afsd: Parse cacheinfo during argument parsing
authorAndrew Deason <adeason@sinenomine.net>
Thu, 22 Dec 2011 03:00:12 +0000 (22:00 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 27 Dec 2011 04:25:01 +0000 (20:25 -0800)
commitaf218dee6c517f4636a18c681bff6f1212a7d9c0
tree08bb9a62980dc6310aaa7cd00dca382788ac952e
parent83d3084e95ac025660f0b8064f49400eb94bfb60
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().

Change-Id: I058f2c7c2f0cc21db21c4b1d38ff63b9e9ed1562
Reviewed-on: http://gerrit.openafs.org/6400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afsd/afsd.c