summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-09 20:54:56 +0000
committerJeremy Allison <jra@samba.org>2001-10-09 20:54:56 +0000
commited94aa9d611aba4d82e717797565550a4a47270e (patch)
tree0bc55205b9138f2c2749e4adca6d6cdb93710b6b /source3/passdb
parentf55172c51c9bd27c72bf6d7af877926bac90a8f8 (diff)
downloadsamba-ed94aa9d611aba4d82e717797565550a4a47270e.tar.gz
samba-ed94aa9d611aba4d82e717797565550a4a47270e.tar.bz2
samba-ed94aa9d611aba4d82e717797565550a4a47270e.zip
Fixes from John Trostel (modified somewhat by me) to ensure that all lookup_XX
functions correctly deal with the SID_NAME_TYPE. One fix for connection user lookup in LSA. Jeremy. (This used to be commit 29730027d8118ec7d207c89d0fd7fb24ac173fde)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 9269a49e20..fa0dd244d2 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -477,6 +477,8 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
{
BOOL is_user = pdb_rid_is_user(rid);
+ *psid_name_use = SID_NAME_UNKNOWN;
+
DEBUG(5,("local_lookup_rid: looking up %s RID %u.\n", is_user ? "user" :
"group", (unsigned int)rid));
@@ -484,11 +486,13 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
if(rid == DOMAIN_USER_RID_ADMIN) {
pstring admin_users;
char *p = admin_users;
+ *psid_name_use = SID_NAME_USER;
if(!next_token(&p, name, NULL, sizeof(fstring)))
fstrcpy(name, "Administrator");
} else if (rid == DOMAIN_USER_RID_GUEST) {
pstring guest_users;
char *p = guest_users;
+ *psid_name_use = SID_NAME_USER;
if(!next_token(&p, name, NULL, sizeof(fstring)))
fstrcpy(name, "Guest");
} else {
@@ -567,6 +571,8 @@ BOOL local_lookup_name(const char *c_domain, const char *c_user, DOM_SID *psid,
fstring user;
fstring domain;
+ *psid_name_use = SID_NAME_UNKNOWN;
+
/*
* domain and user may be quoted const strings, and map_username and
* friends can modify them. Make a modifiable copy. JRA.
@@ -670,6 +676,8 @@ BOOL local_sid_to_uid(uid_t *puid, DOM_SID *psid, enum SID_NAME_USE *name_type)
DEBUG(10,("local_sid_to_uid: SID %s -> uid (%u) (%s).\n", sid_to_string( str, psid),
(unsigned int)*puid, pass->pw_name ));
+ *name_type = SID_NAME_USER;
+
return True;
}
@@ -727,6 +735,8 @@ BOOL local_sid_to_gid(gid_t *pgid, DOM_SID *psid, enum SID_NAME_USE *name_type)
DEBUG(10,("local_sid_to_gid: SID %s -> gid (%u) (%s).\n", sid_to_string( str, psid),
(unsigned int)*pgid, grp->gr_name ));
+ *name_type = SID_NAME_ALIAS;
+
return True;
}