Re: [PATCH] allow file modes up to 7777 instead of 777

2018-03-16 Thread Chet Ramey
On 3/15/18 4:11 PM, Martijn Dekker wrote: > Op 14-03-18 om 16:49 schreef Martijn Dekker: > [...] >> { >>digits++; >>result = (result * 8) + (*string++ - '0'); >> - if (result > 0777) >> + if (result > 0) >> return -1; >> } >> >> By the way, why does that

Re: [PATCH] allow file modes up to 7777 instead of 777

2018-03-15 Thread Martijn Dekker
Op 14-03-18 om 16:49 schreef Martijn Dekker: [...] > { >digits++; >result = (result * 8) + (*string++ - '0'); > - if (result > 0777) > + if (result > 0) > return -1; > } > > By the way, why does that function repeatedly check the bounds for every > dig

Re: [PATCH] allow file modes up to 7777 instead of 777

2018-03-15 Thread Chet Ramey
On 3/14/18 11:49 AM, Martijn Dekker wrote: > This fixes two bugs: > > 1. The example 'mkdir' builtin, examples/loadables/mkdir.c, has a broken > '-m' option that doesn't accept sticky/setuid/setgid. > > $ ./bash -c '(cd examples/loadables && make mkdir) && > enable -f examples/loadables/mkd

Re: [PATCH] allow file modes up to 7777 instead of 777

2018-03-14 Thread Martijn Dekker
Op 14-03-18 om 16:49 schreef Martijn Dekker: > While POSIX says the effect of specifying sticky/setuid/setgid bits is > unspecified[*], the 'umask' builtin should still accept these bits, as > it does in every other shell. Forgot the footnote link. Here it is: http://pubs.opengroup.org/onlinepubs/

[PATCH] allow file modes up to 7777 instead of 777

2018-03-14 Thread Martijn Dekker
This fixes two bugs: 1. The example 'mkdir' builtin, examples/loadables/mkdir.c, has a broken '-m' option that doesn't accept sticky/setuid/setgid. $ ./bash -c '(cd examples/loadables && make mkdir) && enable -f examples/loadables/mkdir mkdir && mkdir -m2775 foo' ['make' output sk