[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 27/31: Fix root operations on trivfs-translated nodes
From: |
Samuel Thibault |
Subject: |
[hurd] 27/31: Fix root operations on trivfs-translated nodes |
Date: |
Mon, 02 May 2016 23:48:33 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit d18ea50ec00210680b80359cb182a0175374d5e1
Author: Samuel Thibault <address@hidden>
Date: Fri Apr 29 21:03:08 2016 +0200
Fix root operations on trivfs-translated nodes
* libtrivfs/fsys-getroot.c: When `uids` contain 0, make a verbatim copy of
the real node instead of making an auth-restricted copy.
---
libtrivfs/fsys-getroot.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index 2bc11f5..c44e535 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -69,8 +69,20 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
flags &= O_HURD;
flags &= ~(O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS);
- err = io_restrict_auth (cntl->underlying,
- &new_realnode, uids, nuids, gids, ngids);
+ struct idvec idvec = {
+ .ids = uids,
+ .num = nuids,
+ .alloced = nuids,
+ };
+
+ if (idvec_contains (&idvec, 0))
+ /* Root should be given all our rights. */
+ err = io_duplicate (cntl->underlying, &new_realnode);
+ else
+ /* Non-root, restrict rights. */
+ err = io_restrict_auth (cntl->underlying,
+ &new_realnode, uids, nuids, gids, ngids);
+
if (err)
return err;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 13/31: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, (continued)
- [hurd] 13/31: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2016/05/02
- [hurd] 20/31: libshouldbeinlibc: add assert(3) variant that prints backtraces, Samuel Thibault, 2016/05/02
- [hurd] 07/31: utils/settrans: get an authenticated root node in chroot mode, Samuel Thibault, 2016/05/02
- [hurd] 06/31: isofs: make superblock detection more robust, Samuel Thibault, 2016/05/02
- [hurd] 08/31: utils/settrans: add option to specify the underlying node, Samuel Thibault, 2016/05/02
- [hurd] 31/31: Fix build, Samuel Thibault, 2016/05/02
- [hurd] 29/31: libihash: keep track of free slots, Samuel Thibault, 2016/05/02
- [hurd] 10/31: mach-defpager: fix error handling, Samuel Thibault, 2016/05/02
- [hurd] 30/31: libihash: rehash if effective load exceeds the threshold, Samuel Thibault, 2016/05/02
- [hurd] 26/31: startup: write all messages to stderr, Samuel Thibault, 2016/05/02
- [hurd] 27/31: Fix root operations on trivfs-translated nodes,
Samuel Thibault <=
- [hurd] 16/31: libtrivfs: fix notion of privileged user, Samuel Thibault, 2016/05/02
- [hurd] 28/31: libihash: fix index computation, Samuel Thibault, 2016/05/02
- [hurd] 24/31: startup: add verbose parameter, Samuel Thibault, 2016/05/02
- [hurd] 25/31: startup: use the generated default server implementations, Samuel Thibault, 2016/05/02
- [hurd] 01/31: netfs: Remove global reference count lock., Samuel Thibault, 2016/05/03
- [hurd] 04/31: Use posix types for mig definitions., Samuel Thibault, 2016/05/03