- start client in its own session with no controlling tty (bug 214649)

This commit is contained in:
Ray Strode 2006-11-10 15:31:06 +00:00
parent f4b656c880
commit 03c18264ca
2 changed files with 32 additions and 1 deletions

View File

@ -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

View File

@ -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 <rstrode@redhat.com> - 1.0.2-14
- start client in its own session with no controlling tty
(bug 214649)
* Mon Oct 23 2006 Kristian Høgsberg <krh@redhat.com> - 1.0.2-13
- Update Xsession to not use switchdesk for the hard coded kde and twm
cases.