]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vlserver: limit use of regex to admins always
authorD Brashear <shadow@your-file-system.com>
Fri, 18 Jul 2014 20:00:12 +0000 (16:00 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 13 Aug 2015 12:44:18 +0000 (08:44 -0400)
allow regexes only if the querying user is a superuser.
if the superuser uses up all the resources, well, they could just do
whatever damage directly anyway. means even in unrestricted mode
we are not vulnerable

Reviewed-on: http://gerrit.openafs.org/11968
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 049323e7e03c64f534a73ff452d218f19d5b8132)

Change-Id: I1e3f11bd14b071be69eb6e00c26ea2209596c82a
Reviewed-on: http://gerrit.openafs.org/11975
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vlserver/vlprocs.c

index 4fb5db0784c901102cbe38743a76b718ec2c1156..2f56b19d81771758ce41c7f51471faf38fd01a87 100644 (file)
@@ -1515,6 +1515,10 @@ SVL_ListAttributesN2(struct rx_call *rxcall,
        findpartition = ((attributes->Mask & VLLIST_PARTITION) ? 1 : 0);
        findflag = ((attributes->Mask & VLLIST_FLAG) ? 1 : 0);
        if (name && (strcmp(name, ".*") != 0) && (strcmp(name, "") != 0)) {
+           if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL)) {
+               errorcode = VL_PERM;
+               goto done;
+           }
            sprintf(volumename, "^%s$", name);
 #ifdef HAVE_POSIX_REGEX
            if (regcomp(&re, volumename, REG_NOSUB) != 0) {