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)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 13 Sep 2013 13:10:56 +0000 (06:10 -0700)
if the mountdir in the cacheinfo file is not absolute,
it can confuse commands like "df". Thus, force it to
be absolute.

Change-Id: Idb098b7c83fef6931fe71dd53a85569a953e5e3f
Reviewed-on: http://gerrit.openafs.org/10250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/afsd/afsd_kernel.c

index 7800fcb..a58be2c 100644 (file)
@@ -555,6 +555,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;
 }