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>
/* rxkad options */
cmd_OptionAsFlag(opts, OPT_dotted, &rxkadDisableDotCheck);
- if (auditFileName != NULL)
- osi_audit_file(auditFileName);
-
#ifndef AFS_NT40_ENV
if (geteuid() != 0) {
printf("bosserver: must be run as root.\n");
exit(1);
}
+ if (auditFileName != NULL)
+ osi_audit_file(auditFileName);
+
/* try to read the key from the config file */
tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
if (!tdir) {