Merge ^/head r343956 through r344177.

This commit is contained in:
Dimitry Andric 2019-02-15 21:50:45 +00:00
commit c981cbbd13
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang800-import/; revision=344178
205 changed files with 7612 additions and 1609 deletions

View file

@ -44,6 +44,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
modules on kernels not having 'device iflib', the iflib.ko module
is loaded automatically.
20190125:
The IEEE80211_AMPDU_AGE and AH_SUPPORT_AR5416 kernel configuration
options no longer exist since r343219 and r343427 respectively;
nothing uses them, so they should be just removed from custom
kernel config files.
20181230:
r342635 changes the way efibootmgr(8) works by requiring users to add
the -b (bootnum) parameter for commands where the bootnum was previously
@ -237,7 +243,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
20180719:
ARM64 now have efifb support, if you want to have serial console
on your arm64 board when an screen is connected and the bootloader
setup a frambuffer for us to use, just add :
setup a framebuffer for us to use, just add :
boot_serial=YES
boot_multicons=YES
in /boot/loader.conf

View file

@ -104,7 +104,7 @@ static arith_t arith_lookupvarint(char *varname)
if (str == NULL || *str == '\0')
str = "0";
errno = 0;
result = strtoarith_t(str, &p, 0);
result = strtoarith_t(str, &p);
if (errno != 0 || *p != '\0')
yyerror("variable conversion error");
return result;

View file

@ -90,4 +90,5 @@ union yystype {
extern union yystype yylval;
arith_t strtoarith_t(const char *restrict nptr, char **restrict endptr);
int yylex(void);

View file

@ -35,6 +35,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
@ -50,6 +52,32 @@ __FBSDID("$FreeBSD$");
#error Arithmetic tokens are out of order.
#endif
arith_t
strtoarith_t(const char *restrict nptr, char **restrict endptr)
{
arith_t val;
while (isspace((unsigned char)*nptr))
nptr++;
switch (*nptr) {
case '-':
return strtoimax(nptr, endptr, 0);
case '0':
return (arith_t)strtoumax(nptr, endptr, 0);
default:
val = (arith_t)strtoumax(nptr, endptr, 0);
if (val >= 0)
return val;
else if (val == ARITH_MIN) {
errno = ERANGE;
return ARITH_MIN;
} else {
errno = ERANGE;
return ARITH_MAX;
}
}
}
int
yylex(void)
{
@ -78,7 +106,7 @@ yylex(void)
case '7':
case '8':
case '9':
yylval.val = strtoarith_t(buf, &end, 0);
yylval.val = strtoarith_t(buf, &end);
arith_buf = end;
return ARITH_NUM;
case 'A':

View file

@ -59,7 +59,6 @@
*/
typedef intmax_t arith_t;
#define ARITH_FORMAT_STR "%" PRIdMAX
#define strtoarith_t(nptr, endptr, base) (intmax_t)strtoumax(nptr, endptr, base)
#define ARITH_MIN INTMAX_MIN
#define ARITH_MAX INTMAX_MAX

View file

@ -22,6 +22,8 @@ ${PACKAGE}FILES+= arith12.0
${PACKAGE}FILES+= arith13.0
${PACKAGE}FILES+= arith14.0
${PACKAGE}FILES+= arith15.0
${PACKAGE}FILES+= arith16.0
${PACKAGE}FILES+= arith17.0
${PACKAGE}FILES+= assign1.0
${PACKAGE}FILES+= cmdsubst1.0
${PACKAGE}FILES+= cmdsubst2.0

View file

@ -0,0 +1,26 @@
# $FreeBSD$
failures=0
for x in \
0x10000000000000000 \
-0x8000000000000001 \
0xfffffffffffffffffffffffffffffffff \
-0xfffffffffffffffffffffffffffffffff \
02000000000000000000000 \
9223372036854775808 \
9223372036854775809 \
-9223372036854775809 \
9999999999999999999999999 \
-9999999999999999999999999
do
msg=$({
v=$((x)) || :
} 3>&1 >&2 2>&3 3>&-)
r=$?
if [ "$r" = 0 ] || [ -z "$msg" ]; then
printf 'Failed: %s\n' "$x"
: $((failures += 1))
fi
done
exit $((failures > 0))

View file

@ -0,0 +1,3 @@
# $FreeBSD$
[ $((9223372036854775809)) -gt 0 ]

View file

@ -88,11 +88,11 @@ DEFINE_TEST(test_option_t)
setlocale(LC_ALL, "");
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
strftime(date2, sizeof(date), "%b %d %Y", localtime(&mtime));
_snprintf(date, sizeof(date)-1, "%12s file", date2);
strftime(date2, sizeof(date2)-1, "%b %d %Y", localtime(&mtime));
_snprintf(date, sizeof(date)-1, "%12.12s file", date2);
#else
strftime(date2, sizeof(date), "%b %e %Y", localtime(&mtime));
snprintf(date, sizeof(date)-1, "%12s file", date2);
strftime(date2, sizeof(date2)-1, "%b %e %Y", localtime(&mtime));
snprintf(date, sizeof(date)-1, "%12.12s file", date2);
#endif
assertEqualMem(p + 42, date, strlen(date));
free(p);

View file

@ -138,14 +138,10 @@ archive_acl_clear(struct archive_acl *acl)
free(acl->acl_head);
acl->acl_head = ap;
}
if (acl->acl_text_w != NULL) {
free(acl->acl_text_w);
acl->acl_text_w = NULL;
}
if (acl->acl_text != NULL) {
free(acl->acl_text);
acl->acl_text = NULL;
}
free(acl->acl_text_w);
acl->acl_text_w = NULL;
free(acl->acl_text);
acl->acl_text = NULL;
acl->acl_p = NULL;
acl->acl_types = 0;
acl->acl_state = 0; /* Not counting. */
@ -324,14 +320,10 @@ acl_new_entry(struct archive_acl *acl,
return (NULL);
}
if (acl->acl_text_w != NULL) {
free(acl->acl_text_w);
acl->acl_text_w = NULL;
}
if (acl->acl_text != NULL) {
free(acl->acl_text);
acl->acl_text = NULL;
}
free(acl->acl_text_w);
acl->acl_text_w = NULL;
free(acl->acl_text);
acl->acl_text = NULL;
/*
* If there's a matching entry already in the list, overwrite it.

View file

@ -1560,10 +1560,8 @@ archive_entry_acl_text_compat(int *flags)
const wchar_t *
archive_entry_acl_text_w(struct archive_entry *entry, int flags)
{
if (entry->acl.acl_text_w != NULL) {
free(entry->acl.acl_text_w);
entry->acl.acl_text_w = NULL;
}
free(entry->acl.acl_text_w);
entry->acl.acl_text_w = NULL;
if (archive_entry_acl_text_compat(&flags) == 0)
entry->acl.acl_text_w = archive_acl_to_text_w(&entry->acl,
NULL, flags, entry->archive);
@ -1574,10 +1572,8 @@ archive_entry_acl_text_w(struct archive_entry *entry, int flags)
const char *
archive_entry_acl_text(struct archive_entry *entry, int flags)
{
if (entry->acl.acl_text != NULL) {
free(entry->acl.acl_text);
entry->acl.acl_text = NULL;
}
free(entry->acl.acl_text);
entry->acl.acl_text = NULL;
if (archive_entry_acl_text_compat(&flags) == 0)
entry->acl.acl_text = archive_acl_to_text_l(&entry->acl, NULL,
flags, NULL);
@ -1590,10 +1586,8 @@ int
_archive_entry_acl_text_l(struct archive_entry *entry, int flags,
const char **acl_text, size_t *len, struct archive_string_conv *sc)
{
if (entry->acl.acl_text != NULL) {
free(entry->acl.acl_text);
entry->acl.acl_text = NULL;
}
free(entry->acl.acl_text);
entry->acl.acl_text = NULL;
if (archive_entry_acl_text_compat(&flags) == 0)
entry->acl.acl_text = archive_acl_to_text_l(&entry->acl,

View file

@ -60,6 +60,9 @@ __RCSID("$NetBSD$");
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@
/* Ppmd8.h -- PPMdI codec
2011-01-27 : Igor Pavlov : Public domain
This code is based on:
PPMd var.I (2002): Dmitry Shkarin : Public domain
Carryless rangecoder (1999): Dmitry Subbotin : Public domain */
#ifndef __PPMD8_H
#define __PPMD8_H
#include "archive_ppmd_private.h"
#define PPMD8_MIN_ORDER 2
#define PPMD8_MAX_ORDER 16
struct CPpmd8_Context_;
typedef
#ifdef PPMD_32BIT
struct CPpmd8_Context_ *
#else
UInt32
#endif
CPpmd8_Context_Ref;
#pragma pack(push, 1)
typedef struct CPpmd8_Context_
{
Byte NumStats;
Byte Flags;
UInt16 SummFreq;
CPpmd_State_Ref Stats;
CPpmd8_Context_Ref Suffix;
} CPpmd8_Context;
#pragma pack(pop)
#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
/* The BUG in Shkarin's code for FREEZE mode was fixed, but that fixed
code is not compatible with original code for some files compressed
in FREEZE mode. So we disable FREEZE mode support. */
enum
{
PPMD8_RESTORE_METHOD_RESTART,
PPMD8_RESTORE_METHOD_CUT_OFF
#ifdef PPMD8_FREEZE_SUPPORT
, PPMD8_RESTORE_METHOD_FREEZE
#endif
};
typedef struct
{
CPpmd8_Context *MinContext, *MaxContext;
CPpmd_State *FoundState;
unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder;
Int32 RunLength, InitRL; /* must be 32-bit at least */
UInt32 Size;
UInt32 GlueCount;
Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
UInt32 AlignOffset;
unsigned RestoreMethod;
/* Range Coder */
UInt32 Range;
UInt32 Code;
UInt32 Low;
union
{
IByteIn *In;
IByteOut *Out;
} Stream;
Byte Indx2Units[PPMD_NUM_INDEXES];
Byte Units2Indx[128];
CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
UInt32 Stamps[PPMD_NUM_INDEXES];
Byte NS2BSIndx[256], NS2Indx[260];
CPpmd_See DummySee, See[24][32];
UInt16 BinSumm[25][64];
} CPpmd8;
void Ppmd8_Construct(CPpmd8 *p);
Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size);
void Ppmd8_Free(CPpmd8 *p);
void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod);
#define Ppmd8_WasAllocated(p) ((p)->Base != NULL)
/* ---------- Internal Functions ---------- */
extern const Byte PPMD8_kExpEscape[16];
#ifdef PPMD_32BIT
#define Ppmd8_GetPtr(p, ptr) (ptr)
#define Ppmd8_GetContext(p, ptr) (ptr)
#define Ppmd8_GetStats(p, ctx) ((ctx)->Stats)
#else
#define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
#define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
#define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
#endif
void Ppmd8_Update1(CPpmd8 *p);
void Ppmd8_Update1_0(CPpmd8 *p);
void Ppmd8_Update2(CPpmd8 *p);
void Ppmd8_UpdateBin(CPpmd8 *p);
#define Ppmd8_GetBinSumm(p) \
&p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked, UInt32 *scale);
/* ---------- Decode ---------- */
Bool Ppmd8_RangeDec_Init(CPpmd8 *p);
#define Ppmd8_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
int Ppmd8_DecodeSymbol(CPpmd8 *p); /* returns: -1 as EndMarker, -2 as DataError */
/* ---------- Encode ---------- */
#define Ppmd8_RangeEnc_Init(p) { (p)->Low = 0; (p)->Range = 0xFFFFFFFF; }
void Ppmd8_RangeEnc_FlushData(CPpmd8 *p);
void Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol); /* symbol = -1 means EndMarker */
typedef struct
{
/* Base Functions */
void (*Ppmd8_Construct)(CPpmd8 *p);
Bool (*Ppmd8_Alloc)(CPpmd8 *p, UInt32 size);
void (*Ppmd8_Free)(CPpmd8 *p);
void (*Ppmd8_Init)(CPpmd8 *p, unsigned max_order, unsigned restore_method);
#define Ppmd7_WasAllocated(p) ((p)->Base != NULL)
/* Decode Functions */
int (*Ppmd8_RangeDec_Init)(CPpmd8 *p);
int (*Ppmd8_DecodeSymbol)(CPpmd8 *p);
} IPpmd8;
extern const IPpmd8 __archive_ppmd8_functions;
#endif

View file

@ -856,7 +856,12 @@ next_entry(struct archive_read_disk *a, struct tree *t,
const struct stat *st; /* info to use for this entry */
const struct stat *lst;/* lstat() information */
const char *name;
int descend, r;
int delayed, delayed_errno, descend, r;
struct archive_string delayed_str;
delayed = ARCHIVE_OK;
delayed_errno = 0;
archive_string_init(&delayed_str);
st = NULL;
lst = NULL;
@ -885,11 +890,23 @@ next_entry(struct archive_read_disk *a, struct tree *t,
case TREE_REGULAR:
lst = tree_current_lstat(t);
if (lst == NULL) {
if (errno == ENOENT && t->depth > 0) {
delayed = ARCHIVE_WARN;
delayed_errno = errno;
if (delayed_str.length == 0) {
archive_string_sprintf(&delayed_str,
"%s", tree_current_path(t));
} else {
archive_string_sprintf(&delayed_str,
" %s", tree_current_path(t));
}
} else {
archive_set_error(&a->archive, errno,
"%s: Cannot stat",
tree_current_path(t));
tree_enter_initial_dir(t);
return (ARCHIVE_FAILED);
}
}
break;
}
@ -1083,6 +1100,18 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_read_disk_entry_from_file(&(a->archive), entry,
t->entry_fd, st);
if (r == ARCHIVE_OK) {
r = delayed;
if (r != ARCHIVE_OK) {
archive_string_sprintf(&delayed_str, ": %s",
"File removed before we read it");
archive_set_error(&(a->archive), delayed_errno,
"%s", delayed_str.s);
}
}
if (!archive_string_empty(&delayed_str))
archive_string_free(&delayed_str);
return (r);
}

View file

@ -174,8 +174,7 @@ file_close(struct archive *a, void *client_data)
struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
(void)a; /* UNUSED */
if (mine->buffer != NULL)
free(mine->buffer);
free(mine->buffer);
free(mine);
return (ARCHIVE_OK);
}

View file

@ -2964,13 +2964,7 @@ get_uncompressed_data(struct archive_read *a, const void **buff, size_t size,
if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
/* Copy mode. */
/*
* Note: '1' here is a performance optimization.
* Recall that the decompression layer returns a count of
* available bytes; asking for more than that forces the
* decompressor to combine reads by copying data.
*/
*buff = __archive_read_ahead(a, 1, &bytes_avail);
*buff = __archive_read_ahead(a, minimum, &bytes_avail);
if (bytes_avail <= 0) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
@ -3323,8 +3317,7 @@ setup_decode_folder(struct archive_read *a, struct _7z_folder *folder,
* Release the memory which the previous folder used for BCJ2.
*/
for (i = 0; i < 3; i++) {
if (zip->sub_stream_buff[i] != NULL)
free(zip->sub_stream_buff[i]);
free(zip->sub_stream_buff[i]);
zip->sub_stream_buff[i] = NULL;
}

View file

@ -138,8 +138,7 @@ archive_read_format_ar_cleanup(struct archive_read *a)
struct ar *ar;
ar = (struct ar *)(a->format->data);
if (ar->strtab)
free(ar->strtab);
free(ar->strtab);
free(ar);
(a->format->data) = NULL;
return (ARCHIVE_OK);
@ -388,9 +387,10 @@ _ar_read_header(struct archive_read *a, struct archive_entry *entry,
/*
* "/" is the SVR4/GNU archive symbol table.
* "/SYM64/" is the SVR4/GNU 64-bit variant archive symbol table.
*/
if (strcmp(filename, "/") == 0) {
archive_entry_copy_pathname(entry, "/");
if (strcmp(filename, "/") == 0 || strcmp(filename, "/SYM64/") == 0) {
archive_entry_copy_pathname(entry, filename);
/* Parse the time, owner, mode, size fields. */
r = ar_parse_common_header(ar, entry, h);
/* Force the file type to a regular file. */

View file

@ -955,8 +955,7 @@ archive_read_format_cpio_cleanup(struct archive_read *a)
while (cpio->links_head != NULL) {
struct links_entry *lp = cpio->links_head->next;
if (cpio->links_head->name)
free(cpio->links_head->name);
free(cpio->links_head->name);
free(cpio->links_head);
cpio->links_head = lp;
}

View file

@ -1724,8 +1724,7 @@ archive_read_format_iso9660_cleanup(struct archive_read *a)
free(iso9660->read_ce_req.reqs);
archive_string_free(&iso9660->pathname);
archive_string_free(&iso9660->previous_pathname);
if (iso9660->pending_files.files)
free(iso9660->pending_files.files);
free(iso9660->pending_files.files);
#ifdef HAVE_ZLIB_H
free(iso9660->entry_zisofs.uncompressed_buffer);
free(iso9660->entry_zisofs.block_pointers);
@ -2102,6 +2101,7 @@ parse_rockridge(struct archive_read *a, struct file_info *file,
const unsigned char *p, const unsigned char *end)
{
struct iso9660 *iso9660;
int entry_seen = 0;
iso9660 = (struct iso9660 *)(a->format->data);
@ -2257,8 +2257,16 @@ parse_rockridge(struct archive_read *a, struct file_info *file,
}
p += p[2];
entry_seen = 1;
}
if (entry_seen)
return (ARCHIVE_OK);
else {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Tried to parse Rockridge extensions, but none found");
return (ARCHIVE_WARN);
}
return (ARCHIVE_OK);
}
static int
@ -3029,8 +3037,7 @@ heap_add_entry(struct archive_read *a, struct heap_queue *heap,
if (heap->allocated)
memcpy(new_pending_files, heap->files,
heap->allocated * sizeof(new_pending_files[0]));
if (heap->files != NULL)
free(heap->files);
free(heap->files);
heap->files = new_pending_files;
heap->allocated = new_size;
}

View file

@ -588,8 +588,7 @@ static int run_filter(struct archive_read* a, struct filter_info* flt) {
int ret;
struct rar5* rar = get_context(a);
if(rar->cstate.filtered_buf)
free(rar->cstate.filtered_buf);
free(rar->cstate.filtered_buf);
rar->cstate.filtered_buf = malloc(flt->block_length);
if(!rar->cstate.filtered_buf) {
@ -772,7 +771,7 @@ static void free_filters(struct rar5* rar) {
struct filter_info* f = NULL;
/* Pop_front will also decrease the collection's size. */
if(CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)) && f != NULL)
if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
free(f);
}
@ -873,7 +872,7 @@ static int read_var(struct archive_read* a, uint64_t* pvalue,
/* Strip the MSB from the input byte and add the resulting number
* to the `result`. */
result += (b & 0x7F) << shift;
result += (b & (uint64_t)0x7F) << shift;
/* MSB set to 1 means we need to continue decoding process. MSB set
* to 0 means we're done.
@ -1301,7 +1300,7 @@ static int process_head_file(struct archive_read* a, struct rar5* rar,
char name_utf8_buf[2048 * 4];
const uint8_t* p;
memset(entry, 0, sizeof(struct archive_entry));
archive_entry_clear(entry);
/* Do not reset file context if we're switching archives. */
if(!rar->cstate.switch_multivolume) {
@ -1795,8 +1794,14 @@ static int skip_base_block(struct archive_read* a) {
int ret;
struct rar5* rar = get_context(a);
struct archive_entry entry;
ret = process_base_block(a, &entry);
/* Create a new local archive_entry structure that will be operated on
* by header reader; operations on this archive_entry will be discarded.
*/
struct archive_entry* entry = archive_entry_new();
ret = process_base_block(a, entry);
/* Discard operations on this archive_entry structure. */
archive_entry_free(entry);
if(rar->generic.last_header_id == 2 && rar->generic.split_before > 0)
return ARCHIVE_OK;
@ -1836,13 +1841,14 @@ static int rar5_read_header(struct archive_read *a,
static void init_unpack(struct rar5* rar) {
rar->file.calculated_crc32 = 0;
rar->cstate.window_mask = rar->cstate.window_size - 1;
if (rar->cstate.window_size)
rar->cstate.window_mask = rar->cstate.window_size - 1;
else
rar->cstate.window_mask = 0;
if(rar->cstate.window_buf)
free(rar->cstate.window_buf);
free(rar->cstate.window_buf);
if(rar->cstate.filtered_buf)
free(rar->cstate.filtered_buf);
free(rar->cstate.filtered_buf);
rar->cstate.window_buf = calloc(1, rar->cstate.window_size);
rar->cstate.filtered_buf = calloc(1, rar->cstate.window_size);
@ -2676,13 +2682,21 @@ static int merge_block(struct archive_read* a, ssize_t block_size,
if(rar->vol.push_buf)
free((void*) rar->vol.push_buf);
rar->vol.push_buf = malloc(block_size);
/* Increasing the allocation block by 8 is due to bit reading functions,
* which are using additional 2 or 4 bytes. Allocating the block size
* by exact value would make bit reader perform reads from invalid memory
* block when reading the last byte from the buffer. */
rar->vol.push_buf = malloc(block_size + 8);
if(!rar->vol.push_buf) {
archive_set_error(&a->archive, ENOMEM, "Can't allocate memory for a "
"merge block buffer.");
return ARCHIVE_FATAL;
}
/* Valgrind complains if the extension block for bit reader is not
* initialized, so initialize it. */
memset(&rar->vol.push_buf[block_size], 0, 8);
/* A single block can span across multiple multivolume archive files,
* so we use a loop here. This loop will consume enough multivolume
* archive files until the whole block is read. */
@ -3394,14 +3408,11 @@ static int64_t rar5_seek_data(struct archive_read *a, int64_t offset,
static int rar5_cleanup(struct archive_read *a) {
struct rar5* rar = get_context(a);
if(rar->cstate.window_buf)
free(rar->cstate.window_buf);
free(rar->cstate.window_buf);
if(rar->cstate.filtered_buf)
free(rar->cstate.filtered_buf);
free(rar->cstate.filtered_buf);
if(rar->vol.push_buf)
free(rar->vol.push_buf);
free(rar->vol.push_buf);
free_filters(rar);
cdeque_free(&rar->cstate.filters);

View file

@ -1229,8 +1229,7 @@ heap_add_entry(struct archive_read *a,
}
memcpy(new_pending_files, heap->files,
heap->allocated * sizeof(new_pending_files[0]));
if (heap->files != NULL)
free(heap->files);
free(heap->files);
heap->files = new_pending_files;
heap->allocated = new_size;
}

View file

@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#ifdef HAVE_BZLIB_H
#include <bzlib.h>
#endif
#ifdef HAVE_LZMA_H
#include <lzma.h>
#endif
#include "archive.h"
#include "archive_digest_private.h"
@ -63,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
#include "archive_rb.h"
#include "archive_read_private.h"
#include "archive_ppmd8_private.h"
#ifndef HAVE_ZLIB_H
#include "archive_crc32.h"
@ -165,13 +172,29 @@ struct zip {
char decompress_init;
char end_of_entry;
#ifdef HAVE_ZLIB_H
unsigned char *uncompressed_buffer;
size_t uncompressed_buffer_size;
#ifdef HAVE_ZLIB_H
z_stream stream;
char stream_valid;
#endif
#if HAVE_LZMA_H && HAVE_LIBLZMA
lzma_stream zipx_lzma_stream;
char zipx_lzma_valid;
#endif
#ifdef HAVE_BZLIB_H
bz_stream bzstream;
char bzstream_valid;
#endif
IByteIn zipx_ppmd_stream;
ssize_t zipx_ppmd_read_compressed;
CPpmd8 ppmd8;
char ppmd8_valid;
struct archive_string_conv *sconv;
struct archive_string_conv *sconv_default;
struct archive_string_conv *sconv_utf8;
@ -222,6 +245,27 @@ struct zip {
/* Many systems define min or MIN, but not all. */
#define zipmin(a,b) ((a) < (b) ? (a) : (b))
/* This function is used by Ppmd8_DecodeSymbol during decompression of Ppmd8
* streams inside ZIP files. It has 2 purposes: one is to fetch the next
* compressed byte from the stream, second one is to increase the counter how
* many compressed bytes were read. */
static Byte
ppmd_read(void* p) {
/* Get the handle to current decompression context. */
struct archive_read *a = ((IByteIn*)p)->a;
struct zip *zip = (struct zip*) a->format->data;
/* Fetch next byte. */
const uint8_t* data = __archive_read_ahead(a, 1, NULL);
__archive_read_consume(a, 1);
/* Increment the counter. */
++zip->zipx_ppmd_read_compressed;
/* Return the next compressed byte. */
return data[0];
}
/* ------------------------------------------------------------------------ */
/*
@ -372,6 +416,8 @@ static const struct {
{17, "reserved"}, /* Reserved by PKWARE */
{18, "ibm-terse-new"}, /* File is compressed using IBM TERSE (new) */
{19, "ibm-lz777"},/* IBM LZ77 z Architecture (PFS) */
{95, "xz"}, /* XZ compressed data */
{96, "jpeg"}, /* JPEG compressed data */
{97, "wav-pack"}, /* WavPack compressed data */
{98, "ppmd-1"}, /* PPMd version I, Rev 1 */
{99, "aes"} /* WinZip AES encryption */
@ -1296,6 +1342,695 @@ zip_read_data_none(struct archive_read *a, const void **_buff,
return (ARCHIVE_OK);
}
static int
consume_optional_marker(struct archive_read *a, struct zip *zip)
{
if (zip->end_of_entry && (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
const char *p;
if (NULL == (p = __archive_read_ahead(a, 24, NULL))) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP end-of-file record");
return (ARCHIVE_FATAL);
}
/* Consume the optional PK\007\010 marker. */
if (p[0] == 'P' && p[1] == 'K' &&
p[2] == '\007' && p[3] == '\010') {
p += 4;
zip->unconsumed = 4;
}
if (zip->entry->flags & LA_USED_ZIP64) {
uint64_t compressed, uncompressed;
zip->entry->crc32 = archive_le32dec(p);
compressed = archive_le64dec(p + 4);
uncompressed = archive_le64dec(p + 12);
if (compressed > INT64_MAX || uncompressed > INT64_MAX) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Overflow of 64-bit file sizes");
return ARCHIVE_FAILED;
}
zip->entry->compressed_size = compressed;
zip->entry->uncompressed_size = uncompressed;
zip->unconsumed += 20;
} else {
zip->entry->crc32 = archive_le32dec(p);
zip->entry->compressed_size = archive_le32dec(p + 4);
zip->entry->uncompressed_size = archive_le32dec(p + 8);
zip->unconsumed += 12;
}
}
return (ARCHIVE_OK);
}
#if HAVE_LZMA_H && HAVE_LIBLZMA
static int
zipx_xz_init(struct archive_read *a, struct zip *zip)
{
lzma_ret r;
if(zip->zipx_lzma_valid) {
lzma_end(&zip->zipx_lzma_stream);
zip->zipx_lzma_valid = 0;
}
memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
r = lzma_stream_decoder(&zip->zipx_lzma_stream, UINT64_MAX, 0);
if (r != LZMA_OK) {
archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
"xz initialization failed(%d)",
r);
return (ARCHIVE_FAILED);
}
zip->zipx_lzma_valid = 1;
free(zip->uncompressed_buffer);
zip->uncompressed_buffer_size = 256 * 1024;
zip->uncompressed_buffer =
(uint8_t*) malloc(zip->uncompressed_buffer_size);
if (zip->uncompressed_buffer == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory for xz decompression");
return (ARCHIVE_FATAL);
}
zip->decompress_init = 1;
return (ARCHIVE_OK);
}
static int
zipx_lzma_alone_init(struct archive_read *a, struct zip *zip)
{
lzma_ret r;
const uint8_t* p;
#pragma pack(push)
#pragma pack(1)
struct _alone_header {
uint8_t bytes[5];
uint64_t uncompressed_size;
} alone_header;
#pragma pack(pop)
/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma that
* is a part of XZ Utils. The stream format stored inside ZIPX file is a
* modified "lzma alone" file format, that was used by the `lzma` utility
* which was later deprecated in favour of `xz` utility. Since those
* formats are nearly the same, we can use a standard "lzma alone" decoder
* from XZ Utils. */
memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
r = lzma_alone_decoder(&zip->zipx_lzma_stream, UINT64_MAX);
if (r != LZMA_OK) {
archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
"lzma initialization failed(%d)", r);
return (ARCHIVE_FAILED);
}
/* Flag the cleanup function that we want our lzma-related structures
* to be freed later. */
zip->zipx_lzma_valid = 1;
/* The "lzma alone" file format and the stream format inside ZIPx are
* almost the same. Here's an example of a structure of "lzma alone"
* format:
*
* $ cat /bin/ls | lzma | xxd | head -n 1
* 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
*
* 5 bytes 8 bytes n bytes
* <lzma_params><uncompressed_size><data...>
*
* lzma_params is a 5-byte blob that has to be decoded to extract
* parameters of this LZMA stream. The uncompressed_size field is an
* uint64_t value that contains information about the size of the
* uncompressed file, or UINT64_MAX if this value is unknown. The <data...>
* part is the actual lzma-compressed data stream.
*
* Now here's the structure of the stream inside the ZIPX file:
*
* $ cat stream_inside_zipx | xxd | head -n 1
* 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
*
* 2byte 2byte 5 bytes n bytes
* <magic1><magic2><lzma_params><data...>
*
* This means that the ZIPX file contains an additional magic1 and magic2
* headers, the lzma_params field contains the same parameter set as in the
* "lzma alone" format, and the <data...> field is the same as in the "lzma
* alone" format as well. Note that also the zipx format is missing the
* uncompressed_size field.
*
* So, in order to use the "lzma alone" decoder for the zipx lzma stream,
* we simply need to shuffle around some fields, prepare a new lzma alone
* header, feed it into lzma alone decoder so it will initialize itself
* properly, and then we can start feeding normal zipx lzma stream into the
* decoder.
*/
/* Read magic1,magic2,lzma_params from the ZIPX stream. */
if((p = __archive_read_ahead(a, 9, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated lzma data");
return (ARCHIVE_FATAL);
}
if(p[2] != 0x05 || p[3] != 0x00) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Invalid lzma data");
return (ARCHIVE_FATAL);
}
/* Prepare an lzma alone header: copy the lzma_params blob into a proper
* place into the lzma alone header. */
memcpy(&alone_header.bytes[0], p + 4, 5);
/* Initialize the 'uncompressed size' field to unknown; we'll manually
* monitor how many bytes there are still to be uncompressed. */
alone_header.uncompressed_size = UINT64_MAX;
if(!zip->uncompressed_buffer) {
zip->uncompressed_buffer_size = 256 * 1024;
zip->uncompressed_buffer =
(uint8_t*) malloc(zip->uncompressed_buffer_size);
if (zip->uncompressed_buffer == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory for lzma decompression");
return (ARCHIVE_FATAL);
}
}
zip->zipx_lzma_stream.next_in = (void*) &alone_header;
zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
zip->zipx_lzma_stream.total_in = 0;
zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
zip->zipx_lzma_stream.total_out = 0;
/* Feed only the header into the lzma alone decoder. This will effectively
* initialize the decoder, and will not produce any output bytes yet. */
r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
if (r != LZMA_OK) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"lzma stream initialization error");
return ARCHIVE_FATAL;
}
/* We've already consumed some bytes, so take this into account. */
__archive_read_consume(a, 9);
zip->entry_bytes_remaining -= 9;
zip->entry_compressed_bytes_read += 9;
zip->decompress_init = 1;
return (ARCHIVE_OK);
}
static int
zip_read_data_zipx_xz(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip* zip = (struct zip *)(a->format->data);
int ret;
lzma_ret lz_ret;
const void* compressed_buf;
ssize_t bytes_avail, in_bytes, to_consume = 0;
(void) offset; /* UNUSED */
/* Initialize decompressor if not yet initialized. */
if (!zip->decompress_init) {
ret = zipx_xz_init(a, zip);
if (ret != ARCHIVE_OK)
return (ret);
}
compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
if (bytes_avail < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated xz file body");
return (ARCHIVE_FATAL);
}
in_bytes = zipmin(zip->entry_bytes_remaining, bytes_avail);
zip->zipx_lzma_stream.next_in = compressed_buf;
zip->zipx_lzma_stream.avail_in = in_bytes;
zip->zipx_lzma_stream.total_in = 0;
zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
zip->zipx_lzma_stream.total_out = 0;
/* Perform the decompression. */
lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
switch(lz_ret) {
case LZMA_DATA_ERROR:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"xz data error (error %d)", (int) lz_ret);
return (ARCHIVE_FATAL);
case LZMA_NO_CHECK:
case LZMA_OK:
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"xz unknown error %d", (int) lz_ret);
return (ARCHIVE_FATAL);
case LZMA_STREAM_END:
lzma_end(&zip->zipx_lzma_stream);
zip->zipx_lzma_valid = 0;
if((int64_t) zip->zipx_lzma_stream.total_in !=
zip->entry_bytes_remaining)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"xz premature end of stream");
return (ARCHIVE_FATAL);
}
zip->end_of_entry = 1;
break;
}
to_consume = zip->zipx_lzma_stream.total_in;
__archive_read_consume(a, to_consume);
zip->entry_bytes_remaining -= to_consume;
zip->entry_compressed_bytes_read += to_consume;
zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
*size = zip->zipx_lzma_stream.total_out;
*buff = zip->uncompressed_buffer;
ret = consume_optional_marker(a, zip);
if (ret != ARCHIVE_OK)
return (ret);
return (ARCHIVE_OK);
}
static int
zip_read_data_zipx_lzma_alone(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip* zip = (struct zip *)(a->format->data);
int ret;
lzma_ret lz_ret;
const void* compressed_buf;
ssize_t bytes_avail, in_bytes, to_consume;
(void) offset; /* UNUSED */
/* Initialize decompressor if not yet initialized. */
if (!zip->decompress_init) {
ret = zipx_lzma_alone_init(a, zip);
if (ret != ARCHIVE_OK)
return (ret);
}
/* Fetch more compressed data. The same note as in deflate handler applies
* here as well:
*
* Note: '1' here is a performance optimization. Recall that the
* decompression layer returns a count of available bytes; asking for more
* than that forces the decompressor to combine reads by copying data.
*/
compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
if (bytes_avail < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated lzma file body");
return (ARCHIVE_FATAL);
}
/* Set decompressor parameters. */
in_bytes = zipmin(zip->entry_bytes_remaining, bytes_avail);
zip->zipx_lzma_stream.next_in = compressed_buf;
zip->zipx_lzma_stream.avail_in = in_bytes;
zip->zipx_lzma_stream.total_in = 0;
zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
zip->zipx_lzma_stream.avail_out =
/* These lzma_alone streams lack end of stream marker, so let's make
* sure the unpacker won't try to unpack more than it's supposed to. */
zipmin((int64_t) zip->uncompressed_buffer_size,
zip->entry->uncompressed_size -
zip->entry_uncompressed_bytes_read);
zip->zipx_lzma_stream.total_out = 0;
/* Perform the decompression. */
lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
switch(lz_ret) {
case LZMA_DATA_ERROR:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"lzma data error (error %d)", (int) lz_ret);
return (ARCHIVE_FATAL);
case LZMA_OK:
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"lzma unknown error %d", (int) lz_ret);
return (ARCHIVE_FATAL);
}
to_consume = zip->zipx_lzma_stream.total_in;
/* Update pointers. */
__archive_read_consume(a, to_consume);
zip->entry_bytes_remaining -= to_consume;
zip->entry_compressed_bytes_read += to_consume;
zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
if(zip->entry_bytes_remaining == 0) {
zip->end_of_entry = 1;
}
/* Return values. */
*size = zip->zipx_lzma_stream.total_out;
*buff = zip->uncompressed_buffer;
/* Behave the same way as during deflate decompression. */
ret = consume_optional_marker(a, zip);
if (ret != ARCHIVE_OK)
return (ret);
/* Free lzma decoder handle because we'll no longer need it. */
if(zip->end_of_entry) {
lzma_end(&zip->zipx_lzma_stream);
zip->zipx_lzma_valid = 0;
}
/* If we're here, then we're good! */
return (ARCHIVE_OK);
}
#endif /* HAVE_LZMA_H && HAVE_LIBLZMA */
static int
zipx_ppmd8_init(struct archive_read *a, struct zip *zip)
{
const void* p;
uint32_t val;
uint32_t order;
uint32_t mem;
uint32_t restore_method;
/* Remove previous decompression context if it exists. */
if(zip->ppmd8_valid) {
__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
zip->ppmd8_valid = 0;
}
/* Create a new decompression context. */
__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
/* Setup function pointers required by Ppmd8 decompressor. The
* 'ppmd_read' function will feed new bytes to the decompressor,
* and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
zip->zipx_ppmd_stream.a = a;
zip->zipx_ppmd_stream.Read = &ppmd_read;
/* Reset number of read bytes to 0. */
zip->zipx_ppmd_read_compressed = 0;
/* Read Ppmd8 header (2 bytes). */
p = __archive_read_ahead(a, 2, NULL);
if(!p) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated file data in PPMd8 stream");
return (ARCHIVE_FATAL);
}
__archive_read_consume(a, 2);
/* Decode the stream's compression parameters. */
val = archive_le16dec(p);
order = (val & 15) + 1;
mem = ((val >> 4) & 0xff) + 1;
restore_method = (val >> 12);
if(order < 2 || restore_method > 2) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Invalid parameter set in PPMd8 stream (order=%d, "
"restore=%d)", order, restore_method);
return (ARCHIVE_FAILED);
}
/* Allocate the memory needed to properly decompress the file. */
if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
archive_set_error(&a->archive, ENOMEM,
"Unable to allocate memory for PPMd8 stream: %d bytes",
mem << 20);
return (ARCHIVE_FATAL);
}
/* Signal the cleanup function to release Ppmd8 context in the
* cleanup phase. */
zip->ppmd8_valid = 1;
/* Perform further Ppmd8 initialization. */
if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"PPMd8 stream range decoder initialization error");
return (ARCHIVE_FATAL);
}
__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order, restore_method);
/* Allocate the buffer that will hold uncompressed data. */
free(zip->uncompressed_buffer);
zip->uncompressed_buffer_size = 256 * 1024;
zip->uncompressed_buffer =
(uint8_t*) malloc(zip->uncompressed_buffer_size);
if(zip->uncompressed_buffer == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory for PPMd8 decompression");
return ARCHIVE_FATAL;
}
/* Ppmd8 initialization is done. */
zip->decompress_init = 1;
/* We've already read 2 bytes in the output stream. Additionally,
* Ppmd8 initialization code could read some data as well. So we
* are advancing the stream by 2 bytes plus whatever number of
* bytes Ppmd8 init function used. */
zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
return ARCHIVE_OK;
}
static int
zip_read_data_zipx_ppmd(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip* zip = (struct zip *)(a->format->data);
int ret;
size_t consumed_bytes = 0;
ssize_t bytes_avail = 0;
(void) offset; /* UNUSED */
/* If we're here for the first time, initialize Ppmd8 decompression
* context first. */
if(!zip->decompress_init) {
ret = zipx_ppmd8_init(a, zip);
if(ret != ARCHIVE_OK)
return ret;
}
/* Fetch for more data. We're reading 1 byte here, but libarchive should
* prefetch more bytes. */
(void) __archive_read_ahead(a, 1, &bytes_avail);
if(bytes_avail < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated PPMd8 file body");
return (ARCHIVE_FATAL);
}
/* This counter will be updated inside ppmd_read(), which at one
* point will be called by Ppmd8_DecodeSymbol. */
zip->zipx_ppmd_read_compressed = 0;
/* Decompression loop. */
do {
int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(&zip->ppmd8);
if(sym < 0) {
zip->end_of_entry = 1;
break;
}
zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
++consumed_bytes;
} while(consumed_bytes < zip->uncompressed_buffer_size);
/* Update pointers for libarchive. */
*buff = zip->uncompressed_buffer;
*size = consumed_bytes;
/* Update pointers so we can continue decompression in another call. */
zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
zip->entry_uncompressed_bytes_read += consumed_bytes;
/* If we're at the end of stream, deinitialize Ppmd8 context. */
if(zip->end_of_entry) {
__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
zip->ppmd8_valid = 0;
}
/* Seek for optional marker, same way as in each zip entry. */
ret = consume_optional_marker(a, zip);
if (ret != ARCHIVE_OK)
return ret;
return ARCHIVE_OK;
}
#ifdef HAVE_BZLIB_H
static int
zipx_bzip2_init(struct archive_read *a, struct zip *zip)
{
int r;
/* Deallocate already existing BZ2 decompression context if it
* exists. */
if(zip->bzstream_valid) {
BZ2_bzDecompressEnd(&zip->bzstream);
zip->bzstream_valid = 0;
}
/* Allocate a new BZ2 decompression context. */
memset(&zip->bzstream, 0, sizeof(bz_stream));
r = BZ2_bzDecompressInit(&zip->bzstream, 0, 1);
if(r != BZ_OK) {
archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
"bzip2 initialization failed(%d)",
r);
return ARCHIVE_FAILED;
}
/* Mark the bzstream field to be released in cleanup phase. */
zip->bzstream_valid = 1;
/* (Re)allocate the buffer that will contain decompressed bytes. */
free(zip->uncompressed_buffer);
zip->uncompressed_buffer_size = 256 * 1024;
zip->uncompressed_buffer =
(uint8_t*) malloc(zip->uncompressed_buffer_size);
if (zip->uncompressed_buffer == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory for bzip2 decompression");
return ARCHIVE_FATAL;
}
/* Initialization done. */
zip->decompress_init = 1;
return ARCHIVE_OK;
}
static int
zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip *zip = (struct zip *)(a->format->data);
ssize_t bytes_avail = 0, in_bytes, to_consume;
const void *compressed_buff;
int r;
uint64_t total_out;
(void) offset; /* UNUSED */
/* Initialize decompression context if we're here for the first time. */
if(!zip->decompress_init) {
r = zipx_bzip2_init(a, zip);
if(r != ARCHIVE_OK)
return r;
}
/* Fetch more compressed bytes. */
compressed_buff = __archive_read_ahead(a, 1, &bytes_avail);
if(bytes_avail < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated bzip2 file body");
return (ARCHIVE_FATAL);
}
in_bytes = zipmin(zip->entry_bytes_remaining, bytes_avail);
/* Setup buffer boundaries. */
zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
zip->bzstream.avail_in = in_bytes;
zip->bzstream.total_in_hi32 = 0;
zip->bzstream.total_in_lo32 = 0;
zip->bzstream.next_out = (char*) zip->uncompressed_buffer;
zip->bzstream.avail_out = zip->uncompressed_buffer_size;
zip->bzstream.total_out_hi32 = 0;
zip->bzstream.total_out_lo32 = 0;
/* Perform the decompression. */
r = BZ2_bzDecompress(&zip->bzstream);
switch(r) {
case BZ_STREAM_END:
/* If we're at the end of the stream, deinitialize the
* decompression context now. */
switch(BZ2_bzDecompressEnd(&zip->bzstream)) {
case BZ_OK:
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Failed to clean up bzip2 decompressor");
return ARCHIVE_FATAL;
}
zip->end_of_entry = 1;
break;
case BZ_OK:
/* The decompressor has successfully decoded this chunk of
* data, but more data is still in queue. */
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"bzip2 decompression failed");
return ARCHIVE_FATAL;
}
/* Update the pointers so decompressor can continue decoding. */
to_consume = zip->bzstream.total_in_lo32;
__archive_read_consume(a, to_consume);
total_out = ((uint64_t) zip->bzstream.total_out_hi32 << 32) +
zip->bzstream.total_out_lo32;
zip->entry_bytes_remaining -= to_consume;
zip->entry_compressed_bytes_read += to_consume;
zip->entry_uncompressed_bytes_read += total_out;
/* Give libarchive its due. */
*size = total_out;
*buff = zip->uncompressed_buffer;
/* Seek for optional marker, like in other entries. */
r = consume_optional_marker(a, zip);
if(r != ARCHIVE_OK)
return r;
return ARCHIVE_OK;
}
#endif
#ifdef HAVE_ZLIB_H
static int
zip_deflate_init(struct archive_read *a, struct zip *zip)
@ -1470,42 +2205,9 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
return (r);
}
if (zip->end_of_entry && (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
const char *p;
if (NULL == (p = __archive_read_ahead(a, 24, NULL))) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP end-of-file record");
return (ARCHIVE_FATAL);
}
/* Consume the optional PK\007\010 marker. */
if (p[0] == 'P' && p[1] == 'K' &&
p[2] == '\007' && p[3] == '\010') {
p += 4;
zip->unconsumed = 4;
}
if (zip->entry->flags & LA_USED_ZIP64) {
uint64_t compressed, uncompressed;
zip->entry->crc32 = archive_le32dec(p);
compressed = archive_le64dec(p + 4);
uncompressed = archive_le64dec(p + 12);
if (compressed > INT64_MAX || uncompressed > INT64_MAX) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Overflow of 64-bit file sizes");
return ARCHIVE_FAILED;
}
zip->entry->compressed_size = compressed;
zip->entry->uncompressed_size = uncompressed;
zip->unconsumed += 20;
} else {
zip->entry->crc32 = archive_le32dec(p);
zip->entry->compressed_size = archive_le32dec(p + 4);
zip->entry->uncompressed_size = archive_le32dec(p + 8);
zip->unconsumed += 12;
}
}
r = consume_optional_marker(a, zip);
if (r != ARCHIVE_OK)
return (r);
return (ARCHIVE_OK);
}
@ -1933,6 +2635,24 @@ archive_read_format_zip_read_data(struct archive_read *a,
case 0: /* No compression. */
r = zip_read_data_none(a, buff, size, offset);
break;
#ifdef HAVE_BZLIB_H
case 12: /* ZIPx bzip2 compression. */
r = zip_read_data_zipx_bzip2(a, buff, size, offset);
break;
#endif
#if HAVE_LZMA_H && HAVE_LIBLZMA
case 14: /* ZIPx LZMA compression. */
r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
break;
case 95: /* ZIPx XZ compression. */
r = zip_read_data_zipx_xz(a, buff, size, offset);
break;
#endif
/* PPMd support is built-in, so we don't need any #if guards. */
case 98: /* ZIPx PPMd compression. */
r = zip_read_data_zipx_ppmd(a, buff, size, offset);
break;
#ifdef HAVE_ZLIB_H
case 8: /* Deflate compression. */
r = zip_read_data_deflate(a, buff, size, offset);
@ -1941,8 +2661,8 @@ archive_read_format_zip_read_data(struct archive_read *a,
default: /* Unsupported compression. */
/* Return a warning. */
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unsupported ZIP compression method (%s)",
compression_name(zip->entry->compression));
"Unsupported ZIP compression method (%d: %s)",
zip->entry->compression, compression_name(zip->entry->compression));
/* We can't decompress this entry, but we will
* be able to skip() it and try the next entry. */
return (ARCHIVE_FAILED);
@ -2000,11 +2720,29 @@ archive_read_format_zip_cleanup(struct archive_read *a)
struct zip_entry *zip_entry, *next_zip_entry;
zip = (struct zip *)(a->format->data);
#ifdef HAVE_ZLIB_H
if (zip->stream_valid)
inflateEnd(&zip->stream);
free(zip->uncompressed_buffer);
#endif
#if HAVA_LZMA_H && HAVE_LIBLZMA
if (zip->zipx_lzma_valid) {
lzma_end(&zip->zipx_lzma_stream);
}
#endif
#ifdef HAVE_BZLIB_H
if (zip->bzstream_valid) {
BZ2_bzDecompressEnd(&zip->bzstream);
}
#endif
free(zip->uncompressed_buffer);
if (zip->ppmd8_valid)
__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
if (zip->zip_entries) {
zip_entry = zip->zip_entries;
while (zip_entry != NULL) {
@ -3146,3 +3884,5 @@ archive_read_support_format_zip_seekable(struct archive *_a)
free(zip);
return (ARCHIVE_OK);
}
/*# vim:set noet:*/

View file

@ -1791,10 +1791,8 @@ _archive_write_disk_finish_entry(struct archive *_a)
a->fd = -1;
}
/* If there's an entry, we can release it now. */
if (a->entry) {
archive_entry_free(a->entry);
a->entry = NULL;
}
archive_entry_free(a->entry);
a->entry = NULL;
a->archive.state = ARCHIVE_STATE_HEADER;
return (ret);
}
@ -2398,8 +2396,7 @@ _archive_write_disk_free(struct archive *_a)
ret = _archive_write_disk_close(&a->archive);
archive_write_disk_set_group_lookup(&a->archive, NULL, NULL, NULL);
archive_write_disk_set_user_lookup(&a->archive, NULL, NULL, NULL);
if (a->entry)
archive_entry_free(a->entry);
archive_entry_free(a->entry);
archive_string_free(&a->_name_data);
archive_string_free(&a->archive.error_string);
archive_string_free(&a->path_safe);

