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

X Strike Force SVN commit: rev 354 - in trunk/debian: . local



Author: branden
Date: 2003-08-01 14:24:41 -0500 (Fri, 01 Aug 2003)
New Revision: 354

Modified:
   trunk/debian/changelog
   trunk/debian/local/xserver-wrapper.c
Log:
debian/local/xserver-wrapper.c: chdir() to the directory where the X server
  symlink is kept before executing its target, so that relative symlinks
  work


Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	2003-08-01 18:13:08 UTC (rev 353)
+++ trunk/debian/changelog	2003-08-01 19:24:41 UTC (rev 354)
@@ -75,8 +75,12 @@
     time this package is configured for the first time, set the default nice
     value to 0 instead of -10
 
- -- Branden Robinson <branden@debian.org>  Fri,  1 Aug 2003 13:11:48 -0500
+  * debian/local/xserver-wrapper.c: chdir() to the directory where the X
+    server symlink is kept before executing its target, so that relative
+    symlinks work (Closes: #138195)
 
+ -- Branden Robinson <branden@debian.org>  Fri,  1 Aug 2003 14:23:18 -0500
+
 xfree86 (4.2.1-9) unstable; urgency=high
 
   * urgency due to xterm security fixes; see below

Modified: trunk/debian/local/xserver-wrapper.c
==============================================================================
--- trunk/debian/local/xserver-wrapper.c	2003-08-01 18:13:08 UTC (rev 353)
+++ trunk/debian/local/xserver-wrapper.c	2003-08-01 19:24:41 UTC (rev 354)
@@ -63,6 +63,9 @@
  * Branden Robinson: stop using the GNU extension strnlen() to appease the
  *                   Debian GNU/NetBSD geeks, who are using BSD's C library
  *                   (16 Oct 2002)
+ * Branden Robinson: chdir() to the directory where the X server symlink is kept
+ *                   before executing its target, so that relative symlinks work
+ *                   (1 Aug 2003)
  *
  * This is free software; you may redistribute it and/or modify
  * it under the terms of the GNU General Public License as
@@ -101,6 +104,7 @@
 
 #define VT_MAJOR_DEV 4
 #define X_WRAPPER_CONFIG_FILE "/etc/X11/Xwrapper.config"
+#define X_SERVER_SYMLINK_DIR "/etc/X11"
 #define X_SERVER_SYMLINK "/etc/X11/X"
 #define X_SOCKET_DIR "/tmp/.X11-unix"
 #define X_SOCKET_DIR_MODE (S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
@@ -332,6 +336,16 @@
 #endif
 
     /* DEBUG exit(0); */
+
+    /*
+     * change to the directory where the X server symlink is so that a relative
+     * symlink will work and execute the X server
+     */
+    if (chdir(X_SERVER_SYMLINK_DIR)) {
+      (void) fprintf(stderr, "X: cannot chdir() to %s (%s), aborting.\n",
+                     X_SERVER_SYMLINK_DIR, strerror(errno));
+      exit(1);
+    }
     (void) execv(xserver, argv);
     (void) fprintf(stderr, "X: exec of %s failed\n", xserver);
     exit(1);



Reply to: