pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48266: x11/xinit 'startx' broken on netbsd-5

>Number:         48266
>Category:       pkg
>Synopsis:       x11/xinit 'startx' broken on netbsd-5
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 03 20:55:00 +0000 2013
>Originator:     John D. Baker
>Release:        NetBSD/i386-5.2_STABLE, pkgsrc-2013Q3
NetBSD verthandi.technoskunk.fur 5.2_STABLE NetBSD 5.2_STABLE (VERTHANDI) #8: 
Thu Sep 19 06:07:07 CDT 2013  

The 'startx' script generated with x11/xinit attempts to generate the
magic cookie using '/usr/bin/openssl rand -hex 16', but the openssl
utility in netbsd-5 doesn't support the "-hex" option, so trying to use
'startx' fails.

Install modular Xorg on suitable netbsd-5 platform and attempt to start
graphical session via 'startx'.
Workaround:  Patch installed 'startx' as follows:

--- /usr/pkg/bin/startx.orig    2013-09-19 11:19:45.000000000 -0500
+++ /usr/pkg/bin/startx 2013-10-03 15:02:00.000000000 -0500
@@ -125,7 +125,7 @@
-    mcookie=`/usr/bin/openssl rand -hex 16`
+    mcookie=`/usr/bin/openssl rand 16 | hexdump -e \"%x\"`
     if test x"$mcookie" = x; then
         echo "Couldn't create cookie"
         exit 1

Ideally, fix up logic in /x11/xinit ${WRKSRC}/configure to see if the
proposed "$MCOOKIE" works and fall back to something sensible if it
doesn't.  Historical 'startx' (such as in native Xorg for netbsd-5)
grabbed bytes out of /dev/urandom and formatted them with 'hexdump'.

Suggested (tested only on NetBSD/i386-5.2_STABLE w/modular Xorg. It
is sufficient to trigger the fallback of 'dd'-ing from "/dev/urandom":
--- configure.orig      2013-09-08 11:37:39.000000000 -0500
+++ configure   2013-10-03 15:46:45.000000000 -0500
@@ -11231,7 +11231,7 @@
-if test "x$MCOOKIE" != x ; then
+if test "x$MCOOKIE" != x && $MCOOKIE >/dev/null 2>&1 ; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: startx will depend on 
\"$MCOOKIE\" to generate xauth cookies" >&5
 $as_echo "$as_me: startx will depend on \"$MCOOKIE\" to generate xauth 
cookies" >&6;}

Home | Main Index | Thread Index | Old Index