[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pkg-shadow-commits
Subject:    [Pkg-shadow-commits] r2851 - in upstream/trunk: . src
From:       Nicolas_FRANÇOIS <nekral-guest () alioth ! debian ! org>
Date:       2009-04-30 21:39:38
Message-ID: E1Lzdyk-0007dZ-SD () alioth ! debian ! org
[Download RAW message or body]

Author: nekral-guest
Date: 2009-04-30 21:39:38 +0000 (Thu, 30 Apr 2009)
New Revision: 2851

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/chage.c
   upstream/trunk/src/chfn.c
   upstream/trunk/src/chgpasswd.c
   upstream/trunk/src/chpasswd.c
   upstream/trunk/src/chsh.c
   upstream/trunk/src/faillog.c
   upstream/trunk/src/gpasswd.c
   upstream/trunk/src/groupadd.c
   upstream/trunk/src/groupdel.c
   upstream/trunk/src/groupmems.c
   upstream/trunk/src/groupmod.c
   upstream/trunk/src/grpck.c
   upstream/trunk/src/lastlog.c
   upstream/trunk/src/login.c
   upstream/trunk/src/newgrp.c
   upstream/trunk/src/nologin.c
   upstream/trunk/src/passwd.c
   upstream/trunk/src/pwck.c
   upstream/trunk/src/pwconv.c
   upstream/trunk/src/su.c
   upstream/trunk/src/sulogin.c
   upstream/trunk/src/useradd.c
   upstream/trunk/src/userdel.c
   upstream/trunk/src/usermod.c
   upstream/trunk/src/vipw.c
Log:
	* src/newgrp.c, src/chfn.c, src/groupmems.c, src/usermod.c,
	src/userdel.c, src/chpasswd.c, src/grpck.c, src/gpasswd.c,
	src/groupdel.c, src/chgpasswd.c, src/vipw.c, src/useradd.c,
	src/su.c, src/groupmod.c, src/passwd.c, src/pwck.c,
	src/groupadd.c, src/chage.c, src/login.c, src/faillog.c,
	src/sulogin.c, src/chsh.c, src/pwconv.c: Added splint annotations.
	* src/userdel.c, src/pwconv.c, src/lastlog.c, src/grpck.c,
	src/vipw.c, src/groupmod.c, src/passwd.c, src/pwck.c, src/login.c,
	src/sulogin.c, src/usermod.c: Use return instead of exit at the
	end of main().
	* src/gpasswd.c, src/passwd.c, src/faillog.c: Use the exitcodes.h
	exit codes.
	* src/chpasswd.c: Added missing ||.
	* src/nologin.c: Do not include exitcodes.h.
	* src/nologin.c: Added brackets.
	* src/nologin.c: Avoid assignments in comparisons.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/ChangeLog	2009-04-30 21:39:38 UTC (rev 2851)
@@ -1,5 +1,24 @@
 2009-04-30  Nicolas François  <nicolas.francois@centraliens.net>
 
+	* src/newgrp.c, src/chfn.c, src/groupmems.c, src/usermod.c,
+	src/userdel.c, src/chpasswd.c, src/grpck.c, src/gpasswd.c,
+	src/groupdel.c, src/chgpasswd.c, src/vipw.c, src/useradd.c,
+	src/su.c, src/groupmod.c, src/passwd.c, src/pwck.c,
+	src/groupadd.c, src/chage.c, src/login.c, src/faillog.c,
+	src/sulogin.c, src/chsh.c, src/pwconv.c: Added splint annotations.
+	* src/userdel.c, src/pwconv.c, src/lastlog.c, src/grpck.c,
+	src/vipw.c, src/groupmod.c, src/passwd.c, src/pwck.c, src/login.c,
+	src/sulogin.c, src/usermod.c: Use return instead of exit at the
+	end of main().
+	* src/gpasswd.c, src/passwd.c, src/faillog.c: Use the exitcodes.h
+	exit codes.
+	* src/chpasswd.c: Added missing ||.
+	* src/nologin.c: Do not include exitcodes.h.
+	* src/nologin.c: Added brackets.
+	* src/nologin.c: Avoid assignments in comparisons.
+
+2009-04-30  Nicolas François  <nicolas.francois@centraliens.net>
+
 	* libmisc/getgr_nam_gid.c, lib/get_gid.c, lib/get_pid.c,
 	lib/get_uid.c: Added splint annotations.
 

Modified: upstream/trunk/src/chage.c
===================================================================
--- upstream/trunk/src/chage.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/chage.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -52,11 +52,13 @@
 #include <selinux/selinux.h>
 #include <selinux/av_permissions.h>
 #endif
-#include "exitcodes.h"
 #include "prototypes.h"
 #include "defines.h"
 #include "pwio.h"
 #include "shadowio.h"
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables
  */

Modified: upstream/trunk/src/chfn.c
===================================================================
--- upstream/trunk/src/chfn.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/chfn.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -44,7 +44,6 @@
 #include <selinux/av_permissions.h>
 #endif
 #include "defines.h"
-#include "exitcodes.h"
 #include "getdef.h"
 #include "nscd.h"
 #ifdef USE_PAM
@@ -53,6 +52,9 @@
 #include "prototypes.h"
 #include "pwauth.h"
 #include "pwio.h"
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables.
  */

Modified: upstream/trunk/src/chgpasswd.c
===================================================================
--- upstream/trunk/src/chgpasswd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/chgpasswd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -45,13 +45,15 @@
 #endif				/* USE_PAM */
 #endif				/* ACCT_TOOLS_SETUID */
 #include "defines.h"
-#include "exitcodes.h"
 #include "nscd.h"
 #include "prototypes.h"
 #include "groupio.h"
 #ifdef	SHADOWGRP
 #include "sgroupio.h"
 #endif
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables
  */

Modified: upstream/trunk/src/chpasswd.c
===================================================================
--- upstream/trunk/src/chpasswd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/chpasswd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -43,11 +43,13 @@
 #include "pam_defs.h"
 #endif				/* USE_PAM */
 #include "defines.h"
-#include "exitcodes.h"
 #include "nscd.h"
 #include "prototypes.h"
 #include "pwio.h"
 #include "shadowio.h"
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables
  */
@@ -494,8 +496,8 @@
 
 #else				/* !USE_PAM */
 		if (   !eflg
-		    && ((NULL == crypt_method)
-		        (0 != strcmp (crypt_method, "NONE")))) {
+		    && (   (NULL == crypt_method)
+		        || (0 != strcmp (crypt_method, "NONE")))) {
 			void *arg = NULL;
 			if (md5flg) {
 				crypt_method = "MD5";

Modified: upstream/trunk/src/chsh.c
===================================================================
--- upstream/trunk/src/chsh.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/chsh.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -44,7 +44,6 @@
 #include <selinux/av_permissions.h>
 #endif
 #include "defines.h"
-#include "exitcodes.h"
 #include "getdef.h"
 #include "nscd.h"
 #include "prototypes.h"
@@ -53,6 +52,9 @@
 #ifdef USE_PAM
 #include "pam_defs.h"
 #endif
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 #ifndef SHELLS_FILE
 #define SHELLS_FILE "/etc/shells"
 #endif

Modified: upstream/trunk/src/faillog.c
===================================================================
--- upstream/trunk/src/faillog.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/faillog.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -42,9 +42,11 @@
 #include <time.h>
 #include <assert.h>
 #include "defines.h"
-#include "exitcodes.h"
 #include "faillog.h"
 #include "prototypes.h"
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables
  */
@@ -498,7 +500,7 @@
 					fprintf (stderr,
 					         _("%s: invalid numeric argument '%s'\n"),
 					         "faillog", optarg);
-					usage ();
+					exit (E_BAD_ARG);
 				}
 				lflg = true;
 				break;
@@ -507,7 +509,7 @@
 					fprintf (stderr,
 					         _("%s: invalid numeric argument '%s'\n"),
 					         "faillog", optarg);
-					usage ();
+					exit (E_BAD_ARG);
 				}
 				mflg = true;
 				break;
@@ -519,7 +521,7 @@
 					fprintf (stderr,
 					         _("%s: invalid numeric argument '%s'\n"),
 					         "faillog", optarg);
-					usage ();
+					exit (E_BAD_ARG);
 				}
 				seconds = (time_t) days * DAY;
 				tflg = true;
