From 664c3b6ba859f76984d4ef0eb1c130ca3f4da98f Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 14 Feb 2024 17:53:10 +0100 Subject: [PATCH] os: move rpcauth prototypes to separate header The rpc authentication handling isn't really OS specific, and only few sites actually need to call it, so at least it's prototypes are better off in some separate header. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- os/access.c | 1 + os/auth.c | 2 ++ os/osdep.h | 10 ---------- os/rpcauth.c | 1 + os/rpcauth.h | 13 +++++++++++++ 5 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 os/rpcauth.h diff --git a/os/access.c b/os/access.c index 3b0662105..6f6aec14f 100644 --- a/os/access.c +++ b/os/access.c @@ -191,6 +191,7 @@ SOFTWARE. #include "osdep.h" #include "xace.h" +#include "rpcauth.h" Bool defeatAccessControl = FALSE; diff --git a/os/auth.c b/os/auth.c index 243d3c5a8..49005f6b0 100644 --- a/os/auth.c +++ b/os/auth.c @@ -48,6 +48,8 @@ from The Open Group. #endif #include /* for arc4random_buf() */ +#include "rpcauth.h" + struct protocol { unsigned short name_length; const char *name; diff --git a/os/osdep.h b/os/osdep.h index 67958fd77..a0e4d06ca 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -171,16 +171,6 @@ extern int XdmRemoveCookie(AuthRemCArgs); extern int XdmResetCookie(AuthRstCArgs); #endif -/* in rpcauth.c */ -#ifdef SECURE_RPC -extern void SecureRPCInit(AuthInitArgs); -extern XID SecureRPCCheck(AuthCheckArgs); -extern int SecureRPCAdd(AuthAddCArgs); -extern int SecureRPCFromID(AuthFromIDArgs); -extern int SecureRPCRemove(AuthRemCArgs); -extern int SecureRPCReset(AuthRstCArgs); -#endif - #ifdef XDMCP /* in xdmcp.c */ extern void XdmcpUseMsg(void); diff --git a/os/rpcauth.c b/os/rpcauth.c index 0a752f013..9209021e0 100644 --- a/os/rpcauth.c +++ b/os/rpcauth.c @@ -43,6 +43,7 @@ from The Open Group. #include "os.h" #include "osdep.h" #include "dixstruct.h" +#include "rpcauth.h" #include diff --git a/os/rpcauth.h b/os/rpcauth.h new file mode 100644 index 000000000..10fc33840 --- /dev/null +++ b/os/rpcauth.h @@ -0,0 +1,13 @@ +#ifndef _XSERVER_OS_RPCAUTH_H +#define _XSERVER_OS_RPCAUTH_H + +#include "osdep.h" + +void SecureRPCInit(AuthInitArgs); +XID SecureRPCCheck(AuthCheckArgs); +int SecureRPCAdd(AuthAddCArgs); +int SecureRPCFromID(AuthFromIDArgs); +int SecureRPCRemove(AuthRemCArgs); +int SecureRPCReset(AuthRstCArgs); + +#endif /* _XSERVER_OS_RPCAUTH_H */