summaryrefslogtreecommitdiffstats
path: root/lib/libypclnt
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-04-27 21:58:23 +0000
committerdes <des@FreeBSD.org>2002-04-27 21:58:23 +0000
commit1186b74661db098e0c4e9c8358d77dc50c8dffa2 (patch)
tree6044b09fc256f650cfe6bb22a29df5c9da4ac048 /lib/libypclnt
parenta1a94cce5c09be6d56eb4c83034f03ab93077bbe (diff)
downloadFreeBSD-src-1186b74661db098e0c4e9c8358d77dc50c8dffa2.zip
FreeBSD-src-1186b74661db098e0c4e9c8358d77dc50c8dffa2.tar.gz
Obliterate the new password as well as the old, even if though it's hashed.
Diffstat (limited to 'lib/libypclnt')
-rw-r--r--lib/libypclnt/ypclnt_passwd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libypclnt/ypclnt_passwd.c b/lib/libypclnt/ypclnt_passwd.c
index d766e25..61e6f7b 100644
--- a/lib/libypclnt/ypclnt_passwd.c
+++ b/lib/libypclnt/ypclnt_passwd.c
@@ -178,7 +178,10 @@ yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd)
if (nc != NULL)
freenetconfigent(nc);
free(yppwd.newpw.pw_name);
- free(yppwd.newpw.pw_passwd);
+ if (yppwd.newpw.pw_passwd != NULL) {
+ memset(yppwd.newpw.pw_passwd, 0, strlen(yppwd.newpw.pw_passwd));
+ free(yppwd.newpw.pw_passwd);
+ }
free(yppwd.newpw.pw_class);
free(yppwd.newpw.pw_gecos);
free(yppwd.newpw.pw_dir);
@@ -255,7 +258,10 @@ yppasswd_remote(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd)
clnt_destroy(clnt);
}
free(yppwd.newpw.pw_name);
- free(yppwd.newpw.pw_passwd);
+ if (yppwd.newpw.pw_passwd != NULL) {
+ memset(yppwd.newpw.pw_passwd, 0, strlen(yppwd.newpw.pw_passwd));
+ free(yppwd.newpw.pw_passwd);
+ }
free(yppwd.newpw.pw_gecos);
free(yppwd.newpw.pw_dir);
free(yppwd.newpw.pw_shell);
OpenPOWER on IntegriCloud