From: Christof Hanke Date: Fri, 13 Sep 2013 09:47:08 +0000 (+0200) Subject: afsd: check if mountdir is an absolute path X-Git-Tag: upstream/1.6.6_pre2^2~54 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a33157bc62c3bae5975b2316ce62b6d09195601d;p=packages%2Fo%2Fopenafs.git 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. Reviewed-on: http://gerrit.openafs.org/10250 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit fb623d5da30e6d304f672d8485da2e1781afa5df) Change-Id: I80542020848c901e57e7440cb1ed2149aa0d3251 Reviewed-on: http://gerrit.openafs.org/10253 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/afsd/afsd_kernel.c b/src/afsd/afsd_kernel.c index e1e87a7a9..d93dc2a4f 100644 --- a/src/afsd/afsd_kernel.c +++ b/src/afsd/afsd_kernel.c @@ -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; }