File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ num = "0.4.0"
1717log = " 0.4.17"
1818derivative = " 2.1.1"
1919zeroize = " 1.1.0"
20- users = " 0.11.0"
2120url = " 2.2.0"
2221spiffe = { version = " 0.2.0" , optional = true }
22+ libc = " 0.2.147"
2323
2424[dev-dependencies ]
2525mockstream = " 0.0.3"
Original file line number Diff line number Diff 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" ) ]
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments