[xorg-x11-xinit] Fix startx ignoring a server or display passed on the cmdline (#960955)
Hans de Goede
jwrdegoede at fedoraproject.org
Tue Mar 25 12:03:40 UTC 2014
commit 7500efbebed46f35b03394f679a01624308e040d
Author: Hans de Goede <hdegoede at redhat.com>
Date: Tue Mar 25 13:00:18 2014 +0100
Fix startx ignoring a server or display passed on the cmdline (#960955)
- Drop Fedora custom patch to unset XDG_SESSION_COOKIE, this was only for CK
0001-Drop-RAWCPPFLAGS-when-generating-startx.patch | 26 ++++++++++
...rtx-Under-Linux-start-X-on-the-current-VT.patch | 50 ++++++++++++++++++++
...Makefile.am-Give-XINITDIR-a-default-value.patch | 28 +++++++++++
xinit-1.0.9-unset.patch | 12 -----
xorg-x11-xinit-1.3.2-systemd-logind.patch | 27 -----------
xorg-x11-xinit.spec | 30 ++++++------
6 files changed, 120 insertions(+), 53 deletions(-)
---
diff --git a/0001-Drop-RAWCPPFLAGS-when-generating-startx.patch b/0001-Drop-RAWCPPFLAGS-when-generating-startx.patch
new file mode 100644
index 0000000..114161c
--- /dev/null
+++ b/0001-Drop-RAWCPPFLAGS-when-generating-startx.patch
@@ -0,0 +1,26 @@
+From 90b6f5dfcb9c9f41dcbd59b006ea703f2f78b3b1 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Tue, 25 Mar 2014 11:48:58 +0100
+Subject: [PATCH 1/3] Drop $RAWCPPFLAGS when generating startx
+
+startx.cpp contains things like #if defined(__SCO__), and
+$RAWCPPFLAGS contains -undef causing these to not get set.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ cpprules.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpprules.in b/cpprules.in
+index 0931bee..781676a 100644
+--- a/cpprules.in
++++ b/cpprules.in
+@@ -15,4 +15,4 @@ CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
+ SUFFIXES = .cpp
+
+ .cpp:
+- $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
++ $(AM_V_GEN)$(RAWCPP) $(CPP_FILES_FLAGS) $< | $(CPP_SED_MAGIC) > $@
+--
+1.9.0
+
diff --git a/0002-startx-Under-Linux-start-X-on-the-current-VT.patch b/0002-startx-Under-Linux-start-X-on-the-current-VT.patch
new file mode 100644
index 0000000..3c66b1d
--- /dev/null
+++ b/0002-startx-Under-Linux-start-X-on-the-current-VT.patch
@@ -0,0 +1,50 @@
+From e222d3b978499d1e9293dcbe97bb8349da8ad4ea Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Tue, 25 Mar 2014 11:54:31 +0100
+Subject: [PATCH 2/3] startx: Under Linux start X on the current VT
+
+When we let X allocate a new VT, systemd-logind will not recognize any
+processes running on this VT as belonging to a valid session (since there
+was no pam session opened on that tty).
+
+This causes problems like PolicyKit denials for these processes.
+
+ConsoleKit under Linux has been deprecated for a few years now and is no
+longer being maintained, so simply make this the default under Linux.
+
+Note we do not pass in the vt if the user has specified an alternative server
+to start, as the vtX argument is only valid for the Xorg server, likewise we
+omit it if the user has specified any other server arguments.
+
+Fixes:
+https://bugzilla.redhat.com/show_bug.cgi?id=806491
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ startx.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/startx.cpp b/startx.cpp
+index c595b84..3708471 100644
+--- a/startx.cpp
++++ b/startx.cpp
+@@ -228,6 +228,16 @@ XCOMM process server arguments
+ if [ x"$server" = x ]; then
+ server=$defaultserver
+
++#ifdef __linux__
++ XCOMM When starting the defaultserver start X on the current tty to avoid
++ XCOMM the startx session being seen as inactive: RHBZ#820675
++ tty=$(tty)
++ if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then
++ tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
++ defaultserverargs=${defaultserverargs}" vt"${tty_num}
++ fi
++#endif
++
+ XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments
+ if [ x"$serverargs" = x -a x"$display" = x ]; then
+ if [ -f "$userserverrc" ]; then
+--
+1.9.0
+
diff --git a/0003-Makefile.am-Give-XINITDIR-a-default-value.patch b/0003-Makefile.am-Give-XINITDIR-a-default-value.patch
new file mode 100644
index 0000000..b787a32
--- /dev/null
+++ b/0003-Makefile.am-Give-XINITDIR-a-default-value.patch
@@ -0,0 +1,28 @@
+From ab3df9890d3056f217c1fce11101e362db1bdcf7 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Tue, 25 Mar 2014 12:31:28 +0100
+Subject: [PATCH 3/3] Makefile.am: Give XINITDIR a default value
+
+We are using XINITDIR, but never setting it. Lets give it a sane default.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3867bea..ec8d4cc 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -27,6 +27,8 @@ endif
+ bin_PROGRAMS = xinit
+ bin_SCRIPTS = startx
+
++XINITDIR = $(sysconfdir)/X11/xinit
++
+ AM_CFLAGS = $(CWARNFLAGS) $(XINIT_CFLAGS)
+ AM_CPPFLAGS = -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\"
+ xinit_LDADD = $(XINIT_LIBS)
+--
+1.9.0
+
diff --git a/xorg-x11-xinit.spec b/xorg-x11-xinit.spec
index 2da6232..1493bca 100644
--- a/xorg-x11-xinit.spec
+++ b/xorg-x11-xinit.spec
@@ -3,7 +3,7 @@
Summary: X.Org X11 X Window System xinit startup scripts
Name: xorg-x11-%{pkgname}
Version: 1.3.2
-Release: 10%{?dist}
+Release: 11%{?dist}
License: MIT
Group: User Interface/X
URL: http://www.x.org
@@ -24,10 +24,13 @@ Source19: xinit-compat
# Fedora specific patches
Patch1: xinit-1.0.2-client-session.patch
-# Fix startx to run on the same tty as user to avoid new session.
+
+# Fixes scheduled to go upstream for the next release, fixing:
# https://bugzilla.redhat.com/show_bug.cgi?id=806491
-Patch2: xorg-x11-xinit-1.3.2-systemd-logind.patch
-Patch3: xinit-1.0.9-unset.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=960955
+Patch2: 0001-Drop-RAWCPPFLAGS-when-generating-startx.patch
+Patch3: 0002-startx-Under-Linux-start-X-on-the-current-VT.patch
+Patch4: 0003-Makefile.am-Give-XINITDIR-a-default-value.patch
BuildRequires: pkgconfig
BuildRequires: libX11-devel
@@ -56,20 +59,17 @@ Allows legacy ~/.xsession and ~/.Xclients files to be used from display managers
%prep
%setup -q -n %{pkgname}-%{version}
%patch1 -p1 -b .client-session
-%patch2 -p1 -b .systemd-logind
-%patch3 -p1 -b .unset
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
autoreconf -fi
%configure
-# FIXME: Upstream should default to XINITDIR being this. Make a patch to
-# Makefile.am and submit it in a bug report or check into CVS.
-make XINITDIR=%{_sysconfdir}/X11/xinit
+make %{?_smp_mflags}
%install
-# FIXME: Upstream should default to XINITDIR being this. Make a patch to
-# Makefile.am and submit it in a bug report or check into CVS.
-make install DESTDIR=$RPM_BUILD_ROOT XINITDIR=%{_sysconfdir}/X11/xinit
+%make_install
install -p -m644 -D %{SOURCE18} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compat.desktop
# Install Red Hat custom xinitrc, etc.
@@ -95,7 +95,6 @@ install -p -m644 -D %{SOURCE18} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compa
}
%files
-%defattr(-,root,root,-)
%doc COPYING README ChangeLog
%{_bindir}/startx
%{_bindir}/xinit
@@ -113,11 +112,14 @@ install -p -m644 -D %{SOURCE18} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compa
%{_mandir}/man1/xinit.1*
%files session
-%defattr(-, root, root,-)
%{_libexecdir}/xinit-compat
%{_datadir}/xsessions/xinit-compat.desktop
%changelog
+* Tue Mar 25 2014 Hans de Goede <hdegoede at redhat.com> - 1.3.2-11
+- Fix startx ignoring a server or display passed on the cmdline (#960955)
+- Drop Fedora custom patch to unset XDG_SESSION_COOKIE, this was only for CK
+
* Thu Jan 23 2014 Dave Airlie <airlied at redhat.com> 1.3.2-10
- fix for ppc64le enable (#1056742)
More information about the scm-commits
mailing list