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
+3 -2
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);