"O'Connor, Russell" <[EMAIL PROTECTED]> writes:

> The CVS change log for revision 1.6 of gzip.c says "Invoke chmod before
> chown, to close a race condition."  But the change actually moves chown
> before chmod.

Sorry, the change log is wrong.  I'll fix it.

> With chown before chmod, if you don't own the file, you
> won't be able to change the permissions, and they will be left at 0600,
> and gzip reports "Operation not permitted".  Is this intentional?

Yes.  The problem is that on many hosts, if you chown a file there is
a side effect that chmods it as well.  So you must chown before chmoding.

On most systems, if you have enough privileges to chown a file, you
can also chmod it afterwards, so it's not a problem.

On systems where you can give files away you will have problems,
true.  The usual workaround is "Don't do that".


Reply via email to