]> granicus.if.org Git - shadow/commitdiff
* src/newgrp.c, src/userdel.c, src/grpck.c, src/gpasswd.c,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 6 Sep 2008 12:51:53 +0000 (12:51 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 6 Sep 2008 12:51:53 +0000 (12:51 +0000)
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.

31 files changed:
ChangeLog
lib/prototypes.h
libmisc/find_new_gid.c
libmisc/find_new_uid.c
src/chage.c
src/chfn.c
src/chgpasswd.c
src/chpasswd.c
src/chsh.c
src/expiry.c
src/gpasswd.c
src/groupadd.c
src/groupdel.c
src/groupmems.c
src/groupmod.c
src/groups.c
src/grpck.c
src/grpconv.c
src/grpunconv.c
src/login.c
src/logoutd.c
src/newgrp.c
src/newusers.c
src/passwd.c
src/pwck.c
src/pwconv.c
src/pwunconv.c
src/su.c
src/useradd.c
src/userdel.c
src/usermod.c

index d72f60bc748954322c7f07db3214dbcb615b753b..b1cdb280467f78f05be3a468702e59e19450e13e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-09-06  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * configure.in: Check if AUDIT_ADD_USER, AUDIT_DEL_USER,
index a5adedc10855837b5d8e123af7a2d71b370c49c6..569df12f51b58be5a12337aeb47fc1ae93189ba7 100644 (file)
@@ -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);
index c1f7f0a924209d25ce211b30a0a13abfb96eaca2..7225ce30c086b0d90a4a927964a53c1f4010e9fd 100644 (file)
@@ -110,7 +110,8 @@ int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid)
                        }
                }
                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;
                }
        }
index 7a90420cfc238790da381633286c36aa55cc414d..835b2794f57e5a16a3ad8ac43bd2a3717a9dfa56 100644 (file)
@@ -111,7 +111,8 @@ int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid)
                        }
                }
                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;
                }
        }
index 269c7efe897c6b17657f2c7d494093755e9784b9..43fa925c8d742e6f0ac3bde93db6d163e1f5e9f8 100644 (file)
@@ -58,7 +58,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 static bool
     dflg = false,              /* set last password change date */
index ae4185a594d7373ee0dcb134fc1d3442fbdb3482..9f0f60c059fbac0e931aa84416f432c285c41a8b 100644 (file)
@@ -56,7 +56,7 @@
 /*
  * Global variables.
  */
-static char *Prog;
+char *Prog;
 static char fullnm[BUFSIZ];
 static char roomno[BUFSIZ];
 static char workph[BUFSIZ];
index e0e2fcf6e48db968a15534673f85afa028fd49a1..9262d19b01ea49fcc51e9db85715bc3f3baa374b 100644 (file)
@@ -53,7 +53,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 static bool cflg   = false;
 static bool eflg   = false;
 static bool md5flg = false;
index 422eb7903b1058e17358caf20c5df7724ee84107..723bdfcc1e2720e1d566163486d42d8c6c909efe 100644 (file)
@@ -51,7 +51,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 static bool cflg   = false;
 static bool eflg   = false;
 static bool md5flg = false;
index 7fc8f59a9d2ee4b007c6dfe84d7f745d74c03529..7b64017fd41682a119e4d0c0fbd1e0521b2623bb 100644 (file)
@@ -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 */
index f12a434c95967ccdccb8514e9af294ade5d0eaef..32bb508e40aa99f878defce36cf9f0697ed0ef1f 100644 (file)
 #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,9 +74,9 @@ static void usage (void)
 int main (int argc, char **argv)
 {
        struct passwd *pwd;
-
        struct spwd *spwd;
-       char *Prog = Basename (argv[0]);
+
+       Prog = Basename (argv[0]);
 
        sanitize_env ();
 
index cb12fe9bc9a3044ebbaa713df7784939df7a1ab3..02f367e1a171a8dee5b0050d7ebbb8ed16f698ed 100644 (file)
@@ -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
index ff66293ac3658b680f1302a4ef7fea46c07ea2a5..d509ee70e9c48ae79d69b5c8d7dd4af675e202fd 100644 (file)
 /*
  * 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) */
index 311a81026a35acf1f1ec44c3361aafaea3989080..792450e0b9296b18ecab07c9ffe70773b4e1352f 100644 (file)
@@ -53,8 +53,9 @@
 /*
  * Global variables
  */
+char *Prog;
+
 static char *group_name;
-static char *Prog;
 static gid_t group_id = -1;
 
 #ifdef SHADOWGRP
index f855783903e19bf0043c69b426bbe9034e7af84e..e5ce73d033c194870b6c7e8d894fcad30d6ab1ae 100644 (file)
 /*
  * 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
index 9ea852913c4b65572bfba3490df26bd80adbfa14..3d536dbfef11878da8fd8378db451ade28be562a 100644 (file)
@@ -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 char *group_passwd;
 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 */
index cbb7fc118689b1660f5d4542a024948510a4ee6e..4a1536449c83414658eab63fc2b74fa377c4ab95 100644 (file)
@@ -42,7 +42,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 /* local function prototypes */
 static void print_groups (const char *member);
index ecbeb39cdde353b3c1ef1ed58fee6b7f46dc22dd..877d2b3d65c84609b1c0f35a96b401c6c92134a4 100644 (file)
@@ -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;
 
index f1efeb37dae5fcbd60127ecd06a13ad4117af9b2..18aa265969d98323d534294c9b80baa2c09fe828 100644 (file)
 /*
  * 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);
index 3b7063689041f0deeed2f02373010b9a890ea8b1..f7235295bb656eb5025ddaff3f061a95a2ea29c0 100644 (file)
 /*
  * 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);
index f2f6346e08fade166582f542e65c63c938d246bc..73f6e066fe7b39d0ae7716044a939e2a638dd5af 100644 (file)
@@ -105,8 +105,8 @@ static bool preauth_flag = false;
 /*
  * Global variables.
  */
+char *Prog;
 
-static char *Prog;
 static bool amroot;
 static int timeout;
 
index 078109f44cb9c231b297b0a1bfda313bc450b4b0..5679d127f25e14385d6865d12c00ccb4b05f7a47 100644 (file)
@@ -43,7 +43,7 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
 
 #ifndef DEFAULT_HUP_MESG
 #define DEFAULT_HUP_MESG _("login time exceeded\n\n")
index 82c05789b71ee8a33f9a6ecd228cb3b34f66842e..ab0621fe63e5793749b5943527bb1b640bfd9388 100644 (file)
@@ -45,6 +45,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 extern char **newenvp;
 extern char **environ;
 
@@ -53,7 +55,6 @@ static int ngroups;
 static GETGROUPS_T *grouplist;
 #endif
 
-static char *Prog;
 static bool is_newgrp;
 
 #ifdef WITH_AUDIT
index ce700f0a4c39dd50281ce34d41d85955c332b3c6..4509969049422e24235320372186f1ff0f63faae 100644 (file)
@@ -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;
index e67beb9a0d6bddc86142b11ce606be0bdc2dc326..31adc48d625c242b5d56f7303a0e58699d2b0363 100644 (file)
 /*
  * 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
index 9d5a0c01aad0ba733ad34606c38d24543d9c889c..5b1704cf0927e7dd32d3a50d657d4f19f02353d8 100644 (file)
@@ -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;
index 475c92ae0704a07921a66ad8e1f10fe9cee7b2b6..262343d3d6da092e64d61c56cc056c2f39b66c8e 100644 (file)
@@ -83,7 +83,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static bool spw_locked = false;
 static bool pw_locked = false;
 
index c0f49be3eeb16d25a5f23e2ea115c7e46afdff2a..5825f9dfbfdfa988bf9d93296de66409749e5797 100644 (file)
@@ -47,7 +47,8 @@
 /*
  * Global variables
  */
-static char *Prog;
+char *Prog;
+
 static bool spw_locked = false;
 static bool pw_locked = false;
 
index 7a16dbffd0f13c396ca670c4bc771456626bf671..084e33b15219d3b830d234befdd575c33b74922f 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -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 pam_handle_t *pamh = NULL;
 static bool caught = false;
 #endif
 
-static char *Prog;
 extern struct passwd pwent;
 
 /*
index 993f76352d987c4398fa09c4c61755f596c10f49..e3efcb7e9dc4d37ef956f2b718d2941fdda469cb 100644 (file)
@@ -79,6 +79,8 @@
 /*
  * Global variables
  */
+char *Prog;
+
 /*
  * These defaults are used if there is no defaults file.
  */
@@ -119,8 +121,6 @@ static char **user_groups;  /* NULL-terminated list */
 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 */
index f9a1a09c9189bca0422f21d869efd32caa8c6928..3a8862db688350bf4aa790e42652a707cefd6488 100644 (file)
 #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;
 
index e3aeb56ce7b413d469d97394a0e20f2882c8a1d9..ca1a7688a46eb0aec5ff8d3321f0c6368b532e94 100644 (file)
@@ -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 user_newinactive;
 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 */