s3: Fallback to the legacy sid_to_(uid|gid) instead of returning NULL.
authorAravind Srinivasan <aravind.srinivasan@isilon.com>
Thu, 16 Apr 2009 20:42:40 +0000 (20:42 +0000)
committerTim Prouty <tprouty@samba.org>
Wed, 13 May 2009 00:13:40 +0000 (17:13 -0700)
This is very similar to be1dfff02d562e42a7847bd02fed8538630d3f41

source3/passdb/lookup_sid.c
source3/passdb/pdb_wbc_sam.c

index c1249f5..b45000e 100644 (file)
@@ -1430,13 +1430,10 @@ bool sid_to_uid(const DOM_SID *psid, uid_t *puid)
        if (!ret || expired) {
                /* Not in cache. Ask winbindd. */
                if (!winbind_sid_to_uid(puid, psid)) {
-                       if (!winbind_ping()) {
-                               return legacy_sid_to_uid(psid, puid);
-                       }
-
                        DEBUG(5, ("winbind failed to find a uid for sid %s\n",
                                  sid_string_dbg(psid)));
-                       return false;
+                       /* winbind failed. do legacy */
+                       return legacy_sid_to_uid(psid, puid);
                }
        }
 
@@ -1497,13 +1494,11 @@ bool sid_to_gid(const DOM_SID *psid, gid_t *pgid)
                 * (Idmap will check it is a valid SID and of the right type) */
 
                if ( !winbind_sid_to_gid(pgid, psid) ) {
-                       if (!winbind_ping()) {
-                               return legacy_sid_to_gid(psid, pgid);
-                       }
 
                        DEBUG(10,("winbind failed to find a gid for sid %s\n",
                                  sid_string_dbg(psid)));
-                       return false;
+                       /* winbind failed. do legacy */
+                       return legacy_sid_to_gid(psid, pgid);
                }
        }
 
index e8116d0..9c31a0d 100644 (file)
@@ -81,22 +81,6 @@ static bool pdb_wbc_sam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
        return winbind_gid_to_sid(sid, gid);
 }
 
-static bool pdb_wbc_sam_sid_to_id(struct pdb_methods *methods,
-                                 const DOM_SID *sid,
-                                 union unid_t *id, enum lsa_SidType *type)
-{
-       if (winbind_sid_to_uid(&id->uid, sid)) {
-               *type = SID_NAME_USER;
-       } else if (winbind_sid_to_gid(&id->gid, sid)) {
-               /* We assume all gids are groups, not aliases */
-               *type = SID_NAME_DOM_GRP;
-       } else {
-               return false;
-       }
-
-       return true;
-}
-
 static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods,
                                               TALLOC_CTX *mem_ctx,
                                               const DOM_SID *group,
@@ -430,7 +414,6 @@ static NTSTATUS pdb_init_wbc_sam(struct pdb_methods **pdb_method, const char *lo
        (*pdb_method)->set_account_policy = pdb_wbc_sam_set_account_policy;
        (*pdb_method)->uid_to_sid = pdb_wbc_sam_uid_to_sid;
        (*pdb_method)->gid_to_sid = pdb_wbc_sam_gid_to_sid;
-       (*pdb_method)->sid_to_id = pdb_wbc_sam_sid_to_id;
 
        (*pdb_method)->search_groups = pdb_wbc_sam_search_groups;
        (*pdb_method)->search_aliases = pdb_wbc_sam_search_aliases;