@@ -550,7 +552,7 @@
 						fprintf (stderr,
 						         _("lastlog: Unknown user or range: %s\n"),
 						         optarg);
-						exit (EXIT_FAILURE);
+						exit (E_BAD_ARG);
 					}
 				}
 
@@ -579,7 +581,7 @@
 		fprintf (stderr,
 		         _("faillog: Cannot open %s: %s\n"),
 		         FAILLOG_FILE, strerror (errno));
-		exit (EXIT_FAILURE);
+		exit (E_NOPERM);
 	}
 
 	/* Get the size of the faillog */
@@ -587,7 +589,7 @@
 		fprintf (stderr,
 		         _("faillog: Cannot get the size of %s: %s\n"),
 		         FAILLOG_FILE, strerror (errno));
-		exit (EXIT_FAILURE);
+		exit (E_NOPERM);
 	}
 
 	if (lflg) {
@@ -608,6 +610,6 @@
 
 	fclose (fail);
 
-	exit (errors ? EXIT_FAILURE : EXIT_SUCCESS);
+	exit (errors ? E_NOPERM : E_SUCCESS);
 }
 

Modified: upstream/trunk/src/gpasswd.c
===================================================================
--- upstream/trunk/src/gpasswd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/gpasswd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -43,13 +43,15 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include "defines.h"
-#include "exitcodes.h"
 #include "groupio.h"
 #include "nscd.h"
 #include "prototypes.h"
 #ifdef SHADOWGRP
 #include "sgroupio.h"
 #endif
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Global variables
  */
