On 07/08/2013 07:36 AM, Vladimir Marek wrote: > On solaris you can mount given filesystem with norstchown parameter > which gives the owner of the file the ability to chown the file to > someone else.
Yes, that's true. But this is unusual -- I've never seen it done, and I've used a lot of Solaris systems. Who uses it and why? It might be helpful to understand their motiviation before diving into implementation. Anyway, for reasons discussed in the earlier thread, we can't simply change the code to do a chmod before chown, as that would be wrong for typical platforms. Nor does it make sense for this to be a configure-time option, as even on Solaris gzip's current behavior is typically correct now, and it's wrong only in the unusual case where file systems have this mount option. Nor should it be settable by a command-line option or (even worse) an environment variable. Most users won't know about the option. Here's a better idea: have gzip detect when the destination is on a file system that lets you give files away and where it's correct to do the chmod before the chown. On platforms that never let you give files away, this should take zero instructions at run-time. On platforms like Solaris where it depends on mount options, this should inspect the mount options. Can you contribute code to do that?