diff options
author | matteo <matteo@FreeBSD.org> | 2008-11-06 04:53:02 +0000 |
---|---|---|
committer | matteo <matteo@FreeBSD.org> | 2008-11-06 04:53:02 +0000 |
commit | f1225346f40c168eabf5db8887c0540a1e12f105 (patch) | |
tree | 7b017d1bce302a53d1c3b1612eae5b510580be90 /usr.sbin/cron/crontab/crontab.c | |
parent | 63117b74b14bcc55f35b13d1ad2a0d48521e8b74 (diff) | |
download | FreeBSD-src-f1225346f40c168eabf5db8887c0540a1e12f105.zip FreeBSD-src-f1225346f40c168eabf5db8887c0540a1e12f105.tar.gz |
Be paranoid and zero out passwd
PR: 122070
Submitted by: Steven Kreuzer <skreuzer@exit2shell.com>
Reminded by: gnn@
MFC after: 3 days
Diffstat (limited to 'usr.sbin/cron/crontab/crontab.c')
-rw-r--r-- | usr.sbin/cron/crontab/crontab.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c index 17206cb..4cdf301 100644 --- a/usr.sbin/cron/crontab/crontab.c +++ b/usr.sbin/cron/crontab/crontab.c @@ -138,6 +138,7 @@ parse_args(argc, argv) if (!(pw = getpwuid(getuid()))) errx(ERROR_EXIT, "your UID isn't in the passwd file, bailing out"); + bzero(pw->pw_passwd, strlen(pw->pw_passwd)); (void) strncpy(User, pw->pw_name, (sizeof User)-1); User[(sizeof User)-1] = '\0'; strcpy(RealUser, User); @@ -154,6 +155,7 @@ parse_args(argc, argv) errx(ERROR_EXIT, "must be privileged to use -u"); if (!(pw = getpwnam(optarg))) errx(ERROR_EXIT, "user `%s' unknown", optarg); + bzero(pw->pw_passwd, strlen(pw->pw_passwd)); (void) strncpy(User, pw->pw_name, (sizeof User)-1); User[(sizeof User)-1] = '\0'; break; |