xserver: Branch 'master' - 5 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 22 23:46:54 UTC 2024


 hw/xwin/winauth.c |    1 
 os/access.c       |    2 +
 os/auth.c         |    5 +++
 os/auth.h         |   29 ++++++++++++++++++++
 os/connection.c   |    1 
 os/mitauth.c      |    1 
 os/mitauth.h      |   13 +++++++++
 os/osdep.h        |   77 ------------------------------------------------------
 os/rpcauth.c      |    1 
 os/rpcauth.h      |   13 +++++++++
 os/utils.c        |    1 
 os/xdmauth.c      |    2 +
 os/xdmauth.h      |   13 +++++++++
 os/xdmcp.c        |    2 +
 os/xdmcp.h        |   27 ++++++++++++++++++
 15 files changed, 111 insertions(+), 77 deletions(-)

New commits:
commit 6816605e220023e7841406544c43bdbcac5de370
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Feb 14 19:45:59 2024 +0100

    os: move Auth* function types to separate header
    
    The generic auth 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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>

diff --git a/os/auth.h b/os/auth.h
new file mode 100644
index 000000000..f632490d6
--- /dev/null
+++ b/os/auth.h
@@ -0,0 +1,29 @@
+#ifndef _XSERVER_OS_AUTH_H
+#define _XSERVER_OS_AUTH_H
+
+#include <X11/X.h>
+
+#include "dix.h"
+
+#define AuthInitArgs void
+typedef void (*AuthInitFunc) (AuthInitArgs);
+
+#define AuthAddCArgs unsigned short data_length, const char *data, XID id
+typedef int (*AuthAddCFunc) (AuthAddCArgs);
+
+#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason
+typedef XID (*AuthCheckFunc) (AuthCheckArgs);
+
+#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
+typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
+
+#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return
+typedef XID (*AuthGenCFunc) (AuthGenCArgs);
+
+#define AuthRemCArgs unsigned short data_length, const char *data
+typedef int (*AuthRemCFunc) (AuthRemCArgs);
+
+#define AuthRstCArgs void
+typedef int (*AuthRstCFunc) (AuthRstCArgs);
+
+#endif /* _XSERVER_OS_AUTH_H */
diff --git a/os/mitauth.h b/os/mitauth.h
index d67a58c95..143fa46bc 100644
--- a/os/mitauth.h
+++ b/os/mitauth.h
@@ -1,7 +1,7 @@
 #ifndef _XSERVER_OS_MITAUTH_H
 #define _XSERVER_OS_MITAUTH_H
 
-#include "osdep.h"
+#include "auth.h"
 
 XID MitCheckCookie(AuthCheckArgs);
 XID MitGenerateCookie(AuthGenCArgs);
diff --git a/os/osdep.h b/os/osdep.h
index 19a7430d9..5b64f1a38 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -85,29 +85,6 @@ typedef struct _connectionOutput *ConnectionOutputPtr;
 
 struct _osComm;
 
-#define AuthInitArgs void
-typedef void (*AuthInitFunc) (AuthInitArgs);
-
-#define AuthAddCArgs unsigned short data_length, const char *data, XID id
-typedef int (*AuthAddCFunc) (AuthAddCArgs);
-
-#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason
-typedef XID (*AuthCheckFunc) (AuthCheckArgs);
-
-#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
-typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
-
-#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return
-typedef XID (*AuthGenCFunc) (AuthGenCArgs);
-
-#define AuthRemCArgs unsigned short data_length, const char *data
-typedef int (*AuthRemCFunc) (AuthRemCArgs);
-
-#define AuthRstCArgs void
-typedef int (*AuthRstCFunc) (AuthRstCArgs);
-
-typedef void (*OsCloseFunc) (ClientPtr);
-
 typedef int (*OsFlushFunc) (ClientPtr who, struct _osComm * oc, char *extraBuf,
                             int extraCount);
 
