[PATCHES] util_sd: Also accept hex input for ALLOW/DENIED (was Re: bug in smbcacls)

Christof Schmitt cs at samba.org
Fri Feb 12 17:14:51 UTC 2016

On Thu, Feb 11, 2016 at 04:25:17PM -0800, Herb Lewis wrote:
> Looks OK but you should probably also remove the comment
> /* Only numeric form accepted for flags at present */
> since parse_ace_flags actually checks for the string values.
> Of course this does not allow for octal numbers in any of the
> fields that the %i would have allowed but that is probably OK.

Ok, here is the updated patch that also removes the wrong comment. For
octal input, we would need to explicitly use %o, but i don't see the
need for that input format.

Can i push with our reviewed-by?


> On 02/11/2016 03:13 PM, Christof Schmitt wrote:
> >On Thu, Feb 04, 2016 at 10:47:04AM -0700, Christof Schmitt wrote:
> >>On Thu, Feb 04, 2016 at 09:31:37AM -0800, Herb Lewis wrote:
> >>>In source3/lib/util_sd.c function parse_ace there is the following
> >>>line that I think is incorrect
> >>>
> >>>if (sscanf(p, "%u/%u/%u", &atype, &aflags, &amask) == 3 &&
> >>>
> >>>in the old samba 3.6 code it used to read
> >>>
> >>>if (sscanf(p, "%i/%i/%i", &atype, &aflags, &amask) == 3 &&
> >>>
> >>>and according to the man page for sscanf the %u is only for decimal
> >>>integers while %i also checks for base 16 and base 8 as well. Was there
> >>>a reason this was changed so that hex numbers are no longer allowed?
> >>util_sd.c is the result of using common code between smbcacls and
> >>sharesec. There is no reason why we would disallow base 16 and base 8; i
> >>probably just missed that part. Feel free to send a patch, or i can
> >>address this when i have a minute.
> >What about this approach? I also added a test and fixed some issues in
> >the test script.
> >
> >Christof

More information about the samba-technical mailing list