.gitignore | 85 +++- COPYING | 53 +- ChangeLog | 460 ++++++++++++++++++++++ Makefile.am | 15 access.c | 23 + acinclude.m4 | 45 -- app-defaults/.gitignore | 2 auth.c | 157 +++++-- config/.gitignore | 7 config/Xstartup.cpp | 2 configure.ac | 35 + debian/changelog | 18 debian/patches/02_xdm_zombie_no_error.diff | 36 - debian/patches/06_hurd_utsname.diff | 6 debian/patches/15_xdm_openfiles.diff | 43 -- debian/patches/90_xdm_write_dummy_auth.diff | 68 --- debian/patches/91_xdm_saveserverauth_logging.diff | 84 ---- debian/patches/doc_mention_xdm.options.diff | 8 debian/patches/log_sourcing_better.diff | 74 --- debian/patches/selinux_support.diff | 131 ------ debian/patches/series | 19 debian/patches/storepid_rewrite.diff | 141 ------ debian/patches/support_logfile_rotation.diff | 16 dm.c | 142 ++++-- greeter/.gitignore | 7 greeter/Login.c | 117 +++-- greeter/Login.h | 41 - greeter/LoginP.h | 41 - greeter/greet.c | 62 +- m4/ac_define_dir.m4 | 45 ++ session.c | 89 +++- socket.c | 33 + xdm.man.cpp | 6 xdmcp.c | 23 - 34 files changed, 1191 insertions(+), 943 deletions(-)
New commits: commit 19c7684bc0452a2154b785f8a333cc09a3554544 Author: Julien Cristau <jcris...@debian.org> Date: Sat Apr 10 04:15:01 2010 +0200 Mention bugs fixed upstream in the changelog diff --git a/debian/changelog b/debian/changelog index 8d0ea0f..5d86555 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ xdm (1:1.1.10-1) UNRELEASED; urgency=low * New upstream release. + - don't delete the pid file from child xdm processes, closes: #372114 + - clear the "Login incorrect" message properly on next login, + closes: #525596. Thanks, Martin Dickopp! + - fix xdmcp with net.ipv6.bindv6only=1 * Patches merged upstream: - 02_xdm_zombie_no_error.diff - 15_xdm_openfiles.diff commit 615a1ff422652e299a9cb542ded764ebcaa25b0d Author: Julien Cristau <jcris...@debian.org> Date: Sat Apr 10 03:56:45 2010 +0200 Refresh remaining patches diff --git a/debian/patches/06_hurd_utsname.diff b/debian/patches/06_hurd_utsname.diff index eadb737..375d2b2 100644 --- a/debian/patches/06_hurd_utsname.diff +++ b/debian/patches/06_hurd_utsname.diff @@ -4,9 +4,9 @@ Index: xdm/auth.c =================================================================== ---- 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 @@ +--- xdm.orig/auth.c ++++ xdm/auth.c +@@ -56,9 +56,7 @@ # include <netdnet/dnetdb.h> #endif diff --git a/debian/patches/doc_mention_xdm.options.diff b/debian/patches/doc_mention_xdm.options.diff index 4c41284..8d4e59f 100644 --- a/debian/patches/doc_mention_xdm.options.diff +++ b/debian/patches/doc_mention_xdm.options.diff @@ -1,6 +1,8 @@ ---- a/xdm.man.cpp -+++ b/xdm.man.cpp -@@ -1469,7 +1469,8 @@ Kerberos credentials cache +Index: xdm/xdm.man.cpp +=================================================================== +--- xdm.orig/xdm.man.cpp ++++ xdm/xdm.man.cpp +@@ -1473,7 +1473,8 @@ .IR Xserver (__appmansuffix__), .\" .IR chooser (__appmansuffix__), \" except that there isn't a manual for it yet .\" .IR xdmshell (__appmansuffix__), \" except that there isn't a manual for it yet diff --git a/debian/patches/support_logfile_rotation.diff b/debian/patches/support_logfile_rotation.diff index 160f290..51cf119 100644 --- a/debian/patches/support_logfile_rotation.diff +++ b/debian/patches/support_logfile_rotation.diff @@ -13,7 +13,7 @@ Index: xdm/dm.c =================================================================== --- xdm.orig/dm.c +++ xdm/dm.c -@@ -80,8 +80,10 @@ +@@ -90,8 +90,10 @@ extern FILE *fdopen(); #endif @@ -25,7 +25,7 @@ Index: xdm/dm.c static void RestartDisplay (struct display *d, int forceReserver); static void ScanServers (void); static void SetAccessFileTime (void); -@@ -90,6 +92,7 @@ +@@ -100,6 +102,7 @@ static void TerminateProcess (pid_t pid, int signal); volatile int Rescan; @@ -33,7 +33,7 @@ Index: xdm/dm.c static long ServersModTime, ConfigModTime, AccessFileModTime; int nofork_session = 0; -@@ -199,6 +202,7 @@ +@@ -209,6 +212,7 @@ AddOtherEntropy(); #endif (void) Signal (SIGHUP, RescanNotify); @@ -41,7 +41,7 @@ Index: xdm/dm.c #ifndef UNRELIABLE_SIGNALS (void) Signal (SIGCHLD, ChildNotify); #endif -@@ -209,6 +213,11 @@ +@@ -219,6 +223,11 @@ #endif AnyDisplaysLeft ()) { @@ -53,7 +53,7 @@ Index: xdm/dm.c if (Rescan) { RescanServers (); -@@ -233,6 +242,7 @@ +@@ -243,6 +252,7 @@ int olderrno = errno; Debug ("Caught SIGHUP\n"); @@ -61,7 +61,7 @@ Index: xdm/dm.c Rescan = 1; #ifdef SIGNALS_RESET_WHEN_CAUGHT (void) Signal (SIGHUP, RescanNotify); -@@ -240,6 +250,26 @@ +@@ -250,6 +260,26 @@ errno = olderrno; } @@ -88,7 +88,7 @@ Index: xdm/dm.c static void ScanServers (void) { -@@ -307,6 +337,14 @@ +@@ -317,6 +347,14 @@ } static void @@ -120,7 +120,7 @@ Index: xdm/xdm.man.cpp =================================================================== --- xdm.orig/xdm.man.cpp +++ xdm/xdm.man.cpp -@@ -1403,6 +1403,37 @@ +@@ -1407,6 +1407,37 @@ multiple window systems on the same hardware, you'll probably be more interested in .I xinit. commit 861e934c3d8a9d700ebf1b23bff6112e5dfa57a4 Author: Julien Cristau <jcris...@debian.org> Date: Sat Apr 10 03:53:20 2010 +0200 Delete patches applied upstream diff --git a/debian/changelog b/debian/changelog index 17e049d..8d0ea0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,14 @@ xdm (1:1.1.10-1) UNRELEASED; urgency=low * New upstream release. + * Patches merged upstream: + - 02_xdm_zombie_no_error.diff + - 15_xdm_openfiles.diff + - 90_xdm_write_dummy_auth.diff + - 91_xdm_saveserverauth_logging.diff + - log_sourcing_better.diff + - selinux_support.diff + - storepid_rewrite.diff -- Julien Cristau <jcris...@debian.org> Sat, 10 Apr 2010 03:49:17 +0200 diff --git a/debian/patches/02_xdm_zombie_no_error.diff b/debian/patches/02_xdm_zombie_no_error.diff deleted file mode 100644 index 767b0b0..0000000 --- a/debian/patches/02_xdm_zombie_no_error.diff +++ /dev/null @@ -1,36 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Subject: downgrade an error to info message - -During normal xdm shutdown, killed local X servers -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 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 || -- ++d->startTries >= d->startAttempts) { -- LogError ("Display %s is being disabled\n", d->name); -+ ++d->startTries >= d->startAttempts) -+ { -+ /* -+ * During normal xdm shutdown, killed local X servers -+ * can be zombies; this is not an error. -+ */ -+ if (d->status == zombie && -+ (d->startTries < d->startAttempts)) -+ LogInfo ("display %s is being disabled\n", d->name); -+ else -+ LogError ("display %s is being disabled\n", d->name); - StopDisplay(d); - } else - RestartDisplay (d, TRUE); diff --git a/debian/patches/15_xdm_openfiles.diff b/debian/patches/15_xdm_openfiles.diff deleted file mode 100644 index 4bb57f6..0000000 --- a/debian/patches/15_xdm_openfiles.diff +++ /dev/null @@ -1,43 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Subject: [PATCH] Change openFiles() to avoid race-based symlink attacks. - -Forward-ported by Julien Cristau <jcris...@debian.org>. - -Index: xdm/auth.c -=================================================================== ---- xdm.orig/auth.c -+++ xdm/auth.c -@@ -494,12 +494,32 @@ - openFiles (char *name, char *new_name, FILE **oldp, FILE **newp) - { - mode_t mask; -+ int newfd; - - strcpy (new_name, name); - strcat (new_name, "-n"); -+ /* -+ * Set safe umask for file creation operations. -+ */ - mask = umask (0077); -+ /* -+ * Unlink the authorization file we intend to create, and then open -+ * it with O_CREAT | O_EXCL to avoid race-based symlink attacks. -+ */ - (void) unlink (new_name); -- *newp = fopen (new_name, "w"); -+ newfd = open (new_name, O_WRONLY | O_CREAT | O_EXCL, 0600); -+ if (newfd >= 0) -+ *newp = fdopen (newfd, "w"); -+ else -+ { -+ LogError ("Cannot create file %s: %s\n", new_name, -+ _SysErrorMsg (errno)); -+ *newp = NULL; -+ } -+ /* -+ * There are no more attempts to create files after this point; -+ * restore the original umask. -+ */ - (void) umask (mask); - if (!*newp) { - Debug ("can't open new file %s\n", new_name); diff --git a/debian/patches/90_xdm_write_dummy_auth.diff b/debian/patches/90_xdm_write_dummy_auth.diff deleted file mode 100644 index 6189514..0000000 --- a/debian/patches/90_xdm_write_dummy_auth.diff +++ /dev/null @@ -1,68 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Subject: Always attempt to write data to the auth file - -Actually attempt to write data to the auth file in SaveServerAuthorizations(); -that way we detect problems like ENOSPC (full filesystem, user over quota) -early enough to do something about it. (See Debian #217505, #253480) - -Forward-ported by Julien Cristau <jcris...@debian.org>. - -Index: xdm/auth.c -=================================================================== ---- xdm.orig/auth.c -+++ xdm/auth.c -@@ -374,6 +374,8 @@ - mode_t mask; - int ret; - int i; -+ char dummy_auth[] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -+ "XXXXXXXXXXXXXXXXX"; /* 64 "X"s */ - - mask = umask (0077); - ret = MakeServerAuthFile(d, &auth_file); -@@ -391,6 +393,31 @@ - { - Debug ("File: %s auth: %p\n", d->authFile, auths); - ret = TRUE; -+ if (count == 0) -+ { -+ /* -+ * This is a crude hack to determine whether we really can -+ * write to the auth file even if we don't have real data -+ * to write right now. -+ */ -+ -+ /* -+ * Write garbage data to file to provoke ENOSPC and other -+ * errors. -+ */ -+ (void) fprintf (auth_file, "%s", dummy_auth); -+ (void) fflush (auth_file); -+ if (ferror (auth_file)) -+ { -+ LogError ("Cannot write server authorization file %s\n", -+ d->authFile); -+ ret = FALSE; -+ } -+ /* -+ * Rewind so that the garbage data is overwritten later. -+ */ -+ rewind(auth_file); -+ } - for (i = 0; i < count; i++) - { - /* -@@ -409,6 +436,13 @@ - d->authFile = NULL; - } - } -+ /* -+ * XXX: This is not elegant, but stdio has no truncation function. -+ */ -+ if (ftruncate(fileno(auth_file), ftell(auth_file))) -+ { -+ Debug ("ftruncate() failed\n"); -+ } - fclose (auth_file); - } - return ret; diff --git a/debian/patches/91_xdm_saveserverauth_logging.diff b/debian/patches/91_xdm_saveserverauth_logging.diff deleted file mode 100644 index cf8e560..0000000 --- a/debian/patches/91_xdm_saveserverauth_logging.diff +++ /dev/null @@ -1,84 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Subject: improve error logging - -Make several LogError() and Debug() messages more informative. -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 Julien Cristau <jcris...@debian.org>. - -Index: xdm/auth.c -=================================================================== ---- xdm.orig/auth.c -+++ xdm/auth.c -@@ -376,6 +376,7 @@ - int i; - char dummy_auth[] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - "XXXXXXXXXXXXXXXXX"; /* 64 "X"s */ -+ int err = 0; - - mask = umask (0077); - ret = MakeServerAuthFile(d, &auth_file); -@@ -383,10 +384,8 @@ - if (!ret) - return FALSE; - if (!auth_file) { -- Debug ("Can't creat auth file %s\n", d->authFile); -- LogError ("Cannot open server authorization file %s\n", d->authFile); -- free (d->authFile); -- d->authFile = NULL; -+ LogError ("cannot open server authorization file %s: %s\n", -+ d->authFile, _SysErrorMsg (errno)); - ret = FALSE; - } - else -@@ -409,8 +408,7 @@ - (void) fflush (auth_file); - if (ferror (auth_file)) - { -- LogError ("Cannot write server authorization file %s\n", -- d->authFile); -+ err = errno; - ret = FALSE; - } - /* -@@ -426,14 +424,15 @@ - * to the auth file so xrdb and setup programs don't fail. - */ - if (auths[i]->data_length > 0) -- if (!XauWriteAuth (auth_file, auths[i]) || -- fflush (auth_file) == EOF) -+ if (!XauWriteAuth (auth_file, auths[i])) -+ { -+ Debug ("XauWriteAuth() failed\n"); -+ } -+ (void) fflush (auth_file); -+ if (ferror (auth_file)) - { -- LogError ("Cannot write server authorization file %s\n", -- d->authFile); -+ err = errno; - ret = FALSE; -- free (d->authFile); -- d->authFile = NULL; - } - } - /* -@@ -444,6 +443,16 @@ - Debug ("ftruncate() failed\n"); - } - fclose (auth_file); -+ -+ } -+ if (ret == FALSE) -+ { -+ LogError ("Cannot write to server authorization file %s%s%s\n", -+ d->authFile, -+ err ? ": " : "", -+ err ? _SysErrorMsg (errno) : ""); -+ free (d->authFile); -+ d->authFile = NULL; - } - return ret; - } diff --git a/debian/patches/log_sourcing_better.diff b/debian/patches/log_sourcing_better.diff deleted file mode 100644 index 29668b6..0000000 --- a/debian/patches/log_sourcing_better.diff +++ /dev/null @@ -1,74 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Subject: Improve logging of xdm's script handling - -* Make execution of the session program an informational log message (with - LogInfo()), not a Debug() message. -* Ensure that source()d scripts (Xreset, Xsetup, Xstartup) can be - fopen()ed before invoking runAndWait() on them. If they can, LogInfo() - the fact. If they cannot, LogInfo() that, too, and use _SysErrorMsg() to - report why fopen() failed. -* Make source() complain using Debug() when it is given a null pointer in - its file argument. -* For clarity, make source() return from only one location. - -Also see Debian bug #219311. - -Forward ported by Eugene Konev. ---- - 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) { -- Debug ("executing session %s\n", verify->argv[0]); -+ LogInfo ("executing session %s\n", verify->argv[0]); - execute (verify->argv, verify->userEnviron); - LogError ("Session \"%s\" execution failed (err %d)\n", verify->argv[0], errno); - } else { -@@ -821,21 +821,28 @@ - source (char **environ, char *file) - { - char **args, *args_safe[2]; -- int ret; -+ int ret = 0; -+ FILE *f; - - if (file && file[0]) { -- Debug ("source %s\n", file); -- args = parseArgs ((char **) 0, file); -- if (!args) { -- args = args_safe; -- args[0] = file; -- args[1] = NULL; -+ f = fopen (file, "r"); -+ if (!f) -+ LogInfo ("not sourcing %s (%s)\n", file, _SysErrorMsg (errno)); -+ else { -+ fclose (f); -+ LogInfo ("sourcing %s\n", file); -+ args = parseArgs ((char **) 0, file); -+ if (!args) { -+ args = args_safe; -+ args[0] = file; -+ args[1] = NULL; -+ } -+ ret = runAndWait (args, environ); -+ freeArgs (args); - } -- ret = runAndWait (args, environ); -- freeArgs (args); -- return ret; -- } -- return 0; -+ } else -+ Debug ("source() given null pointer in file argument\n"); -+ return ret; - } - - static int diff --git a/debian/patches/selinux_support.diff b/debian/patches/selinux_support.diff deleted file mode 100644 index 2f8af27..0000000 --- a/debian/patches/selinux_support.diff +++ /dev/null @@ -1,131 +0,0 @@ -From: Manoj Srivastava <sriva...@golden-gryphon.com> -Subject: xdm: add SELinux support - -History: -Initial patch submitted in Debian bug#233551 -Forward-ported to modular X by Eugene Konev (changes: remove Imakefile hunks, -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 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 - -+use_selinux_default=no -+# Check for selinux support -+AC_ARG_WITH(selinux, AC_HELP_STRING([--with-selinux],[Add support for selinux]), -+ [USE_SELINUX=$withval], [USE_SELINUX=$use_selinux_default]) -+if test "x$USE_SELINUX" != "xno" ; then -+ old_LIBS="$LIBS" -+ LIBS="" -+ AC_SEARCH_LIBS(is_selinux_enabled,[selinux]) -+ AC_CHECK_FUNC(is_selinux_enabled, -+ [AC_DEFINE(HAVE_SELINUX,1,[Add support for selinux])], -+ [if test "x$USE_SELINUX" != "xtry" ; then -+ AC_MSG_ERROR(["selinux support requested, but is_selinux_enabled not found."]) -+ fi]) -+ XDM_LIBS="$XDM_LIBS $LIBS" -+ LIBS="$old_LIBS" -+fi -+ - # FIXME: Find better test for which OS'es use su -m - for now, just try to - # mirror the Imakefile setting of: - # if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) || defined(DarwinArchitecture) -Index: xdm/session.c -=================================================================== ---- 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 - */ - -+#ifdef HAVE_CONFIG_H -+# include "config.h" -+#endif -+ - #include "dm.h" - #include "dm_auth.h" - #include "dm_error.h" -@@ -67,6 +71,11 @@ - # include <prot.h> - #endif - -+#ifdef HAVE_SELINUX -+#include <selinux/selinux.h> -+#include <selinux/get_context_list.h> -+#endif /* HAVE_SELINUX */ -+ - #ifndef GREET_USER_STATIC - # include <dlfcn.h> - # ifndef RTLD_NOW -@@ -74,6 +83,42 @@ - # endif - #endif - -+#ifdef HAVE_SELINUX -+/* This should be run just before we exec the user session. */ -+static int -+xdm_selinux_setup (const char *login) -+ { -+ security_context_t scontext; -+ int ret = -1; -+ char *seuser=NULL; -+ char *level=NULL; -+ -+ /* If SELinux is not enabled, then we don't do anything. */ -+ if ( is_selinux_enabled () <= 0) -+ return TRUE; -+ -+ if (getseuserbyname(login, &seuser, &level) == 0) { -+ ret=get_default_context_with_level(seuser, level, 0, &scontext); -+ free(seuser); -+ free(level); -+ } -+ if (ret < 0 || scontext == NULL) { -+ LogError ("SELinux: unable to obtain default security context for %s\n", login); -+ return FALSE; -+ } -+ -+ if (setexeccon (scontext) != 0) { -+ freecon (scontext); -+ LogError ("SELinux: unable to set executable context %s\n", -+ (char *)scontext); -+ return FALSE; -+ } -+ -+ freecon (scontext); -+ return TRUE; -+} -+#endif /* HAVE_SELINUX */ -+ - static int runAndWait (char **args, char **environ); - - #ifdef HAVE_GRP_H -@@ -782,6 +827,17 @@ - bzero(passwd, strlen(passwd)); - - SetUserAuthorization (d, verify); -+#ifdef HAVE_SELINUX -+ /* -+ * For Security Enhanced Linux: -+ * set the default security context for this user. -+ */ -+ if ( ! xdm_selinux_setup (name)) { -+ LogError ("failed to set security context\n"); -+ exit (UNMANAGE_DISPLAY); -+ return (0); -+ } -+#endif /* HAVE_SELINUX */ - home = getEnv (verify->userEnviron, "HOME"); - if (home) - if (chdir (home) == -1) { diff --git a/debian/patches/series b/debian/patches/series index e799ec9..15eddf7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,30 +1,11 @@ -# upstream cd6b6d5f78e92725d6466d138f5441d791e58212 -02_xdm_zombie_no_error.diff - # this one might need some ifdefs 06_hurd_utsname.diff -# upstream 11d6aa0b392daef2900681b70960d8be4ada89a9 -15_xdm_openfiles.diff - # patch 20 has signal safety issues 20_xdm_log_timestamp.diff 21_xdm_log_append.diff -# upstream 17105faffcb4533da71f0d3d17fd40a64b6faf50 -90_xdm_write_dummy_auth.diff -# upstream 5222d28e8d8e5b4cc705f1a637aace405ad32bd5 -91_xdm_saveserverauth_logging.diff - -# upstream 90c2cc57cdf911cec2eec185f357868209212c79 -log_sourcing_better.diff -# upstream 6d393844dca10823f85d1ac797879fc6e00eae59 -selinux_support.diff - support_logfile_rotation.diff -# upstream c925709069d7515bb94f43e4b88155a95e41c8fe -storepid_rewrite.diff - debian.diff doc_mention_xdm.options.diff diff --git a/debian/patches/storepid_rewrite.diff b/debian/patches/storepid_rewrite.diff deleted file mode 100644 index ddd4a5e..0000000 --- a/debian/patches/storepid_rewrite.diff +++ /dev/null @@ -1,141 +0,0 @@ -From: Branden Robinson <bran...@debian.org> -Date: Mon, 18 Nov 2002 04:24:48 -0500 -Subject: rewrite StorePid() - -Update StorePid() function to use Matthieu Herrb's changes that refuse -to open an existing pid file, and take more care with the size of the -Pid_t type. - -Matthieu Herrb rewrote the StorePid() function based on my changes; he -made it more careful with the size of Pid_t, and treats an existing pid -file as a failure. I then made some more changes: use _SysErrorMsg() -instead of strerror(), and don't assume that the process id we write to -the pidFile is 5 digits. - -Forward-ported by David Nusinow, Eugene Konev and Julien Cristau. - -Index: xdm/dm.c -=================================================================== ---- xdm.orig/dm.c -+++ xdm/dm.c -@@ -106,7 +106,7 @@ - static SIGVAL ChildNotify (int n); - #endif - --static int StorePid (void); -+static long StorePid (void); - static void RemovePid (void); - - static pid_t parent_pid = -1; /* PID of parent xdm process */ -@@ -902,65 +902,64 @@ - static int pidFd; - static FILE *pidFilePtr; - --static int -+/* -+ * Create and populate file storing xdm's process ID. -+ */ -+static long - StorePid (void) - { -- int oldpid; -+ long oldpid; -+ char pidstr[11]; /* enough space for a 32-bit pid plus \0 */ -+ size_t pidstrlen; - -- if (pidFile[0] != '\0') { -- pidFd = open (pidFile, O_RDWR); -- if (pidFd == -1 && errno == ENOENT) -- pidFd = open (pidFile, O_RDWR|O_CREAT, 0666); -- if (pidFd == -1 || !(pidFilePtr = fdopen (pidFd, "r+"))) -+ if (pidFile[0] != '\0') -+ { -+ Debug ("storing process ID in %s\n", pidFile); -+ pidFd = open (pidFile, O_WRONLY|O_CREAT|O_EXCL, 0666); -+ if (pidFd == -1) - { -- LogError ("process-id file %s cannot be opened\n", -- pidFile); -- return -1; -- } -- if (fscanf (pidFilePtr, "%d\n", &oldpid) != 1) -- oldpid = -1; -- fseek (pidFilePtr, 0l, 0); -- if (lockPidFile) -- { --#ifdef F_SETLK --# ifndef SEEK_SET --# define SEEK_SET 0 --# endif -- struct flock lock_data; -- lock_data.l_type = F_WRLCK; -- lock_data.l_whence = SEEK_SET; -- lock_data.l_start = lock_data.l_len = 0; -- if (fcntl(pidFd, F_SETLK, &lock_data) == -1) -+ if (errno == EEXIST) - { -- if (errno == EAGAIN) -- return oldpid; -- else -+ /* pidFile already exists; see if we can open it */ -+ pidFilePtr = fopen (pidFile, "r"); -+ if (pidFilePtr == NULL) -+ { -+ LogError ("cannot open process ID file %s for reading: " -+ "%s\n", pidFile, _SysErrorMsg (errno)); - return -1; -+ } -+ if (fscanf (pidFilePtr, "%ld\n", &oldpid) != 1) -+ { -+ LogError ("existing process ID file %s empty or contains " -+ "garbage\n", pidFile); -+ oldpid = -1; -+ } -+ fclose (pidFilePtr); -+ return oldpid; - } --#else --# ifdef LOCK_EX -- if (flock (pidFd, LOCK_EX|LOCK_NB) == -1) -- { -- if (errno == EWOULDBLOCK) -- return oldpid; - else -- return -1; -- } --# else -- if (lockf (pidFd, F_TLOCK, 0) == -1) - { -- if (errno == EACCES) -- return oldpid; -- else -- return -1; -+ LogError ("cannot fdopen process ID file %s for writing: " -+ "%s\n", pidFile, _SysErrorMsg (errno)); -+ return -1; - } --# endif --#endif - } -- ftruncate(pidFd, 0); -- fprintf (pidFilePtr, "%5ld\n", (long)getpid ()); -+ if ((pidFilePtr = fdopen (pidFd, "w")) == NULL) -+ { -+ LogError ("cannot open process ID file %s for writing: %s\n", -+ pidFile, _SysErrorMsg (errno)); -+ return -1; -+ } -+ (void) snprintf (pidstr, 11, "%ld", (long) getpid ()); -+ pidstrlen = strlen (pidstr); -+ if (fprintf (pidFilePtr, "%s\n", pidstr) != ( pidstrlen + 1)) -+ { -+ LogError ("cannot write to process ID file %s: %s\n", pidFile, -+ _SysErrorMsg (errno)); -+ return -1; -+ } - (void) fflush (pidFilePtr); -- RegisterCloseOnFork (pidFd); -+ (void) fclose (pidFilePtr); - } - return 0; - } commit 48e9fc36651eee8a7a517039e7c2befcc7efc467 Author: Julien Cristau <jcris...@debian.org> Date: Sat Apr 10 03:49:45 2010 +0200 Update changelogs diff --git a/ChangeLog b/ChangeLog index 91ae211..9af5a86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,463 @@ +commit 7006d5c582e382660437a64b749822116823ecee +Author: Julien Cristau <jcris...@debian.org> +Date: Sat Apr 10 03:48:05 2010 +0200 + + Bump to 1.1.10 + +commit 7c4c0592aca80cc8affe4e94d2742caa754d5be3 +Author: Julien Cristau <jcris...@debian.org> +Date: Sun Apr 4 19:20:39 2010 +0200 + + Add missing brace in previous commit + + Thanks to cjb and tinderbox. + + Signed-off-by: Julien Cristau <jcris...@debian.org> + +commit 8eb897bb980dd6ce3f8ade517a8a39023a477743 +Author: Julien Cristau <jcris...@debian.org> +Date: Tue Mar 23 19:40:49 2010 +0100 + + xdmcp: disable IPV6_V6ONLY for ipv6 listening sockets + + This allows ipv4 connections mapped to ipv6, in case the system default + is backwards. + + Signed-off-by: Julien Cristau <jcris...@debian.org> + Reviewed-by: Jeremy Huddleston <jerem...@apple.com> + +commit 3a4f890fa9466ed27d49ce97adbcad30b840d3d4 +Author: Julien Cristau <jcris...@debian.org> +Date: Tue Mar 23 19:40:48 2010 +0100 + + Don't remove the pid file from xdm child processes + + The parent xdm process registers RemovePid with atexit(), which means + that any child exit would trigger the (wrong) removal of the pidfile. + So in RemovePid, don't do anything if we're not the parent xdm process. + + Signed-off-by: Julien Cristau <jcris...@debian.org> + Reviewed-by: Jeremy Huddleston <jerem...@apple.com> + +commit 931c98390274a9e0c62c41c5e9ceed6681e7a9b7 +Author: Gaetan Nadon <mems...@videotron.ca> +Date: Sat Mar 13 15:19:37 2010 -0500 + + lint: option -rdynamic is not valid for the lint program + + Use xdm_LIBS instead. Tested on Solaris. + + Signed-off-by: Gaetan Nadon <mems...@videotron.ca> + +commit 34b9c0e02bc2d36da2c8c5ee468b2a2d63914610 +Author: Alan Coopersmith <alan.coopersm...@sun.com> +Date: Tue Mar 16 16:33:48 2010 -0700 + + Reject PAM conversation calls after login dialog is closed + + Based on patch suggested by Bjoern A. Zeeb <bzeeb+pa...@zabbadoz.net> + to fix http://bugs.freedesktop.org/show_bug.cgi?id=10522 + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit afc752d1c483e77de9aa3cb9532a67d95fd27dd9 +Author: Alan Coopersmith <alan.coopersm...@sun.com> +Date: Tue Mar 16 11:23:30 2010 -0700 + + Make sure username is not NULL when calling syslog from FailedLogin() + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit 0f18bdfa7fcfe100e487f4c9f91ae37a125ef0f0 +Author: Johannes Dewender <x...@jonnyjd.net> +Date: Fri Nov 13 21:28:23 2009 +0100 + + Bug #25066: exec sessreg + + Sessreg saves the pid of the calling process in utmp. + If this process is terminated the session is implicitly deleted. + Xstartup is called and the process id is gone right when + the script is done so the session is closed right away. + Using "exec" will save the pid of the master process of this login. + + Signed-off-by: Johannes Dewender <x...@jonnyjd.net> + Tested-by: Johannes Dewender <x...@jonnyjd.net> + Acked-by: Julien Cristau <jcris...@debian.org> + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit c9cdd56df50f280e90ba95cfa933222f94ad2677 +Author: Alan Coopersmith <alan.coopersm...@sun.com> +Date: Mon Mar 15 23:34:04 2010 -0700 + + Move m4 macros to m4 subdir as automake/libtool recommend + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit b9226288b96f0c5988d2c2f52718674d39803a5e +Author: Alan Coopersmith <alan.coopersm...@sun.com> +Date: Mon Mar 15 23:21:30 2010 -0700 + + Replace hardcoded NAMELEN of 14 for ancient SysV with MAXNAMELEN + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit af916ebc97a3bd6208f1376e52a4310099b48622 +Author: Alan Coopersmith <alan.coopersm...@sun.com> +Date: Mon Mar 15 18:12:05 2010 -0700 + + echo_passwd should key off PAM no-echo state, not prompt position + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> + +commit dd9dc06055e16cd72ff34c2caea22a6627803fa5 +Author: Georgy A. Shepelev <ge...@super-komputer6-44.ultra> +Date: Wed Dec 9 09:34:02 2009 +0300 + + xdm: add documentation of the "EchoPasswd" option to the man page + + Signed-off-by: Georgy A. Shepelev <shepelev.geo...@googlemail.com> + +commit 7437298deab265b7669043d4a470a684201f5f3c +Author: Georgy A. Shepelev <ge...@k24a.ulsu.ru> +Date: Wed Dec 9 12:18:50 2009 +0300 + + Adding an option to show stars instead of the password itself. + + The behaviour can be controlled via 'xlogin*echoPasswd' option + in Xresource file. The default option value is 'false'. + + Signed-off-by: Georgy A. Shepelev <shepelev.geo...@googlemail.com> + Tested-by: Georgy A. Shepelev <shepelev.geo...@googlemail.com> + + [Reformatted to match existing code style by Alan Coopersmith] + + Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1o0qcj-0004rd...@alioth.debian.org