diff --git a/os/rpcauth.h b/os/rpcauth.h
index 10fc33840..255eafcea 100644
--- a/os/rpcauth.h
+++ b/os/rpcauth.h
@@ -1,7 +1,7 @@
 #ifndef _XSERVER_OS_RPCAUTH_H
 #define _XSERVER_OS_RPCAUTH_H
 
-#include "osdep.h"
+#include "auth.h"
 
 void SecureRPCInit(AuthInitArgs);
 XID SecureRPCCheck(AuthCheckArgs);
diff --git a/os/xdmauth.h b/os/xdmauth.h
index 7a42c8215..e922b2e99 100644
--- a/os/xdmauth.h
+++ b/os/xdmauth.h
@@ -1,7 +1,7 @@
 #ifndef _XSERVER_OS_XDMAUTH_H
 #define _XSERVER_OS_XDMAUTH_H
 
-#include "osdep.h"
+#include "auth.h"
 
 XID XdmCheckCookie(AuthCheckArgs);
 int XdmAddCookie(AuthAddCArgs);
commit 5620102dfeb634f107bcfee46942065a0eed3cf6
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Feb 14 19:33:38 2024 +0100

    os: move mitauth prototypes to separate header
    
    The MIT 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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>

diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index 4e1b26d13..8d151c36a 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -38,6 +38,7 @@
 /* Includes for authorization */
 #include "securitysrv.h"
 #include "os/osdep.h"
+#include "os/mitauth.h"
 
 #include <xcb/xcb.h>
 
diff --git a/os/auth.c b/os/auth.c
index 9f33d86c2..6e3f53152 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -51,6 +51,7 @@ from The Open Group.
 #include "rpcauth.h"
 #include "xdmcp.h"
 #include "xdmauth.h"
