You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chmod LIST
Changes the permissions of a list of files. The first element of the list must be the numeric mode, which should probably be an octal number, and which definitely should not be a string of octal digits: 0644 is okay, but "0644" is not. Returns the number of files successfully changed. See also oct if all you have is a string.
The text was updated successfully, but these errors were encountered:
Can you be more explicit about "does not work properly"? It seems when this was added test coverage was also added to exercise it: e9ba614#diff-57190e78b777d72bce3bdb69a08d4f9d60bfb22110c0cd0ac31cd931d2267358. I assume this is down to the ENV variable being stringified, tweaking the test coverage here to prove the bug would be a good first step.
Yes, that I understood. The problem here is backwards compatibility. If the FCGI_SOCKET_PERM environment variable has been passed in from the shell it will indeed be stringified, however if it is set as part of the process that then calls this (like the test) it could be octal already. Witness:
[leejohnson@lee-nuc J0 C1027 11:32:45 ]
/tmp > ls -l foo bar baz
-rw-rw-rw- 1 leejohnson 0 Dec 9 11:32 bar
-rw-rw-rw- 1 leejohnson 0 Dec 9 11:32 baz
-rw-rw-rw- 1 leejohnson 0 Dec 9 11:32 foo
[leejohnson@lee-nuc J0 C1028 11:32:50 ]
/tmp > perl -E'$ENV{FCGI_SOCKET_PERM}=0644; chmod( $ENV{FCGI_SOCKET_PERM},"foo" ); chmod( oct( $ENV{FCGI_SOCKET_PERM} ),"bar" );'
[leejohnson@lee-nuc J0 C1029 11:33:09 ]
/tmp > ls -l foo bar baz
-r---w---- 1 leejohnson 0 Dec 9 11:32 bar
-rw-rw-rw- 1 leejohnson 0 Dec 9 11:32 baz
-rw-r--r-- 1 leejohnson 0 Dec 9 11:32 foo
We don't get the correct perms on bar as we called oct on something that didn't need it, that's a regression. So we need to call oct on the ENV variable but only if it is stringified and not already octal...
cgi-fast/lib/CGI/Fast.pm
Lines 50 to 57 in 280de79
The text was updated successfully, but these errors were encountered: