[Pkg-shadow-commits] r2348 - in upstream/trunk: . lib libmisc src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Sep 6 12:51:55 UTC 2008


Author: nekral-guest
Date: 2008-09-06 12:51:53 +0000 (Sat, 06 Sep 2008)
New Revision: 2348

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/prototypes.h
   upstream/trunk/libmisc/find_new_gid.c
   upstream/trunk/libmisc/find_new_uid.c
   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/expiry.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/groups.c
   upstream/trunk/src/grpck.c
   upstream/trunk/src/grpconv.c
   upstream/trunk/src/grpunconv.c
   upstream/trunk/src/login.c
   upstream/trunk/src/logoutd.c
   upstream/trunk/src/newgrp.c
   upstream/trunk/src/newusers.c
   upstream/trunk/src/passwd.c
   upstream/trunk/src/pwck.c
   upstream/trunk/src/pwconv.c
   upstream/trunk/src/pwunconv.c
   upstream/trunk/src/su.c
   upstream/trunk/src/useradd.c
   upstream/trunk/src/userdel.c
   upstream/trunk/src/usermod.c
Log:
	* src/newgrp.c, src/userdel.c, src/grpck.c, src/gpasswd.c,
	src/newusers.c, src/pwconv.c, src/chpasswd.c, src/logoutd.c,
	src/chfn.c, src/groupmems.c, src/usermod.c, src/pwunconv.c,
	src/expiry.c, src/groupdel.c, src/chgpasswd.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/grpconv.c,
	src/groups.c, src/grpunconv.c, src/chsh.c: Prog is now global (not
	static to the file) so that it can be used by the helper functions
	of libmisc.
	* lib/prototypes.h: Added extern char *Prog.
	* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Indicate the
	program name with the warning.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/ChangeLog	2008-09-06 12:51:53 UTC (rev 2348)
@@ -1,3 +1,18 @@
+2008-09-06  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* src/newgrp.c, src/userdel.c, src/grpck.c, src/gpasswd.c,
+	src/newusers.c, src/pwconv.c, src/chpasswd.c, src/logoutd.c,
+	src/chfn.c, src/groupmems.c, src/usermod.c, src/pwunconv.c,
+	src/expiry.c, src/groupdel.c, src/chgpasswd.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/grpconv.c,
+	src/groups.c, src/grpunconv.c, src/chsh.c: Prog is now global (not
+	static to the file) so that it can be used by the helper functions
+	of libmisc.
+	* lib/prototypes.h: Added extern char *Prog.
+	* libmisc/find_new_gid.c, libmisc/find_new_uid.c: Indicate the
+	program name with the warning.
+
 2008-09-05  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* configure.in: Check if AUDIT_ADD_USER, AUDIT_DEL_USER,

Modified: upstream/trunk/lib/prototypes.h
===================================================================
--- upstream/trunk/lib/prototypes.h	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/lib/prototypes.h	2008-09-06 12:51:53 UTC (rev 2348)
@@ -57,6 +57,8 @@
 #include "defines.h"
 #include "commonio.h"
 
+extern char *Prog;
+
 /* addgrps.c */
 extern int add_groups (const char *);
 extern void add_cons_grps (void);

Modified: upstream/trunk/libmisc/find_new_gid.c
===================================================================
--- upstream/trunk/libmisc/find_new_gid.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/libmisc/find_new_gid.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -110,7 +110,8 @@
 			}
 		}
 		if (group_id == gid_max) {
-			fputs (_("Can't get unique GID (no more available GIDs)\n"), stderr);
+			fprintf (stderr, _("%s: Can't get unique GID (no more available GIDs)\n"), Prog);
+			SYSLOG ((LOG_WARN, "no more available GID on the system"));
 			return -1;
 		}
 	}

Modified: upstream/trunk/libmisc/find_new_uid.c
===================================================================
--- upstream/trunk/libmisc/find_new_uid.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/libmisc/find_new_uid.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -111,7 +111,8 @@
 			}
 		}
 		if (user_id == uid_max) {
-			fputs (_("Can't get unique UID (no more available UIDs)\n"), stderr);
+			fprintf (stderr, _("Prog: Can't get unique UID (no more available UIDs)\n"), Prog);
+			SYSLOG ((LOG_WARN, "no more available UID on the system"));
 			return -1;
 		}
 	}

Modified: upstream/trunk/src/chage.c
===================================================================
--- upstream/trunk/src/chage.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/chage.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -58,7 +58,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 static bool
     dflg = false,		/* set last password change date */

