Merge ^/head r309263 through r309518.

This commit is contained in:
Dimitry Andric 2016-12-04 00:00:56 +00:00
commit 4f9d94bf64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang391-import/; revision=309519
311 changed files with 56476 additions and 22612 deletions

View File

@ -1631,11 +1631,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
_cat= bin/cat
.endif
# r264059 support for status=
.if ${BOOTSTRAPPING} < 1100017
_dd= bin/dd
.endif
# r277259 crunchide: Correct 64-bit section header offset
# r281674 crunchide: always include both 32- and 64-bit ELF support
.if ${BOOTSTRAPPING} < 1100078
@ -1718,7 +1713,6 @@ bootstrap-tools: .PHONY
${_groff} \
${_dtc} \
${_cat} \
${_dd} \
${_kbdcontrol} \
usr.bin/lorder \
${_libopenbsd} \
@ -2403,6 +2397,11 @@ delete-old-dirs: .PHONY
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
fi; \
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
fi; \
done
@echo ">>> Old directories removed"
@ -2417,6 +2416,11 @@ check-old-dirs: .PHONY
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
fi; \
if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
fi; \
done
delete-old: delete-old-files delete-old-dirs .PHONY

View File

@ -52,8 +52,6 @@ static char *curfile;
#define CTF_BUF_CHUNK_SIZE (64 * 1024)
#define RES_BUF_CHUNK_SIZE (64 * 1024)
static int ntypes = 0; /* The number of types. */
struct ctf_buf {
strtab_t ctb_strtab; /* string table */
caddr_t ctb_base; /* pointer to base of buffer */
@ -1145,10 +1143,6 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize,
(*mpp)->ml_type = tdarr[ctm->ctm_type];
(*mpp)->ml_offset = ctm->ctm_offset;
(*mpp)->ml_size = 0;
if (ctm->ctm_type > ntypes) {
parseterminate("Invalid member type ctm_type=%d",
ctm->ctm_type);
}
}
} else {
for (i = 0, mpp = &tdp->t_members; i < vlen;
@ -1165,10 +1159,6 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize,
(*mpp)->ml_offset =
(int)CTF_LMEM_OFFSET(ctlm);
(*mpp)->ml_size = 0;
if (ctlm->ctlm_type > ntypes) {
parseterminate("Invalid lmember type ctlm_type=%d",
ctlm->ctlm_type);
}
}
}
@ -1282,10 +1272,9 @@ ctf_parse(ctf_header_t *h, caddr_t buf, symit_data_t *si, char *label)
{
tdata_t *td = tdata_new();
tdesc_t **tdarr;
int ntypes = count_types(h, buf);
int idx, i;
ntypes = count_types(h, buf);
/* shudder */
tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1));
tdarr[0] = NULL;

View File

@ -159,7 +159,7 @@ typedef struct ardef {
/* Auxiliary structure for structure/union tdesc_t */
typedef struct mlist {
int ml_offset; /* Offset from start of structure (in bits) */
uint_t ml_size; /* Member size (in bits) */
int ml_size; /* Member size (in bits) */
char *ml_name; /* Member name */
struct tdesc *ml_type; /* Member type */
struct mlist *ml_next; /* Next member */

View File

@ -727,13 +727,6 @@ die_array_create(dwarf_t *dw, Dwarf_Die arr, Dwarf_Off off, tdesc_t *tdp)
tdesc_t *dimtdp;
int flags;
/* Check for bogus gcc DW_AT_byte_size attribute */
if (uval == (unsigned)-1) {
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
__func__);
uval = 0;
}
tdp->t_size = uval;
/*
@ -826,12 +819,6 @@ die_enum_create(dwarf_t *dw, Dwarf_Die die, Dwarf_Off off, tdesc_t *tdp)
tdp->t_type = ENUM;
(void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ);
/* Check for bogus gcc DW_AT_byte_size attribute */
if (uval == (unsigned)-1) {
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
__func__);
uval = 0;
}
tdp->t_size = uval;
if ((mem = die_child(dw, die)) != NULL) {
@ -945,7 +932,7 @@ static void
die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
int type, const char *typename)
{
Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0;
Dwarf_Unsigned sz, bitsz, bitoff;
#if BYTE_ORDER == _LITTLE_ENDIAN
Dwarf_Unsigned bysz;
#endif
@ -1004,8 +991,6 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
ml->ml_name = NULL;
ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type);
debug(3, "die_sou_create(): ml_type = %p t_id = %d\n",
ml->ml_type, ml->ml_type->t_id);
if (die_mem_offset(dw, mem, DW_AT_data_member_location,
&mloff, 0)) {
@ -1051,24 +1036,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
*mlastp = ml;
mlastp = &ml->ml_next;
/* Find the size of the largest member to work around a gcc
* bug. See GCC Bugzilla 35998.
*/
if (maxsz < ml->ml_size)
maxsz = ml->ml_size;
} while ((mem = die_sibling(dw, mem)) != NULL);
/* See if we got a bogus DW_AT_byte_size. GCC will sometimes
* emit this.
*/
if (sz == (unsigned)-1) {
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
__func__);
tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */
}
/*
* GCC will attempt to eliminate unused types, thus decreasing the
* size of the emitted dwarf. That is, if you declare a foo_t in your
@ -1170,7 +1139,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private)
}
if (ml->ml_size != 0 && mt->t_type == INTRINSIC &&
mt->t_intr->intr_nbits != (int)ml->ml_size) {
mt->t_intr->intr_nbits != ml->ml_size) {
/*
* This member is a bitfield, and needs to reference
* an intrinsic type with the same width. If the
@ -1486,13 +1455,6 @@ die_base_create(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, tdesc_t *tdp)
*/
(void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ);
/* Check for bogus gcc DW_AT_byte_size attribute */
if (sz == (unsigned)-1) {
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
__func__);
sz = 0;
}
if (tdp->t_name == NULL)
terminate("die %llu: base type without name\n", off);

View File

@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_t **rtdp)
itdp = find_intrinsic(tdp);
if (itdp->t_type == INTRINSIC) {
if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) {
if (mlp->ml_size != itdp->t_intr->intr_nbits) {
parse_debug(4, cp, "making %d bit intrinsic "
"from %s", mlp->ml_size, tdesc_name(itdp));
mlp->ml_type = bitintrinsic(itdp, mlp->ml_size);
@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, void *private __unused)
while (tdp) {
switch (tdp->t_type) {
case INTRINSIC:
if ((int)ml->ml_size != tdp->t_intr->intr_nbits) {
if (ml->ml_size != tdp->t_intr->intr_nbits) {
debug(3, "making %d bit intrinsic from %s",
ml->ml_size, tdesc_name(tdp));
ml->ml_type = bitintrinsic(tdp, ml->ml_size);

View File

@ -1,3 +1,5 @@
Oct 26, 2016: Remove liblzmadec support
Oct 23, 2016: libarchive 3.2.2 released
Security release

View File

@ -562,7 +562,7 @@ __LA_DECL la_int64_t archive_read_header_position(struct archive *);
* we cannot say whether there are encrypted entries, then
* ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned.
* In general, this function will return values below zero when the
* reader is uncertain or totally uncapable of encryption support.
* reader is uncertain or totally incapable of encryption support.
* When this function returns 0 you can be sure that the reader
* supports encryption detection but no encrypted entries have
* been found yet.
@ -984,12 +984,12 @@ __LA_DECL int archive_read_disk_can_descend(struct archive *);
__LA_DECL int archive_read_disk_current_filesystem(struct archive *);
__LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *);
__LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *);
/* Request that the access time of the entry visited by travesal be restored. */
/* Request that the access time of the entry visited by traversal be restored. */
__LA_DECL int archive_read_disk_set_atime_restored(struct archive *);
/*
* Set behavior. The "flags" argument selects optional behavior.
*/
/* Request that the access time of the entry visited by travesal be restored.
/* Request that the access time of the entry visited by traversal be restored.
* This is the same as archive_read_disk_set_atime_restored. */
#define ARCHIVE_READDISK_RESTORE_ATIME (0x0001)
/* Default: Do not skip an entry which has nodump flags. */
@ -1124,7 +1124,7 @@ __LA_DECL int archive_match_time_excluded(struct archive *,
/*
* Flags to tell a matching type of time stamps. These are used for
* following functinos.
* following functions.
*/
/* Time flag: mtime to be tested. */
#define ARCHIVE_MATCH_MTIME (0x0100)
@ -1144,7 +1144,7 @@ __LA_DECL int archive_match_include_date(struct archive *, int _flag,
const char *_datestr);
__LA_DECL int archive_match_include_date_w(struct archive *, int _flag,
const wchar_t *_datestr);
/* Set inclusion time by a particluar file. */
/* Set inclusion time by a particular file. */
__LA_DECL int archive_match_include_file_time(struct archive *,
int _flag, const char *_pathname);
__LA_DECL int archive_match_include_file_time_w(struct archive *,

View File

@ -94,6 +94,7 @@ archive_acl_clear(struct archive_acl *acl)
acl->acl_text = NULL;
}
acl->acl_p = NULL;
acl->acl_types = 0;
acl->acl_state = 0; /* Not counting. */
}
@ -284,8 +285,11 @@ acl_new_entry(struct archive_acl *acl,
aq = NULL;
while (ap != NULL) {
if (ap->type == type && ap->tag == tag && ap->id == id) {
ap->permset = permset;
return (ap);
if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
tag != ARCHIVE_ENTRY_ACL_GROUP)) {
ap->permset = permset;
return (ap);
}
}
aq = ap;
ap = ap->next;

View File

@ -1441,6 +1441,15 @@ archive_entry_acl_add_entry_w(struct archive_entry *entry,
type, permset, tag, id, name, wcslen(name));
}
/*
* Return a bitmask of ACL types in an archive entry ACL list
*/
int
archive_entry_acl_types(struct archive_entry *entry)
{
return ((&entry->acl)->acl_types);
}
/*
* Return a count of entries matching "want_type".
*/

View File

@ -508,6 +508,9 @@ __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
__LA_DECL const char *archive_entry_acl_text(struct archive_entry *,
int /* flags */);
/* Return bitmask of ACL types in an archive entry */
__LA_DECL int archive_entry_acl_types(struct archive_entry *);
/* Return a count of entries matching 'want_type' */
__LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */);

View File

@ -33,7 +33,8 @@
.Nm archive_entry_acl_next ,
.Nm archive_entry_acl_next_w ,
.Nm archive_entry_acl_reset ,
.Nm archive_entry_acl_text_w
.Nm archive_entry_acl_text_w ,
.Nm archive_entry_acl_types
.Nd functions for manipulating Access Control Lists in archive entry descriptions
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@ -85,6 +86,8 @@ Streaming Archive Library (libarchive, -larchive)
.Fn archive_entry_acl_reset "struct archive_entry *a" "int type"
.Ft const wchar_t *
.Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags"
.Ft int
.Fn archive_entry_acl_types "struct archive_entry *a"
.\" enum?
.Sh DESCRIPTION
An
@ -192,6 +195,11 @@ The returned long string is valid until the next call to
.Fn archive_entry_acl_add_entry_w
or
.Fn archive_entry_acl_text_w .
.Pp
.Fn archive_entry_acl_types
get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4
ACL entries cannot be mixed, this function is a very efficient way to detect if
an ACL already contains POSIX.1e or NFSv4 ACL entries.
.Sh RETURN VALUES
.Fn archive_entry_acl_count
and
@ -225,6 +233,9 @@ The returned long string is valid until the next call to
.Fn archive_entry_acl_add_entry_w
or
.Fn archive_entry_acl_text_w .
.Pp
.Fn archive_entry_acl_types
returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries.
.Sh SEE ALSO
.Xr archive_entry 3
.Xr libarchive 3 ,

View File

@ -125,6 +125,10 @@ static int setup_xattrs(struct archive_read_disk *,
struct archive_entry *, int *fd);
static int setup_sparse(struct archive_read_disk *,
struct archive_entry *, int *fd);
#if defined(HAVE_LINUX_FIEMAP_H)
static int setup_sparse_fiemap(struct archive_read_disk *,
struct archive_entry *, int *fd);
#endif
int
archive_read_disk_entry_from_file(struct archive *_a,
@ -1124,7 +1128,7 @@ setup_xattrs(struct archive_read_disk *a,
#if defined(HAVE_LINUX_FIEMAP_H)
/*
* Linux sparse interface.
* Linux FIEMAP sparse interface.
*
* The FIEMAP ioctl returns an "extent" for each physical allocation
* on disk. We need to process those to generate a more compact list
@ -1139,7 +1143,7 @@ setup_xattrs(struct archive_read_disk *a,
*/
static int
setup_sparse(struct archive_read_disk *a,
setup_sparse_fiemap(struct archive_read_disk *a,
struct archive_entry *entry, int *fd)
{
char buff[4096];
@ -1191,7 +1195,7 @@ setup_sparse(struct archive_read_disk *a,
/* When something error happens, it is better we
* should return ARCHIVE_OK because an earlier
* version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */
goto exit_setup_sparse;
goto exit_setup_sparse_fiemap;
}
if (fm->fm_mapped_extents == 0) {
if (iters == 0) {
@ -1226,14 +1230,24 @@ setup_sparse(struct archive_read_disk *a,
} else
break;
}
exit_setup_sparse:
exit_setup_sparse_fiemap:
return (exit_sts);
}
#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE)
#if !defined(SEEK_HOLE) || !defined(SEEK_DATA)
static int
setup_sparse(struct archive_read_disk *a,
struct archive_entry *entry, int *fd)
{
return setup_sparse_fiemap(a, entry, fd);
}
#endif
#endif /* defined(HAVE_LINUX_FIEMAP_H) */
#if defined(SEEK_HOLE) && defined(SEEK_DATA)
/*
* FreeBSD and Solaris sparse interface.
* SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris)
*/
static int
@ -1241,8 +1255,8 @@ setup_sparse(struct archive_read_disk *a,
struct archive_entry *entry, int *fd)
{
int64_t size;
off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */
off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */
off_t initial_off;
off_t off_s, off_e;
int exit_sts = ARCHIVE_OK;
int check_fully_sparse = 0;
@ -1268,8 +1282,10 @@ setup_sparse(struct archive_read_disk *a,
}
if (*fd >= 0) {
#ifdef _PC_MIN_HOLE_SIZE
if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);
#endif
initial_off = lseek(*fd, 0, SEEK_CUR);
if (initial_off != 0)
lseek(*fd, 0, SEEK_SET);
@ -1280,8 +1296,10 @@ setup_sparse(struct archive_read_disk *a,
if (path == NULL)
path = archive_entry_pathname(entry);
#ifdef _PC_MIN_HOLE_SIZE
if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);
#endif
*fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (*fd < 0) {
archive_set_error(&a->archive, errno,
@ -1292,6 +1310,19 @@ setup_sparse(struct archive_read_disk *a,
initial_off = 0;
}
#ifndef _PC_MIN_HOLE_SIZE
/* Check if the underlying filesystem supports seek hole */
off_s = lseek(*fd, 0, SEEK_HOLE);
if (off_s < 0)
#if defined(HAVE_LINUX_FIEMAP_H)
return setup_sparse_fiemap(a, entry, fd);
#else
goto exit_setup_sparse;
#endif
else if (off_s > 0)
lseek(*fd, 0, SEEK_SET);
#endif
off_s = 0;
size = archive_entry_size(entry);
while (off_s < size) {
@ -1341,7 +1372,7 @@ setup_sparse(struct archive_read_disk *a,
return (exit_sts);
}
#else
#elif !defined(HAVE_LINUX_FIEMAP_H)
/*
* Generic (stub) sparse support.

View File

@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_filter_bidder *self,
avail -= len;
if (l == 6) {
/* "begin " */
if (!uuchar[*b])
return (0);
/* Get a length of decoded bytes. */
@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_filter_bidder *self,
b += nl;
if (avail && uuchar[*b])
return (firstline+30);
}
if (l == 13) {
} else if (l == 13) {
/* "begin-base64 " */
while (len-nl > 0) {
if (!base64[*b++])
return (0);

View File

@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$");
#endif
#if HAVE_LZMA_H
#include <lzma.h>
#elif HAVE_LZMADEC_H
#include <lzmadec.h>
#endif
#include "archive.h"
@ -82,19 +80,6 @@ static ssize_t xz_filter_read(struct archive_read_filter *, const void **);
static int xz_filter_close(struct archive_read_filter *);
static int xz_lzma_bidder_init(struct archive_read_filter *);
#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
struct private_data {
lzmadec_stream stream;
unsigned char *out_block;
size_t out_block_size;
int64_t total_out;
char eof; /* True = found end of compressed data. */
};
/* Lzma-only filter */
static ssize_t lzma_filter_read(struct archive_read_filter *, const void **);
static int lzma_filter_close(struct archive_read_filter *);
#endif
/*
@ -178,8 +163,6 @@ archive_read_support_filter_lzma(struct archive *_a)
bidder->free = NULL;
#if HAVE_LZMA_H && HAVE_LIBLZMA
return (ARCHIVE_OK);
#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
return (ARCHIVE_OK);
#else
archive_set_error(_a, ARCHIVE_ERRNO_MISC,
"Using external lzma program for lzma decompression");
@ -763,175 +746,6 @@ xz_filter_close(struct archive_read_filter *self)
#else
#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC
/*
* If we have the older liblzmadec library, then we can handle
* LZMA streams but not XZ streams.
*/
/*
* Setup the callbacks.
*/
static int
lzma_bidder_init(struct archive_read_filter *self)
{
static const size_t out_block_size = 64 * 1024;
void *out_block;
struct private_data *state;
ssize_t ret, avail_in;
self->code = ARCHIVE_FILTER_LZMA;
self->name = "lzma";
state = (struct private_data *)calloc(sizeof(*state), 1);
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for lzma decompression");
free(out_block);
free(state);
return (ARCHIVE_FATAL);
}
self->data = state;
state->out_block_size = out_block_size;
state->out_block = out_block;
self->read = lzma_filter_read;
self->skip = NULL; /* not supported */
self->close = lzma_filter_close;
/* Prime the lzma library with 18 bytes of input. */
state->stream.next_in = (unsigned char *)(uintptr_t)
__archive_read_filter_ahead(self->upstream, 18, &avail_in);
if (state->stream.next_in == NULL)
return (ARCHIVE_FATAL);
state->stream.avail_in = avail_in;
state->stream.next_out = state->out_block;
state->stream.avail_out = state->out_block_size;
/* Initialize compression library. */
ret = lzmadec_init(&(state->stream));
__archive_read_filter_consume(self->upstream,
avail_in - state->stream.avail_in);
if (ret == LZMADEC_OK)
return (ARCHIVE_OK);
/* Library setup failed: Clean up. */
archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
"Internal error initializing lzma library");
/* Override the error message if we know what really went wrong. */
switch (ret) {
case LZMADEC_HEADER_ERROR:
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
"Internal error initializing compression library: "
"invalid header");
break;
case LZMADEC_MEM_ERROR:
archive_set_error(&self->archive->archive, ENOMEM,
"Internal error initializing compression library: "
"out of memory");
break;
}
free(state->out_block);
free(state);
self->data = NULL;
return (ARCHIVE_FATAL);
}
/*
* Return the next block of decompressed data.
*/
static ssize_t
lzma_filter_read(struct archive_read_filter *self, const void **p)
{
struct private_data *state;
size_t decompressed;
ssize_t avail_in, ret;
state = (struct private_data *)self->data;
/* Empty our output buffer. */
state->stream.next_out = state->out_block;
state->stream.avail_out = state->out_block_size;
/* Try to fill the output buffer. */
while (state->stream.avail_out > 0 && !state->eof) {
state->stream.next_in = (unsigned char *)(uintptr_t)
__archive_read_filter_ahead(self->upstream, 1, &avail_in);
if (state->stream.next_in == NULL && avail_in < 0) {
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
"truncated lzma input");
return (ARCHIVE_FATAL);
}
state->stream.avail_in = avail_in;
/* Decompress as much as we can in one pass. */
ret = lzmadec_decode(&(state->stream), avail_in == 0);
switch (ret) {
case LZMADEC_STREAM_END: /* Found end of stream. */
state->eof = 1;
/* FALL THROUGH */
case LZMADEC_OK: /* Decompressor made some progress. */
__archive_read_filter_consume(self->upstream,
avail_in - state->stream.avail_in);
break;
case LZMADEC_BUF_ERROR: /* Insufficient input data? */
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
"Insufficient compressed data");
return (ARCHIVE_FATAL);
default:
/* Return an error. */
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
"Lzma decompression failed");
return (ARCHIVE_FATAL);
}
}
decompressed = state->stream.next_out - state->out_block;
state->total_out += decompressed;
if (decompressed == 0)
*p = NULL;
else
*p = state->out_block;
return (decompressed);
}
/*
* Clean up the decompressor.
*/
static int
lzma_filter_close(struct archive_read_filter *self)
{
struct private_data *state;
int ret;
state = (struct private_data *)self->data;
ret = ARCHIVE_OK;
switch (lzmadec_end(&(state->stream))) {
case LZMADEC_OK:
break;
default:
archive_set_error(&(self->archive->archive),
ARCHIVE_ERRNO_MISC,
"Failed to clean up %s compressor",
self->archive->archive.compression_name);
ret = ARCHIVE_FATAL;
}
free(state->out_block);
free(state);
return (ret);
}
#else
/*
*
* If we have no suitable library on this system, we can't actually do
@ -953,9 +767,6 @@ lzma_bidder_init(struct archive_read_filter *self)
return (r);
}
#endif /* HAVE_LZMADEC_H */
static int
xz_bidder_init(struct archive_read_filter *self)
{
@ -984,5 +795,4 @@ lzip_bidder_init(struct archive_read_filter *self)
return (r);
}
#endif /* HAVE_LZMA_H */

View File

@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a)
cab = (struct cab *)(a->format->data);
if (cab->found_header == 0 &&
p[0] == 'M' && p[1] == 'Z') {
/* This is an executable? Must be self-extracting... */
/* This is an executable? Must be self-extracting... */
err = cab_skip_sfx(a);
if (err < ARCHIVE_WARN)
return (err);
if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
/* Re-read header after processing the SFX. */
if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
return (truncated_error(a));
}

View File

@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$");
#define MTREE_HAS_OPTIONAL 0x0800
#define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */
#define MTREE_HASHTABLE_SIZE 1024
struct mtree_option {
struct mtree_option *next;
char *value;
@ -86,6 +88,8 @@ struct mtree_entry {
char *name;
char full;
char used;
unsigned int name_hash;
struct mtree_entry *hashtable_next;
};
struct mtree {
@ -98,6 +102,7 @@ struct mtree {
const char *archive_format_name;
struct mtree_entry *entries;
struct mtree_entry *this_entry;
struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE];
struct archive_string current_dir;
struct archive_string contents_name;
@ -110,6 +115,7 @@ struct mtree {
static int bid_keycmp(const char *, const char *, ssize_t);
static int cleanup(struct archive_read *);
static int detect_form(struct archive_read *, int *);
static unsigned int hash(const char *);
static int mtree_bid(struct archive_read *, int);
static int parse_file(struct archive_read *, struct archive_entry *,
struct mtree *, struct mtree_entry *, int *);
@ -862,11 +868,12 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
struct mtree_option **global, const char *line, ssize_t line_len,
struct mtree_entry **last_entry, int is_form_d)
{
struct mtree_entry *entry;
struct mtree_entry *entry, *ht_iter;
struct mtree_option *iter;
const char *next, *eq, *name, *end;
size_t name_len, len;
int r, i;
unsigned int ht_idx;
if ((entry = malloc(sizeof(*entry))) == NULL) {
archive_set_error(&a->archive, errno, "Can't allocate memory");
@ -877,6 +884,8 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
entry->name = NULL;
entry->used = 0;
entry->full = 0;
entry->name_hash = 0;
entry->hashtable_next = NULL;
/* Add this entry to list. */
if (*last_entry == NULL)
@ -929,6 +938,16 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
memcpy(entry->name, name, name_len);
entry->name[name_len] = '\0';
parse_escapes(entry->name, entry);
entry->name_hash = hash(entry->name);
ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE;
if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) {
while (ht_iter->hashtable_next)
ht_iter = ht_iter->hashtable_next;
ht_iter->hashtable_next = entry;
} else {
mtree->entry_hashtable[ht_idx] = entry;
}
for (iter = *global; iter != NULL; iter = iter->next) {
r = add_option(a, &entry->options, iter->value,
@ -1122,9 +1141,10 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
* with pathname canonicalization, which is a very
* tricky subject.)
*/
for (mp = mentry->next; mp != NULL; mp = mp->next) {
for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) {
if (mp->full && !mp->used
&& strcmp(mentry->name, mp->name) == 0) {
&& mentry->name_hash == mp->name_hash
&& strcmp(mentry->name, mp->name) == 0) {
/* Later lines override earlier ones. */
mp->used = 1;
r1 = parse_line(a, entry, mtree, mp,
@ -2000,3 +2020,19 @@ readline(struct archive_read *a, struct mtree *mtree, char **start,
find_off = u - mtree->line.s;
}
}
static unsigned int
hash(const char *p)
{
/* A 32-bit version of Peter Weinberger's (PJW) hash algorithm,
as used by ELF for hashing function names. */
unsigned g, h = 0;
while (*p != '\0') {
h = (h << 4) + *p++;
if ((g = h & 0xF0000000) != 0) {
h ^= g >> 24;
h &= 0x0FFFFFFF;
}
}
return h;
}

View File

@ -294,6 +294,54 @@ archive_read_format_tar_cleanup(struct archive_read *a)
return (ARCHIVE_OK);
}
/*
* Validate number field
*
* This has to be pretty lenient in order to accomodate the enormous
* variety of tar writers in the world:
* = POSIX ustar requires octal values with leading zeros and
* specific termination on fields
* = Many writers use different termination (in particular, libarchive
* omits terminator bytes to squeeze one or two more digits)
* = Many writers pad with space and omit leading zeros
* = GNU tar and star write base-256 values if numbers are too
* big to be represented in octal
*
* This should tolerate all variants in use. It will reject a field
* where the writer just left garbage after a trailing NUL.
*/
static int
validate_number_field(const char* p_field, size_t i_size)
{
unsigned char marker = (unsigned char)p_field[0];
if (marker == 128 || marker == 255 || marker == 0) {
/* Base-256 marker, there's nothing we can check. */
return 1;
} else {
/* Must be octal */
size_t i = 0;
/* Skip any leading spaces */
while (i < i_size && p_field[i] == ' ') {
++i;
}
/* Must be at least one octal digit. */
if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') {
return 0;
}
/* Skip remaining octal digits. */
while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
++i;
}
/* Any remaining characters must be space or NUL padding. */
while (i < i_size) {
if (p_field[i] != ' ' && p_field[i] != 0) {
return 0;
}
++i;
}
return 1;
}
}
static int
archive_read_format_tar_bid(struct archive_read *a, int best_bid)
@ -346,23 +394,19 @@ archive_read_format_tar_bid(struct archive_read *a, int best_bid)
return (0);
bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */
/* Sanity check: Look at first byte of mode field. */
switch (255 & (unsigned)header->mode[0]) {
case 0: case 255:
/* Base-256 value: No further verification possible! */
break;
case ' ': /* Not recommended, but not illegal, either. */
break;
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
/* Octal Value. */
/* TODO: Check format of remainder of this field. */
break;
default:
/* Not a valid mode; bail out here. */
return (0);
/*
* Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
*/
if (bid > 0 && (
validate_number_field(header->mode, sizeof(header->mode)) == 0
|| validate_number_field(header->uid, sizeof(header->uid)) == 0
|| validate_number_field(header->gid, sizeof(header->gid)) == 0
|| validate_number_field(header->mtime, sizeof(header->mtime)) == 0
|| validate_number_field(header->size, sizeof(header->size)) == 0
|| validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
|| validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) {
bid = 0;
}
/* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */
return (bid);
}

View File

@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$");
#endif
#if HAVE_LZMA_H
#include <lzma.h>
#elif HAVE_LZMADEC_H
#include <lzmadec.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
@ -334,9 +332,6 @@ struct xar {
#if HAVE_LZMA_H && HAVE_LIBLZMA
lzma_stream lzstream;
int lzstream_valid;
#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
lzmadec_stream lzstream;
int lzstream_valid;
#endif
/*
* For Checksum data.
@ -1526,34 +1521,6 @@ decompression_init(struct archive_read *a, enum enctype encoding)
xar->lzstream.total_in = 0;
xar->lzstream.total_out = 0;
break;
#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
case LZMA:
if (xar->lzstream_valid)
lzmadec_end(&(xar->lzstream));
r = lzmadec_init(&(xar->lzstream));
if (r != LZMADEC_OK) {
switch (r) {
case LZMADEC_HEADER_ERROR:
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Internal error initializing "
"compression library: "
"invalid header");
break;
case LZMADEC_MEM_ERROR:
archive_set_error(&a->archive,
ENOMEM,
"Internal error initializing "
"compression library: "
"out of memory");
break;
}
return (ARCHIVE_FATAL);
}
xar->lzstream_valid = 1;
xar->lzstream.total_in = 0;
xar->lzstream.total_out = 0;
break;
#endif
/*
* Unsupported compression.
@ -1563,9 +1530,7 @@ decompression_init(struct archive_read *a, enum enctype encoding)
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
case LZMA:
#endif
case XZ:
#endif
switch (xar->entry_encoding) {
@ -1685,46 +1650,12 @@ decompress(struct archive_read *a, const void **buff, size_t *outbytes,
*used = avail_in - xar->lzstream.avail_in;
*outbytes = avail_out - xar->lzstream.avail_out;
break;
#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
case LZMA:
xar->lzstream.next_in = (unsigned char *)(uintptr_t)b;
xar->lzstream.avail_in = avail_in;
xar->lzstream.next_out = (unsigned char *)outbuff;
xar->lzstream.avail_out = avail_out;
r = lzmadec_decode(&(xar->lzstream), 0);
switch (r) {
case LZMADEC_STREAM_END: /* Found end of stream. */
switch (lzmadec_end(&(xar->lzstream))) {
case LZMADEC_OK:
break;
default:
archive_set_error(&(a->archive),
ARCHIVE_ERRNO_MISC,
"Failed to clean up lzmadec decompressor");
return (ARCHIVE_FATAL);
}
xar->lzstream_valid = 0;
/* FALLTHROUGH */
case LZMADEC_OK: /* Decompressor made some progress. */
break;
default:
archive_set_error(&(a->archive),
ARCHIVE_ERRNO_MISC,
"lzmadec decompression failed(%d)",
r);
return (ARCHIVE_FATAL);
}
*used = avail_in - xar->lzstream.avail_in;
*outbytes = avail_out - xar->lzstream.avail_out;
break;
#endif
#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
case LZMA:
#endif
case XZ:
#endif
case NONE:

View File

@ -336,14 +336,19 @@ struct archive_write_disk {
#define HFS_BLOCKS(s) ((s) >> 12)
static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
static void fsobj_error(int *, struct archive_string *, int, const char *,
const char *);
static int check_symlinks_fsobj(char *, int *, struct archive_string *,
int);
static int check_symlinks(struct archive_write_disk *);
static int create_filesystem_object(struct archive_write_disk *);
static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname);
static struct fixup_entry *current_fixup(struct archive_write_disk *,
const char *pathname);
#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
static void edit_deep_directories(struct archive_write_disk *ad);
#endif
static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
static int cleanup_pathname_fsobj(char *, int *, struct archive_string *,
int);
static int cleanup_pathname(struct archive_write_disk *);
static int create_dir(struct archive_write_disk *, char *);
static int create_parent_dir(struct archive_write_disk *, char *);
@ -374,11 +379,14 @@ static struct archive_vtable *archive_write_disk_vtable(void);
static int _archive_write_disk_close(struct archive *);
static int _archive_write_disk_free(struct archive *);
static int _archive_write_disk_header(struct archive *, struct archive_entry *);
static int _archive_write_disk_header(struct archive *,
struct archive_entry *);
static int64_t _archive_write_disk_filter_bytes(struct archive *, int);
static int _archive_write_disk_finish_entry(struct archive *);
static ssize_t _archive_write_disk_data(struct archive *, const void *, size_t);
static ssize_t _archive_write_disk_data_block(struct archive *, const void *, size_t, int64_t);
static ssize_t _archive_write_disk_data(struct archive *, const void *,
size_t);
static ssize_t _archive_write_disk_data_block(struct archive *, const void *,
size_t, int64_t);
static int
lazy_stat(struct archive_write_disk *a)
@ -649,7 +657,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
if (a->restore_pwd >= 0) {
r = fchdir(a->restore_pwd);
if (r != 0) {
archive_set_error(&a->archive, errno, "chdir() failure");
archive_set_error(&a->archive, errno,
"chdir() failure");
ret = ARCHIVE_FATAL;
}
close(a->restore_pwd);
@ -697,7 +706,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
}
if (archive_entry_birthtime_is_set(entry)) {
fe->birthtime = archive_entry_birthtime(entry);
fe->birthtime_nanos = archive_entry_birthtime_nsec(entry);
fe->birthtime_nanos = archive_entry_birthtime_nsec(
entry);
} else {
/* If birthtime is unset, use mtime. */
fe->birthtime = fe->mtime;
@ -723,7 +733,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
return (ARCHIVE_FATAL);
fe->mac_metadata = malloc(metadata_size);
if (fe->mac_metadata != NULL) {
memcpy(fe->mac_metadata, metadata, metadata_size);
memcpy(fe->mac_metadata, metadata,
metadata_size);
fe->mac_metadata_size = metadata_size;
fe->fixup |= TODO_MAC_METADATA;
}
@ -1480,7 +1491,8 @@ _archive_write_disk_data_block(struct archive *_a,
return (r);
if ((size_t)r < size) {
archive_set_error(&a->archive, 0,
"Too much data: Truncating file at %ju bytes", (uintmax_t)a->filesize);
"Too much data: Truncating file at %ju bytes",
(uintmax_t)a->filesize);
return (ARCHIVE_WARN);
}
#if ARCHIVE_VERSION_NUMBER < 3999000
@ -2005,8 +2017,9 @@ restore_entry(struct archive_write_disk *a)
if (en) {
/* Everything failed; give up here. */
archive_set_error(&a->archive, en, "Can't create '%s'",
a->name);
if ((&a->archive)->error == NULL)
archive_set_error(&a->archive, en, "Can't create '%s'",
a->name);
return (ARCHIVE_FAILED);
}
@ -2043,19 +2056,32 @@ create_filesystem_object(struct archive_write_disk *a)
if (linkname_copy == NULL) {
return (EPERM);
}
/* TODO: consider using the cleaned-up path as the link target? */
r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags);
/*
* TODO: consider using the cleaned-up path as the link
* target?
*/
r = cleanup_pathname_fsobj(linkname_copy, &error_number,
&error_string, a->flags);
if (r != ARCHIVE_OK) {
archive_set_error(&a->archive, error_number, "%s", error_string.s);
archive_set_error(&a->archive, error_number, "%s",
error_string.s);
free(linkname_copy);
/* EPERM is more appropriate than error_number for our callers */
/*
* EPERM is more appropriate than error_number for our
* callers
*/
return (EPERM);
}
r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags);
r = check_symlinks_fsobj(linkname_copy, &error_number,
&error_string, a->flags);
if (r != ARCHIVE_OK) {
archive_set_error(&a->archive, error_number, "%s", error_string.s);
archive_set_error(&a->archive, error_number, "%s",
error_string.s);
free(linkname_copy);
/* EPERM is more appropriate than error_number for our callers */
/*
* EPERM is more appropriate than error_number for our
* callers
*/
return (EPERM);
}
free(linkname_copy);
@ -2076,8 +2102,8 @@ create_filesystem_object(struct archive_write_disk *a)
a->todo = 0;
a->deferred = 0;
} else if (r == 0 && a->filesize > 0) {
a->fd = open(a->name,
O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW);
a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY
| O_CLOEXEC | O_NOFOLLOW);
__archive_ensure_cloexec_flag(a->fd);
if (a->fd < 0)
r = errno;
@ -2388,6 +2414,17 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
return (a->current_fixup);
}
/* Error helper for new *_fsobj functions */
static void
fsobj_error(int *a_eno, struct archive_string *a_estr,
int err, const char *errstr, const char *path)
{
if (a_eno)
*a_eno = err;
if (a_estr)
archive_string_sprintf(a_estr, errstr, path);
}
/*
* TODO: Someday, integrate this with the deep dir support; they both
* scan the path and both can be optimized by comparing against other
@ -2400,7 +2437,8 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
* ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
*/
static int
check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
int flags)
{
#if !defined(HAVE_LSTAT)
/* Platform doesn't have lstat, so we can't look for symlinks. */
@ -2433,7 +2471,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
* - if it's a directory and it's not the last chunk, cd into it
* As we go:
* head points to the current (relative) path
* tail points to the temporary \0 terminating the segment we're currently examining
* tail points to the temporary \0 terminating the segment we're
* currently examining
* c holds what used to be in *tail
* last is 1 if this is the last tail
*/
@ -2455,7 +2494,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
* Exiting the loop with break is okay; continue is not.
*/
while (!last) {
/* Skip the separator we just consumed, plus any adjacent ones */
/*
* Skip the separator we just consumed, plus any adjacent ones
*/
while (*tail == '/')
++tail;
/* Skip the next path element. */
@ -2474,19 +2515,20 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
if (errno == ENOENT) {
break;
} else {
/* Treat any other error as fatal - best to be paranoid here
* Note: This effectively disables deep directory
* support when security checks are enabled.
* Otherwise, very long pathnames that trigger
* an error here could evade the sandbox.
* TODO: We could do better, but it would probably
* require merging the symlink checks with the
* deep-directory editing. */
if (error_number) *error_number = errno;
if (error_string)
archive_string_sprintf(error_string,
"Could not stat %s",
path);
/*
* Treat any other error as fatal - best to be
* paranoid here.
* Note: This effectively disables deep
* directory support when security checks are
* enabled. Otherwise, very long pathnames that
* trigger an error here could evade the
* sandbox.
* TODO: We could do better, but it would
* probably require merging the symlink checks
* with the deep-directory editing.
*/
fsobj_error(a_eno, a_estr, errno,
"Could not stat %s", path);
res = ARCHIVE_FAILED;
break;
}
@ -2494,11 +2536,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
if (!last) {
if (chdir(head) != 0) {
tail[0] = c;
if (error_number) *error_number = errno;
if (error_string)
archive_string_sprintf(error_string,
"Could not chdir %s",
path);
fsobj_error(a_eno, a_estr, errno,
"Could not chdir %s", path);
res = (ARCHIVE_FATAL);
break;
}
@ -2514,11 +2553,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
*/
if (unlink(head)) {
tail[0] = c;
if (error_number) *error_number = errno;
if (error_string)
archive_string_sprintf(error_string,
"Could not remove symlink %s",
path);
fsobj_error(a_eno, a_estr, errno,
"Could not remove symlink %s",
path);
res = ARCHIVE_FAILED;
break;
}
@ -2529,13 +2566,14 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
* symlink with another symlink.
*/
tail[0] = c;
/* FIXME: not sure how important this is to restore
/*
* FIXME: not sure how important this is to
* restore
*/
/*
if (!S_ISLNK(path)) {
if (error_number) *error_number = 0;
if (error_string)
archive_string_sprintf(error_string,
"Removing symlink %s",
path);
fsobj_error(a_eno, a_estr, 0,
"Removing symlink %s", path);
}
*/
/* Symlink gone. No more problem! */
@ -2545,22 +2583,60 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
/* User asked us to remove problems. */
if (unlink(head) != 0) {
tail[0] = c;
if (error_number) *error_number = 0;
if (error_string)
archive_string_sprintf(error_string,
"Cannot remove intervening symlink %s",
path);
fsobj_error(a_eno, a_estr, 0,
"Cannot remove intervening "
"symlink %s", path);
res = ARCHIVE_FAILED;
break;
}
tail[0] = c;
} else if ((flags &
ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
/*
* We are not the last element and we want to
* follow symlinks if they are a directory.
*
* This is needed to extract hardlinks over
* symlinks.
*/
r = stat(head, &st);
if (r != 0) {
tail[0] = c;
if (errno == ENOENT) {
break;
} else {
fsobj_error(a_eno, a_estr,
errno,
"Could not stat %s", path);
res = (ARCHIVE_FAILED);
break;
}
} else if (S_ISDIR(st.st_mode)) {
if (chdir(head) != 0) {
tail[0] = c;
fsobj_error(a_eno, a_estr,
errno,
"Could not chdir %s", path);
res = (ARCHIVE_FATAL);
break;
}
/*
* Our view is now from inside
* this dir:
*/
head = tail + 1;
} else {
tail[0] = c;
fsobj_error(a_eno, a_estr, 0,
"Cannot extract through "
"symlink %s", path);
res = ARCHIVE_FAILED;
break;
}
} else {
tail[0] = c;
if (error_number) *error_number = 0;
if (error_string)
archive_string_sprintf(error_string,
"Cannot extract through symlink %s",
path);
fsobj_error(a_eno, a_estr, 0,
"Cannot extract through symlink %s", path);
res = ARCHIVE_FAILED;
break;
}
@ -2577,10 +2653,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
if (restore_pwd >= 0) {
r = fchdir(restore_pwd);
if (r != 0) {
if(error_number) *error_number = errno;
if(error_string)
archive_string_sprintf(error_string,
"chdir() failure");
fsobj_error(a_eno, a_estr, errno,
"chdir() failure", "");
}
close(restore_pwd);
restore_pwd = -1;
@ -2605,9 +2679,11 @@ check_symlinks(struct archive_write_disk *a)
int error_number;
int rc;
archive_string_init(&error_string);
rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags);
rc = check_symlinks_fsobj(a->name, &error_number, &error_string,
a->flags);
if (rc != ARCHIVE_OK) {
archive_set_error(&a->archive, error_number, "%s", error_string.s);
archive_set_error(&a->archive, error_number, "%s",
error_string.s);
}
archive_string_free(&error_string);
a->pst = NULL; /* to be safe */
@ -2688,17 +2764,16 @@ cleanup_pathname_win(struct archive_write_disk *a)
* is set) if the path is absolute.
*/
static int
cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
int flags)
{
char *dest, *src;
char separator = '\0';
dest = src = path;
if (*src == '\0') {
if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
if (error_string)
archive_string_sprintf(error_string,
"Invalid empty pathname");
fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
"Invalid empty ", "pathname");
return (ARCHIVE_FAILED);
}
@ -2708,10 +2783,8 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
/* Skip leading '/'. */
if (*src == '/') {
if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
if (error_string)
archive_string_sprintf(error_string,
"Path is absolute");
fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
"Path is ", "absolute");
return (ARCHIVE_FAILED);
}
@ -2738,11 +2811,11 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
} else if (src[1] == '.') {
if (src[2] == '/' || src[2] == '\0') {
/* Conditionally warn about '..' */
if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
if (error_string)
archive_string_sprintf(error_string,
"Path contains '..'");
if (flags
& ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
fsobj_error(a_eno, a_estr,
ARCHIVE_ERRNO_MISC,
"Path contains ", "'..'");
return (ARCHIVE_FAILED);
}
}
@ -2795,9 +2868,11 @@ cleanup_pathname(struct archive_write_disk *a)
int error_number;
int rc;
archive_string_init(&error_string);
rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string, a->flags);
rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string,
a->flags);
if (rc != ARCHIVE_OK) {
archive_set_error(&a->archive, error_number, "%s", error_string.s);
archive_set_error(&a->archive, error_number, "%s",
error_string.s);
}
archive_string_free(&error_string);
return rc;
@ -2881,7 +2956,8 @@ create_dir(struct archive_write_disk *a, char *path)
}
} else if (errno != ENOENT && errno != ENOTDIR) {
/* Stat failed? */
archive_set_error(&a->archive, errno, "Can't test directory '%s'", path);
archive_set_error(&a->archive, errno,
"Can't test directory '%s'", path);
return (ARCHIVE_FAILED);
} else if (slash != NULL) {
*slash = '\0';
@ -3406,7 +3482,8 @@ clear_nochange_fflags(struct archive_write_disk *a)
nochange_flags |= EXT2_IMMUTABLE_FL;
#endif
return (set_fflags_platform(a, a->fd, a->name, mode, 0, nochange_flags));
return (set_fflags_platform(a, a->fd, a->name, mode, 0,
nochange_flags));
}
@ -3931,7 +4008,8 @@ set_xattrs(struct archive_write_disk *a)
if (errno == ENOTSUP || errno == ENOSYS) {
if (!warning_done) {
warning_done = 1;
archive_set_error(&a->archive, errno,
archive_set_error(&a->archive,
errno,
"Cannot restore extended "
"attributes on this file "
"system");
@ -3942,7 +4020,8 @@ set_xattrs(struct archive_write_disk *a)
ret = ARCHIVE_WARN;
}
} else {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Invalid extended attribute encountered");
ret = ARCHIVE_WARN;
}
@ -3986,19 +4065,22 @@ set_xattrs(struct archive_write_disk *a)
errno = 0;
#if HAVE_EXTATTR_SET_FD
if (a->fd >= 0)
e = extattr_set_fd(a->fd, namespace, name, value, size);
e = extattr_set_fd(a->fd, namespace, name,
value, size);
else
#endif
/* TODO: should we use extattr_set_link() instead? */
{
e = extattr_set_file(archive_entry_pathname(entry),
namespace, name, value, size);
e = extattr_set_file(
archive_entry_pathname(entry), namespace,
name, value, size);
}
if (e != (ssize_t)size) {
if (errno == ENOTSUP || errno == ENOSYS) {
if (!warning_done) {
warning_done = 1;
archive_set_error(&a->archive, errno,
archive_set_error(&a->archive,
errno,
"Cannot restore extended "
"attributes on this file "
"system");

View File

@ -106,10 +106,48 @@ test_compat_gtar_1(void)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
/*
* test_compat_gtar_2.tar exercises reading of UID = 2097152 as base256
* and GID = 2097152 as octal without null terminator.
*/
static void
test_compat_gtar_2(void)
{
char name[] = "test_compat_gtar_2.tar";
struct archive_entry *ae;
struct archive *a;
int 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));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
/* Check UID and GID */
assertEqualInt(2097152, archive_entry_uid(ae));
assertEqualInt(2097152, archive_entry_gid(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
}
DEFINE_TEST(test_compat_gtar)
{
test_compat_gtar_1();
test_compat_gtar_2();
}

View File

@ -0,0 +1,49 @@
begin 660 test_compat_gtar_2.tar.uu
M9FEL95]W:71H7V)I9U]U:61?9VED````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V-C8`@``````@```Q,#`P,#`P,#`P,#`P,#`P,38W
M`#$S,#$T-C<R,38W`#`Q,S,U,``@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<B`@`'1E<W0`
M````````````````````````````````````8FEG````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!4:&ES(&9I;&4@:&%S($=)1#TR,#DW,34R('=H
M:6-H(&ES(&]N92!O=F5R('1H92!L:6UI="!O9B!T87(@=BXW(&%N9"!'3E4@
M=&%R('-T;W)E<R!I="!A<R!B87-E(#(U-B!N=6UB97(@*&YO="!O8W1A;"DN
M"@``````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
7````````````````````````````````
`
end

View File

@ -0,0 +1,66 @@
/*-
* Copyright (c) 2016 Martin Matuska
* 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");
/*
* Verify our ability to read sample files created by Perl module Archive::Tar
*/
DEFINE_TEST(test_compat_perl_archive_tar)
{
char name[] = "test_compat_perl_archive_tar.tar";
struct archive_entry *ae;
struct archive *a;
int 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));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(1480603099, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualString("john", archive_entry_uname(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualString("john", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View File

@ -0,0 +1,49 @@
begin 644 test_compat_perl_archive_tar.tar
M9FEL93$`````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U
M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,&IO:&X`
M````````````````````````````````````:F]H;@``````````````````
M```````````````````P,#`P,#```#`P,#`P,```````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!A8F-D"@``````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
7````````````````````````````````
`
end

View File

@ -0,0 +1,215 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify reading entries with POSIX.1e ACLs from archives created by star
*
* This should work on all systems, regardless of whether local filesystems
* support ACLs or not.
*/
struct acl_t {
int type; /* Type of ACL: "access" or "default" */
int permset; /* Permissions for this class of users. */
int tag; /* Owner, User, Owning group, group, other, etc. */
const char *name; /* Name of user/group, depending on tag. */
};
static struct acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_MASK, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, "" },
};
static struct acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_GROUP, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_MASK, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, "" },
};
static struct acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_GROUP, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_MASK, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, "" },
};
static int
acl_match(struct acl_t *acl, int type, int permset, int tag, const char *name)
{
if (type != acl->type)
return (0);
if (permset != acl->permset)
return (0);
if (tag != acl->tag)
return (0);
if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
return (1);
if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ)
return (1);
if (tag == ARCHIVE_ENTRY_ACL_OTHER)
return (1);
if (tag == ARCHIVE_ENTRY_ACL_MASK)
return (1);
if (name == NULL)
return (acl->name == NULL || acl->name[0] == '\0');
if (acl->name == NULL)
return (name == NULL || name[0] == '\0');
return (0 == strcmp(name, acl->name));
}
static void
compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode,
int want_type)
{
int *marker = malloc(sizeof(marker[0]) * n);
int i;
int r;
int type, permset, tag, qual;
int matched;
const char *name;
for (i = 0; i < n; i++)
marker[i] = i;
while (0 == (r = archive_entry_acl_next(ae, want_type,
&type, &permset, &tag, &qual, &name))) {
for (i = 0, matched = 0; i < n && !matched; i++) {
if (acl_match(&acls[marker[i]], type, permset,
tag, name)) {
/* We found a match; remove it. */
marker[i] = marker[n - 1];
n--;
matched = 1;
}
}
if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ) {
if (!matched) printf("No match for user_obj perm\n");
if (want_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
failure("USER_OBJ permset (%02o) != user mode (%02o)",
permset, 07 & (mode >> 6));
assert((permset << 6) == (mode & 0700));
}
} else if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) {
if (!matched) printf("No match for group_obj perm\n");
if (want_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
failure("GROUP_OBJ permset %02o != group mode %02o",
permset, 07 & (mode >> 3));
assert((permset << 3) == (mode & 0070));
}
} else if (tag == ARCHIVE_ENTRY_ACL_OTHER) {
if (!matched) printf("No match for other perm\n");
if (want_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
failure("OTHER permset (%02o) != other mode (%02o)",
permset, mode & 07);
assert((permset << 0) == (mode & 0007));
}
} else if (tag != ARCHIVE_ENTRY_ACL_MASK) {
failure("Could not find match for ACL "
"(type=%d,permset=%d,tag=%d,name=``%s'')",
type, permset, tag, name);
assert(matched == 1);
}
}
assertEqualInt(ARCHIVE_EOF, r);
assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777));
failure("Could not find match for ACL "
"(type=%d,permset=%d,tag=%d,name=``%s'')",
acls[marker[0]].type, acls[marker[0]].permset,
acls[marker[0]].tag, acls[marker[0]].name);
assert(n == 0); /* Number of ACLs not matched should == 0 */
free(marker);
}
DEFINE_TEST(test_compat_star_acl_posix1e)
{
char name[] = "test_compat_star_acl_posix1e.tar";
struct archive *a;
struct archive_entry *ae;
/* Read archive file */
assert(NULL != (a = archive_read_new()));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* First item has a few ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("One extended ACL should flag all ACLs to be returned.");
assertEqualInt(5, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]), 0142, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Second item has pretty extensive ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(7, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]), 0543, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
/* Third item has default ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]), 0142, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View File

@ -0,0 +1,231 @@
begin 644 test_compat_star_acl_posix1e.tar
M+B\N+T!087A(96%D97(`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V,#`@,#`P,#`P,"`P,#`P,#`P(#`P,#`P,#`P,C<R
M(#`P,#`P,#`P,#`P(#`P,38P-S0@9P``````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
M````````````````````````````````````=VAE96P`````````````````
M```````````````````P,#`P,#`P(#`P,#`P,#`@````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````P,#`P,#`P,#`P,"`P,#`P,#`P
M,#`P,"`````````````````U-R!30TA)3%DN<F5L96%S93US=&%R(#$N-2XS
M("AA;60V-"UU;FMN;W=N+69R965B<V0Q,2XP*0HR-R!30TA)3%DN87)C:'1Y
M<&4]97AU<W1A<@HT-R!30TA)3%DN=F]L:&1R+F1U;7!D871E/3$T-SDQ,CDY
M-30N,#4X-S<R-SDS"C(U(%-#2$E,62YV;VQH9'(N=F]L;F\],0HS,"!30TA)
M3%DN=F]L:&1R+F)L;V-K<VEZ93TR,`H`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````"XO+B]`4&%X2&5A
M9&5R````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````P
M,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#(U,2`P,#`P,#`P,#`P
M,"`P,#$V,3$R('@`````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````=7-T87(`,#!R;V]T````````````````
M`````````````````````'=H965L````````````````````````````````
M````,#`P,#`P,"`P,#`P,#`P(```````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@````````
M````````,S`@871I;64],30W.3$R,34Y-BXT.#4W,30P,#`*,S`@8W1I;64]
M,30W.3$R.3<V-RXQ,#@Y.#8P,#`*,S`@;71I;64],30W.3$R,34Y-BXT.#4W
M,30P,#`*-SD@4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ+2UX+'5S97(Z=7-E
M<C<W.G(M+2QG<F]U<#HZ<BTM+&UA<VLZ.G(M+2QO=&AE<CHZ+7<M"@``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````!F:6QE,0``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````,#`P,#$T,B`P,#`P
M,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34R-S0@,#`Q-#8W,2`P
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````'5S=&%R`#`P<F]O=```````````````````````````````
M``````!W:&5E;````````````````````````````````````#`P,#`P,#`@
M,#`P,#`P,"``````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````#$S,#$R,S$U,C<T(#$S,#$R,S,U,C0W(````````````````"XO+B]`
M4&%X2&5A9&5R````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,Q-"`P,#`P
M,#`P,#`P,"`P,#$V,3$R('@`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````=7-T87(`,#!R;V]T````````
M`````````````````````````````'=H965L````````````````````````
M````````````,#`P,#`P,"`P,#`P,#`P(```````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@
M````````````````,S`@871I;64],30W.3$R,38P,2XP-C`X-C8P,#`*,S`@
M8W1I;64],30W.3$R.3<V-RXQ,#@Y-S0P,#`*,S`@;71I;64],30W.3$R,38P
M,2XP-C`X-C8P,#`*,3$T(%-#2$E,62YA8VPN86-C97-S/75S97(Z.G(M>"QU
M<V5R.G5S97(W-SIR+2TL=7-E<CIU<V5R-S@Z+2TM+&=R;W5P.CIR+2TL9W)O
M=7`Z9W)O=7`W.#IR=W@L;6%S:SHZ<G=X+&]T:&5R.CHM=W@*````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````!F:6QE,@``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````,#`P,#4W
M,R`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34S,#$@,#`Q
M-#8V,"`P````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````'5S=&%R`#`P<F]O=```````````````````````
M``````````````!W:&5E;````````````````````````````````````#`P
M,#`P,#`@,#`P,#`P,"``````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#$S,#$R,S$U,S`Q(#$S,#$R,S,U,C0W(```````````````
M`"XO+B]`4&%X2&5A9&5R````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,W
M,R`P,#`P,#`P,#`P,"`P,#$V,3$W('@`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````=7-T87(`,#!R;V]T
M`````````````````````````````````````'=H965L````````````````
M````````````````````,#`P,#`P,"`P,#`P,#`P(```````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P
M,#`P,#`@````````````````,S`@871I;64],30W.3$R,3<R-BXX,3<T-3`P
M,#`*,S`@8W1I;64],30W.3$R,3@S,2XU.#,U-3(P,#`*,S`@;71I;64],30W
M.3$R,3<R-BXX,3<T-3`P,#`*-C,@4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ
M+2UX+&=R;W5P.CIR+2TL;6%S:SHZ<BTM+&]T:&5R.CHM=RT*.3@@4T-(24Q9
M+F%C;"YD969A=6QT/75S97(Z.BTM>"QU<V5R.G5S97(W-SIR+2TL9W)O=7`Z
M.G(M+2QG<F]U<#IG<F]U<#<X.BTM>"QM87-K.CIR+7@L;W1H97(Z.BUW+0H`
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````!D:7(Q+P``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M,#`P,#$T,B`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34T
M-S8@,#`Q-#8R-B`U````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````'5S=&%R`#`P<F]O=```````````````
M``````````````````````!W:&5E;```````````````````````````````
M`````#`P,#`P,#`@,#`P,#`P,"``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````#$S,#$R,S$U-#<V(#$S,#$R,S$U-C0W(```````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
9````````````````````````````````````
`
end

View File

@ -0,0 +1,95 @@
begin 660 test_read_format_raw.bufr.uu
M,#`P-S0T.3@P,`$-#0HP,#`-#0I)15%8,#$@155-4"`P-S`U,#`-#0I"5492
M`2+?!```%@``_@`````#_]T0``?@"P<$.P````D``'C`Z`@!(K0``,``_@!N
M@#T!^`"P!P"!`````"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ@#=]]]]]
M]]]]]]]]]]@`````````````````````````````````````````````````
M````````````````````````````````````````````````````````0AS@
M/.`\X#S@//M\^WS[?/M]%ET6719=%ETQ/3$],3TQ(```````````&V`;8!M@
M&V`V0#9`-D`V0%&`48!1@%&`;&!L8&Q@;&"'0(=`AT"'0*(@HB"B(*(@O8"]
M@+V`O8#80-A`V$#80/.@\Z#SH/.A#H$.@0Z!#H$I82EA*6$I843!1,%$P43!
M7X%?@5^!7X%Z87IA>F%Z897!E<&5P97!L*&PH;"AL*',`<P!S`',`>;AYN'F
MX>;B`B("(@(B`B(<@AR"'((<@C?B-^(WXC?B4L)2PE+"4L)N(FXB;B)N(HCB
MB.*(XHCBH\*CPJ/"H\BZQK3$>Z`M3P```96P=EB)(F#:0C*.B=E8YJH8[61W
MV+Z)DM;2)*Q8Z4V[T6O1*GO&@Y3UWQHV$QNX==:0U"G4XC@H"!]-(J(@'D/?
M@(SYTVUR+"E#9NEU?4F/)3&DAC2@Z%6S^G>N30VJGI%L62FLU1@^LI27SAJ\
MAE7)"Z[IC/VMTH6><,,*6=1B_>=>!,RS3:UOL>+6(/[321O:>SY39A-MM<W-
MRC7A%J!DXUZ=ZKM_#FX=3KN![XZY_(<B@/0)X">;Q$AVID_52A79OI7GLR$&
MSF*I)!#&@`%Q#EY!`,.RR%*'&\:EF1QI5(J]<GHB=*+)O?D-%S2?J38<U/^7
MI50TKK;FT6L)]PU4'>X(-6,[J'"6>D\2[%OX:S*/?P46S?=U=PV5MOW^%-?Q
M"-,Z'1F[U]*D5IJX<+]WA,(L9NKCB>[D-C</1[P"M>3H[!`U7VI[+9C9M9:A
M3'3YOJJE-5E\Z$7102[J,RG1VXIIC',\]YQ3C.:890?))T[97M[+-*8XQY&W
MIH_F5(+RXB"?$"!HHBA%2^8,)-!3&H29["AH7VT*^HIG\Y^_U;GAW,\!)WGV
M&],S7-,TY;['3(@ZG`VXB\VVM&^?"X!RVCO\T02FIP`U;[V.JPQGC64RBRT4
MUY0&N\%%_CDP*E%B_.L)Q%IB\M:L5+[&I0_%2T.JE&DSJ\F.HTZ_HGFV49Y:
MC`"$AQ,D=<3^/R?B54&T*A&33@,V;Q7#IJ$==HB_(T7H(#)O*9>_":$02^K"
MF*F5#21OUT-KRQ]\L0"FP^9B'>[1/3**.N@"OB````7M\#3O$=.;64K*60;(
M,]2>I1YH\R)I$TL26+"'A#Q(8D+O!W@^'?#M86L+?5OJO77KL:6-2E)2DKC5
MQHT4:*6!+"=3.IGX3\1=8NN9D,R$7"+A.DG2+C%R#<!N`6L+:'X#[@```P(8
M$("2!*@$P!P@<00%]"]C?QP`O07D3V)[D:B-)G(SF7E+R'[S]YV$[`EN2W(W
MT;RO%7BIA4P,>&/"^9?*X#<"-<&M[Y5\L[_=_1,(F$):$K+4EJR-I&M(FD3/
MDGR64K*=:6M(.$Q](FI95+*I%-(>I9E++I$-(4I9U+,I"](+I:=+1I!](`I;
M-+6I`E'RI;]+;H^U'CI==+FH]%'1I?=+TH[%&WIAU,$HX%&8IEE,?HTE%NIK
MU-)HO]$GIU=.(HHE"HJ(-/[H<4]LJX=3^H!L:<OTUC(F6Q$]"Z@``+20XM$K
M@BJ'9XU0%(0H!&Q8SQ%68J2&B`RN%=`K5&8(R0%C`L,&3PQU%F0LJ&/XQ?%H
M@L^&,XQ-%J`M-&*@P]%K`M6&(8PO%KHM;&&@PA%KXM?&$XP5%L`MA&#8P'%K
MHM?&!HOX%JXM:%_ZZ1+!N"P``"Q/"4#>'H>H[!FC6*`3@CA)3!E[+&6LWYN#
M1&I/L>\[9XD4HC0@A=+*4T@I(4.H%."=E9*L4XJ);BUECK,8*O]>"]F6LH8R
MQYJK4&@M&;ZWAM+;G2N@<BY9YSR7<N^?N_)\3Z(1P=@;!**$2H<P^C_'F,\;
M98RLDQ)Z=$XIFS3I'1V@U#*R5>J)4JUMI[%61P#?J[-X,QY<QKCS;6TM1ZJ+
MDLN!+X(#0Q=<XET[S6S-$:XWYE3"V/L^7NMM=;"5EJP5^MI4:BE+JQ4`FA.B
MC$OI)2FFM(**T:I,1*A!#*+T%GV/^A0^)W3RGZ.R<4YIX3@FM-L<DU1ES/FR
M,F8`Q!FR^%I+B80LI4BM%M*<3LH95B;DD)83\CY#"*$H(,/(?9#QV#8'"/4:
M`O!C#:%F)X5(OA)A]$2)\-X60S!]".#`'X5P,@``D"L`'``00,(%#!Q`D4+&
M#1P\@1)$RA4L7,&31LX=/'T"%$C2)4R=0I5*UBU<O8,63-HU;-W#ET[>/7S^
M!!A0XD6-'D294N9-G3Z%&E3J5:U>Q9M6[EV]?P8<6/)ES9]&G5KV;=V_AQY<
M^G7MW`%/B`"Y@?X"'Q```0!\T``'S@$_P``3_0(0T``R`!`,@&0````$#__X
M'_^!__@?@?_X'_^!^!__@?_X'X'_^!__@?@?_X'_^!^!__@?_X'X'_^!__@?
M@?_X'_^!^!__@?_X'X'_^!__@?@``"!__@?_^```@#YH``9`!R@\C(R&ZKFQ
ML]VG'6NK;7Y'YR_*2;6$.#`H3IT%@:D4DL9DAIUJ.-A"5-S[1?*=.G\Y*:'1
M1KZ6E`1&3E36NH7)B!2(Z,%9;J:8I;R%A;D%KE3`J3R4O.]L0J^):=TM0O*.
M\2.HMA=FQ.2(#*``+0#__RQ`^FC6'9C\M-VY1W%.XY7!&\H5`"+,W&V_=W\^
M_77O*T?R-^O4X)'`Z3U.Z1X5.M50:RX+XQ#';7;^I6W+O"/4^>9R1RG!Z1^:
M:>8FK#]*MUP\U+YH#IT%O_MOI9`M^L8R)"\'@`\Q$O@``4=AV`+M`SU9^H'X
M9ZFNQQ-0CUX*.""6+X'2R]-H;+96%JR-5HW)NY[/(B9T/2$Z,30K8-_0/9C+
M-7:)?(99;O+XYLW$/Y(?+U8G^=LTGNZ:2Z'"G8R['JXC>ZW8VK#*5P[&]Y!7
M(4XT+*1XM?)29BO)=9)?%%8T1___PX77'!5!9,V\L_>>[=7X1I8K?."<=)*)
MMQ(<RB6+J'/OH@ZI$`#TX%O*9FC1LS,%,@#!0[U#R:'KM0F_`TXX.C1`_/45
MA0='R^X(K^\7,5=:.TERK*^!L*XX2*>C#^/3<6OKMFJRXPC!'E*=:HK)C##&
MELG0LWAM[26Z-W?2[5N;S8%P`?Z1<Q;10VP4D3*Z-[3)&1(3'%^=4M($4>IE
M3*?-I+]6DJZ___G?+6HC]^T+#5G,/$>(M"IY_F>+.3THA1TWV#8R2@W:,SB%
M;4+BDGXR0^$/44-L<J)[45H`4RU3P``J'<.:G.V5)K41PHVTR(]BHA3->-'"
M),O9S0>/PWNA#L#-&!*T9TSX?AZEJ&$LLL@]$`#L,&2TZA;RY*]+\74Q1=#P
ME9*X;4Y9E##F*M+0M5N0U#)+.2>*)+#6#3IAVY5R<69<QH@S'2]=>:&V"?__
M]XEC]%^&4693BM$.(L;Y'RKS/)&2$@A$K(7BL)4:TA=:_V'/=C@T9I[K7UP?
M>S`:!<Q)6OL?@_%ZL&T/K(DS&AL<=G/N\<D0=L88A")5`>,T9`N`;I41,6P[
MJG&?KE50XF!\1TYPJE_`5R<0X#12A0_M]+_HOO(>:]EYCGFVN0=:U]ES/FDP
M4?@WZ+:X5(JC6VN%)2A&IG\->?E(Q'R.%.+<"\``@Q2/__^`RJ5L!E6DGZ?Z
M@J6*'B7N.GG>N`X):Y*6+>5DU'8EN%A,]=6C7U>%38)2D),4T4Z+@U4]2HB"
MI0`=!:($>Q@'\(1+`8$Q.`0!`7!4`!T%4(`N((JRA(0MD&/4=$I.X[3K1A+4
M82-/$Y3=)%L5-2U;6A9UD7-H&07U@E365H$TBJ$G\B*0)9C-_:NI^@Z6R&YK
M6P/=-.QC3'___7922)<0Y5,>Q2VKBW36LFTSS.VZSGO.^+T/I`KYOX_<)1G`
MT+QG#T+P-'#QR7+D7O^^\7R6F#1QY*D)R8]L)M\>,%$Z>B]$$7Z,(\1*>+JN
MJ.+`V"_,"X\60HGD=Q'`[R0?$D8Q4^S_PW`CJ/2_+S.*WSNNFR#1N4S*YK<P
M#,)RI"J*\@B%H:AYA'X?YFCP3IADD!XB"&`#___N`EF-52JAH,EFLAC+9"LU
M:+M<L55ADW,%:JA3,99A1D--IOUFRII-4`"5^IY7OER15_K\MF,:FH^N8_%U
M`D!.&!-E4C)&2K4H-&30:00F$OB*T%P,QYP-=--DM)?,YE*)PM9J-=LNUTM=
M[.QOOTJH5Y#J.0.&2%JOU[J]QN5TN)Q.1M.-M-5WOY___[$3I-;)9YD\IEM-
M=+C;+_1:'3JI,8+%J%#W[!9#$'@_(H_H]')NY6>KVVW5BL'"S3RI&ZR$\M4*
MK5<+$V&@H80`)A,%0F?C4/BJ@TJBT&G5HSD(MV>MU6GUHM%4DU0JE,L6(N%8
MRF<T%^X7$V&ZTG`_VG,8[$YI*9;'8K)Z1-XS+:'1IK(IK,I"___^F)"0$%HK
M`0#!@(!(;&@#`X+``,#`P!P+#!1!@=)Z$%PJ&1#.!?%(7'B`$9#(`:&:$0I:
M<C[7J`>2+:D3:CV7C+:$#@+#4#EC;)0*`1B+,!&*Q_'Q,*A4%@M%0C%0G%HV
M%XQ&`Q$@I&`J$8F%HP$@D%@^(`V%(\(@X%1#)))(!')H^)Q8(8_&9'?__^OD
MT:L1&`T*B4ZF25ZK^1PJ,1N0-%`MJ&-U<-A[K@GM1Y.!7)=@L)!E4EL,L&UC
MK@LF$\`4$!88`05#@`#\9"DF#<2B\D%46!$:&0Z'0WG=:IDUL`WIA3JIA*E;
MK]C,=,-)F,QH-1Q.!F-MW.-O)!2M%!/1_/N!.2!O9I0>1Q!^QB2R2.PZ,1>%
M/___UB$XV>8$F+"4I'EB-+R$A(2)%E%8@*SPP'C^7(@P%)T,E&4^)A@QA3P8
M*.C%&E7*!<GIE87E>7V988%Y94SQ-8E,I*28F*P89+09/)!4H`!P*%0@2-0T
M3#@H9$!08'0X/$X=S.8\K&!D<2B<P9#TK+#]*02XY;&E69H```#PZ`X)#J4:
M90J.C$ZELM3I2AU<K7JU:HPJ6+EBA@R3%$"]6I:,FKU6I=+5S!FO7*V3E0M=
MO%S9^^9NWKIVQ8LG3%4Q8*ES%>M7,#Z-,L4HU"E.@1IU`8:5`(3YQ$-/FPYP
MZ;,)41Y.R4(U;___X8@5#U%6!PL`"0DF1@D/$0\+)FP[#B`]*!,I@Q\+#`<G
M"!5+=7`,5$0)"EM/-XV3CGF'6'V>>GIK<G-_@6Q-:HAO13L_/4`D($LE0"LI
!20``
`
end

View File

@ -35,6 +35,7 @@ DEFINE_TEST(test_read_format_raw)
struct archive *a;
const char *reffile1 = "test_read_format_raw.data";
const char *reffile2 = "test_read_format_raw.data.Z";
const char *reffile3 = "test_read_format_raw.bufr";
/* First, try pulling data out of an uninterpretable file. */
extract_reference_file(reffile1);
@ -90,4 +91,30 @@ DEFINE_TEST(test_read_format_raw)
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/* Third, try with file which fooled us in past - appeared to be tar. */
extract_reference_file(reffile3);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, reffile3, 1));
/* First (and only!) Entry */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("data", archive_entry_pathname(ae));
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
/* Most fields should be unset (unknown) */
assert(!archive_entry_size_is_set(ae));
assert(!archive_entry_atime_is_set(ae));
assert(!archive_entry_ctime_is_set(ae));
assert(!archive_entry_mtime_is_set(ae));
/* Test EOF */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View File

@ -146,28 +146,14 @@ create_sparse_file(const char *path, const struct sparse *s)
#else
#if defined(_PC_MIN_HOLE_SIZE)
/*
* FreeBSD and Solaris can detect 'hole' of a sparse file
* through lseek(HOLE) on ZFS. (UFS does not support yet)
*/
static int
is_sparse_supported(const char *path)
{
return (pathconf(path, _PC_MIN_HOLE_SIZE) > 0);
}
#elif defined(__linux__)&& defined(HAVE_LINUX_FIEMAP_H)
#if defined(HAVE_LINUX_FIEMAP_H)
/*
* FIEMAP, which can detect 'hole' of a sparse file, has
* been supported from 2.6.28
*/
static int
is_sparse_supported(const char *path)
is_sparse_supported_fiemap(const char *path)
{
const struct sparse sparse_file[] = {
/* This hole size is too small to create a sparse
@ -198,7 +184,58 @@ is_sparse_supported(const char *path)
return (r >= 0);
}
#else
#if !defined(SEEK_HOLE) || !defined(SEEK_DATA)
static int
is_sparse_supported(const char *path)
{
return is_sparse_supported_fiemap(path);
}
#endif
#endif
#if defined(_PC_MIN_HOLE_SIZE)
/*
* FreeBSD and Solaris can detect 'hole' of a sparse file
* through lseek(HOLE) on ZFS. (UFS does not support yet)
*/
static int
is_sparse_supported(const char *path)
{
return (pathconf(path, _PC_MIN_HOLE_SIZE) > 0);
}
#elif defined(SEEK_HOLE) && defined(SEEK_DATA)
static int
is_sparse_supported(const char *path)
{
const struct sparse sparse_file[] = {
/* This hole size is too small to create a sparse
* files for almost filesystem. */
{ HOLE, 1024 }, { DATA, 10240 },
{ END, 0 }
};
int fd, r;
const char *testfile = "can_sparse";
(void)path; /* UNUSED */
create_sparse_file(testfile, sparse_file);
fd = open(testfile, O_RDWR);
if (fd < 0)
return (0);
r = lseek(fd, 0, SEEK_HOLE);
close(fd);
unlink(testfile);
#if defined(HAVE_LINUX_FIEMAP_H)
if (r < 0)
return (is_sparse_supported_fiemap(path));
#endif
return (r >= 0);
}
#elif !defined(HAVE_LINUX_FIEMAP_H)
/*
* Other system may do not have the API such as lseek(HOLE),

View File

@ -295,7 +295,7 @@ cset_auto_compress(struct creation_set *cset, const char *filename)
struct filter_set *v;
int i, r;
/* Release previos filters. */
/* Release previous filters. */
_cleanup_filters(old_filters, old_filter_count);
v = malloc(sizeof(*v) * cset->filter_count);
@ -308,7 +308,7 @@ cset_auto_compress(struct creation_set *cset, const char *filename)
cset->filters = v;
return (1);
} else {
/* Put previos filters back. */
/* Put previous filters back. */
cset->filters = old_filters;
cset->filter_count = old_filter_count;
return (0);

View File

@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
return (0); /* Standard: return 0 for end-of-string. */
cnt = utf8_count[ch];
/* Invalide sequence or there are not plenty bytes. */
/* Invalid sequence or there are not plenty bytes. */
if (n < (size_t)cnt)
return (-1);
@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
return (-1);
}
/* The code point larger than 0x10FFFF is not leagal
/* The code point larger than 0x10FFFF is not legal
* Unicode values. */
if (wc > 0x10FFFF)
return (-1);

View File

@ -285,7 +285,7 @@ copy_basic(void)
/* NOTE: for proper operation on cygwin-1.5 and windows, the
* length of the name of the directory below, "plain", must be
* less than or equal to the lengthe of the name of the original
* less than or equal to the length of the name of the original
* directory, "original" This restriction derives from the
* extremely limited pathname lengths on those platforms.
*/
@ -327,7 +327,7 @@ copy_ustar(void)
/* NOTE: for proper operation on cygwin-1.5 and windows, the
* length of the name of the directory below, "ustar", must be
* less than or equal to the lengthe of the name of the original
* less than or equal to the length of the name of the original
* directory, "original" This restriction derives from the
* extremely limited pathname lengths on those platforms.
*/

View File

@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir)
assertMakeDir("source/dir3", 0755);
assertMakeDir("source/dir3/d3", 0755);
assertMakeFile("source/dir3/f3", 0755, "abcde");
assertMakeDir("source/dir4", 0755);
assertMakeFile("source/dir4/file3", 0755, "abcdef");
assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
assertEqualInt(0,
systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
testprog));
/* Second archive with hardlinks */
assertEqualInt(0,
systemf("%s -cf test2.tar -C source dir4", testprog));
/*
* Extract with -x and without -P.
*/
@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir)
assertMakeSymlink("dest2/file2", "real_file2");
assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
/* dest2/dir symlink should be followed */
/* "dir4" is a symlink to existing "real_dir" */
if (canSymlink())
assertMakeSymlink("dest2/dir4", "real_dir");
assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
/* dest2/dir and dest2/dir4 symlinks should be followed */
if (canSymlink()) {
assertIsSymlink("dest2/dir", "real_dir");
assertIsSymlink("dest2/dir4", "real_dir");
assertIsDir("dest2/real_dir", -1);
}
@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir)
/* dest2/file2 symlink should be removed */
failure("Symlink to non-existing file should be removed");
assertIsReg("dest2/file2", -1);
/* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
}

View File

@ -527,7 +527,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
struct archive *disk = bsdtar->diskreader;
/*
* This tricky code here is to correctly read the cotents
* This tricky code here is to correctly read the contents
* of the entry because the disk reader bsdtar->diskreader
* is pointing at does not have any information about the
* entry by this time and using archive_read_data_block()

View File

@ -37,7 +37,7 @@ expect() {
atf_test_case overflow1
overflow1_head() {
atf_set "descr" "Tests for overflow conditions"
atf_set "require.progs" "/usr/bin/factor"
atf_set "require.progs" "/usr/games/factor"
}
overflow1_body() {
expect '8675309' '8675309: 8675309'
@ -56,7 +56,7 @@ atf_test_case loop1
loop1_head() {
atf_set "descr" "Tests some cases that once locked the program" \
"in an infinite loop"
atf_set "require.progs" "/usr/bin/factor"
atf_set "require.progs" "/usr/games/factor"
}
loop1_body() {
expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103'

View File

@ -144,6 +144,9 @@ ATF_TC_BODY(strunvis_hex, tc)
}
}
/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */
#ifdef VIS_NOLOCALE
/* End FreeBSD */
ATF_TC(strvis_locale);
ATF_TC_HEAD(strvis_locale, tc)
{
@ -172,6 +175,9 @@ ATF_TC_BODY(strvis_locale, tc)
setlocale(LC_CTYPE, ol);
free(ol);
}
/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */
#endif /* VIS_NOLOCALE */
/* End FreeBSD */
ATF_TP_ADD_TCS(tp)
{
@ -180,7 +186,13 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, strvis_null);
ATF_TP_ADD_TC(tp, strvis_empty);
ATF_TP_ADD_TC(tp, strunvis_hex);
/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */
#ifdef VIS_NOLOCALE
/* End FreeBSD */
ATF_TP_ADD_TC(tp, strvis_locale);
/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */
#endif /* VIS_NOLOCALE */
/* End FreeBSD */
return atf_no_error();
}

View File

@ -50,86 +50,13 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 kre Exp $");
#include <limits.h>
#define _KMEMUSER
#include <machine/vmparam.h>
void set_vm_max_wired(int);
void restore_vm_max_wired(void);
#endif
static long page = 0;
#ifdef __FreeBSD__
#define VM_MAX_WIRED "vm.max_wired"
static void
vm_max_wired_sysctl(int *old_value, int *new_value)
{
size_t old_len;
size_t new_len = (new_value == NULL ? 0 : sizeof(int));
if (old_value == NULL)
printf("Setting the new value to %d\n", *new_value);
else {
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
}
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
if (old_value != NULL)
printf("Saved the old value (%d)\n", *old_value);
}
static void
set_vm_max_wired(int new_value)
{
FILE *fp;
int old_value;
fp = fopen(VM_MAX_WIRED, "w");
if (fp == NULL) {
atf_tc_skip("could not open %s for writing: %s",
VM_MAX_WIRED, strerror(errno));
return;
}
vm_max_wired_sysctl(&old_value, NULL);
ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0,
"saving %s failed", VM_MAX_WIRED);
fclose(fp);
vm_max_wired_sysctl(NULL, &new_value);
}
static void
restore_vm_max_wired(void)
{
FILE *fp;
int saved_max_wired;
fp = fopen(VM_MAX_WIRED, "r");
if (fp == NULL) {
perror("fopen failed\n");
return;
}
if (fscanf(fp, "%d", &saved_max_wired) != 1) {
perror("fscanf failed\n");
fclose(fp);
return;
}
fclose(fp);
printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired);
if (saved_max_wired == 0) /* This will cripple the test host */
return;
vm_max_wired_sysctl(NULL, &saved_max_wired);
}
#endif
ATF_TC(mlock_clip);
ATF_TC_HEAD(mlock_clip, tc)
{

View File

@ -50,6 +50,11 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.5 2016/07/13 09:53:16 njoly Exp $");
#include <ucontext.h>
#include <unistd.h>
#ifdef __FreeBSD__
void set_vm_max_wired(int);
void restore_vm_max_wired(void);
#endif
static void sighandler(int);
static const char path[] = "setrlimit";
@ -235,10 +240,18 @@ sighandler(int signo)
_exit(EXIT_SUCCESS);
}
#ifdef __FreeBSD__
ATF_TC_WITH_CLEANUP(setrlimit_memlock);
#else
ATF_TC(setrlimit_memlock);
#endif
ATF_TC_HEAD(setrlimit_memlock, tc)
{
atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_MEMLOCK");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects");
atf_tc_set_md_var(tc, "require.user", "root");
#endif
}
ATF_TC_BODY(setrlimit_memlock, tc)
@ -249,6 +262,11 @@ ATF_TC_BODY(setrlimit_memlock, tc)
pid_t pid;
int sta;
#ifdef __FreeBSD__
/* Set max_wired really really high to avoid EAGAIN */
set_vm_max_wired(INT_MAX);
#endif
page = sysconf(_SC_PAGESIZE);
ATF_REQUIRE(page >= 0);
@ -292,6 +310,14 @@ ATF_TC_BODY(setrlimit_memlock, tc)
atf_tc_fail("RLIMIT_MEMLOCK not enforced");
}
#ifdef __FreeBSD__
ATF_TC_CLEANUP(setrlimit_memlock, tc)
{
restore_vm_max_wired();
}
#endif
ATF_TC(setrlimit_nofile_1);
ATF_TC_HEAD(setrlimit_nofile_1, tc)
{

View File

@ -1,3 +1,54 @@
Version 1.9.5
(29 Nov 2016, from /branches/1.9.x)
http://svn.apache.org/repos/asf/subversion/tags/1.9.5
User-visible changes:
- Client-side bugfixes:
* fix accessing non-existent paths during reintegrate merge (r1766699 et al)
* fix handling of newly secured subdirectories in working copy (r1724448)
* info: remove trailing whitespace in --show-item=revision (issue #4660)
* fix recording wrong revisions for tree conflicts (r1734106)
* gpg-agent: improve discovery of gpg-agent sockets (r1766327)
* gpg-agent: fix file descriptor leak (r1766323)
* resolve: fix --accept=mine-full for binary files (issue #4647)
* merge: fix possible crash (issue #4652)
* resolve: fix possible crash (r1748514)
* fix potential crash in Win32 crash reporter (r1663253 et al)
- Server-side bugfixes:
* fsfs: fix "offset too large" error during pack (issue #4657)
* svnserve: enable hook script environments (r1769152)
* fsfs: fix possible data reconstruction error (issue #4658)
* fix source of spurious 'incoming edit' tree conflicts (r1770108)
* fsfs: improve caching for large directories (r1721285)
* fsfs: fix crash when encountering all-zero checksums (r1759686)
* fsfs: fix potential source of repository corruptions (r1756266)
* mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate
(issue #3084)
* mod_dav_svn: reduce memory usage during GET requests (r1757529 et al)
* fsfs: fix unexpected "database is locked" errors (r1741096 et al)
* fsfs: fix opening old repositories without db/format files (r1720015)
- Client-side and server-side bugfixes:
* fix possible crash when reading invalid configuration files (r1715777)
- Bindings bugfixes:
* swig-pl: do not corrupt "{DATE}" revision variable (r1767768)
* javahl: fix temporary accepting SSL server certificates (r1764851)
* swig-pl: fix possible stack corruption (r1683266, r1683267)
Developer-visible changes:
- General:
* add zlib discovery through pkg-config (issue #4655)
* fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653)
* ruby: fix test failures with ruby >= 2.2 (r1766621)
* fix link error with --disable-keychain on OS X (r1765385)
* swig: enable building with SWIG >= 3.0.6 (r1721488 et al)
* swig: fix building with -Wdate-time in $CPPFLAGS (r1722164)
* update serf download URI in build scripts (r1700130 et al)
* raise minimal httpd version from 2.0 to 2.2 (r1754193)
Version 1.9.4
(28 Apr 2016, from /branches/1.9.x)
http://svn.apache.org/repos/asf/subversion/tags/1.9.4
@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.4
* ra_serf: fix deleting directories with many files (issue #4557)
- Server-side bugfixes:
* mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168)
* svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167)
* improve documentation for AuthzSVNGroupsFile and groups-db (r1730856)
* fsfs: reduce peak memory usage when listing large directories (r1725180)
* fsfs: fix a rare source of incomplete dump files and reports (r1717876)
@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.4
* fix ruby test suite to work with test-unit gem (r1714790)
* allow building against KDE4 without conflict with KDE5 (r1734926)
* fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432)
* build system tweaks:
* tweak how symbolic error names in maintainer mode (r1735179)
* tweak getting symbolic error names in maintainer mode (r1735179)
* fix inconsistent behavior of inherited property API (r1717874 et al)
- API changes:
@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.0
* javahl: allow compiling with a C++11 compiler (r1684412)
Version 1.8.17
(29 Nov 2016, from /branches/1.8.x)
http://svn.apache.org/repos/asf/subversion/tags/1.8.17
User-visible changes:
- Client-side bugfixes:
* fix handling of newly secured subdirectories in working copy (r1724448)
* ra_serf: fix deleting directories with many files (issue #4557)
* svnlook: properly remove tempfiles on diff errors (r1711346)
* gpg-agent: properly handle passwords with percent characters (issue #4611)
* merge: fix crash when merging to a local add (r1702299 et al)
- Server-side bugfixes:
* fsfs: fix possible data reconstruction error (issue #4658)
- Client-side and server-side bugfixes:
* fix potential memory access bugs (r1722860 et al)
- Bindings bugfixes:
* javahl: fix temporary accepting SSL server certificates (r1764851)
* swig-pl: do not corrupt "{DATE}" revision variable (r1767768)
* swig-pl: fix possible stack corruption (r1683266)
Developer-visible changes:
- General:
* fix inconsistent behavior of inherited property API (r1717875, r1717878)
* fix patch filter invocation in svn_client_patch() (r1706783)
* fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653)
Version 1.8.16
(28 Apr 2016, from /branches/1.8.x)
http://svn.apache.org/repos/asf/subversion/tags/1.8.16
User-visible changes:
- Server-side bugfixes:
* mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168)
* svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167)
* mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602)
* dump: don't write broken dump files in some ambiguously encoded fsfs
repositories (issue #4554)
@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversion/tags/1.8.0
* fix bug in mergeinfo recording during foreign-repos merge (r1430310)
* fix spurious merge conflicts for binary files with keywords (issue #4221)
* fix patching symlinks with 'svn patch' (issue #4273)
* make 'svn switch' refresh lock information (issue #3376)
* make 'svn switch' refresh lock information (issue #3378)
* fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362)
* fix mergeinfo recording for multiple-revision-range merge (issue #4306)
* fix diffs shown by 'show-diff' conflict prompt option (r1438879)

View File

@ -2,7 +2,7 @@
Subversion, a version control system.
=====================================
$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $
$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $
Contents:
@ -36,10 +36,10 @@ II. DOCUMENTATION
It is written in DocBook XML, and the sources can be found at:
http://svnbook.googlecode.com/svn/trunk/
http://svn.code.sf.net/p/svnbook/source/trunk/
If you wish to build the documentation from source, read the
src/en/README file within the book source.
en/README file within the book source.

View File

@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3-test.lo: subversion/tests/libsvn_diff/di
subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h
subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings-reps-test.lo: subversion/tests/libsvn_fs
subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h
subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for subversion 1.9.4.
# Generated by GNU Autoconf 2.69 for subversion 1.9.5.
#
# Report bugs to <http://subversion.apache.org/>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='subversion'
PACKAGE_TARNAME='subversion'
PACKAGE_VERSION='1.9.4'
PACKAGE_STRING='subversion 1.9.4'
PACKAGE_VERSION='1.9.5'
PACKAGE_STRING='subversion 1.9.5'
PACKAGE_BUGREPORT='http://subversion.apache.org/'
PACKAGE_URL=''
@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures subversion 1.9.4 to adapt to many kinds of systems.
\`configure' configures subversion 1.9.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1537,7 +1537,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of subversion 1.9.4:";;
short | recursive ) echo "Configuration of subversion 1.9.5:";;
esac
cat <<\_ACEOF
@ -1751,7 +1751,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
subversion configure 1.9.4
subversion configure 1.9.5
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by subversion $as_me 1.9.4, which was
It was created by subversion $as_me 1.9.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5
$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5
$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;}
abs_srcdir="`cd $srcdir && pwd`"
@ -7422,7 +7422,10 @@ _ACEOF
localedir='${datadir}/locale'
if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then
if test "${prefix}" = "NONE" \
&& ( test "${datadir}" = '${prefix}/share' \
|| ( test "${datadir}" = '${datarootdir}' \
&& test "${datarootdir}" = '${prefix}/share' ) ); then
exp_localedir='${ac_default_prefix}/share/locale'
else
exp_localedir=$localedir
@ -22550,12 +22553,156 @@ fi
zlib_found=no
zlib_skip=no
# Check whether --with-zlib was given.
if test "${with_zlib+set}" = set; then :
withval=$with_zlib;
if test "$withval" = "yes" ; then
if test "$withval" = "yes"; then
zlib_skip=no
elif test "$withval" = "no"; then
zlib_skip=yes
else
zlib_skip=no
zlib_prefix="$withval"
fi
fi
if test "$zlib_skip" = "yes"; then
as_fn_error $? "subversion requires zlib" "$LINENO" 5
fi
if test -n "$zlib_prefix"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5
$as_echo "$as_me: zlib library configuration via prefix" >&6;}
save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include"
for ac_header in zlib.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ZLIB_H 1
_ACEOF
save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$zlib_prefix/lib"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
$as_echo_n "checking for inflate in -lz... " >&6; }
if ${ac_cv_lib_z_inflate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inflate ();
int
main ()
{
return inflate ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_z_inflate=yes
else
ac_cv_lib_z_inflate=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
$as_echo "$ac_cv_lib_z_inflate" >&6; }
if test "x$ac_cv_lib_z_inflate" = xyes; then :
zlib_found="yes"
SVN_ZLIB_INCLUDES="-I$zlib_prefix/include"
SVN_ZLIB_LIBS="`
input_flags="-L$zlib_prefix/lib"
output_flags=""
filtered_dirs="/lib /lib64 /usr/lib /usr/lib64"
for flag in $input_flags; do
filter="no"
for dir in $filtered_dirs; do
if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then
filter="yes"
break
fi
done
if test "$filter" = "no"; then
output_flags="$output_flags $flag"
fi
done
if test -n "$output_flags"; then
printf "%s" "${output_flags# }"
fi
` -lz"
fi
LDFLAGS="$save_ldflags"
fi
done
CPPFLAGS="$save_cppflags"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5
$as_echo "$as_me: zlib library configuration via pkg-config" >&6;}
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5
$as_echo_n "checking for zlib library... " >&6; }
if $PKG_CONFIG zlib --exists; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
zlib_found=yes
SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags`
SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs`
SVN_ZLIB_LIBS="`
input_flags="$SVN_ZLIB_LIBS"
output_flags=""
filtered_dirs="/lib /lib64 /usr/lib /usr/lib64"
for flag in $input_flags; do
filter="no"
for dir in $filtered_dirs; do
if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then
filter="yes"
break
fi
done
if test "$filter" = "no"; then
output_flags="$output_flags $flag"
fi
done
if test -n "$output_flags"; then
printf "%s" "${output_flags# }"
fi
`"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test "$zlib_found" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5
$as_echo "$as_me: zlib library configuration" >&6;}
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
@ -22596,163 +22743,23 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
$as_echo "$ac_cv_lib_z_inflate" >&6; }
if test "x$ac_cv_lib_z_inflate" = xyes; then :
zlib_found="builtin"
zlib_found="builtin"
SVN_ZLIB_LIBS="-lz"
fi
fi
elif test "$withval" = "no" ; then
as_fn_error $? "cannot compile without zlib." "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5
$as_echo "$as_me: zlib library configuration" >&6;}
zlib_prefix=$withval
save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include"
for ac_header in zlib.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ZLIB_H 1
_ACEOF
save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$zlib_prefix/lib"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
$as_echo_n "checking for inflate in -lz... " >&6; }
if ${ac_cv_lib_z_inflate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inflate ();
int
main ()
{
return inflate ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_z_inflate=yes
else
ac_cv_lib_z_inflate=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
$as_echo "$ac_cv_lib_z_inflate" >&6; }
if test "x$ac_cv_lib_z_inflate" = xyes; then :
zlib_found="yes"
fi
LDFLAGS="$save_ldflags"
fi
done
CPPFLAGS="$save_cppflags"
fi
else
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
$as_echo_n "checking for inflate in -lz... " >&6; }
if ${ac_cv_lib_z_inflate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inflate ();
int
main ()
{
return inflate ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_z_inflate=yes
else
ac_cv_lib_z_inflate=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
$as_echo "$ac_cv_lib_z_inflate" >&6; }
if test "x$ac_cv_lib_z_inflate" = xyes; then :
zlib_found="builtin"
fi
fi
fi
fi
if test "$zlib_found" = "no"; then
as_fn_error $? "subversion requires zlib" "$LINENO" 5
fi
if test "$zlib_found" = "yes"; then
SVN_ZLIB_INCLUDES="-I$zlib_prefix/include"
LDFLAGS="$LDFLAGS `
input_flags="-L$zlib_prefix/lib"
output_flags=""
filtered_dirs="/lib /lib64 /usr/lib /usr/lib64"
for flag in $input_flags; do
filter="no"
for dir in $filtered_dirs; do
if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then
filter="yes"
break
fi
done
if test "$filter" = "no"; then
output_flags="$output_flags $flag"
fi
done
if test -n "$output_flags"; then
printf "%s" "${output_flags# }"
fi
`"
fi
SVN_ZLIB_LIBS="-lz"
@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; }
# packages/rpm/redhat-7.x/subversion.spec
# packages/rpm/rhel-3/subversion.spec
# packages/rpm/rhel-4/subversion.spec
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
test "$SWIG_VERSION" -lt "300000"; then
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
SWIG_SUITABLE=yes
else
SWIG_SUITABLE=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5
$as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;}
fi
fi
@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; }
# packages/rpm/redhat-7.x/subversion.spec
# packages/rpm/rhel-3/subversion.spec
# packages/rpm/rhel-4/subversion.spec
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
test "$SWIG_VERSION" -lt "300000"; then
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
SWIG_SUITABLE=yes
else
SWIG_SUITABLE=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5
$as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;}
fi
fi
@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; }
# packages/rpm/redhat-7.x/subversion.spec
# packages/rpm/rhel-3/subversion.spec
# packages/rpm/rhel-4/subversion.spec
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
test "$SWIG_VERSION" -lt "300000"; then
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
SWIG_SUITABLE=yes
else
SWIG_SUITABLE=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5
$as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;}
fi
fi
@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; }
# packages/rpm/redhat-7.x/subversion.spec
# packages/rpm/rhel-3/subversion.spec
# packages/rpm/rhel-4/subversion.spec
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
test "$SWIG_VERSION" -lt "300000"; then
if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
SWIG_SUITABLE=yes
else
SWIG_SUITABLE=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5
$as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5
$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;}
fi
fi
@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS"
SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'`
SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'`
cat >>confdefs.h <<_ACEOF
@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by subversion $as_me 1.9.4, which was
This file was extended by subversion $as_me 1.9.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -26816,7 +26822,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
subversion config.status 1.9.4
subversion config.status 1.9.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -199,7 +199,10 @@ localedir='${datadir}/locale'
AC_SUBST(localedir)
dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR.
if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then
if test "${prefix}" = "NONE" \
&& ( test "${datadir}" = '${prefix}/share' \
|| ( test "${datadir}" = '${datarootdir}' \
&& test "${datarootdir}" = '${prefix}/share' ) ); then
exp_localedir='${ac_default_prefix}/share/locale'
else
exp_localedir=$localedir
@ -1504,6 +1507,7 @@ fi
# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well.
SWIG_CPPFLAGS="$CPPFLAGS"
SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ])
SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ])
AC_SUBST([SWIG_CPPFLAGS])
dnl Since this is used only on Unix-y systems, define the path separator as '/'

View File

@ -89,7 +89,7 @@ get_serf() {
test -d $BASEDIR/serf && return
cd $TEMPDIR
$HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2
$HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2
cd $BASEDIR
bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf -

View File

@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path,
const char *dst_path,
apr_pool_t *scratch_pool);
/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */
#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44)
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -70,7 +70,7 @@ extern "C" {
*
* @since New in 1.1.
*/
#define SVN_VER_PATCH 4
#define SVN_VER_PATCH 5
/** @deprecated Provided for backward compatibility with the 1.0 API. */
@ -93,7 +93,7 @@ extern "C" {
*
* Always change this at the same time as SVN_VER_NUMTAG.
*/
#define SVN_VER_TAG " (r1740329)"
#define SVN_VER_TAG " (r1770682)"
/** Number tag: a string describing the version.
@ -117,7 +117,7 @@ extern "C" {
* file version. Its value remains 0 in the repository except in release
* tags where it is the revision from which the tag was created.
*/
#define SVN_VER_REVISION 1740329
#define SVN_VER_REVISION 1770682
/* Version strings composed from the above definitions. */

View File

@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b,
return SVN_NO_ERROR;
}
/* Forward declaration */
static svn_client__merge_path_t *
find_nearest_ancestor_with_intersecting_ranges(
svn_revnum_t *start,
svn_revnum_t *end,
const apr_array_header_t *children_with_mergeinfo,
svn_boolean_t path_is_own_ancestor,
const char *local_abspath);
/* Record a tree conflict in the WC, unless this is a dry run or a record-
* only merge, or if a tree conflict is already flagged for the VICTIM_PATH.
* (The latter can happen if a merge-tracking-aware merge is doing multiple
@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t *merge_b,
reason = svn_wc_conflict_reason_moved_here;
}
SVN_ERR(make_conflict_versions(&left, &right, local_abspath,
merge_left_node_kind,
merge_right_node_kind,
&merge_b->merge_source, merge_b->target,
result_pool, scratch_pool));
if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral)
{
struct merge_source_t *source;
svn_client__pathrev_t *loc1;
svn_client__pathrev_t *loc2;
svn_merge_range_t range =
{SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE};
/* We are honoring mergeinfo so do not blindly record
* a conflict describing the merge of
* SOURCE->LOC1->URL@SOURCE->LOC1->REV through
* SOURCE->LOC2->URL@SOURCE->LOC2->REV
* but figure out the actual revision range merged. */
(void)find_nearest_ancestor_with_intersecting_ranges(
&(range.start), &(range.end),
merge_b->notify_begin.nodes_with_mergeinfo,
action != svn_wc_conflict_action_delete,
local_abspath);
loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1,
scratch_pool);
loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2,
scratch_pool);
loc1->rev = range.start;
loc2->rev = range.end;
source = merge_source_create(loc1, loc2,
merge_b->merge_source.ancestral,
scratch_pool);
SVN_ERR(make_conflict_versions(&left, &right, local_abspath,
merge_left_node_kind,
merge_right_node_kind,
source, merge_b->target,
result_pool, scratch_pool));
}
else
SVN_ERR(make_conflict_versions(&left, &right, local_abspath,
merge_left_node_kind,
merge_right_node_kind,
&merge_b->merge_source, merge_b->target,
result_pool, scratch_pool));
/* Fix up delete of file, add of dir replacement (or other way around) */
if (existing_conflict != NULL && existing_conflict->src_left_version)
@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__pathrev_t *source_loc,
potentially_unmerged_ranges->nelts - 1,
svn_merge_range_t *))->end;
log_find_operative_baton_t log_baton;
const char *old_session_url;
const char *old_session_url = NULL;
svn_error_t *err;
log_baton.merged_catalog = merged_catalog;
@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__pathrev_t *source_loc,
= svn_client__pathrev_fspath(target_loc, scratch_pool);
log_baton.result_pool = result_pool;
SVN_ERR(svn_client__ensure_ra_session_url(
&old_session_url, ra_session, target_loc->url, scratch_pool));
/* Reparent the session to TARGET_LOC if this target location
* exists within the unmerged revision range. */
if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev)
SVN_ERR(svn_client__ensure_ra_session_url(
&old_session_url, ra_session, target_loc->url, scratch_pool));
err = get_log(ra_session, "", youngest_rev, oldest_rev,
TRUE, /* discover_changed_paths */
log_find_operative_revs, &log_baton,
scratch_pool);
SVN_ERR(svn_error_compose_create(
err, svn_ra_reparent(ra_session, old_session_url, scratch_pool)));
if (old_session_url)
err = svn_error_compose_create(err,
svn_ra_reparent(ra_session,
old_session_url,
scratch_pool));
SVN_ERR(err);
}
return SVN_NO_ERROR;

View File

@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin, rep_state_t *rs,
return SVN_NO_ERROR;
}
/* Skip SIZE bytes from the PLAIN representation RS. */
static svn_error_t *
skip_plain_window(rep_state_t *rs,
apr_size_t size)
{
/* Update RS. */
rs->current += (apr_off_t)size;
return SVN_NO_ERROR;
}
/* Get the undeltified window that is a result of combining all deltas
from the current desired representation identified in *RB with its
base representation. Store the window in *RESULT. */
@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **result,
Also note that we may have short-cut reading the delta chain --
in which case SRC_OPS is 0 and it might not be a PLAIN rep. */
source = buf;
if (source == NULL && rb->src_state != NULL && window->src_ops)
SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len,
pool, iterpool));
if (source == NULL && rb->src_state != NULL)
{
/* Even if we don't need the source rep now, we still must keep
* its read offset in sync with what we might need for the next
* window. */
if (window->src_ops)
SVN_ERR(read_plain_window(&source, rb->src_state,
window->sview_len,
pool, iterpool));
else
SVN_ERR(skip_plain_window(rb->src_state, window->sview_len));
}
/* Combine this window with the current one. */
new_pool = svn_pool_create(rb->pool);

