FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-08-2008, 03:40 AM
"A. F. Cano"
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

I've decided to automate what I've been doing manually after starting
pppd, via pon.

/usr/bin/pon (a script) starts /usr/sbin/pppd (an suid root executable).
I used to start pon as root, but I've added myself to the dip group
so I now can start it as a regular user. After the link is up,
/etc/ppp/ip-up.local is executed. This works to get the mail and
usenet news.

But I would like a window to pop up telling me when that is done, so
I researched a bit and found zenity. I also wanted to pop up a
konsole with pppstatus running in it.

When running a test script as myself that runs the zenity line:

zenity --info --text="Done getting the news"

it works fine, the window pops up. But when called from ip-up.local
nothing happens. The only error in the log file is:

This option is not available. Please see --help for all possible usages.

I've also tried:

su <regular-user> -c 'zenity --info --text="Done getting the news"'

with the same result. I understand that pppd is suid root and that is
the likely cause of the problem. I've added DISPLAY=:0.0 before calling
zenity with no effect.

The konsole with pppstatus running in it is called from ip-up.local
like this:

su <regular-user> -c "konsole --vt_sz 80x24 --nomenubar --notabbar --noscrollbar -e pppstatus -s 1540"

I've also tried without su. The result is the same:

konsole: cannot connect to X server

And this is even after I've typed

xhost +

from a regular user console. The X/kde session was started as that user.
I understand that it is a security feature of the X server not to allow
connections from root, but how do I get a window popped up from a
setuid root script?

There is one more oddity. When ip-up.local is executed, pppstatus started
by hand (as a regular user) thinks that ppp is disconnected/off. When
ip-up.local is renamed and thus not found/executed, pppstatus has access
and works fine.

Any hints or explanations?

Thanks!

A.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-08-2008, 04:06 AM
Charlie
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

On Tue, 8 Apr 2008, A. F. Cano shared this with us all:
>--} I've also tried without su. *The result is the same:
>--}
>--} konsole: cannot connect to X server
>--}
>--} And this is even after I've typed
>--}
>--} xhost +
>--}
>--} from a regular user console.

You may need to do the following:

As user in a terminal:

$ /usr/bin/X11/xhost +

Then as root in a terminal:

# export DISPLAY=:0.0 <your user name here>

HTH
Charlie
--
Registered Linux User:- 329524
***********************************************
It is the intensity of the longing that does all the work. -----KABIR

***********************************************
Debian, just the best way to create magic
_______________________________________________
 
Old 04-09-2008, 03:34 AM
"A. F. Cano"
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

On Tue, Apr 08, 2008 at 02:06:14PM +1000, Charlie wrote:
> On Tue, 8 Apr 2008, A. F. Cano shared this with us all:
> >--} I've also tried without su. *The result is the same:
> >--}
> >--} konsole: cannot connect to X server
> >--}
> >--} And this is even after I've typed
> >--}
> >--} xhost +
> >--}
> >--} from a regular user console.
>
> You may need to do the following:
>
> As user in a terminal:
>
> $ /usr/bin/X11/xhost +

Yes, I had done that.

> Then as root in a terminal:
>
> # export DISPLAY=:0.0 <your user name here>

This was the missing piece! I was missing the user name.
I actually included this in ip-up.local and it worked.
Now the windows appear. Thank you!

The only remaining problem is that pppstatus somehow seems to have lost
access to the ppp link. It says the link is not connected/off.
This does not happen if ip-up.local is not present/run and I run
pppstatus manually from a user-level konsole.

Any ideas out there? anyone?

A.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 04:28 AM
NN_il_Confusionario
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

On Tue, Apr 08, 2008 at 11:34:33PM -0400, A. F. Cano wrote:
> On Tue, Apr 08, 2008 at 02:06:14PM +1000, Charlie wrote:
> > $ /usr/bin/X11/xhost +
> Yes, I had done that.
> > Then as root in a terminal:
> > # export DISPLAY=:0.0 <your user name here>
> This was the missing piece! I was missing the user name.

Nice that this problem is solved. But I do not understand why so many
use "xhost" in a insecure way instead of correctly setting DISPLAY and
XAUTHORITY (or using "xauth" or "sux" and so on), as clearly explained in

/usr/share/doc/xfree86-common/FAQ.gz
section "How do I run an X client as root when the X session is run by a user?"

(this is the placement in sarge, I have not checked where the FAQ is now)

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 05:48 AM
Charlie
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

On Wed, 9 Apr 2008, NN_il_Confusionario shared this with us all:
>--} /usr/share/doc/xfree86-common/FAQ.gz
>--} section "How do I run an X client as root when the X session is run by a
> user?" --}
>--} (this is the placement in sarge, I have not checked where the FAQ is
> now)

I don't know where that might be either. Sorry.

Charlie
--
Registered Linux User:- 329524
***********************************************
After the ecstasy, the laundry. -----ZEN SAYING

***********************************************
Debian, just the best way to create magic
_______________________________________________


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-10-2008, 12:09 AM
"A. F. Cano"
 
Default pon oddities - pop-up windows from ip-up.local, pppstatus

On Wed, Apr 09, 2008 at 06:28:44AM +0200, NN_il_Confusionario wrote:
> On Tue, Apr 08, 2008 at 11:34:33PM -0400, A. F. Cano wrote:
> > On Tue, Apr 08, 2008 at 02:06:14PM +1000, Charlie wrote:
> > > $ /usr/bin/X11/xhost +
> > Yes, I had done that.
> > > Then as root in a terminal:
> > > # export DISPLAY=:0.0 <your user name here>
> > This was the missing piece! I was missing the user name.
>
> Nice that this problem is solved. But I do not understand why so many
> use "xhost" in a insecure way instead of correctly setting DISPLAY and

It turns out that xhost + (as the regular user) wasn't
necessary. I had actually reset that and it still worked when
I tried the DISPLAY line above.

>...

A.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 04:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org