Bug 36737

Summary: [PATCH] startx hosed, .xserverrc/cmdline woes
Product: [Retired] Red Hat Linux Reporter: h0e <hoshem>
Component: XFree86Assignee: Mike A. Harris <mharris>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-21 21:37:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description h0e 2001-04-20 02:05:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.19-7.0.1 i686; en-US; 0.8.1)
Gecko/20010326


startx incorrectly handles passing a nondefault server to xinit. startx
passes .xserverrc, /usr/X11R6/lib/X11/xserverrc, and command line
overridden servers to xinit on it's command line, but they get treated as
server arguments. In the case of .xserverrc that means the server will get
some funny arguments (because xinit calls .xserverrc by itself anyway), in
the case of [no dot]xserverrc or a command line server those options won't
work at all.

Reproducible: Always
Steps to Reproduce:
1.startx -- /bin/true OR

1.echo 'exec X $*' > ~/.xserverrc
2.startx

Actual Results:  server complains about funny server arguments /bin/true or
~/.xserverrc, /bin/true doesn't get executed as the server

Expected Results:  /bin/true gets executed as the server, .xserverrc and
/bin/true not passed in as arguments

I believe this patch is nice and correct

--- startx~	Thu Aug 31 06:54:16 2000
+++ startx	Fri Apr 20 12:00:05 2001
@@ -30,9 +30,9 @@
 fi
 
 if [ -f $userserverrc ]; then
-    serverargs=$userserverrc
+    server=$userserverrc
 else if [ -f $sysserverrc ]; then
-    serverargs=$sysserverrc
+    server=$sysserverrc
 fi
 fi
 
@@ -48,7 +48,7 @@
 
	    fi
 
	else
 
	    if [ "x$serverargs" = x ]; then
-
		serverargs="$1"
+
		server="$1"
 
	    else
 
		serverargs="$serverargs $1"
 
	    fi

Comment 1 Mike A. Harris 2002-12-21 21:37:35 UTC
Hmm...  this problem seems to not be present in current XFree86.  I've
never noticed it before personally.  Must have been a problem in the
4.0.1 release only I guess.  I'm able to pass an X server to the startx
script in 7.1 and later using XFree86 4.1.0 and higher at least.

The current startx is quite different now it seems.  Sorry for not commenting
on this earlier.

Closing as CURRENTRELEASE (8.0)