View File

@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *fs,
svn_fs_fs__deserialize_dir_entries,
sizeof(pair_cache_key_t),
apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL),
SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
fs,
no_handler,
fs->pool, pool));
@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_t *fs,
APR_HASH_KEY_STRING,
apr_pstrcat(pool, prefix, "TXNDIR",
SVN_VA_NULL),
0,
SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
fs,
TRUE,
pool, pool));

View File

@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs,
apr_pool_t *common_pool)
{
SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool));
return svn_fs_fs__pack(fs, notify_func, notify_baton,
return svn_fs_fs__pack(fs, 0, notify_func, notify_baton,
cancel_func, cancel_baton, pool);
}

View File

@ -492,6 +492,7 @@ read_format(int *pformat,
svn_error_clear(err);
*pformat = 1;
*max_files_per_dir = 0;
*use_log_addressing = FALSE;
return SVN_NO_ERROR;
}

View File

@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(representation_t **rep_p,
SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str,
scratch_pool));
memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest));
/* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already
contains the correct value. */
if (checksum)
memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest));
/* The remaining fields are only used for formats >= 4, so check that. */
str = svn_cstring_tokenize(" ", &string);
@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(representation_t **rep_p,
SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str,
scratch_pool));
/* We do have a valid SHA1 but it might be all 0.
We cannot be sure where that came from (Alas! legacy), so let's not
claim we know the SHA1 in that case. */
rep->has_sha1 = checksum != NULL;
memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest));
/* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already
contains the correct value. */
if (checksum)
memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest));
/* Read the uniquifier. */
str = svn_cstring_tokenize("/", &string);

