bozo: defer audit open until log dir is created and current 81/14381/4
authorMark Vitale <mvitale@sinenomine.net>
Tue, 6 Oct 2020 14:18:11 +0000 (10:18 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Sun, 25 Oct 2020 20:58:02 +0000 (16:58 -0400)
commitf372ec041a83288a5d096360f0ad8589e4db666a
treed3d5ad508708cc021fd9c76d6d79de2b7592f8ed
parent87041d676c93dfe35a085b9b5aaa73e74c08bc90
bozo: defer audit open until log dir is created and current

On a new OpenAFS install where the log directory has not yet been
created. 'bosserver -auditlog /usr/afs/logs/<auditlog>' (absolute path)
fails with ENOENT because the log directory doesn't exist yet.

Furthermore, 'bosserver -auditlog <auditlog>' (relative path) succeeds,
but the audit file is created in the current working directory when
bosserver was started, not in the expected log directory (Transarc
/usr/afs/logs).

Both problems have been present since bosserver audit log support was
introduced by commit 16d67791dce45e5d4ee9b854c796492ffcde2113
'auditlogs-for-everyone-20050702'.

Reorder the bosserver initialization steps to ensure that the log
directory has been created and is the current working directory, before
creating and opening the audit log.

Change-Id: I1dc3c136edd12c5425ef0b7a3212a18d4c3036f7
Reviewed-on: https://gerrit.openafs.org/14381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/bozo/bosserver.c