Getting X client information. (in the X server) - Xwindows

This is a discussion on Getting X client information. (in the X server) - Xwindows ; Hello, I want to slightly modify X server to get the client list which is currently connected to X server. I want to save the list of client into a file. (If possible, I want to get details of each ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Getting X client information. (in the X server)

  1. Getting X client information. (in the X server)

    Hello,

    I want to slightly modify X server to get the client list which is
    currently
    connected to X server. I want to save the list of client into a file.
    (If possible, I want to get details of each client. For example, the
    PID of
    the client, request that is received from the client.)

    Could you help to find out a starting point to do this?


  2. Re: Getting X client information. (in the X server)

    "Seongsu Lee" writes:

    > Hello,
    >
    > I want to slightly modify X server to get the client list which is
    > currently
    > connected to X server. I want to save the list of client into a file.
    > (If possible, I want to get details of each client. For example, the
    > PID of
    > the client, request that is received from the client.)
    >
    > Could you help to find out a starting point to do this?


    Given the network transparent nature of X, getting
    the PID is a problem. That is, some of the windows on your
    DISPLAY may not have a PID on the local machine.

    Otherwise, look at xlsclients.

  3. Re: Getting X client information. (in the X server)

    On Fri, 15 Dec 2006 08:37:55 -0500, Dan Espen
    wrote:

    >"Seongsu Lee" writes:
    >
    >> Hello,
    >>
    >> I want to slightly modify X server to get the client list which is
    >> currently
    >> connected to X server. I want to save the list of client into a file.
    >> (If possible, I want to get details of each client. For example, the
    >> PID of
    >> the client, request that is received from the client.)
    >>
    >> Could you help to find out a starting point to do this?

    >
    >Given the network transparent nature of X, getting
    >the PID is a problem. That is, some of the windows on your
    >DISPLAY may not have a PID on the local machine.


    Which might be solved by requiring that only TCPIP connections be
    used, and that the client machine has identd running.

    >
    >Otherwise, look at xlsclients.


  4. Re: Getting X client information. (in the X server)

    Michel Bardiaux writes:

    > On Fri, 15 Dec 2006 08:37:55 -0500, Dan Espen
    > wrote:
    >
    >>"Seongsu Lee" writes:
    >>
    >>> Hello,
    >>>
    >>> I want to slightly modify X server to get the client list which is
    >>> currently
    >>> connected to X server. I want to save the list of client into a file.
    >>> (If possible, I want to get details of each client. For example, the
    >>> PID of
    >>> the client, request that is received from the client.)
    >>>
    >>> Could you help to find out a starting point to do this?

    >>
    >>Given the network transparent nature of X, getting
    >>the PID is a problem. That is, some of the windows on your
    >>DISPLAY may not have a PID on the local machine.

    >
    > Which might be solved by requiring that only TCPIP connections be
    > used, and that the client machine has identd running.


    Hmm, never heard of identd before.
    I just read the RFC.
    You won't get the PID on the remote system and
    you couldn't really distinguish one X windows connection
    from the remote host from another.

    Interesting though.

  5. Re: Getting X client information. (in the X server)

    On Wed, 20 Dec 2006 09:46:07 -0500, Dan Espen
    wrote:

    >Michel Bardiaux writes:
    >
    >> On Fri, 15 Dec 2006 08:37:55 -0500, Dan Espen
    >> wrote:
    >>
    >>>"Seongsu Lee" writes:
    >>>
    >>>> Hello,
    >>>>
    >>>> I want to slightly modify X server to get the client list which is
    >>>> currently
    >>>> connected to X server. I want to save the list of client into a file.
    >>>> (If possible, I want to get details of each client. For example, the
    >>>> PID of
    >>>> the client, request that is received from the client.)
    >>>>
    >>>> Could you help to find out a starting point to do this?
    >>>
    >>>Given the network transparent nature of X, getting
    >>>the PID is a problem. That is, some of the windows on your
    >>>DISPLAY may not have a PID on the local machine.

    >>
    >> Which might be solved by requiring that only TCPIP connections be
    >> used, and that the client machine has identd running.

    >
    >Hmm, never heard of identd before.
    >I just read the RFC.
    >You won't get the PID on the remote system and


    Mmm, yes, I must be confusing identd with some other daemon. I'm
    pretty sure there *is* (or was!) one that gives the remote PID, but I
    cant remember which.

    >you couldn't really distinguish one X windows connection
    >from the remote host from another.


    Let's be sure we're using the same terms: remote host = X client.
    Right?

    Now, reading /proc//fd gives us the sockets.

    Reading /proc/net/tcp gives us the remote address and port for each
    client.

    Identd (on the remote) then gives the corresponding username. It would
    be relatively straightforward to extend the rcf1413 protocol to supply
    more info about the connection.

    But of course that assumes one has root privileges on both the local
    and remote, and both the knowledge and authority to play around with
    security-sensitive issues.

    The last thing wished for by the OP, monitoring X requests on
    per-client basis, would be much more difficult to do.


    >
    >Interesting though.


  6. Re: Getting X client information. (in the X server)

    Michel Bardiaux writes:

    > On Wed, 20 Dec 2006 09:46:07 -0500, Dan Espen
    > wrote:
    >
    >>Michel Bardiaux writes:
    >>
    >>> On Fri, 15 Dec 2006 08:37:55 -0500, Dan Espen
    >>> wrote:
    >>>
    >>>>"Seongsu Lee" writes:


    Gee, a thread from last year.

    >>>>> Hello,
    >>>>>
    >>>>> I want to slightly modify X server to get the client list which is
    >>>>> currently
    >>>>> connected to X server. I want to save the list of client into a file.
    >>>>> (If possible, I want to get details of each client. For example, the
    >>>>> PID of
    >>>>> the client, request that is received from the client.)
    >>>>>
    >>>>> Could you help to find out a starting point to do this?
    >>>>
    >>>>Given the network transparent nature of X, getting
    >>>>the PID is a problem. That is, some of the windows on your
    >>>>DISPLAY may not have a PID on the local machine.
    >>>
    >>> Which might be solved by requiring that only TCPIP connections be
    >>> used, and that the client machine has identd running.

    >>
    >>Hmm, never heard of identd before.
    >>I just read the RFC.
    >>You won't get the PID on the remote system and

    >
    > Mmm, yes, I must be confusing identd with some other daemon. I'm
    > pretty sure there *is* (or was!) one that gives the remote PID, but I
    > cant remember which.
    >
    >>you couldn't really distinguish one X windows connection
    >>from the remote host from another.

    >
    > Let's be sure we're using the same terms: remote host = X client.
    > Right?


    Yep.

    > Now, reading /proc//fd gives us the sockets.
    >
    > Reading /proc/net/tcp gives us the remote address and port for each
    > client.
    >
    > Identd (on the remote) then gives the corresponding username. It would
    > be relatively straightforward to extend the rcf1413 protocol to supply
    > more info about the connection.
    >
    > But of course that assumes one has root privileges on both the local
    > and remote, and both the knowledge and authority to play around with
    > security-sensitive issues.
    >
    > The last thing wished for by the OP, monitoring X requests on
    > per-client basis, would be much more difficult to do.
    >
    >>Interesting though.


    I don't think you mentioned why you would want to do this.
    The PID would allow you to kill a process, but X has protocols
    for shutting down clients already.

    You could design a new protocol that requires clients to present their
    PIDs on connection but I don't think there is any requirement now that
    a client has to have one PID.

+ Reply to Thread