Yeah i know, but the 'gedit' is an example, what i want to do is
invoke 'vncviewer' so a teacher in a school can view a boy's desktop.
I've made a controller that is able to shutdown all computers and more
things.

The idea for the vncviewer is that the teacher choose one of the
computers and the vncviewer appears in his desktop. When i'm be able
todo this i'll fix the permissions and perhaps www-data can't invoke
anything but the three or four neccessary commands.

2010/10/15 Diez B. Roggisch <[email protected]>:
>
> Am 15.10.2010 um 18:34 schrieb César Fernández:
>
>> I'm trying to execute some graphic tools from my turbogears app. I've
>> changed my 'sudoers' file to allow user 'www-data' to execute all kind
>> of commands (i know, is insecure, but i'm trying and i'll fix this
>> when i find the solution). I have my turbogears app running in apache
>> and this is what i make in my code:
>>
>> [...]
>> Popen(['sudo', '-u', 'user', '-k', 'gedit'])
>> [...]
>>
>> I've also tried 'gksudo' but this message appear in the apache log:
>>
>> (gedit:2843): Gtk-WARNING **: cannot open display:
>>
>> The user i've used in the command is the same that is using the
>> desktop.
>>
>> I'm using debian and i've copied the user skeleton in the home
>> directory of user 'www-data' but nothing changed.
>>
>> A command like this works perfectly: Popen(['sudo', touch', '/pepe'])
>>
>> When i execute 'sudo -u www-data gedit' appears the same error, but i
>> make, as root:
>>
>> # xhost +local:
>>
>> And then the 'gedit' appears perfectly.
>>
>> Any idea? I know that is not a turbogears problem but i wonder if
>> anybody has tried the same as me and got the solutions.
>
> gedit is a graphical user interface application. Why on earth do you want to
> start these from TG? They will appear on the desktop of the poor soul who's
> just working on the machine. Or not, if he's not logged in...
>
> To make this work, the process needs to have the "DISPLAY" environment
> variable set properly, an x-server must run, and you need to compromise the
> X authentication settings so that not only you can sudo liberally, but also
> connect to X from everywhere.
>
> It's nightmarish.
>
> Diez
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>
>



-- 
There's no religion but sex and music
  -- Sting

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to