s3-utils: Fix scanf format in smbacls.
authorAndreas Schneider <asn@samba.org>
Fri, 15 Nov 2013 16:02:14 +0000 (17:02 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 15 Nov 2013 19:07:43 +0000 (11:07 -0800)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/smbcacls.c

index 20ce73ddc718a231ceda14441ed35e7c699f3334..11b7388303cd7acacf7bb3e9b7d3dc8fa967d925 100644 (file)
@@ -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);