the way we parse things, we can't really distinguish between complete
nonsense and an ACL that seems to end early because of bad flags. That
is, "D:ZZ(A;;;;;WD)" looks the same as "ZZ" to the parser. But at least
we can point to the right place in the string.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
while (*sddl) {
uint32_t flags;
char c = sddl[0];
- if (sddl[1] != ':') goto failed;
-
+ if (sddl[1] != ':') {
+ *msg = talloc_strdup(mem_ctx,
+ "expected '[OGDS]:' section start "
+ "(or the previous section ended prematurely)");
+ goto failed;
+ }
sddl += 2;
switch (c) {
case 'D':
if (sd->group_sid == NULL) goto failed;
break;
default:
+ *msg = talloc_strdup(mem_ctx, "unexpected character (expected [OGDS])");
goto failed;
}
}