mirror of git://git.suckless.org/ubase
Only try to ask for a password and check if uid is != 0
This commit is contained in:
parent
56ce9e8bff
commit
86566f4ceb
2
su.c
2
su.c
|
@ -61,7 +61,6 @@ main(int argc, char **argv)
|
|||
pass = getpass("Password: ");
|
||||
if (!pass)
|
||||
eprintf("getpass:");
|
||||
}
|
||||
|
||||
cryptpass = crypt(pass, spw->sp_pwdp);
|
||||
for (i = 0; pass[i]; i++)
|
||||
|
@ -71,6 +70,7 @@ main(int argc, char **argv)
|
|||
|
||||
if (strcmp(cryptpass, spw->sp_pwdp) != 0)
|
||||
enprintf(EXIT_FAILURE, "Denied\n");
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
pw = getpwnam(usr);
|
||||
|
|
Loading…
Reference in New Issue