Letting "ls -l" display file permissions in octal

Benjamin Kaduk kaduk at MIT.EDU
Wed Apr 9 02:32:00 UTC 2014


On Tue, 8 Apr 2014, A.J. 'Fonz' van Werven wrote:

> Please note: someone else on the forums spotted a bug in my code: the
> snprintf() call in octalmode() in print.c uses sizeof, which actually
> refers to the size of the pointer rather than the size of the buffer
> itself. I've updated the patch to just use the literal value 6 instead
> (four octal digits, a space reserved for aclmode() and a terminating \0).
> Since the length of said buffer has been hardcoded to 20 in the calling
> function (I didn't do that, BTW), I think that should be ok.

If you have a version of the patch that you're happy with, it's probably 
worth submitting it in a PR so that it doesn't get lost.

-Ben Kaduk


More information about the freebsd-hackers mailing list