1 From b861d070092ee71ac4208f79b699cf7dadd5c154 Mon Sep 17 00:00:00 2001
2 From: Simon Ser <contact@emersion.fr>
3 Date: Mon, 3 May 2021 15:42:19 +0200
4 Subject: [PATCH] Copy XDG_RUNTIME_DIR and WAYLAND_DISPLAY
5
6 This allows to run Wayland clients under doas.
7 ---
8 doas.1 | 6 +++++-
9 env.c | 2 +-
10 2 files changed, 6 insertions(+), 2 deletions(-)
11
12 diff --git a/doas.1 b/doas.1
13 index a91705e..bd1f543 100644
14 --- a/doas.1
15 +++ b/doas.1
16 @@ -58,8 +58,12 @@ is set to the name of the user executing
17 .Nm .
18 The variables
19 .Ev DISPLAY
20 -and
21 +,
22 .Ev TERM
23 +,
24 +.Ev XDG_RUNTIME_DIR
25 +and
26 +.Ev WAYLAND_DISPLAY
27 are inherited from the current environment.
28 This behavior may be modified by the config file.
29 The working directory is not changed.
30 diff --git a/env.c b/env.c
31 index e2286fc..b7955d7 100644
32 --- a/env.c
33 +++ b/env.c
34 @@ -91,7 +91,7 @@ createenv(const struct rule *rule, const struct passwd *mypw,
35 const struct passwd *targpw)
36 {
37 static const char *copyset[] = {
38 - "DISPLAY", "TERM",
39 + "DISPLAY", "TERM", "XDG_RUNTIME_DIR", "WAYLAND_DISPLAY",
40 NULL
41 };
42 struct env *env;
|