summaryrefslogtreecommitdiff
path: root/libtrivfs/fsys-getroot.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-04-29 23:36:47 +0200
committerJustus Winter <justus@gnupg.org>2016-05-03 17:18:30 +0200
commit45b829f4dcb28a98af7285dc57bfaf621b0bbf21 (patch)
tree1cf6ad2deb54f047ed9beda500d0eb7609144ca5 /libtrivfs/fsys-getroot.c
parentb90164e0090473573a90e16cee515c2d4d6f3f91 (diff)
Fix privileged operations on trivfs-translated nodes
Amends d18ea50e. * libtrivfs/fsys-getroot.c: When the user is privileged, make a verbatim copy of the real node instead of making an auth-restricted copy.
Diffstat (limited to 'libtrivfs/fsys-getroot.c')
-rw-r--r--libtrivfs/fsys-getroot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index c44e5358..c9b8261e 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -75,11 +75,11 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
.alloced = nuids,
};
- if (idvec_contains (&idvec, 0))
- /* Root should be given all our rights. */
+ if (_is_privileged (&idvec))
+ /* Privileged users should be given all our rights. */
err = io_duplicate (cntl->underlying, &new_realnode);
else
- /* Non-root, restrict rights. */
+ /* Non-privileged, restrict rights. */
err = io_restrict_auth (cntl->underlying,
&new_realnode, uids, nuids, gids, ngids);