[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force XFree86 SVN commit: rev 720 - trunk/debian



Author: branden
Date: 2003-10-27 12:15:25 -0500 (Mon, 27 Oct 2003)
New Revision: 720

Modified:
   trunk/debian/changelog
   trunk/debian/xdm.config.in
Log:
Fix xdm's config script to not choke on multiword garbage in
/etc/X11/default-display-manager, by quoting the argument to basename.
Use grep with head to extract the first non-whitespace, non-comment line
from the file.  If the result does not appear to be a command ("which"
fails), observe() it.  (Closes: #217605)

- debian/xdm.config.in


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2003-10-27 08:49:38 UTC (rev 719)
+++ trunk/debian/changelog	2003-10-27 17:15:25 UTC (rev 720)
@@ -255,8 +255,15 @@
     - debian/xfonts-scalable.postinst.in
     - debian/xfonts-scalable.postrm.in
 
- -- Branden Robinson <branden@debian.org>  Mon, 27 Oct 2003 03:48:42 -0500
+  * Fix xdm's config script to not choke on multiword garbage in
+    /etc/X11/default-display-manager, by quoting the argument to basename.
+    Use grep with head to extract the first non-whitespace, non-comment line
+    from the file.  If the result does not appear to be a command ("which"
+    fails), observe() it.  (Closes: #217605)
+    - debian/xdm.config.in
 
+ -- Branden Robinson <branden@debian.org>  Mon, 27 Oct 2003 11:51:41 -0500
+
 xfree86 (4.2.1-12.1) unstable; urgency=low
 
   * Fix typo in xlibs preinst.  Closes: #213774, #213776

Modified: trunk/debian/xdm.config.in
===================================================================
--- trunk/debian/xdm.config.in	2003-10-27 08:49:38 UTC (rev 719)
+++ trunk/debian/xdm.config.in	2003-10-27 17:15:25 UTC (rev 720)
@@ -33,8 +33,15 @@
   # debconf is not a registry; use the current contents of the default display
   # manager file to pre-answer the question if possible
   if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
-    CURRENT_DEFAULT=$(basename $(head -n 1 "$DEFAULT_DISPLAY_MANAGER_FILE"))
+    CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
+                                  "$DEFAULT_DISPLAY_MANAGER_FILE" |
+                                  head -n -1)")
     if [ -n "$CURRENT_DEFAULT" ]; then
+      if ! which "$CURRENT_DEFAULT" > /dev/null 2>&1; then
+        observe "default display manager \"$CURRENT_DEFAULT\" specified in" \
+                "$DEFAULT_DISPLAY_MANAGER_FILE does not exist or is not" \
+                "executable"
+      fi
       safe_debconf db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
     fi
   else



Reply to: