svn commit: r329362 - head/sbin/savecore

Mike Silbersack silby at FreeBSD.org
Fri Feb 16 06:51:40 UTC 2018


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) {


More information about the svn-src-all mailing list