You are not logged in.

#1 2020-11-12 17:44:12

antarchtic
Member
Registered: 2020-11-11
Posts: 15

[SOLVED] Can't start some GUI applications from sudo

For example,

sudo mousepad

"Failed to initialize xfconf"
I use i3.

What is it about? The wiki doesn't say anything about "xconf"

My .xinitrc
http://sprunge.us/W0aKqt

Last edited by antarchtic (2020-11-12 18:17:52)

Offline

#2 2020-11-12 17:47:14

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Can't start some GUI applications from sudo

Why are you trying to use sudo to launch graphical applications? It's really not a good idea.

Also why are you using dbus-launch in your ~/.xinitrc?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2020-11-12 17:58:15

antarchtic
Member
Registered: 2020-11-11
Posts: 15

Re: [SOLVED] Can't start some GUI applications from sudo

Slithery wrote:

Why are you trying to use sudo to launch graphical applications? It's really not a good idea.

Also why are you using dbus-launch in your ~/.xinitrc?

Just for testing, I use commented "exec i3".
It did not affect to launch applications from sudo anyway...

Why is this a bad idea? I need to to edit some system wide configs from GUI text editor.
... or even just want everything to work correctly big_smile
Sometimes I need it.

Last edited by antarchtic (2020-11-12 17:59:06)

Offline

#4 2020-11-12 18:01:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Can't start some GUI applications from sudo

antarchtic wrote:

Why is this a bad idea? I need to to edit some system wide configs from GUI text editor.
... or even just want everything to work correctly big_smile
Sometimes I need it.

I think you should look up the definition of "need"

You never, ever need a GUI text editor to edit system configs.

Offline

#5 2020-11-12 18:10:20

antarchtic
Member
Registered: 2020-11-11
Posts: 15

Re: [SOLVED] Can't start some GUI applications from sudo

Scimmia wrote:
antarchtic wrote:

Why is this a bad idea? I need to to edit some system wide configs from GUI text editor.
... or even just want everything to work correctly big_smile
Sometimes I need it.

I think you should look up the definition of "need"

You never, ever need a GUI text editor to edit system configs.

I like nano but it has no syntax highlighting... Vim is something scary for me.
I think there is nothing wrong with a graphical text editor for convenience

Offline

#6 2020-11-12 18:12:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,692

Re: [SOLVED] Can't start some GUI applications from sudo

Please use sudoedit and export your favorite $EDITOR

Edit: it's a bad idea because GUI applications (and emacs tongue ) tend to be bloated bug collections what makes them very vulnerable.
You want to limit the stuff you run as UID0 as much as possible.

Last edited by seth (2020-11-12 18:15:46)

Offline

#7 2020-11-12 18:16:51

antarchtic
Member
Registered: 2020-11-11
Posts: 15

Re: [SOLVED] Can't start some GUI applications from sudo

seth wrote:

Please use sudoedit and export your favorite $EDITOR

With variable works fine, thanks again

Offline

#8 2020-11-12 19:52:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,700

Re: [SOLVED] Can't start some GUI applications from sudo

Joking aside, emacs does have TRAMP mode to allow the ability to selectively access files with higher privilege.   I'm pretty sure it still represents a security issue;  as does any editor given permission to do dangerous things.  Some editors are more dangerous than others, especially those written without being intended to edit dangerous things.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2020-11-12 21:28:37

antarchtic
Member
Registered: 2020-11-11
Posts: 15

Re: [SOLVED] Can't start some GUI applications from sudo

ewaller wrote:

Joking aside, emacs does have TRAMP mode to allow the ability to selectively access files with higher privilege.   I'm pretty sure it still represents a security issue;  as does any editor given permission to do dangerous things.  Some editors are more dangerous than others, especially those written without being intended to edit dangerous things.

This has its own truth, but for the sake of knowledge sometimes I need to break something. Everything is relative)

Offline

#10 2020-11-12 23:19:01

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Can't start some GUI applications from sudo

antarchtic wrote:

I like nano but it has no syntax highlighting

Not true. https://wiki.archlinux.org/index.php/Na … ghlighting

Offline

#11 2020-11-13 06:54:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,692

Re: [SOLVED] Can't start some GUI applications from sudo

Afaiu the TRAMP mode, it's not much different from sudoedit; ie. it operates on a local copy and uses a "remote" protocol (su/do) to upload the file to its original location.
That's perfectly fine and not like running emacs as UID0

It's also not very surprising that emacs provides its own access leverage system.
After all it's a pretty decent OS that even runs vim!
smile

Offline

Board footer

Powered by FluxBB