[Xquartz-dev] ah-HAH! the precise problem here is … (Re: I got it working, but still potential problem (Re: Getting bad DISPLAY value during use of 2.6.1-2.6.2 (not with 2.6.0 & before).)

Peter O'Gorman peter at pogma.com
Sat Apr 30 10:36:21 PDT 2011


On 04/27/2011 07:24 PM, SciFi wrote:
>
> Hello,
>
> Apparently the only thing I need to change
> in your newer Xquartz versions
> is to do this patch:
>
> $ cd /opt/X11/lib/X11/xinit/privileged_startx.d
>
> --- start patch ---
> --- ../original/10-tmpdirs	2011-04-25 18:48:26 -0500
> +++ ./10-tmpdirs	2011-04-26 01:00:36 -0500
> @@ -30,7 +30,7 @@
>   for dir in /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix ; do
>   	# Use mktemp rather than mkdir to avoid possible security issue
>   	# if $dir exists and is a symlink
> -	if mktemp -d ${dir}>&  /dev/null ; then
> +	if /usr/bin/mktemp -d ${dir}>&  /dev/null ; then
>   		chmod 1777 $dir
>   		chown root:wheel $dir
>   	fi
> --- end patch ---

I don't understand what this is trying to do, in no case will $dir 
contain XXXXXX for mktemp to replace with randomness, so in all cases 
Mac OS X mktemp behaves the same as mkdir ${dir}.

Coreutils's mktemp correctly says:
mktemp: too few X's in template `/tmp/.ICE-unix'

proper use of mktemp(1):
dir=`mktemp -d /tmp/foo.XXXXXX`
... do stuff with $dir

Peter


More information about the Xquartz-dev mailing list