afsd: check if mountdir is an absolute path

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>
This commit is contained in:
Christof Hanke 2013-09-13 11:47:08 +02:00 committed by Derrick Brashear
parent 9db8b123e4
commit fb623d5da3

View 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;
}