debian/changelog | 6 ++++ debian/local/xserver-wrapper.c | 38 ++++++++++++++----------- debian/xserver-xorg.postinst.in | 60 ---------------------------------------- debian/xserver-xorg.preinst.in | 32 --------------------- debian/xserver-xorg.prerm.in | 33 ---------------------- 5 files changed, 27 insertions(+), 142 deletions(-)
New commits: commit 92e0aab7088619401247107911e2ecb4804a47d7 Author: Maarten Lankhorst <maarten.lankho...@ubuntu.com> Date: Mon Feb 9 10:48:56 2015 +0100 Cope with /etc/X11/X not existing. Default to /usr/bin/Xorg if no /etc/X11/X symlink is found. Remove creation of /etc/X11/X symlink, but keep existing. Do not chdir to /etc/X11 if the symlink has an absolute path. diff --git a/debian/changelog b/debian/changelog index b09fa77..8692a77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,17 @@ xorg (1:7.7+8) UNRELEASED; urgency=medium + [ Laurent Bigonville ] * debian/x11-common.init: Add Short-Description field (Closes: #510087) * debian/x11-common.init: Call restorecon after creating the socket directories to ensure the SELinux context if properly set (Closes: #677831) * debian/control: Bump Standards-Version to 3.9.5 (no further changes) * debian/control: Use canonical Vcs-* URL + [ Maarten Lankhorst ] + * Default to /usr/bin/Xorg if no /etc/X11/X symlink is found. + * Remove creation of /etc/X11/X symlink, but keep existing. + * Do not chdir to /etc/X11 if the symlink has an absolute path. + -- Laurent Bigonville <bi...@debian.org> Wed, 24 Sep 2014 12:57:17 +0200 xorg (1:7.7+7) unstable; urgency=medium diff --git a/debian/local/xserver-wrapper.c b/debian/local/xserver-wrapper.c index d4a6ab8..08e02e3 100644 --- a/debian/local/xserver-wrapper.c +++ b/debian/local/xserver-wrapper.c @@ -251,32 +251,36 @@ main(int argc, char **argv) X_WRAPPER_CONFIG_FILE); */ } - if (lstat(X_SERVER_SYMLINK, &statbuf)) { + i = lstat(X_SERVER_SYMLINK, &statbuf); + if (i < 0 && errno != ENOENT) { (void) fprintf(stderr, "X: cannot stat %s (%s), aborting.\n", X_SERVER_SYMLINK, strerror(errno)); exit(1); } - i = readlink(X_SERVER_SYMLINK, xserver, 1024); - if (i < 0) { - (void) fprintf(stderr, "X: cannot read %s symbolic link (%s), aborting.\n", - X_SERVER_SYMLINK, strerror(errno)); - exit(1); - } + strcpy(xserver, "/usr/bin/Xorg"); + } else { + i = readlink(X_SERVER_SYMLINK, xserver, 1024); - xserver[i] = '\0'; /* readlink() does not null-terminate the string */ + if (i < 0) { + (void) fprintf(stderr, "X: cannot read %s symbolic link (%s), aborting.\n", + X_SERVER_SYMLINK, strerror(errno)); + exit(1); + } + xserver[i] = '\0'; /* readlink() does not null-terminate the string */ - if ((strcmp(xserver, "/usr/bin/X11/X") == 0) || - (strcmp(xserver, "/usr/X11R6/bin/X") == 0) || - (strcmp(xserver, "/usr/bin/X") == 0)) { - (void) fprintf(stderr, "X: %s points back to X wrapper executable, " - "aborting.\n", X_SERVER_SYMLINK); - exit(1); + if ((strcmp(xserver, "/usr/bin/X11/X") == 0) || + (strcmp(xserver, "/usr/X11R6/bin/X") == 0) || + (strcmp(xserver, "/usr/bin/X") == 0)) { + (void) fprintf(stderr, "X: %s points back to X wrapper executable, " + "aborting.\n", X_SERVER_SYMLINK); + exit(1); + } } - if (access(X_SERVER_SYMLINK, X_OK)) { /* access() uses real uid */ - (void) fprintf(stderr, "%s is not executable\n", X_SERVER_SYMLINK); + if (access(xserver, X_OK)) { /* access() uses real uid */ + (void) fprintf(stderr, "%s is not executable\n", val); exit(1); } @@ -333,7 +337,7 @@ main(int argc, char **argv) * 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)) { + if (xserver[0] != '/' && chdir(X_SERVER_SYMLINK_DIR)) { (void) fprintf(stderr, "X: cannot chdir() to %s (%s), aborting.\n", X_SERVER_SYMLINK_DIR, strerror(errno)); exit(1); diff --git a/debian/xserver-xorg.postinst.in b/debian/xserver-xorg.postinst.in deleted file mode 100644 index 3cc91c0..0000000 --- a/debian/xserver-xorg.postinst.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Debian xserver-xorg package post-installation script -# Copyright 1998-2004 Branden Robinson. -# Copyright 2004-2005 Canonical Ltd. -# Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>. -# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava. - -set -e - -THIS_PACKAGE=xserver-xorg -THIS_SCRIPT=postinst - -#INCLUDE_SHELL_LIB# - -if [ -e /etc/default/xorg ]; then - . /etc/default/xorg -fi - -debug_echo () { - # Syntax: debug_echo message ... - if [ -n "$DEBUG_XORG_DEBCONF" ] || [ "$DEBCONF_DEBUG" = "user" ] \ - || [ "$DEBCONF_DEBUG" = '.*' ]; then - DEBUG_XORG_PACKAGE="yes" observe "$*" - fi -} - -CONFIG_DIR="/etc/X11" -CONFIG_AUX_DIR=/var/lib/x11 -SERVER_SYMLINK="$CONFIG_DIR/X" -XORGCONFIG="$CONFIG_DIR/xorg.conf" -CONFIG_AUX_DIR="/var/lib/x11" -SERVER_SYMLINK_CHECKSUM="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.md5sum" -SERVER_SYMLINK_ROSTER="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.roster" -XORGCONFIG_CHECKSUM="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.md5sum" -XORGCONFIG_ROSTER="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.roster" -THIS_SERVER=/usr/bin/Xorg - -debug_report_status () { - # Syntax: debug_report_status command exit_status - debug_echo "$1 exited with status $2" -} - -debug_echo "Configuring $THIS_PACKAGE." - -#DEBHELPER# - -# only mess with the server symlink file if it does not exist. otherwise, -# assume that's the way the user wants it. -if ! [ -e "$SERVER_SYMLINK" ]; then - ln -s "$THIS_SERVER" "$SERVER_SYMLINK" -# recover from an old bug -elif [ `readlink "$SERVER_SYMLINK"` = "/bin/true" ]; then - rm -f "$SERVER_SYMLINK" - ln -s "$THIS_SERVER" "$SERVER_SYMLINK" -fi - -exit 0 - -# vim:set ai et sts=2 sw=2 tw=0: diff --git a/debian/xserver-xorg.preinst.in b/debian/xserver-xorg.preinst.in deleted file mode 100644 index d507b68..0000000 --- a/debian/xserver-xorg.preinst.in +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Debian xserver-xorg package pre-installation script -# Copyright 2003, 2004 Branden Robinson. -# Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>. - - -set -e - -THIS_PACKAGE=xserver-xorg -THIS_SCRIPT=preinst - -#INCLUDE_SHELL_LIB# - -CONFIG_DIR=/etc/X11 -SERVER_SYMLINK="$CONFIG_DIR/X" -CONFIG_AUX_DIR=/var/lib/x11 -THIS_SERVER=/usr/bin/Xorg - -if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then - # create the configuration files directory if it doesn't exist - if ! [ -e "$CONFIG_DIR" ]; then - observe "creating $CONFIG_DIR" - mkdir --mode=755 --parents "$CONFIG_DIR" - fi -fi - -#DEBHELPER# - -exit 0 - -# vim:set ai et sts=2 sw=2 tw=0: diff --git a/debian/xserver-xorg.prerm.in b/debian/xserver-xorg.prerm.in deleted file mode 100644 index f45708d..0000000 --- a/debian/xserver-xorg.prerm.in +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# Debian xserver-xorg package pre-removal script -# Copyright 1998--2001, 2003, 2004 Branden Robinson. -# Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>. -# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava. - - -set -e - -# debconf may not be available if some massive purging is going on -HAVE_DEBCONF= -if [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - HAVE_DEBCONF=yes -fi - -THIS_PACKAGE=xserver-xorg -THIS_SCRIPT=prerm - -#INCLUDE_SHELL_LIB# - -CONFIG_DIR=/etc/X11 -SERVER_SYMLINK="$CONFIG_DIR/X" -CONFIG_AUX_DIR=/var/lib/x11 -SERVER_SYMLINK_CHECKSUM="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.md5sum" -UNCONFIGURED_LINK_TARGET=$(which true) - -#DEBHELPER# - -exit 0 - -# vim:set ai et sts=2 sw=2 tw=0: -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/e1ykkzw-0000iw...@moszumanska.debian.org