1 # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 # DEALINGS IN THE SOFTWARE.
22 Integration of Display Manager (gdm/xdm/etc.) to X server communication pipe
23 with core server code - see sun-src/os/dtlogin.c for the main implementation.
25 diff --git a/configure.ac b/configure.ac
26 index 77ad53d..28eb2f1 100644
29 @@ -1492,6 +1492,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
30 XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
31 XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
32 XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
33 +XSERVER_SYS_LIBS="${XSERVER_SYS_LIBS} -lproject"
34 AC_SUBST([XSERVER_LIBS])
35 AC_SUBST([XSERVER_SYS_LIBS])
37 diff --git a/dix/main.c b/dix/main.c
38 index e2ec177..0eaa6aa 100644
41 @@ -116,6 +116,11 @@ Equipment Corporation.
46 +extern void DtloginInit(void);
47 +extern void DtloginCloseDown(void);
50 extern void Dispatch(void);
53 @@ -165,6 +170,13 @@ main(int argc, char *argv[], char *envp[])
54 InitBlockAndWakeupHandlers();
55 /* Perform any operating system dependent initializations you'd like */
59 + /* Create pipe for dtlogin authentication info before we tell dtlogin
60 + we're done and ready for it to run. */
64 if (serverGeneration == 1) {
65 CreateWellKnownSockets();
66 for (i = 1; i < MAXCLIENTS; i++)
67 @@ -302,6 +314,11 @@ main(int argc, char *argv[], char *envp[])
68 pthread_mutex_unlock(&serverRunningMutex);
72 + /* Return to root privs before calling the rest of close down */
73 + DtloginCloseDown ();
79 diff --git a/os/Makefile.am b/os/Makefile.am
80 index c4825ad..27d70ca 100644
83 @@ -35,6 +35,9 @@ if XDMCP
84 libos_la_SOURCES += $(XDMCP_SRCS)
87 +libos_la_SOURCES += dtlogin.c
88 +libos_la_LIBADD += -lproject
90 EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
92 if SPECIAL_DTRACE_OBJECTS
93 diff --git a/os/auth.c b/os/auth.c
94 index ac20de4..d43795b 100644
97 @@ -277,6 +277,19 @@ AddAuthorization(unsigned name_length, const char *name,
102 +/* This function is called from dtlogin.c
103 + * This is added to do "chmod authorization_file" since
104 + * this file is owned by root and we need to change this
105 + * to user logged on.
108 +GetAuthFilename(void)
110 + return (authorization_file);