Skip to content

Commit

Permalink
Merge pull request #110 from tgonzalezorlandoarm/tg/remove-users-crate
Browse files Browse the repository at this point in the history
Remove unmaintained 'users' crate
  • Loading branch information
gowthamsk-arm authored Aug 10, 2023
2 parents 16019af + 6aa4396 commit 809bc15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ num = "0.4.0"
log = "0.4.17"
derivative = "2.1.1"
zeroize = "1.1.0"
users = "0.11.0"
url = "2.2.0"
spiffe = { version = "0.2.0", optional = true }
libc = "0.2.147"

[dev-dependencies]
mockstream = "0.0.3"
Expand Down
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl TryFrom<&Authentication> for RequestAuth {
Authentication::None => Ok(RequestAuth::new(Vec::new())),
Authentication::Direct(name) => Ok(RequestAuth::new(name.bytes().collect())),
Authentication::UnixPeerCredentials => {
let current_uid = users::get_current_uid();
let current_uid: libc::uid_t = unsafe { libc::getuid() };
Ok(RequestAuth::new(current_uid.to_le_bytes().to_vec()))
}
#[cfg(feature = "spiffe-auth")]
Expand Down
3 changes: 2 additions & 1 deletion src/core/testing/core_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,9 @@ fn peer_credential_auth_test() {
.expect("Failed to call destroy key");

let req = get_req_from_bytes(client.get_mock_write());
let current_uid: libc::uid_t = unsafe { libc::getuid() };
assert_eq!(
&users::get_current_uid().to_le_bytes().to_vec(),
&current_uid.to_le_bytes().to_vec(),
req.auth.buffer.expose_secret()
);
}
Expand Down

0 comments on commit 809bc15

Please sign in to comment.