Date: Wed, 20 Feb 2013 15:28:41 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247043 - head/usr.sbin/makefs Message-ID: <201302201528.r1KFSfLd022276@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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, '/');
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302201528.r1KFSfLd022276>