SHA256
1
0
forked from pool/xinit

Accepting request 113512 from home:vuntz:branches:X11:XOrg

Split xinit out of xorg-x11; no change to the content

OBS-URL: https://build.opensuse.org/request/show/113512
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xinit?expand=0&rev=1
This commit is contained in:
Stefan Dirsch 2012-04-14 09:34:16 +00:00 committed by Git OBS Bridge
commit 4d0de5b109
12 changed files with 460 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

15
keygen.1 Normal file
View File

@ -0,0 +1,15 @@
.TH keygen 1 2011-04-05 University XAuth
.SH NAME
keygen \- generate magic cookies for xauth
.SH SYNOPSIS
.B keygen
.SH DESCRIPTION
Prints a newly generated random key for
.B xauth
on the standard output.
.SH SEE ALSO
xauth(7)

99
keygen.c Normal file
View File

@ -0,0 +1,99 @@
/*
Copyright 1992 by the University of Edinburgh, Department of Computer Science
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of the University of Edinburgh not be used
in advertising or publicity pertaining to distribution of the software
without specific, written prior permission. The University of Edinburgh
makes no representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied warranty.
*/
/* Little utility to generate magic cookies for xauth. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef Solaris
#include <sys/statvfs.h>
#else
#include <sys/vfs.h>
#endif
#if defined(hpux) || defined(Solaris)
#define srandom srand
#define random rand
#endif
static long keys[4];
static void generate(seed)
int seed;
{ int i;
srandom(seed);
for (i = 0; i < 4; i++) keys[i] ^= random();
}
int main()
{ int hostid;
int uid;
int gid;
int pid;
int ppid;
int pgrp;
struct timeval tv;
#ifdef Solaris
struct statvfs fs;
#else
struct statfs fs;
#endif
#if !defined(hpux) && !defined(Solaris)
hostid = gethostid();
#endif
uid = getuid();
gid = getgid();
pid = getpid();
ppid = getppid();
#ifdef linux
pgrp = getpgrp();
#else
pgrp = getpgrp(0);
#endif
(void) gettimeofday(&tv, NULL);
#ifdef Solaris
(void) statvfs(".", &fs);
#else
(void) statfs(".", &fs);
#endif
#ifndef hpux
generate(hostid);
#endif
generate(uid);
generate(gid);
generate(pid);
generate(pid);
generate(pgrp);
generate(tv.tv_sec);
generate(tv.tv_usec);
generate(fs.f_blocks);
generate(fs.f_bfree);
generate(fs.f_bavail);
generate(fs.f_files);
generate(fs.f_ffree);
if (+printf("%08lx%08lx%08lx%08lx\n",
keys[0], keys[1], keys[2], keys[3]) < 0
|| +fflush (stdout) < 0)
{ perror ("write"); return +EXIT_FAILURE; }
else return +EXIT_SUCCESS;
}

3
xinit-1.3.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ba76e36e1a42a7cf76505b7e6fc4777f5d14f45ddff74341abfb7dd10d5fe04c
size 138315

View File

@ -0,0 +1,38 @@
--- xinit-1.3.0/xinit.c.orig 2010-06-12 03:14:10.000000000 +0200
+++ xinit-1.3.0/xinit.c 2010-10-31 04:32:20.000000000 +0100
@@ -91,6 +91,7 @@ char xserverrcbuf[256];
#define TRUE 1
#define FALSE 0
+#define ERR_EXIT 1
static char *default_server = "X";
static char *default_display = ":0"; /* choose most efficient */
@@ -562,6 +562,8 @@ startClient(char *client[])
{
clientpid = fork();
if (clientpid == 0) {
+ int fd;
+
set_environment();
setWindowPath();
@@ -569,7 +571,17 @@ startClient(char *client[])
Error("cannot change uid");
_exit(EXIT_FAILURE);
}
- setpgid(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();
+
Execute(client);
Error("Unable to run program \"%s\"", client[0]);

160
xinit-suse.diff Normal file
View File

@ -0,0 +1,160 @@
Index: xinit-1.3.0/startx.cpp
===================================================================
--- xinit-1.3.0.orig/startx.cpp
+++ xinit-1.3.0/startx.cpp
@@ -70,10 +70,115 @@ userclientrc=$HOME/.xinitrc
sysclientrc=XINITDIR/xinitrc
#endif
+XCOMM
+XCOMM check for installed servers
+XCOMM
+
+#ifdef linux
+
+INSTALLED_SERVERS=`ls -1 /usr/bin/Xorg /usr/X11R6/bin/XFree86 /usr/X11R6/bin/Xorg* 2>/dev/null`
+
+
+if [ -z "$INSTALLED_SERVERS" ]; then
+
+ echo ""
+ echo "You did not install any X-Server \(e.g. Xorg\)!"
+ echo "Please install at least one server to start X."
+ echo "I'm aborting now."
+ exit 1
+fi
+
+
+XCOMM
+XCOMM perhaps a windowmanager is specified?
+XCOMM
+XCOMM
+XCOMM find wmlist utility, else take twm as default (always there :-))
+XCOMM
+type -p wmlist &> /dev/null && WMLIST="`for i in $(wmlist); do echo $i; done | sort`"
+test -z "$WMLIST" && WMLIST="twm"
+
+test "$1" = "--" || { test -n "$1" && WANTEDWM=`basename "$1"` ; }
+
+XCOMM
+XCOMM User could have set a list of window manager in WINDOWMANAGERLIST.
+XCOMM go throu wms and check if user specified a reachable one.
+XCOMM
+
+for WM in $WMLIST $WINDOWMANAGERLIST
+do
+ test "$WM" = "$WANTEDWM" && {
+XCOMM
+XCOMM is it reachable via $PATH?
+XCOMM
+ type -p $WM &> /dev/null || {
+
+ echo "`basename $0`: error: the requested window manager '$1' could not be found!"
+ echo "Window manager must be one of (currently installed window managers):"
+ for i in $WMLIST; do echo $i; done
+ exit 1
+ }
+XCOMM
+XCOMM OK, we got it, this will be the override for WINDOWMANAGER
+XCOMM
+ export WINDOWMANAGER=$WM
+ shift 1
+ break
+ }
+done
+
+unset WINDOWMANAGERLIST WMLIST WANTEDWM WM
+
+XCOMM
+XCOMM check for the first link
+XCOMM
+
+if [ ! -L /usr/X11R6/bin/X -a ! -L /usr/bin/X ]; then
+
+ echo ""
+ echo "There is no link /usr/X11R6/bin/X (/usr/bin/Xorg) to /var/X11R6/bin/X!"
+ echo "Please link the files as mentioned above or install the X-Server again."
+ echo "I'm aborting now."
+ exit 1
+fi
+
+XCOMM
+XCOMM check for the second link
+XCOMM
+
+if [ ! -L /var/X11R6/bin/X ]; then
+
+ echo ""
+ echo "There is no link /var/X11R6/bin/X to the correct X Server binary."
+ echo "Please configure the correct X Server with SaX/SaX2, which will create"
+ echo "the missing link. I'm aborting now."
+ exit 1
+fi
+
+XCOMM
+XCOMM check if the Xorg file is an executable or an accidentially copied script or similar things
+XCOMM
+
+if [ ! -x /var/X11R6/bin/X ]; then
+
+ echo ""
+ echo "The file Xorg (binary of X-Server) doesn't seem to be a binary file."
+ echo "Please check it or / and install a new X-Server-binary."
+ echo "I'm aborting now."
+ exit 1
+fi
+
+#endif /* linux */
+
+XCOMM set $DISPLAYMANAGER_XSERVER $DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN
+. /etc/sysconfig/displaymanager
+
userserverrc=$HOME/.xserverrc
sysserverrc=XINITDIR/xserverrc
defaultclient=XTERM
+XCOMM set X Server accordingly (Xorg/Xgl)
defaultserver=XSERVER
+test -n "$DISPLAYMANAGER_XSERVER" && defaultserver=/usr/bin/$DISPLAYMANAGER_XSERVER
defaultclientargs=""
defaultserverargs=""
defaultdisplay=":0"
@@ -314,6 +419,9 @@ else
XINIT "$client" $clientargs -- "$server" $display $serverargs
fi
#else
+XCOMM handle TCP port 6000
+test "$DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN" != "yes" && \
+ serverargs="$serverargs -nolisten tcp"
#if defined(__APPLE__) || defined(__CYGWIN__)
eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs
@@ -324,6 +432,12 @@ XINIT "$client" $clientargs -- "$server"
#endif
retval=$?
+if [ "$retval" != 0 -a ! -u "/usr/bin/Xorg" ]; then
+ echo "-------------------------------------------------------------------------------------------"
+ echo "xinit failed. /usr/bin/Xorg is not setuid, maybe that's the reason?"
+ echo "If so either use a display manager (strongly recommended) or adjust /etc/permissions.local"
+fi
+
if [ x"$enable_xauth" = x1 ] ; then
if [ x"$removelist" != x ]; then
XAUTH remove $removelist
Index: xinit-1.3.0/xinitrc.cpp
===================================================================
--- xinit-1.3.0.orig/xinitrc.cpp
+++ xinit-1.3.0/xinitrc.cpp
@@ -91,8 +91,10 @@ if [ -d XINITDIR/xinitrc.d ] ; then
unset f
fi
-TWM &
+if [ -x /usr/X11R6/bin/fvwm -o -x /usr/bin/fvwm]; then
+ exec fvwm
+fi
XCLOCK -geometry 50x50-1+1 &
XTERM -geometry 80x50+494+51 &
XTERM -geometry 80x20+494-0 &
-exec XTERM -geometry 80x66+0+0 -name login
+exec TWM

View File

@ -0,0 +1,12 @@
Index: xinit-1.3.0/startx.cpp
===================================================================
--- xinit-1.3.0.orig/startx.cpp
+++ xinit-1.3.0/startx.cpp
@@ -422,6 +422,7 @@ fi
XCOMM handle TCP port 6000
test "$DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN" != "yes" && \
serverargs="$serverargs -nolisten tcp"
+export XAUTHLOCALHOSTNAME=`hostname`
#if defined(__APPLE__) || defined(__CYGWIN__)
eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs

5
xinit.changes Normal file
View File

@ -0,0 +1,5 @@
-------------------------------------------------------------------
Fri Apr 13 08:46:08 UTC 2012 - vuntz@opensuse.org
- Split xinit from xorg-x11. Initial version: 1.3.0.

11
xinit.diff Normal file
View File

@ -0,0 +1,11 @@
--- Makefile.am.orig 2010-03-15 23:35:56.000000000 +0100
+++ Makefile.am 2010-09-05 12:29:21.000000000 +0200
@@ -19,6 +19,8 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
+XINITDIR = /etc/X11/xinit
+
bin_PROGRAMS = xinit
bin_SCRIPTS = startx

90
xinit.spec Normal file
View File

@ -0,0 +1,90 @@
#
# spec file for package xinit
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: xinit
Version: 1.3.0
Release: 0
License: MIT
Summary: X Window System initializer
Url: http://xorg.freedesktop.org/
Group: System/X11/Utilities
Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{version}.tar.bz2
Source1: xinit.tar.bz2
Source2: keygen.c
Source3: keygen.1
Patch0: xinit.diff
Patch1: xinit-client-session.patch
Patch2: xinit-suse.diff
Patch3: xinit-tolerant-hostname-changes.diff
# needed for patch0
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xorg-macros) >= 1.8
Requires: setxkbmap
Requires: xauth
Requires: xmodmap
Requires: xrdb
Requires: xsetroot
Requires: xterm
# This was part of the xorg-x11 package up to version 7.6
Conflicts: xorg-x11 <= 7.6
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The xinit program is used to start the X Window System server and a
first client program on systems that are not using a display manager
such as xdm or in environments that use multiple window systems.
When this first client exits, xinit will kill the X server and then
terminate.
%prep
%setup -q
%patch0 -p0
%patch1 -p1
%patch2 -p1
%patch3 -p1
# needed for patch0
autoreconf -fi
%build
%configure
make %{?_smp_mflags}
%{__cc} %{optflags} -o keygen %{SOURCE2}
%install
%make_install
install -m 0644 %{SOURCE3} %{buildroot}%{_mandir}/man1
install -m 0711 keygen %{buildroot}%{_bindir}/keygen
pushd %{buildroot}
tar xf %{SOURCE1}
popd
install -D %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc %{buildroot}%{_sysconfdir}/skel/.xinitrc.template
%files
%defattr(-,root,root)
%doc ChangeLog COPYING README
%config %{_sysconfdir}/X11/xinit/
%config %{_sysconfdir}/skel/.xinitrc.template
%{_bindir}/keygen
%{_bindir}/startx
%{_bindir}/xinit
%{_mandir}/man1/keygen.1%{?ext_man}
%{_mandir}/man1/startx.1%{?ext_man}
%{_mandir}/man1/xinit.1%{?ext_man}
%changelog

3
xinit.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb0494ac44c32363eea9b89938f76ad0283eff1a40d9e4fc3c8931c3ac48b595
size 2750