diff --git a/Xext/security.c b/Xext/security.c index 84c468e62..d1f0df9e4 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -30,6 +30,7 @@ in this Software without prior written authorization from The Open Group. #include "dix/dix_priv.h" #include "dix/registry_priv.h" +#include "os/audit.h" #include "scrnintstr.h" #include "inputstr.h" diff --git a/dix/main.c b/dix/main.c index 567e1324e..ea81defba 100644 --- a/dix/main.c +++ b/dix/main.c @@ -86,6 +86,7 @@ Equipment Corporation. #include "dix/callback_priv.h" #include "dix/dix_priv.h" #include "dix/registry_priv.h" +#include "os/audit.h" #include "scrnintstr.h" #include "misc.h" diff --git a/include/os.h b/include/os.h index 24ab2ba07..94853d26c 100644 --- a/include/os.h +++ b/include/os.h @@ -286,8 +286,6 @@ OsSignal(int /* sig */ , OsSigHandlerPtr /* handler */ ); extern _X_EXPORT OsSigWrapperPtr OsRegisterSigWrapper(OsSigWrapperPtr newWrap); -extern _X_EXPORT int auditTrailLevel; - extern _X_EXPORT void LockServer(void); extern _X_EXPORT void @@ -639,14 +637,6 @@ LogHdrMessage(MessageType type, const char *msg_format, _X_ATTRIBUTE_PRINTF(2, 0) _X_ATTRIBUTE_PRINTF(4, 5); -extern _X_EXPORT void -FreeAuditTimer(void); -extern _X_EXPORT void -AuditF(const char *f, ...) -_X_ATTRIBUTE_PRINTF(1, 2); -extern _X_EXPORT void -VAuditF(const char *f, va_list args) -_X_ATTRIBUTE_PRINTF(1, 0); extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2) diff --git a/os/audit.h b/os/audit.h new file mode 100644 index 000000000..205109489 --- /dev/null +++ b/os/audit.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + */ +#ifndef _XSERVER_OS_AUDIT_H +#define _XSERVER_OS_AUDIT_H + +#include +#include + +extern int auditTrailLevel; + +void FreeAuditTimer(void); + +void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2); +void VAuditF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0); + +#endif /* _XSERVER_OS_AUDIT_H */ diff --git a/os/connection.c b/os/connection.c index 71420a248..aad3e74fb 100644 --- a/os/connection.c +++ b/os/connection.c @@ -99,6 +99,7 @@ SOFTWARE. #endif /* WIN32 */ #include "dix/dix_priv.h" +#include "os/audit.h" #include "misc.h" /* for typedef of pointer */ #include "osdep.h" diff --git a/os/log.c b/os/log.c index ae02dc746..7e71ff8af 100644 --- a/os/log.c +++ b/os/log.c @@ -87,6 +87,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include /* for malloc() */ #include +#include "os/audit.h" #include "os/fmt.h" #include "input.h" @@ -902,6 +903,8 @@ static int nrepeat = 0; static int oldlen = -1; static OsTimerPtr auditTimer = NULL; +int auditTrailLevel = 1; + void FreeAuditTimer(void) { diff --git a/os/utils.c b/os/utils.c index df56b5b9b..7b5e75d38 100644 --- a/os/utils.c +++ b/os/utils.c @@ -78,6 +78,9 @@ __stdcall unsigned long GetTickCount(void); #define TRANS_SERVER #define TRANS_REOPEN #include + +#include "os/audit.h" + #include "input.h" #include "dixfont.h" #include @@ -107,11 +110,8 @@ __stdcall unsigned long GetTickCount(void); #include "dixstruct.h" #include "xkbsrv.h" - #include "picture.h" - #include "miinitext.h" - #include "present.h" Bool noTestExtensions; @@ -192,8 +192,6 @@ Bool AllowByteSwappedClients = FALSE; Bool PanoramiXExtensionDisabledHack = FALSE; #endif -int auditTrailLevel = 1; - char *SeatId = NULL; sig_atomic_t inSignalContext = FALSE;