From 61a8f0c5b8b1cf5022e4f20af4eb42cae1cb03f6 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Thu, 6 Jun 2019 14:08:53 -0600 Subject: [PATCH] volser: Avoid calling osi_audit before audit init volmain.c calls osi_audit before the audit facility is fully initialized. Commit 16d67791 (auditlogs-for-everyone-20050702) introduced the -auditlog parameter; it appears that it didn't remove the call to osi_audit (right after osi_audit_init) that was called before command line argument processing. This resulted in calling the audit facility before it was fulling initialized with the -auditlog and -audit-interface parameters. The 16d67791 commit replicated the osi_audit call after command line processing. Change-Id: Ia0c0054a2fb11892b5b30c0f0838a4d6bbdf9bbb Reviewed-on: https://gerrit.openafs.org/13772 Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/volser/volmain.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/volser/volmain.c b/src/volser/volmain.c index a56f657..22e3e15 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -461,7 +461,6 @@ main(int argc, char **argv) sigaction(SIGSEGV, &nsa, NULL); #endif osi_audit_init(); - osi_audit(VS_StartEvent, 0, AUD_END); /* Initialize dirpaths */ if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) { @@ -480,9 +479,12 @@ main(int argc, char **argv) } if (auditFileName) { - osi_audit_file(auditFileName); - osi_audit(VS_StartEvent, 0, AUD_END); + if (osi_audit_file(auditFileName)) { + fprintf(stderr, "error from opening auditlog %s\n", auditFileName); + exit(1); + } } + osi_audit(VS_StartEvent, 0, AUD_END); #ifdef AFS_SGI_VNODE_GLUE if (afs_init_kernel_config(-1) < 0) { printf -- 1.9.4