Skip to content

Commit 809bc15

Browse files
Merge pull request #110 from tgonzalezorlandoarm/tg/remove-users-crate
Remove unmaintained 'users' crate
2 parents 16019af + 6aa4396 commit 809bc15

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ num = "0.4.0"
1717
log = "0.4.17"
1818
derivative = "2.1.1"
1919
zeroize = "1.1.0"
20-
users = "0.11.0"
2120
url = "2.2.0"
2221
spiffe = { version = "0.2.0", optional = true }
22+
libc = "0.2.147"
2323

2424
[dev-dependencies]
2525
mockstream = "0.0.3"

src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl TryFrom<&Authentication> for RequestAuth {
4949
Authentication::None => Ok(RequestAuth::new(Vec::new())),
5050
Authentication::Direct(name) => Ok(RequestAuth::new(name.bytes().collect())),
5151
Authentication::UnixPeerCredentials => {
52-
let current_uid = users::get_current_uid();
52+
let current_uid: libc::uid_t = unsafe { libc::getuid() };
5353
Ok(RequestAuth::new(current_uid.to_le_bytes().to_vec()))
5454
}
5555
#[cfg(feature = "spiffe-auth")]

src/core/testing/core_tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,9 @@ fn peer_credential_auth_test() {
854854
.expect("Failed to call destroy key");
855855

856856
let req = get_req_from_bytes(client.get_mock_write());
857+
let current_uid: libc::uid_t = unsafe { libc::getuid() };
857858
assert_eq!(
858-
&users::get_current_uid().to_le_bytes().to_vec(),
859+
&current_uid.to_le_bytes().to_vec(),
859860
req.auth.buffer.expose_secret()
860861
);
861862
}

0 commit comments

Comments
 (0)