View File

@ -335,21 +335,40 @@ static svn_error_t *
reset_pack_context(pack_context_t *context,
apr_pool_t *pool)
{
const char *temp_dir;
apr_array_clear(context->changes);
SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool));
SVN_ERR(svn_io_file_close(context->changes_file, pool));
apr_array_clear(context->file_props);
SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool));
SVN_ERR(svn_io_file_close(context->file_props_file, pool));
apr_array_clear(context->dir_props);
SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool));
SVN_ERR(svn_io_file_close(context->dir_props_file, pool));
apr_array_clear(context->rev_offsets);
apr_array_clear(context->path_order);
apr_array_clear(context->references);
apr_array_clear(context->reps);
SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool));
SVN_ERR(svn_io_file_close(context->reps_file, pool));
svn_pool_clear(context->info_pool);
/* The new temporary files must live at least as long as any other info
* object in CONTEXT. */
SVN_ERR(svn_io_temp_dir(&temp_dir, pool));
SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir,
svn_io_file_del_on_close,
context->info_pool, pool));
SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir,
svn_io_file_del_on_close,
context->info_pool, pool));
SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir,
svn_io_file_del_on_close,
context->info_pool, pool));
SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir,
svn_io_file_del_on_close,
context->info_pool, pool));
context->paths = svn_prefix_tree__create(context->info_pool);
return SVN_NO_ERROR;
}
@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context,
apr_off_t offset = 0;
apr_pool_t *iterpool = svn_pool_create(pool);
svn_fs_fs__revision_file_t *rev_file;
apr_finfo_t finfo;
svn_filesize_t revdata_size;
/* Get the size of the file. */
const char *path = svn_dirent_join(context->shard_dir,
apr_psprintf(iterpool, "%ld",
context->start_rev),
pool);
SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool));
/* Copy all the bits from the rev file to the end of the pack file. */
/* Copy all non-index contents the rev file to the end of the pack file. */
SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs,
context->start_rev, pool,
iterpool));
SVN_ERR(svn_fs_fs__auto_read_footer(rev_file));
revdata_size = rev_file->l2p_offset;
SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0,
iterpool));
SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file,
finfo.size, iterpool));
revdata_size, iterpool));
/* mark the start of a new revision */
SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index,
@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context,
/* read the phys-to-log index file until we covered the whole rev file.
* That index contains enough info to build both target indexes from it. */
while (offset < finfo.size)
while (offset < revdata_size)
{
/* read one cluster */
int i;
@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context,
/* process entry while inside the rev file */
offset = entry->offset;
if (offset < finfo.size)
if (offset < revdata_size)
{
entry->offset += context->pack_offset;
offset += entry->size;
@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context,
}
svn_pool_destroy(iterpool);
context->pack_offset += finfo.size;
context->pack_offset += revdata_size;
SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
@ -1534,6 +1552,7 @@ pack_log_addressed(svn_fs_t *fs,
for (i = 0; i < max_ids->nelts; ++i)
if (APR_ARRAY_IDX(max_ids, i, apr_uint64_t) + item_count <= max_items)
{
item_count += APR_ARRAY_IDX(max_ids, i, apr_uint64_t);
context.end_rev++;
}
else
@ -1792,6 +1811,7 @@ struct pack_baton
void *notify_baton;
svn_cancel_func_t cancel_func;
void *cancel_baton;
size_t max_mem;
/* Additional entries valid when entering pack_shard(). */
const char *revs_dir;
@ -1913,7 +1933,7 @@ pack_shard(struct pack_baton *baton,
/* pack the revision content */
SVN_ERR(pack_rev_shard(baton->fs, rev_pack_file_dir, baton->rev_shard_path,
baton->shard, ffd->max_files_per_dir,
DEFAULT_MAX_MEM, baton->cancel_func,
baton->max_mem, baton->cancel_func,
baton->cancel_baton, pool));
/* For newer repo formats, we only acquired the pack lock so far.
@ -2002,6 +2022,7 @@ pack_body(void *baton,
svn_error_t *
svn_fs_fs__pack(svn_fs_t *fs,
apr_size_t max_mem,
svn_fs_pack_notify_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,
@ -2017,6 +2038,7 @@ svn_fs_fs__pack(svn_fs_t *fs,
pb.notify_baton = notify_baton;
pb.cancel_func = cancel_func;
pb.cancel_baton = cancel_baton;
pb.max_mem = max_mem ? max_mem : DEFAULT_MAX_MEM;
if (ffd->format >= SVN_FS_FS__MIN_PACK_LOCK_FORMAT)
{

View File

@ -26,13 +26,19 @@
#include "fs.h"
/* Possibly pack the repository at PATH. This just take full shards, and
combines all the revision files into a single one, with a manifest header.
combines all the revision files into a single one, with a manifest header
when required by the repository format.
MAX_MEM limits the size of in-memory data structures needed for reordering
items in format 7 repositories. 0 means use the built-in default.
If given, NOTIFY_FUNC will be called with NOTIFY_BATON to report progress.
Use optional CANCEL_FUNC/CANCEL_BATON for cancellation support.
Existing filesystem references need not change. */
svn_error_t *
svn_fs_fs__pack(svn_fs_t *fs,
apr_size_t max_mem,
svn_fs_pack_notify_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_fs_fs/token-map.h.
/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_fs_fs/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_CREATE_SCHEMA 0

View File

@ -50,6 +50,13 @@ path_rep_cache_db(const char *fs_path,
return svn_dirent_join(fs_path, REP_CACHE_DB_NAME, result_pool);
}
#define SVN_ERR_CLOSE(x, db) do \
{ \
svn_error_t *svn__err = (x); \
if (svn__err) \
return svn_error_compose_create(svn__err, svn_sqlite__close(db)); \
} while (0)
/** Library-private API's. **/
@ -99,12 +106,12 @@ open_rep_cache(void *baton,
0, NULL, 0,
fs->pool, pool));
SVN_ERR(svn_sqlite__read_schema_version(&version, sdb, pool));
SVN_ERR_CLOSE(svn_sqlite__read_schema_version(&version, sdb, pool), sdb);
if (version < REP_CACHE_SCHEMA_FORMAT)
{
/* Must be 0 -- an uninitialized (no schema) database. Create
the schema. Results in schema version of 1. */
SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_CREATE_SCHEMA));
SVN_ERR_CLOSE(svn_sqlite__exec_statements(sdb, STMT_CREATE_SCHEMA), sdb);
}
/* This is used as a flag that the database is available so don't
@ -124,6 +131,21 @@ svn_fs_fs__open_rep_cache(svn_fs_t *fs,
return svn_error_quick_wrap(err, _("Couldn't open rep-cache database"));
}
svn_error_t *
svn_fs_fs__close_rep_cache(svn_fs_t *fs)
{
fs_fs_data_t *ffd = fs->fsap_data;
if (ffd->rep_cache_db)
{
SVN_ERR(svn_sqlite__close(ffd->rep_cache_db));
ffd->rep_cache_db = NULL;
ffd->rep_cache_db_opened = 0;
}
return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_fs__exists_rep_cache(svn_boolean_t *exists,
svn_fs_t *fs, apr_pool_t *pool)

View File

@ -40,6 +40,10 @@ svn_error_t *
svn_fs_fs__open_rep_cache(svn_fs_t *fs,
apr_pool_t *pool);
/* Close the rep cache database associated with FS. */
svn_error_t *
svn_fs_fs__close_rep_cache(svn_fs_t *fs);
/* Set *EXISTS to TRUE iff the rep-cache DB file exists. */
svn_error_t *
svn_fs_fs__exists_rep_cache(svn_boolean_t *exists,

View File

@ -2334,12 +2334,17 @@ rep_write_contents_close(void *baton)
b->fnv1a_checksum_ctx,
b->scratch_pool));
SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
SVN_ERR(store_p2l_index_entry(b->fs, &rep->txn_id, &entry,
b->scratch_pool));
}
SVN_ERR(svn_io_file_close(b->file, b->scratch_pool));
/* Write the sha1->rep mapping *after* we successfully written node
* revision to disk. */
if (!old_rep)
SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
SVN_ERR(unlock_proto_rev(b->fs, &rep->txn_id, b->lockcookie,
b->scratch_pool));
svn_pool_destroy(b->scratch_pool);
@ -3623,6 +3628,8 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_p,
if (ffd->rep_sharing_allowed)
{
svn_error_t *err;
SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
/* Write new entries to the rep-sharing database.
@ -3633,9 +3640,21 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_p,
/* ### A commit that touches thousands of files will starve other
(reader/writer) commits for the duration of the below call.
Maybe write in batches? */
SVN_SQLITE__WITH_TXN(
write_reps_to_cache(fs, cb.reps_to_cache, pool),
ffd->rep_cache_db);
SVN_ERR(svn_sqlite__begin_transaction(ffd->rep_cache_db));
err = write_reps_to_cache(fs, cb.reps_to_cache, pool);
err = svn_sqlite__finish_transaction(ffd->rep_cache_db, err);
if (svn_error_find_cause(err, SVN_SQLITE__ERR_ROLLBACK_FAILED))
{
/* Failed rollback means that our db connection is unusable, and
the only thing we can do is close it. The connection will be
reopened during the next operation with rep-cache.db. */
return svn_error_trace(
svn_error_compose_create(err,
svn_fs_fs__close_rep_cache(fs)));
}
else if (err)
return svn_error_trace(err);
}
return SVN_NO_ERROR;

