File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -442,8 +442,6 @@ fn do_pre_install_options_sanity_checks(opts: &InstallOpts) -> Result<()> {
442
442
fn do_anti_sudo_check ( no_prompt : bool ) -> Result < ( ) > {
443
443
#[ cfg( unix) ]
444
444
pub fn home_mismatch ( ) -> bool {
445
- use libc as c;
446
-
447
445
use std:: env;
448
446
use std:: ffi:: CStr ;
449
447
use std:: mem;
@@ -460,13 +458,13 @@ fn do_anti_sudo_check(no_prompt: bool) -> Result<()> {
460
458
return false ;
461
459
}
462
460
let mut buf = [ 0u8 ; 1024 ] ;
463
- let mut pwd = unsafe { mem:: uninitialized :: < c :: passwd > ( ) } ;
464
- let mut pwdp: * mut c :: passwd = ptr:: null_mut ( ) ;
461
+ let mut pwd = unsafe { mem:: uninitialized :: < libc :: passwd > ( ) } ;
462
+ let mut pwdp: * mut libc :: passwd = ptr:: null_mut ( ) ;
465
463
let rv = unsafe {
466
- c :: getpwuid_r (
467
- c :: geteuid ( ) ,
464
+ libc :: getpwuid_r (
465
+ libc :: geteuid ( ) ,
468
466
& mut pwd,
469
- mem :: transmute ( & mut buf) ,
467
+ & mut buf as * mut [ u8 ] as * mut i8 ,
470
468
buf. len ( ) ,
471
469
& mut pwdp,
472
470
)
You can’t perform that action at this time.
0 commit comments