mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
Don't strip trailing linear whitespace from passwords.
MFC after: 2 weeks
This commit is contained in:
parent
ebeb3bab5b
commit
e9aa05f18c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132696
@ -275,8 +275,8 @@ query_auth(struct url *URL)
|
||||
fprintf(stderr, "Login: ");
|
||||
if (fgets(URL->user, sizeof URL->user, stdin) == NULL)
|
||||
return (-1);
|
||||
for (i = 0; URL->user[i]; ++i)
|
||||
if (isspace(URL->user[i]))
|
||||
for (i = strlen(URL->user); i >= 0; --i)
|
||||
if (URL->user[i] == '\r' || URL->user[i] == '\n')
|
||||
URL->user[i] = '\0';
|
||||
|
||||
fprintf(stderr, "Password: ");
|
||||
@ -293,10 +293,10 @@ query_auth(struct url *URL)
|
||||
}
|
||||
if (nopwd)
|
||||
return (-1);
|
||||
|
||||
for (i = 0; URL->pwd[i]; ++i)
|
||||
if (isspace(URL->pwd[i]))
|
||||
for (i = strlen(URL->pwd); i >= 0; --i)
|
||||
if (URL->pwd[i] == '\r' || URL->pwd[i] == '\n')
|
||||
URL->pwd[i] = '\0';
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user