From 03c18264ca8d0153cd8c58ad10203476907ddcd9 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 10 Nov 2006 15:31:06 +0000 Subject: [PATCH] - start client in its own session with no controlling tty (bug 214649) --- xinit-1.0.2-client-session.patch | 25 +++++++++++++++++++++++++ xorg-x11-xinit.spec | 8 +++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 xinit-1.0.2-client-session.patch diff --git a/xinit-1.0.2-client-session.patch b/xinit-1.0.2-client-session.patch new file mode 100644 index 0000000..106b50f --- /dev/null +++ b/xinit-1.0.2-client-session.patch @@ -0,0 +1,25 @@ +--- xinit-1.0.2/xinit.c.client-session 2006-11-10 00:24:25.000000000 -0500 ++++ xinit-1.0.2/xinit.c 2006-11-10 00:30:42.000000000 -0500 +@@ -692,11 +692,21 @@ + startClient(char *client[]) + { + if ((clientpid = vfork()) == 0) { ++ int fd; + if (setuid(getuid()) == -1) { + Error("cannot change uid: %s\n", strerror(errno)); + _exit(ERR_EXIT); + } +- setpgrp(0, getpid()); ++ 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(); + environ = newenviron; + #ifdef __UNIXOS2__ + #undef environ diff --git a/xorg-x11-xinit.spec b/xorg-x11-xinit.spec index 93f344f..b667faf 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.0.2 -Release: 13%{?dist} +Release: 14%{?dist} License: MIT/X11 Group: User Interface/X URL: http://www.x.org @@ -22,6 +22,7 @@ Source16: Xsession Source17: localuser.sh Patch0: ftp://ftp.freedesktop.org/pub/xorg/X11R7.1/patches/xinit-1.0.2-setuid.diff +Patch1: xinit-1.0.2-client-session.patch BuildRequires: pkgconfig BuildRequires: libX11-devel @@ -47,6 +48,7 @@ X.Org X11 X Window System xinit startup scripts %prep %setup -q -n %{pkgname}-%{version} %patch0 -p0 -b .setuid +%patch1 -p1 -b .client-session %build %configure @@ -100,6 +102,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/xinit.1x* %changelog +* Fri Nov 10 2006 Ray Strode - 1.0.2-14 +- start client in its own session with no controlling tty + (bug 214649) + * Mon Oct 23 2006 Kristian Høgsberg - 1.0.2-13 - Update Xsession to not use switchdesk for the hard coded kde and twm cases.