The branch, master has been updated
       via  9fbbaa5... s3:passdb: avoid sid_to_gid() if the sid is "domain 
users"
      from  ef1c317... s4:libcli/wrepl: correctly remove the tstream_context 
when the connection is dead

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9fbbaa560ae74f015e404cfa700753c0b5909519
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Mar 25 20:59:49 2010 +0100

    s3:passdb: avoid sid_to_gid() if the sid is "domain users"
    
    If the call fails we would use the "domain users" sid anyway.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/passdb/pdb_get_set.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 8001bbb..4725e8e 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -572,6 +572,7 @@ bool pdb_set_user_sid_from_string(struct samu *sampass, 
fstring u_sid, enum pdb_
 bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum 
pdb_value_state flag)
 {
        gid_t gid;
+       DOM_SID dug_sid;
 
        if (!g_sid)
                return False;
@@ -583,11 +584,14 @@ bool pdb_set_group_sid(struct samu *sampass, const 
DOM_SID *g_sid, enum pdb_valu
        /* if we cannot resolve the SID to gid, then just ignore it and 
           store DOMAIN_USERS as the primary groupSID */
 
-       if ( sid_to_gid( g_sid, &gid ) ) {
+       sid_compose(&dug_sid, get_global_sam_sid(), DOMAIN_GROUP_RID_USERS);
+
+       if (sid_equal(&dug_sid, g_sid)) {
+               sid_copy(sampass->group_sid, &dug_sid);
+       } else if (sid_to_gid( g_sid, &gid ) ) {
                sid_copy(sampass->group_sid, g_sid);
        } else {
-               sid_compose(sampass->group_sid, get_global_sam_sid(),
-                           DOMAIN_GROUP_RID_USERS);
+               sid_copy(sampass->group_sid, &dug_sid);
        }
 
        DEBUG(10, ("pdb_set_group_sid: setting group sid %s\n", 


-- 
Samba Shared Repository

Reply via email to