ftlerror-guest changed gksu/trunk/ChangeLog, gksu/trunk/gksu/gksu.c

Guilherme de S. Pastore ftlerror-guest at costa.debian.org
Thu Aug 18 19:52:02 UTC 2005


Mensagem de log: 
Fix Debian bug #323836 by checking if pwentry is not NULL before acessing one of the structure members


-----


Modified: gksu/trunk/ChangeLog
===================================================================
--- gksu/trunk/ChangeLog	2005-08-18 17:55:54 UTC (rev 414)
+++ gksu/trunk/ChangeLog	2005-08-18 19:52:02 UTC (rev 415)
@@ -1,3 +1,9 @@
+2005-08-18  Guilherme de S. Pastore  <gpastore at colband.com.br>
+
+	* gksu/gksu.c: check if pwentry is not NULL before accessing
+	one of the structure members, so we don't segfault when the
+	given user does not exist (Debian bug #323836)
+
 2005-08-17  Gustavo Noronha Silva  <kov at debian.org>
 
 	* README:

Modified: gksu/trunk/gksu/gksu.c
===================================================================
--- gksu/trunk/gksu/gksu.c	2005-08-18 17:55:54 UTC (rev 414)
+++ gksu/trunk/gksu/gksu.c	2005-08-18 19:52:02 UTC (rev 415)
@@ -1054,6 +1054,13 @@
 
     pwentry = getpwnam (gksu_context_get_user (context));
 
+    if (!pwentry)
+      {
+	gk_dialog (GTK_MESSAGE_ERROR, _("User %s does not exist"),
+		   gksu_context_get_user (context));
+	return 1;
+      }
+
     if (pwentry->pw_uid == geteuid ())
       return g_spawn_command_line_sync (gksu_context_get_command (context),
 					NULL, NULL, NULL, NULL);




More information about the gksu-commits mailing list