Commit a8a97bc3 authored by Jim Meyering's avatar Jim Meyering Committed by David Zeuthen
Browse files

(do_auth): rename local: s/buf/password/


Signed-off-by: default avatarJim Meyering <meyering@redhat.com>
Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 83445eb9
......@@ -126,19 +126,19 @@ error:
int do_auth (const char *user_to_auth)
{
struct spwd *shadow;
char buf[256];
char password[256];
if ((shadow = getspnam (user_to_auth)) == NULL)
goto error;
if (fgets (buf, sizeof (buf), stdin) == NULL)
if (fgets (password, sizeof (password), stdin) == NULL)
goto error;
if (strlen (buf) > 0 &&
buf[strlen (buf) - 1] == '\n')
buf[strlen (buf) - 1] = '\0';
if (strlen (password) > 0 &&
password[strlen (password) - 1] == '\n')
password[strlen (password) - 1] = '\0';
if (strcmp (shadow->sp_pwdp, crypt (buf, shadow->sp_pwdp)) != 0)
if (strcmp (shadow->sp_pwdp, crypt (password, shadow->sp_pwdp)) != 0)
goto error;
return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment