From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 04:53:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94DB106567B; Thu, 6 Nov 2008 04:53:02 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EC18FC1F; Thu, 6 Nov 2008 04:53:02 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA64r2ku045758; Thu, 6 Nov 2008 04:53:02 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA64r24k045757; Thu, 6 Nov 2008 04:53:02 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811060453.mA64r24k045757@svn.freebsd.org> From: Matteo Riondato Date: Thu, 6 Nov 2008 04:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184706 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 04:53:02 -0000 Author: matteo Date: Thu Nov 6 04:53:02 2008 New Revision: 184706 URL: http://svn.freebsd.org/changeset/base/184706 Log: Be paranoid and zero out passwd PR: 122070 Submitted by: Steven Kreuzer Reminded by: gnn@ MFC after: 3 days Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Thu Nov 6 04:51:09 2008 (r184705) +++ head/usr.sbin/cron/crontab/crontab.c Thu Nov 6 04:53:02 2008 (r184706) @@ -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;