summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-12-07 15:50:46 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-12-09 15:08:00 +0100
commit83dfdd298d14d885b9ebc37b3b1af703cdd27f8c (patch)
tree1287737ddf44a7cd364f06d9c41e012e9a60b2a0
parent2640c8a8e32c2f20023e4cb91f87684c62316f19 (diff)
trans: unlock nodes with faked attributes in fakeroot
When a node has faked attributes, we cannot drop our node. Reinitialize the lock box as if the node was dropped. This fixes the following bug: % fakeroot-hurd /bin/sh -c 'touch /tmp/$$.lock chown 0 /tmp/$$.lock l(){ flock /tmp/$$.lock true; }; l; l' <hangs> * trans/fakeroot.c (fake_node_dropweak): Unlock the node if the last real reference is dropped but we keep a fake one.
-rw-r--r--trans/fakeroot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 3756f489..920367d1 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -172,6 +172,9 @@ fakeroot_netfs_release_protid (void *cookie)
account for that fake reference. */
np->nn->faked |= FAKE_REFERENCE;
+ /* Clear the lock box as if the file was closed. */
+ fshelp_lock_init (&np->userlock);
+
/* We keep our node. */
goto out;
}