open-src/xserver/xorg/dtlogin-userinfo.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Fri, 25 Mar 2011 17:37:55 -0700
changeset 1097 243d7ed7a10c
parent 1088 1c99106ccbe0
child 1124 7bc7e624f965
permissions -rw-r--r--
6991718 Removal of 32-bit X servers [PSARC/2010/382]

# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
diff -Nurp -x '*~' -x '*.orig' configure.ac configure.ac
diff -Nurp -x '*~' -x '*.orig' configure.ac configure.ac
--- configure.ac	2011-02-04 11:37:03.000000000 -0800
+++ configure.ac	2011-02-15 15:53:16.732320605 -0800
@@ -1472,6 +1472,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUI
 XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
 XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
 XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
+XSERVER_SYS_LIBS="${XSERVER_SYS_LIBS} -lproject"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
diff -Nurp -x '*~' -x '*.orig' dix/main.c dix/main.c
--- dix/main.c	2010-12-02 12:16:53.000000000 -0800
+++ dix/main.c	2011-02-15 15:53:16.732690379 -0800
@@ -116,6 +116,11 @@ Equipment Corporation.
 #include "dpmsproc.h"
 #endif
 
+#ifdef SUNSOFT
+extern void DtloginInit(void);
+extern void DtloginCloseDown(void);
+#endif /* SUNSOFT */
+
 extern void Dispatch(void);
 
 extern void InitProcVectors(void);
@@ -168,6 +173,13 @@ int main(int argc, char *argv[], char *e
 	InitBlockAndWakeupHandlers();
 	/* Perform any operating system dependent initializations you'd like */
 	OsInit();
+
+#ifdef SUNSOFT
+	/* Create pipe for dtlogin authentication info before we tell dtlogin 
+	   we're done and ready for it to run. */
+	DtloginInit ();
+#endif
+
 	if(serverGeneration == 1)
 	{
 	    CreateWellKnownSockets();
@@ -290,6 +302,11 @@ int main(int argc, char *argv[], char *e
 
 	Dispatch();
 
+#ifdef SUNSOFT
+	/* Return to root privs before calling the rest of close down */
+	DtloginCloseDown ();
+#endif
+
         UndisplayDevices();
 
 	/* Now free up whatever must be freed */
diff -Nurp -x '*~' -x '*.orig' os/Makefile.am os/Makefile.am
--- os/Makefile.am	2010-03-25 22:17:44.000000000 -0700
+++ os/Makefile.am	2011-02-15 15:53:16.732911213 -0800
@@ -47,6 +47,9 @@ if NEED_STRLCAT
 libos_la_SOURCES += $(STRLCAT_SRCS)
 endif
 
+libos_la_SOURCES += dtlogin.c
+libos_la_LIBADD = -lproject
+
 EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
      $(XDMCP_SRCS) $(STRLCAT_SRCS)
 
diff -Nurp -x '*~' -x '*.orig' os/auth.c os/auth.c
--- os/auth.c	2010-05-12 20:16:31.000000000 -0700
+++ os/auth.c	2011-02-15 15:53:16.733178408 -0800
@@ -290,6 +290,19 @@ AddAuthorization (unsigned name_length, 
     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