Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Mar 2008 16:16:17 GMT
From:      Steven Kreuzer <skreuzer@exit2shell.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/122070: Zero out pw_passwd in crontab
Message-ID:  <200803251616.m2PGGHuG020962@www.freebsd.org>
Resent-Message-ID: <200803251620.m2PGK1ZI067653@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         122070
>Category:       bin
>Synopsis:       Zero out pw_passwd in crontab
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 25 16:20:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Steven Kreuzer
>Release:        7.0-BETA4
>Organization:
>Environment:
FreeBSD  7.0-BETA4 FreeBSD 7.0-BETA4 #0: Sun Dec  2 19:19:04 UTC 2007     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
For the sake of being paranoid, the following patch will zero out pw_passwd since its not needed.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: crontab.c
===================================================================
RCS file: /usr/share/cvs/freebsd/src/usr.sbin/cron/crontab/crontab.c,v
retrieving revision 1.25
diff -u -r1.25 crontab.c
--- crontab.c	7 Nov 2007 10:53:34 -0000	1.25
+++ crontab.c	19 Feb 2008 23:23:11 -0000
@@ -138,6 +138,7 @@
 
 	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 @@
 				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;


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803251616.m2PGGHuG020962>