On 09/22/2012 10:59 PM, Georgiy Treyvus wrote: > it shouldn't be returning a 0 exit code for failure
Unless I'm missing something, I'd guess that the chmod command is just executing the chmod system call, which means that if it is reporting success that one should be looking at how the system call is implemented, not at how the chmod command is implemented. You can test this theory by running it under strace. E.g.: strace -o chmod.tr chmod 755 file and look at what 'chmod.tr' says about when the chmod system call is being executed.
