s3-auth: Make server_info const in create_local_token()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 5 Apr 2011 20:46:26 +0000 (06:46 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Apr 2011 22:33:31 +0000 (00:33 +0200)
Andreas Schneider <asn@samba.org> correctly points out that this input
parameter should now be const, and that found a bug where I used then
used it incorrectly as a talloc context.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr  6 00:33:31 CEST 2011 on sn-devel-104

source3/auth/auth_util.c
source3/auth/proto.h

index e2a687ddf400ca232afd959ef70cd7b6adbd5e48..1cc78f07577c3d57eb2a5bb885a1ec7923fe2706 100644 (file)
@@ -443,7 +443,7 @@ static NTSTATUS log_nt_token(struct security_token *token)
  */
 
 NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
-                           struct auth_serversupplied_info *server_info,
+                           const struct auth_serversupplied_info *server_info,
                            DATA_BLOB *session_key,
                            struct auth_serversupplied_info **session_info_out)
 {
@@ -527,9 +527,9 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
                                   "ignoring it\n", sid_string_dbg(sid)));
                        continue;
                }
-               if (!add_gid_to_array_unique(server_info, gid,
-                                       &session_info->utok.groups,
-                                       &session_info->utok.ngroups)) {
+               if (!add_gid_to_array_unique(session_info, gid,
+                                            &session_info->utok.groups,
+                                            &session_info->utok.ngroups)) {
                        return NT_STATUS_NO_MEMORY;
                }
        }
index 15e79dda0a57a404f9b491a0e30b8e173b8fa1e7..b88bb8c62656cf5b51a32cacc6246f6dd6f62e18 100644 (file)
@@ -102,7 +102,7 @@ struct samu;
 NTSTATUS make_server_info_sam(struct auth_serversupplied_info **server_info,
                              struct samu *sampass);
 NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
-                           struct auth_serversupplied_info *server_info,
+                           const struct auth_serversupplied_info *server_info,
                            DATA_BLOB *session_key,
                            struct auth_serversupplied_info **session_info_out);
 NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,