Re: gnome-system-monitor root problem



> Hello, I'm using garnome-2.9.4, although this applies to arch as well.
>
> When installing this package the following happens:
> 1) it informs me that I need root acces.  Fine, I type in my pw and it
installs libgnomesu just fine.

That's good. :)

> 2) it gets back to gnome-system-monitor and immediately errors out
giving me a generic message about needing root access for libgnomesu and
gnome-system monitor and how I need to remove those dirs if I don't have
root access.

Weird, it should just restart at the point where it left off to execute
the 'pre-extract' statement. This might be related to the 'exit 2' at the
end of 'pre-extract' statement though.

> Looking at the makefile it seems that there is a logical mistake in the
pre-extract code.

There are lots of problems with the current code. We know this. :)

>>From a discussion on IRC i do realize that this is somewhat of a hack
> to get around the new need for root access for libgnomesu.

Yes, very quick hack unfortunately. :( But people where getting ticked so
we did the release.

> I feel that it should be like this, or at least something similar:
>
> pre-extract:
>        @if [ `id -u` = "0" ] ; then \
>                $(MAKE) -C ../libgnomesu install ; \
>        else \
>                echo " ==> Gnome-system-monitor requires libgnomesu" ; \
echo " ==> You need to be root to install libgnomesu" ; \
echo " ==> Please provide your root passwd" ; \
>                if [ -x `which sudo` -a -e /etc/sudoers ] ; then \
>                        sudo sh -c "$(MAKE) -C ../libgnomesu install" ; \
>                elif [ -x `which su` ] ; then \
>                        su -m -c "$(MAKE) -C ../libgnomesu install" ; \
>                else \
>                        echo " *** If you do not have root access then
> you need to:" ; \
>                        echo " *** rm -rf gnome-system-monitor libgnomesu"
> ; \
>                        exit 2 ; \
>                fi ; \
>        fi

The problem with your suggestion is:

What happens if 'su' is executed and the person doesn't have the root
passwd? The 'else' will not execute because the condition has already
returned true "[ -x `which su` ]" in the inner 'if' statement.

A few things need to change when I get a chance to do them in a few days:

1. Rewrite the inner 'if' statement to do proper error checking.
2. Change the 'sudo' check to be Ubuntu specific cause it'll fail
otherwise on most newer distros that have 'sudo' installed and a default
/etc/sudoers file (i.e. All versions of Fedora, etc.)
3. Figure out why 'su' fails silently on SUSE? Paul, thinks this might
have to do with the fact that they mount /home that's not on a / partition
as 'nosetuid'. Maybe we'll just have it error out if it detects SUSE? Can
someone who is running SUSE check their /etc/fstab and give us more info
on how SUSE is mounting things? Especially, if you're /home is on a
different partition then /.

Any other conditions that people can think of where things might fail?

Thanks,

Bob







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]