diff options
author | brooks <brooks@FreeBSD.org> | 2013-02-20 15:28:40 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2013-02-20 15:28:40 +0000 |
commit | 327967222614ab8336aa339a369eaed8d05b377e (patch) | |
tree | 4d7455708f7b5e35948cb4ed0dc9a87f7c872862 /usr.sbin | |
parent | 4694fe43306e5877c32c38ad795b292384979060 (diff) | |
download | FreeBSD-src-327967222614ab8336aa339a369eaed8d05b377e.zip FreeBSD-src-327967222614ab8336aa339a369eaed8d05b377e.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/makefs/mtree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 12893df..2f2400a 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -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, '/'); |