1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

Implement Metze's suggestion of trying getpwuid(0) then getpwnam(root).

Jeremy.
This commit is contained in:
Jeremy Allison 2009-08-22 09:40:58 -07:00
parent 1fb916babd
commit da9356711b

View File

@ -91,17 +91,13 @@ NT_USER_TOKEN *get_root_nt_token( void )
cache_data, struct nt_user_token);
}
#if defined(DEVELOPER)
if ( !(pw = sys_getpwnam("root")) ) {
DEBUG(0,("get_root_nt_token: sys_getpwnam(\"root\") failed!\n"));
return NULL;
}
#else
if ( !(pw = sys_getpwuid(0)) ) {
DEBUG(0,("get_root_nt_token: sys_getpwuid(0) failed!\n"));
return NULL;
if ( !(pw = sys_getpwnam("root")) ) {
DEBUG(0,("get_root_nt_token: both sys_getpwuid(0) "
"and sys_getpwnam(\"root\") failed!\n"));
return NULL;
}
}
#endif
/* get the user and primary group SIDs; although the
BUILTIN\Administrators SId is really the one that matters here */