View file

@ -114,8 +114,7 @@ lookup_gid(void *private_data, const char *gname, int64_t gid)
return ((gid_t)b->id);
/* Free the cache slot for a new entry. */
if (b->name != NULL)
free(b->name);
free(b->name);
b->name = strdup(gname);
/* Note: If strdup fails, that's okay; we just won't cache. */
b->hash = h;
@ -184,8 +183,7 @@ lookup_uid(void *private_data, const char *uname, int64_t uid)
return ((uid_t)b->id);
/* Free the cache slot for a new entry. */
if (b->name != NULL)
free(b->name);
free(b->name);
b->name = strdup(uname);
/* Note: If strdup fails, that's okay; we just won't cache. */
b->hash = h;

View file

@ -187,6 +187,11 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry)
buff[AR_name_offset] = '/';
goto stat;
}
if (strcmp(pathname, "/SYM64/") == 0) {
/* Entry is archive symbol table in GNU 64-bit format */
memcpy(buff + AR_name_offset, "/SYM64/", 7);
goto stat;
}
if (strcmp(pathname, "__.SYMDEF") == 0) {
/* Entry is archive symbol table in BSD format */
memcpy(buff + AR_name_offset, "__.SYMDEF", 9);

View file

@ -408,8 +408,7 @@ write_header(struct archive_write *a, struct archive_entry *entry)
}
}
exit_write_header:
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret_final);
}

