Quite some callers of sid_split_rid do not care about the rid
authorVolker Lendecke <vl@samba.org>
Thu, 10 Mar 2011 15:19:17 +0000 (16:19 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 10 Mar 2011 17:48:34 +0000 (18:48 +0100)
libcli/security/util_sid.c
source3/auth/token_util.c
source3/lib/util_sid.c
source3/libads/ldap.c
source3/passdb/lookup_sid.c
source3/passdb/machine_sid.c
source3/passdb/util_builtin.c
source3/passdb/util_unixsids.c
source3/passdb/util_wellknown.c

index 535e81c..cf1f7f3 100644 (file)
@@ -167,7 +167,9 @@ bool sid_split_rid(struct dom_sid *sid, uint32_t *rid)
 {
        if (sid->num_auths > 0) {
                sid->num_auths--;
-               *rid = sid->sub_auths[sid->num_auths];
+               if (rid != NULL) {
+                       *rid = sid->sub_auths[sid->num_auths];
+               }
                return true;
        }
        return false;
index 4f617c4..4942740 100644 (file)
@@ -849,8 +849,6 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                 * correct info. AD might prohibit winbind looking up that
                 * information. */
 
-               uint32 dummy;
-
                /* We must always assign the *uid. */
                if (!sid_to_uid(&user_sid, uid)) {
                        DEBUG(1, ("winbindd case, sid_to_uid for %s (%s) failed\n",
@@ -868,7 +866,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                }
 
                sid_copy(&group_sids[0], &user_sid);
-               sid_split_rid(&group_sids[0], &dummy);
+               sid_split_rid(&group_sids[0], NULL);
                sid_append_rid(&group_sids[0], DOMAIN_RID_USERS);
 
                if (!sid_to_gid(&group_sids[0], gid)) {
index 0a026a1..f6210c1 100644 (file)
@@ -95,10 +95,9 @@ bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid)
 bool non_mappable_sid(struct dom_sid *sid)
 {
        struct dom_sid dom;
-       uint32 rid;
 
        sid_copy(&dom, sid);
-       sid_split_rid(&dom, &rid);
+       sid_split_rid(&dom, NULL);
 
        if (dom_sid_equal(&dom, &global_sid_Builtin))
                return True;
index c1af5b5..3ce7a7e 100644 (file)
@@ -3644,11 +3644,10 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname)
                 * domsid */
 
                struct dom_sid domsid;
-               uint32 dummy_rid;
 
                sid_copy(&domsid, &tmp_user_sid);
 
-               if (!sid_split_rid(&domsid, &dummy_rid)) {
+               if (!sid_split_rid(&domsid, NULL)) {
                        ads_msgfree(ads, res);
                        return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
                }
index 0901319..23566b6 100644 (file)
@@ -259,7 +259,6 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
 
        if (IS_DC && winbind_lookup_name("", name, &sid, &type)) {
                struct dom_sid dom_sid;
-               uint32 tmp_rid;
                enum lsa_SidType domain_type;
 
                if (type == SID_NAME_DOMAIN) {
@@ -273,7 +272,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
                 * domain it figured out itself. Maybe fix that later... */
 
                sid_copy(&dom_sid, &sid);
-               sid_split_rid(&dom_sid, &tmp_rid);
+               sid_split_rid(&dom_sid, NULL);
 
                if (!winbind_lookup_sid(tmp_ctx, &dom_sid, &domain, NULL,
                                        &domain_type) ||
index 4de51b8..977cd20 100644 (file)
@@ -243,9 +243,8 @@ bool sid_check_is_domain(const struct dom_sid *sid)
 bool sid_check_is_in_our_domain(const struct dom_sid *sid)
 {
        struct dom_sid dom_sid;
-       uint32 rid;
 
        sid_copy(&dom_sid, sid);
-       sid_split_rid(&dom_sid, &rid);
+       sid_split_rid(&dom_sid, NULL);
        return sid_check_is_domain(&dom_sid);
 }
index a2cbbc7..9cd6780 100644 (file)
@@ -115,11 +115,10 @@ bool sid_check_is_builtin(const struct dom_sid *sid)
 bool sid_check_is_in_builtin(const struct dom_sid *sid)
 {
        struct dom_sid dom_sid;
-       uint32 rid;
 
        sid_copy(&dom_sid, sid);
-       sid_split_rid(&dom_sid, &rid);
-       
+       sid_split_rid(&dom_sid, NULL);
+
        return sid_check_is_builtin(&dom_sid);
 }
 
index 1f830b3..00cab22 100644 (file)
@@ -28,10 +28,9 @@ bool sid_check_is_unix_users(const struct dom_sid *sid)
 bool sid_check_is_in_unix_users(const struct dom_sid *sid)
 {
        struct dom_sid dom_sid;
-       uint32 rid;
 
        sid_copy(&dom_sid, sid);
-       sid_split_rid(&dom_sid, &rid);
+       sid_split_rid(&dom_sid, NULL);
 
        return sid_check_is_unix_users(&dom_sid);
 }
@@ -86,10 +85,9 @@ bool sid_check_is_unix_groups(const struct dom_sid *sid)
 bool sid_check_is_in_unix_groups(const struct dom_sid *sid)
 {
        struct dom_sid dom_sid;
-       uint32 rid;
 
        sid_copy(&dom_sid, sid);
-       sid_split_rid(&dom_sid, &rid);
+       sid_split_rid(&dom_sid, NULL);
 
        return sid_check_is_unix_groups(&dom_sid);
 }
index 5ca26db..2d83ebe 100644 (file)
@@ -89,11 +89,10 @@ bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name)
 bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid)
 {
        struct dom_sid dom_sid;
-       uint32 rid;
 
        sid_copy(&dom_sid, sid);
-       sid_split_rid(&dom_sid, &rid);
-       
+       sid_split_rid(&dom_sid, NULL);
+
        return sid_check_is_wellknown_domain(&dom_sid, NULL);
 }