From: Alejandro Colomar Date: Wed, 29 Jan 2025 16:21:33 +0000 (+0100) Subject: lib/pwauth.*: PW_{ADD,CHANGE,DELETE,FTP,REXEC}: Remove dead code X-Git-Tag: 4.17.3~27 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e8d7bf4709e596cbc3f1f84d9e6caa40eaf6871;p=thirdparty%2Fshadow.git lib/pwauth.*: PW_{ADD,CHANGE,DELETE,FTP,REXEC}: Remove dead code These values aren't being set anywhere. Reviewed-by: Sam James Signed-off-by: Alejandro Colomar --- diff --git a/lib/pwauth.c b/lib/pwauth.c index 93ea546a6..6ff20888d 100644 --- a/lib/pwauth.c +++ b/lib/pwauth.c @@ -54,10 +54,10 @@ int pw_auth (const char *cipher, { int retval; char prompt[1024]; - char *clear = NULL; + char *clear; const char *cp; const char *encrypted; - const char *input = NULL; + const char *input; #ifdef SKEY bool use_skey = false; @@ -65,27 +65,6 @@ int pw_auth (const char *cipher, struct skey skey; #endif - /* - * There are programs for adding and deleting authentication data. - */ - - if ((PW_ADD == reason) || (PW_DELETE == reason)) { - return 0; - } - - /* - * WARNING: - * - * When we change a password and we are root, we don't prompt. - * This is so root can change any password without having to - * know it. This is a policy decision that might have to be - * revisited. - */ - - if ((PW_CHANGE == reason) && (getuid () == 0)) { - return 0; - } - /* * WARNING: * @@ -120,25 +99,22 @@ int pw_auth (const char *cipher, #endif /* - * Prompt for the password as required. FTPD and REXECD both - * get the cleartext password for us. + * Prompt for the password as required. */ - if ((PW_FTP != reason) && (PW_REXEC != reason)) { - cp = getdef_str ("LOGIN_STRING"); - if (NULL == cp) { - cp = _(PROMPT); - } + cp = getdef_str ("LOGIN_STRING"); + if (NULL == cp) { + cp = _(PROMPT); + } #ifdef SKEY - if (use_skey) { - printf ("[%s]\n", challenge_info); - } + if (use_skey) { + printf ("[%s]\n", challenge_info); + } #endif - SNPRINTF(prompt, cp, user); - clear = agetpass(prompt); - input = (clear == NULL) ? "" : clear; - } + SNPRINTF(prompt, cp, user); + clear = agetpass(prompt); + input = (clear == NULL) ? "" : clear; /* * Convert the cleartext password into a ciphertext string. diff --git a/lib/pwauth.h b/lib/pwauth.h index 65def0a40..405b3ed94 100644 --- a/lib/pwauth.h +++ b/lib/pwauth.h @@ -27,21 +27,11 @@ int pw_auth (const char *cipher, #define PW_SU 1 #define PW_LOGIN 2 -/* - * Administrative functions - */ - -#define PW_ADD 101 -#define PW_CHANGE 102 -#define PW_DELETE 103 - /* * Network access */ #define PW_TELNET 201 #define PW_RLOGIN 202 -#define PW_FTP 203 -#define PW_REXEC 204 #endif /* _PWAUTH_H */