Date: Mon, 12 Apr 2004 17:37:57 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 50947 for review Message-ID: <200404130037.i3D0bvHO003853@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50947 Change 50947 by marcel@marcel_nfs on 2004/04/12 17:37:38 IFC @50944 Affected files ... .. //depot/projects/gdb/etc/rc.d/adjkerntz#3 integrate .. //depot/projects/gdb/etc/rc.d/random#4 integrate .. //depot/projects/gdb/lib/libarchive/Makefile#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_check_magic.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.3#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.c#6 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.h#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_private.h#6 integrate .. //depot/projects/gdb/lib/libarchive/archive_read.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_data_into_buffer.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_data_into_fd.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_extract.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_open_fd.c#2 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_open_file.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_all.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_bzip2.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_gzip.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_none.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_format_all.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_format_cpio.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_read_support_format_gnutar.c#4 delete .. //depot/projects/gdb/lib/libarchive/archive_read_support_format_tar.c#7 integrate .. //depot/projects/gdb/lib/libarchive/archive_string.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_string_sprintf.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_util.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_write.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_open_fd.c#2 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_open_file.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_bzip2.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_gzip.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_none.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_format_cpio.c#3 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_format_pax.c#7 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_format_shar.c#4 integrate .. //depot/projects/gdb/lib/libarchive/archive_write_set_format_ustar.c#4 integrate .. //depot/projects/gdb/lib/libc/locale/big5.c#4 integrate .. //depot/projects/gdb/lib/libc/locale/euc.c#4 integrate .. //depot/projects/gdb/lib/libc/locale/gb18030.c#5 integrate .. //depot/projects/gdb/lib/libc/locale/gb2312.c#5 integrate .. //depot/projects/gdb/lib/libc/locale/gbk.c#4 integrate .. //depot/projects/gdb/lib/libc/locale/mskanji.c#4 integrate .. //depot/projects/gdb/lib/libc/locale/utf2.c#5 integrate .. //depot/projects/gdb/lib/libc/locale/utf8.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/utf8.c#4 integrate .. //depot/projects/gdb/sbin/dump/dump.8#4 integrate .. //depot/projects/gdb/sbin/dump/main.c#3 integrate .. //depot/projects/gdb/sys/conf/NOTES#11 integrate .. //depot/projects/gdb/sys/dev/acpica/acpi_thermal.c#5 integrate .. //depot/projects/gdb/sys/dev/pccard/pccard_cis.c#2 integrate .. //depot/projects/gdb/sys/dev/pccbb/pccbb.c#5 integrate .. //depot/projects/gdb/sys/dev/random/randomdev.c#5 integrate .. //depot/projects/gdb/sys/fs/specfs/spec_vnops.c#6 integrate .. //depot/projects/gdb/sys/i386/conf/NOTES#7 integrate .. //depot/projects/gdb/sys/kern/kern_sig.c#6 integrate .. //depot/projects/gdb/sys/kern/subr_rman.c#2 integrate .. //depot/projects/gdb/sys/net/if_var.h#7 integrate .. //depot/projects/gdb/sys/net/route.c#3 integrate .. //depot/projects/gdb/sys/net/rtsock.c#3 integrate .. //depot/projects/gdb/sys/nfsserver/nfs_serv.c#4 integrate .. //depot/projects/gdb/usr.bin/make/make.1#3 integrate .. //depot/projects/gdb/usr.bin/make/parse.c#3 integrate .. //depot/projects/gdb/usr.bin/make/suff.c#2 integrate .. //depot/projects/gdb/usr.bin/netstat/if.c#2 integrate .. //depot/projects/gdb/usr.bin/tar/Makefile#3 integrate .. //depot/projects/gdb/usr.sbin/sysinstall/menus.c#3 integrate Differences ... ==== //depot/projects/gdb/etc/rc.d/adjkerntz#3 (text+ko) ==== @@ -1,10 +1,10 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/adjkerntz,v 1.3 2004/03/08 12:25:05 pjd Exp $ +# $FreeBSD: src/etc/rc.d/adjkerntz,v 1.4 2004/04/12 18:11:00 brooks Exp $ # # PROVIDE: adjkerntz -# REQUIRE: diskless mountcritlocal random +# REQUIRE: mountcritlocal random # BEFORE: netif # KEYWORD: FreeBSD nojail ==== //depot/projects/gdb/etc/rc.d/random#4 (text+ko) ==== @@ -1,10 +1,10 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/random,v 1.5 2004/03/08 12:25:05 pjd Exp $ +# $FreeBSD: src/etc/rc.d/random,v 1.6 2004/04/12 18:11:00 brooks Exp $ # # PROVIDE: random -# REQUIRE: diskless mountcritlocal initrandom +# REQUIRE: var initrandom # BEFORE: netif # KEYWORD: FreeBSD nojail shutdown ==== //depot/projects/gdb/lib/libarchive/Makefile#5 (text+ko) ==== @@ -1,14 +1,16 @@ -# Makefile for libarchive. -# -# $FreeBSD: src/lib/libarchive/Makefile,v 1.5 2004/04/05 21:12:29 kientzle Exp $ -DEBUG_FLAGS=-g +# $FreeBSD: src/lib/libarchive/Makefile,v 1.6 2004/04/12 01:16:16 kientzle Exp $ + LIB= archive SHLIB_MAJOR= 1 +WARNS?= 6 + # I'm not yet ready for a shared version of this library, as # there are a couple of API changes still in the works. NOPIC= 1 +INCS= archive.h archive_entry.h + SRCS= archive_check_magic.c \ archive_entry.c \ archive_read.c \ @@ -23,7 +25,6 @@ archive_read_support_compression_none.c \ archive_read_support_format_all.c \ archive_read_support_format_cpio.c \ - archive_read_support_format_gnutar.c \ archive_read_support_format_tar.c \ archive_string.c \ archive_string_sprintf.c \ @@ -41,90 +42,78 @@ archive_write_set_format_shar.c \ archive_write_set_format_ustar.c -MAN = archive_entry.3 \ +MAN= archive_entry.3 \ archive_read.3 \ archive_util.3 \ archive_write.3 \ libarchive.3 \ tar.5 -MLINKS += archive_entry.3 archive_entry_clear.3 -MLINKS += archive_entry.3 archive_entry_clone.3 -MLINKS += archive_entry.3 archive_entry_copy_stat.3 -MLINKS += archive_entry.3 archive_entry_dup.3 -MLINKS += archive_entry.3 archive_entry_free.3 -MLINKS += archive_entry.3 archive_entry_gname.3 -MLINKS += archive_entry.3 archive_entry_hardlink.3 -MLINKS += archive_entry.3 archive_entry_new.3 -MLINKS += archive_entry.3 archive_entry_pathname.3 -MLINKS += archive_entry.3 archive_entry_set_devmajor.3 -MLINKS += archive_entry.3 archive_entry_set_devminor.3 -MLINKS += archive_entry.3 archive_entry_set_gid.3 -MLINKS += archive_entry.3 archive_entry_set_gname.3 -MLINKS += archive_entry.3 archive_entry_set_hardlink.3 -MLINKS += archive_entry.3 archive_entry_set_mode.3 -MLINKS += archive_entry.3 archive_entry_set_pathname.3 -MLINKS += archive_entry.3 archive_entry_set_symlink.3 -MLINKS += archive_entry.3 archive_entry_set_tartype.3 -MLINKS += archive_entry.3 archive_entry_set_uid.3 -MLINKS += archive_entry.3 archive_entry_set_uname.3 -MLINKS += archive_entry.3 archive_entry_size.3 -MLINKS += archive_entry.3 archive_entry_stat.3 -MLINKS += archive_entry.3 archive_entry_symlink.3 -MLINKS += archive_entry.3 archive_entry_tartype.3 -MLINKS += archive_entry.3 archive_entry_uname.3 -MLINKS += archive_read.3 archive_read_data.3 -MLINKS += archive_read.3 archive_read_data_into_buffer.3 -MLINKS += archive_read.3 archive_read_data_into_file.3 -MLINKS += archive_read.3 archive_read_data_skip.3 -MLINKS += archive_read.3 archive_read_extract.3 -MLINKS += archive_read.3 archive_read_finish.3 -MLINKS += archive_read.3 archive_read_new.3 -MLINKS += archive_read.3 archive_read_next_header.3 -MLINKS += archive_read.3 archive_read_open.3 -MLINKS += archive_read.3 archive_read_open_fd.3 -MLINKS += archive_read.3 archive_read_open_file.3 -MLINKS += archive_read.3 archive_read_set_bytes_per_block.3 -MLINKS += archive_read.3 archive_read_support_compression_all.3 -MLINKS += archive_read.3 archive_read_support_compression_bzip2.3 -MLINKS += archive_read.3 archive_read_support_compression_gzip.3 -MLINKS += archive_read.3 archive_read_support_compression_none.3 -MLINKS += archive_read.3 archive_read_support_format_all.3 -MLINKS += archive_read.3 archive_read_support_format_cpio.3 -MLINKS += archive_read.3 archive_read_support_format_gnutar.3 -MLINKS += archive_read.3 archive_read_support_format_tar.3 -MLINKS += archive_util.3 archive_compression.3 -MLINKS += archive_util.3 archive_compression_name.3 -MLINKS += archive_util.3 archive_errno.3 -MLINKS += archive_util.3 archive_error_string.3 -MLINKS += archive_util.3 archive_format.3 -MLINKS += archive_util.3 archive_format_name.3 -MLINKS += archive_write.3 archive_write_data.3 -MLINKS += archive_write.3 archive_write_finish.3 -MLINKS += archive_write.3 archive_write_header.3 -MLINKS += archive_write.3 archive_write_new.3 -MLINKS += archive_write.3 archive_write_open.3 -MLINKS += archive_write.3 archive_write_open_fd.3 -MLINKS += archive_write.3 archive_write_open_file.3 -MLINKS += archive_write.3 archive_write_prepare.3 -MLINKS += archive_write.3 archive_write_set_bytes_per_block.3 -MLINKS += archive_write.3 archive_write_set_bytes_in_last_block.3 -MLINKS += archive_write.3 archive_write_set_callbacks.3 -MLINKS += archive_write.3 archive_write_set_compression_bzip2.3 -MLINKS += archive_write.3 archive_write_set_compression_gzip.3 -MLINKS += archive_write.3 archive_write_set_format_pax.3 -MLINKS += archive_write.3 archive_write_set_format_ustar.3 -MLINKS += libarchive.3 archive.3 - -INCS = archive.h archive_entry.h - -.if defined(DMALLOC) -DEBUG_FLAGS+= -DDEBUG -g -CFLAGS+= -DHAVE_DMALLOC -I/usr/local/include -LDFLAGS+= -L/usr/local/lib -ldmalloc -.endif -#CFLAGS+= -O3 - -WARNS?= 6 +MLINKS+= archive_entry.3 archive_entry_clear.3 +MLINKS+= archive_entry.3 archive_entry_clone.3 +MLINKS+= archive_entry.3 archive_entry_copy_stat.3 +MLINKS+= archive_entry.3 archive_entry_dup.3 +MLINKS+= archive_entry.3 archive_entry_free.3 +MLINKS+= archive_entry.3 archive_entry_gname.3 +MLINKS+= archive_entry.3 archive_entry_hardlink.3 +MLINKS+= archive_entry.3 archive_entry_new.3 +MLINKS+= archive_entry.3 archive_entry_pathname.3 +MLINKS+= archive_entry.3 archive_entry_set_devmajor.3 +MLINKS+= archive_entry.3 archive_entry_set_devminor.3 +MLINKS+= archive_entry.3 archive_entry_set_gid.3 +MLINKS+= archive_entry.3 archive_entry_set_gname.3 +MLINKS+= archive_entry.3 archive_entry_set_hardlink.3 +MLINKS+= archive_entry.3 archive_entry_set_link.3 +MLINKS+= archive_entry.3 archive_entry_set_mode.3 +MLINKS+= archive_entry.3 archive_entry_set_pathname.3 +MLINKS+= archive_entry.3 archive_entry_set_symlink.3 +MLINKS+= archive_entry.3 archive_entry_set_uid.3 +MLINKS+= archive_entry.3 archive_entry_set_uname.3 +MLINKS+= archive_entry.3 archive_entry_size.3 +MLINKS+= archive_entry.3 archive_entry_stat.3 +MLINKS+= archive_entry.3 archive_entry_symlink.3 +MLINKS+= archive_entry.3 archive_entry_uname.3 +MLINKS+= archive_read.3 archive_read_data.3 +MLINKS+= archive_read.3 archive_read_data_into_buffer.3 +MLINKS+= archive_read.3 archive_read_data_into_file.3 +MLINKS+= archive_read.3 archive_read_data_skip.3 +MLINKS+= archive_read.3 archive_read_extract.3 +MLINKS+= archive_read.3 archive_read_finish.3 +MLINKS+= archive_read.3 archive_read_new.3 +MLINKS+= archive_read.3 archive_read_next_header.3 +MLINKS+= archive_read.3 archive_read_open.3 +MLINKS+= archive_read.3 archive_read_open_fd.3 +MLINKS+= archive_read.3 archive_read_open_file.3 +MLINKS+= archive_read.3 archive_read_set_bytes_per_block.3 +MLINKS+= archive_read.3 archive_read_support_compression_all.3 +MLINKS+= archive_read.3 archive_read_support_compression_bzip2.3 +MLINKS+= archive_read.3 archive_read_support_compression_gzip.3 +MLINKS+= archive_read.3 archive_read_support_compression_none.3 +MLINKS+= archive_read.3 archive_read_support_format_all.3 +MLINKS+= archive_read.3 archive_read_support_format_cpio.3 +MLINKS+= archive_read.3 archive_read_support_format_gnutar.3 +MLINKS+= archive_read.3 archive_read_support_format_tar.3 +MLINKS+= archive_util.3 archive_compression.3 +MLINKS+= archive_util.3 archive_compression_name.3 +MLINKS+= archive_util.3 archive_errno.3 +MLINKS+= archive_util.3 archive_error_string.3 +MLINKS+= archive_util.3 archive_format.3 +MLINKS+= archive_util.3 archive_format_name.3 +MLINKS+= archive_write.3 archive_write_data.3 +MLINKS+= archive_write.3 archive_write_finish.3 +MLINKS+= archive_write.3 archive_write_header.3 +MLINKS+= archive_write.3 archive_write_new.3 +MLINKS+= archive_write.3 archive_write_open.3 +MLINKS+= archive_write.3 archive_write_open_fd.3 +MLINKS+= archive_write.3 archive_write_open_file.3 +MLINKS+= archive_write.3 archive_write_prepare.3 +MLINKS+= archive_write.3 archive_write_set_bytes_per_block.3 +MLINKS+= archive_write.3 archive_write_set_bytes_in_last_block.3 +MLINKS+= archive_write.3 archive_write_set_callbacks.3 +MLINKS+= archive_write.3 archive_write_set_compression_bzip2.3 +MLINKS+= archive_write.3 archive_write_set_compression_gzip.3 +MLINKS+= archive_write.3 archive_write_set_format_pax.3 +MLINKS+= archive_write.3 archive_write_set_format_ustar.3 +MLINKS+= libarchive.3 archive.3 .include <bsd.lib.mk> ==== //depot/projects/gdb/lib/libarchive/archive_check_magic.c#3 (text+ko) ==== @@ -25,13 +25,10 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.3 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/types.h> -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <stdio.h> #include <string.h> #include <unistd.h> ==== //depot/projects/gdb/lib/libarchive/archive_entry.3#3 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.2 2004/03/19 22:37:06 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.3 2004/04/12 01:16:16 kientzle Exp $ .\" .Dd December 15, 2003 .Dt archive_entry 3 @@ -52,14 +52,12 @@ .Nm archive_entry_set_mode .Nm archive_entry_set_pathname .Nm archive_entry_set_symlink -.Nm archive_entry_set_tartype .Nm archive_entry_set_uid .Nm archive_entry_set_uname .Nm archive_entry_size .Nm archive_entry_stat .Nm archive_entry_symlink .Nm archive_entry_symlink_w -.Nm archive_entry_tartype .Nm archive_entry_uname .Nm archive_entry_uname_w .Nd functions for manipulating archive entry descriptions @@ -114,8 +112,6 @@ .Ft void .Fn archive_entry_set_symlink "struct archive_entry *" "const char *" .Ft void -.Fn archive_entry_set_tartype "struct archive_entry *" "int" -.Ft void .Fn archive_entry_set_uid "struct archive_entry *" "uid_t" .Ft void .Fn archive_entry_set_uname "struct archive_entry *" "const char *" @@ -127,8 +123,6 @@ .Fn archive_entry_symlink "struct archive_entry *" .Ft const wchar_t * .Fn archive_entry_symlink_w "struct archive_entry *" -.Ft int -.Fn archive_entry_tartype "struct archive_entry *" .Ft const char * .Fn archive_entry_uname "struct archive_entry *" .Ft const wchar_t * @@ -199,12 +193,6 @@ Allocate and return a blank .Tn struct archive_entry object. -.It Fn archive_entry_set_tartype -Sets the value to be used in a tar-format header -for this entry. -Client code should generally not set this; if it -is left unset, the library will automatically determine -an appropriate value. .El .\" .Sh EXAMPLE .\" .Sh RETURN VALUES ==== //depot/projects/gdb/lib/libarchive/archive_entry.c#6 (text+ko) ==== @@ -25,13 +25,10 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.5 2004/04/06 23:16:50 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.6 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/stat.h> #include <sys/types.h> -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -119,9 +116,6 @@ */ struct stat ae_stat; - /* I'm not happy with having this format-particular data here. */ - int ae_tartype; - /* * Use aes here so that we get transparent mbs<->wcs conversions. */ @@ -283,7 +277,6 @@ aes_clean(&entry->ae_uname); archive_entry_acl_clear(entry); memset(entry, 0, sizeof(*entry)); - entry->ae_tartype = -1; return entry; } @@ -298,7 +291,6 @@ return (NULL); memset(entry2, 0, sizeof(*entry2)); entry2->ae_stat = entry->ae_stat; - entry2->ae_tartype = entry->ae_tartype; aes_copy(&entry2->ae_fflags ,&entry->ae_fflags); aes_copy(&entry2->ae_gname ,&entry->ae_gname); @@ -326,7 +318,6 @@ if(entry == NULL) return (NULL); memset(entry, 0, sizeof(*entry)); - entry->ae_tartype = -1; return (entry); } @@ -415,12 +406,6 @@ return (aes_get_mbs(&entry->ae_symlink)); } -int -archive_entry_tartype(struct archive_entry *entry) -{ - return (entry->ae_tartype); -} - const char * archive_entry_uname(struct archive_entry *entry) { @@ -501,6 +486,16 @@ aes_copy_wcs(&entry->ae_hardlink, target); } +/* Set symlink if symlink is already set, else set hardlink. */ +void +archive_entry_set_link(struct archive_entry *entry, const char *target) +{ + if (entry->ae_symlink.aes_mbs != NULL || + entry->ae_symlink.aes_wcs != NULL) + aes_set_mbs(&entry->ae_symlink, target); + aes_set_mbs(&entry->ae_hardlink, target); +} + void archive_entry_set_mode(struct archive_entry *entry, mode_t m) { @@ -538,12 +533,6 @@ } void -archive_entry_set_tartype(struct archive_entry *entry, char t) -{ - entry->ae_tartype = t; -} - -void archive_entry_set_uid(struct archive_entry *entry, uid_t u) { entry->ae_stat.st_uid = u; @@ -1121,15 +1110,16 @@ namebuff = malloc(namebuff_length * sizeof(wchar_t)); } - wmemcpy(namebuff, start, end-start); + wmemcpy(namebuff, name_start, name_end - name_start); archive_entry_acl_add_entry_w(entry, type, permset, tag, id, namebuff); } } + if (namebuff != NULL) + free(namebuff); return (ARCHIVE_OK); fail: - fprintf(stderr, "ACL error\n"); if (namebuff != NULL) free(namebuff); return (ARCHIVE_WARN); ==== //depot/projects/gdb/lib/libarchive/archive_entry.h#5 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.4 2004/04/06 23:16:50 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.5 2004/04/12 01:16:16 kientzle Exp $ */ #ifndef ARCHIVE_ENTRY_H_INCLUDED @@ -79,7 +79,6 @@ int64_t archive_entry_size(struct archive_entry *); const struct stat *archive_entry_stat(struct archive_entry *); const char *archive_entry_symlink(struct archive_entry *); -int archive_entry_tartype(struct archive_entry *); const char *archive_entry_uname(struct archive_entry *); /* @@ -99,23 +98,24 @@ void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); void archive_entry_set_hardlink(struct archive_entry *, const char *); void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); +void archive_entry_set_link(struct archive_entry *, const char *); void archive_entry_set_mode(struct archive_entry *, mode_t); void archive_entry_set_pathname(struct archive_entry *, const char *); void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *); void archive_entry_set_size(struct archive_entry *, int64_t); void archive_entry_set_symlink(struct archive_entry *, const char *); void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); -void archive_entry_set_tartype(struct archive_entry *, char); void archive_entry_set_uid(struct archive_entry *, uid_t); void archive_entry_set_uname(struct archive_entry *, const char *); void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); /* * ACL routines. This used to simply store and return text-format ACL - * strings, but that proved insufficient. The intent here is to allow - * libarchive internals to fetch/store text-format strings, but - * clients use the more involved interface that allows them control - * over uid/uname/gid/gname lookups. + * strings, but that proved insufficient for a number of reasons: + * = clients need control over uname/uid and gname/gid mappings + * = there are many different ACL text formats + * = would like to be able to read/convert archives containing ACLs + * on platforms that lack ACL libraries */ /* @@ -139,7 +139,6 @@ #define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access. */ #define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public. */ - /* * Set the ACL by clearing it and adding entries one at a time. * Unlike the POSIX.1e ACL routines, you must specify the type @@ -185,6 +184,17 @@ /* Return a count of entries matching 'want_type' */ int archive_entry_acl_count(struct archive_entry *, int want_type); - +/* + * Private ACL parser. This is private because it handles some + * very weird formats that clients should not be messing with. + * Clients should only deal with their platform-native formats. + * Because of the need to support many formats cleanly, new arguments + * are likely to get added on a regular basis. Clients who try to use + * this interface are likely to be surprised when it changes. + * + * You were warned! + */ +int __archive_entry_acl_parse_w(struct archive_entry *, + const wchar_t *, int type); #endif /* !ARCHIVE_ENTRY_H_INCLUDED */ ==== //depot/projects/gdb/lib/libarchive/archive_private.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/archive_private.h,v 1.5 2004/04/06 23:16:50 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_private.h,v 1.6 2004/04/12 01:16:16 kientzle Exp $ */ #ifndef ARCHIVE_PRIVATE_H_INCLUDED @@ -201,7 +201,7 @@ /* Utility function to format a USTAR header into a buffer. */ int __archive_write_format_header_ustar(struct archive *, char buff[512], - struct archive_entry *); + struct archive_entry *, int tartype); #define ARCHIVE_STATE_ANY 0xFFFFU #define ARCHIVE_STATE_NEW 1U @@ -231,17 +231,4 @@ #define err_combine(a,b) ((a) < (b) ? (a) : (b)) - -/* - * Private ACL handling: parse and generate ACL strings. - * These are private because they handle a lot of very weird formats - * that clients should not be messing with. Clients should only - * deal with their platform-native formats. Because of the need to - * support many formats cleanly, new arguments are likely to get added - * on a regular basis. Clients who try to use this interface are - * likely to be surprised when it changes. - */ -int __archive_entry_acl_parse_w(struct archive_entry *, - const wchar_t *, int type); - #endif ==== //depot/projects/gdb/lib/libarchive/archive_read.c#5 (text+ko) ==== @@ -33,11 +33,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.4 2004/04/05 21:12:29 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.5 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <err.h> #include <errno.h> #include <stdio.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_data_into_buffer.c#3 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_buffer.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_buffer.c,v 1.3 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <string.h> #include "archive.h" ==== //depot/projects/gdb/lib/libarchive/archive_read_data_into_fd.c#4 (text+ko) ==== @@ -25,13 +25,9 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.3 2004/03/19 22:37:06 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.4 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/types.h> - -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <unistd.h> #include "archive.h" ==== //depot/projects/gdb/lib/libarchive/archive_read_extract.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.5 2004/04/06 23:16:50 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.6 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/stat.h> #include <sys/types.h> @@ -34,9 +34,6 @@ #endif #include <sys/time.h> -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> #include <fcntl.h> #include <grp.h> @@ -773,15 +770,15 @@ static int set_extended_perm(struct archive *a, struct archive_entry *entry, int flags) { - int ret; + int ret, ret2; if ((flags & ARCHIVE_EXTRACT_PERM) == 0) return (ARCHIVE_OK); ret = set_fflags(a, entry); - if (ret == ARCHIVE_OK) - ret = set_acls(a, entry); - return (ret); + ret2 = set_acls(a, entry); + + return (err_combine(ret,ret2)); } static int @@ -831,6 +828,7 @@ { (void)a; (void)entry; + return (ARCHIVE_OK); } @@ -878,22 +876,33 @@ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { acl_create_entry(&acl, &acl_entry); - if (ae_tag == ARCHIVE_ENTRY_ACL_USER) { + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: acl_set_tag_type(acl_entry, ACL_USER); ae_uid = lookup_uid(a, ae_name, ae_id); acl_set_qualifier(acl_entry, &ae_uid); - } else if (ae_tag == ARCHIVE_ENTRY_ACL_GROUP) { + break; + case ARCHIVE_ENTRY_ACL_GROUP: acl_set_tag_type(acl_entry, ACL_GROUP); ae_gid = lookup_gid(a, ae_name, ae_id); acl_set_qualifier(acl_entry, &ae_gid); - } else if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ) + break; + case ARCHIVE_ENTRY_ACL_USER_OBJ: acl_set_tag_type(acl_entry, ACL_USER_OBJ); - else if (ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: acl_set_tag_type(acl_entry, ACL_GROUP_OBJ); - else if (ae_tag == ARCHIVE_ENTRY_ACL_MASK) + break; + case ARCHIVE_ENTRY_ACL_MASK: acl_set_tag_type(acl_entry, ACL_MASK); - else if (ae_tag == ARCHIVE_ENTRY_ACL_OTHER) + break; + case ARCHIVE_ENTRY_ACL_OTHER: acl_set_tag_type(acl_entry, ACL_OTHER); + break; + default: + /* XXX */ + break; + } acl_get_permset(acl_entry, &acl_permset); acl_clear_perms(acl_permset); @@ -906,6 +915,7 @@ } name = archive_entry_pathname(entry); + if (acl_set_file(name, acl_type, acl) != 0) { archive_set_error(a, errno, "Failed to set %s acl", typename); ret = ARCHIVE_WARN; ==== //depot/projects/gdb/lib/libarchive/archive_read_open_fd.c#2 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.1 2004/04/05 21:12:29 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.2 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> #include <stdlib.h> #include <string.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_open_file.c#4 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_file.c,v 1.3 2004/04/05 21:12:29 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_file.c,v 1.4 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> #include <fcntl.h> #include <stdlib.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_support_compression_all.c#3 (text+ko) ==== @@ -25,11 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_all.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $"); - -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_all.c,v 1.3 2004/04/12 01:16:16 kientzle Exp $"); #include "archive.h" ==== //depot/projects/gdb/lib/libarchive/archive_read_support_compression_bzip2.c#3 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.3 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <err.h> #include <errno.h> #include <stdlib.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_support_compression_gzip.c#4 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.3 2004/03/19 22:37:06 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.4 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> #include <stdlib.h> #include <string.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_support_compression_none.c#4 (text+ko) ==== @@ -25,11 +25,8 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.3 2004/04/05 21:12:29 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.4 2004/04/12 01:16:16 kientzle Exp $"); -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> #include <stdlib.h> #include <string.h> ==== //depot/projects/gdb/lib/libarchive/archive_read_support_format_all.c#3 (text+ko) ==== @@ -25,11 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_all.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $"); - -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_all.c,v 1.3 2004/04/12 01:16:16 kientzle Exp $"); #include "archive.h" ==== //depot/projects/gdb/lib/libarchive/archive_read_support_format_cpio.c#5 (text+ko) ==== @@ -25,13 +25,10 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.5 2004/03/19 22:37:06 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.6 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/stat.h> -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <err.h> #include <errno.h> /* #include <stdint.h> */ /* See archive_platform.h */ ==== //depot/projects/gdb/lib/libarchive/archive_read_support_format_tar.c#7 (text+ko) ==== @@ -25,12 +25,9 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.6 2004/04/05 21:12:29 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.7 2004/04/12 01:16:16 kientzle Exp $"); #include <sys/stat.h> -#ifdef HAVE_DMALLOC -#include <dmalloc.h> -#endif #include <errno.h> /* #include <stdint.h> */ /* See archive_platform.h */ #include <stdlib.h> @@ -97,8 +94,12 @@ struct archive_entry *, struct stat *, const void *h); static int header_longname(struct archive *, struct tar *, struct archive_entry *, struct stat *, const void *h); +static int header_volume(struct archive *, struct tar *, + struct archive_entry *, struct stat *, const void *h); static int header_ustar(struct archive *, struct tar *, struct archive_entry *, struct stat *, const void *h); +static int header_gnutar(struct archive *, struct tar *, + struct archive_entry *, struct stat *, const void *h); static int archive_read_format_tar_bid(struct archive *); static int archive_read_format_tar_cleanup(struct archive *); static int archive_read_format_tar_read_header(struct archive *, @@ -120,6 +121,13 @@ static int utf8_decode(wchar_t *, const char *, size_t length); int +archive_read_support_format_gnutar(struct archive *a) +{ + return (archive_read_support_format_tar(a)); +} + + +int archive_read_support_format_tar(struct archive *a) { struct tar *tar; @@ -185,11 +193,6 @@ ARCHIVE_FORMAT_TAR) bid++; - /* If last header was my preferred format, bid a bit more. */ - if (a->archive_format == ARCHIVE_FORMAT_TAR_USTAR || - a->archive_format == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) - bid++; - /* Now let's look at the actual header and see if it matches. */ bytes_read = (a->compression_read_ahead)(a, &h, 512); if (bytes_read < 512) @@ -211,6 +214,11 @@ &&(memcmp(header->version, "00", 2)==0)) bid += 56; + /* Recognize GNU tar format as well. */ + if ((memcmp(header->magic, "ustar ", 6) == 0) + &&(memcmp(header->version, " \0", 2)==0)) + bid += 56; + /* Type flag must be null, digit or A-Z, a-z. */ if (header->typeflag[0] != 0 && !( header->typeflag[0] >= '0' && header->typeflag[0] <= '9') && @@ -280,7 +288,6 @@ /* Check for end-of-archive mark. */ if (((*(const char *)h)==0) && archive_block_is_null(h)) { - /* TODO: Store file location of start of block */ archive_set_error(a, 0, NULL); return (ARCHIVE_EOF); } @@ -304,11 +311,7 @@ /* Determine the format variant. */ header = h; - if (memcmp(header->magic, "ustar", 5) != 0) { - a->archive_format = ARCHIVE_FORMAT_TAR; - a->archive_format_name = "tar (non-POSIX)"; - err = header_old_tar(a, tar, entry, st, h); - } else switch(header->typeflag[0]) { + switch(header->typeflag[0]) { case 'A': /* Solaris tar ACL */ a->archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; a->archive_format_name = "Solaris tar"; @@ -319,12 +322,15 @@ a->archive_format_name = "POSIX pax interchange format"; err = header_pax_global(a, tar, entry, st, h); break; - case 'K': /* Long link name (non-POSIX, but fairly common). */ + case 'K': /* Long link name (GNU tar, others) */ err = header_longlink(a, tar, entry, st, h); break; - case 'L': /* Long filename (non-POSIX, but fairly common). */ + case 'L': /* Long filename (GNU tar, others) */ err = header_longname(a, tar, entry, st, h); break; + case 'V': /* GNU volume header */ + err = header_volume(a, tar, entry, st, h); + break; case 'X': /* Used by SUN tar; same as 'x'. */ a->archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; a->archive_format_name = @@ -337,12 +343,21 @@ err = header_pax_extensions(a, tar, entry, st, h); break; default: - if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE - && a->archive_format != ARCHIVE_FORMAT_TAR_USTAR) { - a->archive_format = ARCHIVE_FORMAT_TAR_USTAR; - a->archive_format_name = "POSIX ustar format"; + if (memcmp(header->magic, "ustar \0", 8) == 0) { + a->archive_format = ARCHIVE_FORMAT_TAR_GNUTAR; + a->archive_format_name = "GNU tar format"; + err = header_gnutar(a, tar, entry, st, h); + } else if (memcmp(header->magic, "ustar", 5) == 0) { + if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) { >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404130037.i3D0bvHO003853>