* 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.
This commit is contained in:
nekral-guest 2008-09-06 12:51:53 +00:00
parent 7034a913fd
commit ee4e367ea8
31 changed files with 73 additions and 34 deletions

View File

@ -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,

View 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);

View 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;
}
}

View 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;
}
}

View File

@ -58,7 +58,7 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
static bool
dflg = false, /* set last password change date */

View File

@ -56,7 +56,7 @@
/*
* Global variables.
*/
static char *Prog;
char *Prog;
static char fullnm[BUFSIZ];
static char roomno[BUFSIZ];
static char workph[BUFSIZ];

View File

@ -53,7 +53,7 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
static bool cflg = false;
static bool eflg = false;
static bool md5flg = false;

View File

@ -51,7 +51,7 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
static bool cflg = false;
static bool eflg = false;
static bool md5flg = false;

View 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 */

View File

@ -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,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 ();

View 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

View File

@ -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) */

View File

@ -53,8 +53,9 @@
/*
* Global variables
*/
char *Prog;
static char *group_name;
static char *Prog;
static gid_t group_id = -1;
#ifdef SHADOWGRP

View File

@ -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

View 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 */

View File

@ -42,7 +42,7 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
/* local function prototypes */
static void print_groups (const char *member);

View 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;

View File

@ -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);

View File

@ -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);

View File

@ -105,8 +105,8 @@ static bool preauth_flag = false;
/*
* Global variables.
*/
char *Prog;
static char *Prog;
static bool amroot;
static int timeout;

View 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")

View 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

View 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;

View File

@ -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

View 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;

View File

@ -83,7 +83,8 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
static bool spw_locked = false;
static bool pw_locked = false;

View File

@ -47,7 +47,8 @@
/*
* Global variables
*/
static char *Prog;
char *Prog;
static bool spw_locked = false;
static bool pw_locked = false;

View File

@ -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;
/*

View 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 */

View File

@ -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;

View 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 */