Modified: upstream/trunk/src/chfn.c
===================================================================
--- upstream/trunk/src/chfn.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/chfn.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -56,7 +56,7 @@
 /*
  * Global variables.
  */
-static char *Prog;
+char *Prog;
 static char fullnm[BUFSIZ];
 static char roomno[BUFSIZ];
 static char workph[BUFSIZ];

Modified: upstream/trunk/src/chgpasswd.c
===================================================================
--- upstream/trunk/src/chgpasswd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/chgpasswd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -53,7 +53,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 static bool cflg   = false;
 static bool eflg   = false;
 static bool md5flg = false;

Modified: upstream/trunk/src/chpasswd.c
===================================================================
--- upstream/trunk/src/chpasswd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/chpasswd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -51,7 +51,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 static bool cflg   = false;
 static bool eflg   = false;
 static bool md5flg = false;

Modified: upstream/trunk/src/chsh.c
===================================================================
--- upstream/trunk/src/chsh.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/chsh.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -59,7 +59,7 @@
 /*
  * Global variables
  */
-static char *Prog;		/* Program name */
+char *Prog;		/* Program name */
 static bool amroot;		/* Real UID is root */
 static char loginsh[BUFSIZ];	/* Name of new login shell */
 /* command line options */

Modified: upstream/trunk/src/expiry.c
===================================================================
--- upstream/trunk/src/expiry.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/expiry.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -40,6 +40,10 @@
 #include <sys/types.h>
 #include "defines.h"
 #include "prototypes.h"
+
+/* Global variables */
+char *Prog;
+
 /* local function prototypes */
 static RETSIGTYPE catch_signals (int);
 static void usage (void);