@@ -220,7 +222,7 @@
 {
 	fprintf (stderr, _("%s: Permission denied.\n"), Prog);
 	log_gpasswd_failure (": Permission denied");
-	exit (1);
+	exit (E_NOPERM);
 }
 
 /*
@@ -248,9 +250,9 @@
 			/* local, no need for xgetpwnam */
 			if (getpwnam (user) == NULL) {
 				fprintf (stderr,
-				         _("%s: user '%s' does not exist\n"), Prog,
-				         user);
-				exit (1);
+				         _("%s: user '%s' does not exist\n"),
+				         Prog, user);
+				exit (E_BAD_ARG);
 			}
 			break;
 #ifdef SHADOWGRP
@@ -259,11 +261,11 @@
 				fprintf (stderr,
 				         _("%s: shadow group passwords required for -A\n"),
 				         Prog);
-				exit (2);
+				exit (E_GSHADOW_NOTFOUND);
 			}
 			admins = optarg;
 			if (!is_valid_user_list (admins)) {
-				exit (1);
+				exit (E_BAD_ARG);
 			}
 			Aflg = true;
 			break;
@@ -277,7 +279,7 @@
 		case 'M':	/* set the list of members */
 			members = optarg;
 			if (!is_valid_user_list (members)) {
-				exit (1);
+				exit (E_BAD_ARG);
 			}
 			Mflg = true;
 			break;
@@ -345,7 +347,7 @@
 		fprintf (stderr,
 		         _("%s: cannot lock %s; try again later.\n"),
 		         Prog, gr_dbname ());
-		exit (1);
+		exit (E_NOPERM);
 	}
 	add_cleanup (cleanup_unlock_group, NULL);
 
