dtlogin-userinfo.patch revision 1351
1127N/A# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1127N/A#
1127N/A# Permission is hereby granted, free of charge, to any person obtaining a
1127N/A# copy of this software and associated documentation files (the "Software"),
1127N/A# to deal in the Software without restriction, including without limitation
1127N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1127N/A# and/or sell copies of the Software, and to permit persons to whom the
1127N/A# Software is furnished to do so, subject to the following conditions:
1127N/A#
1127N/A# The above copyright notice and this permission notice (including the next
1127N/A# paragraph) shall be included in all copies or substantial portions of the
1127N/A# Software.
1127N/A#
1127N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1127N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1127N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1127N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1127N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1127N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1127N/A# DEALINGS IN THE SOFTWARE.
1127N/A
1127N/AIntegration of Display Manager (gdm/xdm/etc.) to X server communication pipe
1127N/Awith core server code - see sun-src/os/dtlogin.c for the main implementation.
1127N/A
1127N/Adiff --git a/configure.ac b/configure.ac
1220N/Aindex 77ad53d..28eb2f1 100644
1214N/A--- a/configure.ac
1127N/A+++ b/configure.ac
1127N/A@@ -1492,6 +1492,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
1127N/A XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
1127N/A XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
1470N/A XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
1127N/A+XSERVER_SYS_LIBS="${XSERVER_SYS_LIBS} -lproject"
1127N/A AC_SUBST([XSERVER_LIBS])
1129N/A AC_SUBST([XSERVER_SYS_LIBS])
1127N/A
1127N/Adiff --git a/dix/main.c b/dix/main.c
1127N/Aindex e2ec177..0eaa6aa 100644
1127N/A--- a/dix/main.c
1127N/A+++ b/dix/main.c
1127N/A@@ -116,6 +116,11 @@ Equipment Corporation.
1127N/A #include "dpmsproc.h"
1470N/A #endif
1127N/A
1127N/A+#ifdef SUNSOFT
1470N/A+extern void DtloginInit(void);
1470N/A+extern void DtloginCloseDown(void);
1127N/A+#endif /* SUNSOFT */
1127N/A+
1470N/A extern void Dispatch(void);
1127N/A
1470N/A #ifdef XQUARTZ
1470N/A@@ -165,6 +170,13 @@ main(int argc, char *argv[], char *envp[])
1470N/A InitBlockAndWakeupHandlers();
1470N/A /* Perform any operating system dependent initializations you'd like */
1470N/A OsInit();
1470N/A+
1127N/A+#ifdef SUNSOFT
1127N/A+ /* Create pipe for dtlogin authentication info before we tell dtlogin
1470N/A+ we're done and ready for it to run. */
1127N/A+ DtloginInit ();
1470N/A+#endif
1127N/A+
1127N/A if (serverGeneration == 1) {
1127N/A CreateWellKnownSockets();
1470N/A for (i = 1; i < MAXCLIENTS; i++)
1127N/A@@ -302,6 +314,11 @@ main(int argc, char *argv[], char *envp[])
1127N/A pthread_mutex_unlock(&serverRunningMutex);
1127N/A #endif
1127N/A
1127N/A+#ifdef SUNSOFT
1127N/A+ /* Return to root privs before calling the rest of close down */
1127N/A+ DtloginCloseDown ();
1127N/A+#endif
1127N/A+
1127N/A UndisplayDevices();
1127N/A DisableAllDevices();
1127N/A
1127N/Adiff --git a/os/Makefile.am b/os/Makefile.am
1127N/Aindex c4825ad..27d70ca 100644
1127N/A--- a/os/Makefile.am
1127N/A+++ b/os/Makefile.am
1127N/A@@ -35,6 +35,9 @@ if XDMCP
1127N/A libos_la_SOURCES += $(XDMCP_SRCS)
1127N/A endif
1127N/A
+libos_la_SOURCES += dtlogin.c
+libos_la_LIBADD += -lproject
+
EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
if SPECIAL_DTRACE_OBJECTS
diff --git a/os/auth.c b/os/auth.c
index ac20de4..d43795b 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -277,6 +277,19 @@ AddAuthorization(unsigned name_length, const char *name,
return 0;
}
+#ifdef SUNSOFT
+/* This function is called from dtlogin.c
+ * This is added to do "chmod authorization_file" since
+ * this file is owned by root and we need to change this
+ * to user logged on.
+ */
+const char *
+GetAuthFilename(void)
+{
+ return (authorization_file);
+}
+#endif
+
#ifdef XCSECURITY
XID