Comment 17 for bug 376388

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 376388] Re: ~/.bazaar created owned by root (when run under sudo)

On 11 March 2010 00:18, Vincent Ladeuil <email address hidden> wrote:
>> Another option would be to say we always attempt to chown the .bazaar (and .bzr.log) to be the same
>> as the containing directory.
>
> Until parthm nudged me enough to reveal that chown isn't working for the average user, I had always thought
> *any* user can freely use chown as long as he had write access to the containing directory.

Sure, I meant to say "always try to", but we must not be surprised if
we get EPERM.

>
> I was wrong.
>
> chown(2) unambiguously says:
>
>        Only a privileged process (Linux: one with  the  CAP_CHOWN  capability)
>       may  change  the  owner  of a file.  The owner of a file may change the
>       group of the file to any group of which that  owner  is  a  member.   A
>       privileged  process  (Linux: with CAP_CHOWN) may change the group arbi‐
>       trarily.

btw I think this may vary between unixes.

--
Martin <http://launchpad.net/~mbp/>