[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 04/06: Show firmlink mounts to mount points
From: |
Samuel Thibault |
Subject: |
[hurd] 04/06: Show firmlink mounts to mount points |
Date: |
Wed, 16 Mar 2016 01:36:35 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 0bc52ecb504401e089e1aa335c56e0c5db6d8e32
Author: Samuel Thibault <address@hidden>
Date: Tue Mar 15 22:22:07 2016 +0100
Show firmlink mounts to mount points
* trans/mtab.c (mtab_populate): Always open the underlying node, and pass
it to mtab_mark_as_seen instead of the translated node.
---
trans/mtab.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/trans/mtab.c b/trans/mtab.c
index e855080..e0fcb46 100644
--- a/trans/mtab.c
+++ b/trans/mtab.c
@@ -344,7 +344,7 @@ mtab_populate (struct mtab *mtab, const char *path, int
insecure)
error_t err = 0;
/* These resources are freed in the epilogue. */
- file_t node = MACH_PORT_NULL;
+ file_t node = MACH_PORT_NULL, underlying_node = MACH_PORT_NULL;
char *argz = NULL;
size_t argz_len = 0;
char **argv = NULL;
@@ -357,19 +357,19 @@ mtab_populate (struct mtab *mtab, const char *path, int
insecure)
char *children = NULL;
size_t children_len = 0;
- if (! insecure)
+ /* Get the underlying node. */
+ underlying_node = file_name_lookup (path, O_NOTRANS, 0666);
+ if (underlying_node == MACH_PORT_NULL)
{
- /* Get the underlying node. */
- node = file_name_lookup (path, O_NOTRANS, 0666);
- if (node == MACH_PORT_NULL)
- {
- err = errno;
- goto errout;
- }
+ err = errno;
+ goto errout;
+ }
+ if (! insecure)
+ {
/* Check who owns the node the translator is bound to. */
io_statbuf_t st;
- err = io_stat (node, &st);
+ err = io_stat (underlying_node, &st);
if (err)
goto errout;
@@ -378,8 +378,6 @@ mtab_populate (struct mtab *mtab, const char *path, int
insecure)
err = EPERM;
goto errout;
}
-
- mach_port_deallocate (mach_task_self (), node);
}
/* (Re-)do the lookup without O_NOTRANS to get the root node. */
@@ -397,7 +395,7 @@ mtab_populate (struct mtab *mtab, const char *path, int
insecure)
}
/* Avoid running in circles. */
- if (mtab_mark_as_seen (mtab, node))
+ if (mtab_mark_as_seen (mtab, underlying_node))
{
err = 0;
goto errout;
@@ -509,6 +507,8 @@ mtab_populate (struct mtab *mtab, const char *path, int
insecure)
}
errout:
+ if (underlying_node != MACH_PORT_NULL)
+ mach_port_deallocate (mach_task_self (), underlying_node);
if (node != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self (), node);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (77b1fce -> a2cfb67), Samuel Thibault, 2016/03/15
- [hurd] 04/06: Show firmlink mounts to mount points,
Samuel Thibault <=
- [hurd] 03/06: Add get_source support to firmlink, Samuel Thibault, 2016/03/15
- [hurd] 02/06: ext2fs: Fix adding blocks to free blocks cache, Samuel Thibault, 2016/03/15
- [hurd] 06/06: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into upstream, Samuel Thibault, 2016/03/15
- [hurd] 01/06: Add missing RPC definitions, Samuel Thibault, 2016/03/15
- [hurd] 05/06: Add getting swap information from swapon and procfs, Samuel Thibault, 2016/03/15