View File

@ -2284,7 +2284,7 @@ svn_fs_fs__commit_txn(const char **conflict_p,
if (ffd->pack_after_commit)
{
SVN_ERR(svn_fs_fs__pack(fs, NULL, NULL, NULL, NULL, pool));
SVN_ERR(svn_fs_fs__pack(fs, 0, NULL, NULL, NULL, NULL, pool));
}
return SVN_NO_ERROR;

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_fs_x/token-map.h.
/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_fs_x/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_CREATE_SCHEMA 0

View File

@ -988,6 +988,30 @@ expat_cdata(void *userData, const char *data, int len)
#endif
}
#if XML_VERSION_AT_LEAST(1, 95, 8)
static void
expat_entity_declaration(void *userData,
const XML_Char *entityName,
int is_parameter_entity,
const XML_Char *value,
int value_length,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
const XML_Char *notationName)
{
struct expat_ctx_t *ectx = userData;
/* Stop the parser if an entity declaration is hit. */
XML_StopParser(ectx->parser, 0 /* resumable */);
}
#else
/* A noop default_handler. */
static void
expat_default_handler(void *userData, const XML_Char *s, int len)
{
}
#endif
/* Implements svn_ra_serf__response_handler_t */
static svn_error_t *
@ -1042,6 +1066,12 @@ expat_response_handler(serf_request_t *request,
XML_SetUserData(ectx->parser, ectx);
XML_SetElementHandler(ectx->parser, expat_start, expat_end);
XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
#if XML_VERSION_AT_LEAST(1, 95, 8)
XML_SetEntityDeclHandler(ectx->parser, expat_entity_declaration);
#else
XML_SetDefaultHandler(ectx->parser, expat_default_handler);
#endif
}
while (1)

