Discussion:
X server connection to X clients
(too old to reply)
AK
2004-05-17 14:59:43 UTC
Permalink
I am trying to understand how X client connects to a X server. I
understood (from numerous sites) that the X server listens for
connections. When it receives a request to connect, then it checks a
list of authorised clients. When it finds a match, then it accepts the
request.
My questions :
1. When the X server is first set-up from where does it get this list
of authorised clients ? How is this list built ?
2. If a new client wants to connect to the X server, how should it go
about doing this, so that the server accepts its request to client.

This might be a basic question, answered already. But I would
appreciate any pointer regarding where to look for - links, FAQs,
previous posts in any forum et al.

Thanks.
Lew Pitcher
2004-05-17 15:08:37 UTC
Permalink
Post by AK
I am trying to understand how X client connects to a X server. I
understood (from numerous sites) that the X server listens for
connections. When it receives a request to connect, then it checks a
list of authorised clients. When it finds a match, then it accepts the
request.
1. When the X server is first set-up from where does it get this list
of authorised clients ? How is this list built ?
The server initially only accepts connections from the local system.

Subsequently, the end user issues the xhost or xauth command specifying the
client origin system.
Post by AK
2. If a new client wants to connect to the X server, how should it go
about doing this, so that the server accepts its request to client.
The end user issues an xhost or xauth command at the xserver
For instance, at the server, the user enters "xhost +remotesystem",
where "remotesystem" is the name of the remote system on which the
client app executes.

The end user specifies the x server and authority to the xclient
For instance, at the client end, the user enters
"export DISPLAY=xhost:xdisplay" (export DISPLAY=somesystem:0)
where xhost is the DNS host name of the x server host, and
xdisplay is the display number of the x server display.
Post by AK
This might be a basic question, answered already. But I would
appreciate any pointer regarding where to look for - links, FAQs,
previous posts in any forum et al.
Thanks.
- --
Lew Pitcher
IT Consultant, Enterprise Application Architecture,
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed are my own, not my employers')
Alan Coopersmith
2004-05-17 17:22:55 UTC
Permalink
***@yahoo.com (AK) writes in comp.windows.x.apps:
|I am trying to understand how X client connects to a X server. I
|understood (from numerous sites) that the X server listens for
|connections. When it receives a request to connect, then it checks a
|list of authorised clients. When it finds a match, then it accepts the
|request.

The list is not of authorized client applications, but client machines.

|My questions :
|1. When the X server is first set-up from where does it get this list
|of authorised clients ? How is this list built ?

localhost is always there, plus the hosts listed in /etc/X0.hosts if
it exists. (X0.hosts for :0, X1.hosts for :1, etc.)

|2. If a new client wants to connect to the X server, how should it go
|about doing this, so that the server accepts its request to client.

Xlib takes care of this under the hood - the client should either have
an Xauthority cookie for the display or the client should be running on
a system that is included on the access list.
--
________________________________________________________________________
Alan Coopersmith ***@alum.calberkeley.org
http://www.CSUA.Berkeley.EDU/~alanc/ aka: ***@Sun.COM
Working for, but definitely not speaking for, Sun Microsystems, Inc.
Loading...