Kaynağa Gözat

qrexec: check for setuid() error when calling zenity/kdialog

Mostly to mute compiler warning - only emit log message but still
continue.
Marek Marczykowski-Górecki 9 yıl önce
ebeveyn
işleme
64e8eedcb0
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      qubes-rpc/gui-fatal.c

+ 2 - 1
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);