summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2023-04-23 12:36:35 +1200
committerAndrew Bartlett <abartlet@samba.org>2023-04-28 02:15:36 +0000
commit46793d384e9810b4d814ffbea65714c064e16439 (patch)
treedf33de4afb806f271240d80882fe4efe2e46247f /libcli
parentec2d2f8ea83f433b32071ebf40a8358c084b060b (diff)
downloadsamba-46793d384e9810b4d814ffbea65714c064e16439.tar.gz
libcli:security:sddl_decode_access allows spaces between flags
because Windows does. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/security/sddl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c
index 7692be8a0e1..8e67f90bf86 100644
--- a/libcli/security/sddl.c
+++ b/libcli/security/sddl.c
@@ -381,11 +381,23 @@ static bool sddl_decode_access(const char *str, uint32_t *pmask)
}
/* It's not a positive number, so we'll look for flags */
- while ((str[0] != '\0') && isupper(str[0])) {
+ while ((str[0] != '\0') &&
+ (isupper((unsigned char)str[0]) || str[0] == ' ')) {
uint32_t flags = 0;
size_t len = 0;
bool found;
-
+ while (str[0] == ' ') {
+ /*
+ * Following Windows we accept spaces between flags
+ * but not after flags. Not tabs, though, never tabs.
+ */
+ str++;
+ if (str[0] == '\0') {
+ DBG_WARNING("trailing whitespace in flags "
+ "- '%s'\n", str0);
+ return false;
+ }
+ }
found = sddl_map_flag(
ace_access_mask, str, &len, &flags);
found |= sddl_map_flag(