[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 60/98: trans: fix the creation of files in fakeroot
From: |
Samuel Thibault |
Subject: |
[hurd] 60/98: trans: fix the creation of files in fakeroot |
Date: |
Tue, 14 Jan 2014 02:00:02 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit df66588b0f6daf99573153cb384a676ced27f0b1
Author: Justus Winter <address@hidden>
Date: Tue Dec 3 17:46:58 2013 +0100
trans: fix the creation of files in fakeroot
Previously, fakeroot failed to create files in certain circumstances,
e. g. assuming /tmp is a tmpfs and /tmp/some_file does not exist:
% cd /tmp && fakeroot-hurd /bin/sh -c ':>/tmp/some_file'
/bin/sh: 1: cannot create /tmp/some_file: Is a directory
Fix this by sanitizing the flags value not to contain O_WRITE if we're
not at the last path component.
* trans/fakeroot.c (netfs_S_dir_lookup): Strip O_WRITE from flags when
looking up all but the last path component.
---
trans/fakeroot.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 679e476..b6938dc 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -307,6 +307,10 @@ netfs_S_dir_lookup (struct protid *diruser,
/* We already know about this node. */
mach_port_deallocate (mach_task_self (), idport);
pthread_mutex_lock (&np->lock);
+ if (retry_name[0] != '\0')
+ /* This was not the last component, remove O_WRITE to
+ avoid opening directories with it. */
+ flags &= ~O_WRITE;
err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
if (!err)
netfs_nref (np);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 74/98: trans: unlock nodes with faked attributes in fakeroot, (continued)
- [hurd] 74/98: trans: unlock nodes with faked attributes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 75/98: console-client: remove spurious pthread_spin_unlocks, Samuel Thibault, 2014/01/13
- [hurd] 62/98: trans: make the fakeroot environment more transparent, Samuel Thibault, 2014/01/13
- [hurd] 14/98: proc: turn count_up and store_pid into normal functions, Samuel Thibault, 2014/01/13
- [hurd] 67/98: trans: handle invalid responses to dir_lookup requests in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 78/98: trans/fakeroot: drop else, Samuel Thibault, 2014/01/13
- [hurd] 13/98: term: fix error handling in hurdio_mdmctl, Samuel Thibault, 2014/01/13
- [hurd] 08/98: proc: fix error handling in S_proc_exception_raise, Samuel Thibault, 2014/01/13
- [hurd] 07/98: proc: fix a use-after-free error, Samuel Thibault, 2014/01/13
- [hurd] 18/98: libdiskfs: remove dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 60/98: trans: fix the creation of files in fakeroot,
Samuel Thibault <=
- [hurd] 69/98: trans: return nodes locked when creating fake nodes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 20/98: ext2fs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 93/98: trans/mtab: make the translator multithreaded, Samuel Thibault, 2014/01/13
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13
- [hurd] 15/98: mach-defpager: include errno.h, Samuel Thibault, 2014/01/13
- [hurd] 91/98: trans/mtab: remove the loop detection logic, Samuel Thibault, 2014/01/13
- [hurd] 97/98: libnetfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 19/98: libdiskfs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function, Samuel Thibault, 2014/01/13