We don't read the parameter at all. Remove it.
As a consequence, all the PW_* constants are also removed (as they are
now unused).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
}
#ifdef HAS_SHADOW
if ((pw->pw_passwd && pw->pw_passwd[0] == '@'
- && pw_auth (pw->pw_passwd+1, pw->pw_name, PW_LOGIN))
+ && pw_auth(pw->pw_passwd+1, pw->pw_name))
|| !valid (passwd, pw)) {
return (UPAP_AUTHNAK);
}
* compared.
*/
-int pw_auth (const char *cipher,
- const char *user,
- int reason)
+int
+pw_auth(const char *cipher, const char *user)
{
int retval;
char prompt[1024];
* SPDX-License-Identifier: BSD-3-Clause
*/
-/*
- * $Id$
- */
-
#ifndef _PWAUTH_H
#define _PWAUTH_H
#ifndef USE_PAM
-int pw_auth (const char *cipher,
- const char *user,
- int flag);
+int pw_auth(const char *cipher, const char *user);
#endif /* !USE_PAM */
-/*
- * Local access
- */
-
-#define PW_SU 1
-#define PW_LOGIN 2
-
-/*
- * Network access
- */
-
-#define PW_TELNET 201
-#define PW_RLOGIN 202
-
#endif /* _PWAUTH_H */
if (NULL != sp) {
passwd = sp->sp_pwdp;
}
- if (pw_auth(passwd, user, PW_LOGIN) != 0) {
+ if (pw_auth(passwd, user) != 0) {
SYSLOG ((LOG_WARN, "incorrect password for `%s'", user));
(void) sleep (1);
fprintf (log_get_logfd(), _("Incorrect password for %s.\n"), user);
static const char *hostname = "";
static /*@null@*/ /*@only@*/char *username = NULL;
-static int reason = PW_LOGIN;
#ifndef USE_PAM
#ifdef ENABLE_LASTLOG
case 'h':
hflg = true;
hostname = optarg;
- reason = PW_TELNET;
break;
case 'p':
pflg = true;
if (fflg) {
preauth_flag = true;
}
- if (hflg) {
- reason = PW_RLOGIN;
- }
OPENLOG (Prog);
goto auth_ok;
}
- if (pw_auth(user_passwd, username, reason) == 0) {
+ if (pw_auth(user_passwd, username) == 0) {
goto auth_ok;
}
* all). --marekm
*/
if (streq(user_passwd, "")) {
- pw_auth("!", username, reason);
+ pw_auth("!", username);
}
/*
* The first character of an administrator defined method is an '@'
* character.
*/
- if (pw_auth(password, name, PW_SU) != 0) {
+ if (pw_auth(password, name) != 0) {
SYSLOG (((pw->pw_uid != 0)? LOG_NOTICE : LOG_WARN,
"Authentication failed for %s", name));
fprintf(stderr, _("%s: Authentication failure\n"), Prog);