@@ -355,7 +357,7 @@
 			fprintf (stderr,
 			         _("%s: cannot lock %s; try again later.\n"),
 			         Prog, sgr_dbname ());
-			exit (1);
+			exit (E_NOPERM);
 		}
 		add_cleanup (cleanup_unlock_gshadow, NULL);
 	}
@@ -368,7 +370,7 @@
 		         _("%s: cannot open %s\n"),
 		         Prog, gr_dbname ());
 		SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
-		exit (1);
+		exit (E_NOPERM);
 	}
 
 #ifdef SHADOWGRP
@@ -378,7 +380,7 @@
 			         _("%s: cannot open %s\n"),
 			         Prog, sgr_dbname ());
 			SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
-			exit (1);
+			exit (E_NOPERM);
 		}
 		add_cleanup (log_gpasswd_failure_gshadow, NULL);
 	}
@@ -669,7 +671,7 @@
 		fprintf (stderr,
 		         _("%s: failure while writing changes to %s\n"),
 		         Prog, gr_dbname ());
-		exit (1);
+		exit (E_NOPERM);
 	}
 	add_cleanup (log_gpasswd_success_group, NULL);
 	del_cleanup (log_gpasswd_failure_group);
@@ -683,7 +685,7 @@
 			fprintf (stderr,
 			         _("%s: failure while writing changes to %s\n"),
 			         Prog, sgr_dbname ());
-			exit (1);
+			exit (E_NOPERM);
 		}
 		add_cleanup (log_gpasswd_success_gshadow, NULL);
 		del_cleanup (log_gpasswd_failure_gshadow);
@@ -815,7 +817,7 @@
 	if (gr_open (O_RDONLY) == 0) {
 		fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
 		SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
-		exit (1);
+		exit (E_NOPERM);
 	}
 
 	tmpgr = gr_locate (group);
@@ -823,7 +825,7 @@
 		fprintf (stderr,
 		         _("%s: group '%s' does not exist in %s\n"),
 		         Prog, group, gr_dbname ());
-		exit (1);
+		exit (E_BAD_ARG);
 	}
 
 	*gr = *tmpgr;
@@ -838,7 +840,7 @@
 		SYSLOG ((LOG_ERR,
 		         "failure while closing read-only %s",
 		         gr_dbname ()));
-		exit (1);
+		exit (E_NOPERM);
 	}
 
 #ifdef SHADOWGRP
@@ -848,7 +850,7 @@
 			         _("%s: cannot open %s\n"),
 			         Prog, sgr_dbname ());
 			SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
-			exit (1);
+			exit (E_NOPERM);
 		}
 		tmpsg = sgr_locate (group);
 		if (NULL != tmpsg) {
@@ -884,7 +886,7 @@
 			SYSLOG ((LOG_ERR,
 			         "failure while closing read-only %s",
 			         sgr_dbname ()));
-			exit (1);
+			exit (E_NOPERM);
 		}
 	}
 #endif				/* SHADOWGRP */
@@ -1010,7 +1012,7 @@
 		SYSLOG ((LOG_WARN,
 		         "Cannot determine the user name of the caller (UID %lu)",
 		         (unsigned long) getuid ()));
-		exit (1);
+		exit (E_NOPERM);
 	}
 	myname = xstrdup (pw->pw_name);
 
@@ -1020,7 +1022,7 @@
 	 */
 	if (atexit (do_cleanups) != 0) {
 		fprintf(stderr, "%s: cannot set exit function\n", Prog);
-		exit(EXIT_FAILURE);
+		exit (1);
 	}
 
 	/* Parse the options */
@@ -1106,7 +1108,7 @@
 			fprintf (stderr,
 			         _("%s: user '%s' is not a member of '%s'\n"),
 			         Prog, user, group);
-			exit (1);
+			exit (E_BAD_ARG);
 		}
 		goto output;
 	}
