summaryrefslogtreecommitdiff
path: root/src/vycli.ml
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-09-18 12:32:18 +0100
committerGitHub <noreply@github.com>2025-09-18 12:32:18 +0100
commit304e4d2a172fe1baf2c1df7f61b7a0a8e40f7d5d (patch)
tree4a415189068819e7914ae1352a69abe08eb45c60 /src/vycli.ml
parent2da0981501a9bec8b69d29f1e52c10db90571aa4 (diff)
parentbca62a7bd1da4e78497fdce3882421609ce28c00 (diff)
downloadvyconf-304e4d2a172fe1baf2c1df7f61b7a0a8e40f7d5d.tar.gz
vyconf-304e4d2a172fe1baf2c1df7f61b7a0a8e40f7d5d.zip
Merge pull request #31 from jestabro/interstitial-set
T7737: add analogue of configfs for config tree updates during commit
Diffstat (limited to 'src/vycli.ml')
-rw-r--r--src/vycli.ml10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vycli.ml b/src/vycli.ml
index 174d6f4..6b13bdd 100644
--- a/src/vycli.ml
+++ b/src/vycli.ml
@@ -68,7 +68,15 @@ let main socket op path out_format config_format =
end
| OpSetupSession ->
let pid = Int32.of_int (Unix.getppid ()) in
- let%lwt resp = setup_session client "vycli" pid in
+ let user =
+ try Sys.getenv "USER"
+ with Not_found -> ""
+ in
+ let sudo_user =
+ try Sys.getenv "SUDO_USER"
+ with Not_found -> ""
+ in
+ let%lwt resp = setup_session client "vycli" sudo_user user pid in
begin
match resp with
| Ok c -> get_token c