summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-01-24 17:29:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:09 -0500
commit0b3889e346aed9eb49d0a485ba0706a540360c30 (patch)
treed71b21e833b0d1e9d541bd507be10bea6c67dce0 /source3/passdb
parent446a2107e639e4a4e6b94e1c06e791a1012eedd2 (diff)
downloadsamba-0b3889e346aed9eb49d0a485ba0706a540360c30.tar.gz
samba-0b3889e346aed9eb49d0a485ba0706a540360c30.tar.bz2
samba-0b3889e346aed9eb49d0a485ba0706a540360c30.zip
r4964: Fix our lsa lookupsid $OURDOMAINSID-500.
Give the admin-user (rid 500) a chance to be found in passdb, not returning the (possibly obscure) first entry of "admin users" before that. Guenther (This used to be commit d319c0e189bc67a4552dafaff80113603b551eb3)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index bd76941c61..666e5072b6 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -759,24 +759,11 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
DEBUG(5,("local_lookup_sid: looking up RID %u.\n", (unsigned int)rid));
- if (rid == DOMAIN_USER_RID_ADMIN) {
- const char **admin_list = lp_admin_users(-1);
- *psid_name_use = SID_NAME_USER;
- if (admin_list) {
- const char *p = *admin_list;
- if(!next_token(&p, name, NULL, sizeof(fstring)))
- fstrcpy(name, "Administrator");
- } else {
- fstrcpy(name, "Administrator");
- }
- return True;
- }
+ /* see if the passdb can help us with the name of the user */
if (!NT_STATUS_IS_OK(pdb_init_sam(&sam_account))) {
return False;
}
-
- /* see if the passdb can help us with the name of the user */
/* BEING ROOT BLLOCK */
become_root();
@@ -807,6 +794,20 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
return True;
}
+ if (rid == DOMAIN_USER_RID_ADMIN) {
+ const char **admin_list = lp_admin_users(-1);
+ *psid_name_use = SID_NAME_USER;
+ if (admin_list) {
+ const char *p = *admin_list;
+ if(!next_token(&p, name, NULL, sizeof(fstring))) {
+ fstrcpy(name, "Administrator");
+ }
+ } else {
+ fstrcpy(name, "Administrator");
+ }
+ return True;
+ }
+
if (algorithmic_pdb_rid_is_user(rid)) {
uid_t uid;
struct passwd *pw = NULL;