You are not logged in.

#1 2021-09-26 11:37:42

cowpoon
Member
Registered: 2021-09-25
Posts: 2

Opening Thunar using doas

I can't open Thunar by typing "doas thunar" on the terminal. I've figured out that i can just use "pkexec thunar", but i just wanted to know why this happens, since i can't seem to find it anywhere in the wiki. Thanks in advance!

Offline

#2 2021-09-26 11:51:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Opening Thunar using doas

sudo and I'm assuming doas as well discards a lot of the environment of the calling user for security purposes. In this case you'll want to retain DISPLAY and DBUS_SESSION_BUS_ADDRESS at the least, sudo would have a -E flag to keep the environment not sure about doas. In any case running GUI applications as root is often not that good of an idea, and afaik thunar can use gvfs which has the admin:// special file URL that wraps the actual operations in polkit rather than running the entire process as root.

Offline

#3 2021-11-10 12:47:23

RoseMaster3000
Member
Registered: 2021-11-10
Posts: 1

Re: Opening Thunar using doas

As V1del pointed out, we need to retain the DISPLAY and DBUS_SESSION_BUS_ADDRESS environment variables.
This is possible with doas by changing the /etc/doas.conf to include the "keepenv" option.
https://man.openbsd.org/doas.conf.5#keepenv

So, for example, if the user is part of the wheel group, you can add something like this to your doas.conf...

permit keepenv :wheel

(To edit /etc/doas.conf you will need to be a root user btw)

Of course, if you only want to inherit the environment variables you need for "doas thunar" to work, you could use the "setenv" option instead.
https://man.openbsd.org/doas.conf.5#setenv

Last edited by RoseMaster3000 (2021-11-10 12:48:51)

Offline

Board footer

Powered by FluxBB