]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
ptserver: Fix AccessOK -restricted for SYSADMINID
authorAndrew Deason <adeason@sinenomine.net>
Sat, 3 Nov 2018 05:58:58 +0000 (00:58 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 25 Jul 2019 14:11:06 +0000 (10:11 -0400)
According to the documentation, as well as other code paths that check
for -restricted, the -restricted option does not affect members of
system:administrators. Currently, though, AccessOK only bypasses the
-restricted check if the caller is SYSADMINID itself (i.e. localauth).

Fix AccessOK to only do the -restricted checks if the caller is not in
system:administrators, to match the documentation as well as other
ptserver operations.

Reviewed-on: https://gerrit.openafs.org/13373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3a8fa4ecd65d5d743fdc573c9f0f261aee2063b6)

Change-Id: I786830efab229a50a521daf3efc624e949475030
Reviewed-on: https://gerrit.openafs.org/13687
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/ptserver/ptutils.c

index 7ea7202dcc831a3cde9a77a15959810b75de07b5..c551c62b9f599aab67eccf6fef9dadffdbcbcb33 100644 (file)
@@ -286,7 +286,7 @@ AccessOK(struct ubik_trans *ut, afs_int32 cid,              /* caller id */
        return 1;
     if (cid == SYSADMINID)
        return 1;               /* special case fileserver */
-    if (restricted) {
+    if (restricted && !IsAMemberOf(ut, cid, SYSADMINID)) {
         if (mem == PRP_ADD_MEM || mem == PRP_REMOVE_MEM) {
             /* operation is for adding/removing members from a group */
             return 0;