From: Christof Hanke Date: Sun, 28 Nov 2010 12:01:12 +0000 (+0100) Subject: Unix afsd: Check for mountpoint /afs first X-Git-Tag: upstream/1.6.0.pre2^2~123 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c93d28abf492cc04274ad9501fb60f0351d6f264;p=packages%2Fo%2Fopenafs.git Unix afsd: Check for mountpoint /afs first Check for the existance of the mountpoint before trying to start. Reviewed-on: http://gerrit.openafs.org/3392 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit cc54175e43ce14c01f9c103541ffad795b17629c) Change-Id: Ic94f1701f5d1d0d080e5751093a685e89d892b1a Reviewed-on: http://gerrit.openafs.org/3782 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 90a4cdbe3..5eee1f194 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -1923,6 +1923,7 @@ afsd_run(void) { static char rn[] = "afsd"; /*Name of this routine */ struct afsconf_dir *cdir; /* config dir */ + struct stat statbuf; int lookupResult; /*Result of GetLocalCellName() */ int i; afs_int32 code; /*Result of fork() */ @@ -1956,6 +1957,16 @@ afsd_run(void) exit(1); } + if (stat(afsd_cacheMountDir, &statbuf)) { + printf("afsd: Mountpoint %s missing.\n", afsd_cacheMountDir); + exit(1); + } else { + if (!S_ISDIR(statbuf.st_mode)) { + printf("afsd: Mountpoint %s is not a directory.\n", afsd_cacheMountDir); + exit(1); + } + } + /* do some random computations in memcache case to get things to work * reasonably no matter which parameters you set. */