Subject: Re: CVS commit: pkgsrc/graphics/xart
To: None <pkgsrc-changes@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: pkgsrc-changes
Date: 01/10/2007 20:29:28
Oops, I should not send mails that have a single dot in a line. :)
Roland Illig wrote:
> Christoph Badura wrote:
>
>> On Mon, Jan 08, 2007 at 01:40:23AM +0000, Roland Illig wrote:
>>
>>> Modified Files:
>>> pkgsrc/graphics/xart: Makefile
>>
>>
>>
>>> Log Message:
>>> When fixing file permissions with find | xargs, there is always a race
>>> condition. Fixed this by using find -exec for the directories.
>>
>>
>>
>> Exactly what race condition are you talking about?
>
>
> There have been directories that had been extracted with mode 415 (or
> similar, at least non-executable for the user). These directories also
> had subdirectories.
>
> mkdir dir
> mkdir dir/subdir
> touch dir/subdir/file
> chmod 123 dir/subdir/file
> chmod 444 dir/subdir
> chmod 400 dir
>
> When find(1) iterated over such a directory, it couldn't change to the
> subdirectories to fix their permissions, too, because the directory was
> still non-executable at that point.
>
> $ find . -print
> .
> ./dir
> find: ./dir/subdir: Permission denied
> find: ./dir: Permission denied
>
> When you add the xargs(1) pipe, and assuming that xargs runs the command
> for every single argument, there can still be the case that find(1)
> tries to change to the directory before xargs(1) has managed to run
> chmod on it.
Roland