|
|
|
|
@ -733,9 +733,18 @@ int yon_ubl_check_root(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *yon_ubl_root_user_get(){
|
|
|
|
|
char *user=NULL;
|
|
|
|
|
if (yon_ubl_check_root()){
|
|
|
|
|
char *user=getenv("SUDO_USER");
|
|
|
|
|
user=getenv("SUDO_USER");
|
|
|
|
|
if (user&&strcmp(user,"")!=0){
|
|
|
|
|
return user;
|
|
|
|
|
}else {
|
|
|
|
|
FILE *file = popen("getent passwd $PKEXEC_UID | cut -d: -f1","r");
|
|
|
|
|
user=g_malloc0(4096);
|
|
|
|
|
fgets(user,4096,file);
|
|
|
|
|
user=yon_char_divide_search(user,"\n",-1);
|
|
|
|
|
if (user) return user;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return getlogin();
|
|
|
|
|
}
|
|
|
|
|
|