svn commit: r247043 - head/usr.sbin/makefs

Brooks Davis brooks at FreeBSD.org
Wed Feb 20 15:28:41 UTC 2013


Author: brooks
Date: Wed Feb 20 15:28:40 2013
New Revision: 247043
URL: http://svnweb.freebsd.org/changeset/base/247043

Log:
  Allow '.' components in manifest paths.  They are always the first
  component of mtree -C and install -M output and are easily skipped.
  
  Reviewed by:	marcel
  Sponsored by:	DARPA, AFRL

Modified:
  head/usr.sbin/makefs/mtree.c

Modified: head/usr.sbin/makefs/mtree.c
==============================================================================
--- head/usr.sbin/makefs/mtree.c	Wed Feb 20 15:25:40 2013	(r247042)
+++ head/usr.sbin/makefs/mtree.c	Wed Feb 20 15:28:40 2013	(r247043)
@@ -974,15 +974,15 @@ read_mtree_spec(FILE *fp)
 		do {
 			*cp++ = '\0';
 
-			/* Disallow '.' and '..' as components. */
-			if (IS_DOT(pathspec) || IS_DOTDOT(pathspec)) {
-				mtree_error("absolute path cannot contain . "
-				    "or .. components");
+			/* Disallow '..' as a component. */
+			if (IS_DOTDOT(pathspec)) {
+				mtree_error("absolute path cannot contain "
+				    ".. component");
 				goto out;
 			}
 
-			/* Ignore multiple adjacent slashes. */
-			if (pathspec[0] != '\0')
+			/* Ignore multiple adjacent slashes and '.'. */
+			if (pathspec[0] != '\0' && !IS_DOT(pathspec))
 				error = read_mtree_spec1(fp, false, pathspec);
 			memmove(pathspec, cp, strlen(cp) + 1);
 			cp = strchr(pathspec, '/');


More information about the svn-src-head mailing list