From owner-svn-src-stable-11@freebsd.org Wed May 31 05:00:03 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2954A922DA; Wed, 31 May 2017 05:00:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82A3030DB; Wed, 31 May 2017 05:00:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4V502el027283; Wed, 31 May 2017 05:00:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4V502ic027282; Wed, 31 May 2017 05:00:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201705310500.v4V502ic027282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 31 May 2017 05:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319275 - stable/11/etc/rc.d X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 05:00:03 -0000 Author: delphij Date: Wed May 31 05:00:02 2017 New Revision: 319275 URL: https://svnweb.freebsd.org/changeset/base/319275 Log: MFC r318975: Tighten /entropy permissions. PR: 219527 Reported by: Lu Tung-Pin Submitted by: jilles Modified: stable/11/etc/rc.d/random Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/random ============================================================================== --- stable/11/etc/rc.d/random Wed May 31 03:44:31 2017 (r319274) +++ stable/11/etc/rc.d/random Wed May 31 05:00:02 2017 (r319275) @@ -20,12 +20,14 @@ saveseed_cmd="${name}_stop" save_dev_random() { + oumask=`umask` + umask 077 for f ; do - if :>>"$f" ; then - debug "saving entropy to $f" - dd if=/dev/random of="$f" bs=4096 count=1 2>/dev/null - fi + debug "saving entropy to $f" + dd if=/dev/random of="$f" bs=4096 count=1 status=none && + chmod 600 "$f" done + umask ${oumask} } feed_dev_random()