From 94ce9fa4c443ec9a0e6ecc92cb6b07534c321c75 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 25 Apr 2016 01:38:45 +0200 Subject: libtrivfs: fix notion of privileged user Set 'is_root' if the node has been opened by the root user (this was the old behavior) or if it has been opened by the user the translator is executing under. This fixes the irritating bug that an unprivileged user cannot control her own trivfs-based translators. It does not change how privileged trivfs translators work. * libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Use the new function to compute 'isroot'. * libtrivfs/io-restrict-auth.c (trivfs_S_io_restrict_auth): Likewise. * libtrivfs/open.c (trivfs_open): Likewise. * libtrivfs/priv.h (_is_privileged): New function. * libtrivfs/trivfs.h (struct peropen): Clarify what 'isroot' means. --- libtrivfs/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libtrivfs/open.c') diff --git a/libtrivfs/open.c b/libtrivfs/open.c index 97e70a16..35a9452c 100644 --- a/libtrivfs/open.c +++ b/libtrivfs/open.c @@ -56,7 +56,7 @@ trivfs_open (struct trivfs_control *cntl, if (! err) { new->user = user; - new->isroot = idvec_contains (user->uids, 0); + new->isroot = _is_privileged (user->uids); new->po = po; new->hook = 0; -- cgit v1.2.3