View file

@ -366,8 +366,7 @@ write_header(struct archive_write *a, struct archive_entry *entry)
}
}
exit_write_header:
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret_final);
}

View file

@ -565,8 +565,7 @@ archive_write_gnutar_header(struct archive_write *a,
gnutar->entry_bytes_remaining = archive_entry_size(entry);
gnutar->entry_padding = 0x1ff & (-(int64_t)gnutar->entry_bytes_remaining);
exit_write_header:
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret);
}

View file

@ -169,8 +169,7 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
}
/* Save the entry for the closing. */
if (shar->entry)
archive_entry_free(shar->entry);
archive_entry_free(shar->entry);
shar->entry = archive_entry_clone(entry);
name = archive_entry_pathname(entry);
@ -289,8 +288,7 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
"mkdir -p %s > /dev/null 2>&1\n",
shar->quoted_name.s);
/* Record that we just created this directory. */
if (shar->last_dir != NULL)
free(shar->last_dir);
free(shar->last_dir);
shar->last_dir = strdup(name);
/* Trim a trailing '/'. */

View file

@ -352,14 +352,12 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry)
#endif
ret = __archive_write_format_header_ustar(a, buff, entry, -1, 1, sconv);
if (ret < ARCHIVE_WARN) {
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret);
}
ret2 = __archive_write_output(a, buff, 512);
if (ret2 < ARCHIVE_WARN) {
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret2);
}
if (ret2 < ret)
@ -367,8 +365,7 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry)
ustar->entry_bytes_remaining = archive_entry_size(entry);
ustar->entry_padding = 0x1ff & (-(int64_t)ustar->entry_bytes_remaining);
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret);
}

View file

@ -330,14 +330,12 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry)
#endif
ret = format_header_v7tar(a, buff, entry, 1, sconv);
if (ret < ARCHIVE_WARN) {
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret);
}
ret2 = __archive_write_output(a, buff, 512);
if (ret2 < ARCHIVE_WARN) {
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret2);
}
if (ret2 < ret)
@ -345,8 +343,7 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry)
v7tar->entry_bytes_remaining = archive_entry_size(entry);
v7tar->entry_padding = 0x1ff & (-(int64_t)v7tar->entry_bytes_remaining);
if (entry_main)
archive_entry_free(entry_main);
archive_entry_free(entry_main);
return (ret);
}

View file

@ -564,10 +564,8 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
zip->entry_uses_zip64 = 0;
zip->entry_crc32 = zip->crc32func(0, NULL, 0);
zip->entry_encryption = 0;
if (zip->entry != NULL) {
archive_entry_free(zip->entry);
zip->entry = NULL;
}
archive_entry_free(zip->entry);
zip->entry = NULL;
if (zip->cctx_valid)
archive_encrypto_aes_ctr_release(&zip->cctx);
@ -1430,6 +1428,9 @@ write_path(struct archive_entry *entry, struct archive_write *archive)
type = archive_entry_filetype(entry);
written_bytes = 0;
if (path == NULL)
return (ARCHIVE_FATAL);
ret = __archive_write_output(archive, path, strlen(path));
if (ret != ARCHIVE_OK)
return (ARCHIVE_FATAL);

View file

