summaryrefslogtreecommitdiffstats
path: root/source/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-03-02 18:33:43 +0000
committerVolker Lendecke <vlendec@samba.org>2006-03-02 18:33:43 +0000
commitcfdc82d521149a64f67b191343221ab273e8bd6d (patch)
treebd5f165afa20746c4c121c03c16e996cf4baced0 /source/passdb
parentbf33b637fd33e3e845cef69964421581b826a05e (diff)
downloadsamba-cfdc82d521149a64f67b191343221ab273e8bd6d.tar.gz
samba-cfdc82d521149a64f67b191343221ab273e8bd6d.tar.xz
samba-cfdc82d521149a64f67b191343221ab273e8bd6d.zip
r13791: Having S-1-1-0 show up in winbind lookupsid does not really make sense.
Volker
Diffstat (limited to 'source/passdb')
-rw-r--r--source/passdb/lookup_sid.c10
-rw-r--r--source/passdb/util_wellknown.c11
2 files changed, 18 insertions, 3 deletions
diff --git a/source/passdb/lookup_sid.c b/source/passdb/lookup_sid.c
index 3d1805525a1..942d2771782 100644
--- a/source/passdb/lookup_sid.c
+++ b/source/passdb/lookup_sid.c
@@ -1191,9 +1191,13 @@ BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid)
goto done;
}
- if (sid_check_is_in_builtin(psid) && pdb_getgrsid(&map, *psid)) {
- *pgid = map.gid;
- goto done;
+ if ((sid_check_is_in_builtin(psid) ||
+ sid_check_is_in_wellknown_domain(psid))) {
+ if (pdb_getgrsid(&map, *psid)) {
+ *pgid = map.gid;
+ goto done;
+ }
+ return False;
}
if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) {
diff --git a/source/passdb/util_wellknown.c b/source/passdb/util_wellknown.c
index be3cf374469..9a6fa7def52 100644
--- a/source/passdb/util_wellknown.c
+++ b/source/passdb/util_wellknown.c
@@ -85,6 +85,17 @@ BOOL sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name)
return False;
}
+BOOL sid_check_is_in_wellknown_domain(const DOM_SID *sid)
+{
+ DOM_SID dom_sid;
+ uint32 rid;
+
+ sid_copy(&dom_sid, sid);
+ sid_split_rid(&dom_sid, &rid);
+
+ return sid_check_is_wellknown_domain(&dom_sid, NULL);
+}
+
/**************************************************************************
Looks up a known username from one of the known domains.
***************************************************************************/