View File

@ -916,7 +916,7 @@ update_entry(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
const char *e_path, path_info_t *info, svn_depth_t wc_depth,
svn_depth_t requested_depth, apr_pool_t *pool)
{
svn_fs_root_t *s_root;
svn_fs_root_t *s_root = NULL;
svn_boolean_t allowed, related;
void *new_baton;
svn_checksum_t *checksum;
@ -959,7 +959,26 @@ update_entry(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
if (s_entry && t_entry && s_entry->kind == t_entry->kind)
{
int distance = svn_fs_compare_ids(s_entry->id, t_entry->id);
if (distance == 0 && !any_path_info(b, e_path)
svn_boolean_t changed = TRUE;
/* Check related files for content changes to avoid reporting
* unchanged copies of files to the client as an open_file() call
* and change_file_prop()/apply_textdelta() calls with no-op changes.
* The client will otherwise raise unnecessary tree conflicts. */
if (!b->ignore_ancestry && t_entry->kind == svn_node_file &&
distance == 1)
{
if (s_root == NULL)
SVN_ERR(get_source_root(b, &s_root, s_rev));
SVN_ERR(svn_fs_props_different(&changed, s_root, s_path,
b->t_root, t_path, pool));
if (!changed)
SVN_ERR(svn_fs_contents_different(&changed, s_root, s_path,
b->t_root, t_path, pool));
}
if ((distance == 0 || !changed) && !any_path_info(b, e_path)
&& (requested_depth <= wc_depth || t_entry->kind == svn_node_file))
{
if (!info)

View File

@ -712,7 +712,7 @@ create_hooks(svn_repos_t *repos, apr_pool_t *pool)
"# Because the locks have already been created and cannot be undone," NL
"# the exit code of the hook program is ignored. The hook program" NL
"# can use the 'svnlook' utility to examine the paths in the repository" NL
"# but since the hook is invoked asyncronously the newly-created locks" NL
"# but since the hook is invoked asynchronously the newly-created locks" NL
"# may no longer be present." NL;
script =
"REPOS=\"$1\"" NL

View File

@ -74,6 +74,9 @@ typedef struct parse_context_t
char parser_buffer[SVN__STREAM_CHUNK_SIZE]; /* Larger than most config files */
size_t buffer_pos; /* Current position within parser_buffer */
size_t buffer_size; /* parser_buffer contains this many bytes */
/* Non-zero if we hit EOF on the stream. */
svn_boolean_t hit_stream_eof;
} parse_context_t;
@ -101,11 +104,15 @@ parser_getc(parse_context_t *ctx, int *c)
}
else
{
ctx->buffer_pos = 0;
ctx->buffer_size = sizeof(ctx->parser_buffer);
if (!ctx->hit_stream_eof)
{
ctx->buffer_pos = 0;
ctx->buffer_size = sizeof(ctx->parser_buffer);
SVN_ERR(svn_stream_read_full(ctx->stream, ctx->parser_buffer,
&(ctx->buffer_size)));
SVN_ERR(svn_stream_read_full(ctx->stream, ctx->parser_buffer,
&(ctx->buffer_size)));
ctx->hit_stream_eof = (ctx->buffer_size != sizeof(ctx->parser_buffer));
}
if (ctx->buffer_pos < ctx->buffer_size)
{
@ -224,8 +231,10 @@ skip_bom(parse_context_t *ctx)
* of the BOM characters into the parse_context_t buffer. This can
* safely be assumed as long as we only try to use skip_bom() at the
* start of the stream and the buffer is longer than 3 characters. */
SVN_ERR_ASSERT(ctx->buffer_size > ctx->buffer_pos + 1);
if (buf[ctx->buffer_pos] == 0xBB && buf[ctx->buffer_pos + 1] == 0xBF)
SVN_ERR_ASSERT(ctx->buffer_size > ctx->buffer_pos + 1 ||
ctx->hit_stream_eof);
if (ctx->buffer_size > ctx->buffer_pos + 1 &&
buf[ctx->buffer_pos] == 0xBB && buf[ctx->buffer_pos + 1] == 0xBF)
ctx->buffer_pos += 2;
else
SVN_ERR(parser_ungetc(ctx, ch));
@ -579,6 +588,7 @@ svn_config__parse_stream(svn_config_t *cfg, svn_stream_t *stream,
ctx->value = svn_stringbuf_create_empty(scratch_pool);
ctx->buffer_pos = 0;
ctx->buffer_size = 0;
ctx->hit_stream_eof = FALSE;
SVN_ERR(skip_bom(ctx));

View File

@ -1484,7 +1484,11 @@ void
svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
#ifdef SVN_HAVE_KEYCHAIN_SERVICES
svn_auth__get_keychain_simple_provider(provider, pool);
#else
svn_auth__get_dummmy_simple_provider(provider, pool);
#endif
}
void
@ -1492,7 +1496,13 @@ svn_auth_get_keychain_ssl_client_cert_pw_provider
(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
#ifdef SVN_HAVE_KEYCHAIN_SERVICES
svn_auth__get_keychain_ssl_client_cert_pw_provider(provider, pool);
#else
/* Not really the right type of dummy provider, but doesn't throw NULL
errors as just returning NULL would */
svn_auth__get_dummmy_simple_provider(provider, pool);
#endif
}
#endif /* DARWIN */

View File

@ -233,6 +233,7 @@ find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
{
char *buffer;
char *gpg_agent_info = NULL;
char *gnupghome = NULL;
const char *socket_name = NULL;
const char *request = NULL;
const char *p = NULL;
@ -243,10 +244,9 @@ find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
/* This implements the method of finding the socket as described in
* the gpg-agent man page under the --use-standard-socket option.
* The manage page misleadingly says the standard socket is
* "named 'S.gpg-agent' located in the home directory." The standard
* socket path is actually in the .gnupg directory in the home directory,
* i.e. ~/.gnupg/S.gpg-agent */
* The manage page says the standard socket is "named 'S.gpg-agent' located
* in the home directory." GPG's home directory is either the directory
* specified by $GNUPGHOME or ~/.gnupg. */
gpg_agent_info = getenv("GPG_AGENT_INFO");
if (gpg_agent_info != NULL)
{
@ -259,6 +259,11 @@ find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
pool);
socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
}
else if ((gnupghome = getenv("GNUPGHOME")) != NULL)
{
const char *homedir = svn_dirent_canonicalize(gnupghome, pool);
socket_name = svn_dirent_join(homedir, "S.gpg-agent", pool);
}
else
{
const char *homedir = svn_user_get_homedir(pool);
@ -611,11 +616,10 @@ simple_gpg_agent_next_creds(void **credentials,
return SVN_NO_ERROR;
}
bye_gpg_agent(sd);
if (strncmp(buffer, "OK\n", 3) != 0)
{
bye_gpg_agent(sd);
return SVN_NO_ERROR;
}
return SVN_NO_ERROR;
/* TODO: This attempt limit hard codes it at 3 attempts (or 2 retries)
* which matches svn command line client's retry_limit as set in

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_subr/token-map.h.
/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_subr/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_INTERNAL_SAVEPOINT_SVN 0

View File

@ -1261,6 +1261,55 @@ reset_all_statements(svn_sqlite__db_t *db,
return err;
}
static svn_error_t *
rollback_transaction(svn_sqlite__db_t *db,
svn_error_t *error_to_wrap)
{
svn_sqlite__stmt_t *stmt;
svn_error_t *err;
err = get_internal_statement(&stmt, db, STMT_INTERNAL_ROLLBACK_TRANSACTION);
if (!err)
{
err = svn_error_trace(svn_sqlite__step_done(stmt));
if (err && err->apr_err == SVN_ERR_SQLITE_BUSY)
{
/* ### Houston, we have a problem!
We are trying to rollback but we can't because some
statements are still busy. This leaves the database
unusable for future transactions as the current transaction
is still open.
As we are returning the actual error as the most relevant
error in the chain, our caller might assume that it can
retry/compensate on this error (e.g. SVN_WC_LOCKED), while
in fact the SQLite database is unusable until the statements
started within this transaction are reset and the transaction
aborted.
We try to compensate by resetting all prepared but unreset
statements; but we leave the busy error in the chain anyway to
help diagnosing the original error and help in finding where
a reset statement is missing. */
err = svn_error_trace(reset_all_statements(db, err));
err = svn_error_compose_create(
svn_error_trace(svn_sqlite__step_done(stmt)),
err);
}
}
if (err)
{
/* Rollback failed, use a specific error code. */
err = svn_error_create(SVN_SQLITE__ERR_ROLLBACK_FAILED, err,
_("SQLite transaction rollback failed"));
}
return svn_error_compose_create(error_to_wrap, err);
}
svn_error_t *
svn_sqlite__begin_transaction(svn_sqlite__db_t *db)
{
@ -1303,46 +1352,37 @@ svn_sqlite__finish_transaction(svn_sqlite__db_t *db,
/* Commit or rollback the sqlite transaction. */
if (err)
{
svn_error_t *err2;
return svn_error_trace(rollback_transaction(db, err));
}
else
{
err = get_internal_statement(&stmt, db,
STMT_INTERNAL_COMMIT_TRANSACTION);
if (!err)
err = svn_error_trace(svn_sqlite__step_done(stmt));
err2 = get_internal_statement(&stmt, db,
STMT_INTERNAL_ROLLBACK_TRANSACTION);
if (!err2)
err2 = svn_sqlite__step_done(stmt);
/* Need to rollback if the commit fails as well, because otherwise the
db connection will be left in an unusable state.
if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
{
/* ### Houston, we have a problem!
One important case to keep in mind is trying to COMMIT with concurrent
readers. In case the commit fails, because someone else is holding a
shared lock, sqlite keeps the transaction, and *also* keeps the file
locks on the database. While the first part only prevents from using
this connection, the second part prevents everyone else from accessing
the database while the connection is open.
We are trying to rollback but we can't because some
statements are still busy. This leaves the database
unusable for future transactions as the current transaction
is still open.
See https://www.sqlite.org/lang_transaction.html
As we are returning the actual error as the most relevant
error in the chain, our caller might assume that it can
retry/compensate on this error (e.g. SVN_WC_LOCKED), while
in fact the SQLite database is unusable until the statements
started within this transaction are reset and the transaction
aborted.
We try to compensate by resetting all prepared but unreset
statements; but we leave the busy error in the chain anyway to
help diagnosing the original error and help in finding where
a reset statement is missing. */
err2 = reset_all_statements(db, err2);
err2 = svn_error_compose_create(
svn_sqlite__step_done(stmt),
err2);
}
return svn_error_compose_create(err,
err2);
COMMIT might also result in an SQLITE_BUSY return code if an another
thread or process has a shared lock on the database that prevented
the database from being updated. When COMMIT fails in this way, the
transaction remains active and the COMMIT can be retried later after
the reader has had a chance to clear. */
if (err)
return svn_error_trace(rollback_transaction(db, err));
}
SVN_ERR(get_internal_statement(&stmt, db, STMT_INTERNAL_COMMIT_TRANSACTION));
return svn_error_trace(svn_sqlite__step_done(stmt));
return SVN_NO_ERROR;
}
svn_error_t *
@ -1359,18 +1399,22 @@ svn_sqlite__finish_savepoint(svn_sqlite__db_t *db,
STMT_INTERNAL_ROLLBACK_TO_SAVEPOINT_SVN);
if (!err2)
err2 = svn_sqlite__step_done(stmt);
if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
{
/* Ok, we have a major problem. Some statement is still open, which
makes it impossible to release this savepoint.
err2 = svn_error_trace(svn_sqlite__step_done(stmt));
### See huge comment in svn_sqlite__finish_transaction for
further details */
if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
{
/* Ok, we have a major problem. Some statement is still open,
which makes it impossible to release this savepoint.
err2 = reset_all_statements(db, err2);
err2 = svn_error_compose_create(svn_sqlite__step_done(stmt), err2);
### See huge comment in svn_sqlite__finish_transaction for
further details */
err2 = svn_error_trace(reset_all_statements(db, err2));
err2 = svn_error_compose_create(
svn_error_trace(svn_sqlite__step_done(stmt)),
err2);
}
}
err = svn_error_compose_create(err, err2);
@ -1378,9 +1422,9 @@ svn_sqlite__finish_savepoint(svn_sqlite__db_t *db,
STMT_INTERNAL_RELEASE_SAVEPOINT_SVN);
if (!err2)
err2 = svn_sqlite__step_done(stmt);
err2 = svn_error_trace(svn_sqlite__step_done(stmt));
return svn_error_trace(svn_error_compose_create(err, err2));
return svn_error_compose_create(err, err2);
}
SVN_ERR(get_internal_statement(&stmt, db,

View File

@ -1143,6 +1143,8 @@ release_name_from_version(const char *osver)
case 8: return "Mountain Lion";
case 9: return "Mavericks";
case 10: return "Yosemite";
case 11: return "El Capitan";
case 12: return "Sierra";
}
return NULL;

View File

@ -53,9 +53,9 @@ HANDLE dbghelp_dll = INVALID_HANDLE_VALUE;
#define LOGFILE_PREFIX "svn-crash-log"
#if defined(_M_IX86)
#define FORMAT_PTR "0x%08x"
#define FORMAT_PTR "0x%08Ix"
#elif defined(_M_X64)
#define FORMAT_PTR "0x%016I64x"
#define FORMAT_PTR "0x%016Ix"
#endif
/*** Code. ***/
@ -171,7 +171,7 @@ write_module_info_callback(void *data,
MINIDUMP_MODULE_CALLBACK module = callback_input->Module;
char *buf = convert_wbcs_to_ansi(module.FullPath);
fprintf(log_file, FORMAT_PTR, module.BaseOfImage);
fprintf(log_file, FORMAT_PTR, (UINT_PTR)module.BaseOfImage);
fprintf(log_file, " %s", buf);
free(buf);
@ -260,18 +260,19 @@ write_process_info(EXCEPTION_RECORD *exception, CONTEXT *context,
#endif
}
/* Formats the value at address based on the specified basic type
* (char, int, long ...). */
/* Writes the value at address based on the specified basic type
* (char, int, long ...) to LOG_FILE. */
static void
format_basic_type(char *buf, DWORD basic_type, DWORD64 length, void *address)
write_basic_type(FILE *log_file, DWORD basic_type, DWORD64 length,
void *address)
{
switch(length)
{
case 1:
sprintf(buf, "0x%02x", (int)*(unsigned char *)address);
fprintf(log_file, "0x%02x", (int)*(unsigned char *)address);
break;
case 2:
sprintf(buf, "0x%04x", (int)*(unsigned short *)address);
fprintf(log_file, "0x%04x", (int)*(unsigned short *)address);
break;
case 4:
switch(basic_type)
@ -279,38 +280,38 @@ format_basic_type(char *buf, DWORD basic_type, DWORD64 length, void *address)
case 2: /* btChar */
{
if (!IsBadStringPtr(*(PSTR*)address, 32))
sprintf(buf, "\"%.31s\"", *(const char **)address);
fprintf(log_file, "\"%.31s\"", *(const char **)address);
else
sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
fprintf(log_file, FORMAT_PTR, *(DWORD_PTR *)address);
}
case 6: /* btInt */
sprintf(buf, "%d", *(int *)address);
fprintf(log_file, "%d", *(int *)address);
break;
case 8: /* btFloat */
sprintf(buf, "%f", *(float *)address);
fprintf(log_file, "%f", *(float *)address);
break;
default:
sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
fprintf(log_file, FORMAT_PTR, *(DWORD_PTR *)address);
break;
}
break;
case 8:
if (basic_type == 8) /* btFloat */
sprintf(buf, "%lf", *(double *)address);
fprintf(log_file, "%lf", *(double *)address);
else
sprintf(buf, "0x%016I64X", *(unsigned __int64 *)address);
fprintf(log_file, "0x%016I64X", *(unsigned __int64 *)address);
break;
default:
sprintf(buf, "[unhandled type 0x%08x of length " FORMAT_PTR "]",
basic_type, length);
fprintf(log_file, "[unhandled type 0x%08x of length " FORMAT_PTR "]",
basic_type, (UINT_PTR)length);
break;
}
}
/* Formats the value at address based on the type (pointer, user defined,
* basic type). */
/* Writes the value at address based on the type (pointer, user defined,
* basic type) to LOG_FILE. */
static void
format_value(char *value_str, DWORD64 mod_base, DWORD type, void *value_addr)
write_value(FILE *log_file, DWORD64 mod_base, DWORD type, void *value_addr)
{
DWORD tag = 0;
int ptr = 0;
@ -340,19 +341,19 @@ format_value(char *value_str, DWORD64 mod_base, DWORD type, void *value_addr)
LocalFree(type_name_wbcs);
if (ptr == 0)
sprintf(value_str, "(%s) " FORMAT_PTR,
type_name, (DWORD_PTR *)value_addr);
fprintf(log_file, "(%s) " FORMAT_PTR,
type_name, (UINT_PTR)(DWORD_PTR *)value_addr);
else if (ptr == 1)
sprintf(value_str, "(%s *) " FORMAT_PTR,
fprintf(log_file, "(%s *) " FORMAT_PTR,
type_name, *(DWORD_PTR *)value_addr);
else
sprintf(value_str, "(%s **) " FORMAT_PTR,
fprintf(log_file, "(%s **) " FORMAT_PTR,
type_name, *(DWORD_PTR *)value_addr);
free(type_name);
}
else
sprintf(value_str, "[no symbol tag]");
fprintf(log_file, "[no symbol tag]");
}
break;
case 16: /* SymTagBaseType */
@ -364,27 +365,27 @@ format_value(char *value_str, DWORD64 mod_base, DWORD type, void *value_addr)
/* print a char * as a string */
if (ptr == 1 && length == 1)
{
sprintf(value_str, FORMAT_PTR " \"%s\"",
fprintf(log_file, FORMAT_PTR " \"%s\"",
*(DWORD_PTR *)value_addr, *(const char **)value_addr);
}
else if (ptr >= 1)
{
sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
fprintf(log_file, FORMAT_PTR, *(DWORD_PTR *)value_addr);
}
else if (SymGetTypeInfo_(proc, mod_base, type, TI_GET_BASETYPE, &bt))
{
format_basic_type(value_str, bt, length, value_addr);
write_basic_type(log_file, bt, length, value_addr);
}
}
break;
case 12: /* SymTagEnum */
sprintf(value_str, "%d", *(DWORD_PTR *)value_addr);
fprintf(log_file, "%d", *(DWORD_PTR *)value_addr);
break;
case 13: /* SymTagFunctionType */
sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
fprintf(log_file, FORMAT_PTR, *(DWORD_PTR *)value_addr);
break;
default:
sprintf(value_str, "[unhandled tag: %d]", tag);
fprintf(log_file, "[unhandled tag: %d]", tag);
break;
}
}
@ -408,7 +409,6 @@ write_var_values(PSYMBOL_INFO sym_info, ULONG sym_size, void *baton)
FILE *log_file = ((symbols_baton_t*)baton)->log_file;
int nr_of_frame = ((symbols_baton_t*)baton)->nr_of_frame;
BOOL log_params = ((symbols_baton_t*)baton)->log_params;
char value_str[256] = "";
/* get the variable's data */
if (sym_info->Flags & SYMFLAG_REGREL)
@ -422,21 +422,21 @@ write_var_values(PSYMBOL_INFO sym_info, ULONG sym_size, void *baton)
if (log_params && sym_info->Flags & SYMFLAG_PARAMETER)
{
if (last_nr_of_frame == nr_of_frame)
fprintf(log_file, ", ", 2);
fprintf(log_file, ", ");
else
last_nr_of_frame = nr_of_frame;
format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
fprintf(log_file, "%.*s=%s", (int)sym_info->NameLen, sym_info->Name,
value_str);
fprintf(log_file, "%.*s=", (int)sym_info->NameLen, sym_info->Name);
write_value(log_file, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
}
if (!log_params && sym_info->Flags & SYMFLAG_LOCAL)
{
format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
fprintf(log_file, " %.*s = %s\n", (int)sym_info->NameLen,
sym_info->Name, value_str);
fprintf(log_file, " %.*s = ", (int)sym_info->NameLen,
sym_info->Name);
write_value(log_file, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
fprintf(log_file, "\n");
}
return TRUE;

View File

@ -46,6 +46,14 @@
#error Expat is unusable -- it has been compiled for wide characters
#endif
#ifndef XML_VERSION_AT_LEAST
#define XML_VERSION_AT_LEAST(major,minor,patch) \
(((major) < XML_MAJOR_VERSION) \
|| ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION) \
|| ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
(patch) <= XML_MICRO_VERSION))
#endif /* XML_VERSION_AT_LEAST */
const char *
svn_xml__compiled_version(void)
{
@ -361,6 +369,28 @@ static void expat_data_handler(void *userData, const XML_Char *s, int len)
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
}
#if XML_VERSION_AT_LEAST(1, 95, 8)
static void expat_entity_declaration(void *userData,
const XML_Char *entityName,
int is_parameter_entity,
const XML_Char *value,
int value_length,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
const XML_Char *notationName)
{
svn_xml_parser_t *svn_parser = userData;
/* Stop the parser if an entity declaration is hit. */
XML_StopParser(svn_parser->parser, 0 /* resumable */);
}
#else
/* A noop default_handler. */
static void expat_default_handler(void *userData, const XML_Char *s, int len)
{
}
#endif
/*** Making a parser. ***/
@ -382,6 +412,12 @@ svn_xml_make_parser(void *baton,
XML_SetCharacterDataHandler(parser,
data_handler ? expat_data_handler : NULL);
#if XML_VERSION_AT_LEAST(1, 95, 8)
XML_SetEntityDeclHandler(parser, expat_entity_declaration);
#else
XML_SetDefaultHandler(parser, expat_default_handler);
#endif
/* ### we probably don't want this pool; or at least we should pass it
### to the callbacks and clear it periodically. */
subpool = svn_pool_create(pool);
@ -463,6 +499,9 @@ void svn_xml_signal_bailout(svn_error_t *error,
/* This will cause the current XML_Parse() call to finish quickly! */
XML_SetElementHandler(svn_parser->parser, NULL, NULL);
XML_SetCharacterDataHandler(svn_parser->parser, NULL);
#if XML_VERSION_AT_LEAST(1, 95, 8)
XML_SetEntityDeclHandler(svn_parser->parser, NULL);
#endif
/* Once outside of XML_Parse(), the existence of this field will
cause svn_delta_parse()'s main read-loop to return error. */

View File

@ -1622,7 +1622,14 @@ build_text_conflict_resolve_items(svn_skel_t **work_items,
}
case svn_wc_conflict_choose_mine_full:
{
install_from_abspath = mine_abspath;
/* In case of selecting to resolve the conflict choosing the full
own file, allow the text conflict resolution to just take the
existing local file if no merged file was present (case: binary
file conflicts do not generate a locally merge file).
*/
install_from_abspath = mine_abspath
? mine_abspath
: local_abspath;
break;
}
case svn_wc_conflict_choose_theirs_conflict:
@ -1633,6 +1640,15 @@ build_text_conflict_resolve_items(svn_skel_t **work_items,
? svn_diff_conflict_display_latest
: svn_diff_conflict_display_modified;
if (mine_abspath == NULL)
return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
_("Conflict on '%s' cannot be resolved to "
"'theirs-conflict' or 'mine-conflict' "
"because a merged version of the file "
"cannot be created."),
svn_dirent_local_style(local_abspath,
scratch_pool));
SVN_ERR(merge_showing_conflicts(&install_from_abspath,
db, local_abspath,
style, merge_options,

View File

@ -2883,10 +2883,7 @@ absent_node(const char *path,
if (pb->skip_this)
return SVN_NO_ERROR;
SVN_ERR(mark_directory_edited(pb, scratch_pool));
local_abspath = svn_dirent_join(pb->local_abspath, name, scratch_pool);
/* If an item by this name is scheduled for addition that's a
genuine tree-conflict. */
err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
@ -2906,6 +2903,10 @@ absent_node(const char *path,
kind = svn_node_unknown;
}
if (status != svn_wc__db_status_server_excluded)
SVN_ERR(mark_directory_edited(pb, scratch_pool));
/* Else fall through as we should update the revision anyway */
if (status == svn_wc__db_status_normal)
{
svn_boolean_t wcroot;
@ -2929,31 +2930,53 @@ absent_node(const char *path,
}
else
{
/* The server asks us to replace a file external
(Existing BASE node; not reported by the working copy crawler or
there would have been a delete_entry() call.
svn_boolean_t file_external;
svn_revnum_t revnum;
There is no way we can store this state in the working copy as
the BASE layer is already filled.
SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, &revnum, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
&file_external,
eb->db, local_abspath,
scratch_pool, scratch_pool));
We could error out, but that is not helping anybody; the user is not
even seeing with what the file external would be replaced, so let's
report a skip and continue the update.
*/
if (eb->notify_func)
if (file_external)
{
svn_wc_notify_t *notify;
notify = svn_wc_create_notify(
/* The server asks us to replace a file external
(Existing BASE node; not reported by the working copy crawler
or there would have been a delete_entry() call.
There is no way we can store this state in the working copy as
the BASE layer is already filled.
We could error out, but that is not helping anybody; the user is not
even seeing with what the file external would be replaced, so let's
report a skip and continue the update.
*/
if (eb->notify_func)
{
svn_wc_notify_t *notify;
notify = svn_wc_create_notify(
local_abspath,
svn_wc_notify_update_skip_obstruction,
scratch_pool);
eb->notify_func(eb->notify_baton, notify, scratch_pool);
}
eb->notify_func(eb->notify_baton, notify, scratch_pool);
}
svn_pool_destroy(scratch_pool);
return SVN_NO_ERROR;
svn_pool_destroy(scratch_pool);
return SVN_NO_ERROR;
}
else
{
/* We have a normal local node that will now be hidden for the
user. Let's try to delete what is there. This may introduce
tree conflicts if there are local changes */
SVN_ERR(delete_entry(path, revnum, pb, scratch_pool));
/* delete_entry() promises that BASE is empty after the operation,
so we can just fall through now */
}
}
}
else if (status == svn_wc__db_status_not_present

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_wc/token-map.h.
/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_VERIFICATION_TRIGGERS 0

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_wc/token-map.h.
/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_CREATE_SCHEMA 0

View File

@ -1,4 +1,4 @@
/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.9.4/subversion/libsvn_wc/token-map.h.
/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_SELECT_NODE_INFO 0

View File

@ -764,7 +764,7 @@ print_info_item_revision(svn_revnum_t rev, const char *target_path,
if (target_path)
SVN_ERR(svn_cmdline_printf(pool, "%-10ld %s", rev, target_path));
else
SVN_ERR(svn_cmdline_printf(pool, "%-10ld", rev));
SVN_ERR(svn_cmdline_printf(pool, "%ld", rev));
}
else if (target_path)
SVN_ERR(svn_cmdline_printf(pool, "%-10s %s", "", target_path));

View File

@ -123,6 +123,11 @@ run_merge(svn_boolean_t two_sources_specified,
_("Merge sources must both be "
"either paths or URLs"));
if (svn_path_is_url(targetpath))
return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Merge target '%s' must be a local path "
"but looks like a URL"), targetpath);
if (opt_state->verbose)
SVN_ERR(svn_cmdline_printf(scratch_pool, _("--- Merging\n")));
merge_err = svn_client_merge5(sourcepath1,

View File

@ -3588,6 +3588,7 @@ find_repos(const char *url,
if (hooks_env)
hooks_env = svn_dirent_internal_style(hooks_env, scratch_pool);
SVN_ERR(svn_repos_hooks_setenv(repository->repos, hooks_env, scratch_pool));
repository->hooks_env = apr_pstrdup(result_pool, hooks_env);
return SVN_NO_ERROR;

View File

@ -21,6 +21,8 @@
### Important initial Boot-time options ####################
##############################################################
# rc_debug can't be set here without interferring with rc.subr's setting it
# when the kenv variable rc.debug is set.
#rc_debug="NO" # Set to YES to enable debugging output from rc.d
rc_info="NO" # Enables display of informational messages at boot.
rc_startmsgs="YES" # Show "Starting foo:" messages at boot
@ -672,7 +674,7 @@ devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev
devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to
# apply (must be mounted already, i.e. fstab(5))
devfs_load_rulesets="YES" # Enable to always load the default rulesets
performance_cx_lowest="C2" # Online CPU idle state
performance_cx_lowest="NONE" # Online CPU idle state
performance_cpu_freq="NONE" # Online CPU frequency
economy_cx_lowest="Cmax" # Offline CPU idle state
economy_cpu_freq="NONE" # Offline CPU frequency

View File

@ -1045,6 +1045,7 @@ run_rc_command()
#
check_startmsgs && echo "Starting ${name}."
if [ -n "$_chroot" ]; then
_cd=
_doit="\
${_nice:+nice -n $_nice }\
${_fib:+setfib -F $_fib }\
@ -1052,8 +1053,8 @@ ${_env:+env $_env }\
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
$_chroot $command $rc_flags $command_args"
else
_cd="${_chdir:+cd $_chdir && }"
_doit="\
${_chdir:+cd $_chdir && }\
${_fib:+setfib -F $_fib }\
${_env:+env $_env }\
$command $rc_flags $command_args"
@ -1072,7 +1073,7 @@ $command $rc_flags $command_args"
fi
# Prepend default limits
_doit="limits -C $_login_class $_doit"
_doit="$_cd limits -C $_login_class $_doit"
# run the full command
#
@ -2119,6 +2120,13 @@ _echoonce()
esac
}
# If the loader env variable rc.debug is set, turn on debugging. rc.conf will
# still override this, but /etc/defaults/rc.conf can't unconditionally set this
# since it would undo what we've done here.
if kenv -q rc.debug > /dev/null ; then
rc_debug=YES
fi
fi # [ -z "${_rc_subr_loaded}" ]
_rc_subr_loaded=:

View File

@ -108,7 +108,7 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh
PARAM_H= ${SYSDIR}/sys/param.h
MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh
SYMLINKS+= ${INCLUDEDIR} ${LIBDIR}/include
SYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include
osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \

View File

@ -66,7 +66,7 @@ typedef ___wchar_t wchar_t;
#ifndef __CLANG_MAX_ALIGN_T_DEFINED
typedef __max_align_t max_align_t;
#define __CLANG_MAX_ALIGN_T_DEFINED
#define __GCC_MAX_ALIGN_T
#define _GCC_MAX_ALIGN_T
#endif
#endif

View File

@ -71,8 +71,10 @@ TESTS_SRCS= \
test_compat_lzop.c \
test_compat_mac.c \
test_compat_pax_libarchive_2x.c \
test_compat_perl_archive_tar.c \
test_compat_solaris_tar_acl.c \
test_compat_solaris_pax_sparse.c \
test_compat_star_acl_posix1e.c \
test_compat_tar_hardlink.c \
test_compat_uudecode.c \
test_compat_uudecode_large.c \
@ -321,6 +323,7 @@ ${PACKAGE}FILES+= test_compat_bzip2_1.tbz.uu
${PACKAGE}FILES+= test_compat_bzip2_2.tbz.uu
${PACKAGE}FILES+= test_compat_cpio_1.cpio.uu
${PACKAGE}FILES+= test_compat_gtar_1.tar.uu
${PACKAGE}FILES+= test_compat_gtar_2.tar.uu
${PACKAGE}FILES+= test_compat_gzip_1.tgz.uu
${PACKAGE}FILES+= test_compat_gzip_2.tgz.uu
${PACKAGE}FILES+= test_compat_lz4_1.tar.lz4.uu
@ -346,9 +349,11 @@ ${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_solaris_pax_sparse_1.pax.Z.uu
${PACKAGE}FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu
${PACKAGE}FILES+= test_compat_solaris_tar_acl.tar.uu
${PACKAGE}FILES+= test_compat_star_acl_posix1e.tar.uu
${PACKAGE}FILES+= test_compat_tar_hardlink_1.tar.uu
${PACKAGE}FILES+= test_compat_uudecode_large.tar.Z.uu
${PACKAGE}FILES+= test_compat_xz_1.txz.uu
@ -490,6 +495,7 @@ ${PACKAGE}FILES+= test_read_format_rar_sfx.exe.uu
${PACKAGE}FILES+= test_read_format_rar_subblock.rar.uu
${PACKAGE}FILES+= test_read_format_rar_unicode.rar.uu
${PACKAGE}FILES+= test_read_format_rar_windows.rar.uu
${PACKAGE}FILES+= test_read_format_raw.bufr.uu
${PACKAGE}FILES+= test_read_format_raw.data.Z.uu
${PACKAGE}FILES+= test_read_format_raw.data.uu
${PACKAGE}FILES+= test_read_format_tar_concatenated.tar.uu

View File

@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 1, 2016
.Dd December 2, 2016
.Dt THR_SET_NAME 2
.Os
.Sh NAME
@ -43,37 +43,34 @@
.Sh DESCRIPTION
The
.Fn thr_set_name
sets the user-visible name for the kernel thread with the identifier
system call sets the user-visible name for the thread with the identifier
.Va id
in the current process, to the NUL-terminated string
in the current process to the NUL-terminated string
.Va name .
The name will be silently truncated to fit into a buffer of
.Dv MAXCOMLEN + 1
bytes.
The thread name can be seen in the output of the
.Xr ps 1
and
.Xr top 1
commands, in the kernel debuggers and kernel tracing facility outputs,
also in userland debuggers and program core files, as notes.
and in userland debuggers and program core files, as notes.
.Sh RETURN VALUES
If successful,
.Fn thr_set_name
will return zero, otherwise \-1 is returned, and
returns zero; otherwise, \-1 is returned, and
.Va errno
is set to indicate the error.
.Sh ERRORS
The
.Fn thr_set_name
operation may return the following errors:
system call may return the following errors:
.Bl -tag -width Er
.It Bq Er EFAULT
The memory pointed to by the
.Fa name
argument is not valid.
.It Bq Er ENAMETOOLONG
The string pointed to by the
.Fa name
argument exceeds
.Dv MAXCOMLEN + 1
bytes in length.
.It Bq Er ESRCH
The thread with the identifier
.Fa id
@ -92,6 +89,6 @@ does not exist in the current process.
.Xr ktr 9
.Sh STANDARDS
The
.Fn thr_new
system call is non-standard and is used by
.Fn thr_set_name
system call is non-standard and is used by the
.Lb libthr .

View File

@ -68,6 +68,9 @@ LIBADD.timer_create_test+= rt
.include "../Makefile.netbsd-tests"
SRCS.mlock_test+= mlock_helper.c
SRCS.setrlimit_test+= mlock_helper.c
.if ${COMPILER_TYPE} == "gcc"
WARNS?= 3
.else

View File

@ -0,0 +1,114 @@
/*-
* Copyright (C) 2016 Bryan Drewery <bdrewery@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 AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Helper for mlock(3) to avoid EAGAIN errors
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/sysctl.h>
#include <atf-c.h>
#include <errno.h>
#include <stdio.h>
#include <limits.h>
#define VM_MAX_WIRED "vm.max_wired"
static void
vm_max_wired_sysctl(int *old_value, int *new_value)
{
size_t old_len;
size_t new_len = (new_value == NULL ? 0 : sizeof(int));
if (old_value == NULL)
printf("Setting the new value to %d\n", *new_value);
else {
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
}
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
if (old_value != NULL)
printf("Saved the old value (%d)\n", *old_value);
}
void
set_vm_max_wired(int new_value)
{
FILE *fp;
int old_value;
fp = fopen(VM_MAX_WIRED, "w");
if (fp == NULL) {
atf_tc_skip("could not open %s for writing: %s",
VM_MAX_WIRED, strerror(errno));
return;
}
vm_max_wired_sysctl(&old_value, NULL);
ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0,
"saving %s failed", VM_MAX_WIRED);
fclose(fp);
vm_max_wired_sysctl(NULL, &new_value);
}
void
restore_vm_max_wired(void)
{
FILE *fp;
int saved_max_wired;
fp = fopen(VM_MAX_WIRED, "r");
if (fp == NULL) {
perror("fopen failed\n");
return;
}
if (fscanf(fp, "%d", &saved_max_wired) != 1) {
perror("fscanf failed\n");
fclose(fp);
return;
}
fclose(fp);
printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired);
if (saved_max_wired == 0) /* This will cripple the test host */
return;
vm_max_wired_sysctl(NULL, &saved_max_wired);
}

View File

@ -94,12 +94,12 @@ caph_limit_stdout(void)
static __inline int
caph_limit_stdio(void)
{
const int iebadf = CAPH_IGNORE_EBADF;
if (caph_limit_stdin() == -1 || caph_limit_stdout() == -1 ||
caph_limit_stderr() == -1) {
if (caph_limit_stream(STDIN_FILENO, CAPH_READ | iebadf) == -1 ||
caph_limit_stream(STDOUT_FILENO, CAPH_WRITE | iebadf) == -1 ||
caph_limit_stream(STDERR_FILENO, CAPH_WRITE | iebadf) == -1)
return (-1);
}
return (0);
}

View File

@ -204,7 +204,7 @@ dos_mount(DOS_FS *fs, struct open_file *fd)
if (buf != NULL)
free(buf);
(void)dosunmount(fs);
return(err);
return (err);
}
free(buf);
@ -219,7 +219,7 @@ dos_mount(DOS_FS *fs, struct open_file *fd)
fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff;
fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff;
}
return 0;
return (0);
}
/*
@ -231,10 +231,10 @@ dos_unmount(DOS_FS *fs)
int err;
if (fs->links)
return(EBUSY);
return (EBUSY);
if ((err = dosunmount(fs)))
return(err);
return 0;
return (err);
return (0);
}
/*
@ -244,7 +244,7 @@ static int
dosunmount(DOS_FS *fs)
{
free(fs);
return(0);
return (0);
}
/*
@ -285,7 +285,7 @@ dos_open(const char *path, struct open_file *fd)
fd->f_fsdata = (void *)f;
out:
return(err);
return (err);
}
/*
@ -307,7 +307,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid)
twiddle(4);
nb = (u_int)nbyte;
if ((size = fsize(f->fs, &f->de)) == -1)
return EINVAL;
return (EINVAL);
if (nb > (n = size - f->offset))
nb = n;
off = f->offset;
@ -344,7 +344,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid)
out:
if (resid)
*resid = nbyte - nb + cnt;
return(err);
return (err);
}
/*
@ -370,16 +370,16 @@ dos_seek(struct open_file *fd, off_t offset, int whence)
break;
default:
errno = EINVAL;
return(-1);
return (-1);
}
off += offset;
if (off < 0 || off > size) {
errno = EINVAL;
return(-1);
return (-1);
}
f->offset = (u_int)off;
f->c = 0;
return(off);
return (off);
}
/*
@ -394,7 +394,7 @@ dos_close(struct open_file *fd)
f->fs->links--;
free(f);
dos_unmount(fs);
return 0;
return (0);
}
/*
@ -411,7 +411,7 @@ dos_stat(struct open_file *fd, struct stat *sb)
sb->st_uid = 0;
sb->st_gid = 0;
if ((sb->st_size = fsize(f->fs, &f->de)) == -1)
return EINVAL;
return (EINVAL);
return (0);
}
@ -501,7 +501,7 @@ dos_readdir(struct open_file *fd, struct dirent *d)
d->d_reclen = sizeof(*d);
d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG;
memcpy(d->d_name, fn, sizeof(d->d_name));
return(0);
return (0);
}
/*
@ -516,41 +516,41 @@ parsebs(DOS_FS *fs, DOS_BS *bs)
bs->jmp[0] != 0xe9 &&
(bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) ||
bs->bpb.media < 0xf0)
return EINVAL;
return (EINVAL);
if (cv2(bs->bpb.secsiz) != SECSIZ)
return EINVAL;
return (EINVAL);
if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1))
return EINVAL;
return (EINVAL);
fs->bsize = secbyt(fs->spc);
fs->bshift = ffs(fs->bsize) - 1;
if ((fs->spf = cv2(bs->bpb.spf))) {
if (bs->bpb.fats != 2)
return EINVAL;
return (EINVAL);
if (!(fs->dirents = cv2(bs->bpb.dirents)))
return EINVAL;
return (EINVAL);
} else {
if (!(fs->spf = cv4(bs->bpb.lspf)))
return EINVAL;
return (EINVAL);
if (!bs->bpb.fats || bs->bpb.fats > 16)
return EINVAL;
return (EINVAL);
if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS)
return EINVAL;
return (EINVAL);
}
if (!(fs->lsnfat = cv2(bs->bpb.ressec)))
return EINVAL;
return (EINVAL);
fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats;
fs->lsndta = fs->lsndir + entsec(fs->dirents);
if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs)))
return EINVAL;
return (EINVAL);
if (fs->lsndta > sc)
return EINVAL;
return (EINVAL);
if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS)
return EINVAL;
return (EINVAL);
fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32;
sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1;
if (fs->xclus > sc)
fs->xclus = sc;
return 0;
return (0);
}
/*
@ -575,17 +575,17 @@ namede(DOS_FS *fs, const char *path, DOS_DE **dep)
if (!(s = strchr(path, '/')))
s = strchr(path, 0);
if ((n = s - path) > 255)
return ENAMETOOLONG;
return (ENAMETOOLONG);
memcpy(name, path, n);
name[n] = 0;
path = s;
if (!(de->attr & FA_DIR))
return ENOTDIR;
return (ENOTDIR);
if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de)))
return err;
return (err);
}
*dep = de;
return 0;
return (0);
}
/*
@ -604,7 +604,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
for (ent = 0; ent < 2; ent++)
if (!strcasecmp(name, dotstr[ent])) {
*dep = dot + ent;
return 0;
return (0);
}
if (!clus && fs->fatsz == 32)
clus = fs->rdcl;
@ -617,13 +617,13 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
else if (okclus(fs, clus))
lsec = blklsn(fs, clus);
else
return EINVAL;
return (EINVAL);
for (sec = 0; sec < nsec; sec++) {
if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1))))
return err;
return (err);
for (ent = 0; ent < DEPSEC; ent++) {
if (!*dir[ent].de.name)
return ENOENT;
return (ENOENT);
if (*dir[ent].de.name != 0xe5) {
if ((dir[ent].de.attr & FA_MASK) == FA_XDE) {
x = dir[ent].xde.seq;
@ -651,7 +651,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
}
if (ok) {
*dep = &dir[ent].de;
return 0;
return (0);
}
}
}
@ -661,11 +661,11 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
if (!clus)
break;
if ((err = fatget(fs, &clus)))
return err;
return (err);
if (fatend(fs->fatsz, clus))
break;
}
return ENOENT;
return (ENOENT);
}
/*
@ -739,11 +739,11 @@ fsize(DOS_FS *fs, DOS_DE *de)
size = fs->dirents * sizeof(DOS_DE);
else {
if ((n = fatcnt(fs, c)) == -1)
return n;
return (n);
size = blkbyt(fs, n);
}
}
return size;
return (size);
}
/*
@ -756,8 +756,8 @@ fatcnt(DOS_FS *fs, u_int c)
for (n = 0; okclus(fs, c); n++)
if (fatget(fs, &c))
return -1;
return fatend(fs->fatsz, c) ? n : -1;
return (-1);
return (fatend(fs->fatsz, c) ? n : -1);
}
/*
@ -815,7 +815,7 @@ fatget(DOS_FS *fs, u_int *c)
static int
fatend(u_int sz, u_int c)
{
return c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7);
return (c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7));
}
/*
@ -834,7 +834,7 @@ ioread(DOS_FS *fs, u_int offset, void *buf, u_int nbyte)
if ((n = SECSIZ - off) > nbyte)
n = nbyte;
if ((err = ioget(fs->fd, bytsec(offset), off, s, n)))
return err;
return (err);
offset += SECSIZ;
s += n;
nbyte -= n;
@ -842,15 +842,15 @@ ioread(DOS_FS *fs, u_int offset, void *buf, u_int nbyte)
n = nbyte & (SECSIZ - 1);
if (nbyte -= n) {
if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte)))
return err;
return (err);
offset += nbyte;
s += nbyte;
}
if (n) {
if ((err = ioget(fs->fd, bytsec(offset), 0, s, n)))
return err;
return (err);
}
return 0;
return (0);
}
/*

View File

@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$");
/*
* Reliably open and lock a file.
*
* DO NOT, UNDER PAIN OF DEATH, modify this code without first reading the
* revision history and discussing your changes with <des@freebsd.org>.
* Don't be fooled by the code's apparent simplicity; there would be no
* need for this function if it was as easy to get right as you think.
* Please do not modify this code without first reading the revision history
* and discussing your changes with <des@freebsd.org>. Don't be fooled by the
* code's apparent simplicity; there would be no need for this function if it
* was easy to get right.
*/
int
flopen(const char *path, int flags, ...)
@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...)
errno = serrno;
return (-1);
}
#ifdef DONT_EVEN_THINK_ABOUT_IT
/*
* The following change is provided as a specific example to
* avoid.
*/
#if 0
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
serrno = errno;
(void)close(fd);

View File

@ -164,11 +164,12 @@ gr_tmp(int mfd)
int
gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
{
char buf[8192], *end, *line, *p, *q, *r, t;
char *buf, *end, *line, *p, *q, *r, *tmp;
struct group *fgr;
const struct group *sgr;
size_t len;
size_t len, size;
int eof, readlen;
char t;
if (old_gr == NULL && gr == NULL)
return(-1);
@ -186,6 +187,10 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
if (sgr == NULL)
sgr = gr;
/* initialize the buffer */
if ((buf = malloc(size = 1024)) == NULL)
goto err;
eof = 0;
len = 0;
p = q = end = buf;
@ -199,10 +204,16 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
if (q >= end) {
if (eof)
break;
if ((size_t)(q - p) >= sizeof(buf)) {
warnx("group line too long");
errno = EINVAL; /* hack */
goto err;
while ((size_t)(q - p) >= size) {
if ((tmp = realloc(buf, size * 2)) == NULL) {
warnx("group line too long");
goto err;
}
p = tmp + (p - buf);
q = tmp + (q - buf);
end = tmp + (end - buf);
buf = tmp;
size = size * 2;
}
if (p < end) {
q = memmove(buf, p, end -p);
@ -210,7 +221,7 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
} else {
p = q = end = buf;
}
readlen = read(ffd, end, sizeof(buf) - (end -buf));
readlen = read(ffd, end, size - (end - buf));
if (readlen == -1)
goto err;
else
@ -219,7 +230,7 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
break;
end += len;
len = end - buf;
if (len < (ssize_t)sizeof(buf)) {
if (len < size) {
eof = 1;
if (len > 0 && buf[len -1] != '\n')
++len, *end++ = '\n';
@ -281,7 +292,7 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
if (write(tfd, q, end - q) != end - q)
goto err;
q = buf;
readlen = read(ffd, buf, sizeof(buf));
readlen = read(ffd, buf, size);
if (readlen == 0)
break;
else
@ -303,12 +314,12 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
write(tfd, "\n", 1) != 1)
goto err;
done:
if (line != NULL)
free(line);
free(line);
free(buf);
return (0);
err:
if (line != NULL)
free(line);
free(line);
free(buf);
return (-1);
}

View File

@ -427,11 +427,12 @@ pw_make_v7(const struct passwd *pw)
int
pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
{
char buf[8192], *end, *line, *p, *q, *r, t;
char *buf, *end, *line, *p, *q, *r, *tmp;
struct passwd *fpw;
const struct passwd *spw;
size_t len;
size_t len, size;
int eof, readlen;
char t;
if (old_pw == NULL && pw == NULL)
return (-1);
@ -449,6 +450,10 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
if (spw == NULL)
spw = pw;
/* initialize the buffer */
if ((buf = malloc(size = 1024)) == NULL)
goto err;
eof = 0;
len = 0;
p = q = end = buf;
@ -462,10 +467,16 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
if (q >= end) {
if (eof)
break;
if ((size_t)(q - p) >= sizeof(buf)) {
warnx("passwd line too long");
errno = EINVAL; /* hack */
goto err;
while ((size_t)(q - p) >= size) {
if ((tmp = realloc(buf, size * 2)) == NULL) {
warnx("passwd line too long");
goto err;
}
p = tmp + (p - buf);
q = tmp + (q - buf);
end = tmp + (end - buf);
buf = tmp;
size = size * 2;
}
if (p < end) {
q = memmove(buf, p, end - p);
@ -473,7 +484,7 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
} else {
p = q = end = buf;
}
readlen = read(ffd, end, sizeof(buf) - (end - buf));
readlen = read(ffd, end, size - (end - buf));
if (readlen == -1)
goto err;
else
@ -482,7 +493,7 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
break;
end += len;
len = end - buf;
if (len < (ssize_t)sizeof(buf)) {
if (len < size) {
eof = 1;
if (len > 0 && buf[len - 1] != '\n')
++len, *end++ = '\n';
@ -545,7 +556,7 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
if (write(tfd, q, end - q) != end - q)
goto err;
q = buf;
readlen = read(ffd, buf, sizeof(buf));
readlen = read(ffd, buf, size);
if (readlen == 0)
break;
else
@ -567,12 +578,12 @@ pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw)
write(tfd, "\n", 1) != 1)
goto err;
done:
if (line != NULL)
free(line);
free(line);
free(buf);
return (0);
err:
if (line != NULL)
free(line);
free(line);
free(buf);
return (-1);
}

View File

@ -5,13 +5,8 @@ FBSD_1.0 {
};
FBSD_1.3 {
feclearexcept;
fegetexceptflag;
fesetexceptflag;
feraiseexcept;
fetestexcept;
fegetround;
fesetround;
fegetenv;
feholdexcept;
feupdateenv;

View File

@ -5,13 +5,8 @@ FBSD_1.0 {
};
FBSD_1.3 {
feclearexcept;
fegetexceptflag;
fesetexceptflag;
feraiseexcept;
fetestexcept;
fegetround;
fesetround;
fegetenv;
feholdexcept;
feupdateenv;

View File

@ -5,13 +5,8 @@ FBSD_1.0 {
};
FBSD_1.3 {
feclearexcept;
fegetexceptflag;
fesetexceptflag;
feraiseexcept;
fetestexcept;
fegetround;
fesetround;
fegetenv;
feholdexcept;
feupdateenv;

View File

@ -45,7 +45,6 @@ struct Struct_Obj_Entry;
asm volatile("adr %0, _DYNAMIC" : "=&r"(_dynamic_addr)); \
(const Elf_Dyn *)_dynamic_addr; \
})
#define RTLD_IS_DYNAMIC() (1)
Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
const struct Struct_Obj_Entry *defobj,

View File

@ -52,7 +52,6 @@ uint64_t set_gp(struct Struct_Obj_Entry *obj);
__asm __volatile("lla %0, _DYNAMIC" : "=r"(_dynamic_addr)); \
(const Elf_Dyn *)_dynamic_addr; \
})
#define RTLD_IS_DYNAMIC() (1)
Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
const struct Struct_Obj_Entry *defobj,

View File

@ -200,9 +200,6 @@ Elf_Sym sym_zero; /* For resolving undefined weak refs. */
extern Elf_Dyn _DYNAMIC;
#pragma weak _DYNAMIC
#ifndef RTLD_IS_DYNAMIC
#define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL)
#endif
int dlclose(void *) __exported;
char *dlerror(void) __exported;
@ -1920,22 +1917,20 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info)
#ifdef PIC
objtmp.relocbase = mapbase;
#endif
if (RTLD_IS_DYNAMIC()) {
objtmp.dynamic = rtld_dynamic(&objtmp);
digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath);
assert(objtmp.needed == NULL);
objtmp.dynamic = rtld_dynamic(&objtmp);
digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath);
assert(objtmp.needed == NULL);
#if !defined(__mips__)
/* MIPS has a bogus DT_TEXTREL. */
assert(!objtmp.textrel);
/* MIPS has a bogus DT_TEXTREL. */
assert(!objtmp.textrel);
#endif
/*
* Temporarily put the dynamic linker entry into the object list, so
* that symbols can be found.
*/
relocate_objects(&objtmp, true, &objtmp, 0, NULL);
/*
* Temporarily put the dynamic linker entry into the object list, so
* that symbols can be found.
*/
relocate_objects(&objtmp, true, &objtmp, 0, NULL);
}
ehdr = (Elf_Ehdr *)mapbase;
objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff);
objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]);