@ -1,153 +0,0 @@
/*-
* Copyright (c) 2011 Michihiro NAKAJIMA
* 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 "test.h"
__FBSDID("$FreeBSD");
#include <locale.h>
/*
* Test "tar:compat-2x" option that enables the string conversion of
* libarchive 2.x, which made incorrect UTF-8 form filenames for the
* pax format on some platform the wchar_t of which was not Unicode form.
* The option is unneeded if people have been using UTF-8 locale during
* making tar files(in pax format).
*
* NOTE: The sample tar file was made with bsdtar 2.x in LANG=KOI8-R on
* FreeBSD.
*/
DEFINE_TEST(test_compat_pax_libarchive_2x)
{
#if (defined(_WIN32) && !defined(__CYGWIN__)) \
|| defined(__STDC_ISO_10646__) || defined(__APPLE__)
skipping("This test only for the platform the WCS of which is "
"not Unicode.");
#else
struct archive *a;
struct archive_entry *ae;
char c;
wchar_t wc;
const char *refname = "test_compat_pax_libarchive_2x.tar.Z";
/*
* Read incorrect format UTF-8 filename in ru_RU.KOI8-R with
* "tar:compat-2x" option. We should correctly
* read two filenames.
*/
if (NULL == setlocale(LC_ALL, "ru_RU.KOI8-R")) {
skipping("ru_RU.KOI8-R locale not available on this system.");
return;
}
/*
* Test if wchar_t format is the same as FreeBSD wchar_t.
*/
assert(-1 != wctomb(NULL, L'\0'));
wc = (wchar_t)0xd0;
c = 0;
if (wctomb(&c, wc) != 1 || (unsigned char)c != 0xd0) {
skipping("wchar_t format is different on this platform.");
return;
}
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_set_options(a, "tar:compat-2x"));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, refname, 10240));
/* Verify regular first file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("\xd0\xd2\xc9\xd7\xc5\xd4",
archive_entry_pathname(ae));
assertEqualInt(6, archive_entry_size(ae));
/* Verify regular second file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("\xf0\xf2\xe9\xf7\xe5\xf4",
archive_entry_pathname(ae));
assertEqualInt(6, archive_entry_size(ae));
/* End of archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
archive_format(a));
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
* Without "tar:compat-2x" option.
* Neither first file name nor second file name can be translated
* to KOI8-R.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, refname, 10240));
/* We cannot correctly read the filename. */
// This test used to look for WARN here coming from a
// character-conversion failure. But: Newer iconv tables are
// more tolerant so we can't always detect the conversion
// failures.
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assert(strcmp("\xd0\xd2\xc9\xd7\xc5\xd4",
archive_entry_pathname(ae)) != 0);
assertEqualInt(6, archive_entry_size(ae));
/* We cannot correctly read the filename. */
// Same here: The test is still valid (it sill verifies that
// the converted pathname is different), but we can no longer
// rely on WARN here.
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assert(strcmp("\xf0\xf2\xe9\xf7\xe5\xf4",
archive_entry_pathname(ae)) != 0);
assertEqualInt(6, archive_entry_size(ae));
/* End of archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
archive_format(a));
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
#endif
}

View file

@ -1,15 +0,0 @@
begin 644 test_compat_pax_libarchive_2x.tar.Z
M'YV04,+@05(F#)DR<EY`DY;L6C%J`")*G$BQHL6+&#-JW%@1AL<;-6J``.`Q
M!L@8(TN>3.FQ94D;-D#$B%&#QHT9,CS.B`DCADT;-P"`P,.QJ-&C2)-:K#.'
M3A@Y)&&,J5-&:<:I5:U>=.F1I<N16L.*'4NV;%D9*.&$H8.FQS!(PR0-2S3L
MTK!"PR@IR`EB#)TT;<KTB#$#!EJ0.&+@V`L#Q%K`@@D;QG$C!PX9.128!#%E
M")(D3+*X.&BG1XX:>V5P]@Q:=!HW;P87IE'C!@W-.%9_#NW"#9O7:P8K,$N\
MN/'CR),K7\Z\N?.)"QL^?$[=:$N0(J.:K(%2^\JH7%O&G%GS9DX8.T'T+`PC
MJ/KJ\)$R=0K5(];B]XF']]H2;/S_`"H'CSSIW%,./0$FJ.""##;HX(,01@A`
M0`,5=%!"`Q9XH(3Z?1022]MUIQ)W_+D4`TPRT6033CKQ1),,0`E%%(?PS?=4
M5/F9E6-9^X'7'XU`-H@6"&JQY18LP\@R3"K#W#),*</0PEA??P4FFV';);88
M7X]9*9D,E%F&F68WZ-;::&64=EIJ9O+V6FR2T082;FV*YAMPP@6IYYY\]NFG
M4AD:B."?9EWWH7<D(BIB>.*E6!Z+Z+DX0V'NP4!H<C;6)Q55^'':X5<^=G7I
>J,<%NB&IJ*:JZJJLMNKJJ[#&*NNLM-9JZZVXYDH<
`
end

View file

@ -26,6 +26,76 @@
#include "test.h"
__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_BUILD
#include <archive_crc32.h>
static
int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc)
{
la_ssize_t fsize, bytes_read;
uint8_t* buf;
int ret = 1;
uint32_t computed_crc;
fsize = archive_entry_size(ae);
buf = malloc(fsize);
if(buf == NULL)
return 1;
bytes_read = archive_read_data(a, buf, fsize);
if(bytes_read != fsize) {
assertEqualInt(bytes_read, fsize);
goto fn_exit;
}
computed_crc = crc32(0, buf, fsize);
assertEqualInt(computed_crc, crc);
ret = 0;
fn_exit:
free(buf);
return ret;
}
static
int extract_one_using_blocks(struct archive* a, int block_size, uint32_t crc)
{
uint8_t* buf;
int ret = 1;
uint32_t computed_crc = 0;
la_ssize_t bytes_read;
buf = malloc(block_size);
if(buf == NULL)
return 1;
while(1) {
bytes_read = archive_read_data(a, buf, block_size);
if(bytes_read == ARCHIVE_RETRY)
continue;
else if(bytes_read == 0)
break;
else if(bytes_read < 0) {
/* If we're here, it means the decompressor has failed
* to properly decode test file. */
assertA(0);
ret = 1;
goto fn_exit;
} else {
/* ok */
}
computed_crc = crc32(computed_crc, buf, bytes_read);
}
assertEqualInt(computed_crc, crc);
ret = 0;
fn_exit:
free(buf);
return ret;
}
/*
* The reference file for this has been manually tweaked so that:
* * file2 has length-at-end but file1 does not
@ -312,3 +382,380 @@ DEFINE_TEST(test_read_format_zip)
test_extract_length_at_end();
test_symlink();
}
DEFINE_TEST(test_read_format_zip_ppmd_one_file)
{
const char *refname = "test_read_format_zip_ppmd8.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_ppmd_one_file_blockread)
{
const char *refname = "test_read_format_zip_ppmd8.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_ppmd_multi)
{
const char *refname = "test_read_format_zip_ppmd8_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_ppmd_multi_blockread)
{
const char *refname = "test_read_format_zip_ppmd8_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 12, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (ppmd-1)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 14, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_lzma_one_file)
{
const char *refname = "test_read_format_zip_lzma.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_lzma_one_file_blockread)
{
const char *refname = "test_read_format_zip_lzma.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_lzma_multi)
{
const char *refname = "test_read_format_zip_lzma_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_lzma_multi_blockread)
{
const char *refname = "test_read_format_zip_lzma_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 12, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 6.3 (lzma)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 14, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_bzip2_one_file)
{
const char *refname = "test_read_format_zip_bzip2.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_bzip2_one_file_blockread)
{
const char *refname = "test_read_format_zip_bzip2.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_bzip2_multi)
{
const char *refname = "test_read_format_zip_bzip2_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_bzip2_multi_blockread)
{
const char *refname = "test_read_format_zip_bzip2_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("smartd.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 12, 0x8DD7379E));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("ts.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0x7AE59B31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 4.6 (bzip)", archive_format_name(a));
assertEqualString("vimrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 14, 0xBA8E3BAA));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_xz_multi)
{
const char *refname = "test_read_format_zip_xz_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("bash.bashrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xF751B8C9));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("pacman.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0xB20B7F88));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("profile", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one(a, ae, 0x2329F054));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_read_format_zip_xz_multi_blockread)
{
const char *refname = "test_read_format_zip_xz_multi.zipx";
struct archive *a;
struct archive_entry *ae;
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("bash.bashrc", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 12, 0xF751B8C9));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("pacman.conf", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 13, 0xB20B7F88));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("ZIP 2.0 (xz)", archive_format_name(a));
assertEqualString("profile", archive_entry_pathname(ae));
assertEqualIntA(a, 0, extract_one_using_blocks(a, 14, 0x2329F054));
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,19 @@
begin 644 bzip2.zipx
M4$L#!"X#```,`#TQD4VJ.XZZ-`(``)`#```%````=FEM<F-"6F@Y,4%9)E-9
MYPC!D@``3%^``!!TY^!2(B.7`+__W^%``C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>-Q`H``"L:
M```+`"0`````````(("D@0````!S;6%R=&0N8V]N9@H`(````````0`8`(#N
M7F'.E=0!`,YV<<Z5U`&`[EYASI74`5!+`0(_`RX#```,`(@XD4TQF^5ZR`$`
M`%0#```'`"0`````````(("D@>T*``!T<RYC;VYF"@`@```````!`!@``/`\
M5\Z5U`$`SG9QSI74`0#P/%?.E=0!4$L!`C\#+@,```P`/3&13:H[CKHT`@``
MD`,```4`)``````````@@*2!V@P``'9I;7)C"@`@```````!`!@``)=1P<:5
HU`&`0`0-QY74`0`TN_O&E=0!4$L%!@`````#``,`#0$``#$/````````
`
end

View file

@ -0,0 +1,19 @@
begin 644 lzma.zipx
M4$L#!#\#```.`#TQD4VJ.XZZ.0(``)`#```%````=FEM<F,0`@4`70`0````
M$0@$J,)\D;(#4L%<^$P5TO^CM0KI0HWG08B&_].4<,CJ")TW/L>)82Q1PWAL
M+U`,N0L_$]^&650C/X$D6#4QFD$\A/"_![4!O/5O/!KH`WCQ*4?T2*]4P#/D
M0'9I?EZG=N69Z0V;H0I=C<!C<J6O^834W097PY1$%=-++.YUA'!>P*$?".I\
MGMG/80.A'^W>R4J'S/CZ%P`8`>F=R>R&R$2T@EM#X)"OQH1?A7,`:4IU9WV!
M#2W*DXT',;.4YIN4A:-X)O=IREL201ZSOC=YSAU[C4-::/YV8\)%"L17+>VC
M%/'B]ZCQN$2(Q*9*\KJZ`Y131`]5C&G';@1S-QES_RZF!2OX45@58+??ES%(
MUJ<(\`11M$NO)HK#/MK-9RT"15.2I:IZN8<TJR>VTM1_?$G\L#BH67]$S%[4
M%C-$\Q<+./&HV](4,7)OL-@C^M0F"2O!0N$OHOW54H87^QLBQVH*D%A<#SI%
M/#+-5U(W';:KC)RE>0Y^5YI!RECQNR"R4.UW9IR!@:B!UB8?_D5$FT8YCJHJ
M2[2"-&-_D2BJ6#XK[6G=%K"%;'^-+0]FHCY4ER#`^<I-M<!"D:-0H@);U"P"
MPYX+4#8!&$7\M.+%%MZ:KQ2GX0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VLUG+0)%4Y*EJGJY
MAS2K)[;2U']\2?RP.*A9?T3,7M06,T3S%PLX\:C;TA0Q<F^PV"/ZU"8)*\%"
MX2^B_=52AA?[&R+':@J06%P/.D4\,LU74C<=MJN,G*5Y#GY7FD'*6/&[(+)0
M[7=FG(&!J('6)A_^142;1CF.JBI+M((T8W^1**I8/BOM:=T6L(5L?XTM#V:B
M/E27(,#YRDVUP$*1HU"B`EO4+`+#G@M0-@$81?RTXL46WIJO%*?A!ST0+!>;
MZC0FI6JUP3:]D^3L->OKP>:G2P_FF8)V>\LVQ^;MC'-2N-<MV$E$`(G9PYB3
MA9)G%MOE3B'RTT6\:W>,GXD"Z]PZI8A79+7ED*DB,K&N'OH,DT/C4$L!`C\#
M/P,```X`D3B139XWUXV$"@``*QH```L`)``````````@@*2!`````'-M87)T
M9"YC;VYF"@`@```````!`!@`@.Y>8<Z5U`&`[EYASI74`8#N7F'.E=0!4$L!
M`C\#/P,```X`B#B133&;Y7J]`0``5`,```<`)``````````@@*2!K0H``'1S
M+F-O;F8*`"````````$`&```\#Q7SI74`0#P/%?.E=0!`/`\5\Z5U`%02P$"
M/P,_`P``#@`],9%-JCN.NCD"``"0`P``!0`D`````````""`I(&/#```=FEM
M<F,*`"````````$`&```EU'!QI74`8!`!`W'E=0!`#2[^\:5U`%02P4&````
/``,``P`-`0``ZPX`````
`
end

View file

@ -0,0 +1,17 @@
begin 644 ppmd8.zipx
M4$L#!#\#``!B`#TQD4VJ.XZZV`$``)`#```%````=FEM<F,'`"']JO"&\1[R
M;;G)@`(8>EJ>3<8@F_*<(\B>K]4_(WC8#)`_QSG+`7`B&_11VIJ)@#(<W.9L
M>K)_I8R^=`VUO2_S,1C=1CAU>-*`]CC+&6Q;EE'#CG-W=^[,F,+UR-TE(9,G
M1_&$NYD`,5WY5QX7@%5XX-*7+7&#W'1#XF+"?6*U!H=B063.]NTA`1+&\J(K
M&U]D<Z8#:-^E0@IRO9J$W&\^A>E8$ZYUU'UT\$!88I,6+(M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.UYMG+D*L*">.%
MKY&BW>NHE92\QT;V$D8_X^)[*WA-4GBAS.]:Q0"SGL>J*KNDX)76,LF["/13
M[SM72F%\\//WRT1^2GJA553G>V*&$Z9ZK.*:"0K;06@IC_N`Z$&Z<O$;4=9;
M)F$MK2SKZUO<>4?!2=`CN071_Z=#```````!G1/),P``5\:%:*@`"OP"````
M``!96E!+`0(4`!0```!?`$JCP4K)N%'WP`0``,4(```+`"0```````$`(```
M``````!B87-H+F)A<VAR8PH`(````````0`8`(#_S/$,V](!H&U5$).6U`$0
M=OM:DZ'3`5!+`0(4`!0```!?`$DZ/4N(?PNR0`4```8*```+`"0```````$`
M(````.D$``!P86-M86XN8V]N9@H`(````````0`8``#QLKWJ.-,!T%`4$9.6
MU`'0*<"<\7?4`5!+`0(4`!0```!?`$JCP4I4\"DCQ`D``,D9```'`"0`````
M``$`(````%(*``!P<F]F:6QE"@`@```````!`!@`@/_,\0S;T@&0.\4/DY;4
?`?#K!%N3H=,!4$L%!@`````#``,`$P$``#L4````````
`
end

View file

@ -2590,10 +2590,8 @@ sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
cnt = facl(fd, cmd, cnt, aclp);
}
} else {
if (aclp != NULL) {
free(aclp);
aclp = NULL;
}
free(aclp);
aclp = NULL;
break;
}
}

View file

@ -1275,14 +1275,20 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
continue;
// FIXME: produce a better error message.
// FIXME: Get source locations for these errors or diagnose them earlier.
if (Symbol.isUndefined() && Rest.startswith("@@") &&
!Rest.startswith("@@@"))
report_fatal_error("A @@ version cannot be undefined");
!Rest.startswith("@@@")) {
Asm.getContext().reportError(SMLoc(), "versioned symbol " + AliasName +
" must be defined");
continue;
}
if (Renames.count(&Symbol) && Renames[&Symbol] != Alias)
report_fatal_error(llvm::Twine("Multiple symbol versions defined for ") +
Symbol.getName());
if (Renames.count(&Symbol) && Renames[&Symbol] != Alias) {
Asm.getContext().reportError(
SMLoc(), llvm::Twine("multiple symbol versions defined for ") +
Symbol.getName());
continue;
}
Renames.insert(std::make_pair(&Symbol, Alias));
}

View file

@ -66,6 +66,7 @@ SRCS= archive_acl.c \
archive_pack_dev.c \
archive_pathmatch.c \
archive_ppmd7.c \
archive_ppmd8.c \
archive_random.c \
archive_rb.c \
archive_read.c \

View file

@ -72,7 +72,6 @@ TESTS_SRCS= \
test_compat_lzma.c \
test_compat_lzop.c \
test_compat_mac.c \
test_compat_pax_libarchive_2x.c \
test_compat_perl_archive_tar.c \
test_compat_plexus_archiver_tar.c \
test_compat_solaris_tar_acl.c \
@ -296,8 +295,6 @@ TESTS_SRCS= \
BROKEN_TESTS+= test_archive_rmd160
# Fails with `libarchive/test/test_archive_crypto.c:121: md != actualmd`
BROKEN_TESTS+= test_archive_sha384
# Fails with `test_compat_pax_libarchive_2x.c:122: ARCHIVE_WARN != archive_read_next_header(a, &ae)`
BROKEN_TESTS+= test_compat_pax_libarchive_2x
# Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago`
BROKEN_TESTS+= test_read_disk_directory_traversals
@ -358,7 +355,6 @@ ${PACKAGE}FILES+= test_compat_lzop_2.tar.lzo.uu
${PACKAGE}FILES+= test_compat_lzop_3.tar.lzo.uu
${PACKAGE}FILES+= test_compat_mac-1.tar.Z.uu
${PACKAGE}FILES+= test_compat_mac-2.tar.Z.uu
${PACKAGE}FILES+= test_compat_pax_libarchive_2x.tar.Z.uu
${PACKAGE}FILES+= test_compat_perl_archive_tar.tar.uu
${PACKAGE}FILES+= test_compat_plexus_archiver_tar.tar.uu
${PACKAGE}FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu
@ -542,6 +538,8 @@ ${PACKAGE}FILES+= test_read_format_ustar_filename_eucjp.tar.Z.uu
${PACKAGE}FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu
${PACKAGE}FILES+= test_read_format_warc.warc.uu
${PACKAGE}FILES+= test_read_format_zip.zip.uu
${PACKAGE}FILES+= test_read_format_zip_bzip2.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_bzip2_multi.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_comment_stored_1.zip.uu
${PACKAGE}FILES+= test_read_format_zip_comment_stored_2.zip.uu
${PACKAGE}FILES+= test_read_format_zip_encryption_data.zip.uu
@ -556,6 +554,8 @@ ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu
${PACKAGE}FILES+= test_read_format_zip_high_compression.zip.uu
${PACKAGE}FILES+= test_read_format_zip_jar.jar.uu
${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu
${PACKAGE}FILES+= test_read_format_zip_lzma.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_lzma_multi.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu
${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu
${PACKAGE}FILES+= test_read_format_zip_msdos.zip.uu
@ -564,6 +564,8 @@ ${PACKAGE}FILES+= test_read_format_zip_nofiletype.zip.uu
${PACKAGE}FILES+= test_read_format_zip_padded1.zip.uu
${PACKAGE}FILES+= test_read_format_zip_padded2.zip.uu
${PACKAGE}FILES+= test_read_format_zip_padded3.zip.uu
${PACKAGE}FILES+= test_read_format_zip_ppmd8.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_ppmd8_multi.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_sfx.uu
${PACKAGE}FILES+= test_read_format_zip_symlink.zip.uu
${PACKAGE}FILES+= test_read_format_zip_traditional_encryption_data.zip.uu
@ -573,6 +575,7 @@ ${PACKAGE}FILES+= test_read_format_zip_winzip_aes128.zip.uu
${PACKAGE}FILES+= test_read_format_zip_winzip_aes256.zip.uu
${PACKAGE}FILES+= test_read_format_zip_winzip_aes256_large.zip.uu
${PACKAGE}FILES+= test_read_format_zip_winzip_aes256_stored.zip.uu
${PACKAGE}FILES+= test_read_format_zip_xz_multi.zipx.uu
${PACKAGE}FILES+= test_read_format_zip_zip64a.zip.uu
${PACKAGE}FILES+= test_read_format_zip_zip64b.zip.uu
${PACKAGE}FILES+= test_read_large_splitted_rar_aa.uu

View file

@ -45,6 +45,11 @@ __FBSDID("$FreeBSD$");
#include "be.h"
#include "be_impl.h"
struct be_destroy_data {
libbe_handle_t *lbh;
char *snapname;
};
#if SOON
static int be_create_child_noent(libbe_handle_t *lbh, const char *active,
const char *child_path);
@ -186,12 +191,38 @@ be_nicenum(uint64_t num, char *buf, size_t buflen)
static int
be_destroy_cb(zfs_handle_t *zfs_hdl, void *data)
{
char path[BE_MAXPATHLEN];
struct be_destroy_data *bdd;
zfs_handle_t *snap;
int err;
if ((err = zfs_iter_children(zfs_hdl, be_destroy_cb, data)) != 0)
return (err);
if ((err = zfs_destroy(zfs_hdl, false)) != 0)
bdd = (struct be_destroy_data *)data;
if (bdd->snapname == NULL) {
err = zfs_iter_children(zfs_hdl, be_destroy_cb, data);
if (err != 0)
return (err);
return (zfs_destroy(zfs_hdl, false));
}
/* If we're dealing with snapshots instead, delete that one alone */
err = zfs_iter_filesystems(zfs_hdl, be_destroy_cb, data);
if (err != 0)
return (err);
/*
* This part is intentionally glossing over any potential errors,
* because there's a lot less potential for errors when we're cleaning
* up snapshots rather than a full deep BE. The primary error case
* here being if the snapshot doesn't exist in the first place, which
* the caller will likely deem insignificant as long as it doesn't
* exist after the call. Thus, such a missing snapshot shouldn't jam
* up the destruction.
*/
snprintf(path, sizeof(path), "%s@%s", zfs_get_name(zfs_hdl),
bdd->snapname);
if (!zfs_dataset_exists(bdd->lbh->lzh, path, ZFS_TYPE_SNAPSHOT))
return (0);
snap = zfs_open(bdd->lbh->lzh, path, ZFS_TYPE_SNAPSHOT);
if (snap != NULL)
zfs_destroy(snap, false);
return (0);
}
@ -199,21 +230,26 @@ be_destroy_cb(zfs_handle_t *zfs_hdl, void *data)
* Destroy the boot environment or snapshot specified by the name
* parameter. Options are or'd together with the possible values:
* BE_DESTROY_FORCE : forces operation on mounted datasets
* BE_DESTROY_ORIGIN: destroy the origin snapshot as well
*/
int
be_destroy(libbe_handle_t *lbh, const char *name, int options)
{
struct be_destroy_data bdd;
char origin[BE_MAXPATHLEN], path[BE_MAXPATHLEN];
zfs_handle_t *fs;
char path[BE_MAXPATHLEN];
char *p;
char *snapdelim;
int err, force, mounted;
size_t rootlen;
p = path;
bdd.lbh = lbh;
bdd.snapname = NULL;
force = options & BE_DESTROY_FORCE;
*origin = '\0';
be_root_concat(lbh, name, path);
if (strchr(name, '@') == NULL) {
if ((snapdelim = strchr(path, '@')) == NULL) {
if (!zfs_dataset_exists(lbh->lzh, path, ZFS_TYPE_FILESYSTEM))
return (set_error(lbh, BE_ERR_NOENT));
@ -221,36 +257,68 @@ be_destroy(libbe_handle_t *lbh, const char *name, int options)
strcmp(path, lbh->bootfs) == 0)
return (set_error(lbh, BE_ERR_DESTROYACT));
fs = zfs_open(lbh->lzh, p, ZFS_TYPE_FILESYSTEM);
} else {
fs = zfs_open(lbh->lzh, path, ZFS_TYPE_FILESYSTEM);
if (fs == NULL)
return (set_error(lbh, BE_ERR_ZFSOPEN));
if ((options & BE_DESTROY_ORIGIN) != 0 &&
zfs_prop_get(fs, ZFS_PROP_ORIGIN, origin, sizeof(origin),
NULL, NULL, 0, 1) != 0)
return (set_error(lbh, BE_ERR_NOORIGIN));
} else {
if (!zfs_dataset_exists(lbh->lzh, path, ZFS_TYPE_SNAPSHOT))
return (set_error(lbh, BE_ERR_NOENT));
fs = zfs_open(lbh->lzh, p, ZFS_TYPE_SNAPSHOT);
bdd.snapname = strdup(snapdelim + 1);
if (bdd.snapname == NULL)
return (set_error(lbh, BE_ERR_NOMEM));
*snapdelim = '\0';
fs = zfs_open(lbh->lzh, path, ZFS_TYPE_DATASET);
if (fs == NULL) {
free(bdd.snapname);
return (set_error(lbh, BE_ERR_ZFSOPEN));
}
}
if (fs == NULL)
return (set_error(lbh, BE_ERR_ZFSOPEN));
/* Check if mounted, unmount if force is specified */
if ((mounted = zfs_is_mounted(fs, NULL)) != 0) {
if (force)
if (force) {
zfs_unmount(fs, NULL, 0);
else
} else {
free(bdd.snapname);
return (set_error(lbh, BE_ERR_DESTROYMNT));
}
}
if ((err = be_destroy_cb(fs, NULL)) != 0) {
err = be_destroy_cb(fs, &bdd);
zfs_close(fs);
free(bdd.snapname);
if (err != 0) {
/* Children are still present or the mount is referenced */
if (err == EBUSY)
return (set_error(lbh, BE_ERR_DESTROYMNT));
return (set_error(lbh, BE_ERR_UNKNOWN));
}
return (0);
}
if ((options & BE_DESTROY_ORIGIN) == 0)
return (0);
/* The origin can't possibly be shorter than the BE root */
rootlen = strlen(lbh->root);
if (*origin == '\0' || strlen(origin) <= rootlen + 1)
return (set_error(lbh, BE_ERR_INVORIGIN));
/*
* We'll be chopping off the BE root and running this back through
* be_destroy, so that we properly handle the origin snapshot whether
* it be that of a deep BE or not.
*/
if (strncmp(origin, lbh->root, rootlen) != 0 || origin[rootlen] != '/')
return (0);
return (be_destroy(lbh, origin + rootlen + 1,
options & ~BE_DESTROY_ORIGIN));
}
int
be_snapshot(libbe_handle_t *lbh, const char *source, const char *snap_name,

View file

@ -59,6 +59,7 @@ typedef enum be_error {
BE_ERR_NOPOOL, /* operation not supported on this pool */
BE_ERR_NOMEM, /* insufficient memory */
BE_ERR_UNKNOWN, /* unknown error */
BE_ERR_INVORIGIN, /* invalid origin */
} be_error_t;
@ -93,7 +94,8 @@ int be_rename(libbe_handle_t *, const char *, const char *);
/* Bootenv removal functions */
typedef enum {
BE_DESTROY_FORCE = 1 << 0,
BE_DESTROY_FORCE = 1 << 0,
BE_DESTROY_ORIGIN = 1 << 1,
} be_destroy_opt_t;
int be_destroy(libbe_handle_t *, const char *, int);
@ -102,7 +104,7 @@ int be_destroy(libbe_handle_t *, const char *, int);
typedef enum {
BE_MNT_FORCE = 1 << 0,
BE_MNT_DEEP = 1 << 1,
BE_MNT_DEEP = 1 << 1,
} be_mount_opt_t;
int be_mount(libbe_handle_t *, char *, char *, int, char *);

View file

@ -105,6 +105,9 @@ libbe_error_description(libbe_handle_t *lbh)
case BE_ERR_UNKNOWN:
return ("unknown error");
case BE_ERR_INVORIGIN:
return ("invalid origin");
default:
assert(lbh->error == BE_ERR_SUCCESS);
return ("no error");

View file

@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd November 21, 2018
.Dd February 12, 2019
.Dt LIBBE 3
.Os
.Sh NAME
@ -253,6 +253,13 @@ It will not destroy a mounted boot environment unless the
.Dv BE_DESTROY_FORCE
option is set in
.Fa options .
If the
.Dv BE_DESTROY_ORIGIN
option is set in
.Fa options ,
the
.Fn be_destroy
function will destroy the origin snapshot to this boot environment as well.
.Pp
The
.Fn be_nicenum
@ -482,6 +489,8 @@ BE_ERR_NOPOOL
BE_ERR_NOMEM
.It
BE_ERR_UNKNOWN
.It
BE_ERR_INVORIGIN
.El
.Sh SEE ALSO
.Xr bectl 8

View file

@ -122,6 +122,7 @@ NOASM=
.endif
.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc"
.include "${LIBC_SRCTOP}/x86/gen/Makefile.inc"
.endif
.if ${MK_NIS} != "no"
CFLAGS+= -DYP

View file

@ -2,7 +2,7 @@
# $FreeBSD$
SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \
fabs.S getcontextx.c \
fabs.S \
infinity.c ldexp.c makecontext.c signalcontext.c \
flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \
fpgetround.c fpsetround.c fpgetsticky.c

View file

@ -178,4 +178,6 @@ extension and should not be used if portability is desired.
The
.Fn readpassphrase
function first appeared in
.Fx 4.6
and
.Ox 2.9 .

View file

@ -2,5 +2,5 @@
# $FreeBSD$
SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \
flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \
flt_rounds.c infinity.c ldexp.c makecontext.c \
rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S

View file

@ -1,145 +0,0 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
* 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 ``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 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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ucontext.h>
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <machine/npx.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>
static int xstate_sz = -1;
int
__getcontextx_size(void)
{
u_int p[4];
int cpuid_supported;
if (xstate_sz == -1) {
__asm __volatile(
" pushfl\n"
" popl %%eax\n"
" movl %%eax,%%ecx\n"
" xorl $0x200000,%%eax\n"
" pushl %%eax\n"
" popfl\n"
" pushfl\n"
" popl %%eax\n"
" xorl %%eax,%%ecx\n"
" je 1f\n"
" movl $1,%0\n"
" jmp 2f\n"
"1: movl $0,%0\n"
"2:\n"
: "=r" (cpuid_supported) : : "eax", "ecx");
if (cpuid_supported) {
__asm __volatile(
" pushl %%ebx\n"
" cpuid\n"
" movl %%ebx,%1\n"
" popl %%ebx\n"
: "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (0x1));
if ((p[2] & CPUID2_OSXSAVE) != 0) {
__asm __volatile(
" pushl %%ebx\n"
" cpuid\n"
" movl %%ebx,%1\n"
" popl %%ebx\n"
: "=a" (p[0]), "=r" (p[1]), "=c" (p[2]),
"=d" (p[3])
: "0" (0xd), "2" (0x0));
xstate_sz = p[1] - sizeof(struct savexmm);
} else
xstate_sz = 0;
} else
xstate_sz = 0;
}
return (sizeof(ucontext_t) + xstate_sz);
}
int
__fillcontextx2(char *ctx)
{
struct i386_get_xfpustate xfpu;
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
if (xstate_sz != 0) {
xfpu.addr = (char *)(ucp + 1);
xfpu.len = xstate_sz;
if (sysarch(I386_GET_XFPUSTATE, &xfpu) == -1)
return (-1);
ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr;
ucp->uc_mcontext.mc_xfpustate_len = xstate_sz;
ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE;
} else {
ucp->uc_mcontext.mc_xfpustate = 0;
ucp->uc_mcontext.mc_xfpustate_len = 0;
}
return (0);
}
int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
if (getcontext(ucp) == -1)
return (-1);
__fillcontextx2(ctx);
return (0);
}
__weak_reference(__getcontextx, getcontextx);
ucontext_t *
__getcontextx(void)
{
char *ctx;
int error;
ctx = malloc(__getcontextx_size());
if (ctx == NULL)
return (NULL);
if (__fillcontextx(ctx) == -1) {
error = errno;
free(ctx);
errno = error;
return (NULL);
}
return ((ucontext_t *)ctx);
}

View file

@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 13, 2017
.Dd February 10, 2019
.Dt GETADDRINFO 3
.Os
.Sh NAME
@ -78,14 +78,14 @@ as defined by
.Aq Pa netdb.h :
.Bd -literal
struct addrinfo {
int ai_flags; /* input flags */
int ai_family; /* address family for socket */
int ai_socktype; /* socket type */
int ai_protocol; /* protocol for socket */
socklen_t ai_addrlen; /* length of socket-address */
struct sockaddr *ai_addr; /* socket-address for socket */
char *ai_canonname; /* canonical name for service location */
struct addrinfo *ai_next; /* pointer to next in list */
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, .. */
int ai_family; /* AF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
.Ed
.Pp

View file

@ -0,0 +1,6 @@
# $FreeBSD$
.PATH: ${LIBC_SRCTOP}/x86/gen
SRCS+= \
getcontextx.c

View file

@ -35,51 +35,78 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h>
#include <stdlib.h>
#include <machine/cpufunc.h>
#include <machine/fpu.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>
#include <x86/ifunc.h>
#include <x86/fpu.h>
static int xstate_sz = -1;
#if defined __i386__
#define X86_GET_XFPUSTATE I386_GET_XFPUSTATE
typedef struct savexmm savex86_t ;
typedef struct i386_get_xfpustate x86_get_xfpustate_t;
#elif defined __amd64__
#define X86_GET_XFPUSTATE AMD64_GET_XFPUSTATE
typedef struct savefpu savex86_t;
typedef struct amd64_get_xfpustate x86_get_xfpustate_t;
#else
#error "Wrong arch"
#endif
int
__getcontextx_size(void)
static int xstate_sz = 0;
static int
__getcontextx_size_xfpu(void)
{
u_int p[4];
if (xstate_sz == -1) {
do_cpuid(1, p);
if ((p[2] & CPUID2_OSXSAVE) != 0) {
cpuid_count(0xd, 0x0, p);
xstate_sz = p[1] - sizeof(struct savefpu);
} else
xstate_sz = 0;
}
return (sizeof(ucontext_t) + xstate_sz);
}
int
__fillcontextx2(char *ctx)
DEFINE_UIFUNC(, int, __getcontextx_size, (void), static)
{
struct amd64_get_xfpustate xfpu;
u_int p[4];
if ((cpu_feature2 & CPUID2_OSXSAVE) != 0) {
cpuid_count(0xd, 0x0, p);
xstate_sz = p[1] - sizeof(savex86_t);
}
return (__getcontextx_size_xfpu);
}
static int
__fillcontextx2_xfpu(char *ctx)
{
x86_get_xfpustate_t xfpu;
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
if (xstate_sz != 0) {
xfpu.addr = (char *)(ucp + 1);
xfpu.len = xstate_sz;
if (sysarch(AMD64_GET_XFPUSTATE, &xfpu) == -1)
return (-1);
ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr;
ucp->uc_mcontext.mc_xfpustate_len = xstate_sz;
ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE;
} else {
ucp->uc_mcontext.mc_xfpustate = 0;
ucp->uc_mcontext.mc_xfpustate_len = 0;
}
xfpu.addr = (char *)(ucp + 1);
xfpu.len = xstate_sz;
if (sysarch(X86_GET_XFPUSTATE, &xfpu) == -1)
return (-1);
ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr;
ucp->uc_mcontext.mc_xfpustate_len = xstate_sz;
ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE;
return (0);
}
static int
__fillcontextx2_noxfpu(char *ctx)
{
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
ucp->uc_mcontext.mc_xfpustate = 0;
ucp->uc_mcontext.mc_xfpustate_len = 0;
return (0);
}
DEFINE_UIFUNC(, int, __fillcontextx2, (char *), static)
{
return ((cpu_feature2 & CPUID2_OSXSAVE) != 0 ? __fillcontextx2_xfpu :
__fillcontextx2_noxfpu);
}
int
__fillcontextx(char *ctx)
{

View file

@ -53,31 +53,6 @@ __FBSDID("$FreeBSD$");
#include <x86/ifunc.h>
#include "libc_private.h"
static void
cpuidp(u_int leaf, u_int p[4])
{
__asm __volatile(
#if defined(__i386__)
" pushl %%ebx\n"
#endif
" cpuid\n"
#if defined(__i386__)
" movl %%ebx,%1\n"
" popl %%ebx"
#endif
: "=a" (p[0]),
#if defined(__i386__)
"=r" (p[1]),
#elif defined(__amd64__)
"=b" (p[1]),
#else
#error "Arch"
#endif
"=c" (p[2]), "=d" (p[3])
: "0" (leaf));
}
static void
rdtsc_mb_lfence(void)
{
@ -100,12 +75,12 @@ rdtsc_mb_none(void)
DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static)
{
u_int p[4];
/* Not a typo, string matches our cpuidp() registers use. */
/* Not a typo, string matches our do_cpuid() registers use. */
static const char intel_id[] = "GenuntelineI";
if ((cpu_feature & CPUID_SSE2) == 0)
return (rdtsc_mb_none);
cpuidp(0, p);
do_cpuid(0, p);
return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ?
rdtsc_mb_lfence : rdtsc_mb_mfence);
}

