summaryrefslogtreecommitdiffstats
path: root/bin/pax
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2010-08-29 11:56:56 +0000
committerbrian <brian@FreeBSD.org>2010-08-29 11:56:56 +0000
commita8d67237e01bdd6792c4afd32cb56aed6030bbba (patch)
treed627b6ee1647bb2a156585082c4357c0e4cad0ee /bin/pax
parent9112be80d82f5c839a88cf13631c36faca3a85a4 (diff)
downloadFreeBSD-src-a8d67237e01bdd6792c4afd32cb56aed6030bbba.zip
FreeBSD-src-a8d67237e01bdd6792c4afd32cb56aed6030bbba.tar.gz
Correct an out-by-one error when earlying out ustar filenames that
are too long. Filenames escaping this test are caught later on, so the bug doesn't cause any breakage. Document the correct ustar limitations in pax. As I have no access to the IEEE 1003.2 spec, I can only assume that the limitations imposed are in fact correct. Add regression tests for the filename limitations imposed by pax. MFC after: 3 weeks
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/pax.14
-rw-r--r--bin/pax/tar.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/pax/pax.1 b/bin/pax/pax.1
index 373ec9b..58fba13 100644
--- a/bin/pax/pax.1
+++ b/bin/pax/pax.1
@@ -748,7 +748,9 @@ The extended tar interchange format specified in the
.St -p1003.2
standard.
The default blocksize for this format is 10240 bytes.
-Pathnames stored by this format must be 250 characters or less in length.
+Pathnames stored by this format must be 255 characters or less in length.
+The directory part may be at most 155 characters and each path component
+must be less than 100 characters.
.El
.Pp
The
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index e274df4..05e8be5 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -1086,7 +1086,7 @@ name_split(char *name, int len)
*/
if (len <= TNMSZ)
return(name);
- if (len > (TPFSZ + TNMSZ + 1))
+ if (len > TPFSZ + TNMSZ)
return(NULL);
/*
OpenPOWER on IntegriCloud