mirror of
https://github.com/sheumann/telnetd.git
synced 2024-10-31 12:04:35 +00:00
Make the PAM user-override actually override the correect thing.
git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@76751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
This commit is contained in:
parent
b33b21628e
commit
9c526f75a3
@ -574,7 +574,7 @@ auth_conv(int num_msg, const struct pam_message **msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The PAM version as a side effect may put a new username in *user.
|
* The PAM version as a side effect may put a new username in *name.
|
||||||
*/
|
*/
|
||||||
int check_user(const char *name, const char *pass)
|
int check_user(const char *name, const char *pass)
|
||||||
{
|
{
|
||||||
@ -623,11 +623,11 @@ int check_user(const char *name, const char *pass)
|
|||||||
*/
|
*/
|
||||||
if ((e = pam_get_item(pamh, PAM_USER, &item)) ==
|
if ((e = pam_get_item(pamh, PAM_USER, &item)) ==
|
||||||
PAM_SUCCESS) {
|
PAM_SUCCESS) {
|
||||||
strcpy(user, (const char *) item);
|
strcpy(name, (const char *) item);
|
||||||
} else
|
} else
|
||||||
syslog(LOG_ERR, "Couldn't get PAM_USER: %s",
|
syslog(LOG_ERR, "Couldn't get PAM_USER: %s",
|
||||||
pam_strerror(pamh, e));
|
pam_strerror(pamh, e));
|
||||||
if (isroot(user) && !rootterm(line))
|
if (isroot(name) && !rootterm(line))
|
||||||
rval = 0;
|
rval = 0;
|
||||||
else
|
else
|
||||||
rval = 1;
|
rval = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user