Исправлена команда получения пользователя

pull/97/head
Igor Belitskiy 3 years ago
parent 0ce939ec53
commit 77651ff402

@ -384,13 +384,9 @@ void MainWindow::synopsis_show() {
int start_error = error_info; int start_error = error_info;
string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/")) + app_name; string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/")) + app_name;
if (geteuid() == 0) { if (geteuid() == 0) {
string response_user = this->call("who"); string response_user = getlogin();
size_t index = response_user.find(" ");
if (index != std::string::npos){
response_user = response_user.substr(0, index);
cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \""; cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \"";
} }
}
wrapper_system(cmd, "&"); wrapper_system(cmd, "&");
if (start_error != error_info) { if (start_error != error_info) {
error_info = start_error; error_info = start_error;

@ -16,6 +16,7 @@
#include <unicode/timezone.h> #include <unicode/timezone.h>
#include <unicode/calendar.h> #include <unicode/calendar.h>
#include <map> #include <map>
#include <pwd.h>
#include "ubl-util-standard.c" #include "ubl-util-standard.c"

Loading…
Cancel
Save