From a33157bc62c3bae5975b2316ce62b6d09195601d Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Fri, 13 Sep 2013 11:47:08 +0200 Subject: [PATCH] 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 --- src/afsd/afsd_kernel.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.5