@@ -11,15 +11,15 @@ mod parser;
1111use clap:: Command ;
1212use error:: { ParseError , ParseResult } ;
1313use parser:: { Operator , Symbol , UnaryOperator , parse} ;
14+ #[ cfg( not( windows) ) ]
15+ use rustix:: process:: { getegid, geteuid} ;
1416use std:: ffi:: { OsStr , OsString } ;
1517use std:: fs;
1618#[ cfg( unix) ]
1719use std:: os:: unix:: fs:: MetadataExt ;
1820use uucore:: display:: Quotable ;
1921use uucore:: error:: { UResult , USimpleError } ;
2022use uucore:: format_usage;
21- #[ cfg( not( windows) ) ]
22- use uucore:: process:: { getegid, geteuid} ;
2323
2424use uucore:: translate;
2525
@@ -278,9 +278,9 @@ fn path(path: &OsStr, condition: &PathCondition) -> bool {
278278 }
279279
280280 let perm = |metadata : Metadata , p : Permission | {
281- if geteuid ( ) == metadata. uid ( ) {
281+ if geteuid ( ) . as_raw ( ) == metadata. uid ( ) {
282282 metadata. mode ( ) & ( ( p as u32 ) << 6 ) != 0
283- } else if getegid ( ) == metadata. gid ( ) {
283+ } else if getegid ( ) . as_raw ( ) == metadata. gid ( ) {
284284 metadata. mode ( ) & ( ( p as u32 ) << 3 ) != 0
285285 } else {
286286 metadata. mode ( ) & ( p as u32 ) != 0
@@ -309,10 +309,10 @@ fn path(path: &OsStr, condition: &PathCondition) -> bool {
309309 }
310310 PathCondition :: Regular => file_type. is_file ( ) ,
311311 PathCondition :: GroupIdFlag => metadata. mode ( ) & S_ISGID != 0 ,
312- PathCondition :: GroupOwns => metadata. gid ( ) == getegid ( ) ,
312+ PathCondition :: GroupOwns => metadata. gid ( ) == getegid ( ) . as_raw ( ) ,
313313 PathCondition :: SymLink => metadata. file_type ( ) . is_symlink ( ) ,
314314 PathCondition :: Sticky => metadata. mode ( ) & S_ISVTX != 0 ,
315- PathCondition :: UserOwns => metadata. uid ( ) == geteuid ( ) ,
315+ PathCondition :: UserOwns => metadata. uid ( ) == geteuid ( ) . as_raw ( ) ,
316316 PathCondition :: Fifo => file_type. is_fifo ( ) ,
317317 PathCondition :: Readable => perm ( metadata, Permission :: Read ) ,
318318 PathCondition :: Socket => file_type. is_socket ( ) ,
0 commit comments