View file

@ -304,6 +304,8 @@ parent(int sock)
name = nvlist_next(nvl, &type, &cookie);
CHECK(name == NULL);
nvlist_destroy(nvl);
}
static void

View file

@ -72,14 +72,15 @@ _tcb_set(struct tcb *tcb)
static __inline struct tcb *
_tcb_get(void)
{
register uint8_t *_tp;
register struct tcb *tcb;
#ifdef __powerpc64__
__asm __volatile("mr %0,13" : "=r"(_tp));
__asm __volatile("addi %0,13,%1" : "=r"(tcb) : "i"(-TP_OFFSET));
#else
__asm __volatile("mr %0,2" : "=r"(_tp));
__asm __volatile("addi %0,2,%1" : "=r"(tcb) : "i"(-TP_OFFSET));
#endif
return ((struct tcb *)(_tp - TP_OFFSET));
return (tcb);
}
static __inline struct pthread *

View file

@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 25, 2018
.Dd February 10, 2019
.Dt BECTL 8
.Os
.Sh NAME
@ -40,7 +40,7 @@
.Ar beName@snapshot
.Nm
.Cm destroy
.Op Fl F
.Op Fl \&Fo
.Brq Ar beName | beName@snapshot
.Nm
.Cm export
@ -124,7 +124,7 @@ If the
flag is given, a recursive boot environment will be made.
.It Xo
.Cm destroy
.Op Fl F
.Op Fl \&Fo
.Brq Ar beName | beName@snapshot
.Xc
Destroys the given
@ -136,6 +136,14 @@ snapshot without confirmation, unlike in
Specifying
.Fl F
will automatically unmount without confirmation.
.Pp
By default,
.Nm
will warn that it is not destroying the origin of
.Ar beName .
The
.Fl o
flag may be specified to destroy the origin as well.
.It Cm export Ar sourceBe
Export
.Ar sourceBe

View file

@ -341,15 +341,18 @@ bectl_cmd_add(int argc, char *argv[])
static int
bectl_cmd_destroy(int argc, char *argv[])
{
char *target;
int opt, err;
bool force;
nvlist_t *props;
char *origin, *target, targetds[BE_MAXPATHLEN];
int err, flags, opt;
force = false;
while ((opt = getopt(argc, argv, "F")) != -1) {
flags = 0;
while ((opt = getopt(argc, argv, "Fo")) != -1) {
switch (opt) {
case 'F':
force = true;
flags |= BE_DESTROY_FORCE;
break;
case 'o':
flags |= BE_DESTROY_ORIGIN;
break;
default:
fprintf(stderr, "bectl destroy: unknown option '-%c'\n",
@ -368,7 +371,24 @@ bectl_cmd_destroy(int argc, char *argv[])
target = argv[0];
err = be_destroy(be, target, force);
/* We'll emit a notice if there's an origin to be cleaned up */
if ((flags & BE_DESTROY_ORIGIN) == 0 && strchr(target, '@') == NULL) {
if (be_root_concat(be, target, targetds) != 0)
goto destroy;
if (be_prop_list_alloc(&props) != 0)
goto destroy;
if (be_get_dataset_props(be, targetds, props) != 0) {
be_prop_list_free(props);
goto destroy;
}
if (nvlist_lookup_string(props, "origin", &origin) == 0)
fprintf(stderr, "bectl destroy: leaving origin '%s' intact\n",
origin);
be_prop_list_free(props);
}
destroy:
err = be_destroy(be, target, flags);
return (err);
}

View file

@ -26,6 +26,17 @@
#
# $FreeBSD$
ZPOOL_NAME_FILE=zpool_name
get_zpool_name()
{
cat $ZPOOL_NAME_FILE
}
make_zpool_name()
{
mktemp -u bectl_test_XXXXXX > $ZPOOL_NAME_FILE
get_zpool_name
}
# Establishes a bectl_create zpool that can be used for some light testing; contains
# a 'default' BE and not much else.
bectl_create_setup()
@ -34,6 +45,9 @@ bectl_create_setup()
disk=$2
mnt=$3
# Sanity check to make sure `make_zpool_name` succeeded
atf_check test -n "$zpool"
kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system"
atf_check mkdir -p ${mnt}
atf_check truncate -s 1G ${disk}
@ -48,6 +62,9 @@ bectl_create_deep_setup()
disk=$2
mnt=$3
# Sanity check to make sure `make_zpool_name` succeeded
atf_check test -n "$zpool"
bectl_create_setup ${zpool} ${disk} ${mnt}
atf_check mkdir -p ${root}
atf_check -o ignore bectl -r ${zpool}/ROOT mount default ${root}
@ -60,8 +77,9 @@ bectl_create_deep_setup()
bectl_cleanup()
{
zpool=$1
if zpool get health ${zpool} >/dev/null 2>&1; then
if [ -z "$zpool" ]; then
echo "Skipping cleanup; zpool not set up"
elif zpool get health ${zpool} >/dev/null 2>&1; then
zpool destroy -f ${zpool}
fi
}
@ -76,7 +94,7 @@ bectl_create_head()
bectl_create_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
@ -89,8 +107,7 @@ bectl_create_body()
}
bectl_create_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_destroy cleanup
@ -103,20 +120,20 @@ bectl_destroy_head()
bectl_destroy_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
bectl_create_setup ${zpool} ${disk} ${mount}
atf_check bectl -r ${zpool}/ROOT create -e default default2
atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2
atf_check bectl -r ${zpool}/ROOT destroy default2
atf_check -e ignore bectl -r ${zpool}/ROOT destroy default2
atf_check -e not-empty -s not-exit:0 zfs get mountpoint ${zpool}/ROOT/default2
}
bectl_destroy_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_export_import cleanup
@ -129,7 +146,7 @@ bectl_export_import_head()
bectl_export_import_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
@ -137,14 +154,14 @@ bectl_export_import_body()
atf_check -o save:exported bectl -r ${zpool}/ROOT export default
atf_check -x "bectl -r ${zpool}/ROOT import default2 < exported"
atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2
atf_check bectl -r ${zpool}/ROOT destroy default2
atf_check -e ignore bectl -r ${zpool}/ROOT destroy default2
atf_check -e not-empty -s not-exit:0 zfs get mountpoint \
${zpool}/ROOT/default2
}
bectl_export_import_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_list cleanup
@ -157,7 +174,7 @@ bectl_list_head()
bectl_list_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
@ -171,7 +188,7 @@ bectl_list_body()
atf_check bectl -r ${zpool}/ROOT create -e default default2
atf_check -o save:list.out bectl -r ${zpool}/ROOT list
atf_check -o not-empty grep 'default2' list.out
atf_check bectl -r ${zpool}/ROOT destroy default2
atf_check -e ignore bectl -r ${zpool}/ROOT destroy default2
atf_check -o save:list.out bectl -r ${zpool}/ROOT list
atf_check -s not-exit:0 grep 'default2' list.out
# XXX TODO: Formatting checks
@ -179,7 +196,7 @@ bectl_list_body()
bectl_list_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_mount cleanup
@ -192,7 +209,7 @@ bectl_mount_head()
bectl_mount_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
root=${mount}/root
@ -213,7 +230,7 @@ bectl_mount_body()
bectl_mount_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_rename cleanup
@ -226,7 +243,7 @@ bectl_rename_head()
bectl_rename_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
@ -239,7 +256,7 @@ bectl_rename_body()
bectl_rename_cleanup()
{
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_test_case bectl_jail cleanup
@ -252,7 +269,7 @@ bectl_jail_head()
bectl_jail_body()
{
cwd=$(realpath .)
zpool=bectl_test
zpool=$(make_zpool_name)
disk=${cwd}/disk.img
mount=${cwd}/mnt
root=${mount}/root
@ -327,7 +344,7 @@ bectl_jail_cleanup()
jail -r ${jailid}
done;
bectl_cleanup bectl_test
bectl_cleanup $(get_zpool_name)
}
atf_init_test_cases()

View file

@ -174,18 +174,7 @@ g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error)
static void
random_bits(void *p, u_int len)
{
static int fdr = -1;
int i;
if (fdr < 0) {
fdr = open("/dev/urandom", O_RDONLY);
if (fdr < 0)
err(1, "/dev/urandom");
}
i = read(fdr, p, len);
if (i != (int)len)
err(1, "read from /dev/urandom");
arc4random_buf(p, len);
}
/* XXX: not nice */

View file

@ -5080,7 +5080,9 @@ ieee80211_status(int s)
LINE_CHECK("roam:rssi %u.5", rp->rssi/2);
else
LINE_CHECK("roam:rssi %u", rp->rssi/2);
LINE_CHECK("roam:rate %u", rp->rate/2);
LINE_CHECK("roam:rate %s%u",
(rp->rate & IEEE80211_RATE_MCS) ? "MCS " : "",
get_rate_value(rp->rate));
} else {
LINE_BREAK();
list_roam(s);

View file

@ -444,7 +444,8 @@ static void
do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
{
const char *ta; /* Type arg. */
char *linep, *linebuf; /* Line pointer, line buffer. */
char *linep;
char linebuf[12]; /* 32-bit unit (10) + '\n' (1) + '\0' (1) */
int fd; /* Standard output of mdconfig invocation. */
FILE *sfd;
int rv;
@ -479,14 +480,15 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
if (sfd == NULL)
err(1, "fdopen");
linep = fgetln(sfd, &linelen);
if (linep == NULL && linelen < mdnamelen + 1)
errx(1, "unexpected output from mdconfig (attach)");
/* If the output format changes, we want to know about it. */
assert(strncmp(linep, mdname, mdnamelen) == 0);
linebuf = malloc(linelen - mdnamelen + 1);
assert(linebuf != NULL);
if (linep == NULL || linelen <= mdnamelen + 1 ||
linelen - mdnamelen >= sizeof(linebuf) ||
strncmp(linep, mdname, mdnamelen) != 0)
errx(1, "unexpected output from mdconfig (attach)");
linep += mdnamelen;
linelen -= mdnamelen;
/* Can't use strlcpy because linep is not NULL-terminated. */
strncpy(linebuf, linep + mdnamelen, linelen);
strncpy(linebuf, linep, linelen);
linebuf[linelen] = '\0';
ul = strtoul(linebuf, &p, 10);
if (ul == ULONG_MAX || *p != '\n')
@ -494,7 +496,6 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
unit = ul;
fclose(sfd);
close(fd);
}
/*

View file

@ -429,34 +429,25 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
if (pa->qlimit == 0)
pa->qlimit = DEFAULT_QLIMIT;
if (eval_queue_opts(pa, opts,
parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth))
return (1);
if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC ||
pa->scheduler == ALTQT_FAIRQ) {
pa->bandwidth = eval_bwspec(bw,
parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth);
/*
* For HFSC, if the linkshare service curve m2 parameter is
* set, it overrides the provided queue bandwidth parameter,
* so adjust the queue bandwidth parameter accordingly here
* to avoid false positives in the total child bandwidth
* check below.
*/
if ((pa->scheduler == ALTQT_HFSC) &&
(pa->pq_u.hfsc_opts.lssc_m2 != 0)) {
pa->bandwidth = pa->pq_u.hfsc_opts.lssc_m2;
}
if (pa->bandwidth > pa->ifbandwidth) {
fprintf(stderr, "bandwidth for %s higher than "
"interface\n", pa->qname);
return (1);
}
/* check the sum of the child bandwidth is under parent's */
if (parent != NULL) {
/*
* If not HFSC, then check that the sum of the child
* bandwidths is less than the parent's bandwidth. For
* HFSC, the equivalent concept is to check that the sum of
* the child linkshare service curves are under the parent's
* linkshare service curve, and that check is performed by
* eval_pfqueue_hfsc().
*/
if ((parent != NULL) && (pa->scheduler != ALTQT_HFSC)) {
if (pa->bandwidth > parent->pa.bandwidth) {
warnx("bandwidth for %s higher than parent",
pa->qname);
@ -472,6 +463,10 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
}
}
if (eval_queue_opts(pa, opts,
parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth))
return (1);
if (parent != NULL)
parent->meta.children++;

View file

@ -1408,6 +1408,7 @@ ifa_grouplookup(char *ifa_name, int flags)
return (NULL);
bzero(&ifgr, sizeof(ifgr));
strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name));
ifgr.ifgr_len = len;
if ((ifgr.ifgr_groups = calloc(1, len)) == NULL)
err(1, "calloc");
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1)

View file

@ -77,6 +77,9 @@ The
.Xr cpuset 1
tool is available for starting processes with a non-default
policy, or to change the policy of an existing thread or process.
See
.Xr SMP 4
for information about CPU to domain mapping.
.Pp
Systems with non-uniform access to I/O devices may mark those devices
with the local VM domain identifier.
@ -117,6 +120,7 @@ Policy information is available in both struct thread and struct proc.
.Xr cpuset 1 ,
.Xr cpuset_getaffinity 2 ,
.Xr cpuset_setaffinity 2 ,
.Xr SMP 4 ,
.Xr bus_get_domain 9
.Sh HISTORY
.Nm

View file

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 8, 2019
.Dd February 12, 2019
.Dt PORTS 7
.Os
.Sh NAME
@ -38,8 +38,6 @@ Ports Collection
offers a simple way to compile and install third party applications.
It is also used to build packages, to be installed using
.Xr pkg 8 .
It can be installed and updated using
.Xr portsnap 8 .
.Pp
The ports tree, typically located at
.Pa /usr/ports ,
@ -62,6 +60,55 @@ Afterwards,
.Dq Li "make install"
installs the application.
.Pp
The
.Fx
Ports Collection is maintained in several branches, which differ mostly
by versions of software provided: the
.Em head
branch contains all the latest changes, while the
.Em quarterly
branches only provide critical fixes.
The
.Em head
branch can be installed or updated using either
.Xr portsnap 8 ,
or from Subversion repository at:
.Pp
.Lk https://svn.FreeBSD.org/ports/head
.Pp
The
.Em quarterly
branches can be found in Subversion in the
.Pa branches/
subdirectory, eg:
.Pp
.Lk https://svn.FreeBSD.org/ports/branches/2019Q1
.Pp
It is generally a good idea to use the
.Nm
branch that matches the
.Xr pkg 8
repository being used.
By default, for
.Fx CURRENT
the
.Xr pkg 8
is configured to install packages built from the
.Em head
branch, while for
.Fx STABLE
or RELEASE versions it is configured to install packages built from
the latest
.Em quarterly
branch.
Currently configured
.Xr pkg 8
repository can be verified by looking at the
.Em url
field in
.Cm pkg -vv
output.
.Pp
For more information about using ports, see the
.Dq "Packages and Ports" section
in

View file

@ -26,6 +26,7 @@ MLINKS= \
rc.8 rc.local.8 \
rc.8 rc.network.8 \
rc.8 rc.pccard.8 \
rc.8 rc.resume.8 \
rc.8 rc.serial.8 \
rc.8 rc.shutdown.8

View file

@ -4746,6 +4746,29 @@ st-meta-256color|simpleterm with meta key and 256 colors:\
:is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
:rs=\E[4l\E>\E[?1034h:tc=st-256color:
# From version 0.13.3
xterm-kitty|KovId's TTY:\
:tc=xterm-256color:tc=kitty+common:
kitty+common|KovId's TTY common properties:\
:am:hs:km:mi:ms:xn:\
:co#80:it#8:li#24:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\
:K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\
:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\
:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\
:ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\
:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\
:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\
:kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\
:ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\
:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
:te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\
:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\
:vs=\E[?12;25h:
#
# END OF TERMCAP
# ------------------------

View file

@ -122,13 +122,15 @@ net_open(struct open_file *f, ...)
{
struct iodesc *d;
va_list args;
char *devname; /* Device part of file name (or NULL). */
struct devdesc *dev;
const char *devname; /* Device part of file name (or NULL). */
int error = 0;
va_start(args, f);
devname = va_arg(args, char*);
dev = va_arg(args, struct devdesc *);
va_end(args);
devname = dev->d_dev->dv_name;
/* Before opening another interface, close the previous one first. */
if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0)
net_cleanup();
@ -137,7 +139,7 @@ net_open(struct open_file *f, ...)
if (netdev_opens == 0) {
/* Find network interface. */
if (netdev_sock < 0) {
netdev_sock = netif_open(devname);
netdev_sock = netif_open(dev);
if (netdev_sock < 0) {
printf("net_open: netif_open() failed\n");
return (ENXIO);

View file

@ -73,7 +73,8 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
.sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_TIMEKEEP,
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
SV_TIMEKEEP,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,

View file

@ -194,6 +194,11 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8xx power regulator");
#define AXP_BAT_CAP_WARN_LV1 0xf0 /* Bits 4, 5, 6, 7 */
#define AXP_BAT_CAP_WARN_LV2 0xf /* Bits 0, 1, 2, 3 */
/* Sensor conversion macros */
#define AXP_SENSOR_BAT_H(hi) ((hi) << 4)
#define AXP_SENSOR_BAT_L(lo) ((lo) & 0xf)
#define AXP_SENSOR_COULOMB(hi, lo) (((hi & ~(1 << 7)) << 8) | (lo))
static const struct {
const char *name;
uint8_t ctrl_reg;
@ -538,6 +543,123 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = {
},
};
enum axp8xx_sensor {
AXP_SENSOR_ACIN_PRESENT,
AXP_SENSOR_VBUS_PRESENT,
AXP_SENSOR_BATT_PRESENT,
AXP_SENSOR_BATT_CHARGING,
AXP_SENSOR_BATT_CHARGE_STATE,
AXP_SENSOR_BATT_VOLTAGE,
AXP_SENSOR_BATT_CHARGE_CURRENT,
AXP_SENSOR_BATT_DISCHARGE_CURRENT,
AXP_SENSOR_BATT_CAPACITY_PERCENT,
AXP_SENSOR_BATT_MAXIMUM_CAPACITY,
AXP_SENSOR_BATT_CURRENT_CAPACITY,
};
enum battery_capacity_state {
BATT_CAPACITY_NORMAL = 1, /* normal cap in battery */
BATT_CAPACITY_WARNING, /* warning cap in battery */
BATT_CAPACITY_CRITICAL, /* critical cap in battery */
BATT_CAPACITY_HIGH, /* high cap in battery */
BATT_CAPACITY_MAX, /* maximum cap in battery */
BATT_CAPACITY_LOW /* low cap in battery */
};
struct axp8xx_sensors {
int id;
const char *name;
const char *desc;
const char *format;
};
static const struct axp8xx_sensors axp8xx_common_sensors[] = {
{
.id = AXP_SENSOR_ACIN_PRESENT,
.name = "acin",
.format = "I",
.desc = "ACIN Present",
},
{
.id = AXP_SENSOR_VBUS_PRESENT,
.name = "vbus",
.format = "I",
.desc = "VBUS Present",
},
{
.id = AXP_SENSOR_BATT_PRESENT,
.name = "bat",
.format = "I",
.desc = "Battery Present",
},
{
.id = AXP_SENSOR_BATT_CHARGING,
.name = "batcharging",
.format = "I",
.desc = "Battery Charging",
},
{
.id = AXP_SENSOR_BATT_CHARGE_STATE,
.name = "batchargestate",
.format = "I",
.desc = "Battery Charge State",
},
{
.id = AXP_SENSOR_BATT_VOLTAGE,
.name = "batvolt",
.format = "I",
.desc = "Battery Voltage",
},
{
.id = AXP_SENSOR_BATT_CHARGE_CURRENT,
.name = "batchargecurrent",
.format = "I",
.desc = "Battery Charging Current",
},
{
.id = AXP_SENSOR_BATT_DISCHARGE_CURRENT,
.name = "batdischargecurrent",
.format = "I",
.desc = "Battery Discharging Current",
},
{
.id = AXP_SENSOR_BATT_CAPACITY_PERCENT,
.name = "batcapacitypercent",
.format = "I",
.desc = "Battery Capacity Percentage",
},
{
.id = AXP_SENSOR_BATT_MAXIMUM_CAPACITY,
.name = "batmaxcapacity",
.format = "I",
.desc = "Battery Maximum Capacity",
},
{
.id = AXP_SENSOR_BATT_CURRENT_CAPACITY,
.name = "batcurrentcapacity",
.format = "I",
.desc = "Battery Current Capacity",
},
};
struct axp8xx_config {
const char *name;
int batsense_step; /* uV */
int charge_step; /* uA */
int discharge_step; /* uA */
int maxcap_step; /* uAh */
int coulomb_step; /* uAh */
};
static struct axp8xx_config axp803_config = {
.name = "AXP803",
.batsense_step = 1100,
.charge_step = 1000,
.discharge_step = 1000,
.maxcap_step = 1456,
.coulomb_step = 1456,
};
struct axp8xx_softc;
struct axp8xx_reg_sc {
@ -558,9 +680,20 @@ struct axp8xx_softc {
int type;
/* Configs */
const struct axp8xx_config *config;
/* Sensors */
const struct axp8xx_sensors *sensors;
int nsensors;
/* Regulators */
struct axp8xx_reg_sc **regs;
int nregs;
/* Warning, shutdown thresholds */
int warn_thres;
int shut_thres;
};
#define AXP_LOCK(sc) mtx_lock(&(sc)->mtx)
@ -756,6 +889,110 @@ axp8xx_shutdown(void *devp, int howto)
axp8xx_write(dev, AXP_POWERBAT, AXP_POWERBAT_SHUTDOWN);
}
static int
axp8xx_sysctl(SYSCTL_HANDLER_ARGS)
{
struct axp8xx_softc *sc;
device_t dev = arg1;
enum axp8xx_sensor sensor = arg2;
const struct axp8xx_config *c;
uint8_t data;
int val, i, found, batt_val;
uint8_t lo, hi;
sc = device_get_softc(dev);
c = sc->config;
for (found = 0, i = 0; i < sc->nsensors; i++) {
if (sc->sensors[i].id == sensor) {
found = 1;
break;
}
}
if (found == 0)
return (ENOENT);
switch (sensor) {
case AXP_SENSOR_ACIN_PRESENT:
if (axp8xx_read(dev, AXP_POWERSRC, &data, 1) == 0)
val = !!(data & AXP_POWERSRC_ACIN);
break;
case AXP_SENSOR_VBUS_PRESENT:
if (axp8xx_read(dev, AXP_POWERSRC, &data, 1) == 0)
val = !!(data & AXP_POWERSRC_VBUS);
break;
case AXP_SENSOR_BATT_PRESENT:
if (axp8xx_read(dev, AXP_POWERMODE, &data, 1) == 0) {
if (data & AXP_POWERMODE_BAT_VALID)
val = !!(data & AXP_POWERMODE_BAT_PRESENT);
}
break;
case AXP_SENSOR_BATT_CHARGING:
if (axp8xx_read(dev, AXP_POWERMODE, &data, 1) == 0)
val = !!(data & AXP_POWERMODE_BAT_CHARGING);
break;
case AXP_SENSOR_BATT_CHARGE_STATE:
if (axp8xx_read(dev, AXP_BAT_CAP, &data, 1) == 0 &&
(data & AXP_BAT_CAP_VALID) != 0) {
batt_val = (data & AXP_BAT_CAP_PERCENT);
if (batt_val <= sc->shut_thres)
val = BATT_CAPACITY_CRITICAL;
else if (batt_val <= sc->warn_thres)
val = BATT_CAPACITY_WARNING;
else
val = BATT_CAPACITY_NORMAL;
}
break;
case AXP_SENSOR_BATT_CAPACITY_PERCENT:
if (axp8xx_read(dev, AXP_BAT_CAP, &data, 1) == 0 &&
(data & AXP_BAT_CAP_VALID) != 0)
val = (data & AXP_BAT_CAP_PERCENT);
break;
case AXP_SENSOR_BATT_VOLTAGE:
if (axp8xx_read(dev, AXP_BATSENSE_HI, &hi, 1) == 0 &&
axp8xx_read(dev, AXP_BATSENSE_LO, &lo, 1) == 0) {
val = (AXP_SENSOR_BAT_H(hi) | AXP_SENSOR_BAT_L(lo));
val *= c->batsense_step;
}
break;
case AXP_SENSOR_BATT_CHARGE_CURRENT:
if (axp8xx_read(dev, AXP_POWERSRC, &data, 1) == 0 &&
(data & AXP_POWERSRC_CHARING) != 0 &&
axp8xx_read(dev, AXP_BATCHG_HI, &hi, 1) == 0 &&
axp8xx_read(dev, AXP_BATCHG_LO, &lo, 1) == 0) {
val = (AXP_SENSOR_BAT_H(hi) | AXP_SENSOR_BAT_L(lo));
val *= c->charge_step;
}
break;
case AXP_SENSOR_BATT_DISCHARGE_CURRENT:
if (axp8xx_read(dev, AXP_POWERSRC, &data, 1) == 0 &&
(data & AXP_POWERSRC_CHARING) == 0 &&
axp8xx_read(dev, AXP_BATDISCHG_HI, &hi, 1) == 0 &&
axp8xx_read(dev, AXP_BATDISCHG_LO, &lo, 1) == 0) {
val = (AXP_SENSOR_BAT_H(hi) | AXP_SENSOR_BAT_L(lo));
val *= c->discharge_step;
}
break;
case AXP_SENSOR_BATT_MAXIMUM_CAPACITY:
if (axp8xx_read(dev, AXP_BAT_MAX_CAP_HI, &hi, 1) == 0 &&
axp8xx_read(dev, AXP_BAT_MAX_CAP_LO, &lo, 1) == 0) {
val = AXP_SENSOR_COULOMB(hi, lo);
val *= c->maxcap_step;
}
break;
case AXP_SENSOR_BATT_CURRENT_CAPACITY:
if (axp8xx_read(dev, AXP_BAT_COULOMB_HI, &hi, 1) == 0 &&
axp8xx_read(dev, AXP_BAT_COULOMB_LO, &lo, 1) == 0) {
val = AXP_SENSOR_COULOMB(hi, lo);
val *= c->coulomb_step;
}
break;
}
return sysctl_handle_opaque(oidp, &val, sizeof(val), req);
}
static void
axp8xx_intr(void *arg)
{
@ -1157,7 +1394,7 @@ axp8xx_attach(device_t dev)
{
struct axp8xx_softc *sc;
struct axp8xx_reg_sc *reg;
uint8_t chip_id;
uint8_t chip_id, val;
phandle_t rnode, child;
int error, i;
@ -1187,6 +1424,10 @@ axp8xx_attach(device_t dev)
sc->nregs += nitems(axp813_regdefs);
break;
}
sc->config = &axp803_config;
sc->sensors = axp8xx_common_sensors;
sc->nsensors = nitems(axp8xx_common_sensors);
sc->regs = malloc(sizeof(struct axp8xx_reg_sc *) * sc->nregs,
M_AXP8XX_REG, M_WAITOK | M_ZERO);
@ -1231,6 +1472,31 @@ axp8xx_attach(device_t dev)
}
}
/* Add sensors */
for (i = 0; i < sc->nsensors; i++) {
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, sc->sensors[i].name,
CTLTYPE_INT | CTLFLAG_RD,
dev, sc->sensors[i].id, axp8xx_sysctl,
sc->sensors[i].format,
sc->sensors[i].desc);
}
/* Get thresholds */
if (axp8xx_read(dev, AXP_BAT_CAP_WARN, &val, 1) == 0) {
sc->warn_thres = (val & AXP_BAT_CAP_WARN_LV1) >> 4;
sc->shut_thres = (val & AXP_BAT_CAP_WARN_LV2);
if (bootverbose) {
device_printf(dev,
"Raw reg val: 0x%02x\n", val);
device_printf(dev,
"Warning threshold: 0x%02x\n", sc->warn_thres);
device_printf(dev,
"Shutdown threshold: 0x%02x\n", sc->shut_thres);
}
}
/* Enable interrupts */
axp8xx_write(dev, AXP_IRQEN1,
AXP_IRQEN1_VBUS_LO |

View file

@ -339,16 +339,27 @@ cacheline_bounce(bus_dmamap_t map, bus_addr_t addr, bus_size_t size)
*
* Note that the addr argument might be either virtual or physical. It doesn't
* matter because we only look at the low-order bits, which are the same in both
* address spaces.
* address spaces and maximum alignment of generic buffer is limited up to page
* size.
* Bouncing of buffers allocated by bus_dmamem_alloc()is not necessary, these
* always comply with the required rules (alignment, boundary, and address
* range).
*/
static __inline int
might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr,
bus_size_t size)
{
return ((dmat->flags & BUS_DMA_EXCL_BOUNCE) ||
KASSERT(map->flags & DMAMAP_DMAMEM_ALLOC ||
dmat->alignment <= PAGE_SIZE,
("%s: unsupported alignment (0x%08lx) for buffer not "
"allocated by bus_dmamem_alloc()",
__func__, dmat->alignment));
return (!(map->flags & DMAMAP_DMAMEM_ALLOC) &&
((dmat->flags & BUS_DMA_EXCL_BOUNCE) ||
alignment_bounce(dmat, addr) ||
cacheline_bounce(map, addr, size));
cacheline_bounce(map, addr, size)));
}
/*

View file

@ -82,9 +82,9 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_maxssiz = NULL,
.sv_flags =
#if __ARM_ARCH >= 6
SV_SHP | SV_TIMEKEEP |
SV_ASLR | SV_SHP | SV_TIMEKEEP |
#endif
SV_ABI_FREEBSD | SV_ILP32,
SV_ABI_FREEBSD | SV_ILP32 | SV_ASLR,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,

View file

@ -311,13 +311,6 @@ tegra_sdhci_attach(device_t dev)
gpio_pin_get_by_ofw_property(sc->dev, node, "power-gpios", &sc->gpio_power);
rv = clk_get_by_ofw_index(dev, 0, 0, &sc->clk);
if (rv != 0) {
device_printf(dev, "Cannot get clock\n");
goto fail;
}
rv = clk_get_by_ofw_index(dev, 0, 0, &sc->clk);
if (rv != 0) {
device_printf(dev, "Cannot get clock\n");

View file

@ -79,7 +79,8 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
.sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64,
.sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64 |
SV_ASLR,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,

View file

@ -5411,8 +5411,9 @@ xpt_done_process(struct ccb_hdr *ccb_h)
}
/*
* Insulate against a race where the periph is destroyed
* but CCBs are still not all processed.
* Insulate against a race where the periph is destroyed but CCBs are
* still not all processed. This shouldn't happen, but allows us better
* bug diagnostic when it does.
*/
if (ccb_h->path->bus)
sim = ccb_h->path->bus->sim;
@ -5434,7 +5435,7 @@ xpt_done_process(struct ccb_hdr *ccb_h)
if (sim)
devq = sim->devq;
KASSERT(devq, ("sim missing for XPT_FC_USER_CCB request"));
KASSERT(devq, ("Periph disappeared with request pending."));
mtx_lock(&devq->send_mtx);
devq->send_active--;

View file

@ -1385,6 +1385,12 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
probe_purge_old(path, lp, softc->flags);
lp = NULL;
}
/* The processing above should either exit via a `goto
* out` or leave the `lp` variable `NULL` and (if
* applicable) `free()` the storage to which it had
* pointed. Assert here that is the case.
*/
KASSERT(lp == NULL, ("%s: lp is not NULL", __func__));
inq_buf = &path->device->inq_data;
if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID &&
(SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED ||
@ -1398,9 +1404,6 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
xpt_schedule(periph, priority);
goto out;
}
if (lp) {
free(lp, M_CAMXPT);
}
PROBE_SET_ACTION(softc, PROBE_INVALID);
xpt_release_ccb(done_ccb);
break;

View file

@ -3328,6 +3328,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
int error, error1, flags, signum;
switch (uap->com) {
case PROC_ASLR_CTL:
case PROC_SPROTECT:
case PROC_TRACE_CTL:
case PROC_TRAPCAP_CTL:
@ -3359,6 +3360,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
return (error);
data = &x.rk;
break;
case PROC_ASLR_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
data = &flags;
@ -3387,6 +3389,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
if (error == 0)
error = error1;
break;
case PROC_ASLR_STATUS:
case PROC_TRACE_STATUS:
case PROC_TRAPCAP_STATUS:
if (error == 0)

View file

@ -119,7 +119,7 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_setregs = ia32_setregs,
.sv_fixlimit = ia32_fixlimit,
.sv_maxssiz = &ia32_maxssiz,
.sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 |
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 |
SV_SHP | SV_TIMEKEEP,
.sv_set_syscall_retval = ia32_set_syscall_retval,
.sv_fetch_syscall_args = ia32_fetch_syscall_args,

View file

@ -109,7 +109,7 @@ tasklet_subsystem_init(void *arg __unused)
GROUPTASK_INIT(&tw->gtask, 0, tasklet_handler, tw);
snprintf(buf, sizeof(buf), "softirq%d", i);
taskqgroup_attach_cpu(qgroup_softirq, &tw->gtask,
"tasklet", i, -1, buf);
"tasklet", i, NULL, NULL, buf);
}
}
SYSINIT(linux_tasklet, SI_SUB_TASKQ, SI_ORDER_THIRD, tasklet_subsystem_init, NULL);

View file

@ -3808,7 +3808,7 @@ kern/kern_idle.c standard
kern/kern_intr.c standard
kern/kern_jail.c standard
kern/kern_kcov.c optional kcov \
compile-with "${NORMAL_C} -fno-sanitize=all"
compile-with "${NORMAL_C:N-fsanitize*}"
kern/kern_khelp.c standard
kern/kern_kthread.c standard
kern/kern_ktr.c optional ktr
@ -3884,7 +3884,7 @@ kern/subr_clock.c standard
kern/subr_compressor.c standard \
compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd"
kern/subr_coverage.c optional coverage \
compile-with "${NORMAL_C} -fno-sanitize=all"
compile-with "${NORMAL_C:N-fsanitize*}"
kern/subr_counter.c standard
kern/subr_devstat.c standard
kern/subr_disk.c standard
@ -4847,6 +4847,8 @@ crypto/libsodium/randombytes.c optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
crypto/libsodium/utils.c optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
opencrypto/cbc_mac.c optional crypto
opencrypto/xform_cbc_mac.c optional crypto
rpc/auth_none.c optional krpc | nfslockd | nfscl | nfsd
rpc/auth_unix.c optional krpc | nfslockd | nfscl | nfsd
rpc/authunix_prot.c optional krpc | nfslockd | nfscl | nfsd

View file

@ -103,6 +103,7 @@ bool nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp);
void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent);
void nvlist_set_array_next(nvlist_t *nvl, nvpair_t *ele);
nvpair_t *nvlist_get_array_next_nvpair(nvlist_t *nvl);
const nvpair_t *nvlist_get_nvpair(const nvlist_t *nvl, const char *name);

View file

@ -247,6 +247,15 @@ nvlist_set_array_next(nvlist_t *nvl, nvpair_t *ele)
nvl->nvl_array_next = ele;
}
nvpair_t *
nvlist_get_array_next_nvpair(nvlist_t *nvl)
{
NVLIST_ASSERT(nvl);
return (nvl->nvl_array_next);
}
bool
nvlist_in_array(const nvlist_t *nvl)
{

View file

@ -229,8 +229,16 @@ nvpair_remove_nvlist_array(nvpair_t *nvp)
nvlarray = __DECONST(nvlist_t **,
nvpair_get_nvlist_array(nvp, &count));
for (i = 0; i < count; i++) {
nvlist_set_array_next(nvlarray[i], NULL);
nvlist_set_parent(nvlarray[i], NULL);
nvlist_t *nvl;
nvpair_t *nnvp;
nvl = nvlarray[i];
nnvp = nvlist_get_array_next_nvpair(nvl);
if (nnvp != NULL) {
nvpair_free_structure(nnvp);
}
nvlist_set_array_next(nvl, NULL);
nvlist_set_parent(nvl, NULL);
}
}
@ -1193,8 +1201,7 @@ nvpair_create_stringv(const char *name, const char *valuefmt, va_list valueap)
if (len < 0)
return (NULL);
nvp = nvpair_create_string(name, str);
if (nvp == NULL)
nv_free(str);
nv_free(str);
return (nvp);
}
@ -2054,6 +2061,7 @@ nvpair_free(nvpair_t *nvp)
case NV_TYPE_DESCRIPTOR_ARRAY:
for (i = 0; i < nvp->nvp_nitems; i++)
close(((int *)(intptr_t)nvp->nvp_data)[i]);
nv_free((int *)(intptr_t)nvp->nvp_data);
break;
#endif
case NV_TYPE_NVLIST:

View file

@ -187,7 +187,7 @@ vtblk_proc(struct beri_vtblk_softc *sc, struct vqueue_info *vq)
break;
case VIRTIO_BLK_T_GET_ID:
/* Assume a single buffer */
strlcpy(iov[1].iov_base, sc->ident,
strncpy(iov[1].iov_base, sc->ident,
MIN(iov[1].iov_len, sizeof(sc->ident)));
err = 0;
break;
@ -401,7 +401,7 @@ backend_info(struct beri_vtblk_softc *sc)
s+=1;
}
sprintf(sc->ident, "Virtio block backend");
strncpy(sc->ident, "Virtio block backend", sizeof(sc->ident));
return (0);
}

View file

@ -5306,6 +5306,7 @@ void t4_intr_enable(struct adapter *adap)
F_EGRESS_SIZE_ERR;
t4_set_reg_field(adap, A_SGE_INT_ENABLE3, val, val);
t4_write_reg(adap, MYPF_REG(A_PL_PF_INT_ENABLE), PF_INTR_MASK);
t4_set_reg_field(adap, A_PL_INT_ENABLE, F_SF | F_I2CM, 0);
t4_set_reg_field(adap, A_PL_INT_MAP0, 0, 1 << adap->pf);
}

View file

@ -1046,10 +1046,6 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num)
"RX buffer - next to use: %d", next_to_use);
req_id = rx_ring->free_rx_ids[next_to_use];
rc = validate_rx_req_id(rx_ring, req_id);
if (unlikely(rc != 0))
break;
rx_info = &rx_ring->rx_buffer_info[req_id];
rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info);
@ -1472,21 +1468,24 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs,
struct ena_rx_buffer *rx_info;
struct ena_adapter *adapter;
unsigned int descs = ena_rx_ctx->descs;
int rc;
uint16_t ntc, len, req_id, buf = 0;
ntc = *next_to_clean;
adapter = rx_ring->adapter;
rx_info = &rx_ring->rx_buffer_info[ntc];
len = ena_bufs[buf].len;
req_id = ena_bufs[buf].req_id;
rc = validate_rx_req_id(rx_ring, req_id);
if (unlikely(rc != 0))
return (NULL);
rx_info = &rx_ring->rx_buffer_info[req_id];
if (unlikely(rx_info->mbuf == NULL)) {
device_printf(adapter->pdev, "NULL mbuf in rx_info");
return (NULL);
}
len = ena_bufs[buf].len;
req_id = ena_bufs[buf].req_id;
rx_info = &rx_ring->rx_buffer_info[req_id];
ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx",
rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr);
@ -1517,6 +1516,16 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs,
++buf;
len = ena_bufs[buf].len;
req_id = ena_bufs[buf].req_id;
rc = validate_rx_req_id(rx_ring, req_id);
if (unlikely(rc != 0)) {
/*
* If the req_id is invalid, then the device will be
* reset. In that case we must free all mbufs that
* were already gathered.
*/
m_freem(mbuf);
return (NULL);
}
rx_info = &rx_ring->rx_buffer_info[req_id];
if (unlikely(rx_info->mbuf == NULL)) {

View file

@ -41,7 +41,7 @@
#define DRV_MODULE_VER_MAJOR 0
#define DRV_MODULE_VER_MINOR 8
#define DRV_MODULE_VER_SUBMINOR 2
#define DRV_MODULE_VER_SUBMINOR 3
#define DRV_MODULE_NAME "ena"

View file

@ -932,7 +932,7 @@ ixl_if_msix_intr_assign(if_ctx_t ctx, int msix)
return (err);
}
/* Create soft IRQ for handling VFLRs */
iflib_softirq_alloc_generic(ctx, &pf->iov_irq, IFLIB_INTR_IOV, pf, 0, "iov");
iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_IOV, pf, 0, "iov");
/* Now set up the stations */
for (i = 0, vector = 1; i < vsi->shared->isc_nrxqsets; i++, vector++, rx_que++) {

View file

@ -138,7 +138,6 @@ struct ixl_pf {
struct ixl_vf *vfs;
int num_vfs;
uint16_t veb_seid;
struct if_irq iov_irq;
};
/*

View file

@ -1051,13 +1051,9 @@ malo_tx_start(struct malo_softc *sc, struct ieee80211_node *ni,
copyhdrlen = hdrlen = ieee80211_anyhdrsize(wh);
pktlen = m0->m_pkthdr.len;
if (IEEE80211_QOS_HAS_SEQ(wh)) {
if (IEEE80211_IS_DSTODS(wh)) {
qos = *(uint16_t *)
(((struct ieee80211_qosframe_addr4 *) wh)->i_qos);
qos = *(uint16_t *)ieee80211_getqos(wh);
if (IEEE80211_IS_DSTODS(wh))
copyhdrlen -= sizeof(qos);
} else
qos = *(uint16_t *)
(((struct ieee80211_qosframe *) wh)->i_qos);
} else
qos = 0;
@ -1952,7 +1948,6 @@ malo_rx_proc(void *arg, int npending)
struct malo_rxdesc *ds;
struct mbuf *m, *mnew;
struct ieee80211_qosframe *wh;
struct ieee80211_qosframe_addr4 *wh4;
struct ieee80211_node *ni;
int off, len, hdrlen, pktlen, rssi, ntodo;
uint8_t *data, status;
@ -2062,15 +2057,8 @@ malo_rx_proc(void *arg, int npending)
/* NB: don't need to do this sometimes but ... */
/* XXX special case so we can memcpy after m_devget? */
ovbcopy(data + sizeof(uint16_t), wh, hdrlen);
if (IEEE80211_QOS_HAS_SEQ(wh)) {
if (IEEE80211_IS_DSTODS(wh)) {
wh4 = mtod(m,
struct ieee80211_qosframe_addr4*);
*(uint16_t *)wh4->i_qos = ds->qosctrl;
} else {
*(uint16_t *)wh->i_qos = ds->qosctrl;
}
}
if (IEEE80211_QOS_HAS_SEQ(wh))
*(uint16_t *)ieee80211_getqos(wh) = ds->qosctrl;
if (ieee80211_radiotap_active(ic)) {
sc->malo_rx_th.wr_flags = 0;
sc->malo_rx_th.wr_rate = ds->rate;

Some files were not shown because too many files have changed in this diff Show more