From 9d44688681bc196baf1bccbdf84092ffc0510bb7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 4 Sep 2010 14:05:30 +1000 Subject: s3-util_sid Accept S-1-5 as a SID --- source3/lib/util_sid.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/lib/util_sid.c') diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 58df0f2a48..9a2876baec 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -230,8 +230,12 @@ bool string_to_sid(struct dom_sid *sidout, const char *sidstr) } /* get identauth */ - if (!q || (*q != '-')) { conv = (uint32_t) strtoul(q, &q, 10); + if (!q) { + goto format_error; + } else if (*q == '\0') { + /* Just id_auth, no subauths */ + } else if (*q != '-') { goto format_error; } /* identauth in decimal should be < 2^32 */ @@ -243,8 +247,12 @@ bool string_to_sid(struct dom_sid *sidout, const char *sidstr) sidout->id_auth[4] = (conv & 0x0000ff00) >> 8; sidout->id_auth[5] = (conv & 0x000000ff); - q++; sidout->num_auths = 0; + if (*q == '\0') { + return true; + } + + q++; while (true) { char *end; -- cgit