Skip to content

Commit 36ab24a

Browse files
lib/pwauth.*: PW_{ADD,CHANGE,DELETE,FTP,REXEC}: Remove dead code
These values aren't being set anywhere. Signed-off-by: Alejandro Colomar <[email protected]>
1 parent e938d47 commit 36ab24a

File tree

2 files changed

+12
-46
lines changed

2 files changed

+12
-46
lines changed

lib/pwauth.c

+12-36
Original file line numberDiff line numberDiff line change
@@ -57,35 +57,14 @@ int pw_auth (const char *cipher,
5757
char *clear = NULL;
5858
const char *cp;
5959
const char *encrypted;
60-
const char *input = NULL;
60+
const char *input;
6161

6262
#ifdef SKEY
6363
bool use_skey = false;
6464
char challenge_info[40];
6565
struct skey skey;
6666
#endif
6767

68-
/*
69-
* There are programs for adding and deleting authentication data.
70-
*/
71-
72-
if ((PW_ADD == reason) || (PW_DELETE == reason)) {
73-
return 0;
74-
}
75-
76-
/*
77-
* WARNING:
78-
*
79-
* When we change a password and we are root, we don't prompt.
80-
* This is so root can change any password without having to
81-
* know it. This is a policy decision that might have to be
82-
* revisited.
83-
*/
84-
85-
if ((PW_CHANGE == reason) && (getuid () == 0)) {
86-
return 0;
87-
}
88-
8968
/*
9069
* WARNING:
9170
*
@@ -120,25 +99,22 @@ int pw_auth (const char *cipher,
12099
#endif
121100

122101
/*
123-
* Prompt for the password as required. FTPD and REXECD both
124-
* get the cleartext password for us.
102+
* Prompt for the password as required.
125103
*/
126104

127-
if ((PW_FTP != reason) && (PW_REXEC != reason)) {
128-
cp = getdef_str ("LOGIN_STRING");
129-
if (NULL == cp) {
130-
cp = _(PROMPT);
131-
}
105+
cp = getdef_str ("LOGIN_STRING");
106+
if (NULL == cp) {
107+
cp = _(PROMPT);
108+
}
132109
#ifdef SKEY
133-
if (use_skey) {
134-
printf ("[%s]\n", challenge_info);
135-
}
110+
if (use_skey) {
111+
printf ("[%s]\n", challenge_info);
112+
}
136113
#endif
137114

138-
SNPRINTF(prompt, cp, user);
139-
clear = agetpass(prompt);
140-
input = (clear == NULL) ? "" : clear;
141-
}
115+
SNPRINTF(prompt, cp, user);
116+
clear = agetpass(prompt);
117+
input = (clear == NULL) ? "" : clear;
142118

143119
/*
144120
* Convert the cleartext password into a ciphertext string.

lib/pwauth.h

-10
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@ int pw_auth (const char *cipher,
2727
#define PW_SU 1
2828
#define PW_LOGIN 2
2929

30-
/*
31-
* Administrative functions
32-
*/
33-
34-
#define PW_ADD 101
35-
#define PW_CHANGE 102
36-
#define PW_DELETE 103
37-
3830
/*
3931
* Network access
4032
*/
4133

4234
#define PW_TELNET 201
4335
#define PW_RLOGIN 202
44-
#define PW_FTP 203
45-
#define PW_REXEC 204
4636

4737
#endif /* _PWAUTH_H */

0 commit comments

Comments
 (0)