From 60b30146a5d9861c6674bd7165be3a9dd840873c Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 12 Mar 2003 01:17:57 +0000 Subject: [PATCH] give auth file to _x11 user if it exists. Mimics xdm's behavior, so that kdm fully works with OpenBSD's X server. okay'd pval@ --- .../base3/patches/patch-kdm_backend_auth_c | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 x11/kde/base3/patches/patch-kdm_backend_auth_c diff --git a/x11/kde/base3/patches/patch-kdm_backend_auth_c b/x11/kde/base3/patches/patch-kdm_backend_auth_c new file mode 100644 index 00000000000..5357b0e1d5a --- /dev/null +++ b/x11/kde/base3/patches/patch-kdm_backend_auth_c @@ -0,0 +1,39 @@ +$OpenBSD: patch-kdm_backend_auth_c,v 1.1 2003/03/12 01:17:57 espie Exp $ +--- kdm/backend/auth.c.orig Tue Mar 11 17:41:21 2003 ++++ kdm/backend/auth.c Wed Mar 12 01:51:12 2003 +@@ -47,6 +47,9 @@ from The Open Group. + #include + #include + #include ++#ifdef __OpenBSD__ ++#include ++#endif + + #include + +@@ -345,6 +348,25 @@ SaveServerAuthorizations ( + return FALSE; + } + } ++#ifdef __OpenBSD__ ++ { ++ struct passwd *x11; ++ uid_t uid; ++ gid_t gid; ++ /* Give read capability to group _x11 */ ++ x11 = getpwnam("_x11"); ++ if (x11 == NULL) { ++ LogError("Can't find _x11 user\n"); ++ uid = getuid(); ++ gid = getgid(); ++ } else { ++ uid = x11->pw_uid; ++ gid = x11->pw_gid; ++ } ++ ++ fchown(fileno(auth_file), uid, gid); ++ } ++#endif + Debug ("File: %s auth: %p\n", d->authFile, auths); + ret = TRUE; + for (i = 0; i < count; i++)