mirror of git://git.suckless.org/ubase
Use explicit_bzero() in su
This commit is contained in:
parent
1920516abf
commit
24d5c07d29
4
su.c
4
su.c
|
@ -35,7 +35,6 @@ main(int argc, char *argv[])
|
||||||
struct spwd *spw;
|
struct spwd *spw;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
int i;
|
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 'l':
|
case 'l':
|
||||||
|
@ -81,8 +80,7 @@ main(int argc, char *argv[])
|
||||||
eprintf("getpass:");
|
eprintf("getpass:");
|
||||||
|
|
||||||
cryptpass = crypt(pass, spw->sp_pwdp);
|
cryptpass = crypt(pass, spw->sp_pwdp);
|
||||||
for (i = 0; pass[i]; i++)
|
explicit_bzero(pass, strlen(pass));
|
||||||
pass[i] = '\0';
|
|
||||||
if (!cryptpass)
|
if (!cryptpass)
|
||||||
eprintf("crypt:");
|
eprintf("crypt:");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue