From nobody@FreeBSD.org  Tue Mar 25 16:16:30 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2D30F1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Mar 2008 16:16:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 29C208FC29
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Mar 2008 16:16:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m2PGGHJc020963
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Mar 2008 16:16:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m2PGGHuG020962;
	Tue, 25 Mar 2008 16:16:17 GMT
	(envelope-from nobody)
Message-Id: <200803251616.m2PGGHuG020962@www.freebsd.org>
Date: Tue, 25 Mar 2008 16:16:17 GMT
From: Steven Kreuzer <skreuzer@exit2shell.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Zero out pw_passwd in crontab
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122070
>Category:       bin
>Synopsis:       [patch] crontab(1): Zero out pw_passwd in crontab
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 25 16:20:01 UTC 2008
>Closed-Date:    Fri Nov 02 22:19:47 UTC 2012
>Last-Modified:  Fri Nov 02 22:19:47 UTC 2012
>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:
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Lun 8 Set 2008 21:12:39 UTC 
Responsible-Changed-Why:  
Take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122070 
State-Changed-From-To: open->patched 
State-Changed-By: matteo 
State-Changed-When: Gio 6 Nov 2008 05:02:15 UTC 
State-Changed-Why:  
Commited to HEAD. MFC coming in 3 day. Thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122070 
Responsible-Changed-From-To: matteo->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jun 19 04:46:27 UTC 2010 
Responsible-Changed-Why:  
Reset PR assigned to inactive committer. 

Hat:	gnats-admin 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122070 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Fri Nov 2 22:19:46 UTC 2012 
State-Changed-Why:  
MFCed/fixed by now 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122070 
>Unformatted:
