~alpine/users

3 3

Doas environment not right?

Details
Message ID
<20250823120637.4cd62e59@bonsai.doitto.me.uk>
DKIM signature
missing
Download raw message
According to the doas(1) manpage:

"The variables DISPLAY and TERM are inherited from the current
environment."

This is incorrect:

$ env|grep -e TERM -e DISPLAY
TERM=xterm-256color
DISPLAY=localhost:10.0

$ doas su -
# env|grep -e TERM -e DISPLAY
TERM=xterm-256color

This prevents me from e.g. running gparted from an XFCE panel launcher.

# gparted

(gpartedbin:15313): Gtk-WARNING **: 12:03:23.389: cannot open display: 

Have I missed something?

BTW I also experimented with the "keepenv" option in doas.conf, whcih
allows gparted to run, but that caused the progress indicator of "apk
add" to turn into a solid block insted of a hash symbol.  Weird!
Details
Message ID
<DC9SBETJ1VVI.1G7IU7ANSRIUQ@posteo.net>
In-Reply-To
<20250823120637.4cd62e59@bonsai.doitto.me.uk> (view parent)
DKIM signature
missing
Download raw message
> According to the doas(1) manpage:
>
> "The variables DISPLAY and TERM are inherited from the current
> environment."
>
> This is incorrect:
>
> $ env|grep -e TERM -e DISPLAY
> TERM=xterm-256color
> DISPLAY=localhost:10.0
>
> $ doas su -
> # env|grep -e TERM -e DISPLAY
> TERM=xterm-256color

The - option of su clears the environment. If you do 'doas env' it will list DISPLAY.

> This prevents me from e.g. running gparted from an XFCE panel launcher.
>
> # gparted
>
> (gpartedbin:15313): Gtk-WARNING **: 12:03:23.389: cannot open display: 
>
> Have I missed something?

Maybe 'doas gparted' is what you want?
Details
Message ID
<20250823132136.1c8f458a@bonsai.doitto.me.uk>
In-Reply-To
<DC9SBETJ1VVI.1G7IU7ANSRIUQ@posteo.net> (view parent)
DKIM signature
missing
Download raw message
Good points, you are correct; the '-' is a hang-over habit from my
"sudo" days.

'doas gparted' is what I am actually doing, I just happened to run it
from a root prompt when I wrote the email!

THX - solved that one, now I just need to resolve the auth issue!
Details
Message ID
<df785a7b-b995-4f44-8c96-dcc11d172872@regrow.earth>
In-Reply-To
<20250823120637.4cd62e59@bonsai.doitto.me.uk> (view parent)
DKIM signature
missing
Download raw message
> $ doas su -
You can use `doas -s` for this purpose, just as a side note :)
Reply to thread Export thread (mbox)