From 7dcb564aca95e0b8dee0e6f9b10b5f4dd0db8016 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 21 Mar 2023 14:07:37 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D0=B5=20"=D0=A1=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-datetime.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index 04b3708..38f2a9c 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -382,6 +382,14 @@ void MainWindow::event_zone() { void MainWindow::synopsis_show() { int start_error = error_info; string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name; + if (geteuid() == 0) { + string response_user = this->call("who"); + size_t index = response_user.find(" "); + if (index != std::string::npos){ + response_user = response_user.substr(0, index); + cmd = "sudo -u " + response_user + " " + cmd + " "; + } + } wrapper_system(cmd, "&"); if (start_error != error_info) { error_info = start_error;