OpenBSD CVS

CVS log for src/bin/pax/ftree.c


[BACK] Up to [local] / src / bin / pax

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.42 / (download) - annotate - [select for diffs], Fri Jun 28 13:34:59 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Sep 16 07:42:34 2017 UTC (6 years, 8 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Carefully add casts to silence clang sign-compare warnings. ok millert@

Revision 1.40 / (download) - annotate - [select for diffs], Fri Aug 26 04:17:48 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.39: +19 -7 lines
Diff to previous 1.39 (colored)

ftree.h is only used by ftree.c; merge it into the .c file
<sys/time.h> is unnecessary; sort #includes

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jun 3 23:22:20 2016 UTC (8 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

new style overlords say to use continue in empty loops.
this is easier to see and self documenting.
ok openbsd

Revision 1.32.4.1 / (download) - annotate - [select for diffs], Thu Apr 30 19:30:57 2015 UTC (9 years, 1 month ago) by guenther
Branch: OPENBSD_5_6
Changes since 1.32: +4 -6 lines
Diff to previous 1.32 (colored) next main 1.33 (colored)

Backport trunk commit of 2015/03/09 04:23:29:
tar/pax/cpio had multiple issues:
 * extracting a malicious archive could create files outside of the
   current directory without using pre-existing symlinks to 'escape',
   and could change the timestamps and modes on preexisting files
 * tar without -P would permit extraction of paths with ".." components
 * there was a buffer overflow in the handling of pax extension headers

Revision 1.36.2.1 / (download) - annotate - [select for diffs], Thu Apr 30 19:28:46 2015 UTC (9 years, 1 month ago) by guenther
Branch: OPENBSD_5_7
Changes since 1.36: +4 -6 lines
Diff to previous 1.36 (colored) next main 1.37 (colored)

Backport trunk commit of 2015/03/09 04:23:29:
tar/pax/cpio had multiple issues:
 * extracting a malicious archive could create files outside of the
   current directory without using pre-existing symlinks to 'escape',
   and could change the timestamps and modes on preexisting files
 * tar without -P would permit extraction of paths with ".." components
 * there was a buffer overflow in the handling of pax extension headers

Revision 1.38 / (download) - annotate - [select for diffs], Thu Mar 19 05:14:24 2015 UTC (9 years, 2 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Use struct timespec internally.  This gives nanosecond precision to pax -rw
and a basis for support of mtime and atime values in pax-format extended
header records.

ok millert@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Mar 9 04:23:29 2015 UTC (9 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.36: +4 -6 lines
Diff to previous 1.36 (colored)

Unrevert post-unlock:
* Prevent an archive from esacaping the current directory by itself:
  when extracting a symlink whose value is absolute or contains ".."
  components, just create a zero-length normal file (with additional
  tracking of the mode and hardlinks to the symlink) until everything
  else is extracted, then go back and replace it with the requested
  link (if it's still that zero-length placeholder).

* For tar without -P, if a path in the archive has any ".." components
  then strip everything up to and including the last of them (if
  it ends in ".." then it becomes ".")
  This mostly follows GNU tar's behavior, except for 'tar tf' and
  'tar xvf' we report the modified path that would be/was actually
  created instead of the raw path from the archive

  Above two fixes prompted by a report from Daniel Cegielka
  (daniel.cegielka (at) gmail.com)

* For directories whose times or mode will be fixed up in the
  clean-up pass, record their dev+ino and then use
  open(O_DIRECTORY)+fstat() to verify that we're updating the correct
  directory before using futimens() and fchmod().

* Correct buffer overflow in handling of pax extension headers,
  caught by the memcpy() overlap check.


previously ok millert@ deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Feb 21 22:48:23 2015 UTC (9 years, 3 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE
Branch point for: OPENBSD_5_7
Changes since 1.35: +6 -4 lines
Diff to previous 1.35 (colored)

Recent changes haven't been completely stable, so revert for the 5.7 release

requested by deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Wed Feb 11 23:14:46 2015 UTC (9 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.34: +4 -6 lines
Diff to previous 1.34 (colored)

Take II, this time without an incorrect mode test.
For directories whose times or mode will be fixed up in the clean-up pass,
record their dev+ino and then use open(O_DIRECTORY)+fstat() to verify that
we're updating the correct directory before using futimens() and fchmod().

ok sthen@ millert@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Feb 5 22:32:20 2015 UTC (9 years, 4 months ago) by sthen
Branch: MAIN
Changes since 1.33: +5 -3 lines
Diff to previous 1.33 (colored)

backout previous for now; issues seen with "tar: Directory vanished before
restoring mode and times: ..." (and an error exit code, which breaks at least
building ports). krw@ agrees.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Feb 5 07:49:25 2015 UTC (9 years, 4 months ago) by guenther
Branch: MAIN
Changes since 1.32: +4 -6 lines
Diff to previous 1.32 (colored)

For directories whose times or mode will be fixed up in the clean-up pass,
record their dev+ino and then use open(O_DIRECTORY)+fstat() to verify that
we're updating the correct directory before using futimens() and fchmod().

ok millert@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jul 11 07:51:48 2014 UTC (9 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE
Branch point for: OPENBSD_5_6
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

clarify a comment about readlink. from Doug Hogan

Revision 1.31 / (download) - annotate - [select for diffs], Sat May 24 18:51:00 2014 UTC (10 years ago) by guenther
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Delete pointless casts: free() return value to (void), free()'s
argument to (char *), and malloc/calloc's return value to the type
of the variable it's being assigned to.
Convert the one calloc() where the zeroing isn't needed to a reallocarray().

ok millert@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Dec 4 02:24:45 2012 UTC (11 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

remove some unnecessary sys/param.h inclusions

Revision 1.29 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:22 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.28: +1 -9 lines
Diff to previous 1.28 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.28 / (download) - annotate - [select for diffs], Tue May 6 06:54:28 2008 UTC (16 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.27: +17 -3 lines
Diff to previous 1.27 (colored)

when pax is running in -u mode, and no files are beeing updated because
not one changed, we should not exit with an error but zero to indicate
success (matches solaris behaviour).
need to track wether files were skipped because of the -u checks for that
and take that into account later when taking the exit code decision.
ok theo, comments from otto and miod

Revision 1.27 / (download) - annotate - [select for diffs], Tue Dec 26 20:58:25 2006 UTC (17 years, 5 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.26: +4 -2 lines
Diff to previous 1.26 (colored)

fts_read returning NULL and errno set is an error. ok ray@

Revision 1.26 / (download) - annotate - [select for diffs], Thu Apr 21 21:47:18 2005 UTC (19 years, 1 month ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.25: +4 -2 lines
Diff to previous 1.25 (colored)

fix strlcpy abuse in pax - this commit turns potential overflows into
potential non-spec compliance - the use of these fields as strings needs
to be revisited more thouroughly.
ok millert@ otto@

Revision 1.25 / (download) - annotate - [select for diffs], Fri Apr 16 22:50:23 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.24: +6 -6 lines
Diff to previous 1.24 (colored)

spacing

Revision 1.24 / (download) - annotate - [select for diffs], Mon Oct 20 06:22:27 2003 UTC (20 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

typos from Jared Yanovich;

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jun 13 17:51:14 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.22: +52 -6 lines
Diff to previous 1.22 (colored)

Add a -0 flag to make pax use a NUL instead of a newline as the
pathname separator.  Works in list mode as well as read/copy mode.
Based on a patch from David Leonard; closes PR 3310

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jun 2 23:32:08 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.21: +3 -7 lines
Diff to previous 1.21 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Oct 16 19:20:02 2002 UTC (21 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

sprinkle const; mostly from NetBSD

Revision 1.20 / (download) - annotate - [select for diffs], Wed Oct 16 18:40:30 2002 UTC (21 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Fix comment typos; most from NetBSD and FreeBSD

Revision 1.19 / (download) - annotate - [select for diffs], Wed Oct 16 17:43:10 2002 UTC (21 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.18: +11 -11 lines
Diff to previous 1.18 (colored)

kill register

Revision 1.18 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:35 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.17: +2 -36 lines
Diff to previous 1.17 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:07 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.16 / (download) - annotate - [select for diffs], Sat May 26 00:32:21 2001 UTC (23 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.15: +2 -27 lines
Diff to previous 1.15 (colored)

Get rid of NET2_FTS and NET2_REGEX #ifdefs since they are useless.
Change NET2_STAT into LONG_OFF_T for portability to systems with
a 32bit off_t.

Revision 1.15 / (download) - annotate - [select for diffs], Sat May 19 15:31:20 2001 UTC (23 years ago) by millert
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Use an explicit memcpy() to copy a stat struct.  Fixes a mysterious
Memory fault on my hp300 boxes.  This is more than a little worrisome
(and it doesn't show up on i386).  The problem may actually be related
to struct alignment and the recent fts struct changes.

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 16 03:04:56 2001 UTC (23 years, 1 month ago) by mickey
Branch: MAIN
Changes since 1.13: +5 -6 lines
Diff to previous 1.13 (colored)

use proper str*cpy functions instead of home grown one, spaces; millert@ ok

Revision 1.13 / (download) - annotate - [select for diffs], Fri Feb 9 23:01:00 2001 UTC (23 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

another typo

Revision 1.12 / (download) - annotate - [select for diffs], Fri Feb 9 17:14:43 2001 UTC (23 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

no need to revert a change that just fixed a typo

Revision 1.11 / (download) - annotate - [select for diffs], Fri Feb 9 14:04:33 2001 UTC (23 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored)

Revert broken fix, until a correct fix is written.
Breaking all ports like that is not acceptable.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Feb 7 19:43:10 2001 UTC (23 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

Fix -T option and add support for -C option in the file pointed to
by -T ala GNU tar.
Based on a patch from woods@proven.weird.com; Closes PR #1664

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 9 07:28:41 1998 UTC (26 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

spelling

Revision 1.8 / (download) - annotate - [select for diffs], Mon Sep 1 18:29:49 1997 UTC (26 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

i am bored enough to fix terminal space/tab uglies

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jul 25 18:58:30 1997 UTC (26 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.6: +8 -8 lines
Diff to previous 1.6 (colored)

#if __STDC__ --> #ifdef __STDC__

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jul 24 23:19:19 1997 UTC (26 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.5: +6 -6 lines
Diff to previous 1.5 (colored)

Stash fd of cwd instead of using getcwd() to stash path.
This works in cases where the parent dir is not readable.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jun 4 00:15:16 1997 UTC (27 years ago) by millert
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

Fix usage of l_strncpy() (noticed by Theo) and make l_strncpy()
pad with NULL's like strncpy(3).  This eliminates the need for
zf_strncpy(); ocurrences of zf_strncpy() have been changed to l_strncpy().

Revision 1.4 / (download) - annotate - [select for diffs], Sun Oct 27 06:45:11 1996 UTC (27 years, 7 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.3: +22 -6 lines
Diff to previous 1.3 (colored)

Initial cut -C support in paxtar.  Exceeds GNU tar by quite a bit.
General pax still seems to work ok.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 23 14:20:34 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

update rcsid

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jun 11 06:41:50 1996 UTC (28 years ago) by tholo
Branch: MAIN
Changes since 1.1: +6 -7 lines
Diff to previous 1.1 (colored)

Correct compile warnings
Rename warn() to paxwarn() so <err.h> can be included

Remove #include <ctype.h> when not needed; from FreeBSD

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:37:17 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:37:17 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.