s3-auth Rename NT_USER_TOKEN user_sids -> sids
authorAndrew Bartlett <abartlet@samba.org>
Mon, 30 Aug 2010 23:32:52 +0000 (09:32 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 31 Aug 2010 00:20:14 +0000 (10:20 +1000)
This is closer to the struct security_token from security.idl

15 files changed:
source3/auth/auth_util.c
source3/auth/token_util.c
source3/include/smb.h
source3/lib/util_nttoken.c
source3/lib/util_sid.c
source3/libgpo/gpo_reg.c
source3/modules/vfs_acl_common.c
source3/modules/vfs_smb_traffic_analyzer.c
source3/registry/reg_util_token.c
source3/smbd/service.c
source3/smbd/trans2.c
source3/smbd/uid.c
source3/utils/net_ads_gpo.c
source3/utils/net_rpc.c
source3/winbindd/winbindd_pam.c

index 23f557a3169ec6338286f26df289858fcadcf88b..3b07bad6bf86d3cfa8abfe95e5837eb22754a79c 100644 (file)
@@ -405,12 +405,12 @@ static NTSTATUS log_nt_token(NT_USER_TOKEN *token)
        for (i=1; i<token->num_sids; i++) {
                group_sidstr = talloc_asprintf(
                        frame, "%s %s", group_sidstr,
-                       sid_string_talloc(frame, &token->user_sids[i]));
+                       sid_string_talloc(frame, &token->sids[i]));
        }
 
        command = talloc_string_sub(
                frame, lp_log_nt_token_command(),
-               "%s", sid_string_talloc(frame, &token->user_sids[0]));
+               "%s", sid_string_talloc(frame, &token->sids[0]));
        command = talloc_string_sub(frame, command, "%t", group_sidstr);
 
        if (command == NULL) {
@@ -477,7 +477,7 @@ NTSTATUS create_local_token(struct auth_serversupplied_info *server_info)
 
        for (i=1; i<server_info->ptok->num_sids; i++) {
                gid_t gid;
-               struct dom_sid *sid = &server_info->ptok->user_sids[i];
+               struct dom_sid *sid = &server_info->ptok->sids[i];
 
                if (!sid_to_gid(sid, &gid)) {
                        DEBUG(10, ("Could not convert SID %s to gid, "
@@ -505,13 +505,13 @@ NTSTATUS create_local_token(struct auth_serversupplied_info *server_info)
        uid_to_unix_users_sid(server_info->utok.uid, &tmp_sid);
 
        add_sid_to_array_unique(server_info->ptok, &tmp_sid,
-                               &server_info->ptok->user_sids,
+                               &server_info->ptok->sids,
                                &server_info->ptok->num_sids);
 
        for ( i=0; i<server_info->utok.ngroups; i++ ) {
                gid_to_unix_groups_sid(server_info->utok.groups[i], &tmp_sid);
                add_sid_to_array_unique(server_info->ptok, &tmp_sid,
-                                       &server_info->ptok->user_sids,
+                                       &server_info->ptok->sids,
                                        &server_info->ptok->num_sids);
        }
 
index 8f66171e407a0d50a97c9886e31c88725657e135..87022fb1e4f12acb734e81eb782612fd3fd7fbf4 100644 (file)
@@ -42,7 +42,7 @@ bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token
                return False;
 
        for ( i=0; i<token->num_sids; i++ ) {
-               if ( sid_equal( sid, &token->user_sids[i] ) )
+               if ( sid_equal( sid, &token->sids[i] ) )
                        return True;
        }
 
@@ -144,7 +144,7 @@ NTSTATUS add_aliases(const struct dom_sid *domain_sid,
        num_aliases = 0;
 
        status = pdb_enum_alias_memberships(tmp_ctx, domain_sid,
-                                           token->user_sids,
+                                           token->sids,
                                            token->num_sids,
                                            &aliases, &num_aliases);
 
@@ -158,7 +158,7 @@ NTSTATUS add_aliases(const struct dom_sid *domain_sid,
                struct dom_sid alias_sid;
                sid_compose(&alias_sid, domain_sid, aliases[i]);
                status = add_sid_to_array_unique(token, &alias_sid,
-                                                &token->user_sids,
+                                                &token->sids,
                                                 &token->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("add_sid_to_array failed\n"));
@@ -200,7 +200,7 @@ static NTSTATUS add_builtin_administrators(struct nt_user_token *token,
        if ( nt_token_check_sid( &domadm, token ) ) {
                status = add_sid_to_array(token,
                                          &global_sid_Builtin_Administrators,
-                                         &token->user_sids, &token->num_sids);
+                                         &token->sids, &token->num_sids);
        if (!NT_STATUS_IS_OK(status)) {
                        return status;
                }
@@ -365,8 +365,8 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
        /* check if the user rid is the special "Domain Guests" rid.
         * If so pick the first sid for the extra sids instead as it
         * is a local fake account */
-       usrtok->user_sids = talloc_array(usrtok, struct dom_sid, 2);
-       if (!usrtok->user_sids) {
+       usrtok->sids = talloc_array(usrtok, struct dom_sid, 2);
+       if (!usrtok->sids) {
                TALLOC_FREE(usrtok);
                return NT_STATUS_NO_MEMORY;
        }
@@ -383,10 +383,10 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
                        TALLOC_FREE(usrtok);
                        return NT_STATUS_UNSUCCESSFUL;
                }
-               sid_copy(&usrtok->user_sids[0], &extra->user_sid);
+               sid_copy(&usrtok->sids[0], &extra->user_sid);
        } else {
-               sid_copy(&usrtok->user_sids[0], info3->base.domain_sid);
-               sid_append_rid(&usrtok->user_sids[0], info3->base.rid);
+               sid_copy(&usrtok->sids[0], info3->base.domain_sid);
+               sid_append_rid(&usrtok->sids[0], info3->base.rid);
        }
 
        /* GROUP SID */
@@ -400,10 +400,10 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
                        TALLOC_FREE(usrtok);
                        return NT_STATUS_UNSUCCESSFUL;
                }
-               sid_copy(&usrtok->user_sids[1], &extra->pgid_sid);
+               sid_copy(&usrtok->sids[1], &extra->pgid_sid);
        } else {
-               sid_copy(&usrtok->user_sids[1], info3->base.domain_sid);
-               sid_append_rid(&usrtok->user_sids[1],
+               sid_copy(&usrtok->sids[1], info3->base.domain_sid);
+               sid_append_rid(&usrtok->sids[1],
                                info3->base.primary_gid);
        }
 
@@ -420,7 +420,7 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
                sid_append_rid(&tmp_sid, info3->base.groups.rids[i].rid);
 
                status = add_sid_to_array_unique(usrtok, &tmp_sid,
-                                                &usrtok->user_sids,
+                                                &usrtok->sids,
                                                 &usrtok->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(3, ("Failed to add SID to nt token\n"));
@@ -434,7 +434,7 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
        for (i = 0; i < info3->sidcount; i++) {
                status = add_sid_to_array_unique(usrtok,
                                                 info3->sids[i].sid,
-                                                &usrtok->user_sids,
+                                                &usrtok->sids,
                                                 &usrtok->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(3, ("Failed to add SID to nt token\n"));
@@ -479,7 +479,7 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
        /* Add the user and primary group sid */
 
        status = add_sid_to_array(result, user_sid,
-                                 &result->user_sids, &result->num_sids);
+                                 &result->sids, &result->num_sids);
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(result);
                return NULL;
@@ -488,7 +488,7 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
        /* For guest, num_groupsids may be zero. */
        if (num_groupsids) {
                status = add_sid_to_array(result, &groupsids[0],
-                                         &result->user_sids,
+                                         &result->sids,
                                          &result->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(result);
@@ -504,7 +504,7 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
 
        for (i=1; i<num_groupsids; i++) {
                status = add_sid_to_array_unique(result, &groupsids[i],
-                                                &result->user_sids,
+                                                &result->sids,
                                                 &result->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(result);
@@ -531,19 +531,19 @@ static NTSTATUS finalize_local_nt_token(struct nt_user_token *result,
        /* Add in BUILTIN sids */
 
        status = add_sid_to_array(result, &global_sid_World,
-                                 &result->user_sids, &result->num_sids);
+                                 &result->sids, &result->num_sids);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
        status = add_sid_to_array(result, &global_sid_Network,
-                                 &result->user_sids, &result->num_sids);
+                                 &result->sids, &result->num_sids);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
        if (is_guest) {
                status = add_sid_to_array(result, &global_sid_Builtin_Guests,
-                                         &result->user_sids,
+                                         &result->sids,
                                          &result->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
@@ -551,7 +551,7 @@ static NTSTATUS finalize_local_nt_token(struct nt_user_token *result,
        } else {
                status = add_sid_to_array(result,
                                          &global_sid_Authenticated_Users,
-                                         &result->user_sids,
+                                         &result->sids,
                                          &result->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
@@ -642,7 +642,7 @@ static NTSTATUS finalize_local_nt_token(struct nt_user_token *result,
 
        /* Add privileges based on current user sids */
 
-       get_privileges_for_sids(&result->privileges, result->user_sids,
+       get_privileges_for_sids(&result->privileges, result->sids,
                                result->num_sids);
 
        return NT_STATUS_OK;
@@ -663,13 +663,13 @@ void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token)
 
        DEBUGC(dbg_class, dbg_lev,
               ("NT user token of user %s\n",
-               sid_string_dbg(&token->user_sids[0]) ));
+               sid_string_dbg(&token->sids[0]) ));
        DEBUGADDC(dbg_class, dbg_lev,
                  ("contains %lu SIDs\n", (unsigned long)token->num_sids));
        for (i = 0; i < token->num_sids; i++)
                DEBUGADDC(dbg_class, dbg_lev,
                          ("SID[%3lu]: %s\n", (unsigned long)i,
-                          sid_string_dbg(&token->user_sids[i])));
+                          sid_string_dbg(&token->sids[i])));
 
        dump_se_priv( dbg_class, dbg_lev, &token->privileges );
 }
index 74f1eb535ad1bdabd771becf9cb45fca1c362c07..011851ab814274d101c4aaf2c63549c50453ef2c 100644 (file)
@@ -233,7 +233,7 @@ extern const struct dom_sid global_sid_Unix_Groups;
 
 typedef struct nt_user_token {
        size_t num_sids;
-       struct dom_sid *user_sids;
+       struct dom_sid *sids;
        SE_PRIV privileges;
 } NT_USER_TOKEN;
 
index 04c7e4f1576cff32f49cc7252f17dccb2dee53c3..60ce8e76187b1f84b37cea6aac69eb75bcb2ce89 100644 (file)
@@ -44,11 +44,11 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, const NT_USER_TOKEN *ptoken)
                return NULL;
        }
 
-       if (ptoken->user_sids && ptoken->num_sids) {
-               token->user_sids = (struct dom_sid *)talloc_memdup(
-                       token, ptoken->user_sids, sizeof(struct dom_sid) * ptoken->num_sids );
+       if (ptoken->sids && ptoken->num_sids) {
+               token->sids = (struct dom_sid *)talloc_memdup(
+                       token, ptoken->sids, sizeof(struct dom_sid) * ptoken->num_sids );
 
-               if (token->user_sids == NULL) {
+               if (token->sids == NULL) {
                        DEBUG(0, ("talloc_memdup failed\n"));
                        TALLOC_FREE(token);
                        return NULL;
@@ -88,8 +88,8 @@ NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx,
 
        for (i=0; i < token_1->num_sids; i++) {
                status = add_sid_to_array_unique(mem_ctx,
-                                                &token_1->user_sids[i],
-                                                &token->user_sids,
+                                                &token_1->sids[i],
+                                                &token->sids,
                                                 &token->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(token);
@@ -99,8 +99,8 @@ NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx,
 
        for (i=0; i < token_2->num_sids; i++) {
                status = add_sid_to_array_unique(mem_ctx,
-                                                &token_2->user_sids[i],
-                                                &token->user_sids,
+                                                &token_2->sids[i],
+                                                &token->sids,
                                                 &token->num_sids);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(token);
@@ -125,7 +125,7 @@ bool token_sid_in_ace(const NT_USER_TOKEN *token, const struct security_ace *ace
        size_t i;
 
        for (i = 0; i < token->num_sids; i++) {
-               if (sid_equal(&ace->trustee, &token->user_sids[i]))
+               if (sid_equal(&ace->trustee, &token->sids[i]))
                        return true;
        }
 
index 31a4c06c24d736404afdd92bab724f8f9131964b..3874d3d20ce0a90cbf05ac6d5957fec2ebb3379c 100644 (file)
@@ -673,7 +673,7 @@ bool is_sid_in_token(const NT_USER_TOKEN *token, const struct dom_sid *sid)
         int i;
 
         for (i=0; i<token->num_sids; i++) {
-                if (sid_compare(sid, &token->user_sids[i]) == 0)
+                if (sid_compare(sid, &token->sids[i]) == 0)
                         return true;
         }
         return false;
index 5b56ecd365df813172010536eaa333f225204500..10c4160b02a61175b59de5793cfc0d2880b53a72 100644 (file)
@@ -40,7 +40,7 @@ struct nt_user_token *registry_create_system_token(TALLOC_CTX *mem_ctx)
        token->privileges = se_priv_all;
 
        if (!NT_STATUS_IS_OK(add_sid_to_array(token, &global_sid_System,
-                        &token->user_sids, &token->num_sids))) {
+                        &token->sids, &token->num_sids))) {
                DEBUG(1,("Error adding nt-authority system sid to token\n"));
                return NULL;
        }
@@ -319,7 +319,7 @@ static WERROR gp_reg_del_groupmembership(TALLOC_CTX *mem_ctx,
 {
        const char *path = NULL;
 
-       path = gp_reg_groupmembership_path(mem_ctx, &token->user_sids[0],
+       path = gp_reg_groupmembership_path(mem_ctx, &token->sids[0],
                                           flags);
        W_ERROR_HAVE_NO_MEMORY(path);
 
@@ -343,7 +343,7 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx,
        const char *val = NULL;
        int count = 0;
 
-       path = gp_reg_groupmembership_path(mem_ctx, &token->user_sids[0],
+       path = gp_reg_groupmembership_path(mem_ctx, &token->sids[0],
                                           flags);
        W_ERROR_HAVE_NO_MEMORY(path);
 
@@ -358,7 +358,7 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx,
                valname = talloc_asprintf(mem_ctx, "Group%d", count++);
                W_ERROR_HAVE_NO_MEMORY(valname);
 
-               val = sid_string_talloc(mem_ctx, &token->user_sids[i]);
+               val = sid_string_talloc(mem_ctx, &token->sids[i]);
                W_ERROR_HAVE_NO_MEMORY(val);
                werr = gp_store_reg_val_sz(mem_ctx, key, valname, val);
                W_ERROR_NOT_OK_RETURN(werr);
@@ -410,7 +410,7 @@ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx,
                werr = gp_read_reg_val_sz(mem_ctx, key, valname, &val);
                W_ERROR_NOT_OK_RETURN(werr);
 
-               if (!string_to_sid(&tmp_token->user_sids[num_token_sids++],
+               if (!string_to_sid(&tmp_token->sids[num_token_sids++],
                                   val)) {
                        return WERR_INSUFFICIENT_BUFFER;
                }
@@ -468,7 +468,7 @@ WERROR gp_reg_state_store(TALLOC_CTX *mem_ctx,
        W_ERROR_NOT_OK_RETURN(werr);
 
        werr = gp_secure_key(mem_ctx, flags, reg_ctx->curr_key,
-                            &token->user_sids[0]);
+                            &token->sids[0]);
        if (!W_ERROR_IS_OK(werr)) {
                DEBUG(0,("failed to secure key: %s\n", win_errstr(werr)));
                goto done;
@@ -480,7 +480,7 @@ WERROR gp_reg_state_store(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       subkeyname = gp_req_state_path(mem_ctx, &token->user_sids[0], flags);
+       subkeyname = gp_req_state_path(mem_ctx, &token->sids[0], flags);
        if (!subkeyname) {
                werr = WERR_NOMEM;
                goto done;
@@ -979,7 +979,7 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
                case GP_REG_ACTION_SEC_KEY_SET:
                        werr = gp_secure_key(mem_ctx, flags,
                                             key,
-                                            &token->user_sids[0]);
+                                            &token->sids[0]);
                        if (!W_ERROR_IS_OK(werr)) {
                                DEBUG(0,("reg_apply_registry_entry: "
                                        "gp_secure_key failed: %s\n",
index 46ff2e6f0c14acaf85be4c86a6ce8cfb796faaff..e759dc2df3f3b1e82d9b19229fe426c7733377b9 100644 (file)
@@ -422,8 +422,8 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle,
                        &psd,
                        &size,
                        parent_desc,
-                       &handle->conn->server_info->ptok->user_sids[PRIMARY_USER_SID_INDEX],
-                       &handle->conn->server_info->ptok->user_sids[PRIMARY_GROUP_SID_INDEX],
+                       &handle->conn->server_info->ptok->sids[PRIMARY_USER_SID_INDEX],
+                       &handle->conn->server_info->ptok->sids[PRIMARY_GROUP_SID_INDEX],
                        is_directory);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
index 53ea5f9339dffcf37f75c2a8dcd1f84e00fa21fa..a5e1f5e6f679fe9e09785759c057e90c325e5366 100644 (file)
@@ -330,7 +330,7 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
         * anonymized if needed, by the calling function.
         */
        usersid = dom_sid_string( common_data_count_str,
-               &handle->conn->server_info->ptok->user_sids[0]);
+               &handle->conn->server_info->ptok->sids[0]);
 
        sidstr = smb_traffic_analyzer_anonymize(
                common_data_count_str,
index f218dfa472b43f7ee1595b44a09e8a9dfa321e22..995b0d832245b2f3ffb630471ec8c72482c135bd 100644 (file)
@@ -45,7 +45,7 @@ NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
        }
        token->privileges = se_disk_operators;
        status = add_sid_to_array(token, &global_sid_Builtin_Administrators,
-                                 &token->user_sids, &token->num_sids);
+                                 &token->sids, &token->num_sids);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("Error adding builtin administrators sid "
                          "to fake token.\n"));
index d39557285629501bf8717a57ffaf737d540ae5d0..675ae2b0d5644a306f3f6384152e0ba35bcf5315 100644 (file)
@@ -759,7 +759,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
 
                status = find_forced_group(
                        conn->force_user, snum, conn->server_info->unix_name,
-                       &conn->server_info->ptok->user_sids[1],
+                       &conn->server_info->ptok->sids[1],
                        &conn->server_info->utok.gid);
 
                if (!NT_STATUS_IS_OK(status)) {
index 4ecf08a479e9db53a47662d1f686f85833053d92..304476476e6bbf96a8140dd7dfd7b9c23757f219 100644 (file)
@@ -3406,7 +3406,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
                        for (i = 0, sid_bytes = 0;
                             i < conn->server_info->ptok->num_sids; ++i) {
                                sid_bytes += ndr_size_dom_sid(
-                                       &conn->server_info->ptok->user_sids[i],
+                                       &conn->server_info->ptok->sids[i],
                                        0);
                        }
 
@@ -3428,11 +3428,11 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
                        for (i = 0;
                            i < conn->server_info->ptok->num_sids; ++i) {
                                int sid_len = ndr_size_dom_sid(
-                                       &conn->server_info->ptok->user_sids[i],
+                                       &conn->server_info->ptok->sids[i],
                                        0);
 
                                sid_linearize(pdata + data_len, sid_len,
-                                   &conn->server_info->ptok->user_sids[i]);
+                                   &conn->server_info->ptok->sids[i]);
                                data_len += sid_len;
                        }
 
index c7c216b66f9d72fe1cd627142bb68e2db2e99e4a..d7ede293c1980ef66925a37d01fb6a8fce41b58c 100644 (file)
@@ -325,14 +325,14 @@ bool change_to_user(connection_struct *conn, uint16 vuid)
                                                conn->force_group_gid;
                                        gid = conn->force_group_gid;
                                        gid_to_sid(&conn->server_info->ptok
-                                                  ->user_sids[1], gid);
+                                                  ->sids[1], gid);
                                        break;
                                }
                        }
                } else {
                        conn->server_info->utok.gid = conn->force_group_gid;
                        gid = conn->force_group_gid;
-                       gid_to_sid(&conn->server_info->ptok->user_sids[1],
+                       gid_to_sid(&conn->server_info->ptok->sids[1],
                                   gid);
                }
        }
index 57396c76e303df24dcbd7a559edc72a71f9b47eb..d6f392ae7ef64419c42fe5325cac9e3d384370b2 100644 (file)
@@ -157,7 +157,7 @@ static int net_ads_gpo_refresh(struct net_context *c, int argc, const char **arg
 
        {
                WERROR werr = gp_reg_state_read(mem_ctx, flags,
-                                               &token->user_sids[0],
+                                               &token->sids[0],
                                                &read_list);
                if (!W_ERROR_IS_OK(werr)) {
                        d_printf(_("failed: %s\n"), win_errstr(werr));
index fe94f7ec88771666ec6490bdaa70dccfe42b01aa..4dd00d3dc293898e3f10cd8f6712893bcd58c5bb 100644 (file)
@@ -4118,21 +4118,21 @@ static void init_user_token(NT_USER_TOKEN *token, struct dom_sid *user_sid)
 {
        token->num_sids = 4;
 
-       if (!(token->user_sids = SMB_MALLOC_ARRAY(struct dom_sid, 4))) {
+       if (!(token->sids = SMB_MALLOC_ARRAY(struct dom_sid, 4))) {
                d_fprintf(stderr, "malloc %s\n",_("failed"));
                token->num_sids = 0;
                return;
        }
 
-       token->user_sids[0] = *user_sid;
-       sid_copy(&token->user_sids[1], &global_sid_World);
-       sid_copy(&token->user_sids[2], &global_sid_Network);
-       sid_copy(&token->user_sids[3], &global_sid_Authenticated_Users);
+       token->sids[0] = *user_sid;
+       sid_copy(&token->sids[1], &global_sid_World);
+       sid_copy(&token->sids[2], &global_sid_Network);
+       sid_copy(&token->sids[3], &global_sid_Authenticated_Users);
 }
 
 static void free_user_token(NT_USER_TOKEN *token)
 {
-       SAFE_FREE(token->user_sids);
+       SAFE_FREE(token->sids);
 }
 
 static void add_sid_to_token(NT_USER_TOKEN *token, struct dom_sid *sid)
@@ -4140,12 +4140,12 @@ static void add_sid_to_token(NT_USER_TOKEN *token, struct dom_sid *sid)
        if (is_sid_in_token(token, sid))
                return;
 
-       token->user_sids = SMB_REALLOC_ARRAY(token->user_sids, struct dom_sid, token->num_sids+1);
-       if (!token->user_sids) {
+       token->sids = SMB_REALLOC_ARRAY(token->sids, struct dom_sid, token->num_sids+1);
+       if (!token->sids) {
                return;
        }
 
-       sid_copy(&token->user_sids[token->num_sids], sid);
+       sid_copy(&token->sids[token->num_sids], sid);
 
        token->num_sids += 1;
 }
@@ -4162,7 +4162,7 @@ static void dump_user_token(struct user_token *token)
        d_printf("%s\n", token->name);
 
        for (i=0; i<token->token.num_sids; i++) {
-               d_printf(" %s\n", sid_string_tos(&token->token.user_sids[i]));
+               d_printf(" %s\n", sid_string_tos(&token->token.sids[i]));
        }
 }
 
@@ -4201,7 +4201,7 @@ static void collect_alias_memberships(NT_USER_TOKEN *token)
        int i;
 
        for (i=0; i<num_global_sids; i++) {
-               collect_sid_memberships(token, token->user_sids[i]);
+               collect_sid_memberships(token, token->sids[i]);
        }
 }
 
@@ -4410,7 +4410,7 @@ static bool get_user_tokens_from_file(FILE *f,
 
                fstrcpy(token->name, line);
                token->token.num_sids = 0;
-               token->token.user_sids = NULL;
+               token->token.sids = NULL;
                continue;
        }
        
index be3b2a5c775e7f32ceecc16364374c3abd112e4d..f9b1ab925a2274af998720e87f56ad01b16754ae 100644 (file)
@@ -303,7 +303,7 @@ static NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
        }
 
        status = sid_array_from_info3(talloc_tos(), info3,
-                                     &token->user_sids,
+                                     &token->sids,
                                      &token->num_sids,
                                      true, false);
        if (!NT_STATUS_IS_OK(status)) {