@@ -1144,7 +1146,7 @@
 	 */
 	if ((isatty (0) == 0) || (isatty (1) == 0)) {
 		fprintf (stderr, _("%s: Not a tty\n"), Prog);
-		exit (1);
+		exit (E_NOPERM);
 	}
 
 	catch_signals (0);	/* save tty modes */
@@ -1175,7 +1177,7 @@
 		fputs (_("Cannot change ID to root.\n"), stderr);
 		SYSLOG ((LOG_ERR, "can't setuid(0)"));
 		closelog ();
-		exit (1);
+		exit (E_NOPERM);
 	}
 	pwd_init ();
 

Modified: upstream/trunk/src/groupadd.c
===================================================================
--- upstream/trunk/src/groupadd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/groupadd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -59,6 +59,7 @@
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_USAGE		2	/* invalid command syntax */
 #define E_BAD_ARG	3	/* invalid argument to option */

Modified: upstream/trunk/src/groupdel.c
===================================================================
--- upstream/trunk/src/groupdel.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/groupdel.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -67,6 +67,7 @@
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_USAGE		2	/* invalid command syntax */
 #define E_NOTFOUND	6	/* specified group doesn't exist */

Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/groupmems.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -49,7 +49,7 @@
 #endif
 
 /* Exit Status Values */
-
+/*@-exitarg@*/
 #define EXIT_SUCCESS		0	/* success */
 #define EXIT_USAGE		1	/* invalid command syntax */
 #define EXIT_GROUP_FILE		2	/* group file access problems */

Modified: upstream/trunk/src/groupmod.c
===================================================================
--- upstream/trunk/src/groupmod.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/groupmod.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -58,6 +58,7 @@
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_USAGE		2	/* invalid command syntax */
 #define E_BAD_ARG	3	/* invalid argument to option */
@@ -813,7 +814,6 @@
 
 	nscd_flush_cache ("group");
 
-	exit (E_SUCCESS);
-	/* NOT REACHED */
+	return E_SUCCESS;
 }
 

Modified: upstream/trunk/src/grpck.c
===================================================================
--- upstream/trunk/src/grpck.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/grpck.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -53,7 +53,7 @@
 /*
  * Exit codes
  */
-
+/*@-exitarg@*/
 #define	E_OKAY		0
 #define	E_USAGE		1
 #define	E_BAD_ENTRY	2
@@ -840,6 +840,6 @@
 		}
 	}
 
-	exit ((0 != errors) ? E_BAD_ENTRY : E_OKAY);
+	return ((0 != errors) ? E_BAD_ENTRY : E_OKAY);
 }
 

Modified: upstream/trunk/src/lastlog.c
===================================================================
--- upstream/trunk/src/lastlog.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/lastlog.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -296,6 +296,7 @@
 	print ();
 
 	(void) fclose (lastlogfile);
-	exit (EXIT_SUCCESS);
+
+	return EXIT_SUCCESS;
 }
 

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/login.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -51,7 +51,9 @@
 #include "getdef.h"
 #include "prototypes.h"
 #include "pwauth.h"
+/*@-exitarg@*/
 #include "exitcodes.h"
+
 #ifdef USE_PAM
 #include "pam_defs.h"
 
@@ -1324,8 +1326,7 @@
 		/* exec the shell finally */
 		err = shell (pwd->pw_shell, (char *) 0, newenvp);
 	}
-	exit (err == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
-	/* NOT REACHED */
-	return 0;
+
+	return ((err == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
 }
 

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/newgrp.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -42,7 +42,9 @@
 #include "defines.h"
 #include "getdef.h"
 #include "prototypes.h"
+/*@-exitarg@*/
 #include "exitcodes.h"
+
 /*
  * Global variables
  */
@@ -345,7 +347,7 @@
 				         (unsigned long) gid, name));
 			}
 			closelog ();
