Support for multiple independent mouse cursors

Alan Coopersmith Alan.Coopersmith at Sun.COM
Wed Apr 26 08:01:45 PDT 2006

Samuel Thibault wrote:
> Samuel Thibault, le Wed 26 Apr 2006 09:37:53 +0200, a écrit :
>> Peter Hutterer, le Wed 26 Apr 2006 10:41:34 +0930, a écrit :
>>> The only way I found around that is the following:
>>> modify X lib so that each time a window is created it also sets an  
>>> atom on this window to the PID of the process that opened it.
>> For systems that support it (linux at least), you can use SO_PEERCRED on
>> unix sockets for getting pid, uid and gid of the peer process.
> Solaris provides getpeerucred instead.

xserver/xorg/os/access.c has routines that use SO_PEERCRED, getpeerucred
or getpeereid as needed to determine the client identity for local clients.

Of course this all falls down when you get remote clients.

For the interactive priority extension on Solaris, it actually uses something
similar to the Xlib trick above, where Xlib makes a extension call at
initialization.   (It was written long before getpeer* calls existed.)
This is good enough, since it's not used for any sort of security or access
control, and if a client lies about their process id, all they can do is
give their priority boost to another process.

	-Alan Coopersmith-           alan.coopersmith at
	 Sun Microsystems, Inc. - X Window System Engineering

More information about the xorg mailing list