Subject: xsrc/25239: src/x11 xinit & startx build fixes
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 04/19/2004 13:20:52
>Number:         25239
>Category:       xsrc
>Synopsis:       src/x11 xinit & startx build fixes
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 19 11:21:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Nicolas Joly
>Release:        NetBSD 2.0C (-current 20040419)
>Organization:
	Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 2.0C NetBSD 2.0C (LANFEUST) #6: Mon Apr 19 10:31:56 CEST 2004 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
startx and xinit programs does not behave the same way if built with src/x11
framework or natively with xsrc. cross-builded startx command generate some
error messages :

njoly@lanfeust [~]> startx
[...]
AUDIT: Mon Apr 19 11:20:27 2004: 1596 X: client 1 rejected from local host
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
waiting for X server to begin accepting connections .
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
[...]

I discovered 2 diffrences between src/x11 and xsrc here :

- xinit(1) miss `-DXFREE86'.
- startx(1) does not have cookies support (HAS_COOKIE_MAKER & MK_COOKIE).

>How-To-Repeat:
launch X server with startx command.
>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/src/x11/bin/xinit/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	13 Sep 2003 21:50:52 -0000	1.3
+++ Makefile	19 Apr 2004 11:07:05 -0000
@@ -5,10 +5,13 @@
 PROG=	xinit
 MAN=	xinit.1 startx.1
 
-CPPFLAGS+=-DHAS_VFORK ${X11FLAGS.CONNECTION} -DBINDIR=\"${X11BINDIR}\"
+CPPFLAGS+=	-DHAS_VFORK ${X11FLAGS.CONNECTION} -DBINDIR=\"${X11BINDIR}\" \
+		-DXFREE86
 
 CPPSCRIPTS=	startx xinitrc
-CPPSCRIPTFLAGS=	-DXINITDIR=${X11LIBDIR}/xinit -DBINDIR=${X11BINDIR}
+CPPSCRIPTFLAGS_xinitrc=	-DXINITDIR=${X11LIBDIR}/xinit -DBINDIR=${X11BINDIR}
+CPPSCRIPTFLAGS_startx=	-DXINITDIR=${X11LIBDIR}/xinit -DBINDIR=${X11BINDIR} \
+		-DHAS_COOKIE_MAKER -DMK_COOKIE='dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"'
 SCRIPTS=	startx
 FILES=		xinitrc
 FILESDIR=	${X11LIBDIR}/xinit
>Release-Note:
>Audit-Trail:
>Unformatted: