Module Name:    src
Committed By:   martin
Date:           Sat Jun 27 09:56:54 UTC 2015

Modified Files:
        src/usr.sbin/postinstall: postinstall

Log Message:
Terminate the obsole directory walking loop when we hit "/" or "."
(both relative to DESTDIR), I have seen it run into an endless loop with
_path=. when invoked from the top level make with some (valid) args.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/usr.sbin/postinstall/postinstall

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.191 src/usr.sbin/postinstall/postinstall:1.192
--- src/usr.sbin/postinstall/postinstall:1.191	Tue Mar 31 07:57:57 2015
+++ src/usr.sbin/postinstall/postinstall	Sat Jun 27 09:56:54 2015
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.191 2015/03/31 07:57:57 martin Exp $
+# $NetBSD: postinstall,v 1.192 2015/06/27 09:56:54 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -500,7 +500,7 @@ file_exists_exact()
 	_path="${1#.}"
 	[ -h "${DEST_DIR}${_path}" ] || \
         	[ -e "${DEST_DIR}${_path}" ] || return 1
-	while [ "${_path}" != "/" ] ; do
+	while [ "${_path}" != "/" -a "${_path}" != "." ] ; do
 		_dirname="$(dirname "${_path}" 2>/dev/null)"
 		_basename="$(basename "${_path}" 2>/dev/null)"
 		ls -fa "${DEST_DIR}${_dirname}" 2> /dev/null \

Reply via email to