On Tue, Apr 20, 2010 at 05:23:13PM -0400, Richard Lowe wrote:
> Am I missing something dumb?  Was the change to write to a tempfile and
> then rename a bad move in the first place?  I'd really rather not screw
> this up again, worse, or differently.

The change to the tempfile is reasonable.  The idea was to prevent one
client from reading a copy of the file that was partially re-written, in
case another was updating the file.  This ensures that updates are
atomic.

> I'm not convinced that's right, because then we clobber ownership (this
> also means that write permission to the cfg_cache file is meaningless,
> it's permission to the directory contains that's important.)

Write permission isn't meaningless, since it still prevents unintended
updates to the file by other means.  The only way that one could set
ownership on this file is if you have root (or similar privilege) or are
actually the owner.  The case you're describing is that you're running
pkgsend as a 3rd, non-root, user and have permission to delete the file
from the directory, but not write permission to the cfg_cache?

If I understood that correctly, the only way you can make progress is to
create the file anyway and let someone else fix the permissions later.
I'm not certain that we'd want to halt the entire operation just because
the permissions don't match -- they could have been incorrect when the
operation started.

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to