View File

@ -37,7 +37,6 @@ struct Struct_Obj_Entry;
/* Return the address of the .dynamic section in the dynamic linker. */
Elf_Dyn *rtld_dynamic_addr(void);
#define rtld_dynamic(obj) rtld_dynamic_addr()
#define RTLD_IS_DYNAMIC() (rtld_dynamic_addr() != NULL)
Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr,
const struct Struct_Obj_Entry *,

View File

@ -4,7 +4,7 @@ PACKAGE=runtime
PROG= camcontrol
SRCS= camcontrol.c util.c
.if !defined(RELEASE_CRUNCH)
SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c zone.c
SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c
.else
CFLAGS+= -DMINIMALISTIC
.endif

View File

@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 16, 2016
.Dd November 30, 2016
.Dt CAMCONTROL 8
.Os
.Sh NAME
@ -343,6 +343,11 @@
.Op Fl S Ar power_src
.Op Fl T Ar timer
.Nm
.Ic timestamp
.Op device id
.Op generic args
.Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac
.Nm
.Ic help
.Sh DESCRIPTION
The
@ -2417,6 +2422,54 @@ supports, and a number of parameters about each condition, including
whether it is enabled and what the timer value is.
.El
.El
.It Ic timestamp
Issue REPORT TIMESTAMP or SET TIMESTAMP
.Tn SCSI
commands. Either the
.Fl r
option or the
.Fl s
option must be specified.
.Bl -tag -width 6n
.It Fl r
Report the device's timestamp.
If no more arguments are specified, the timestamp will be reported using
the national representation of the date and time, followed by the time
zone.
.Bl -tag -width 9n
.It Fl f Ar format
Specify the strftime format string, as documented in strftime(3), to be used
to format the reported timestamp.
.It Fl m
Report the timestamp as milliseconds since the epoch.
.It Fl U
Report the timestamp using the national representation of the date and
time, but override the system time zone and use UTC instead.
.El
.El
.Bl -tag -width 6n
.It Fl s
Set the device's timestamp. Either the
.Fl f
and
.Fl T
options or the
.Fl U
option must be specified.
.Bl -tag -width 9n
.It Fl f Ar format
Specify the strptime format string, as documented in strptime(3).
The time must also be specified with the
.Fl T
option.
.It Fl T
Provide the time in the format specified with the
.Fl f
option.
.It Fl U
Set the timestamp to the host system's time in UTC.
.El
.El
.It Ic help
Print out verbose usage information.
.El
@ -2730,6 +2783,18 @@ camcontrol epc ada0 -c list
Display the ATA Power Conditions log (Log Address 0x08) for
drive
.Pa ada0 .
.Pp
.Bd -literal -offset indent
camcontrol timestamp sa0 -s -f "%A %c" \e
-T "Wednesday Wed Oct 26 21:43:57 2016"
.Ed
.Pp
Set the timestamp of drive
.Pa sa0
using a
.Xr strptime 3
format string followed by a time string
that was created using this format string.
.Sh SEE ALSO
.Xr cam 3 ,
.Xr cam_cdbparse 3 ,

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