[SCM] Samba Shared Repository - branch v4-1-test updated
Stefan Metzmacher
metze at samba.org
Mon Aug 17 18:02:09 UTC 2015
The branch, v4-1-test has been updated
via 0c640d0 s3-net: use talloc array in share allowedusers
from 49e39b0 s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-1-test
- Log -----------------------------------------------------------------
commit 0c640d097fe6f83f3585d76f875c5fb0cade26af
Author: Ralph Boehme <slow at samba.org>
Date: Tue Aug 4 11:18:34 2015 +0200
s3-net: use talloc array in share allowedusers
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11426
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Aug 4 16:48:36 CEST 2015 on sn-devel-104
(cherry picked from commit 95eb6db580678a29b1f5f30a9567ea449a43d75a)
Autobuild-User(v4-1-test): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(v4-1-test): Mon Aug 17 20:01:19 CEST 2015 on sn-devel-104
-----------------------------------------------------------------------
Summary of changes:
source3/utils/net_rpc.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index c5c4d6c..48c85c2 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -4342,10 +4342,25 @@ static struct full_alias *server_aliases;
/*
* Add an alias to the static list.
*/
-static void push_alias(TALLOC_CTX *mem_ctx, struct full_alias *alias)
+static void push_alias(struct full_alias *alias)
{
- if (server_aliases == NULL)
- server_aliases = SMB_MALLOC_ARRAY(struct full_alias, 100);
+ size_t array_size;
+
+ if (server_aliases == NULL) {
+ server_aliases = talloc_array(NULL, struct full_alias, 100);
+ if (server_aliases == NULL) {
+ smb_panic("talloc_array failed");
+ }
+ }
+
+ array_size = talloc_array_length(server_aliases);
+ if (array_size == num_server_aliases) {
+ server_aliases = talloc_realloc(NULL, server_aliases,
+ struct full_alias, array_size + 100);
+ if (server_aliases == NULL) {
+ smb_panic("talloc_realloc failed");
+ }
+ }
server_aliases[num_server_aliases] = *alias;
num_server_aliases += 1;
@@ -4454,7 +4469,7 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd,
sid_compose(&alias.sid, domain_sid,
groups->entries[i].idx);
- push_alias(mem_ctx, &alias);
+ push_alias(&alias);
}
} while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
@@ -5084,6 +5099,7 @@ static NTSTATUS rpc_share_allowedusers_internals(struct net_context *c,
free_user_token(&tokens[i].token);
}
SAFE_FREE(tokens);
+ TALLOC_FREE(server_aliases);
return nt_status;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list