xdm: Changes to 'debian-unstable'
.gitignore | 4
COPYING | 175 +++++++++++-
ChangeLog | 373 +++++++++++++++++++++++++
Makefile.am | 17 -
README | 30 ++
access.c | 162 +++++------
acinclude.m4 | 32 +-
app-defaults/Chooser.ad | 2
auth.c | 317 +++++++++++----------
choose.c | 122 ++++----
chooser.c | 185 ++++++------
config/GiveConsole | 1
config/Makefile.am | 5
config/README | 1
config/TakeConsole | 1
config/Xaccess | 3
config/Xreset.cpp | 4
config/Xresources.cpp | 2
config/Xservers.fs | 1
config/Xservers.ws.cpp | 1
config/Xsession.cpp | 3
config/Xsetup_0 | 1
config/Xstartup.cpp | 4
config/Xwilling | 1
config/xdm-config.cpp | 4
configure.ac | 81 ++++-
cpprules.in | 9
daemon.c | 9
debian/changelog | 16 -
debian/patches/00_warning_fixes.diff | 85 -----
debian/patches/01_xdm_include_fcntl.diff | 15 -
debian/patches/02_xdm_zombie_no_error.diff | 10
debian/patches/03_spelling.diff | 18 -
debian/patches/04_xdm_init_log_earlier.diff | 39 --
debian/patches/06_hurd_utsname.diff | 14
debian/patches/07_xdm_more_debug.diff | 56 ---
debian/patches/08_xdm_execute_more_debug.diff | 46 ---
debian/patches/09_xdm_syserrormsg.diff | 50 ---
debian/patches/10_xdm_better_logging.diff | 186 ------------
debian/patches/11_xdm_strerror.diff | 55 ---
debian/patches/12_remove_pidfile.diff | 51 ---
debian/patches/log_sourcing_better.diff | 14
debian/patches/openlog.diff | 48 ---
debian/patches/selinux_support.diff | 25 +
debian/patches/series | 14
dm.c | 154 +++++-----
dm.h | 247 ++++++++---------
dm_auth.h | 42 +-
dm_error.h | 27 -
dm_socket.h | 18 -
dpylist.c | 16 -
error.c | 120 ++++----
file.c | 13
genauth.c | 89 ++----
greet.h | 124 ++++----
greeter/Login.c | 300 +++++++++-----------
greeter/Login.h | 83 ++---
greeter/LoginP.h | 61 ++--
greeter/Makefile.am | 6
greeter/greet.c | 129 ++++----
greeter/verify.c | 110 +++----
krb5auth.c | 4
mitauth.c | 10
netaddr.c | 122 ++++----
policy.c | 45 +--
prngc.c | 21 -
protodpy.c | 18 -
reset.c | 14
resource.c | 150 +++-------
rpcauth.c | 14
server.c | 41 +-
session.c | 103 +++----
socket.c | 148 ++++------
streams.c | 16 -
util.c | 76 +++--
xdm.man.cpp | 70 ++--
xdmauth.c | 21 -
xdmcp.c | 375 +++++++++++---------------
xdmshell.c | 81 -----
79 files changed, 2479 insertions(+), 2681 deletions(-)
New commits:
commit 3e78ede22f8a6b4c7701df319cd2128a26ff1d47
Author: Brice Goglin <bgoglin@debian.org>
Date: Sun Dec 6 22:06:32 2009 +0100
Try to refresh patches, not ready yet
diff --git a/debian/changelog b/debian/changelog
index 06e2664..0685131 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,16 @@ xdm (1:1.1.9-1) UNRELEASED; urgency=low
[ Brice Goglin ]
* New upstream release.
+ + Drop 00_warning_fixes.diff, always entirely fixed upstream.
+ + Drop openlog.diff, irrelevant now.
+ + Drop 03_spelling.diff, 04_xdm_init_log_earlier.diff,
+ 07_xdm_more_debug.diff, 08_xdm_execute_more_debug.diff,
+ 09_xdm_syserrormsg.diff, 10_xdm_better_logging.diff,
+ 11_xdm_strerror.diff, 12_remove_pidfile.diff,
+ applied upstream.
+ * Refresh patches.
- -- Brice Goglin <bgoglin@debian.org> Sun, 06 Dec 2009 21:38:49 +0100
+ -- Brice Goglin <bgoglin@debian.org> Sun, 06 Dec 2009 22:05:09 +0100
xdm (1:1.1.8-6) unstable; urgency=low
diff --git a/debian/patches/00_warning_fixes.diff b/debian/patches/00_warning_fixes.diff
deleted file mode 100644
index 1e3d9a7..0000000
--- a/debian/patches/00_warning_fixes.diff
+++ /dev/null
@@ -1,85 +0,0 @@
-From: Julien Cristau <jcristau@debian.org>
-Date: Tue, 19 Aug 2008 22:43:47 +0200
-Subject: Fix compiler warnings
-
-* glibc wants _XOPEN_SOURCE_EXTENDED for vfork(), and
- _BSD_SOURCE for strcasecmp, so let's define _GNU_SOURCE and get them all.
-* greeter/Login.c: gcc gets confused about lastspace being initialized
-* greeter/greet.c: add const modifier to pam_message struct
-* Also cast away a bunch of signed vs unsigned char* warnings.
-
-diff --git a/configure.ac b/configure.ac
-index 329c8e8..ff9cfb5 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -123,7 +123,7 @@ fi
-
- case $host_os in
- linux*|gnu*|*-gnu)
-- OS_CFLAGS="-D_XOPEN_SOURCE"
-+ OS_CFLAGS="-D_GNU_SOURCE"
- SU="su"
- ;;
- darwin*)
-diff --git a/genauth.c b/genauth.c
-index 0b54b8d..245a63f 100644
---- a/genauth.c
-+++ b/genauth.c
-@@ -377,7 +377,7 @@ InitXdmcpWrapper (void)
- #endif
- /* Try some pseudo-random number genrator daemon next */
- if (prngdSocket != NULL || prngdPort != 0) {
-- if (get_prngd_bytes(tmpkey, sizeof(tmpkey), prngdPort,
-+ if (get_prngd_bytes((char *)tmpkey, sizeof(tmpkey), prngdPort,
- prngdSocket) == 0) {
- tmpkey[0] = 0;
- _XdmcpWrapperToOddParity(tmpkey, key);
-diff --git a/greeter/Login.c b/greeter/Login.c
-index a156762..741724d 100644
---- a/greeter/Login.c
-+++ b/greeter/Login.c
-@@ -73,6 +73,7 @@ from The Open Group.
- # include <stdio.h>
- # include <ctype.h>
- # include <time.h>
-+# include <string.h>
-
- # include "dm.h"
- # include "dm_error.h"
-@@ -602,7 +603,7 @@ RedrawFail (LoginWidget w)
- char *tempCopy = strdup(w->login.fail);
- if (tempCopy != NULL) {
- char *start, *next;
-- char lastspace;
-+ char lastspace = '\0';
-
- y = PROMPT_Y(w,LAST_PROMPT) + (2 * PROMPT_Y_INC(w));
-
-diff --git a/greeter/greet.c b/greeter/greet.c
-index 0aabec7..27732ef 100644
---- a/greeter/greet.c
-+++ b/greeter/greet.c
-@@ -683,7 +683,7 @@ static int pamconv(int num_msg,
- "PAM_PROMPT_ECHO_OFF", "PAM_PROMPT_ECHO_ON",
- "PAM_ERROR_MSG", "PAM_TEXT_INFO" } ;
-
-- struct pam_message *m;
-+ const struct pam_message *m;
- struct pam_response *r;
-
- struct myconv_data *d = (struct myconv_data *) appdata_ptr;
-diff --git a/xdmauth.c b/xdmauth.c
-index b54d5ce..fc47821 100644
---- a/xdmauth.c
-+++ b/xdmauth.c
-@@ -182,7 +182,9 @@ XdmGetXdmcpAuth (struct protoDisplay *pdpy,
- XdmPrintDataHex ("Accept packet auth", xdmcpauth->data, xdmcpauth->data_length);
- XdmPrintDataHex ("Auth file auth", fileauth->data, fileauth->data_length);
- /* encrypt the session key for its trip back to the server */
-- XdmcpWrap (xdmcpauth->data, (unsigned char *)&pdpy->key, xdmcpauth->data, 8);
-+ XdmcpWrap ((unsigned char *)xdmcpauth->data,
-+ (unsigned char *)&pdpy->key,
-+ (unsigned char *)xdmcpauth->data, 8);
- pdpy->fileAuthorization = fileauth;
- pdpy->xdmcpAuthorization = xdmcpauth;
- }
diff --git a/debian/patches/01_xdm_include_fcntl.diff b/debian/patches/01_xdm_include_fcntl.diff
index 9582fca..3790359 100644
--- a/debian/patches/01_xdm_include_fcntl.diff
+++ b/debian/patches/01_xdm_include_fcntl.diff
@@ -3,13 +3,13 @@ Subject: [PATCH] auth.c: include <fcntl.h> for definitions of O_ flags to open()
---
auth.c | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ 1 file changed, 1 insertion(+)
-diff --git a/auth.c b/auth.c
-index e3a0d66..4040930 100644
---- a/auth.c
-+++ b/auth.c
-@@ -42,6 +42,7 @@ from The Open Group.
+Index: xdm/auth.c
+===================================================================
+--- xdm.orig/auth.c 2009-12-06 21:37:54.000000000 +0100
++++ xdm/auth.c 2009-12-06 21:44:07.000000000 +0100
+@@ -39,6 +39,7 @@
#include <X11/Xlibint.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -17,6 +17,3 @@ index e3a0d66..4040930 100644
#include "dm.h"
#include "dm_auth.h"
---
-1.5.6.3
-
diff --git a/debian/patches/02_xdm_zombie_no_error.diff b/debian/patches/02_xdm_zombie_no_error.diff
index e151982..767b0b0 100644
--- a/debian/patches/02_xdm_zombie_no_error.diff
+++ b/debian/patches/02_xdm_zombie_no_error.diff
@@ -6,11 +6,15 @@ can be zombies; this is not an error.
Forward-ported by David Nusinow, Eugene Konev and Julien Cristau
+---
+ dm.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
Index: xdm/dm.c
===================================================================
---- xdm.orig/dm.c
-+++ xdm/dm.c
-@@ -537,8 +544,17 @@
+--- xdm.orig/dm.c 2009-12-06 21:37:54.000000000 +0100
++++ xdm/dm.c 2009-12-06 21:45:00.000000000 +0100
+@@ -543,8 +543,17 @@
d->startTries, d->startAttempts);
if (d->displayType.origin == FromXDMCP ||
d->status == zombie ||
diff --git a/debian/patches/03_spelling.diff b/debian/patches/03_spelling.diff
deleted file mode 100644
index 2bdbbcd..0000000
--- a/debian/patches/03_spelling.diff
+++ /dev/null
@@ -1,18 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: spelling fix
-
-Upstream commit 6dfbdf2823dc50c6b0ff24afbc58c67dc1651bef
-
-Index: xdm/dm.c
-===================================================================
---- xdm.orig/dm.c
-+++ xdm/dm.c
-@@ -380,7 +387,7 @@
- *
- * See defect XWSog08655 for more information.
- */
-- Debug ("Child xdm caught SIGTERM before it remove that signal.\n");
-+ Debug ("Child xdm caught SIGTERM before it removed that signal.\n");
- (void) Signal (n, SIG_DFL);
- TerminateProcess (getpid(), SIGTERM);
- errno = olderrno;
diff --git a/debian/patches/04_xdm_init_log_earlier.diff b/debian/patches/04_xdm_init_log_earlier.diff
deleted file mode 100644
index 5402ee2..0000000
--- a/debian/patches/04_xdm_init_log_earlier.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-From 98c45e683e640459e30d62d7d6d8cdf0066b8747 Mon Sep 17 00:00:00 2001
-From: Julien Cristau <jcristau@debian.org>
-Date: Wed, 20 Aug 2008 01:30:59 +0200
-Subject: [PATCH] Call InitErrorLog() right after BecomeDaemon()
-
-The latter points stderr to /dev/null, so the sooner we open the log
-after that, the better.
-
-Upstream commit 72240433a85410e68a3b6705e097337ff985ae90
-
----
- dm.c | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/dm.c b/dm.c
-index 52b49eb..015ce31 100644
---- a/dm.c
-+++ b/dm.c
-@@ -145,6 +145,8 @@ main (int argc, char **argv)
- }
- if (debugLevel == 0 && daemonMode)
- BecomeDaemon ();
-+ if (debugLevel == 0)
-+ InitErrorLog ();
- if (debugLevel >= 10)
- nofork_session = 1;
- /* SUPPRESS 560 */
-@@ -157,8 +159,6 @@ main (int argc, char **argv)
- pidFile, oldpid);
- exit (1);
- }
-- if (debugLevel == 0)
-- InitErrorLog ();
-
- if (nofork_session == 0) {
- /* Clean up any old Authorization files */
---
-1.5.6.3
-
diff --git a/debian/patches/06_hurd_utsname.diff b/debian/patches/06_hurd_utsname.diff
index fe8116e..eadb737 100644
--- a/debian/patches/06_hurd_utsname.diff
+++ b/debian/patches/06_hurd_utsname.diff
@@ -1,13 +1,17 @@
-Index: xdm-X11R7.0-1.0.1/auth.c
+---
+ auth.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+Index: xdm/auth.c
===================================================================
---- xdm-X11R7.0-1.0.1.orig/auth.c 2006-03-05 20:46:28.000000000 -0500
-+++ xdm-X11R7.0-1.0.1/auth.c 2006-03-05 20:47:28.000000000 -0500
-@@ -60,9 +60,7 @@
+--- xdm.orig/auth.c 2009-12-06 21:44:07.000000000 +0100
++++ xdm/auth.c 2009-12-06 21:48:19.000000000 +0100
+@@ -57,9 +57,7 @@
# include <netdnet/dnetdb.h>
#endif
-#if defined(hpux)
- #include <sys/utsname.h>
+ # include <sys/utsname.h>
-#endif
#if defined(SYSV) && defined(i386)
diff --git a/debian/patches/07_xdm_more_debug.diff b/debian/patches/07_xdm_more_debug.diff
deleted file mode 100644
index e75818d..0000000
--- a/debian/patches/07_xdm_more_debug.diff
+++ /dev/null
@@ -1,56 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: [PATCH] Add some more log and debug messages
-
-Add log messages for xdm startup, shutdown, and normal exit. Add a
-debugging message when xdm enters its main loop.
-
-Upstream commit 2d6d2f121bffb378676f422b44d37534c8c5d53b
----
- dm.c | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-Index: xdm/dm.c
-===================================================================
---- xdm.orig/dm.c
-+++ xdm/dm.c
-@@ -160,6 +160,8 @@
- exit (1);
- }
-
-+ LogInfo ("Starting\n");
-+
- if (nofork_session == 0) {
- /* Clean up any old Authorization files */
- /* AUD: all good? */
-@@ -199,6 +201,7 @@
- #ifndef UNRELIABLE_SIGNALS
- (void) Signal (SIGCHLD, ChildNotify);
- #endif
-+ Debug ("startup successful; entering main loop\n");
- while (
- #ifdef XDMCP
- AnyWellKnownSockets() ||
-@@ -217,6 +220,7 @@
- #endif
- }
- Debug ("Nothing left to do, exiting\n");
-+ LogInfo ("Exiting\n");
- exit(0);
- /*NOTREACHED*/
- }
-@@ -387,6 +391,7 @@
- return;
- }
- Debug ("Shutting down entire manager\n");
-+ LogInfo ("Shutting down\n");
- #ifdef XDMCP
- DestroyWellKnownSockets ();
- #endif
-@@ -711,6 +716,7 @@
- pid_t pid;
-
- Debug ("StartDisplay %s\n", d->name);
-+ LogInfo ("Starting X server on %s\n", d->name);
- LoadServerResources (d);
- if (d->displayType.location == Local)
- {
diff --git a/debian/patches/08_xdm_execute_more_debug.diff b/debian/patches/08_xdm_execute_more_debug.diff
deleted file mode 100644
index 64ad4e1..0000000
--- a/debian/patches/08_xdm_execute_more_debug.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: [PATCH] session.c: Add more debugging to execute()
-
-[jcristau@debian.org: save errno before calling Debug() in one place]
-
-Upstream commit d6faa3c02a6f61c8d01accd0fcead28c39673e32
----
- session.c | 7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
-
-Index: xdm/session.c
-===================================================================
---- xdm.orig/session.c
-+++ xdm/session.c
-@@ -869,18 +869,22 @@
- void
- execute (char **argv, char **environ)
- {
-+ int err;
- /* give /dev/null as stdin */
- (void) close (0);
- open ("/dev/null", O_RDONLY);
- /* make stdout follow stderr to the log file */
- dup2 (2,1);
-+ Debug ("attempting to execve() %s\n", argv[0]);
- execve (argv[0], argv, environ);
-+ err = errno;
-+ Debug ("execve() of %s failed: %s\n", argv[0], _SysErrorMsg (errno));
- /*
- * In case this is a shell script which hasn't been
- * made executable (or this is a SYSV box), do
- * a reasonable thing
- */
-- if (errno != ENOENT) {
-+ if (err != ENOENT) {
- char program[1024], *e, *p, *optarg;
- FILE *f;
- char **newargv, **av;
-@@ -938,6 +942,7 @@
- while ((*av++ = *argv++))
- /* SUPPRESS 530 */
- ;
-+ Debug ("Attempting to execve() %s\n", newargv[0]);
- execve (newargv[0], newargv, environ);
- }
- }
diff --git a/debian/patches/09_xdm_syserrormsg.diff b/debian/patches/09_xdm_syserrormsg.diff
deleted file mode 100644
index 94bcadd..0000000
--- a/debian/patches/09_xdm_syserrormsg.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: [PATCH] Use xdm's _SysErrorMsg() function instead of merely printing errno
-
-Upstream commit 8d15af786d96bb70aceca116a588c2a4b7c45d63
----
- greeter/verify.c | 2 +-
- session.c | 7 ++++---
- 2 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/greeter/verify.c b/greeter/verify.c
-index fad60c9..e9aeccb 100644
---- a/greeter/verify.c
-+++ b/greeter/verify.c
-@@ -446,7 +446,7 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
- errno = 0;
- sp = getspnam(greet->name);
- if (sp == NULL) {
-- Debug ("getspnam() failed, errno=%d. Are you root?\n", errno);
-+ Debug ("getspnam() failed: %s\n", _SysErrorMsg (errno));
- } else {
- user_pass = sp->sp_pwdp;
- }
-diff --git a/session.c b/session.c
-index b48a3ef..3c464ab 100644
---- a/session.c
-+++ b/session.c
-@@ -680,7 +680,8 @@ StartClient (
- * audit classes, user limits, and umask.
- */
- if (setpcred(name, NULL) == -1) {
-- LogError ("setpcred for \"%s\" failed, errno=%d\n", name, errno);
-+ LogError ("setpcred for \"%s\" failed: %s\n", name,
-+ _SysErrorMsg (errno));
- return (0);
- }
- #endif /* AIXV3 */
-@@ -804,8 +805,8 @@ StartClient (
- if (passwd != NULL)
- bzero(passwd, strlen(passwd));
- Debug ("StartSession, fork failed\n");
-- LogError ("can't start session on \"%s\", fork failed, errno=%d\n",
-- d->name, errno);
-+ LogError ("can't start session on \"%s\", fork failed: %s\n",
-+ d->name, _SysErrorMsg (errno));
- return 0;
- default:
- if (passwd != NULL)
---
-1.5.6.3
-
diff --git a/debian/patches/10_xdm_better_logging.diff b/debian/patches/10_xdm_better_logging.diff
deleted file mode 100644
index 4c2f13b..0000000
--- a/debian/patches/10_xdm_better_logging.diff
+++ /dev/null
@@ -1,186 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: [PATCH] Use _SysErrorMsg() in the log message in various error conditions.
-
-Change LogError() invocations to use _SysErrorMsg() where errno might be
-set (and not clobbered by intermediate calls). Also make LogError() the
-first thing we do after an error condition in those cases.
-
-Forward-ported by David Nusinow, Eugene Konev and Julien Cristau.
-
-Upstream commit 18f286641afbe1d3b61abd31d93c0ae8acb375e9
-
-Index: xdm/auth.c
-===================================================================
---- xdm.orig/auth.c
-+++ xdm/auth.c
-@@ -876,7 +876,8 @@
- int len, ipfd;
-
- if ((ipfd = open ("/dev/ip", O_RDWR, 0 )) < 0)
-- LogError ("Getting interface configuration");
-+ LogError ("cannot get interface configuration; cannot open /dev/ip: "
-+ "%s\n", _SysErrorMsg (errno));
-
- /* Indicate that we want to start at the begining */
- ifnet.ib_next = (struct ipb *) 1;
-@@ -890,8 +891,9 @@
-
- if (ioctl (ipfd, (int) I_STR, (char *) &str) < 0)
- {
-+ LogError ("cannot get interface configuration; ioctl failed: %s\n",
-+ _SysErrorMsg (errno));
- close (ipfd);
-- LogError ("Getting interface configuration");
- }
-
- ifaddr.ia_next = (struct in_ifaddr *) ifnet.if_addrlist;
-@@ -902,8 +904,9 @@
-
- if (ioctl (ipfd, (int) I_STR, (char *) &str) < 0)
- {
-+ LogError ("cannot get interface configuration; ioctl failed: %s\n",
-+ _SysErrorMsg (errno));
- close (ipfd);
-- LogError ("Getting interface configuration");
- }
-
- /*
-@@ -1361,16 +1364,22 @@
- doneAddrs ();
- fclose (new);
- if (unlink (name) == -1)
-- Debug ("unlink %s failed\n", name);
-+ if (errno != ENOENT)
-+ LogError ("cannot remove old authorization file %s: %s\n",
-+ name, _SysErrorMsg (errno));
- envname = name;
- if (link (new_name, name) == -1) {
-- Debug ("link failed %s %s\n", new_name, name);
-- LogError ("Can't move authorization into place\n");
-+ LogError ("cannot link temporary authorization file %s to old "
-+ "location %s: %s\n", new_name, name,
-+ _SysErrorMsg (errno));
- setenv = 1;
- envname = new_name;
- } else {
-- Debug ("new is in place, go for it!\n");
-- unlink (new_name);
-+ Debug ("authorization file %s successfully updated\n", name);
-+ if (unlink (new_name))
-+ if (errno != ENOENT)
-+ LogError ("cannot remove new authorization file %s:"
-+ " %s\n", new_name, _SysErrorMsg (errno));
- }
- if (setenv) {
- verify->userEnviron = setEnv (verify->userEnviron,
-@@ -1440,13 +1449,19 @@
- doneAddrs ();
- fclose (new);
- if (unlink (name) == -1)
-- Debug ("unlink %s failed\n", name);
-+ if (errno != ENOENT)
-+ LogError ("cannot remove new authorization file %s: %s\n",
-+ name, _SysErrorMsg (errno));
- if (link (new_name, name) == -1) {
-- Debug ("link failed %s %s\n", new_name, name);
-- LogError ("Can't move authorization into place\n");
-+ LogError ("cannot link temporary authorization file %s to old "
-+ "location %s: %s\n", new_name, name,
-+ _SysErrorMsg (errno));
- } else {
-- Debug ("new is in place, go for it!\n");
-- unlink (new_name);
-+ Debug ("authorization file %s successfully updated\n", name);
-+ if (unlink (new_name))
-+ if (errno != ENOENT)
-+ LogError ("cannot remove new authorization file %s:"
-+ " %s\n", new_name, _SysErrorMsg (errno));
- }
- }
- XauUnlockAuth (name);
-Index: xdm/session.c
-===================================================================
---- xdm.orig/session.c
-+++ xdm/session.c
-@@ -610,20 +610,22 @@
-
- #ifndef AIXV3
- #ifndef HAS_SETUSERCONTEXT
-- if (setgid(verify->gid) < 0) {
-- LogError ("setgid %d (user \"%s\") failed, errno=%d\n",
-- verify->gid, name, errno);
-+ if (setgid (verify->gid) < 0) {
-+ LogError ("setgid %d (user \"%s\") failed: %s\n",
-+ verify->gid, name, _SysErrorMsg (errno));
- return (0);
- }
- #if defined(BSD) && (BSD >= 199103)
-- if (setlogin(name) < 0) {
-- LogError ("setlogin for \"%s\" failed, errno=%d", name, errno);
-- return(0);
-+ if (setlogin (name) < 0) {
-+ LogError ("setlogin for \"%s\" failed: %s\n", name,
-+ _SysErrorMsg (errno));
-+ return (0);
- }
- #endif
- #ifndef QNX4
-- if (initgroups(name, verify->gid) < 0) {
-- LogError ("initgroups for \"%s\" failed, errno=%d\n", name, errno);
-+ if (initgroups (name, verify->gid) < 0) {
-+ LogError ("initgroups for \"%s\" failed: %s\n", name,
-+ _SysErrorMsg (errno));
- return (0);
- }
- #endif /* QNX4 doesn't support multi-groups, no initgroups() */
-@@ -663,14 +665,15 @@
- */
- pwd = getpwnam(name);
- if (pwd) {
-- if (setusercontext(NULL, pwd, pwd->pw_uid, LOGIN_SETALL) < 0) {
-- LogError ("setusercontext for \"%s\" failed, errno=%d\n", name,
-- errno);
-+ if (setusercontext (NULL, pwd, pwd->pw_uid, LOGIN_SETALL) < 0) {
-+ LogError ("setusercontext for \"%s\" failed: %s\n", name,
-+ _SysErrorMsg (errno));
- return (0);
- }
- endpwent();
- } else {
-- LogError ("getpwnam for \"%s\" failed, errno=%d\n", name, errno);
-+ LogError ("getpwnam for \"%s\" failed: %s\n", name,
-+ _SysErrorMsg (errno));
- return (0);
- }
- #endif /* HAS_SETUSERCONTEXT */
-Index: xdm/socket.c
-===================================================================
---- xdm.orig/socket.c
-+++ xdm/socket.c
-@@ -78,7 +78,7 @@
- Debug ("Created chooser socket %d\n", chooserFd);
- if (chooserFd == -1)
- {
-- LogError ("chooser socket creation failed, errno %d\n", errno);
-+ LogError ("chooser socket creation failed: %s\n", _SysErrorMsg (errno));
- return;
- }
- listen (chooserFd, 5);
-@@ -156,14 +156,15 @@
- fd = socket (sock_addr->sa_family, SOCK_DGRAM, 0);
-
- if (fd == -1) {
-- LogError ("XDMCP socket creation failed, errno %d\n", errno);
-+ LogError ("XDMCP socket creation failed: %s\n", _SysErrorMsg (errno));
- return fd;
- }
- RegisterCloseOnFork (fd);
-
- if (bind (fd, sock_addr, salen) == -1)
- {
-- LogError ("error %d binding socket address %d\n", errno, request_port);
-+ LogError ("error binding socket address %d: %s\n", request_port,
-+ _SysErrorMsg (errno));
- close (fd);
- fd = -1;
- return fd;
diff --git a/debian/patches/11_xdm_strerror.diff b/debian/patches/11_xdm_strerror.diff
deleted file mode 100644
index 234f8c4..0000000
--- a/debian/patches/11_xdm_strerror.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: [PATCH] Use xdm's _SysErrorMsg() function instead of strerror()
-
-Upstream commit ec3152fbba9ee39bbb069913e76e9d165001f98a
----
- choose.c | 2 +-
- daemon.c | 6 +++---
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/choose.c b/choose.c
-index ad96800..1d8a88f 100644
---- a/choose.c
-+++ b/choose.c
-@@ -502,7 +502,7 @@ ProcessChooserSocket (int fd)
- }
- else
- {
-- LogError ("Choice response read error: %s\n", strerror(errno));
-+ LogError ("Choice response read error: %s\n", _SysErrorMsg(errno));
- }
-
- #if defined(STREAMSCONN)
-diff --git a/daemon.c b/daemon.c
-index 34cbea7..3738b24 100644
---- a/daemon.c
-+++ b/daemon.c
-@@ -52,14 +52,14 @@ BecomeDaemon (void)
- #ifdef HAVE_DAEMON
- if (daemon (0, 0) < 0) {
- /* error */
-- LogError("daemon() failed, %s\n", strerror(errno));
-+ LogError("daemon() failed, %s\n", _SysErrorMsg (errno));
- exit(1);
- }
- #else
- switch (fork()) {
- case -1:
- /* error */
-- LogError("daemon fork failed, %s\n", strerror(errno));
-+ LogError("daemon fork failed, %s\n", _SysErrorMsg (errno));
- exit(1);
- break;
- case 0:
-@@ -72,7 +72,7 @@ BecomeDaemon (void)
-
- if (setsid() == -1) {
- LogError("setting session id for daemon failed: %s\n",
-- strerror(errno));
-+ _SysErrorMsg (errno));
- exit(1);
- }
-
---
-1.5.6.3
-
diff --git a/debian/patches/12_remove_pidfile.diff b/debian/patches/12_remove_pidfile.diff
deleted file mode 100644
index 643021a..0000000
--- a/debian/patches/12_remove_pidfile.diff
+++ /dev/null
@@ -1,51 +0,0 @@
-From: Branden Robinson <branden@debian.org>
-Subject: Add RemovePid() function, and register it with atexit()
-
-Debian bug#213076
-
-Forward-ported by David Nusinow, Eugene Konev and Julien Cristau.
-
-Upstream commit 2f5bd6ea016a6405208c91c976a16a672cc04184
-
-Index: xdm/dm.c
-===================================================================
---- xdm.orig/dm.c
-+++ xdm/dm.c
-@@ -107,6 +107,7 @@
- #endif
-
- static int StorePid (void);
-+static void RemovePid (void);
-
- static pid_t parent_pid = -1; /* PID of parent xdm process */
-
-@@ -162,6 +163,9 @@
-
- LogInfo ("Starting\n");
-
-+ if (atexit (RemovePid))
-+ LogError ("could not register RemovePid() with atexit()\n");
-+
- if (nofork_session == 0) {
- /* Clean up any old Authorization files */
- /* AUD: all good? */
-@@ -930,6 +934,19 @@
- return 0;
- }
-
-+/*
-+ * Remove process ID file. This function is registered with atexit().
-+ */
-+static void
-+RemovePid (void)
-+{
-+ Debug ("unlinking process ID file %s\n", pidFile);
-+ if (unlink (pidFile))
-+ if (errno != ENOENT)
-+ LogError ("cannot remove process ID file %s: %s\n", pidFile,
-+ _SysErrorMsg (errno));
-+}
-+
- #if 0
- void
- UnlockPidFile (void)
diff --git a/debian/patches/log_sourcing_better.diff b/debian/patches/log_sourcing_better.diff
index 9cc7536..7b137cc 100644
--- a/debian/patches/log_sourcing_better.diff
+++ b/debian/patches/log_sourcing_better.diff
@@ -4,9 +4,15 @@
# Parent fbeb28a122da949d0e70dd30956800ae707700d3
Applied 078_xdm_log_sourcing_better.diff
---- xdm.orig/session.c
-+++ xdm/session.c
-@@ -794,7 +794,7 @@
+---
+ session.c | 33 ++++++++++++++++++++-------------
+ 1 file changed, 20 insertions(+), 13 deletions(-)
+
+Index: xdm/session.c
+===================================================================
+--- xdm.orig/session.c 2009-12-06 21:37:54.000000000 +0100
++++ xdm/session.c 2009-12-06 21:59:11.000000000 +0100
+@@ -791,7 +791,7 @@
verify->userEnviron = setEnv(verify->userEnviron, "HOME", "/");
}
if (verify->argv) {
@@ -15,7 +21,7 @@ Applied 078_xdm_log_sourcing_better.diff
execute (verify->argv, verify->userEnviron);
LogError ("Session \"%s\" execution failed (err %d)\n", verify->argv[0], errno);
} else {
-@@ -824,21 +824,28 @@
+@@ -821,21 +821,28 @@
source (char **environ, char *file)
{
char **args, *args_safe[2];
diff --git a/debian/patches/openlog.diff b/debian/patches/openlog.diff
deleted file mode 100644
index 4d28a64..0000000
--- a/debian/patches/openlog.diff
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Julien Cristau <jcristau@debian.org>
-Subject: greeter: call openlog() not just on openbsd
-
-If we don't call openlog() pam will use syslog but won't have a service name.
-See Debian bug #382037.
-
-Note: this patch is not appropriate for upstream; the bug log contains a more
-complete patch, but this one should be ok for debian's purposes.
-
-Index: xdm/greeter/greet.c
-===================================================================
---- xdm.orig/greeter/greet.c
-+++ xdm/greeter/greet.c
-@@ -83,9 +83,7 @@
- #include "greet.h"
- #include "Login.h"
-
--#ifdef __OpenBSD__
- #include <syslog.h>
--#endif
-
- #if defined(SECURE_RPC) && defined(sun)
- /* Go figure, there's no getdomainname() prototype available */
-@@ -408,13 +406,9 @@
- static void
- FailedLogin (struct display *d, struct greet_info *greet)
- {
--#ifdef __OpenBSD__
-- syslog(LOG_NOTICE, "LOGIN FAILURE ON %s",
-- d->name);
- syslog(LOG_AUTHPRIV|LOG_NOTICE,
- "LOGIN FAILURE ON %s, %s",
- d->name, greet->name);
--#endif
- DrawFail (login);
- #ifndef USE_PAM
- bzero (greet->name, strlen(greet->name));
-@@ -485,9 +479,7 @@
- LogError ("Cannot reopen display %s for greet window\n", d->name);
- exit (RESERVER_DISPLAY);
- }
--#ifdef __OpenBSD__
-- openlog("xdm", LOG_ODELAY, LOG_AUTH);
--#endif
-+ openlog("xdm", LOG_ODELAY | LOG_PID, LOG_AUTHPRIV);
-
- for (;;) {
- #ifdef USE_PAM
diff --git a/debian/patches/selinux_support.diff b/debian/patches/selinux_support.diff
index 44f557e..2f8af27 100644
--- a/debian/patches/selinux_support.diff
+++ b/debian/patches/selinux_support.diff
@@ -8,11 +8,16 @@ add --with-selinux flag to configure.ac).
Updated to latest SE Linux code by Russell Coker 3rd Aug 2008, with bugfix from
Julien Cristau (Debian bug#493524).
+---
+ configure.ac | 17 +++++++++++++++++
+ session.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 73 insertions(+)
+
Index: xdm/configure.ac
===================================================================
---- xdm.orig/configure.ac
-+++ xdm/configure.ac
-@@ -116,6 +116,23 @@
+--- xdm.orig/configure.ac 2009-12-06 21:37:54.000000000 +0100
++++ xdm/configure.ac 2009-12-06 21:59:17.000000000 +0100
+@@ -129,6 +129,23 @@
fi])
fi
@@ -38,9 +43,9 @@ Index: xdm/configure.ac
# if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) || defined(DarwinArchitecture)
Index: xdm/session.c
===================================================================
---- xdm.orig/session.c
-+++ xdm/session.c
-@@ -36,6 +36,10 @@
+--- xdm.orig/session.c 2009-12-06 21:59:11.000000000 +0100
++++ xdm/session.c 2009-12-06 21:59:17.000000000 +0100
+@@ -33,6 +33,10 @@
* session.c
*/
@@ -51,8 +56,8 @@ Index: xdm/session.c
#include "dm.h"
#include "dm_auth.h"
#include "dm_error.h"
-@@ -70,6 +74,11 @@
- #include <prot.h>
+@@ -67,6 +71,11 @@
+ # include <prot.h>
#endif
+#ifdef HAVE_SELINUX
@@ -63,7 +68,7 @@ Index: xdm/session.c
#ifndef GREET_USER_STATIC
# include <dlfcn.h>
# ifndef RTLD_NOW
-@@ -77,6 +86,42 @@
+@@ -74,6 +83,42 @@
# endif
#endif
@@ -106,7 +111,7 @@ Index: xdm/session.c
static int runAndWait (char **args, char **environ);
#ifdef HAVE_GRP_H
-@@ -785,6 +830,17 @@
+@@ -782,6 +827,17 @@
bzero(passwd, strlen(passwd));
SetUserAuthorization (d, verify);
diff --git a/debian/patches/series b/debian/patches/series
index f0195d7..59a6555 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,23 +1,10 @@
# these should either be upstream or killed yesterday
-00_warning_fixes.diff
01_xdm_include_fcntl.diff
02_xdm_zombie_no_error.diff
-# applied upstream
-03_spelling.diff
-04_xdm_init_log_earlier.diff
-
# this one might need some ifdefs
06_hurd_utsname.diff
Reply to: