[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 62/98: trans: make the fakeroot environment more transparent
From: |
Samuel Thibault |
Subject: |
[hurd] 62/98: trans: make the fakeroot environment more transparent |
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 6204a717fc63891839faefda75e95a364ec0434e
Author: Justus Winter <address@hidden>
Date: Wed Dec 4 10:53:15 2013 +0100
trans: make the fakeroot environment more transparent
Previously fakeroot did not explicitly proxy io_identity requests, so
the default implementation from libnetfs handled them. But as the fsys
identity port returned was always netfs_fsys_identity, this broke the
getcwd logic (assuming /media/scratch is a translator):
% cd /media/scratch/foo && fakeroot-hurd pwd
/foo
Fix this by proxying io_identity requests. Since then no-one is
handing out our netfs_fsys_identity port anymore, an optimization in
netfs_fsys_identity is made obsolete by this change.
* trans/fakeroot.c (netfs_S_dir_lookup): Adjust code accordingly.
(netfs_S_io_identity): New function.
---
trans/fakeroot.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 24d3a4f..1342844 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -290,16 +290,7 @@ netfs_S_dir_lookup (struct protid *diruser,
{
/* Talking to ourselves! We just looked up one of our
own nodes. Find the node and return it. */
- struct protid *cred
- = ports_lookup_port (netfs_port_bucket, file,
- netfs_protid_class);
- mach_port_deallocate (mach_task_self (), idport);
- mach_port_deallocate (mach_task_self (), file);
- if (cred == 0)
- return EGRATUITOUS;
- np = cred->po->np;
- netfs_nref (np);
- ports_port_deref (cred);
+ assert (! "reached");
}
else
{
@@ -788,6 +779,27 @@ netfs_S_io_map_cntl (struct protid *user,
return err;
}
+error_t
+netfs_S_io_identity (struct protid *user,
+ mach_port_t *id,
+ mach_msg_type_name_t *idtype,
+ mach_port_t *fsys,
+ mach_msg_type_name_t *fsystype,
+ ino_t *fileno)
+{
+ error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+
+ *idtype = *fsystype = MACH_MSG_TYPE_MOVE_SEND;
+
+ pthread_mutex_lock (&user->po->np->lock);
+ err = io_identity (user->po->np->nn->file, id, fsys, fileno);
+ pthread_mutex_unlock (&user->po->np->lock);
+ return err;
+}
+
#define NETFS_S_SIMPLE(name) \
error_t \
netfs_S_##name (struct protid *user) \
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c, (continued)
- [hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 48/98: libports: another right leak fix, Samuel Thibault, 2014/01/13
- [hurd] 73/98: trans: improve the error handling in fakeauth, Samuel Thibault, 2014/01/13
- [hurd] 06/98: proc: fix the declaraton of genpid, Samuel Thibault, 2014/01/13
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, Samuel Thibault, 2014/01/13
- [hurd] 70/98: trans: fix reference counting and destruction of fake nodes, Samuel Thibault, 2014/01/13
- [hurd] 77/98: trans/fakeroot: fix ownership of newly created files, Samuel Thibault, 2014/01/13
- [hurd] 64/98: libihash: remove dead code, Samuel Thibault, 2014/01/13
- [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 <=
- [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, 2014/01/13
- [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