archive_write_set_format_pax.c (342360) | archive_write_set_format_pax.c (348607) |
---|---|
1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * Copyright (c) 2010-2012 Michihiro NAKAJIMA 4 * Copyright (c) 2016 Martin Matuska 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include "archive_platform.h" | 1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * Copyright (c) 2010-2012 Michihiro NAKAJIMA 4 * Copyright (c) 2016 Martin Matuska 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include "archive_platform.h" |
29__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c 342360 2018-12-21 23:33:05Z mm $"); | 29__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c 348607 2019-06-04 10:35:54Z mm $"); |
30 31#ifdef HAVE_ERRNO_H 32#include <errno.h> 33#endif 34#ifdef HAVE_STDLIB_H 35#include <stdlib.h> 36#endif 37#ifdef HAVE_STRING_H --- 1071 unchanged lines hidden (view full) --- 1109 need_extension = 1; 1110 1111 acl_types = archive_entry_acl_types(entry_original); 1112 1113 /* If there are any ACL entries, we need an extension */ 1114 if (!need_extension && acl_types != 0) 1115 need_extension = 1; 1116 | 30 31#ifdef HAVE_ERRNO_H 32#include <errno.h> 33#endif 34#ifdef HAVE_STDLIB_H 35#include <stdlib.h> 36#endif 37#ifdef HAVE_STRING_H --- 1071 unchanged lines hidden (view full) --- 1109 need_extension = 1; 1110 1111 acl_types = archive_entry_acl_types(entry_original); 1112 1113 /* If there are any ACL entries, we need an extension */ 1114 if (!need_extension && acl_types != 0) 1115 need_extension = 1; 1116 |
1117 /* If the symlink type is defined, we need an extension */ 1118 if (!need_extension && archive_entry_symlink_type(entry_main) > 0) 1119 need_extension = 1; 1120 |
|
1117 /* 1118 * Libarchive used to include these in extended headers for 1119 * restricted pax format, but that confused people who 1120 * expected ustar-like time semantics. So now we only include 1121 * them in full pax format. 1122 */ 1123 if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED) { 1124 if (archive_entry_ctime(entry_main) != 0 || --- 117 unchanged lines hidden (view full) --- 1242 1243 /* Store extended attributes */ 1244 if (archive_write_pax_header_xattrs(a, pax, entry_original) 1245 == ARCHIVE_FATAL) { 1246 archive_entry_free(entry_main); 1247 archive_string_free(&entry_name); 1248 return (ARCHIVE_FATAL); 1249 } | 1121 /* 1122 * Libarchive used to include these in extended headers for 1123 * restricted pax format, but that confused people who 1124 * expected ustar-like time semantics. So now we only include 1125 * them in full pax format. 1126 */ 1127 if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED) { 1128 if (archive_entry_ctime(entry_main) != 0 || --- 117 unchanged lines hidden (view full) --- 1246 1247 /* Store extended attributes */ 1248 if (archive_write_pax_header_xattrs(a, pax, entry_original) 1249 == ARCHIVE_FATAL) { 1250 archive_entry_free(entry_main); 1251 archive_string_free(&entry_name); 1252 return (ARCHIVE_FATAL); 1253 } |
1254 1255 /* Store extended symlink information */ 1256 if (archive_entry_symlink_type(entry_main) == 1257 AE_SYMLINK_TYPE_FILE) { 1258 add_pax_attr(&(pax->pax_header), 1259 "LIBARCHIVE.symlinktype", "file"); 1260 } else if (archive_entry_symlink_type(entry_main) == 1261 AE_SYMLINK_TYPE_DIRECTORY) { 1262 add_pax_attr(&(pax->pax_header), 1263 "LIBARCHIVE.symlinktype", "dir"); 1264 } |
|
1250 } 1251 1252 /* Only regular files have data. */ 1253 if (archive_entry_filetype(entry_main) != AE_IFREG) 1254 archive_entry_set_size(entry_main, 0); 1255 1256 /* 1257 * Pax-restricted does not store data for hardlinks, in order --- 714 unchanged lines hidden --- | 1265 } 1266 1267 /* Only regular files have data. */ 1268 if (archive_entry_filetype(entry_main) != AE_IFREG) 1269 archive_entry_set_size(entry_main, 0); 1270 1271 /* 1272 * Pax-restricted does not store data for hardlinks, in order --- 714 unchanged lines hidden --- |