From 64e8eedcb0ae2d9be23c9f2c01d5e13c4305d395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 29 Sep 2014 21:04:47 +0200 Subject: [PATCH] qrexec: check for setuid() error when calling zenity/kdialog Mostly to mute compiler warning - only emit log message but still continue. --- qubes-rpc/gui-fatal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubes-rpc/gui-fatal.c b/qubes-rpc/gui-fatal.c index 1b71b00..5292f06 100644 --- a/qubes-rpc/gui-fatal.c +++ b/qubes-rpc/gui-fatal.c @@ -29,7 +29,8 @@ static void produce_message(const char * type, const char *fmt, va_list args) exit(1); //what else case 0: if (geteuid() == 0) - setuid(getuid()); + if (setuid(getuid()) != 0) + perror("setuid failed, calling kdialog/zenity as root"); fix_display(); #ifdef USE_KDIALOG execlp("/usr/bin/kdialog", "kdialog", "--sorry", dialog_msg, NULL);