summaryrefslogtreecommitdiff
path: root/libgpo/gpo_reg.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-12-10 12:34:13 +0100
committerJeremy Allison <jra@samba.org>2018-12-11 00:40:31 +0100
commit9ffa6d49a56f9a55ad34f4c687429c8fd14e9d8c (patch)
tree571992c79b63d42507eb0af115b73e0d7d19cbc5 /libgpo/gpo_reg.c
parent939d64b9f830e9da88caf24d97299e379f3cdcd2 (diff)
downloadsamba-9ffa6d49a56f9a55ad34f4c687429c8fd14e9d8c.tar.gz
libgpo: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libgpo/gpo_reg.c')
-rw-r--r--libgpo/gpo_reg.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libgpo/gpo_reg.c b/libgpo/gpo_reg.c
index 644b4d36d62..a160c3dd03d 100644
--- a/libgpo/gpo_reg.c
+++ b/libgpo/gpo_reg.c
@@ -351,7 +351,6 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx,
uint32_t i = 0;
const char *valname = NULL;
const char *path = NULL;
- const char *val = NULL;
int count = 0;
path = gp_reg_groupmembership_path(mem_ctx, &token->sids[0],
@@ -365,13 +364,16 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx,
W_ERROR_NOT_OK_RETURN(werr);
for (i=0; i<token->num_sids; i++) {
+ struct dom_sid_buf buf;
valname = talloc_asprintf(mem_ctx, "Group%d", count++);
W_ERROR_HAVE_NO_MEMORY(valname);
- 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);
+ werr = gp_store_reg_val_sz(
+ mem_ctx,
+ key,
+ valname,
+ dom_sid_str_buf(&token->sids[i], &buf));
W_ERROR_NOT_OK_RETURN(werr);
}