From owner-svn-src-head@freebsd.org Fri Feb 16 06:51:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62083F1A9A2; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A8A68D67; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E83D1F1C; Fri, 16 Feb 2018 06:51:40 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1G6pd0O093347; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Received: (from silby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G6pdoQ093346; Fri, 16 Feb 2018 06:51:39 GMT (envelope-from silby@FreeBSD.org) Message-Id: <201802160651.w1G6pdoQ093346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: silby set sender to silby@FreeBSD.org using -f From: Mike Silbersack Date: Fri, 16 Feb 2018 06:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329362 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: silby X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 329362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 06:51:40 -0000 Author: silby Date: Fri Feb 16 06:51:39 2018 New Revision: 329362 URL: https://svnweb.freebsd.org/changeset/base/329362 Log: Prevent savecore from reading bounds from the current directory. Rev 244218 removed the requirement that you provide a dump directory when checking if there is a coredump ready to be written. That had the side-effect of causing the bounds file to be read from the current working directory instead of the dump directory. As the bounds file is irrelevant when just checking, the simplest fix is to not read the bounds file when checking. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14383 Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Feb 16 05:48:45 2018 (r329361) +++ head/sbin/savecore/savecore.c Fri Feb 16 06:51:39 2018 (r329362) @@ -172,6 +172,13 @@ getbounds(void) char buf[6]; int ret; + /* + * If we are just checking, then we haven't done a chdir to the dump + * directory and we should not try to read a bounds file. + */ + if (checkfor) + return (0); + ret = 0; if ((fp = fopen("bounds", "r")) == NULL) {