[PATCH 3/9] s3-utils: Fix scanf format in smbacls.
Andreas Schneider
asn at samba.org
Fri Nov 15 09:02:14 MST 2013
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/smbcacls.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 20ce73d..11b7388 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -489,7 +489,7 @@ static bool parse_ace(struct cli_state *cli, struct security_ace *ace,
p++;
/* Try to parse numeric form */
- if (sscanf(p, "%i/%i/%i", &atype, &aflags, &amask) == 3 &&
+ if (sscanf(p, "%u/%u/%u", &atype, &aflags, &amask) == 3 &&
StringToSid(cli, &sid, str)) {
goto done;
}
@@ -552,7 +552,7 @@ static bool parse_ace(struct cli_state *cli, struct security_ace *ace,
return False;
}
} else {
- if (!sscanf(tok, "%i", &aflags)) {
+ if (!sscanf(tok, "%u", &aflags)) {
printf("ACE '%s': bad integer flags entry at '%s'\n",
orig_str, tok);
SAFE_FREE(str);
@@ -570,7 +570,7 @@ static bool parse_ace(struct cli_state *cli, struct security_ace *ace,
}
if (strncmp(tok, "0x", 2) == 0) {
- if (sscanf(tok, "%i", &amask) != 1) {
+ if (sscanf(tok, "%u", &amask) != 1) {
printf("ACE '%s': bad hex number at '%s'\n",
orig_str, tok);
SAFE_FREE(str);
--
1.8.4
More information about the samba-technical
mailing list