fix: Fix path for the locales, return error when running as root

This commit is contained in:
ngn
2024-02-22 20:31:10 +03:00
parent e1b05b3bf2
commit d50d357173
3 changed files with 27 additions and 16 deletions

View File

@ -160,6 +160,11 @@ END:
}
int main(int argc, char** argv, char** envp){
if(getuid()==0){
error(_("You should use this script as a regular user, not as root!"));
return EXIT_FAILURE;
}
signal(SIGINT, SIG_IGN);
setlocale(LC_ALL, "");
textdomain("mp");
@ -185,7 +190,7 @@ int main(int argc, char** argv, char** envp){
return EXIT_FAILURE;
}
free(mpi_path);
char* doas_path = check_path("doas");
if(NULL==doas_path) {
doas_path = check_path("sudo");