Doesn't this patch introduce a security hole into the Solaris port of gzip?
If gzip chmods the output file before chowning it, the output file may be (say) group-readable to the current user's group, even though the intent is that the file be group-readable only to the intended user's group. This will allow someone to read the file who shouldn't be able to read the file, if they open the file between the chmod and the chown. Instead, how about the following idea. On Solaris, if a process discovers that it has the right to chown but it cannot chmod other people's files, then it relinquishes the right to chown. That way, the chown will fail (just as it does on GNU systems) and gzip will behave on Solaris as it does elsewhere, and this security hole will be closed.