summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-15 09:02:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:30 -0500
commit2246d32e70f38ce31d8432eeb436fb522661d1c5 (patch)
treed7d7d7f31df01fbb0a4e197a2e9eba1a56dc8e68 /source4/libcli
parent9ba0c91e9f459bfec21d8d8d0c3c768744cdae0d (diff)
downloadsamba-2246d32e70f38ce31d8432eeb436fb522661d1c5.tar.gz
samba-2246d32e70f38ce31d8432eeb436fb522661d1c5.tar.bz2
samba-2246d32e70f38ce31d8432eeb436fb522661d1c5.zip
r20795: dom_sid_parse_talloc() gets an null terminated string as input,
the SDDL string has the sid strings embedded, so we need to create a null terminated string... metze (This used to be commit 532395a18db84affa8a743b995e9fae2e3c312f2)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/security/sddl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/libcli/security/sddl.c b/source4/libcli/security/sddl.c
index 14dd7e0917..423ccc92e9 100644
--- a/source4/libcli/security/sddl.c
+++ b/source4/libcli/security/sddl.c
@@ -100,9 +100,17 @@ static struct dom_sid *sddl_decode_sid(TALLOC_CTX *mem_ctx, const char **sddlp,
/* see if its in the numeric format */
if (strncmp(sddl, "S-", 2) == 0) {
+ struct dom_sid *sid;
+ char *sid_str;
size_t len = strspn(sddl+2, "-0123456789");
+ sid_str = talloc_strndup(mem_ctx, sddl, len+2);
+ if (!sid_str) {
+ return NULL;
+ }
(*sddlp) += len+2;
- return dom_sid_parse_talloc(mem_ctx, sddl);
+ sid = dom_sid_parse_talloc(mem_ctx, sid_str);
+ talloc_free(sid_str);
+ return sid;
}
/* now check for one of the special codes */