Re: [[Bulk] Re: using zenity to write a sudo script ?? [SOVED]



Hi;

Solved the problem with a forgotten adjustment. I am putting it on the
mailing list in case anyone else has the same problem with zenity.

On Wed, 2007-12-26 at 13:04 -0500, William Case wrote:
Thanks Stefano;
On Tue, 2007-12-25 at 11:50 +0100, Stefano Sabatini wrote:
[snip]
#! /bin/bash
# Open nautilus as root
# file name: RootBrowse

sudo -K
zenity --entry \
--title="Browse files as root" \
--text="Enter your user _password:" \
--entry-text "" \
--hide-text | sudo -S nautilus --no-desktop --browser 1>/dev/null
2>/dev/null

# End

This works fine here, both from the commandline and launching it as a
nautilus script.

For zenity to work with sudo, the sudoers file defaults have to be
altered. At least they do on my version in Fedora.

Go to root; visudo; scroll down to Defaults.
Comment out 'Defaults requiretty' so that it becomes
# Defaults requiretty
Save and sudo now works with zenity.

I had forgotten this from install to new install.
Why this is necessary is beyond me. If, anyone has an explanation I
would appreciate reading it.

There should be a clear warning about the possible need to configure the
sudoers file in any or all of the 'man zenity', gnome zenity or the
Zenity Manual Page.

I spent several hours on this and wasted other people's time until I
came across some old notes reminding me.

--
Regards Bill

_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list



Relevant Pages

  • Re: Why doesnt this sudo script using zenity work??
    ... else echo "No password entered" ... Why doesn't this sudo script using zenity work?? ... Because you need sudo to read the password passed by zenity on stdout. ...
    (GNOME)
  • Re: Why doesnt this sudo script using zenity work??
    ... zenity --entry \ ... then control the return code of sudo to check that the password ... Initializing nautilus-search-tool extension ...
    (GNOME)
  • Re: using zenity to write a sudo script ??
    ... # file name: RootBrowse ... if zenity --entry \ ... that would need sudo -S, ...
    (GNOME)
  • Re: root in FC 10
    ... but then the install doesn't add the one user it ... root passwd when I tried that, but no root passwd had been set ... was that user, and used that users passwd was "not in sudoers file, ... You'd get that message from sudo, ...
    (Fedora)
  • [SLE] Synaptic question...
    ... I'm using synaptic to update programs. ... dependency problems. ... I mean other than to install Zenity ...
    (SuSE)