Make shadow_logfd and Prog not extern

Closes #444
Closes #465

Signed-off-by: Serge Hallyn <serge@hallyn.com>
This commit is contained in:
Serge Hallyn
2021-11-28 17:37:53 -06:00
parent b8c67c320c
commit 79157cbad8
79 changed files with 371 additions and 217 deletions

View File

@@ -52,6 +52,7 @@
#include "defines.h"
#include "pwio.h"
#include "shadowio.h"
#include "shadowlog.h"
#ifdef WITH_TCB
#include "tcbfuncs.h"
#endif
@@ -62,7 +63,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool
dflg = false, /* set last password change date */
@@ -815,7 +815,8 @@ int main (int argc, char **argv)
* Get the program name so that error messages can use it.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
sanitize_env ();
(void) setlocale (LC_ALL, "");

View File

@@ -16,9 +16,9 @@
#include "prototypes.h"
#include "subordinateio.h"
#include "idmapping.h"
#include "shadowlog.h"
const char *Prog;
FILE *shadow_logfd = NULL;
int main(int argc, char **argv)
{
@@ -26,7 +26,8 @@ int main(int argc, char **argv)
unsigned long start, count;
bool check_uids;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc != 5)
exit(1);

View File

@@ -52,12 +52,12 @@
#include "pwio.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables.
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char fullnm[BUFSIZ];
static char roomno[BUFSIZ];
static char workph[BUFSIZ];
@@ -640,7 +640,8 @@ int main (int argc, char **argv)
* prefix to most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
sanitize_env ();
(void) setlocale (LC_ALL, "");

View File

@@ -54,12 +54,12 @@
#endif
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool eflg = false;
static bool md5flg = false;
#if defined(USE_SHA_CRYPT) || defined(USE_BCRYPT) || defined(USE_YESCRYPT)
@@ -438,7 +438,8 @@ int main (int argc, char **argv)
int line = 0;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -51,12 +51,12 @@
#include "shadowio.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool eflg = false;
static bool md5flg = false;
#if defined(USE_SHA_CRYPT) || defined(USE_BCRYPT) || defined(USE_YESCRYPT)
@@ -430,7 +430,8 @@ int main (int argc, char **argv)
int line = 0;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -51,6 +51,7 @@
#endif
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
#ifndef SHELLS_FILE
#define SHELLS_FILE "/etc/shells"
@@ -59,7 +60,6 @@
* Global variables
*/
const char *Prog; /* Program name */
FILE *shadow_logfd = NULL;
static bool amroot; /* Real UID is root */
static char loginsh[BUFSIZ]; /* Name of new login shell */
/* command line options */
@@ -442,7 +442,8 @@ int main (int argc, char **argv)
* most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -43,10 +43,10 @@
#include "prototypes.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/* Global variables */
const char *Prog;
FILE *shadow_logfd = NULL;
static bool cflg = false;
/* local function prototypes */
@@ -145,7 +145,8 @@ int main (int argc, char **argv)
struct spwd *spwd;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
sanitize_env ();

View File

