~ubuntu-branches/ubuntu/hardy/xdm/hardy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# HG changeset patch
# User ejka@imfi.kspu.ru
# Node ID 96e35758da2d69a8a9cd281b25c7dcb7364f5d3b
# Parent  24626b4361c54d148fbc4b7cf1a9f4f2de3ec74b
Ported parts of 905_debian_xdm.diff. Some changes are now done through
configure flags

Index: xdm/config/Makefile.am
===================================================================
--- xdm.orig/config/Makefile.am	2007-04-09 05:38:43.000000000 +0200
+++ xdm/config/Makefile.am	2007-08-13 17:07:38.000000000 +0200
@@ -55,7 +55,7 @@
     -DXDMPIDDIR="$(XDMPIDDIR)" -DXDMCONFIGDIR="$(XDMCONFIGDIR)" \
     -DXDMSCRIPTDIR="$(XDMSCRIPTDIR)" -DSU="$(SU)" \
     -DCHOOSERPATH="$(XDMLIBDIR)/chooser" $(XPMDEFINES) \
-    -DSHELL_CMD="$(SHELL_CMD)" $(MKTEMP_DEFINES)
+    -DSHELL_CMD="$(SHELL_CMD)" $(MKTEMP_DEFINES) -DXDMAUTHDIR="$(XDMAUTHDIR)"
 
 Xservers.ws: $(srcdir)/Xservers.ws.cpp
 	$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $(srcdir)/Xservers.ws.cpp | $(CPP_SED_MAGIC) > $@
Index: xdm/config/Xservers.ws.cpp
===================================================================
--- xdm.orig/config/Xservers.ws.cpp	2007-04-09 05:38:43.000000000 +0200
+++ xdm/config/Xservers.ws.cpp	2007-08-13 17:07:38.000000000 +0200
@@ -10,4 +10,26 @@
 XCOMM look like:
 XCOMM	XTerminalName:0 foreign
 XCOMM
-:0 local BINDIR/X :0 DEFAULTVT
+XCOMM When adding X servers, please keep the following things in mind:
+XCOMM - If the X server's number is not zero, it must be passed to the X
+XCOMM   server's command line as its first argument.
+XCOMM - When using the XFree86 X server, it is wise to add the vtXX
+XCOMM   option to each local X server, since this is the only sure way
+XCOMM   of knowing in advance which X server attaches to which virtual
+XCOMM   console.
+XCOMM - SECURITY NOTE: Always pass the "-nolisten tcp" option to the X
+XCOMM   server, as shown in the examples below, unless you know you
+XCOMM   need the X server listening on a TCP port.  Omitting this
+XCOMM   option can expose your X server to attacks from remote hosts.
+XCOMM   Note also that SSH's X11 port-forwarding option works even with
+XCOMM   X servers that do not listen on a TCP port, so you do not need
+XCOMM   to remove the "-nolisten tcp" option for SSH's benefit.
+XCOMM - See the Xserver(1) manpage for a description of X server
+XCOMM   options.  If you are using the XFree86 X server, see the
+XCOMM   XFree86(1) manpage for a description of options specific to it
+XCOMM   (such as "-depth").
+XCOMM
+XCOMM Examples for multiple local X displays:
+XCOMM :0 local BINDIR/X :0 vt9 -depth 15 -nolisten tcp
+XCOMM :1 local BINDIR/X :1 vt10 -depth 8 -nolisten tcp
+:0 local BINDIR/X :0 DEFAULTVT -nolisten tcp
Index: xdm/config/Xsession.cpp
===================================================================
--- xdm.orig/config/Xsession.cpp	2007-04-09 05:38:43.000000000 +0200
+++ xdm/config/Xsession.cpp	2007-08-13 17:07:38.000000000 +0200
@@ -4,84 +4,5 @@
 XCOMM $Xorg: Xsession,v 1.4 2000/08/17 19:54:17 cpqbld Exp $
 XCOMM $XFree86: xc/programs/xdm/config/Xsession,v 1.2 1998/01/11 03:48:32 dawes Exp $
 
-XCOMM redirect errors to a file in user's home directory if we can
-
-errfile="$HOME/.xsession-errors"
-if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null )
-then
-	exec > "$errfile" 2>&1
-else
-#ifdef MKTEMP_COMMAND
-	mktemp=MKTEMP_COMMAND
- 	for errfile in "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
-	do
-		if ef="$( umask 077 && $mktemp "$errfile.XXXXXX" 2> /dev/null)"
-		then
-			exec > "$ef" 2>&1
-			mv "$ef" "$errfile" 2> /dev/null
- 			break
- 		fi
-	done
-#else
-XCOMM Since this system doesn't have a mktemp command to allow secure
-XCOMM creation of files in shared directories, no fallback error log
-XCOMM is being used.   See https://bugs.freedesktop.org/show_bug.cgi?id=5898
-XCOMM
-XCOMM 	for errfile in "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
-XCOMM	do
-XCOMM		if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null )
-XCOMM		then
-XCOMM			exec > "$errfile" 2>&1
-XCOMM			break
-XCOMM		fi
-XCOMM	done
-
-	exec > /dev/null 2>&1
-
-#endif
-fi
-
-case $# in
-1)
-	case $1 in
-	failsafe)
-		exec BINDIR/xterm -geometry 80x24-0-0
-		;;
-	esac
-esac
-
-XCOMM The startup script is not intended to have arguments.
-
-startup=$HOME/.xsession
-resources=$HOME/.Xresources
-
-if [ -s "$startup" ]; then
-	if [ -x "$startup" ]; then
-		exec "$startup"
-	else
-		exec /bin/sh "$startup"
-	fi
-else
-	if [ -r "$resources" ]; then
-		BINDIR/xrdb -load "$resources"
-	fi
-#if defined(__SCO__) || defined(__UNIXWARE__)
-        [ -r /etc/default/xdesktops ] && {
-                . /etc/default/xdesktops
-        }
-
-        [ -r /etc/default/xdm ] && {
-                . /etc/default/xdm
-        }
-
-        XCOMM Allow the user to over-ride the system default desktop
-        [ -r $HOME/.xdmdesktop ] && {
-                . $HOME/.xdmdesktop
-        }
-
-        [ -n "$XDESKTOP" ] && {
-                exec `eval $XDESKTOP`
-        }
-#endif
-	exec BINDIR/xsm
-fi
+# invoke global X session script
+. /etc/X11/Xsession
Index: xdm/config/xdm-config.cpp
===================================================================
--- xdm.orig/config/xdm-config.cpp	2007-04-09 05:38:43.000000000 +0200
+++ xdm/config/xdm-config.cpp	2007-08-13 17:07:38.000000000 +0200
@@ -17,22 +17,22 @@
 DisplayManager.keyFile:		XDMCONFIGDIR/xdm-keys
 DisplayManager.servers:		XDMCONFIGDIR/Xservers
 DisplayManager.accessFile:	XDMCONFIGDIR/Xaccess
