From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:28:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4D85537B; Wed, 20 Feb 2013 15:28:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F30BAFF; Wed, 20 Feb 2013 15:28:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KFSfiF022277; Wed, 20 Feb 2013 15:28:41 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KFSfLd022276; Wed, 20 Feb 2013 15:28:41 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302201528.r1KFSfLd022276@svn.freebsd.org> From: Brooks Davis Date: Wed, 20 Feb 2013 15:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247043 - head/usr.sbin/makefs X-SVN-Group: head 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.14 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: Wed, 20 Feb 2013 15:28:41 -0000 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, '/');