On 07/10/2013 12:54 AM, Vladimir Marek wrote: > But the chown > will be executed anyway just in a different sequence, so I don't see the > difference.
The difference is that the setuid or setgid bits will be cleared by the chown, which means they'll be incorrect in the final version of the file. If you execute the chmod after the chown, it doesn't matter that the chown clears those bits, since the chmod fixes that.