+DisplayManager.authDir:	XDMAUTHDIR
 DisplayManager*resources:	XDMCONFIGDIR/Xresources
 DisplayManager.willing:		SU nobody -c XDMSCRIPTDIR/Xwilling
 ! All displays should use authorization, but we cannot be sure
-! X terminals may not be configured that way, so they will require
-! individual resource settings.
+! X terminals will be configured to support it, so those that do not will
+! require individual resource settings.
 DisplayManager*authorize:	true
 !
 DisplayManager*chooser:		CHOOSERPATH
 DisplayManager*startup:		XDMSCRIPTDIR/Xstartup
 DisplayManager*session:		XDMSCRIPTDIR/Xsession
+DisplayManager*setup:		XDMSCRIPTDIR/Xsetup
 DisplayManager*reset:		XDMSCRIPTDIR/Xreset
 DisplayManager*authComplain:	true
-! The following three resources set up display :0 as the console.
-DisplayManager._0.setup:	XDMSCRIPTDIR/Xsetup_0
-DisplayManager._0.startup:	XDMSCRIPTDIR/GiveConsole
-DisplayManager._0.reset:	XDMSCRIPTDIR/TakeConsole
+DisplayManager*userPath:	/usr/local/bin:/usr/bin:/bin:/usr/games
+DisplayManager*systemPath:	/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 #ifdef XPM
 DisplayManager*loginmoveInterval:	10
 #endif /* XPM */
Index: xdm/configure.ac
===================================================================
--- xdm.orig/configure.ac	2007-08-13 17:06:57.000000000 +0200
+++ xdm/configure.ac	2007-08-13 17:07:38.000000000 +0200
@@ -222,6 +222,12 @@
 	[XDMSCRIPTDIR="$withval"], [XDMSCRIPTDIR="${XDMLIBDIR}"])
 AC_SUBST(XDMSCRIPTDIR)
 
+AC_ARG_WITH(xdmauthdir,
+	AC_HELP_STRING([--with-xdmauthdir=<pathname>],
+	  [specify a directory where authentication cookie files should be stored (default is same as xdmconfigdir)]),
+	[XDMAUTHDIR="$withval"], [XDMAUTHDIR="${XDMCONFIGDIR}"])
+AC_SUBST(XDMAUTHDIR)
+
 AC_ARG_WITH(logdir,
 	AC_HELP_STRING([--with-logdir=<pathname>],
 	  [specify directory for xdm log files (default=/var/log)]),
@@ -527,7 +533,7 @@
 
 # -DDEF_AUTH_DIR="$(XDMDIR)"
 
-AC_DEFINE_DIR(DEF_AUTH_DIR, XDMCONFIGDIR, 
+AC_DEFINE_DIR(DEF_AUTH_DIR, XDMAUTHDIR,
 	[Define to pathname where authentication cookie files should be stored])
 
 # -DDEF_GREETER_LIB="$(XDMDIR)/libXdmGreet.so"
Index: xdm/xdm.man.cpp
===================================================================
--- xdm.orig/xdm.man.cpp	2007-08-13 17:06:57.000000000 +0200
+++ xdm/xdm.man.cpp	2007-08-13 17:07:38.000000000 +0200
@@ -306,7 +306,7 @@
 This names a directory under which
 .I xdm
 stores authorization files while initializing the session.  The
-default value is \fI XDMDIR.\fP
+default value is \fI XDMAUTHDIR.\fP
 Can be overridden for specific displays by
 DisplayManager.\fIDISPLAY\fP.authFile.
 .IP \fBDisplayManager.autoRescan\fP
Index: xdm/Makefile.am
===================================================================
--- xdm.orig/Makefile.am	2007-04-09 05:38:43.000000000 +0200
+++ xdm/Makefile.am	2007-08-13 17:07:38.000000000 +0200
@@ -116,6 +116,7 @@
 	-D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
 	-DCHOOSERPATH=$(xdmlibdir)/chooser -DXDMLOGDIR=$(XDMLOGDIR) \
 	-DXDMDIR=$(XDMCONFIGDIR) -DBINDIR=$(bindir) -DXDMPIDDIR=$(XDMPIDDIR) \
+	-DXDMAUTHDIR=$(XDMAUTHDIR) \
 	-D__appmansuffix__=$(APP_MAN_SUFFIX) \
 	-D__filemansuffix__=$(FILE_MAN_SUFFIX) \
 	-D__libmansuffix__=$(LIB_MAN_SUFFIX) \