diff --git a/contrib/libarchive/FREEBSD-Xlist b/contrib/libarchive/FREEBSD-Xlist index 98a169660222..b87a53b0c5e1 100644 --- a/contrib/libarchive/FREEBSD-Xlist +++ b/contrib/libarchive/FREEBSD-Xlist @@ -14,10 +14,12 @@ cpio/test/CMakeLists.txt doc examples libarchive/CMakeLists.txt +libarchive/archive_entry_copy_bhfi.c libarchive/archive_windows.c libarchive/archive_windows.h libarchive/config_freebsd.h libarchive/filter_fork_windows.c +libarchive/mtree.5 libarchive/test/.cvsignore libarchive/test/CMakeLists.txt tar/CMakeLists.txt diff --git a/contrib/libarchive/libarchive/archive_entry_copy_bhfi.c b/contrib/libarchive/libarchive/archive_entry_copy_bhfi.c deleted file mode 100644 index 8339032c5c35..000000000000 --- a/contrib/libarchive/libarchive/archive_entry_copy_bhfi.c +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 2003-2007 Tim Kientzle - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "archive_platform.h" -__FBSDID("$FreeBSD$"); - -#include "archive_private.h" -#include "archive_entry.h" - -#if defined(_WIN32) && !defined(__CYGWIN__) - -#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000) - -__inline static void -fileTimeToUtc(const FILETIME *filetime, time_t *time, long *ns) -{ - ULARGE_INTEGER utc; - - utc.HighPart = filetime->dwHighDateTime; - utc.LowPart = filetime->dwLowDateTime; - if (utc.QuadPart >= EPOC_TIME) { - utc.QuadPart -= EPOC_TIME; - *time = (time_t)(utc.QuadPart / 10000000); /* milli seconds base */ - *ns = (long)(utc.QuadPart % 10000000) * 100;/* nano seconds base */ - } else { - *time = 0; - *ns = 0; - } -} - -void -archive_entry_copy_bhfi(struct archive_entry *entry, - BY_HANDLE_FILE_INFORMATION *bhfi) -{ - time_t secs; - long nsecs; - - fileTimeToUtc(&bhfi->ftLastAccessTime, &secs, &nsecs); - archive_entry_set_atime(entry, secs, nsecs); - fileTimeToUtc(&bhfi->ftLastWriteTime, &secs, &nsecs); - archive_entry_set_mtime(entry, secs, nsecs); - fileTimeToUtc(&bhfi->ftCreationTime, &secs, &nsecs); - archive_entry_set_birthtime(entry, secs, nsecs); - archive_entry_set_dev(entry, bhfi->dwVolumeSerialNumber); - archive_entry_set_ino64(entry, (((int64_t)bhfi->nFileIndexHigh) << 32) - + bhfi->nFileIndexLow); - archive_entry_set_nlink(entry, bhfi->nNumberOfLinks); - archive_entry_set_size(entry, (((int64_t)bhfi->nFileSizeHigh) << 32) - + bhfi->nFileSizeLow); -// archive_entry_set_mode(entry, st->st_mode); -} -#endif diff --git a/contrib/libarchive/libarchive/mtree.5 b/contrib/libarchive/libarchive/mtree.5 deleted file mode 100644 index b6637d6f55e8..000000000000 --- a/contrib/libarchive/libarchive/mtree.5 +++ /dev/null @@ -1,269 +0,0 @@ -.\" Copyright (c) 1989, 1990, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93 -.\" $FreeBSD$ -.\" -.Dd August 20, 2007 -.Dt MTREE 5 -.Os -.Sh NAME -.Nm mtree -.Nd format of mtree dir hierarchy files -.Sh DESCRIPTION -The -.Nm -format is a textual format that describes a collection of filesystem objects. -Such files are typically used to create or verify directory hierarchies. -.Ss General Format -An -.Nm -file consists of a series of lines, each providing information -about a single filesystem object. -Leading whitespace is always ignored. -.Pp -When encoding file or pathnames, any backslash character or -character outside of the 95 printable ASCII characters must be -encoded as a a backslash followed by three -octal digits. -When reading mtree files, any appearance of a backslash -followed by three octal digits should be converted into the -corresponding character. -.Pp -Each line is interpreted independently as one of the following types: -.Bl -tag -width Cm -.It Signature -The first line of any mtree file must begin with -.Dq #mtree . -If a file contains any full path entries, the first line should -begin with -.Dq #mtree v2.0 , -otherwise, the first line should begin with -.Dq #mtree v1.0 . -.It Blank -Blank lines are ignored. -.It Comment -Lines beginning with -.Cm # -are ignored. -.It Special -Lines beginning with -.Cm / -are special commands that influence -the interpretation of later lines. -.It Relative -If the first whitespace-delimited word has no -.Cm / -characters, -it is the name of a file in the current directory. -Any relative entry that describes a directory changes the -current directory. -.It dot-dot -As a special case, a relative entry with the filename -.Pa .. -changes the current directory to the parent directory. -Options on dot-dot entries are always ignored. -.It Full -If the first whitespace-delimited word has a -.Cm / -character after -the first character, it is the pathname of a file relative to the -starting directory. -There can be multiple full entries describing the same file. -.El -.Pp -Some tools that process -.Nm -files may require that multiple lines describing the same file -occur consecutively. -It is not permitted for the same file to be mentioned using -both a relative and a full file specification. -.Ss Special commands -Two special commands are currently defined: -.Bl -tag -width Cm -.It Cm /set -This command defines default values for one or more keywords. -It is followed on the same line by one or more whitespace-separated -keyword definitions. -These definitions apply to all following files that do not specify -a value for that keyword. -.It Cm /unset -This command removes any default value set by a previous -.Cm /set -command. -It is followed on the same line by one or more keywords -separated by whitespace. -.El -.Ss Keywords -After the filename, a full or relative entry consists of zero -or more whitespace-separated keyword definitions. -Each such definition consists of a key from the following -list immediately followed by an '=' sign -and a value. -Software programs reading mtree files should warn about -unrecognized keywords. -.Pp -Currently supported keywords are as follows: -.Bl -tag -width Cm -.It Cm cksum -The checksum of the file using the default algorithm specified by -the -.Xr cksum 1 -utility. -.It Cm contents -The full pathname of a file that holds the contents of this file. -.It Cm flags -The file flags as a symbolic name. -See -.Xr chflags 1 -for information on these names. -If no flags are to be set the string -.Dq none -may be used to override the current default. -.It Cm gid -The file group as a numeric value. -.It Cm gname -The file group as a symbolic name. -.It Cm ignore -Ignore any file hierarchy below this file. -.It Cm link -The target of the symbolic link when type=link. -.It Cm md5 -The MD5 message digest of the file. -.It Cm md5digest -A synonym for -.Cm md5 . -.It Cm mode -The current file's permissions as a numeric (octal) or symbolic -value. -.It Cm nlink -The number of hard links the file is expected to have. -.It Cm nochange -Make sure this file or directory exists but otherwise ignore all attributes. -.It Cm ripemd160digest -The -.Tn RIPEMD160 -message digest of the file. -.It Cm rmd160 -A synonym for -.Cm ripemd160digest . -.It Cm rmd160digest -A synonym for -.Cm ripemd160digest . -.It Cm sha1 -The -.Tn FIPS -160-1 -.Pq Dq Tn SHA-1 -message digest of the file. -.It Cm sha1digest -A synonym for -.Cm sha1 . -.It Cm sha256 -The -.Tn FIPS -180-2 -.Pq Dq Tn SHA-256 -message digest of the file. -.It Cm sha256digest -A synonym for -.Cm sha256 . -.It Cm size -The size, in bytes, of the file. -.It Cm time -The last modification time of the file. -.It Cm type -The type of the file; may be set to any one of the following: -.Pp -.Bl -tag -width Cm -compact -.It Cm block -block special device -.It Cm char -character special device -.It Cm dir -directory -.It Cm fifo -fifo -.It Cm file -regular file -.It Cm link -symbolic link -.It Cm socket -socket -.El -.It Cm uid -The file owner as a numeric value. -.It Cm uname -The file owner as a symbolic name. -.El -.Pp -.Sh SEE ALSO -.Xr cksum 1 , -.Xr find 1 , -.Xr mtree 8 -.Sh BUGS -The -.Fx -implementation of mtree does not currently support -the -.Nm -2.0 -format. -The requirement for a -.Dq #mtree -signature line is new and not yet widely implemented. -.Sh HISTORY -The -.Nm -utility appeared in -.Bx 4.3 Reno . -The -.Tn MD5 -digest capability was added in -.Fx 2.1 , -in response to the widespread use of programs which can spoof -.Xr cksum 1 . -The -.Tn SHA-1 -and -.Tn RIPEMD160 -digests were added in -.Fx 4.0 , -as new attacks have demonstrated weaknesses in -.Tn MD5 . -The -.Tn SHA-256 -digest was added in -.Fx 6.0 . -Support for file flags was added in -.Fx 4.0 , -and mostly comes from -.Nx . -The -.Dq full -entry format was added by -.Nx .