Popup X-application from background - Xwindows

This is a discussion on Popup X-application from background - Xwindows ; Hello, I want to know if it is posiible to popup a X-window application from a background process. Suppose user A is logged in but background process running as user B has to run an X-app when some event occurs. ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Popup X-application from background

  1. Popup X-application from background

    Hello,

    I want to know if it is posiible to popup a X-window application from a
    background process. Suppose user A is logged in but background process
    running as user B has to run an X-app when some event occurs.

    thanks

    Johan



  2. Re: Popup X-application from background

    Johan den Boer wrote:
    > Hello,
    >
    > I want to know if it is posiible to popup a X-window application from a
    > background process. Suppose user A is logged in but background process
    > running as user B has to run an X-app when some event occurs.
    >
    > thanks
    >
    > Johan
    >
    >


    It depends on how the display is configured WRT access. IOW, if user A
    has configured things (or the sys-admin) to allow it you can. It's not
    any different than if user B was in a telnet or ssh session.

    If the background app isn't interactive but just wants to use an
    Xserver to render graphics you could install a second headless Xserver
    to support those needs. Google for xvfb (x virtual frame buffer).

    -- ced

    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.


  3. Re: Popup X-application from background

    In comp.windows.x, Johan den Boer

    wrote
    on Mon, 22 Dec 2003 07:46:36 +0100
    :
    > Hello,
    >
    > I want to know if it is posiible to popup a X-window application from a
    > background process. Suppose user A is logged in but background process
    > running as user B has to run an X-app when some event occurs.


    It is possible but user B has to have the right authorization key.

    'man xauth'

    >
    > thanks
    >
    > Johan
    >


    --
    #191, ewill3@earthlink.net
    It's still legal to go .sigless.

  4. Re: Popup X-application from background

    The Ghost In The Machine writes:

    > In comp.windows.x, Johan den Boer
    >
    > wrote
    > on Mon, 22 Dec 2003 07:46:36 +0100
    > :
    >> Hello,
    >>
    >> I want to know if it is posiible to popup a X-window application from a
    >> background process. Suppose user A is logged in but background process
    >> running as user B has to run an X-app when some event occurs.

    >
    > It is possible but user B has to have the right authorization key.
    >
    > 'man xauth'



    Expanding on that: User A probably has his authorization key stored in
    the file ~/.Xauthority. So one way would be to give user B read access
    to user A's ~/.Xauthority. Then you do something like

    export XAUTHORITY=/home/A/.Xauthority

    in the program run by user B. Setting

    export DISPLAY=:0.0

    is probably the right thing to do as well. Then it should work to run
    the X-app. But you must realize that user B now kan do anything on
    user A's desktop, so user B must be trusted.

    --
    - Mårten

    mail: msv@kth.se *** ICQ: 4356928 *** mobile: +46 (0)707390385

  5. Re: Popup X-application from background

    In comp.windows.x, Mårten Svantesson

    wrote
    on Mon, 22 Dec 2003 18:11:32 +0100
    :
    > The Ghost In The Machine writes:
    >
    >> In comp.windows.x, Johan den Boer
    >>
    >> wrote
    >> on Mon, 22 Dec 2003 07:46:36 +0100
    >> :
    >>> Hello,
    >>>
    >>> I want to know if it is posiible to popup a X-window application from a
    >>> background process. Suppose user A is logged in but background process
    >>> running as user B has to run an X-app when some event occurs.

    >>
    >> It is possible but user B has to have the right authorization key.
    >>
    >> 'man xauth'

    >
    >
    > Expanding on that: User A probably has his authorization key stored in
    > the file ~/.Xauthority. So one way would be to give user B read access
    > to user A's ~/.Xauthority. Then you do something like
    >
    > export XAUTHORITY=/home/A/.Xauthority
    >
    > in the program run by user B. Setting
    >
    > export DISPLAY=:0.0
    >
    > is probably the right thing to do as well. Then it should work to run
    > the X-app. But you must realize that user B now kan do anything on
    > user A's desktop, so user B must be trusted.
    >


    An interesting subpoint; however, I suspect user B is
    (local) root. The main problem with your method (apart
    from the trivial issue that it's ~A/.Xauthority rather
    than /home/A/.Xauthority, for various reasons) is that,
    if ~A is on a remotely mounted volume (e.g., NFS), B
    may not be able to read the .Xauthority file at all --
    even if B is root -- without special dispensation(s).
    (You've covered that, though.)

    I'll be darned if I can think of a better idea offhand.
    It gets more complicated of course if A is logged into
    multiple displays -- a distinct possibility -- or A has
    used 'ssh -X' and established more keys in .Xauthority.
    Also, .Xauthority tends to accumulate stale keys.

    B's program may have to open a window to all of them,
    which brings up the obvious question as to what that
    program is intended to accomplish.

    --
    #191, ewill3@earthlink.net
    It's still legal to go .sigless.

+ Reply to Thread