-			exit (EXIT_SUCCESS);
+			exit (E_SUCCESS);
 		}
 
 		/* child - restore signals to their default state */
@@ -728,7 +730,7 @@
 		              (unsigned int) getuid (), 0);
 #endif
 		perror ("/bin/sh");
-		exit (errno == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
+		exit ((errno == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
 	}
 
 	/*
@@ -800,7 +802,7 @@
 	 * the previous environment which should be the user's login shell.
 	 */
 	err = shell (prog, initflag ? (char *) 0 : cp, newenvp);
-	exit (err == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
+	exit ((err == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
 	/* @notreached@ */
       failure:
 

Modified: upstream/trunk/src/nologin.c
===================================================================
--- upstream/trunk/src/nologin.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/nologin.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -31,20 +31,24 @@
 #include <stdio.h>
 #include <syslog.h>
 #include <unistd.h>
-#include "exitcodes.h"
 
 int main (void)
 {
 	const char *user, *tty;
 
-	if ((tty = ttyname (0)) == NULL)
+	tty = ttyname (0);
+	if (NULL == tty) {
 		tty = "UNKNOWN";
-	if ((user = getlogin ()) == NULL)
+	}
+	user = getlogin ();
+	if (NULL == user) {
 		user = "UNKNOWN";
+	}
 	openlog ("nologin", LOG_CONS, LOG_AUTH);
 	syslog (LOG_CRIT, "Attempted login by %s on %s", user, tty);
 	closelog ();
 
 	printf ("%s", "This account is currently not available.\n");
-	return E_NOPERM;
+
+	return EXIT_FAILURE;
 }

Modified: upstream/trunk/src/passwd.c
===================================================================
--- upstream/trunk/src/passwd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/passwd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -55,9 +55,11 @@
 #include "pwauth.h"
 #include "pwio.h"
 #include "shadowio.h"
+
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_NOPERM	1	/* permission denied */
 #define E_USAGE		2	/* invalid combination of options */
@@ -1004,7 +1006,7 @@
 		if (NULL != user_context) {
 			freecon (user_context);
 		}
-		exit(1);
+		exit (E_NOPERM);
 	}
 #endif				/* WITH_SELINUX */
 
@@ -1111,7 +1113,7 @@
 			printf (_("%s: password expiry information changed."), Prog);
 		}
 	}
-	exit (E_SUCCESS);
-	/*@notreached@*/
+
+	return E_SUCCESS;
 }
 

Modified: upstream/trunk/src/pwck.c
===================================================================
--- upstream/trunk/src/pwck.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/pwck.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -51,7 +51,7 @@
 /*
  * Exit codes
  */
-
+/*@-exitarg@*/
 #define	E_OKAY		0
 #define	E_USAGE		1
 #define	E_BADENTRY	2
@@ -707,6 +707,6 @@
 	}
 
 	closelog ();
-	exit ((0 != errors) ? E_BADENTRY : E_OKAY);
+	return ((0 != errors) ? E_BADENTRY : E_OKAY);
 }
 

Modified: upstream/trunk/src/pwconv.c
===================================================================
--- upstream/trunk/src/pwconv.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/pwconv.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -71,9 +71,11 @@
 #include "pwio.h"
 #include "shadowio.h"
 #include "nscd.h"
+
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_NOPERM	1	/* permission denied */
 #define E_USAGE		2	/* invalid command syntax */
@@ -269,6 +271,6 @@
 
 	nscd_flush_cache ("passwd");
 
-	exit (E_SUCCESS);
+	return E_SUCCESS;
 }
 

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/su.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -63,12 +63,14 @@
 #include <sys/types.h>
 #include "prototypes.h"
 #include "defines.h"
-#include "exitcodes.h"
 #include "pwauth.h"
 #include "getdef.h"
 #ifdef USE_PAM
 #include "pam_defs.h"
