Skip to content

Commit

Permalink
gui-fatal: dynamically fall back on kdialog after trying zenity
Browse files Browse the repository at this point in the history
In practice kdialog wasn't used, because the package was built without
USE_KDIALOG being defined.

Fixes QubesOS/qubes-issues#8738
  • Loading branch information
rustybird committed Dec 2, 2023
1 parent 5a29270 commit dac51d1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions qubes-rpc/gui-fatal.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ static void produce_message(const char *type, const char *fmt, va_list args)
case 0:
if (geteuid() == 0) {
if (setuid(getuid()) != 0) {
perror("setuid failed, not calling kdialog/zenity");
perror("setuid failed, not calling zenity/kdialog");
exit(1);
}
}
fix_display();
#ifdef USE_KDIALOG
execlp("/usr/bin/kdialog", "kdialog", "--sorry", dialog_msg, NULL);
#else
execlp("/usr/bin/zenity", "zenity", "--error", "--text", dialog_msg, NULL);
#endif
execlp("/usr/bin/kdialog", "kdialog", "--sorry", dialog_msg, NULL);
exit(1);
default:;
}
Expand Down

0 comments on commit dac51d1

Please sign in to comment.