summaryrefslogtreecommitdiff
path: root/source3/auth/token_util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-08-22 09:40:58 -0700
committerJeremy Allison <jra@samba.org>2009-08-22 09:40:58 -0700
commitda9356711b14d7475bcfe4cf0bb1874c018db276 (patch)
tree9412463da9411776bcffd0b7f40fa09de922d9ac /source3/auth/token_util.c
parent1fb916babdbfe5eb780d1388b38dc5cc05463819 (diff)
downloadsamba-da9356711b14d7475bcfe4cf0bb1874c018db276.tar.gz
samba-da9356711b14d7475bcfe4cf0bb1874c018db276.tar.bz2
samba-da9356711b14d7475bcfe4cf0bb1874c018db276.zip
Implement Metze's suggestion of trying getpwuid(0) then getpwnam(root).
Jeremy.
Diffstat (limited to 'source3/auth/token_util.c')
-rw-r--r--source3/auth/token_util.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 45b0fe2938..86dae3a08c 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -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 */