[Pkg-shadow-commits] r2040 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun May 25 23:42:40 UTC 2008


Author: nekral-guest
Date: 2008-05-25 23:42:39 +0000 (Sun, 25 May 2008)
New Revision: 2040

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/setugid.c
Log:
	* libmisc/setugid.c (setup_uid_gid): The is_console argument is now a bool.
	* libmisc/setugid.c: Avoid implicit conversion of integers / pointers to booleans.
	* libmisc/setugid.c: Add brackets.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-05-25 23:39:59 UTC (rev 2039)
+++ upstream/trunk/ChangeLog	2008-05-25 23:42:39 UTC (rev 2040)
@@ -1,6 +1,6 @@
 2008-05-26  Nicolas François  <nicolas.francois at centraliens.net>
 
-	* libmisc/setugid.c (setup_uid_gid): The is_console argument is no
+	* libmisc/setugid.c (setup_uid_gid): The is_console argument is now
 	a bool.
 	* libmisc/setugid.c: Avoid implicit conversion of integers /
 	pointers to booleans.

Modified: upstream/trunk/libmisc/setugid.c
===================================================================
--- upstream/trunk/libmisc/setugid.c	2008-05-25 23:39:59 UTC (rev 2039)
+++ upstream/trunk/libmisc/setugid.c	2008-05-25 23:42:39 UTC (rev 2040)
@@ -82,7 +82,7 @@
 	/*
 	 * Set the real UID to the UID value in the password file.
 	 */
-	if (setuid (info->pw_uid)) {
+	if (setuid (info->pw_uid) != 0) {
 		perror ("setuid");
 		SYSLOG ((LOG_ERR, "bad user ID `%d' for user `%s': %m\n",
 			 (int) info->pw_uid, info->pw_name));
@@ -103,7 +103,7 @@
  *	Returns 0 on success, or -1 on failure.
  */
 
-int setup_uid_gid (const struct passwd *info, int is_console)
+int setup_uid_gid (const struct passwd *info, bool is_console)
 {
 	if (setup_groups (info) < 0)
 		return -1;
@@ -112,8 +112,9 @@
 	if (is_console) {
 		char *cp = getdef_str ("CONSOLE_GROUPS");
 
-		if (cp && add_groups (cp))
+		if ((NULL != cp) && (add_groups (cp) != 0)) {
 			perror ("Warning: add_groups");
+		}
 	}
 #endif				/* HAVE_INITGROUPS */
 




More information about the Pkg-shadow-commits mailing list