From 710b40e388dcff8d3b64476a02fdc13b60e31ced Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 21 Dec 2011 22:00:12 -0500 Subject: [PATCH] afsd: Parse cacheinfo during argument parsing Currently we parse cacheinfo in afsd_run, when the client is initialized and started. Parsing cacheinfo can change afsd_cacheMountDir, however, which may be of interest to afsd.o users; in particular, libuafs exposes this via uafs_MountDir(). This means that if a mount dir is not explicitly specified in the libcmd arguments to afsd, a libuafs-using program will see the mountpoint as the empty string if it is queried after afsd_parse but before afsd_run. For afsd.fuse, this causes the cryptic error message: fuse: bad mount point `': No such file or directory since the mountpoint is the empty string if it is not specified explicitly on the command line. To fix this, move cacheinfo parsing to effectively near the end of afsd_parse, so the mountpoint is calculated in afsd_parse(). Reviewed-on: http://gerrit.openafs.org/6400 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit af218dee6c517f4636a18c681bff6f1212a7d9c0) Change-Id: Ibd087f52c9a6f1d98614f4fdbbc5b92ea0806506 Reviewed-on: http://gerrit.openafs.org/9453 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Reviewed-by: Stephan Wiesand --- src/afsd/afsd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 6a4f5078c..800fefcaa 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -1904,6 +1904,12 @@ mainproc(struct cmd_syndesc *as, void *arock) /* -dynroot-sparse */ enable_dynroot = 2; } + + /* parse cacheinfo file if this is a diskcache */ + if (ParseCacheInfoFile()) { + exit(1); + } + return 0; } @@ -1940,11 +1946,6 @@ afsd_run(void) printf("%s: My home cell is '%s'\n", rn, LclCellName); } - /* parse cacheinfo file if this is a diskcache */ - if (ParseCacheInfoFile()) { - exit(1); - } - if (!enable_nomount) { if (afsd_check_mount(rn, afsd_cacheMountDir)) { return -1; -- 2.39.5