]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afsd: check if mountdir is an absolute path
authorChristof Hanke <christof.hanke@rzg.mpg.de>
Fri, 13 Sep 2013 09:47:08 +0000 (11:47 +0200)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 25 Sep 2013 15:09:24 +0000 (08:09 -0700)
if the mountdir in the cacheinfo file is not absolute,
it can confuse commands like "df". Thus, force it to
be absolute.

Reviewed-on: http://gerrit.openafs.org/10250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit fb623d5da30e6d304f672d8485da2e1781afa5df)

Change-Id: I80542020848c901e57e7440cb1ed2149aa0d3251
Reviewed-on: http://gerrit.openafs.org/10253
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afsd/afsd_kernel.c

index e1e87a7a9fa013caf15e4afd839d79bb2ee0aed5..d93dc2a4f116f8ee8b2fc754992c03f6104a4ece 100644 (file)
@@ -576,6 +576,9 @@ afsd_check_mount(const char *rn, const char *mountdir)
     } else if (!S_ISDIR(statbuf.st_mode)) {
        printf("%s: Mountpoint %s is not a directory.\n", rn, mountdir);
        return -1;
+    } else if (mountdir[0] != '/') {
+       printf("%s: Mountpoint %s is not an absolute path.\n", rn, mountdir);
+       return -1;
     }
     return 0;
 }