X Strike Force XFree86 SVN commit: r1176 - in trunk/debian: . patches
Author: branden
Date: 2004-03-25 12:48:15 -0500 (Thu, 25 Mar 2004)
New Revision: 1176
Added:
trunk/debian/patches/078_xdm_log_sourcing_better.diff
Modified:
trunk/debian/changelog
Log:
Improve logging of xdm's script handling in session.c.
+ 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 strerror() to
report why fopen() failed. (Closes: #219311)
+ 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.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2004-03-25 16:52:46 UTC (rev 1175)
+++ trunk/debian/changelog 2004-03-25 17:48:15 UTC (rev 1176)
@@ -18,8 +18,19 @@
* Fix cosmetic formatting error in dexconf manpage.
- -- Branden Robinson <branden@debian.org> Thu, 25 Mar 2004 11:52:04 -0500
+ * Improve logging of xdm's script handling in session.c.
+ + 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 strerror() to
+ report why fopen() failed. (Closes: #219311)
+ + 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.
+ -- Branden Robinson <branden@debian.org> Thu, 25 Mar 2004 12:46:02 -0500
+
xfree86 (4.3.0-7) unstable; urgency=medium
* Urgency due to fix for FTBFS. Yes -- I too am begging for it to stop.
Added: trunk/debian/patches/078_xdm_log_sourcing_better.diff
===================================================================
--- trunk/debian/patches/078_xdm_log_sourcing_better.diff 2004-03-25 16:52:46 UTC (rev 1175)
+++ trunk/debian/patches/078_xdm_log_sourcing_better.diff 2004-03-25 17:48:15 UTC (rev 1176)
@@ -0,0 +1,78 @@
+$Id$
+
+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 strerror() 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.
+
+This patch by Branden Robinson.
+
+--- xc/programs/xdm/session.c~ 2004-03-25 12:11:27.000000000 -0500
++++ xc/programs/xdm/session.c 2004-03-25 12:43:56.000000000 -0500
+@@ -46,6 +46,7 @@
+ #include <X11/Xmu/Error.h>
+ #include <errno.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <ctype.h>
+ #include <grp.h> /* for initgroups */
+ #ifdef AIXV3
+@@ -734,7 +735,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 {
+@@ -762,21 +763,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, strerror (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
Property changes on: trunk/debian/patches/078_xdm_log_sourcing_better.diff
___________________________________________________________________
Name: svn:keywords
+ Id
Reply to: