diff options
Diffstat (limited to 'src/chfn.c')
-rw-r--r-- | src/chfn.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -36,7 +36,7 @@ /* * Global variables. */ -const char *Prog; +static const char Prog[] = "chfn"; static char fullnm[BUFSIZ]; static char roomno[BUFSIZ]; static char workph[BUFSIZ]; @@ -362,7 +362,7 @@ static void check_perms (const struct passwd *pw) * check if the change is allowed by SELinux policy. */ if ((pw->pw_uid != getuid ()) - && (check_selinux_permit ("chfn") != 0)) { + && (check_selinux_permit (Prog) != 0)) { fprintf (stderr, _("%s: Permission denied.\n"), Prog); closelog (); exit (E_NOPERM); @@ -377,7 +377,7 @@ static void check_perms (const struct passwd *pw) * --marekm */ if (!amroot && getdef_bool ("CHFN_AUTH")) { - passwd_check (pw->pw_name, pw->pw_passwd, "chfn"); + passwd_check (pw->pw_name, pw->pw_passwd, Prog); } #else /* !USE_PAM */ @@ -389,7 +389,7 @@ static void check_perms (const struct passwd *pw) exit (E_NOPERM); } - retval = pam_start ("chfn", pampw->pw_name, &conv, &pamh); + retval = pam_start (Prog, pampw->pw_name, &conv, &pamh); if (PAM_SUCCESS == retval) { retval = pam_authenticate (pamh, 0); @@ -616,11 +616,6 @@ int main (int argc, char **argv) char new_gecos[BUFSIZ]; /* buffer for new GECOS fields */ char *user; - /* - * Get the program name. The program name is used as a - * prefix to most error messages. - */ - Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd(stderr); @@ -637,7 +632,7 @@ int main (int argc, char **argv) */ amroot = (getuid () == 0); - OPENLOG ("chfn"); + OPENLOG (Prog); /* parse the command line options */ process_flags (argc, argv); |