gui-fatal: do not run as root

GTK+ refuses to initialize.
This commit is contained in:
Marek Marczykowski-Górecki 2014-09-20 01:20:11 +02:00
parent 54755ac444
commit 4bd9971006

View File

@ -28,6 +28,8 @@ static void produce_message(const char * type, const char *fmt, va_list args)
case -1: case -1:
exit(1); //what else exit(1); //what else
case 0: case 0:
if (geteuid() == 0)
setuid(getuid());
fix_display(); fix_display();
#ifdef USE_KDIALOG #ifdef USE_KDIALOG
execlp("/usr/bin/kdialog", "kdialog", "--sorry", dialog_msg, NULL); execlp("/usr/bin/kdialog", "kdialog", "--sorry", dialog_msg, NULL);