+#include "mitauth.h"
 
 struct protocol {
     unsigned short name_length;
diff --git a/os/mitauth.c b/os/mitauth.c
index eb5ca3998..44e3329c2 100644
--- a/os/mitauth.c
+++ b/os/mitauth.c
@@ -38,6 +38,7 @@ from The Open Group.
 #include <X11/X.h>
 #include "os.h"
 #include "osdep.h"
+#include "mitauth.h"
 #include "dixstruct.h"
 
 static struct auth {
diff --git a/os/mitauth.h b/os/mitauth.h
new file mode 100644
index 000000000..d67a58c95
--- /dev/null
+++ b/os/mitauth.h
@@ -0,0 +1,13 @@
+#ifndef _XSERVER_OS_MITAUTH_H
+#define _XSERVER_OS_MITAUTH_H
+
+#include "osdep.h"
+
+XID MitCheckCookie(AuthCheckArgs);
+XID MitGenerateCookie(AuthGenCArgs);
+int MitAddCookie(AuthAddCArgs);
+int MitFromID(AuthFromIDArgs);
+int MitRemoveCookie(AuthRemCArgs);
+int MitResetCookie(AuthRstCArgs);
+
+#endif /* _XSERVER_OS_MITAUTH_H */
diff --git a/os/osdep.h b/os/osdep.h
index 07d42d0c8..19a7430d9 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -154,12 +154,4 @@ extern Bool ComputeLocalClient(ClientPtr client);
 /* in auth.c */
 extern void GenerateRandomData(int len, char *buf);
 
-/* in mitauth.c */
-extern XID MitCheckCookie(AuthCheckArgs);
-extern XID MitGenerateCookie(AuthGenCArgs);
-extern int MitAddCookie(AuthAddCArgs);
-extern int MitFromID(AuthFromIDArgs);
-extern int MitRemoveCookie(AuthRemCArgs);
-extern int MitResetCookie(AuthRstCArgs);
-
 #endif                          /* _OSDEP_H_ */
commit 8c4759a68e335bc17eb0b5cf8a3998e128c7b265
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Feb 14 19:24:31 2024 +0100

    os: move xdmauth prototypes to separate header
    
    The xdmcp 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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>

diff --git a/os/auth.c b/os/auth.c
index 2518b5293..9f33d86c2 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -50,6 +50,7 @@ from The Open Group.
 
 #include "rpcauth.h"
 #include "xdmcp.h"
+#include "xdmauth.h"
 
 struct protocol {
     unsigned short name_length;
diff --git a/os/osdep.h b/os/osdep.h
index fb08d8588..07d42d0c8 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -162,14 +162,4 @@ extern int MitFromID(AuthFromIDArgs);
 extern int MitRemoveCookie(AuthRemCArgs);
 extern int MitResetCookie(AuthRstCArgs);
 
-/* in xdmauth.c */
-#ifdef HASXDMAUTH
-extern XID XdmCheckCookie(AuthCheckArgs);
-extern int XdmAddCookie(AuthAddCArgs);
-extern int XdmFromID(AuthFromIDArgs);
-extern int XdmRemoveCookie(AuthRemCArgs);
-extern int XdmResetCookie(AuthRstCArgs);
-extern void XdmAuthenticationInit(const char *cookie, int cookie_length);
-#endif
-
 #endif                          /* _OSDEP_H_ */
diff --git a/os/xdmauth.c b/os/xdmauth.c
index aa1c113d2..cffd70ad0 100644
--- a/os/xdmauth.c
+++ b/os/xdmauth.c
@@ -46,6 +46,7 @@ from The Open Group.
 #include "os.h"
 #include "osdep.h"
 #include "xdmcp.h"
+#include "xdmauth.h"
 #include "dixstruct.h"
 
 #ifdef HASXDMAUTH
diff --git a/os/xdmauth.h b/os/xdmauth.h
new file mode 100644
index 000000000..7a42c8215
--- /dev/null
+++ b/os/xdmauth.h
@@ -0,0 +1,13 @@
+#ifndef _XSERVER_OS_XDMAUTH_H
+#define _XSERVER_OS_XDMAUTH_H
+
+#include "osdep.h"
+
+XID XdmCheckCookie(AuthCheckArgs);
+int XdmAddCookie(AuthAddCArgs);
+int XdmFromID(AuthFromIDArgs);
+int XdmRemoveCookie(AuthRemCArgs);
+int XdmResetCookie(AuthRstCArgs);
+void XdmAuthenticationInit(const char *cookie, int cookie_length);
+
+#endif /* _XSERVER_OS_XDMAUTH_H */
diff --git a/os/xdmcp.c b/os/xdmcp.c
index a264d96af..4d4690c70 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -41,6 +41,7 @@
 #include "misc.h"
 #include "osdep.h"
 #include "xdmcp.h"
+#include "xdmauth.h"
 #include "input.h"
 #include "dixstruct.h"
 #include "opaque.h"
commit 194a7c203234e50d51fdd3b8bef646ca898507df
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Feb 14 18:45:35 2024 +0100

    os: move xdmcp prototypes to separate header
    
    The xdmcp 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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>

diff --git a/os/access.c b/os/access.c
index 6f6aec14f..ef6147f03 100644
--- a/os/access.c
+++ b/os/access.c
@@ -192,6 +192,7 @@ SOFTWARE.
 
 #include "xace.h"
 #include "rpcauth.h"
+#include "xdmcp.h"
 
 Bool defeatAccessControl = FALSE;
 
diff --git a/os/auth.c b/os/auth.c
index 49005f6b0..2518b5293 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -49,6 +49,7 @@ from The Open Group.
 #include   <stdlib.h>       /* for arc4random_buf() */
 
 #include "rpcauth.h"
+#include "xdmcp.h"
 
 struct protocol {
     unsigned short name_length;
diff --git a/os/connection.c b/os/connection.c
index 8d4b66061..d957ad661 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -117,6 +117,7 @@ SOFTWARE.
 #endif
 
 #include "probes.h"
+#include "xdmcp.h"
 
 struct ospoll   *server_poll;
 
diff --git a/os/osdep.h b/os/osdep.h
index a0e4d06ca..fb08d8588 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -169,32 +169,6 @@ extern int XdmAddCookie(AuthAddCArgs);
 extern int XdmFromID(AuthFromIDArgs);
 extern int XdmRemoveCookie(AuthRemCArgs);
 extern int XdmResetCookie(AuthRstCArgs);
-#endif
-
-#ifdef XDMCP
-/* in xdmcp.c */
-extern void XdmcpUseMsg(void);
-extern int XdmcpOptions(int argc, char **argv, int i);
-extern void XdmcpRegisterConnection(int type, const char *address, int addrlen);
-extern void XdmcpRegisterAuthorizations(void);
-extern void XdmcpRegisterAuthorization(const char *name, int namelen);
-extern void XdmcpInit(void);
-extern void XdmcpReset(void);
-extern void XdmcpOpenDisplay(int sock);
-extern void XdmcpCloseDisplay(int sock);
-extern void XdmcpRegisterAuthentication(const char *name,
-                                        int namelen,
-                                        const char *data,
-                                        int datalen,
-                                        ValidatorFunc Validator,
-                                        GeneratorFunc Generator,
-                                        AddAuthorFunc AddAuth);
-
-struct sockaddr_in;
-extern void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr);
-#endif
-
-#ifdef HASXDMAUTH
 extern void XdmAuthenticationInit(const char *cookie, int cookie_length);
 #endif
 
diff --git a/os/utils.c b/os/utils.c
index 98f532d89..ddcfb629f 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -83,6 +83,7 @@ __stdcall unsigned long GetTickCount(void);
 #include <X11/fonts/libxfont2.h>
 #include "osdep.h"
 #include "bug.h"
+#include "xdmcp.h"
 #include "extension.h"
 #include <signal.h>
 #ifndef WIN32
diff --git a/os/xdmauth.c b/os/xdmauth.c
index ba446e013..aa1c113d2 100644
--- a/os/xdmauth.c
+++ b/os/xdmauth.c
@@ -45,6 +45,7 @@ from The Open Group.
 #include <X11/Xtrans/Xtrans.h>
 #include "os.h"
 #include "osdep.h"
+#include "xdmcp.h"
 #include "dixstruct.h"
 
 #ifdef HASXDMAUTH
diff --git a/os/xdmcp.c b/os/xdmcp.c
index 2b7255644..a264d96af 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -40,6 +40,7 @@
 #include <X11/Xmd.h>
 #include "misc.h"
 #include "osdep.h"
+#include "xdmcp.h"
 #include "input.h"
 #include "dixstruct.h"
 #include "opaque.h"
diff --git a/os/xdmcp.h b/os/xdmcp.h
new file mode 100644
index 000000000..e8b1a3c3e
--- /dev/null
+++ b/os/xdmcp.h
@@ -0,0 +1,27 @@
+#ifndef _XSERVER_OS_XDMCP_H
+#define _XSERVER_OS_XDMCP_H
+
+#include "osdep.h"
+
+/* in xdmcp.c */
+void XdmcpUseMsg(void);
+int XdmcpOptions(int argc, char **argv, int i);
+void XdmcpRegisterConnection(int type, const char *address, int addrlen);
+void XdmcpRegisterAuthorizations(void);
+void XdmcpRegisterAuthorization(const char *name, int namelen);
+void XdmcpInit(void);
+void XdmcpReset(void);
+void XdmcpOpenDisplay(int sock);
+void XdmcpCloseDisplay(int sock);
+void XdmcpRegisterAuthentication(const char *name,
+                                 int namelen,
+                                 const char *data,
+                                 int datalen,
+                                 ValidatorFunc Validator,
+                                 GeneratorFunc Generator,
+                                 AddAuthorFunc AddAuth);
+
+struct sockaddr_in;
+void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr);
+
+#endif /* _XSERVER_OS_XDMCP_H */
commit 664c3b6ba859f76984d4ef0eb1c130ca3f4da98f
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Feb 14 17:53:10 2024 +0100

    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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>

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   <stdlib.h>       /* 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 <rpc/rpc.h>
 
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 */


More information about the xorg-commit mailing list