diff options
author | Gerald Carter <jerry@samba.org> | 2006-02-11 21:27:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:04 -0500 |
commit | 75ef18fa7510d894ccc4540d82616110c3166db3 (patch) | |
tree | 7a3e2e31489f614a48262525228187bdffabe1e4 /source3/lib | |
parent | 85160e654e5a1fc4fcb0d6cecc5187cc3b62f6d7 (diff) | |
download | samba-75ef18fa7510d894ccc4540d82616110c3166db3.tar.gz samba-75ef18fa7510d894ccc4540d82616110c3166db3.tar.bz2 samba-75ef18fa7510d894ccc4540d82616110c3166db3.zip |
r13460: by popular demand....
* remove pdb_context data structure
* set default group for DOMAIN_RID_GUEST user as RID 513 (just
like Windows)
* Allow RID 513 to resolve to always resolve to a name
* Remove auto mapping of guest account primary group given the
previous 2 changes
(This used to be commit 7a2da5f0cc05c1920c664c9a690a23bdf854e285)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/system_smbd.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c index 1d4f88fbb9..3fc2d69a03 100644 --- a/source3/lib/system_smbd.c +++ b/source3/lib/system_smbd.c @@ -209,9 +209,30 @@ NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods, size_t i; gid_t gid; - if (!sid_to_gid(pdb_get_group_sid(user), &gid)) { - DEBUG(10, ("sid_to_gid failed\n")); - return NT_STATUS_NO_SUCH_USER; + if ( !sid_to_gid(pdb_get_group_sid(user), &gid) ) + { + uint32 rid; + struct passwd *pwd; + + /* second try, allow the DOMAIN_USERS group to pass */ + + if ( !sid_peek_check_rid( get_global_sam_sid(), pdb_get_group_sid(user), &rid ) ) + return NT_STATUS_NO_SUCH_USER; + + if ( rid != DOMAIN_GROUP_RID_USERS ) { + DEBUG(10, ("sid_to_gid failed\n")); + return NT_STATUS_NO_SUCH_USER; + } + + DEBUG(5,("pdb_default_enum_group_memberships: sid_to_gid() failed but giving " + "free pass to 'Domain Users' as primary group\n")); + + if ( !(pwd = getpwnam_alloc( NULL, pdb_get_username(user) ) ) ) + return NT_STATUS_NO_SUCH_USER; + + gid = pwd->pw_gid; + + TALLOC_FREE( pwd ); } if (!getgroups_unix_user(mem_ctx, pdb_get_username(user), gid, |