@@ -46,6 +46,7 @@
#include "prototypes.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/* local function prototypes */
static /*@noreturn@*/void usage (int status);
@@ -62,7 +63,6 @@ static void reset (void);
* Global variables
*/
const char *Prog; /* Program name */
FILE *shadow_logfd = NULL;
static FILE *fail; /* failure file stream */
static time_t seconds; /* that number of days in seconds */
static unsigned long umin; /* if uflg and has_umin, only display users with uid >= umin */
@@ -574,7 +574,8 @@ int main (int argc, char **argv)
* most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -3,11 +3,11 @@
#include "subid.h"
#include "stdlib.h"
#include "prototypes.h"
#include "shadowlog.h"
/* Test program for the subid freeing routine */
const char *Prog;
FILE *shadow_logfd = NULL;
void usage(void)
{
@@ -24,7 +24,8 @@ int main(int argc, char *argv[])
bool group = false; // get subuids by default
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
while ((c = getopt(argc, argv, "g")) != EOF) {
switch(c) {
case 'g': group = true; break;

View File

@@ -2,9 +2,9 @@
#include "subid.h"
#include "stdlib.h"
#include "prototypes.h"
#include "shadowlog.h"
const char *Prog;
FILE *shadow_logfd = NULL;
void usage(void)
{
@@ -20,7 +20,8 @@ int main(int argc, char *argv[])
uid_t *uids;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc < 2) {
usage();
}

View File

@@ -3,9 +3,9 @@
#include <stdlib.h>
#include "subid.h"
#include "prototypes.h"
#include "shadowlog.h"
const char *Prog;
FILE *shadow_logfd = NULL;
void usage(void)
{
@@ -22,7 +22,8 @@ int main(int argc, char *argv[])
const char *owner;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc < 2)
usage();
owner = argv[1];

View File

@@ -53,12 +53,12 @@
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
/* The name of this command, as it is invoked */
const char *Prog;
FILE *shadow_logfd = NULL;
#ifdef SHADOWGRP
/* Indicate if shadow groups are enabled on the system
@@ -989,7 +989,8 @@ int main (int argc, char **argv)
*/
bywho = getuid ();
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
OPENLOG ("gpasswd");
setbuf (stdout, NULL);

View File

@@ -56,6 +56,7 @@
#ifdef SHADOWGRP
#include "sgroupio.h"
#endif
#include "shadowlog.h"
/*
* exit status values
@@ -72,7 +73,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static /*@null@*/char *group_name;
static gid_t group_id;
@@ -599,7 +599,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -54,11 +54,11 @@
#ifdef SHADOWGRP
#include "sgroupio.h"
#endif
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char *group_name;
static gid_t group_id = -1;
@@ -377,7 +377,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -47,6 +47,7 @@
#ifdef SHADOWGRP
#include "sgroupio.h"
#endif
#include "shadowlog.h"
/* Exit Status Values */
/*@-exitarg@*/
@@ -65,7 +66,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char *adduser = NULL;
static char *deluser = NULL;
@@ -596,7 +596,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -56,6 +56,7 @@
#ifdef SHADOWGRP
#include "sgroupio.h"
#endif
#include "shadowlog.h"
/*
* exit status values
*/
@@ -76,7 +77,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
#ifdef SHADOWGRP
static bool is_shadow_grp;
@@ -793,7 +793,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -39,11 +39,11 @@
#include <stdio.h>
#include "defines.h"
#include "prototypes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
/* local function prototypes */
static void print_groups (const char *member);
@@ -127,7 +127,8 @@ int main (int argc, char **argv)
* Get the program name so that error messages can use it.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc == 1) {

View File

@@ -45,6 +45,7 @@
#include "nscd.h"
#include "sssd.h"
#include "prototypes.h"
#include "shadowlog.h"
#ifdef SHADOWGRP
#include "sgroupio.h"
@@ -66,7 +67,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static const char *grp_file = GROUP_FILE;
static bool use_system_grp_file = true;
@@ -841,7 +841,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -55,11 +55,11 @@
#ifdef SHADOWGRP
#include "groupio.h"
#include "sgroupio.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool gr_locked = false;
static bool sgr_locked = false;
@@ -147,7 +147,8 @@ int main (int argc, char **argv)
struct sgrp sgent;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -55,11 +55,11 @@
#ifdef SHADOWGRP
#include "groupio.h"
#include "sgroupio.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool gr_locked = false;
static bool sgr_locked = false;
@@ -146,7 +146,8 @@ int main (int argc, char **argv)
const struct sgrp *sg;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -50,6 +50,7 @@
#include "getdef.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Needed for MkLinux DR1/2/2.1 - J.
@@ -62,7 +63,6 @@
* Global variables
*/
const char *Prog; /* Program name */
FILE *shadow_logfd = NULL;
static FILE *lastlogfile; /* lastlog file stream */
static unsigned long umin; /* if uflg and has_umin, only display users with uid >= umin */
static bool has_umin = false;
@@ -318,7 +318,8 @@ int main (int argc, char **argv)
* most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -53,6 +53,7 @@
#include "pwauth.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
#ifdef USE_PAM
#include "pam_defs.h"
@@ -83,7 +84,6 @@ static pam_handle_t *pamh = NULL;
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static const char *hostname = "";
static /*@null@*/ /*@only@*/char *username = NULL;
@@ -578,7 +578,8 @@ int main (int argc, char **argv)
amroot = (getuid () == 0);
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
if (geteuid() != 0) {
fprintf (stderr, _("%s: Cannot possibly work without effective root\n"), Prog);

View File

@@ -40,11 +40,11 @@
#include <sys/types.h>
#include "defines.h"
#include "prototypes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
#ifndef DEFAULT_HUP_MESG
#define DEFAULT_HUP_MESG _("login time exceeded\n\n")
@@ -188,7 +188,8 @@ int main (int argc, char **argv)
* Start syslogging everything
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
OPENLOG ("logoutd");

View File

@@ -3,11 +3,11 @@
#include "subid.h"
#include "stdlib.h"
#include "prototypes.h"
#include "shadowlog.h"
/* Test program for the subid creation routine */
const char *Prog;
FILE *shadow_logfd = NULL;
void usage(void)
{
@@ -27,7 +27,8 @@ int main(int argc, char *argv[])
bool ok;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
while ((c = getopt(argc, argv, "gn")) != EOF) {
switch(c) {
case 'n': makenew = true; break;

View File

@@ -41,12 +41,12 @@
#include "subordinateio.h"
#include "getdef.h"
#include "idmapping.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool verify_range(struct passwd *pw, struct map_range *range, bool *allow_setgroups)
@@ -177,7 +177,8 @@ int main(int argc, char **argv)
bool allow_setgroups = false;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
/*
* The valid syntax are

View File

@@ -44,12 +44,12 @@
#include "prototypes.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
extern char **newenvp;
extern char **environ;
@@ -445,7 +445,8 @@ int main (int argc, char **argv)
* don't need to re-exec anything. -- JWP
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
is_newgrp = (strcmp (Prog, "newgrp") == 0);
OPENLOG (is_newgrp ? "newgrp" : "sg");
argc--;

View File

@@ -41,12 +41,12 @@
#include "subordinateio.h"
#include "getdef.h"
#include "idmapping.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool verify_range(struct passwd *pw, struct map_range *range)
{
@@ -107,7 +107,8 @@ int main(int argc, char **argv)
int written;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
/*
* The valid syntax are

View File

@@ -70,12 +70,12 @@
#include "subordinateio.h"
#endif /* ENABLE_SUBIDS */
#include "chkname.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool rflg = false; /* create a system account */
#ifndef USE_PAM
@@ -1071,7 +1071,8 @@ int main (int argc, char **argv)
#endif /* USE_PAM */
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -50,6 +50,7 @@
#include "pwauth.h"
#include "pwio.h"
#include "shadowio.h"
#include "shadowlog.h"
/*
* exit status values
@@ -66,7 +67,6 @@
* Global variables
*/
const char *Prog; /* Program name */
FILE *shadow_logfd = NULL;
static char *name; /* The name of user whose password is being changed */
static char *myname; /* The current user's name */
@@ -761,7 +761,8 @@ int main (int argc, char **argv)
* most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -52,6 +52,7 @@
#ifdef WITH_TCB
#include "tcbfuncs.h"
#endif /* WITH_TCB */
#include "shadowlog.h"
/*
* Exit codes
@@ -70,7 +71,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool use_system_pw_file = true;
static bool use_system_spw_file = true;
@@ -857,7 +857,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -73,6 +73,7 @@
#include "shadowio.h"
#include "nscd.h"
#include "sssd.h"
#include "shadowlog.h"
/*
* exit status values
@@ -89,7 +90,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool spw_locked = false;
static bool pw_locked = false;
@@ -177,7 +177,8 @@ int main (int argc, char **argv)
struct spwd spent;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -48,12 +48,12 @@
#include "shadowio.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static bool spw_locked = false;
static bool pw_locked = false;
@@ -138,7 +138,8 @@ int main (int argc, char **argv)
const struct spwd *spwd;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -77,12 +77,12 @@
#endif /* USE_PAM */
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static /*@observer@*/const char *caller_tty = NULL; /* Name of tty SU is run from */
static bool caller_is_root = false;
static uid_t caller_uid;
@@ -734,7 +734,8 @@ static void save_caller_context (char **argv)
* most error messages.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
caller_uid = getuid ();
caller_is_root = (caller_uid == 0);

View File

@@ -45,12 +45,12 @@
#include "pwauth.h"
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
/*
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char name[BUFSIZ];
static char pass[BUFSIZ];
@@ -107,7 +107,8 @@ static RETSIGTYPE catch_signals (unused int sig)
#endif
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);

View File

@@ -78,6 +78,7 @@
#ifdef WITH_TCB
#include "tcbfuncs.h"
#endif
#include "shadowlog.h"
#ifndef SKEL_DIR
#define SKEL_DIR "/etc/skel"
@@ -96,7 +97,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
/*
* These defaults are used if there is no defaults file.
@@ -2459,7 +2459,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -72,6 +72,7 @@
#ifdef ENABLE_SUBIDS
#include "subordinateio.h"
#endif /* ENABLE_SUBIDS */
#include "shadowlog.h"
/*
* exit status values
@@ -91,7 +92,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char *user_name;
static uid_t user_id;
@@ -1016,7 +1016,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);

View File

@@ -74,6 +74,7 @@
#ifdef WITH_TCB
#include "tcbfuncs.h"
#endif
#include "shadowlog.h"
/*
* exit status values
@@ -105,7 +106,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static char *user_name;
static char *user_newname;
@@ -2181,7 +2181,8 @@ int main (int argc, char **argv)
* Get my name so that I can use it to report errors.
*/
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);

View File

@@ -53,6 +53,7 @@
#include <tcb.h>
#include "tcbfuncs.h"
#endif /* WITH_TCB */
#include "shadowlog.h"
#define MSG_WARN_EDIT_OTHER_FILE _( \
"You have modified %s.\n"\
@@ -63,7 +64,6 @@
* Global variables
*/
const char *Prog;
FILE *shadow_logfd = NULL;
static const char *filename, *fileeditname;
static bool filelocked = false;
@@ -485,7 +485,8 @@ int main (int argc, char **argv)
bool do_vipw;
Prog = Basename (argv[0]);
shadow_logfd = stderr;
log_set_progname(Prog);
log_set_logfd(stderr);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);