@@ -70,10 +74,10 @@
 int main (int argc, char **argv)
 {
 	struct passwd *pwd;
-
 	struct spwd *spwd;
-	char *Prog = Basename (argv[0]);
 
+	Prog = Basename (argv[0]);
+
 	sanitize_env ();
 
 	/* 

Modified: upstream/trunk/src/gpasswd.c
===================================================================
--- upstream/trunk/src/gpasswd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/gpasswd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -54,7 +54,7 @@
  * Global variables
  */
 /* The name of this command, as it is invoked */
-static char *Prog;
+char *Prog;
 
 #ifdef SHADOWGRP
 /* Indicate if shadow groups are enabled on the system

Modified: upstream/trunk/src/groupadd.c
===================================================================
--- upstream/trunk/src/groupadd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/groupadd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -68,13 +68,13 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static char *group_name;
 static gid_t group_id;
 static char *group_passwd;
 static char *empty_list = NULL;
 
-static char *Prog;
-
 static bool oflg = false;	/* permit non-unique group ID to be specified with -g */
 static bool gflg = false;	/* ID value for the new group */
 static bool fflg = false;	/* if group already exists, do nothing and exit(0) */

Modified: upstream/trunk/src/groupdel.c
===================================================================
--- upstream/trunk/src/groupdel.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/groupdel.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -53,8 +53,9 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static char *group_name;
-static char *Prog;
 static gid_t group_id = -1;
 
 #ifdef	SHADOWGRP

Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/groupmems.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -64,13 +64,14 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static char *adduser = NULL;
 static char *deluser = NULL;
 static char *thisgroup = NULL;
 static bool purge = false;
 static bool list = false;
 static int exclusive = 0;
-static char *Prog;
 static bool gr_locked = false;
 #ifdef SHADOWGRP
 /* Indicate if shadow groups are enabled on the system

Modified: upstream/trunk/src/groupmod.c
===================================================================
--- upstream/trunk/src/groupmod.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/groupmod.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -66,6 +66,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 #ifdef	SHADOWGRP
 static bool is_shadow_grp;
 static bool sgr_locked = false;
@@ -78,8 +80,6 @@
 static gid_t group_id;
 static gid_t group_newid;
 
-static char *Prog;
-
 static bool
     oflg = false,		/* permit non-unique group ID to be specified with -g */
     gflg = false,		/* new ID value for the group */

Modified: upstream/trunk/src/groups.c
===================================================================
--- upstream/trunk/src/groups.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/groups.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -42,7 +42,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 /* local function prototypes */
 static void print_groups (const char *member);

Modified: upstream/trunk/src/grpck.c
===================================================================
--- upstream/trunk/src/grpck.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/grpck.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -64,7 +64,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static const char *grp_file = GROUP_FILE;
 static bool use_system_grp_file = true;
 

Modified: upstream/trunk/src/grpconv.c
===================================================================
--- upstream/trunk/src/grpconv.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/grpconv.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -53,9 +53,10 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static bool gr_locked  = false;
 static bool sgr_locked = false;
-static char *Prog;
 
 /* local function prototypes */
 static void fail_exit (int status);

Modified: upstream/trunk/src/grpunconv.c
===================================================================
--- upstream/trunk/src/grpunconv.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/grpunconv.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -54,9 +54,10 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static bool gr_locked  = false;
 static bool sgr_locked = false;
-static char *Prog;
 
 /* local function prototypes */
 static void fail_exit (int status);

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/login.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -105,8 +105,8 @@
 /*
  * Global variables.
  */
+char *Prog;
 
-static char *Prog;
 static bool amroot;
 static int timeout;
 

Modified: upstream/trunk/src/logoutd.c
===================================================================
--- upstream/trunk/src/logoutd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/logoutd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -43,7 +43,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 #ifndef DEFAULT_HUP_MESG
 #define DEFAULT_HUP_MESG _("login time exceeded\n\n")

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/newgrp.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -45,6 +45,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 extern char **newenvp;
 extern char **environ;
 
@@ -53,7 +55,6 @@
 static GETGROUPS_T *grouplist;
 #endif
 
-static char *Prog;
 static bool is_newgrp;
 
 #ifdef WITH_AUDIT

Modified: upstream/trunk/src/newusers.c
===================================================================
--- upstream/trunk/src/newusers.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/newusers.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -65,7 +65,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static bool cflg = false;
 static bool rflg = false;	/* create a system account */
 static bool sflg = false;

Modified: upstream/trunk/src/passwd.c
===================================================================
--- upstream/trunk/src/passwd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/passwd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -68,9 +68,10 @@
 /*
  * Global variables
  */
+char *Prog;			/* Program name */
+
 static char *name;		/* The name of user whose password is being changed */
 static char *myname;		/* The current user's name */
-static char *Prog;		/* Program name */
 static bool amroot;		/* The caller's real UID was 0 */
 
 static bool

Modified: upstream/trunk/src/pwck.c
===================================================================
--- upstream/trunk/src/pwck.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/pwck.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -63,8 +63,8 @@
 /*
  * Global variables
  */
+char *Prog;
 
-static char *Prog;
 static const char *pwd_file = PASSWD_FILE;
 static bool use_system_pw_file = true;
 static const char *spw_file = SHADOW_FILE;

Modified: upstream/trunk/src/pwconv.c
===================================================================
--- upstream/trunk/src/pwconv.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/pwconv.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -83,7 +83,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static bool spw_locked = false;
 static bool pw_locked = false;
 

Modified: upstream/trunk/src/pwunconv.c
===================================================================
--- upstream/trunk/src/pwunconv.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/pwunconv.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -47,7 +47,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static bool spw_locked = false;
 static bool pw_locked = false;
 

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/su.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -75,6 +75,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 /* not needed by sulog.c anymore */
 static char name[BUFSIZ];
 static char oldname[BUFSIZ];
@@ -87,7 +89,6 @@
 static bool caught = false;
 #endif
 
-static char *Prog;
 extern struct passwd pwent;
 
 /*

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/useradd.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -79,6 +79,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 /*
  * These defaults are used if there is no defaults file.
  */
@@ -119,8 +121,6 @@
 static long sys_ngroups;
 static bool do_grp_update = false;	/* group files need to be updated */
 
-static char *Prog;
-
 static bool
     bflg = false,		/* new default root of home directory */
     cflg = false,		/* comment (GECOS) field for new account */

Modified: upstream/trunk/src/userdel.c
===================================================================
--- upstream/trunk/src/userdel.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/userdel.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -68,11 +68,16 @@
 #define E_USER_BUSY	8	/* user currently logged in */
 #define E_GRP_UPDATE	10	/* can't update group file */
 #define E_HOMEDIR	12	/* can't remove home directory */
+
+/*
+ * Global variables
+ */
+char *Prog;
+
 static char *user_name;
 static uid_t user_id;
 static char *user_home;
 
-static char *Prog;
 static bool fflg = false;
 static bool rflg = false;
 

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2008-09-04 22:34:20 UTC (rev 2347)
+++ upstream/trunk/src/usermod.c	2008-09-06 12:51:53 UTC (rev 2348)
@@ -82,6 +82,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static char *user_name;
 static char *user_newname;
 static char *user_pass;
@@ -102,8 +104,6 @@
 static long sys_ngroups;
 static char **user_groups;	/* NULL-terminated list */
 
-static char *Prog;
-
 static bool
     aflg = false,		/* append to existing secondary group set */
     cflg = false,		/* new comment (GECOS) field */




More information about the Pkg-shadow-commits mailing list