-#endif
+#endif				/* USE_PAM */
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * Assorted #defines to control su's behavior
  */

Modified: upstream/trunk/src/sulogin.c
===================================================================
--- upstream/trunk/src/sulogin.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/sulogin.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -43,7 +43,9 @@
 #include "getdef.h"
 #include "prototypes.h"
 #include "pwauth.h"
+/*@-exitarg@*/
 #include "exitcodes.h"
+
 /*
  * Global variables
  */
@@ -244,7 +246,7 @@
 #endif
 	/* exec the shell finally. */
 	err = shell (pwent.pw_shell, (char *) 0, environ);
-	exit ((err == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
-	 /*NOTREACHED*/ return (0);
+
+	return ((err == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
 }
 

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/useradd.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -153,6 +153,7 @@
 /*
  * exit status values
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_PW_UPDATE	1	/* can't update password file */
 #define E_USAGE		2	/* invalid command syntax */

Modified: upstream/trunk/src/userdel.c
===================================================================
--- upstream/trunk/src/userdel.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/userdel.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -56,10 +56,12 @@
 #include "pwauth.h"
 #include "pwio.h"
 #include "shadowio.h"
-#include "exitcodes.h"
 #ifdef	SHADOWGRP
 #include "sgroupio.h"
 #endif
+/*@-exitarg@*/
+#include "exitcodes.h"
+
 /*
  * exit status values
  */
@@ -1021,7 +1023,6 @@
 	nscd_flush_cache ("passwd");
 	nscd_flush_cache ("group");
 
-	exit ((0 != errors) ? E_HOMEDIR : E_SUCCESS);
-	/* NOT REACHED */
+	return ((0 != errors) ? E_HOMEDIR : E_SUCCESS);
 }
 

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/usermod.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -63,11 +63,13 @@
 #include "sgroupio.h"
 #endif
 #include "shadowio.h"
+
 /*
  * exit status values
  * for E_GRP_UPDATE and E_NOSPACE (not used yet), other update requests
  * will be implemented (as documented in the Solaris 2.x man page).
  */
+/*@-exitarg@*/
 #define E_SUCCESS	0	/* success */
 #define E_PW_UPDATE	1	/* can't update password file */
 #define E_USAGE		2	/* invalid command syntax */
@@ -1792,8 +1794,7 @@
 			    user_gid, gflg ? user_newgid : user_gid);
 	}
 
-	exit (E_SUCCESS);
-	/* NOT REACHED */
+	return E_SUCCESS;
 }
 
 #ifdef WITH_SELINUX

Modified: upstream/trunk/src/vipw.c
===================================================================
--- upstream/trunk/src/vipw.c	2009-04-30 21:12:33 UTC (rev 2850)
+++ upstream/trunk/src/vipw.c	2009-04-30 21:39:38 UTC (rev 2851)
@@ -29,6 +29,9 @@
 
 #include <errno.h>
 #include <getopt.h>
+#ifdef WITH_SELINUX                                                            
+#include <selinux/selinux.h>                                                   
+#endif
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -37,18 +40,15 @@
 #include <unistd.h>
 #include <utime.h>
 #include "defines.h"
-#include "exitcodes.h"
 #include "groupio.h"
 #include "nscd.h"
 #include "prototypes.h"
 #include "pwio.h"
 #include "sgroupio.h"
 #include "shadowio.h"
+/*@-exitarg@*/
+#include "exitcodes.h"
 
-#ifdef WITH_SELINUX                                                            
-#include <selinux/selinux.h>                                                   
-#endif
-
 #define MSG_WARN_EDIT_OTHER_FILE _( \
 	"You have modified %s.\n"\
 	"You may need to modify %s for consistency.\n"\
@@ -406,6 +406,6 @@
 	nscd_flush_cache ("passwd");
 	nscd_flush_cache ("group");
 
-	exit (E_SUCCESS);
+	return E_SUCCESS;
 }
 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic