diff --git a/.gitignore b/.gitignore index a6b2213..2e76eab 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xinit-1.3.2.tar.bz2 +SOURCES/xinit-1.3.4.tar.bz2 diff --git a/.xorg-x11-xinit.metadata b/.xorg-x11-xinit.metadata index 9ae95a1..b7743ca 100644 --- a/.xorg-x11-xinit.metadata +++ b/.xorg-x11-xinit.metadata @@ -1 +1 @@ -1c287ac016d277f973652fa3707eef6db8353d5a SOURCES/xinit-1.3.2.tar.bz2 +de3469080d73ced1f7d7a1803e813bc6ea352072 SOURCES/xinit-1.3.4.tar.bz2 diff --git a/SOURCES/0001-startx-Pass-keeptty-when-telling-the-server-to-start.patch b/SOURCES/0001-startx-Pass-keeptty-when-telling-the-server-to-start.patch new file mode 100644 index 0000000..f6fa8ff --- /dev/null +++ b/SOURCES/0001-startx-Pass-keeptty-when-telling-the-server-to-start.patch @@ -0,0 +1,34 @@ +From c70ab1d87b4aec8f171615aa8dee4a1fc1104b4b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 20 Jan 2015 16:18:34 +0100 +Subject: [PATCH xinit] startx: Pass -keeptty when telling the server to start + on the current tty + +Detaching from the tty causes systemd-logind to refuse service to the xserver, +the xserver already tries to detect that it is being asked to run on the +current tty and then automatically enables -keeptty, but this code fails if +all of stdin, stdout and stderr are redirected to a file. So explicitly tell +the xserver to not detach when we're telling it to run on the current tty. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1177513 +Signed-off-by: Hans de Goede +--- + startx.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/startx.cpp b/startx.cpp +index 1c6fce0..45d7bd9 100644 +--- a/startx.cpp ++++ b/startx.cpp +@@ -195,7 +195,7 @@ if [ x"$server" = x ]; then + tty=$(tty) + if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then + tty_num=$(echo "$tty" | grep -oE '[0-9]+$') +- vtarg="vt$tty_num" ++ vtarg="vt$tty_num -keeptty" + fi + #endif + +-- +2.1.0 + diff --git a/SOURCES/0002-startx-Fix-startx-picking-an-already-used-display-nu.patch b/SOURCES/0002-startx-Fix-startx-picking-an-already-used-display-nu.patch new file mode 100644 index 0000000..1db645a --- /dev/null +++ b/SOURCES/0002-startx-Fix-startx-picking-an-already-used-display-nu.patch @@ -0,0 +1,36 @@ +From 848dc9b7f3a95f14efd4ea34188cba51965c9f53 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 20 Mar 2015 14:25:44 +0100 +Subject: [PATCH xinit 2/3] startx: Fix startx picking an already used display + number when -nolock is used + +Currently startx relies on /tmp/.X?-lock being present for automatically +picking a free display number. This does not work if -nolock is used when +starting the server, or if the server is started with -displayfd as -displayfd +implies -nolock. + +This is becoming a problem now that -displayfd is getting used by +display-managers (e.g. gdm), this fixes this by also checking for +/tmp/.X11-unix/X? + +Signed-off-by: Hans de Goede +--- + startx.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/startx.cpp b/startx.cpp +index 8520399..fe49996 100644 +--- a/startx.cpp ++++ b/startx.cpp +@@ -120,7 +120,7 @@ enable_xauth=1 + XCOMM Automatically determine an unused $DISPLAY + d=0 + while true ; do +- [ -e /tmp/.X$d-lock ] || break ++ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break + d=$(($d + 1)) + done + defaultdisplay=":$d" +-- +2.3.3 + diff --git a/SOURCES/0003-startx-Make-startx-auto-display-select-work-with-per.patch b/SOURCES/0003-startx-Make-startx-auto-display-select-work-with-per.patch new file mode 100644 index 0000000..aa67ba0 --- /dev/null +++ b/SOURCES/0003-startx-Make-startx-auto-display-select-work-with-per.patch @@ -0,0 +1,35 @@ +From 72939fed64b00be4a74dd0e1bf0b418e00ac4c57 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 20 Mar 2015 14:30:08 +0100 +Subject: [PATCH xinit 3/3] startx: Make startx auto display select work with + per user /tmp dirs + +If a separate /tmp per user is used the existing auto display select code +does not work, add an extra check for the unix socket for the display number +existing in /proc/net/unix (linux only). + +Signed-off-by: Hans de Goede +--- + startx.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/startx.cpp b/startx.cpp +index fe49996..3b0dd86 100644 +--- a/startx.cpp ++++ b/startx.cpp +@@ -120,7 +120,11 @@ enable_xauth=1 + XCOMM Automatically determine an unused $DISPLAY + d=0 + while true ; do +- [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break ++ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || ++#ifdef __linux__ ++ grep -q "/tmp/.X11-unix/X$d" "/proc/net/unix" || ++#endif ++ break + d=$(($d + 1)) + done + defaultdisplay=":$d" +-- +2.3.3 + diff --git a/SOURCES/xinit-1.0.2-client-session.patch b/SOURCES/xinit-1.0.2-client-session.patch index a38c883..f463f68 100644 --- a/SOURCES/xinit-1.0.2-client-session.patch +++ b/SOURCES/xinit-1.0.2-client-session.patch @@ -1,8 +1,7 @@ -Index: xinit-1.3.1/xinit.c -=================================================================== ---- xinit-1.3.1.orig/xinit.c -+++ xinit-1.3.1/xinit.c -@@ -91,6 +91,8 @@ char xserverrcbuf[256]; +diff -up xinit-1.3.4/xinit.c.client-session xinit-1.3.4/xinit.c +--- xinit-1.3.4/xinit.c.client-session 2014-03-25 10:20:26.000000000 +0100 ++++ xinit-1.3.4/xinit.c 2014-09-11 17:03:30.928360694 +0200 +@@ -89,6 +89,8 @@ char xserverrcbuf[256]; #define TRUE 1 #define FALSE 0 @@ -11,29 +10,29 @@ Index: xinit-1.3.1/xinit.c static char *default_server = "X"; static char *default_display = ":0"; /* choose most efficient */ -@@ -561,6 +563,7 @@ startClient(char *client[]) +@@ -560,6 +562,7 @@ startClient(char *client_argv[]) { clientpid = fork(); if (clientpid == 0) { -+ int fd; ++ int fd; set_environment(); setWindowPath(); -@@ -568,7 +571,16 @@ startClient(char *client[]) +@@ -567,7 +570,16 @@ startClient(char *client_argv[]) Error("cannot change uid"); _exit(EXIT_FAILURE); } - setpgid(0, getpid()); -+ fd = open ("/dev/null", O_RDONLY); ++ fd = open ("/dev/null", O_RDONLY); + -+ if (fd < 0) { -+ Error("cannot open /dev/null: %s\n", strerror(errno)); -+ _exit(ERR_EXIT); -+ } -+ close (STDIN_FILENO); -+ dup2 (fd, STDIN_FILENO); -+ close (fd); -+ setsid(); - Execute(client); - Error("Unable to run program \"%s\"", client[0]); ++ if (fd < 0) { ++ Error("cannot open /dev/null: %s\n", strerror(errno)); ++ _exit(ERR_EXIT); ++ } ++ close (STDIN_FILENO); ++ dup2 (fd, STDIN_FILENO); ++ close (fd); ++ setsid(); + Execute(client_argv); + Error("Unable to run program \"%s\"", client_argv[0]); diff --git a/SOURCES/xorg-x11-xinit-1.3.2-systemd-logind.patch b/SOURCES/xorg-x11-xinit-1.3.2-systemd-logind.patch deleted file mode 100644 index fcfa3ac..0000000 --- a/SOURCES/xorg-x11-xinit-1.3.2-systemd-logind.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur xinit-1.3.2.orig/startx.cpp xinit-1.3.2/startx.cpp ---- xinit-1.3.2.orig/startx.cpp 2012-09-29 11:55:06.661264745 -0600 -+++ xinit-1.3.2/startx.cpp 2012-09-29 11:56:24.849771316 -0600 -@@ -80,6 +80,7 @@ - defaultdisplay=":0" - clientargs="" - serverargs="" -+tty_num=$(tty | sed -n 's/.*tty\([0-9]\+\)$/\1/p') - - #ifdef __APPLE__ - -@@ -135,6 +136,12 @@ - enable_xauth=1 - #endif - -+if [ x"$tty_num" != x ]; then -+ # Specify TTY number directly to avoid recognizing startx session as -+ # inactive: RHBZ#820675 -+ serverargs=${serverargs}" vt"${tty_num} -+fi -+ - XCOMM Automatically determine an unused $DISPLAY - d=0 - while true ; do diff --git a/SPECS/xorg-x11-xinit.spec b/SPECS/xorg-x11-xinit.spec index 25e382d..a60fbb4 100644 --- a/SPECS/xorg-x11-xinit.spec +++ b/SPECS/xorg-x11-xinit.spec @@ -2,8 +2,8 @@ Summary: X.Org X11 X Window System xinit startup scripts Name: xorg-x11-%{pkgname} -Version: 1.3.2 -Release: 14%{?dist} +Version: 1.3.4 +Release: 1%{?dist} License: MIT Group: User Interface/X URL: http://www.x.org @@ -24,10 +24,10 @@ 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. -# 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 +Patch2: xinit-1.0.9-unset.patch +Patch3: 0001-startx-Pass-keeptty-when-telling-the-server-to-start.patch +Patch4: 0002-startx-Fix-startx-picking-an-already-used-display-nu.patch +Patch5: 0003-startx-Make-startx-auto-display-select-work-with-per.patch BuildRequires: pkgconfig BuildRequires: libX11-devel @@ -56,20 +56,18 @@ 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 -b .unset +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build autoreconf %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. @@ -118,6 +116,12 @@ install -p -m644 -D %{SOURCE18} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compa %{_datadir}/xsessions/xinit-compat.desktop %changelog +* Tue May 12 2015 Hans de Goede - 1.3.4-1 +- xinit 1.3.4 +- Drop xorg-x11-xinit-1.3.2-systemd-logind.patch (included upstream in 1.3.4) +- Add patches from Fedora to fix automatically finding a free display-number +- Resolves: rhbz#1194894 + * Mon Sep 1 2014 Hans de Goede - 1.3.2-14 - Xclients: only try to start gnome classic session if installed - Resolves: rhbz#1078948