[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

fakeroot: chmod race



Package: fakeroot
Version: 1.12.2
Severity: important

Hello,

We're getting FTBFSs on hurd-i386 because of /usr/bin/diff getting
644 instead of 755. This is apparently due to a race in fakeroot-tcp
triggered by install -s, which does the following:

- copy the target file, which is now 600
- fork()
  - in the child exec strip(target file), which calls chmod(600) after
    stripping the file.
  - in the parent wait for the child
- chmod(target file, 755)

sometimes chmod() doesn't have effect. If I put a sleep right before
chmod() (or even just a printf), things are ok.

Looking at the chmod implementation of fakeroot, it just sends a message
to the fakeroot-tcp daemon, which updates the permissions there.  The
race is that the message to fakeroot-tcp corresponding to strip's
chmod(600) may be processed after the one from install's chmod(755),
as the fakeroot-tcp daemon processes messages just in socket order and
doesn't make the client wait for completion of chmod...

Samuel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages fakeroot depends on:
ii  libc6                         2.9-12     GNU C Library: Shared libraries

fakeroot recommends no packages.

fakeroot suggests no packages.

-- no debconf information


Reply to: