From c552e298cb2544520538ae47f1054251b59038b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 27 Apr 2002 21:58:23 +0000 Subject: [PATCH] Obliterate the new password as well as the old, even if though it's hashed. --- lib/libypclnt/ypclnt_passwd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/libypclnt/ypclnt_passwd.c b/lib/libypclnt/ypclnt_passwd.c index d766e25c6fd..61e6f7b3874 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);