You are not logged in.

#1 2011-11-04 06:06:15

dontbugme
Banned
Registered: 2011-11-04
Posts: 166
Website

GKSUDO, GKSU and SUDO. What's going on?!?!

Hello all. I don't usually come to boards, however I didn't found an answer to my question. So let me explain in details to you all:

(I'm using Arch with gnome3-fallback)
(gconf key /apps/gksu/sudo-mode is false by default)
(I tested everything with gedit and checking permissions in ~/.config/gedit)

-----------------------------------------------------------

First, I want to know what's the difference between gksu, gksudo and sudo.

From what I read on the internet it should be like this:
sudo: uses user's configuration, with root privileges. (supposed to be unsafe)
gksu: uses root's configuration, with root privileges. (supposed to be safe)
gksudo:: uses root's configuration, with root privileges. (supposed to be safe)

What's actually happening is:
sudo: uses root's configuration, with root privileges. (it's safe)
gksu: uses user's configuration, with root privileges, and screws up user's configuration permissions. (it's not safe)
gksudo: uses root's configuration, with root privileges, and some bugs appear, as an empty document on gedit. (it's safe)

gksudo and sudo are equally safe. They didn't screw up permissions, however gksudo showed some bugs, which are probably unrelated. That makes sense as gksudo is supposed to use sudo_mode (gksu -S).
gksu is very funny, so you have to try this:
- Open one instance with gksu gedit. (Output is something with 'Failed to connect to the session manager'. gedit uses user's configs)
- Open various instances with gedit. (Some of them will use root's configs, some of them will use user's configs. Some of them will print permission errors about ~/.local/share/recently-used.xbel, some won't.)
If you keep fiddling with that, at some point your user's configurations will be all messed up.

What's happening there? I don't have a clue.

-----------------------------------------------------------

Second, I would like to know how does gksudo works.

As some people pointed it out, it seems that gksu and gksudo should do the same thing, because gksudo is a symlink to gksu (try 'ls -l /usr/bin/gksudo').
However, they do different actions. How? All I can think about is libgksu treating them differently.
Nevertheless, gksudo is actually gksu -S, they can be freely swapped in my examples.

-----------------------------------------------------------


Any help is appreciated. Also, sorry for my english, I'm brazilian.

Offline

#2 2011-11-04 07:48:51

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

man pages are useful, you should try them sometime. gksu and gksudo are frontends to su (which you missed out) and sudo. Your 'not safe' and 'safe' classifications make no sense to me, sorry.

The difference between su and sudo is well documented online. Same difference between gksu and gksudo.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2011-11-04 10:03:48

trontonic
Member
Registered: 2008-07-21
Posts: 80

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

As I understand, by "safe" he means "does not change my configuration files in a way I don't want them to change".

In any case, dontbugme, if you like sudo and gksudo and not gksu, stick with them (I've had better experience with sudo and gksudo than with gksu too).

Last edited by trontonic (2011-11-04 10:04:03)

Offline

#4 2011-11-04 15:17:14

dontbugme
Banned
Registered: 2011-11-04
Posts: 166
Website

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

I'm already using gksudo and sudo and already read all man pages.
However, sudo (and gksudo) are supposed to elevate privileges of user, allowing me to reach, for example, system files, while using my configurations.
But that's not whats happening. sudo (and gksudo) are using root's configuration and gksu is using mine. It's reversed.

I think that the first thing to find out is why sudo is using root's configuration files.
Also, if you (ngoonee) read man pages, you'll see that gksu and gksudo are not just frontends. They change $HOME, $PATH and other stuff which is not well documented.

Offline

#5 2011-11-04 15:25:37

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

gksu/sudo is deprecated. use pkexec


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2011-11-04 16:01:24

Awebb
Member
Registered: 2010-05-06
Posts: 6,282

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

wonder wrote:

gksu/sudo is deprecated. use pkexec

Not so fast, pilgrim :-D

I know, the OP mentioned Gnome 3, but not everybody uses a policykit-driven desktop, although I suspect you think everybody should :-D

Offline

#7 2011-11-04 16:15:32

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

Awebb wrote:
wonder wrote:

gksu/sudo is deprecated. use pkexec

Not so fast, pilgrim :-D

I know, the OP mentioned Gnome 3, but not everybody uses a policykit-driven desktop, although I suspect you think everybody should :-D

Upstream says in big letters "gksu is being replaced by gksu PolicyKit, please take a look at http://live.gnome.org/gksu." On the page of that link is written "The new gksu will use PolicyKit as backend, instead of su and sudo."


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#8 2011-11-04 16:20:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

fsckd wrote:
Awebb wrote:
wonder wrote:

gksu/sudo is deprecated. use pkexec

Not so fast, pilgrim :-D

I know, the OP mentioned Gnome 3, but not everybody uses a policykit-driven desktop, although I suspect you think everybody should :-D

Upstream says in big letters "gksu is being replaced by gksu PolicyKit, please take a look at http://live.gnome.org/gksu." On the page of that link is written "The new gksu will use PolicyKit as backend, instead of su and sudo."

AFAIK pure sudo stays for now, right?

Offline

#9 2011-11-04 17:40:55

Awebb
Member
Registered: 2010-05-06
Posts: 6,282

Re: GKSUDO, GKSU and SUDO. What's going on?!?!

Ah, well, it sounded like sudo, not the gksu/sudo combination is deprecated. That makes sense now.

Offline

Board footer

Powered by FluxBB