Date: Fri, 16 Feb 2018 06:51:39 +0000 (UTC) From: Mike Silbersack <silby@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329362 - head/sbin/savecore Message-ID: <201802160651.w1G6pdoQ093346@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802160651.w1G6pdoQ093346>