MFHead@r345677
This commit is contained in:
commit
415e34c4d5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/fuse2/; revision=345679
@ -1906,11 +1906,11 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap
|
||||
/name/ { printf("===> Creating %s-", $$2); next } \
|
||||
/version/ {print $$2; next } ' \
|
||||
${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
|
||||
create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
|
||||
-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
|
||||
-r ${KSTAGEDIR}/${DISTDIR} \
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION}
|
||||
. endfor
|
||||
.endif
|
||||
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
|
||||
@ -1938,24 +1938,24 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne
|
||||
/name/ { printf("===> Creating %s-", $$2); next } \
|
||||
/version/ {print $$2; next } ' \
|
||||
${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
|
||||
create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
|
||||
-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
|
||||
-r ${KSTAGEDIR}/kernel.${_kernel} \
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION}
|
||||
. endfor
|
||||
. endif
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
sign-packages: _pkgbootstrap .PHONY
|
||||
@[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \
|
||||
unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
||||
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \
|
||||
@[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \
|
||||
unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \
|
||||
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \
|
||||
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \
|
||||
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \
|
||||
${PKGSIGNKEY} ; \
|
||||
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI); \
|
||||
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \
|
||||
ln -s ${PKG_VERSION} latest
|
||||
|
||||
#
|
||||
|
5
UPDATING
5
UPDATING
@ -43,6 +43,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
|
||||
prerequisites and upgrading, if you are not already using clang 3.5.0
|
||||
or higher.
|
||||
|
||||
20190226:
|
||||
geom_uzip(4) depends on the new module xz. If geom_uzip is statically
|
||||
compiled into your custom kernel, add 'device xz' statement to the
|
||||
kernel config.
|
||||
|
||||
20190219:
|
||||
drm and drm2 have been removed from the tree. Please see
|
||||
https://wiki.freebsd.org/Graphics for the latest information on
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 12, 2019
|
||||
.Dd March 20, 2019
|
||||
.Dt DATE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -52,13 +52,13 @@
|
||||
.Ar ...
|
||||
.Op Cm + Ns Ar output_fmt
|
||||
.Nm
|
||||
.Op Fl jnu
|
||||
.Op Fl ju
|
||||
.Sm off
|
||||
.Op Oo Oo Oo Oo Ar cc Oc Ar yy Oc Ar mm Oc Ar dd Oc Ar HH
|
||||
.Ar MM Op Ar .ss
|
||||
.Sm on
|
||||
.Nm
|
||||
.Op Fl jnRu
|
||||
.Op Fl jRu
|
||||
.Fl f Ar input_fmt new_date
|
||||
.Op Cm + Ns Ar output_fmt
|
||||
.Nm
|
||||
@ -142,16 +142,6 @@ This allows you to use the
|
||||
flag in addition to the
|
||||
.Cm +
|
||||
option to convert one date format to another.
|
||||
.It Fl n
|
||||
By default, if the
|
||||
.Xr timed 8
|
||||
daemon is running,
|
||||
.Nm
|
||||
sets the time on all of the machines in the local group.
|
||||
The
|
||||
.Fl n
|
||||
option suppresses this behavior and causes the time to be set only on the
|
||||
current machine.
|
||||
.It Fl R
|
||||
Use RFC 2822 date and time output format.
|
||||
This is equivalent to using
|
||||
@ -431,23 +421,6 @@ can be used to parse the output from
|
||||
.Nm
|
||||
and express it in Epoch time.
|
||||
.Sh DIAGNOSTICS
|
||||
Occasionally, when
|
||||
.Xr timed 8
|
||||
synchronizes the time on many hosts, the setting of a new time value may
|
||||
require more than a few seconds.
|
||||
On these occasions,
|
||||
.Nm
|
||||
prints:
|
||||
.Ql Network time being set .
|
||||
The message
|
||||
.Ql Communication error with timed
|
||||
occurs when the communication
|
||||
between
|
||||
.Nm
|
||||
and
|
||||
.Xr timed 8
|
||||
fails.
|
||||
.Pp
|
||||
It is invalid to combine the
|
||||
.Fl I
|
||||
flag with either
|
||||
@ -465,8 +438,7 @@ and exits with an error status.
|
||||
.Xr gettimeofday 2 ,
|
||||
.Xr getutxent 3 ,
|
||||
.Xr strftime 3 ,
|
||||
.Xr strptime 3 ,
|
||||
.Xr timed 8
|
||||
.Xr strptime 3
|
||||
.Rs
|
||||
.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD"
|
||||
.%A R. Gusella
|
||||
@ -478,7 +450,7 @@ The
|
||||
utility is expected to be compatible with
|
||||
.St -p1003.2 .
|
||||
The
|
||||
.Fl d , f , I , j , n , r , t ,
|
||||
.Fl d , f , I , j , r , t ,
|
||||
and
|
||||
.Fl v
|
||||
options are all extensions to the standard.
|
||||
|
@ -72,7 +72,7 @@ static void iso8601_usage(const char *);
|
||||
static void multipleformats(void);
|
||||
static void printdate(const char *);
|
||||
static void printisodate(struct tm *);
|
||||
static void setthetime(const char *, const char *, int, int);
|
||||
static void setthetime(const char *, const char *, int);
|
||||
static void usage(void);
|
||||
|
||||
static const struct iso8601_fmt {
|
||||
@ -92,7 +92,7 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int ch, rflag;
|
||||
bool Iflag, jflag, nflag, Rflag;
|
||||
bool Iflag, jflag, Rflag;
|
||||
const char *format;
|
||||
char buf[1024];
|
||||
char *fmt;
|
||||
@ -107,8 +107,8 @@ main(int argc, char *argv[])
|
||||
fmt = NULL;
|
||||
(void) setlocale(LC_TIME, "");
|
||||
rflag = 0;
|
||||
Iflag = jflag = nflag = Rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1)
|
||||
Iflag = jflag = Rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "f:I::jRr:uv:")) != -1)
|
||||
switch((char)ch) {
|
||||
case 'f':
|
||||
fmt = optarg;
|
||||
@ -132,9 +132,6 @@ main(int argc, char *argv[])
|
||||
case 'j':
|
||||
jflag = 1; /* don't set time */
|
||||
break;
|
||||
case 'n': /* don't set network */
|
||||
nflag = 1;
|
||||
break;
|
||||
case 'R': /* RFC 2822 datetime format */
|
||||
if (Iflag)
|
||||
multipleformats();
|
||||
@ -179,7 +176,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (*argv) {
|
||||
setthetime(fmt, *argv, jflag, nflag);
|
||||
setthetime(fmt, *argv, jflag);
|
||||
++argv;
|
||||
} else if (fmt != NULL)
|
||||
usage();
|
||||
@ -250,7 +247,7 @@ printisodate(struct tm *lt)
|
||||
#define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0'))
|
||||
|
||||
static void
|
||||
setthetime(const char *fmt, const char *p, int jflag, int nflag)
|
||||
setthetime(const char *fmt, const char *p, int jflag)
|
||||
{
|
||||
struct utmpx utx;
|
||||
struct tm *lt;
|
||||
@ -343,20 +340,17 @@ setthetime(const char *fmt, const char *p, int jflag, int nflag)
|
||||
errx(1, "nonexistent time");
|
||||
|
||||
if (!jflag) {
|
||||
/* set the time */
|
||||
if (nflag) {
|
||||
utx.ut_type = OLD_TIME;
|
||||
memset(utx.ut_id, 0, sizeof(utx.ut_id));
|
||||
(void)gettimeofday(&utx.ut_tv, NULL);
|
||||
pututxline(&utx);
|
||||
tv.tv_sec = tval;
|
||||
tv.tv_usec = 0;
|
||||
if (settimeofday(&tv, NULL) != 0)
|
||||
err(1, "settimeofday (timeval)");
|
||||
utx.ut_type = NEW_TIME;
|
||||
(void)gettimeofday(&utx.ut_tv, NULL);
|
||||
pututxline(&utx);
|
||||
}
|
||||
utx.ut_type = OLD_TIME;
|
||||
memset(utx.ut_id, 0, sizeof(utx.ut_id));
|
||||
(void)gettimeofday(&utx.ut_tv, NULL);
|
||||
pututxline(&utx);
|
||||
tv.tv_sec = tval;
|
||||
tv.tv_usec = 0;
|
||||
if (settimeofday(&tv, NULL) != 0)
|
||||
err(1, "settimeofday (timeval)");
|
||||
utx.ut_type = NEW_TIME;
|
||||
(void)gettimeofday(&utx.ut_tv, NULL);
|
||||
pututxline(&utx);
|
||||
|
||||
if ((p = getlogin()) == NULL)
|
||||
p = "???";
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd August 8, 2018
|
||||
.Dd March 26, 2019
|
||||
.Dt DD 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -427,7 +427,8 @@ if necessary, to a 1MiB boundary:
|
||||
.Xr mt 1 ,
|
||||
.Xr recoverdisk 1 ,
|
||||
.Xr tr 1 ,
|
||||
.Xr geom 4
|
||||
.Xr geom 4 ,
|
||||
.Xr trim 8
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
|
@ -35,7 +35,8 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
for (;;) {
|
||||
(void) __syscall(SYS_mmap, NULL, 1, 2, 3, -1, 0x12345678);
|
||||
(void) __syscall(SYS_mmap, NULL, (size_t)1, 2, 3, -1,
|
||||
(off_t)0x12345678);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
@ -33,9 +33,10 @@ _dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, const char *compdir,
|
||||
Dwarf_Error *error, Dwarf_Debug dbg)
|
||||
{
|
||||
Dwarf_LineFile lf;
|
||||
const char *dirname;
|
||||
FILE *filepath;
|
||||
const char *incdir;
|
||||
uint8_t *src;
|
||||
int slen;
|
||||
size_t slen;
|
||||
|
||||
src = *p;
|
||||
|
||||
@ -54,20 +55,33 @@ _dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, const char *compdir,
|
||||
return (DW_DLE_DIR_INDEX_BAD);
|
||||
}
|
||||
|
||||
/* Make full pathname if need. */
|
||||
/* Make a full pathname if needed. */
|
||||
if (*lf->lf_fname != '/') {
|
||||
dirname = compdir;
|
||||
filepath = open_memstream(&lf->lf_fullpath, &slen);
|
||||
if (filepath == NULL) {
|
||||
free(lf);
|
||||
DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
|
||||
return (DW_DLE_MEMORY);
|
||||
}
|
||||
|
||||
if (lf->lf_dirndx > 0)
|
||||
dirname = li->li_incdirs[lf->lf_dirndx - 1];
|
||||
if (dirname != NULL) {
|
||||
slen = strlen(dirname) + strlen(lf->lf_fname) + 2;
|
||||
if ((lf->lf_fullpath = malloc(slen)) == NULL) {
|
||||
free(lf);
|
||||
DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
|
||||
return (DW_DLE_MEMORY);
|
||||
}
|
||||
snprintf(lf->lf_fullpath, slen, "%s/%s", dirname,
|
||||
lf->lf_fname);
|
||||
incdir = li->li_incdirs[lf->lf_dirndx - 1];
|
||||
else
|
||||
incdir = NULL;
|
||||
|
||||
/*
|
||||
* Prepend the compilation directory if the directory table
|
||||
* entry is relative.
|
||||
*/
|
||||
if (incdir == NULL || *incdir != '/')
|
||||
fprintf(filepath, "%s/", compdir);
|
||||
if (incdir != NULL)
|
||||
fprintf(filepath, "%s/", incdir);
|
||||
fprintf(filepath, "%s", lf->lf_fname);
|
||||
if (fclose(filepath) != 0) {
|
||||
free(lf);
|
||||
DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
|
||||
return (DW_DLE_MEMORY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2741,6 +2741,7 @@ dump_flags(struct flag_desc *desc, uint64_t val)
|
||||
}
|
||||
if (val != 0)
|
||||
printf(" unknown (0x%jx)", (uintmax_t)val);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static struct flag_desc dt_flags[] = {
|
||||
@ -3524,7 +3525,6 @@ dump_notes_data(const char *name, uint32_t type, const char *buf, size_t sz)
|
||||
goto unknown;
|
||||
printf(" Features:");
|
||||
dump_flags(note_feature_ctl_flags, ubuf[0]);
|
||||
printf("\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -84,11 +84,11 @@ static struct option strings_longopts[] = {
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
long getcharacter(void);
|
||||
int getcharacter(FILE *, long *);
|
||||
int handle_file(const char *);
|
||||
int handle_elf(const char *, int);
|
||||
int handle_binary(const char *, int);
|
||||
int find_strings(const char *, off_t, off_t);
|
||||
int handle_elf(const char *, FILE *);
|
||||
int handle_binary(const char *, FILE *, size_t);
|
||||
int find_strings(const char *, FILE *, off_t, off_t);
|
||||
void show_version(void);
|
||||
void usage(void);
|
||||
|
||||
@ -190,7 +190,7 @@ main(int argc, char **argv)
|
||||
if (min_len == 0)
|
||||
min_len = 4;
|
||||
if (*argv == NULL)
|
||||
rc = find_strings("{standard input}", 0, 0);
|
||||
rc = find_strings("{standard input}", stdin, 0, 0);
|
||||
else while (*argv != NULL) {
|
||||
if (handle_file(*argv) != 0)
|
||||
rc = 1;
|
||||
@ -202,19 +202,19 @@ main(int argc, char **argv)
|
||||
int
|
||||
handle_file(const char *name)
|
||||
{
|
||||
int fd, rt;
|
||||
FILE *pfile;
|
||||
int rt;
|
||||
|
||||
if (name == NULL)
|
||||
return (1);
|
||||
if (freopen(name, "rb", stdin) == NULL) {
|
||||
pfile = fopen(name, "rb");
|
||||
if (pfile == NULL) {
|
||||
warnx("'%s': %s", name, strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
fd = fileno(stdin);
|
||||
if (fd < 0)
|
||||
return (1);
|
||||
rt = handle_elf(name, fd);
|
||||
rt = handle_elf(name, pfile);
|
||||
fclose(pfile);
|
||||
return (rt);
|
||||
}
|
||||
|
||||
@ -223,15 +223,11 @@ handle_file(const char *name)
|
||||
* treated as a binary file. This would include text file, core dumps ...
|
||||
*/
|
||||
int
|
||||
handle_binary(const char *name, int fd)
|
||||
handle_binary(const char *name, FILE *pfile, size_t size)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
(void)lseek(fd, 0, SEEK_SET);
|
||||
if (!fstat(fd, &buf))
|
||||
return (find_strings(name, 0, buf.st_size));
|
||||
return (1);
|
||||
(void)fseeko(pfile, 0, SEEK_SET);
|
||||
return (find_strings(name, pfile, 0, size));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -241,24 +237,29 @@ handle_binary(const char *name, int fd)
|
||||
* different archs as flat binary files(has to overridden using -a).
|
||||
*/
|
||||
int
|
||||
handle_elf(const char *name, int fd)
|
||||
handle_elf(const char *name, FILE *pfile)
|
||||
{
|
||||
struct stat buf;
|
||||
GElf_Ehdr elfhdr;
|
||||
GElf_Shdr shdr;
|
||||
Elf *elf;
|
||||
Elf_Scn *scn;
|
||||
int rc;
|
||||
int rc, fd;
|
||||
|
||||
rc = 0;
|
||||
fd = fileno(pfile);
|
||||
if (fstat(fd, &buf) < 0)
|
||||
return (1);
|
||||
|
||||
/* If entire file is chosen, treat it as a binary file */
|
||||
if (entire_file)
|
||||
return (handle_binary(name, fd));
|
||||
return (handle_binary(name, pfile, buf.st_size));
|
||||
|
||||
(void)lseek(fd, 0, SEEK_SET);
|
||||
elf = elf_begin(fd, ELF_C_READ, NULL);
|
||||
if (elf_kind(elf) != ELF_K_ELF) {
|
||||
(void)elf_end(elf);
|
||||
return (handle_binary(name, fd));
|
||||
return (handle_binary(name, pfile, buf.st_size));
|
||||
}
|
||||
|
||||
if (gelf_getehdr(elf, &elfhdr) == NULL) {
|
||||
@ -269,7 +270,7 @@ handle_elf(const char *name, int fd)
|
||||
|
||||
if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
|
||||
(void)elf_end(elf);
|
||||
return (handle_binary(name, fd));
|
||||
return (handle_binary(name, pfile, buf.st_size));
|
||||
} else {
|
||||
scn = NULL;
|
||||
while ((scn = elf_nextscn(elf, scn)) != NULL) {
|
||||
@ -277,7 +278,7 @@ handle_elf(const char *name, int fd)
|
||||
continue;
|
||||
if (shdr.sh_type != SHT_NOBITS &&
|
||||
(shdr.sh_flags & SHF_ALLOC) != 0) {
|
||||
rc = find_strings(name, shdr.sh_offset,
|
||||
rc = find_strings(name, pfile, shdr.sh_offset,
|
||||
shdr.sh_size);
|
||||
}
|
||||
}
|
||||
@ -290,51 +291,52 @@ handle_elf(const char *name, int fd)
|
||||
* Retrieves a character from input stream based on the encoding
|
||||
* type requested.
|
||||
*/
|
||||
long
|
||||
getcharacter(void)
|
||||
int
|
||||
getcharacter(FILE *pfile, long *rt)
|
||||
{
|
||||
long rt;
|
||||
int i;
|
||||
char buf[4], c;
|
||||
int i, c;
|
||||
char buf[4];
|
||||
|
||||
rt = EOF;
|
||||
for(i = 0; i < encoding_size; i++) {
|
||||
c = getc(stdin);
|
||||
if (feof(stdin))
|
||||
return (EOF);
|
||||
c = getc(pfile);
|
||||
if (c == EOF)
|
||||
return (-1);
|
||||
buf[i] = c;
|
||||
}
|
||||
|
||||
switch (encoding) {
|
||||
case ENCODING_7BIT:
|
||||
case ENCODING_8BIT:
|
||||
rt = buf[0];
|
||||
*rt = buf[0];
|
||||
break;
|
||||
case ENCODING_16BIT_BIG:
|
||||
rt = (buf[0] << 8) | buf[1];
|
||||
*rt = (buf[0] << 8) | buf[1];
|
||||
break;
|
||||
case ENCODING_16BIT_LITTLE:
|
||||
rt = buf[0] | (buf[1] << 8);
|
||||
break;
|
||||
*rt = buf[0] | (buf[1] << 8);
|
||||
break;
|
||||
case ENCODING_32BIT_BIG:
|
||||
rt = ((long) buf[0] << 24) | ((long) buf[1] << 16) |
|
||||
*rt = ((long) buf[0] << 24) | ((long) buf[1] << 16) |
|
||||
((long) buf[2] << 8) | buf[3];
|
||||
break;
|
||||
case ENCODING_32BIT_LITTLE:
|
||||
rt = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) |
|
||||
*rt = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) |
|
||||
((long) buf[3] << 24);
|
||||
break;
|
||||
default:
|
||||
return (-1);
|
||||
}
|
||||
return (rt);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Input stream stdin is read until the end of file is reached or until
|
||||
* Input stream is read until the end of file is reached or until
|
||||
* the section size is reached in case of ELF files. Contiguous
|
||||
* characters of >= min_size(default 4) will be displayed.
|
||||
*/
|
||||
int
|
||||
find_strings(const char *name, off_t offset, off_t size)
|
||||
find_strings(const char *name, FILE *pfile, off_t offset, off_t size)
|
||||
{
|
||||
off_t cur_off, start_off;
|
||||
char *obuf;
|
||||
@ -347,7 +349,7 @@ find_strings(const char *name, off_t offset, off_t size)
|
||||
return (1);
|
||||
}
|
||||
|
||||
(void)fseeko(stdin, offset, SEEK_SET);
|
||||
(void)fseeko(pfile, offset, SEEK_SET);
|
||||
cur_off = offset;
|
||||
start_off = 0;
|
||||
for (;;) {
|
||||
@ -356,8 +358,7 @@ find_strings(const char *name, off_t offset, off_t size)
|
||||
start_off = cur_off;
|
||||
memset(obuf, 0, min_len + 1);
|
||||
for(i = 0; i < min_len; i++) {
|
||||
c = getcharacter();
|
||||
if (c == EOF && feof(stdin))
|
||||
if (getcharacter(pfile, &c) < 0)
|
||||
goto _exit1;
|
||||
if (PRINTABLE(c)) {
|
||||
obuf[i] = c;
|
||||
@ -399,14 +400,15 @@ find_strings(const char *name, off_t offset, off_t size)
|
||||
if ((offset + size) &&
|
||||
(cur_off >= offset + size))
|
||||
break;
|
||||
c = getcharacter();
|
||||
if (getcharacter(pfile, &c) < 0)
|
||||
break;
|
||||
cur_off += encoding_size;
|
||||
if (encoding == ENCODING_8BIT &&
|
||||
(uint8_t)c > 127) {
|
||||
putchar(c);
|
||||
continue;
|
||||
}
|
||||
if (!PRINTABLE(c) || c == EOF)
|
||||
if (!PRINTABLE(c))
|
||||
break;
|
||||
putchar(c);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ int blake2sp_init( blake2sp_state *S, size_t outlen )
|
||||
return -1;
|
||||
|
||||
for( i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||
if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1;
|
||||
if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;
|
||||
|
||||
S->R->last_node = 1;
|
||||
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
|
||||
@ -112,7 +112,7 @@ int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t
|
||||
return -1;
|
||||
|
||||
for( i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||
if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1;
|
||||
if( blake2sp_init_leaf( S->S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;
|
||||
|
||||
S->R->last_node = 1;
|
||||
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
|
||||
@ -230,7 +230,7 @@ int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void
|
||||
if( keylen > BLAKE2S_KEYBYTES ) return -1;
|
||||
|
||||
for( i = 0; i < PARALLELISM_DEGREE; ++i )
|
||||
if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1;
|
||||
if( blake2sp_init_leaf( S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;
|
||||
|
||||
S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */
|
||||
|
||||
|
@ -1632,6 +1632,51 @@ _archive_entry_acl_text_l(struct archive_entry *entry, int flags,
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Supported file flags on FreeBSD and Mac OS:
|
||||
* sappnd,sappend SF_APPEND
|
||||
* arch,archived SF_ARCHIVED
|
||||
* schg,schange,simmutable SF_IMMUTABLE
|
||||
* sunlnk,sunlink SF_NOUNLINK (FreeBSD only)
|
||||
* uappnd,uappend UF_APPEND
|
||||
* compressed UF_COMPRESSED (Mac OS only)
|
||||
* hidden,uhidden UF_HIDDEN
|
||||
* uchg,uchange,uimmutable UF_IMMUTABLE
|
||||
* nodump UF_NODUMP
|
||||
* uunlnk,uunlink UF_NOUNLINK (FreeBSD only)
|
||||
* offline,uoffline UF_OFFLINE (FreeBSD only)
|
||||
* opaque UF_OPAQUE
|
||||
* rdonly,urdonly,readonly UF_READONLY (FreeBSD only)
|
||||
* reparse,ureparse UF_REPARSE (FreeBSD only)
|
||||
* sparse,usparse UF_SPARSE (FreeBSD only)
|
||||
* system,usystem UF_SYSTEM (FreeBSD only)
|
||||
*
|
||||
* See chflags(2) for more information
|
||||
*
|
||||
* Supported file attributes on Linux:
|
||||
* a append only FS_APPEND_FL sappnd
|
||||
* A no atime updates FS_NOATIME_FL atime
|
||||
* c compress FS_COMPR_FL compress
|
||||
* C no copy on write FS_NOCOW_FL cow
|
||||
* d no dump FS_NODUMP_FL dump
|
||||
* D synchronous directory updates FS_DIRSYNC_FL dirsync
|
||||
* i immutable FS_IMMUTABLE_FL schg
|
||||
* j data journalling FS_JOURNAL_DATA_FL journal
|
||||
* P project hierarchy FS_PROJINHERIT_FL projinherit
|
||||
* s secure deletion FS_SECRM_FL securedeletion
|
||||
* S synchronous updates FS_SYNC_FL sync
|
||||
* t no tail-merging FS_NOTAIL_FL tail
|
||||
* T top of directory hierarchy FS_TOPDIR_FL topdir
|
||||
* u undeletable FS_UNRM_FL undel
|
||||
*
|
||||
* See ioctl_iflags(2) for more information
|
||||
*
|
||||
* Equivalent file flags supported on FreeBSD / Mac OS and Linux:
|
||||
* SF_APPEND FS_APPEND_FL sappnd
|
||||
* SF_IMMUTABLE FS_IMMUTABLE_FL schg
|
||||
* UF_NODUMP FS_NODUMP_FL nodump
|
||||
*/
|
||||
|
||||
static const struct flag {
|
||||
const char *name;
|
||||
const wchar_t *wname;
|
||||
@ -1640,190 +1685,149 @@ static const struct flag {
|
||||
} flags[] = {
|
||||
/* Preferred (shorter) names per flag first, all prefixed by "no" */
|
||||
#ifdef SF_APPEND
|
||||
{ "nosappnd", L"nosappnd", SF_APPEND, 0 },
|
||||
{ "nosappend", L"nosappend", SF_APPEND, 0 },
|
||||
{ "nosappnd", L"nosappnd", SF_APPEND, 0},
|
||||
{ "nosappend", L"nosappend", SF_APPEND, 0},
|
||||
#endif
|
||||
#if defined(FS_APPEND_FL) /* 'a' */
|
||||
{ "nosappnd", L"nosappnd", FS_APPEND_FL, 0 },
|
||||
{ "nosappend", L"nosappend", FS_APPEND_FL, 0 },
|
||||
{ "nosappnd", L"nosappnd", FS_APPEND_FL, 0},
|
||||
{ "nosappend", L"nosappend", FS_APPEND_FL, 0},
|
||||
#elif defined(EXT2_APPEND_FL) /* 'a' */
|
||||
{ "nosappnd", L"nosappnd", EXT2_APPEND_FL, 0 },
|
||||
{ "nosappend", L"nosappend", EXT2_APPEND_FL, 0 },
|
||||
{ "nosappnd", L"nosappnd", EXT2_APPEND_FL, 0},
|
||||
{ "nosappend", L"nosappend", EXT2_APPEND_FL, 0},
|
||||
#endif
|
||||
#ifdef SF_ARCHIVED
|
||||
{ "noarch", L"noarch", SF_ARCHIVED, 0 },
|
||||
{ "noarchived", L"noarchived", SF_ARCHIVED, 0 },
|
||||
{ "noarch", L"noarch", SF_ARCHIVED, 0},
|
||||
{ "noarchived", L"noarchived", SF_ARCHIVED, 0},
|
||||
#endif
|
||||
#ifdef SF_IMMUTABLE
|
||||
{ "noschg", L"noschg", SF_IMMUTABLE, 0 },
|
||||
{ "noschange", L"noschange", SF_IMMUTABLE, 0 },
|
||||
{ "nosimmutable", L"nosimmutable", SF_IMMUTABLE, 0 },
|
||||
{ "noschg", L"noschg", SF_IMMUTABLE, 0},
|
||||
{ "noschange", L"noschange", SF_IMMUTABLE, 0},
|
||||
{ "nosimmutable", L"nosimmutable", SF_IMMUTABLE, 0},
|
||||
#endif
|
||||
#if defined(FS_IMMUTABLE_FL) /* 'i' */
|
||||
{ "noschg", L"noschg", FS_IMMUTABLE_FL, 0 },
|
||||
{ "noschange", L"noschange", FS_IMMUTABLE_FL, 0 },
|
||||
{ "nosimmutable", L"nosimmutable", FS_IMMUTABLE_FL, 0 },
|
||||
{ "noschg", L"noschg", FS_IMMUTABLE_FL, 0},
|
||||
{ "noschange", L"noschange", FS_IMMUTABLE_FL, 0},
|
||||
{ "nosimmutable", L"nosimmutable", FS_IMMUTABLE_FL, 0},
|
||||
#elif defined(EXT2_IMMUTABLE_FL) /* 'i' */
|
||||
{ "noschg", L"noschg", EXT2_IMMUTABLE_FL, 0 },
|
||||
{ "noschange", L"noschange", EXT2_IMMUTABLE_FL, 0 },
|
||||
{ "nosimmutable", L"nosimmutable", EXT2_IMMUTABLE_FL, 0 },
|
||||
{ "noschg", L"noschg", EXT2_IMMUTABLE_FL, 0},
|
||||
{ "noschange", L"noschange", EXT2_IMMUTABLE_FL, 0},
|
||||
{ "nosimmutable", L"nosimmutable", EXT2_IMMUTABLE_FL, 0},
|
||||
#endif
|
||||
#ifdef SF_NOUNLINK
|
||||
{ "nosunlnk", L"nosunlnk", SF_NOUNLINK, 0 },
|
||||
{ "nosunlink", L"nosunlink", SF_NOUNLINK, 0 },
|
||||
#endif
|
||||
#ifdef SF_SNAPSHOT
|
||||
{ "nosnapshot", L"nosnapshot", SF_SNAPSHOT, 0 },
|
||||
{ "nosunlnk", L"nosunlnk", SF_NOUNLINK, 0},
|
||||
{ "nosunlink", L"nosunlink", SF_NOUNLINK, 0},
|
||||
#endif
|
||||
#ifdef UF_APPEND
|
||||
{ "nouappnd", L"nouappnd", UF_APPEND, 0 },
|
||||
{ "nouappend", L"nouappend", UF_APPEND, 0 },
|
||||
{ "nouappnd", L"nouappnd", UF_APPEND, 0},
|
||||
{ "nouappend", L"nouappend", UF_APPEND, 0},
|
||||
#endif
|
||||
#ifdef UF_IMMUTABLE
|
||||
{ "nouchg", L"nouchg", UF_IMMUTABLE, 0 },
|
||||
{ "nouchange", L"nouchange", UF_IMMUTABLE, 0 },
|
||||
{ "nouimmutable", L"nouimmutable", UF_IMMUTABLE, 0 },
|
||||
{ "nouchg", L"nouchg", UF_IMMUTABLE, 0},
|
||||
{ "nouchange", L"nouchange", UF_IMMUTABLE, 0},
|
||||
{ "nouimmutable", L"nouimmutable", UF_IMMUTABLE, 0},
|
||||
#endif
|
||||
#ifdef UF_NODUMP
|
||||
{ "nodump", L"nodump", 0, UF_NODUMP},
|
||||
#endif
|
||||
#if defined(FS_NODUMP_FL) /* 'd' */
|
||||
{ "nodump", L"nodump", 0, FS_NODUMP_FL},
|
||||
#elif defined(EXT2_NODUMP_FL) /* 'd' */
|
||||
#elif defined(EXT2_NODUMP_FL)
|
||||
{ "nodump", L"nodump", 0, EXT2_NODUMP_FL},
|
||||
#endif
|
||||
#ifdef UF_OPAQUE
|
||||
{ "noopaque", L"noopaque", UF_OPAQUE, 0 },
|
||||
{ "noopaque", L"noopaque", UF_OPAQUE, 0},
|
||||
#endif
|
||||
#ifdef UF_NOUNLINK
|
||||
{ "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 },
|
||||
{ "nouunlink", L"nouunlink", UF_NOUNLINK, 0 },
|
||||
{ "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0},
|
||||
{ "nouunlink", L"nouunlink", UF_NOUNLINK, 0},
|
||||
#endif
|
||||
#ifdef UF_COMPRESSED
|
||||
{ "nocompressed",L"nocompressed", UF_COMPRESSED, 0 },
|
||||
/* Mac OS */
|
||||
{ "nocompressed", L"nocompressed", UF_COMPRESSED, 0},
|
||||
#endif
|
||||
#ifdef UF_HIDDEN
|
||||
{ "nohidden", L"nohidden", UF_HIDDEN, 0 },
|
||||
{ "nohidden", L"nohidden", UF_HIDDEN, 0},
|
||||
{ "nouhidden", L"nouhidden", UF_HIDDEN, 0},
|
||||
#endif
|
||||
#if defined(FS_UNRM_FL)
|
||||
{ "nouunlink", L"nouunlink", FS_UNRM_FL, 0},
|
||||
#ifdef UF_OFFLINE
|
||||
{ "nooffline", L"nooffline", UF_OFFLINE, 0},
|
||||
{ "nouoffline", L"nouoffline", UF_OFFLINE, 0},
|
||||
#endif
|
||||
#ifdef UF_READONLY
|
||||
{ "nordonly", L"nordonly", UF_READONLY, 0},
|
||||
{ "nourdonly", L"nourdonly", UF_READONLY, 0},
|
||||
{ "noreadonly", L"noreadonly", UF_READONLY, 0},
|
||||
#endif
|
||||
#ifdef UF_SPARSE
|
||||
{ "nosparse", L"nosparse", UF_SPARSE, 0},
|
||||
{ "nousparse", L"nousparse", UF_SPARSE, 0},
|
||||
#endif
|
||||
#ifdef UF_REPARSE
|
||||
{ "noreparse", L"noreparse", UF_REPARSE, 0},
|
||||
{ "noureparse", L"noureparse", UF_REPARSE, 0},
|
||||
#endif
|
||||
#ifdef UF_SYSTEM
|
||||
{ "nosystem", L"nosystem", UF_SYSTEM, 0},
|
||||
{ "nousystem", L"nousystem", UF_SYSTEM, 0},
|
||||
#endif
|
||||
#if defined(FS_UNRM_FL) /* 'u' */
|
||||
{ "noundel", L"noundel", FS_UNRM_FL, 0},
|
||||
#elif defined(EXT2_UNRM_FL)
|
||||
{ "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0},
|
||||
{ "noundel", L"noundel", EXT2_UNRM_FL, 0},
|
||||
#endif
|
||||
|
||||
#if defined(FS_BTREE_FL)
|
||||
{ "nobtree", L"nobtree", FS_BTREE_FL, 0 },
|
||||
#elif defined(EXT2_BTREE_FL)
|
||||
{ "nobtree", L"nobtree", EXT2_BTREE_FL, 0 },
|
||||
#if defined(FS_COMPR_FL) /* 'c' */
|
||||
{ "nocompress", L"nocompress", FS_COMPR_FL, 0},
|
||||
#elif defined(EXT2_COMPR_FL)
|
||||
{ "nocompress", L"nocompress", EXT2_COMPR_FL, 0},
|
||||
#endif
|
||||
|
||||
#if defined(FS_ECOMPR_FL)
|
||||
{ "nocomperr", L"nocomperr", FS_ECOMPR_FL, 0 },
|
||||
#elif defined(EXT2_ECOMPR_FL)
|
||||
{ "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 },
|
||||
#if defined(FS_NOATIME_FL) /* 'A' */
|
||||
{ "noatime", L"noatime", 0, FS_NOATIME_FL},
|
||||
#elif defined(EXT2_NOATIME_FL)
|
||||
{ "noatime", L"noatime", 0, EXT2_NOATIME_FL},
|
||||
#endif
|
||||
|
||||
#if defined(FS_COMPR_FL) /* 'c' */
|
||||
{ "nocompress", L"nocompress", FS_COMPR_FL, 0 },
|
||||
#elif defined(EXT2_COMPR_FL) /* 'c' */
|
||||
{ "nocompress", L"nocompress", EXT2_COMPR_FL, 0 },
|
||||
#endif
|
||||
|
||||
#if defined(FS_NOATIME_FL) /* 'A' */
|
||||
{ "noatime", L"noatime", 0, FS_NOATIME_FL},
|
||||
#elif defined(EXT2_NOATIME_FL) /* 'A' */
|
||||
{ "noatime", L"noatime", 0, EXT2_NOATIME_FL},
|
||||
#endif
|
||||
|
||||
#if defined(FS_DIRTY_FL)
|
||||
{ "nocompdirty",L"nocompdirty", FS_DIRTY_FL, 0},
|
||||
#elif defined(EXT2_DIRTY_FL)
|
||||
{ "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0},
|
||||
#endif
|
||||
|
||||
#if defined(FS_COMPRBLK_FL)
|
||||
#if defined(FS_NOCOMPR_FL)
|
||||
{ "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, FS_NOCOMPR_FL},
|
||||
#else
|
||||
{ "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, 0},
|
||||
#endif
|
||||
#elif defined(EXT2_COMPRBLK_FL)
|
||||
#if defined(EXT2_NOCOMPR_FL)
|
||||
{ "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL},
|
||||
#else
|
||||
{ "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, 0},
|
||||
#endif
|
||||
#endif
|
||||
#if defined(FS_DIRSYNC_FL)
|
||||
{ "nodirsync", L"nodirsync", FS_DIRSYNC_FL, 0},
|
||||
#if defined(FS_DIRSYNC_FL) /* 'D' */
|
||||
{ "nodirsync", L"nodirsync", FS_DIRSYNC_FL, 0},
|
||||
#elif defined(EXT2_DIRSYNC_FL)
|
||||
{ "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
|
||||
{ "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_INDEX_FL)
|
||||
{ "nohashidx", L"nohashidx", FS_INDEX_FL, 0},
|
||||
#elif defined(EXT2_INDEX_FL)
|
||||
{ "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_IMAGIC_FL)
|
||||
{ "noimagic", L"noimagic", FS_IMAGIC_FL, 0},
|
||||
#elif defined(EXT2_IMAGIC_FL)
|
||||
{ "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_JOURNAL_DATA_FL)
|
||||
{ "nojournal", L"nojournal", FS_JOURNAL_DATA_FL, 0},
|
||||
#if defined(FS_JOURNAL_DATA_FL) /* 'j' */
|
||||
{ "nojournal-data",L"nojournal-data", FS_JOURNAL_DATA_FL, 0},
|
||||
{ "nojournal", L"nojournal", FS_JOURNAL_DATA_FL, 0},
|
||||
#elif defined(EXT3_JOURNAL_DATA_FL)
|
||||
{ "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
|
||||
{ "nojournal-data",L"nojournal-data", EXT3_JOURNAL_DATA_FL, 0},
|
||||
{ "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_SECRM_FL)
|
||||
{ "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL, 0},
|
||||
#if defined(FS_SECRM_FL) /* 's' */
|
||||
{ "nosecdel", L"nosecdel", FS_SECRM_FL, 0},
|
||||
{ "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL, 0},
|
||||
#elif defined(EXT2_SECRM_FL)
|
||||
{ "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
|
||||
{ "nosecdel", L"nosecdel", EXT2_SECRM_FL, 0},
|
||||
{ "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_SYNC_FL)
|
||||
{ "nosync", L"nosync", FS_SYNC_FL, 0},
|
||||
#if defined(FS_SYNC_FL) /* 'S' */
|
||||
{ "nosync", L"nosync", FS_SYNC_FL, 0},
|
||||
#elif defined(EXT2_SYNC_FL)
|
||||
{ "nosync", L"nosync", EXT2_SYNC_FL, 0},
|
||||
{ "nosync", L"nosync", EXT2_SYNC_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_NOTAIL_FL)
|
||||
{ "notail", L"notail", 0, FS_NOTAIL_FL},
|
||||
#if defined(FS_NOTAIL_FL) /* 't' */
|
||||
{ "notail", L"notail", 0, FS_NOTAIL_FL},
|
||||
#elif defined(EXT2_NOTAIL_FL)
|
||||
{ "notail", L"notail", 0, EXT2_NOTAIL_FL},
|
||||
{ "notail", L"notail", 0, EXT2_NOTAIL_FL},
|
||||
#endif
|
||||
#if defined(FS_TOPDIR_FL)
|
||||
{ "notopdir", L"notopdir", FS_TOPDIR_FL, 0},
|
||||
#if defined(FS_TOPDIR_FL) /* 'T' */
|
||||
{ "notopdir", L"notopdir", FS_TOPDIR_FL, 0},
|
||||
#elif defined(EXT2_TOPDIR_FL)
|
||||
{ "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
|
||||
{ "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_ENCRYPT_FL
|
||||
{ "noencrypt", L"noencrypt", FS_ENCRYPT_FL, 0},
|
||||
#ifdef FS_NOCOW_FL /* 'C' */
|
||||
{ "nocow", L"nocow", 0, FS_NOCOW_FL},
|
||||
#endif
|
||||
#ifdef FS_HUGE_FILE_FL
|
||||
{ "nohugefile", L"nohugefile", FS_HUGE_FILE_FL, 0},
|
||||
#ifdef FS_PROJINHERIT_FL /* 'P' */
|
||||
{ "noprojinherit",L"noprojinherit", FS_PROJINHERIT_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_EXTENT_FL
|
||||
{ "noextent", L"noextent", FS_EXTENT_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_EA_INODE_FL
|
||||
{ "noeainode", L"noeainode", FS_EA_INODE_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_EOFBLOCKS_FL
|
||||
{ "noeofblocks",L"noeofblocks", FS_EOFBLOCKS_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_NOCOW_FL
|
||||
{ "nocow", L"nocow", FS_NOCOW_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_INLINE_DATA_FL
|
||||
{ "noinlinedata",L"noinlinedata", FS_INLINE_DATA_FL, 0},
|
||||
#endif
|
||||
#ifdef FS_PROJINHERIT_FL
|
||||
{ "noprojinherit",L"noprojinherit", FS_PROJINHERIT_FL, 0},
|
||||
#endif
|
||||
#if defined(FS_RESERVED_FL)
|
||||
{ "noreserved", L"noreserved", FS_RESERVED_FL, 0},
|
||||
#elif defined(EXT2_RESERVED_FL)
|
||||
{ "noreserved", L"noreserved", EXT2_RESERVED_FL, 0},
|
||||
#endif
|
||||
{ NULL, NULL, 0, 0 }
|
||||
{ NULL, NULL, 0, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -163,6 +163,9 @@ archive_read_disk_entry_from_file(struct archive *_a,
|
||||
int initial_fd = fd;
|
||||
int r, r1;
|
||||
|
||||
archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, ARCHIVE_STATE_ANY,
|
||||
"archive_read_disk_entry_from_file");
|
||||
|
||||
archive_clear_error(_a);
|
||||
path = archive_entry_sourcepath(entry);
|
||||
if (path == NULL)
|
||||
|
@ -517,15 +517,16 @@ static int run_e8e9_filter(struct rar5* rar, struct filter_info* flt,
|
||||
const uint32_t file_size = 0x1000000;
|
||||
ssize_t i;
|
||||
|
||||
const int mask = (int)rar->cstate.window_mask;
|
||||
circular_memcpy(rar->cstate.filtered_buf,
|
||||
rar->cstate.window_buf,
|
||||
rar->cstate.window_mask,
|
||||
mask,
|
||||
rar->cstate.solid_offset + flt->block_start,
|
||||
rar->cstate.solid_offset + flt->block_start + flt->block_length);
|
||||
|
||||
for(i = 0; i < flt->block_length - 4;) {
|
||||
uint8_t b = rar->cstate.window_buf[(rar->cstate.solid_offset +
|
||||
flt->block_start + i++) & rar->cstate.window_mask];
|
||||
flt->block_start + i++) & mask];
|
||||
|
||||
/* 0xE8 = x86's call <relative_addr_uint32> (function call)
|
||||
* 0xE9 = x86's jmp <relative_addr_uint32> (unconditional jump) */
|
||||
@ -534,17 +535,17 @@ static int run_e8e9_filter(struct rar5* rar, struct filter_info* flt,
|
||||
uint32_t addr;
|
||||
uint32_t offset = (i + flt->block_start) % file_size;
|
||||
|
||||
addr = read_filter_data(rar, (rar->cstate.solid_offset +
|
||||
addr = read_filter_data(rar, (uint32_t)(rar->cstate.solid_offset +
|
||||
flt->block_start + i) & rar->cstate.window_mask);
|
||||
|
||||
if(addr & 0x80000000) {
|
||||
if(((addr + offset) & 0x80000000) == 0) {
|
||||
write_filter_data(rar, i, addr + file_size);
|
||||
write_filter_data(rar, (uint32_t)i, addr + file_size);
|
||||
}
|
||||
} else {
|
||||
if((addr - file_size) & 0x80000000) {
|
||||
uint32_t naddr = addr - offset;
|
||||
write_filter_data(rar, i, naddr);
|
||||
write_filter_data(rar, (uint32_t)i, naddr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -558,11 +559,11 @@ static int run_e8e9_filter(struct rar5* rar, struct filter_info* flt,
|
||||
static int run_arm_filter(struct rar5* rar, struct filter_info* flt) {
|
||||
ssize_t i = 0;
|
||||
uint32_t offset;
|
||||
const int mask = rar->cstate.window_mask;
|
||||
const int mask = (int)rar->cstate.window_mask;
|
||||
|
||||
circular_memcpy(rar->cstate.filtered_buf,
|
||||
rar->cstate.window_buf,
|
||||
rar->cstate.window_mask,
|
||||
mask,
|
||||
rar->cstate.solid_offset + flt->block_start,
|
||||
rar->cstate.solid_offset + flt->block_start + flt->block_length);
|
||||
|
||||
@ -577,7 +578,7 @@ static int run_arm_filter(struct rar5* rar, struct filter_info* flt) {
|
||||
|
||||
offset -= (uint32_t) ((i + flt->block_start) / 4);
|
||||
offset = (offset & 0x00ffffff) | 0xeb000000;
|
||||
write_filter_data(rar, i, offset);
|
||||
write_filter_data(rar, (uint32_t)i, offset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -643,7 +644,7 @@ static int run_filter(struct archive_read* a, struct filter_info* flt) {
|
||||
static void push_data(struct archive_read* a, struct rar5* rar,
|
||||
const uint8_t* buf, int64_t idx_begin, int64_t idx_end)
|
||||
{
|
||||
const int wmask = rar->cstate.window_mask;
|
||||
const int wmask = (int)rar->cstate.window_mask;
|
||||
const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
|
||||
rar->cstate.last_write_ptr) & wmask;
|
||||
|
||||
@ -1716,8 +1717,8 @@ static int process_base_block(struct archive_read* a,
|
||||
|
||||
rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
|
||||
rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
|
||||
rar->generic.size = hdr_size;
|
||||
rar->generic.last_header_id = header_id;
|
||||
rar->generic.size = (int)hdr_size;
|
||||
rar->generic.last_header_id = (int)header_id;
|
||||
rar->main.endarc = 0;
|
||||
|
||||
/* Those are possible header ids in RARv5. */
|
||||
@ -1933,7 +1934,7 @@ static int create_decode_tables(uint8_t* bit_length,
|
||||
}
|
||||
}
|
||||
|
||||
quick_data_size = 1 << table->quick_bits;
|
||||
quick_data_size = (int64_t)1 << table->quick_bits;
|
||||
cur_len = 1;
|
||||
for(code = 0; code < quick_data_size; code++) {
|
||||
int bit_field = code << (16 - table->quick_bits);
|
||||
@ -2364,7 +2365,7 @@ static int decode_code_length(struct rar5* rar, const uint8_t* p,
|
||||
|
||||
static int copy_string(struct archive_read* a, int len, int dist) {
|
||||
struct rar5* rar = get_context(a);
|
||||
const int cmask = rar->cstate.window_mask;
|
||||
const int cmask = (int)rar->cstate.window_mask;
|
||||
const int64_t write_ptr = rar->cstate.write_ptr + rar->cstate.solid_offset;
|
||||
int i;
|
||||
|
||||
@ -2390,7 +2391,7 @@ static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
|
||||
uint16_t num;
|
||||
int ret;
|
||||
|
||||
const int cmask = rar->cstate.window_mask;
|
||||
const int cmask = (int)rar->cstate.window_mask;
|
||||
const struct compressed_block_header* hdr = &rar->last_block_hdr;
|
||||
const uint8_t bit_size = 1 + bf_bit_size(hdr);
|
||||
|
||||
|
@ -194,6 +194,7 @@ struct zip {
|
||||
ssize_t zipx_ppmd_read_compressed;
|
||||
CPpmd8 ppmd8;
|
||||
char ppmd8_valid;
|
||||
char ppmd8_stream_failed;
|
||||
|
||||
struct archive_string_conv *sconv;
|
||||
struct archive_string_conv *sconv_default;
|
||||
@ -254,9 +255,15 @@ ppmd_read(void* p) {
|
||||
/* Get the handle to current decompression context. */
|
||||
struct archive_read *a = ((IByteIn*)p)->a;
|
||||
struct zip *zip = (struct zip*) a->format->data;
|
||||
ssize_t bytes_avail = 0;
|
||||
|
||||
/* Fetch next byte. */
|
||||
const uint8_t* data = __archive_read_ahead(a, 1, NULL);
|
||||
const uint8_t* data = __archive_read_ahead(a, 1, &bytes_avail);
|
||||
if(bytes_avail < 1) {
|
||||
zip->ppmd8_stream_failed = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__archive_read_consume(a, 1);
|
||||
|
||||
/* Increment the counter. */
|
||||
@ -1750,6 +1757,7 @@ zipx_ppmd8_init(struct archive_read *a, struct zip *zip)
|
||||
|
||||
/* Create a new decompression context. */
|
||||
__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
|
||||
zip->ppmd8_stream_failed = 0;
|
||||
|
||||
/* Setup function pointers required by Ppmd8 decompressor. The
|
||||
* 'ppmd_read' function will feed new bytes to the decompressor,
|
||||
@ -1869,6 +1877,14 @@ zip_read_data_zipx_ppmd(struct archive_read *a, const void **buff,
|
||||
break;
|
||||
}
|
||||
|
||||
/* This field is set by ppmd_read() when there was no more data
|
||||
* to be read. */
|
||||
if(zip->ppmd8_stream_failed) {
|
||||
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
|
||||
"Truncated PPMd8 file body");
|
||||
return (ARCHIVE_FATAL);
|
||||
}
|
||||
|
||||
zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
|
||||
++consumed_bytes;
|
||||
} while(consumed_bytes < zip->uncompressed_buffer_size);
|
||||
@ -1902,7 +1918,7 @@ zipx_bzip2_init(struct archive_read *a, struct zip *zip)
|
||||
{
|
||||
int r;
|
||||
|
||||
/* Deallocate already existing BZ2 decompression context if it
|
||||
/* Deallocate already existing BZ2 decompression context if it
|
||||
* exists. */
|
||||
if(zip->bzstream_valid) {
|
||||
BZ2_bzDecompressEnd(&zip->bzstream);
|
||||
@ -1968,6 +1984,15 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff,
|
||||
}
|
||||
|
||||
in_bytes = zipmin(zip->entry_bytes_remaining, bytes_avail);
|
||||
if(in_bytes < 1) {
|
||||
/* libbz2 doesn't complain when caller feeds avail_in == 0. It will
|
||||
* actually return success in this case, which is undesirable. This is
|
||||
* why we need to make this check manually. */
|
||||
|
||||
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
|
||||
"Truncated bzip2 file body");
|
||||
return (ARCHIVE_FATAL);
|
||||
}
|
||||
|
||||
/* Setup buffer boundaries. */
|
||||
zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
|
||||
|
@ -1512,8 +1512,10 @@ get_current_codepage(void)
|
||||
p = strrchr(locale, '.');
|
||||
if (p == NULL)
|
||||
return (GetACP());
|
||||
if (strcmp(p+1, "utf8") == 0)
|
||||
return CP_UTF8;
|
||||
cp = my_atoi(p+1);
|
||||
if (cp <= 0)
|
||||
if ((int)cp <= 0)
|
||||
return (GetACP());
|
||||
return (cp);
|
||||
}
|
||||
@ -4050,6 +4052,7 @@ archive_mstring_copy_utf8(struct archive_mstring *aes, const char *utf8)
|
||||
{
|
||||
if (utf8 == NULL) {
|
||||
aes->aes_set = 0;
|
||||
return (0);
|
||||
}
|
||||
aes->aes_set = AES_SET_UTF8;
|
||||
archive_string_empty(&(aes->aes_mbs));
|
||||
@ -4064,6 +4067,7 @@ archive_mstring_copy_wcs_len(struct archive_mstring *aes, const wchar_t *wcs,
|
||||
{
|
||||
if (wcs == NULL) {
|
||||
aes->aes_set = 0;
|
||||
return (0);
|
||||
}
|
||||
aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
|
||||
archive_string_empty(&(aes->aes_mbs));
|
||||
|
@ -2588,8 +2588,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
|
||||
*/
|
||||
restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC);
|
||||
__archive_ensure_cloexec_flag(restore_pwd);
|
||||
if (restore_pwd < 0)
|
||||
if (restore_pwd < 0) {
|
||||
fsobj_error(a_eno, a_estr, errno,
|
||||
"Could not open ", path);
|
||||
return (ARCHIVE_FATAL);
|
||||
}
|
||||
head = path;
|
||||
tail = path;
|
||||
last = 0;
|
||||
@ -3128,12 +3131,14 @@ create_dir(struct archive_write_disk *a, char *path)
|
||||
static int
|
||||
set_ownership(struct archive_write_disk *a)
|
||||
{
|
||||
#ifndef __CYGWIN__
|
||||
/* unfortunately, on win32 there is no 'root' user with uid 0,
|
||||
so we just have to try the chown and see if it works */
|
||||
|
||||
/* If we know we can't change it, don't bother trying. */
|
||||
if (a->user_uid != 0 && a->user_uid != a->uid) {
|
||||
#if !defined(__CYGWIN__) && !defined(__linux__)
|
||||
/*
|
||||
* On Linux, a process may have the CAP_CHOWN capability.
|
||||
* On Windows there is no 'root' user with uid 0.
|
||||
* Elsewhere we can skip calling chown if we are not root and the desired
|
||||
* user id does not match the current user.
|
||||
*/
|
||||
if (a->user_uid != 0 && a->user_uid != a->uid) {
|
||||
archive_set_error(&a->archive, errno,
|
||||
"Can't set UID=%jd", (intmax_t)a->uid);
|
||||
return (ARCHIVE_WARN);
|
||||
@ -3500,9 +3505,7 @@ set_fflags(struct archive_write_disk *a)
|
||||
struct fixup_entry *le;
|
||||
unsigned long set, clear;
|
||||
int r;
|
||||
int critical_flags;
|
||||
mode_t mode = archive_entry_mode(a->entry);
|
||||
|
||||
/*
|
||||
* Make 'critical_flags' hold all file flags that can't be
|
||||
* immediately restored. For example, on BSD systems,
|
||||
@ -3518,33 +3521,33 @@ set_fflags(struct archive_write_disk *a)
|
||||
* other programs that might try to muck with files as they're
|
||||
* being restored.
|
||||
*/
|
||||
/* Hopefully, the compiler will optimize this mess into a constant. */
|
||||
critical_flags = 0;
|
||||
const int critical_flags = 0
|
||||
#ifdef SF_IMMUTABLE
|
||||
critical_flags |= SF_IMMUTABLE;
|
||||
| SF_IMMUTABLE
|
||||
#endif
|
||||
#ifdef UF_IMMUTABLE
|
||||
critical_flags |= UF_IMMUTABLE;
|
||||
| UF_IMMUTABLE
|
||||
#endif
|
||||
#ifdef SF_APPEND
|
||||
critical_flags |= SF_APPEND;
|
||||
| SF_APPEND
|
||||
#endif
|
||||
#ifdef UF_APPEND
|
||||
critical_flags |= UF_APPEND;
|
||||
| UF_APPEND
|
||||
#endif
|
||||
#if defined(FS_APPEND_FL)
|
||||
critical_flags |= FS_APPEND_FL;
|
||||
| FS_APPEND_FL
|
||||
#elif defined(EXT2_APPEND_FL)
|
||||
critical_flags |= EXT2_APPEND_FL;
|
||||
| EXT2_APPEND_FL
|
||||
#endif
|
||||
#if defined(FS_IMMUTABLE_FL)
|
||||
critical_flags |= FS_IMMUTABLE_FL;
|
||||
| FS_IMMUTABLE_FL
|
||||
#elif defined(EXT2_IMMUTABLE_FL)
|
||||
critical_flags |= EXT2_IMMUTABLE_FL;
|
||||
| EXT2_IMMUTABLE_FL
|
||||
#endif
|
||||
#ifdef FS_JOURNAL_DATA_FL
|
||||
critical_flags |= FS_JOURNAL_DATA_FL;
|
||||
| FS_JOURNAL_DATA_FL
|
||||
#endif
|
||||
;
|
||||
|
||||
if (a->todo & TODO_FFLAGS) {
|
||||
archive_entry_fflags(a->entry, &set, &clear);
|
||||
@ -3575,29 +3578,27 @@ set_fflags(struct archive_write_disk *a)
|
||||
static int
|
||||
clear_nochange_fflags(struct archive_write_disk *a)
|
||||
{
|
||||
int nochange_flags;
|
||||
mode_t mode = archive_entry_mode(a->entry);
|
||||
|
||||
/* Hopefully, the compiler will optimize this mess into a constant. */
|
||||
nochange_flags = 0;
|
||||
const int nochange_flags = 0
|
||||
#ifdef SF_IMMUTABLE
|
||||
nochange_flags |= SF_IMMUTABLE;
|
||||
| SF_IMMUTABLE
|
||||
#endif
|
||||
#ifdef UF_IMMUTABLE
|
||||
nochange_flags |= UF_IMMUTABLE;
|
||||
| UF_IMMUTABLE
|
||||
#endif
|
||||
#ifdef SF_APPEND
|
||||
nochange_flags |= SF_APPEND;
|
||||
| SF_APPEND
|
||||
#endif
|
||||
#ifdef UF_APPEND
|
||||
nochange_flags |= UF_APPEND;
|
||||
| UF_APPEND
|
||||
#endif
|
||||
#ifdef EXT2_APPEND_FL
|
||||
nochange_flags |= EXT2_APPEND_FL;
|
||||
| EXT2_APPEND_FL
|
||||
#endif
|
||||
#ifdef EXT2_IMMUTABLE_FL
|
||||
nochange_flags |= EXT2_IMMUTABLE_FL;
|
||||
| EXT2_IMMUTABLE_FL
|
||||
#endif
|
||||
;
|
||||
|
||||
return (set_fflags_platform(a, a->fd, a->name, mode, 0,
|
||||
nochange_flags));
|
||||
@ -3613,8 +3614,22 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
|
||||
mode_t mode, unsigned long set, unsigned long clear)
|
||||
{
|
||||
int r;
|
||||
|
||||
const int sf_mask = 0
|
||||
#ifdef SF_APPEND
|
||||
| SF_APPEND
|
||||
#endif
|
||||
#ifdef SF_ARCHIVED
|
||||
| SF_ARCHIVED
|
||||
#endif
|
||||
#ifdef SF_IMMUTABLE
|
||||
| SF_IMMUTABLE
|
||||
#endif
|
||||
#ifdef SF_NOUNLINK
|
||||
| SF_NOUNLINK
|
||||
#endif
|
||||
;
|
||||
(void)mode; /* UNUSED */
|
||||
|
||||
if (set == 0 && clear == 0)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
@ -3629,6 +3644,12 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
|
||||
|
||||
a->st.st_flags &= ~clear;
|
||||
a->st.st_flags |= set;
|
||||
|
||||
/* Only super-user may change SF_* flags */
|
||||
|
||||
if (a->user_uid != 0)
|
||||
a->st.st_flags &= ~sf_mask;
|
||||
|
||||
#ifdef HAVE_FCHFLAGS
|
||||
/* If platform has fchflags() and we were given an fd, use it. */
|
||||
if (fd >= 0 && fchflags(fd, a->st.st_flags) == 0)
|
||||
@ -3670,7 +3691,28 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
|
||||
int ret;
|
||||
int myfd = fd;
|
||||
int newflags, oldflags;
|
||||
int sf_mask = 0;
|
||||
/*
|
||||
* Linux has no define for the flags that are only settable by
|
||||
* the root user. This code may seem a little complex, but
|
||||
* there seem to be some Linux systems that lack these
|
||||
* defines. (?) The code below degrades reasonably gracefully
|
||||
* if sf_mask is incomplete.
|
||||
*/
|
||||
const int sf_mask = 0
|
||||
#if defined(FS_IMMUTABLE_FL)
|
||||
| FS_IMMUTABLE_FL
|
||||
#elif defined(EXT2_IMMUTABLE_FL)
|
||||
| EXT2_IMMUTABLE_FL
|
||||
#endif
|
||||
#if defined(FS_APPEND_FL)
|
||||
| FS_APPEND_FL
|
||||
#elif defined(EXT2_APPEND_FL)
|
||||
| EXT2_APPEND_FL
|
||||
#endif
|
||||
#if defined(FS_JOURNAL_DATA_FL)
|
||||
| FS_JOURNAL_DATA_FL
|
||||
#endif
|
||||
;
|
||||
|
||||
if (set == 0 && clear == 0)
|
||||
return (ARCHIVE_OK);
|
||||
@ -3686,26 +3728,6 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
|
||||
if (myfd < 0)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
/*
|
||||
* Linux has no define for the flags that are only settable by
|
||||
* the root user. This code may seem a little complex, but
|
||||
* there seem to be some Linux systems that lack these
|
||||
* defines. (?) The code below degrades reasonably gracefully
|
||||
* if sf_mask is incomplete.
|
||||
*/
|
||||
#if defined(FS_IMMUTABLE_FL)
|
||||
sf_mask |= FS_IMMUTABLE_FL;
|
||||
#elif defined(EXT2_IMMUTABLE_FL)
|
||||
sf_mask |= EXT2_IMMUTABLE_FL;
|
||||
#endif
|
||||
#if defined(FS_APPEND_FL)
|
||||
sf_mask |= FS_APPEND_FL;
|
||||
#elif defined(EXT2_APPEND_FL)
|
||||
sf_mask |= EXT2_APPEND_FL;
|
||||
#endif
|
||||
#if defined(FS_JOURNAL_DATA_FL)
|
||||
sf_mask |= FS_JOURNAL_DATA_FL;
|
||||
#endif
|
||||
/*
|
||||
* XXX As above, this would be way simpler if we didn't have
|
||||
* to read the current flags from disk. XXX
|
||||
|
@ -439,7 +439,8 @@ _7z_write_header(struct archive_write *a, struct archive_entry *entry)
|
||||
|
||||
r = file_new(a, entry, &file);
|
||||
if (r < ARCHIVE_WARN) {
|
||||
file_free(file);
|
||||
if (file != NULL)
|
||||
file_free(file);
|
||||
return (r);
|
||||
}
|
||||
if (file->size == 0 && file->dir) {
|
||||
|
@ -336,7 +336,7 @@ DEFINE_TEST(test_entry)
|
||||
/* Converting fflags bitmap to string is currently system-dependent. */
|
||||
/* TODO: Make this system-independent. */
|
||||
assertEqualString(archive_entry_fflags_text(e),
|
||||
"uappnd,nouchg,nodump,noopaque,uunlnk");
|
||||
"uappnd,nouchg,nodump,noopaque,uunlnk,nosystem");
|
||||
/* Test archive_entry_copy_fflags_text_w() */
|
||||
archive_entry_copy_fflags_text_w(e, L" ,nouappnd, nouchg, dump,uunlnk");
|
||||
archive_entry_fflags(e, &set, &clear);
|
||||
|
@ -96,7 +96,7 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) {
|
||||
int ret = 1;
|
||||
uint32_t computed_crc;
|
||||
|
||||
fsize = archive_entry_size(ae);
|
||||
fsize = (la_ssize_t) archive_entry_size(ae);
|
||||
buf = malloc(fsize);
|
||||
if(buf == NULL)
|
||||
return 1;
|
||||
@ -110,13 +110,13 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) {
|
||||
computed_crc = crc32(0, buf, fsize);
|
||||
assertEqualInt(computed_crc, crc);
|
||||
ret = 0;
|
||||
|
||||
|
||||
fn_exit:
|
||||
free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_rar5_stored)
|
||||
DEFINE_TEST(test_read_format_rar5_stored)
|
||||
{
|
||||
const char helloworld_txt[] = "hello libarchive test suite!\n";
|
||||
la_ssize_t file_size = sizeof(helloworld_txt) - 1;
|
||||
@ -143,7 +143,7 @@ DEFINE_TEST(test_read_format_rar5_stored)
|
||||
DEFINE_TEST(test_read_format_rar5_compressed)
|
||||
{
|
||||
const int DATA_SIZE = 1200;
|
||||
uint8_t buff[DATA_SIZE];
|
||||
uint8_t buff[1200];
|
||||
|
||||
PROLOGUE("test_read_format_rar5_compressed.rar");
|
||||
|
||||
@ -161,7 +161,7 @@ DEFINE_TEST(test_read_format_rar5_compressed)
|
||||
DEFINE_TEST(test_read_format_rar5_multiple_files)
|
||||
{
|
||||
const int DATA_SIZE = 4096;
|
||||
uint8_t buff[DATA_SIZE];
|
||||
uint8_t buff[4096];
|
||||
|
||||
PROLOGUE("test_read_format_rar5_multiple_files.rar");
|
||||
|
||||
@ -173,7 +173,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files)
|
||||
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
|
||||
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
|
||||
assertA(verify_data(buff, 1, DATA_SIZE));
|
||||
|
||||
|
||||
assertA(0 == archive_read_next_header(a, &ae));
|
||||
assertEqualString("test2.bin", archive_entry_pathname(ae));
|
||||
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
|
||||
@ -207,7 +207,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files)
|
||||
DEFINE_TEST(test_read_format_rar5_multiple_files_solid)
|
||||
{
|
||||
const int DATA_SIZE = 4096;
|
||||
uint8_t buff[DATA_SIZE];
|
||||
uint8_t buff[4096];
|
||||
|
||||
PROLOGUE("test_read_format_rar5_multiple_files_solid.rar");
|
||||
|
||||
@ -216,7 +216,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files_solid)
|
||||
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
|
||||
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
|
||||
assertA(verify_data(buff, 1, DATA_SIZE));
|
||||
|
||||
|
||||
assertA(0 == archive_read_next_header(a, &ae));
|
||||
assertEqualString("test2.bin", archive_entry_pathname(ae));
|
||||
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
|
||||
@ -309,7 +309,7 @@ DEFINE_TEST(test_read_format_rar5_multiarchive_skip_all_but_second)
|
||||
DEFINE_TEST(test_read_format_rar5_blake2)
|
||||
{
|
||||
const la_ssize_t proper_size = 814;
|
||||
uint8_t buf[proper_size];
|
||||
uint8_t buf[814];
|
||||
|
||||
PROLOGUE("test_read_format_rar5_blake2.rar");
|
||||
assertA(0 == archive_read_next_header(a, &ae));
|
||||
@ -334,7 +334,7 @@ DEFINE_TEST(test_read_format_rar5_arm_filter)
|
||||
* test. */
|
||||
|
||||
const la_ssize_t proper_size = 90808;
|
||||
uint8_t buf[proper_size];
|
||||
uint8_t buf[90808];
|
||||
|
||||
PROLOGUE("test_read_format_rar5_arm.rar");
|
||||
assertA(0 == archive_read_next_header(a, &ae));
|
||||
@ -598,7 +598,7 @@ DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_last)
|
||||
EPILOGUE();
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all)
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all)
|
||||
{
|
||||
const char* reffile = "test_read_format_rar5_solid.rar";
|
||||
|
||||
@ -623,7 +623,7 @@ DEFINE_TEST(test_read_format_rar5_solid_skip_all)
|
||||
EPILOGUE();
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
|
||||
{
|
||||
const char* reffile = "test_read_format_rar5_solid.rar";
|
||||
|
||||
@ -649,7 +649,7 @@ DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
|
||||
EPILOGUE();
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_second)
|
||||
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_second)
|
||||
{
|
||||
const char* reffile = "test_read_format_rar5_solid.rar";
|
||||
|
||||
|
@ -799,7 +799,7 @@ static void verify(unsigned char *d, size_t s,
|
||||
static void verifyB(unsigned char *d, size_t s) {
|
||||
struct archive* a;
|
||||
struct archive_entry *entry = NULL;
|
||||
la_int64_t buf_size;
|
||||
size_t buf_size;
|
||||
unsigned char *buf;
|
||||
|
||||
assert((a = archive_read_new()) != NULL);
|
||||
@ -826,20 +826,20 @@ static void verifyB(unsigned char *d, size_t s) {
|
||||
|
||||
// f1, content "onetwothree\n", size 12 bytes
|
||||
assertA(0 == archive_read_next_header(a, &entry));
|
||||
buf_size = archive_entry_size(entry);
|
||||
buf_size = (size_t) archive_entry_size(entry);
|
||||
assertA(buf_size == 12);
|
||||
buf = (unsigned char*) malloc(buf_size);
|
||||
assertA(NULL != buf);
|
||||
assertA(buf_size == archive_read_data(a, buf, buf_size));
|
||||
assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
|
||||
free(buf);
|
||||
|
||||
// f2, content "fourfivesix\n", size 12 bytes
|
||||
assertA(0 == archive_read_next_header(a, &entry));
|
||||
buf_size = archive_entry_size(entry);
|
||||
buf_size = (size_t) archive_entry_size(entry);
|
||||
assertA(buf_size == 12);
|
||||
buf = (unsigned char*) malloc(buf_size);
|
||||
assertA(NULL != buf);
|
||||
assertA(buf_size == archive_read_data(a, buf, buf_size));
|
||||
assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
|
||||
free(buf);
|
||||
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
|
@ -37,7 +37,7 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc)
|
||||
int ret = 1;
|
||||
uint32_t computed_crc;
|
||||
|
||||
fsize = archive_entry_size(ae);
|
||||
fsize = (la_ssize_t) archive_entry_size(ae);
|
||||
buf = malloc(fsize);
|
||||
if(buf == NULL)
|
||||
return 1;
|
||||
@ -759,3 +759,67 @@ DEFINE_TEST(test_read_format_zip_xz_multi_blockread)
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_zip_ppmd8_crash_1)
|
||||
{
|
||||
const char *refname = "test_read_format_zip_ppmd8_crash_2.zipx";
|
||||
struct archive *a;
|
||||
struct archive_entry *ae;
|
||||
char buf[64];
|
||||
|
||||
extract_reference_file(refname);
|
||||
|
||||
assert((a = archive_read_new()) != NULL);
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 100));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
|
||||
|
||||
/* This file shouldn't be properly decompressed, because it's invalid.
|
||||
* However, unpacker should return an error during unpacking. Without the
|
||||
* proper fix, the unpacker was entering an unlimited loop. */
|
||||
assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buf, 1));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_zip_bz2_hang_on_invalid)
|
||||
{
|
||||
const char *refname = "test_read_format_zip_bz2_hang.zip";
|
||||
struct archive *a;
|
||||
struct archive_entry *ae;
|
||||
char buf[8];
|
||||
|
||||
extract_reference_file(refname);
|
||||
|
||||
assert((a = archive_read_new()) != NULL);
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
|
||||
|
||||
/* The file `refname` is invalid in this case, so this call should fail.
|
||||
* But it shouldn't crash. */
|
||||
assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buf, 64));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
|
||||
}
|
||||
|
||||
DEFINE_TEST(test_read_format_zip_ppmd8_crash_2)
|
||||
{
|
||||
const char *refname = "test_read_format_zip_ppmd8_crash_2.zipx";
|
||||
struct archive *a;
|
||||
struct archive_entry *ae;
|
||||
char buf[64];
|
||||
|
||||
extract_reference_file(refname);
|
||||
|
||||
assert((a = archive_read_new()) != NULL);
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 37));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
|
||||
|
||||
/* The file `refname` is invalid in this case, so this call should fail.
|
||||
* But it shouldn't crash. */
|
||||
assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buf, 64));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
begin 644 test_read_format_zip_bz2_hang.zip
|
||||
M4$L#!)LP,#`,,#`P,#`P,#`P,#`P,#`P,#`$`!P`,#`P,#`P"0`P,#`P,#`P
|
||||
1,#!U>`L`8(0P,#`P,#`P,#``
|
||||
`
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
begin 644 test_read_format_zip_ppmd8_crash_1.zipx
|
||||
K4$L'"(=02P,$\+N.O&*A>*\+."U``$H`````````@``````#````6(0`````
|
||||
`
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
begin 644 test_read_format_zip_ppmd8_crash_2.zipx
|
||||
L4$L'"(=02P,$\+N.O&*A>*\+.2U`@$H`````````@``````#````````````
|
||||
`
|
||||
end
|
@ -2824,7 +2824,15 @@ bool ARMBaseInstrInfo::optimizeCompareInstr(
|
||||
// change. We can't do this transformation.
|
||||
return false;
|
||||
|
||||
} while (I != B);
|
||||
if (I == B) {
|
||||
// In some cases, we scan the use-list of an instruction for an AND;
|
||||
// that AND is in the same BB, but may not be scheduled before the
|
||||
// corresponding TST. In that case, bail out.
|
||||
//
|
||||
// FIXME: We could try to reschedule the AND.
|
||||
return false;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// Return false if no candidates exist.
|
||||
if (!MI && !SubAdd)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $ */
|
||||
/* $NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $");
|
||||
__RCSID("$NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $");
|
||||
|
||||
#include <sys/resource.h>
|
||||
#include <atf-c.h>
|
||||
@ -56,7 +56,7 @@ mkstr(const char *str, size_t len)
|
||||
{
|
||||
size_t slen = strlen(str);
|
||||
char *p = malloc(slen * len + 1);
|
||||
ATF_REQUIRE(p != NULL);
|
||||
ATF_REQUIRE_MSG(p != NULL, "slen=%zu, len=%zu", slen, len);
|
||||
for (size_t i = 0; i < len; i++)
|
||||
strcpy(&p[i * slen], str);
|
||||
return p;
|
||||
@ -183,11 +183,12 @@ ATF_TC_HEAD(regcomp_too_big, tc)
|
||||
ATF_TC_BODY(regcomp_too_big, tc)
|
||||
{
|
||||
regex_t re;
|
||||
struct rlimit limit;
|
||||
int e;
|
||||
struct rlimit limit;
|
||||
|
||||
limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024;
|
||||
limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024;
|
||||
ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1);
|
||||
|
||||
for (size_t i = 0; i < __arraycount(tests); i++) {
|
||||
char *d = (*tests[i].pattern)(REGEX_MAXSIZE);
|
||||
e = regcomp(&re, d, tests[i].type);
|
||||
|
@ -12,7 +12,10 @@ VERSION= unknown
|
||||
# Email address for bug reports.
|
||||
BUGEMAIL= tz@iana.org
|
||||
|
||||
# Choose source data features. To get new features right away, use:
|
||||
# DATAFORM selects the data format.
|
||||
# Available formats represent essentially the same data, albeit
|
||||
# possibly with minor discrepancies that users are not likely to notice.
|
||||
# To get new features and the best data right away, use:
|
||||
# DATAFORM= vanguard
|
||||
# To wait a while before using new features, to give downstream users
|
||||
# time to upgrade zic (the default), use:
|
||||
@ -33,11 +36,11 @@ DATAFORM= main
|
||||
LOCALTIME= GMT
|
||||
|
||||
# If you want something other than Eastern United States time as a template
|
||||
# for handling POSIX-style timezone environment variables,
|
||||
# for handling ruleless POSIX-style timezone environment variables,
|
||||
# change the line below (after finding the timezone you want in the
|
||||
# one of the $(TDATA) source files, or adding it to a source file).
|
||||
# When a POSIX-style environment variable is handled, the rules in the
|
||||
# template file are used to determine "spring forward" and "fall back" days and
|
||||
# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
|
||||
# template file to determine "spring forward" and "fall back" days and
|
||||
# times; the environment variable itself specifies UT offsets of standard and
|
||||
# daylight saving time.
|
||||
# Alternatively, if you discover you've got the wrong timezone, you can just
|
||||
@ -46,7 +49,6 @@ LOCALTIME= GMT
|
||||
# Use the command
|
||||
# make zonenames
|
||||
# to get a list of the values you can use for POSIXRULES.
|
||||
# If you want POSIX compatibility, use "America/New_York".
|
||||
|
||||
POSIXRULES= America/New_York
|
||||
|
||||
@ -113,8 +115,8 @@ TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
|
||||
TIME_T_ALTERNATIVES_HEAD = int64_t
|
||||
TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
|
||||
|
||||
# What kind of TZif data files to generate.
|
||||
# (TZif is the binary time zone data format that zic generates.)
|
||||
# What kind of TZif data files to generate. (TZif is the binary time
|
||||
# zone data format that zic generates; see Internet RFC 8536.)
|
||||
# If you want only POSIX time, with time values interpreted as
|
||||
# seconds since the epoch (not counting leap seconds), use
|
||||
# REDO= posix_only
|
||||
@ -360,6 +362,9 @@ LEAPSECONDS=
|
||||
zic= ./zic
|
||||
ZIC= $(zic) $(ZFLAGS)
|
||||
|
||||
# To shrink the size of installed TZif files,
|
||||
# append "-r @N" to omit data before N-seconds-after-the-Epoch.
|
||||
# See the zic man page for more about -r.
|
||||
ZFLAGS=
|
||||
|
||||
# How to use zic to install TZif files.
|
||||
@ -491,7 +496,8 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
|
||||
COMMON= calendars CONTRIBUTING LICENSE Makefile \
|
||||
NEWS README theory.html version
|
||||
WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
|
||||
CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html
|
||||
CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
|
||||
check_tz-how-to.html check_tz-link.html
|
||||
DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
|
||||
PRIMARY_YDATA= africa antarctica asia australasia \
|
||||
europe northamerica southamerica
|
||||
@ -804,9 +810,10 @@ check_tzs: $(TZS) $(TZS_NEW)
|
||||
touch $@
|
||||
|
||||
check_web: $(CHECK_WEB_PAGES)
|
||||
check_theory.html: theory.html
|
||||
check_tz-art.html: tz-art.html
|
||||
check_tz-link.html: tz-link.html
|
||||
check_tz-art.html check_tz-link.html:
|
||||
check_theory.html check_tz-art.html check_tz-link.html:
|
||||
$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
|
||||
-F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
|
||||
test ! -s $@.out || { cat $@.out; exit 1; }
|
||||
@ -840,11 +847,13 @@ check_zishrink_posix check_zishrink_right: \
|
||||
touch $@
|
||||
|
||||
clean_misc:
|
||||
rm -fr check_*.dir
|
||||
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
|
||||
check_* core typecheck_* \
|
||||
date tzselect version.h zdump zic yearistype libtz.a
|
||||
clean: clean_misc
|
||||
rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
|
||||
rm -fr *.dir tzdb-*/
|
||||
rm -f *.zi $(TZS_NEW)
|
||||
|
||||
maintainer-clean: clean
|
||||
@echo 'This command is intended for maintainers to use; it'
|
||||
|
@ -1,5 +1,53 @@
|
||||
News for the tz database
|
||||
|
||||
Release 20198 - 2019-03-25 22:01:33 -0700
|
||||
|
||||
Briefly:
|
||||
Palestine "springs forward" on 2019-03-30 instead of 2019-03-23.
|
||||
Metlakatla "fell back" to rejoin Alaska Time on 2019-01-20 at 02:00.
|
||||
|
||||
Changes to past and future timestamps
|
||||
|
||||
Palestine will not start DST until 2019-03-30, instead of 2019-03-23 as
|
||||
previously predicted. Adjust our prediction by guessing that spring
|
||||
transitions will be between 24 and 30 March, which matches recent practice
|
||||
since 2016. (Thanks to Even Scharning and Tim Parenti.)
|
||||
|
||||
Metlakatla ended its observance of Pacific standard time,
|
||||
rejoining Alaska Time, on 2019-01-20 at 02:00. (Thanks to Ryan
|
||||
Stanley and Tim Parenti.)
|
||||
|
||||
Changes to past timestamps
|
||||
|
||||
Israel observed DST in 1980 (08-02/09-13) and 1984 (05-05/08-25).
|
||||
(Thanks to Alois Treindl and Isaac Starkman.)
|
||||
|
||||
Changes to time zone abbreviations
|
||||
|
||||
Etc/UCT is now a backward-compatibility link to Etc/UTC, instead
|
||||
of being a separate zone that generates the abbreviation "UCT",
|
||||
which nowadays is typically a typo. (Problem reported by Isiah
|
||||
Meadows.)
|
||||
|
||||
Changes to code
|
||||
|
||||
zic now has an -r option to limit the time range of output data.
|
||||
For example, 'zic -r @1000000000' limits the output data to
|
||||
timestamps starting 1000000000 seconds after the Epoch.
|
||||
This helps shrink output size and can be useful for applications
|
||||
not needing the full timestamp history, such as TZDIST truncation;
|
||||
see Internet RFC 8536 section 5.1. (Inspired by a feature request
|
||||
from Christopher Wong, helped along by bug reports from Wong and
|
||||
from Tim Parenti.)
|
||||
|
||||
Changes to documentation
|
||||
|
||||
Mention Internet RFC 8536 (February 2019), which documents TZif.
|
||||
|
||||
tz-link.html now cites tzdata-meta
|
||||
<https://tzdata-meta.timtimeonline.com/>.
|
||||
|
||||
|
||||
Release 2018i - 2018-12-30 11:05:43 -0800
|
||||
|
||||
Briefly:
|
||||
@ -400,8 +448,9 @@ Release 2018d - 2018-03-22 07:05:46 -0700
|
||||
downstream parsers do not support it.
|
||||
|
||||
* The build procedure constructs three files vanguard.zi, main.zi,
|
||||
and rearguard.zi, one for each format. The files represent the
|
||||
same data as closely as the formats allow. These three files
|
||||
and rearguard.zi, one for each format. Although the files
|
||||
represent essentially the same data, they may have minor
|
||||
discrepancies that users are not likely to notice. The files
|
||||
are intended for downstream data consumers and are not
|
||||
installed. Zoneinfo parsers that do not support negative SAVE values
|
||||
should start using rearguard.zi, so that they will be unaffected
|
||||
|
@ -1,7 +1,7 @@
|
||||
README for the tz distribution
|
||||
|
||||
"What time is it?" -- Richard Deacon as The King
|
||||
"Any time you want it to be." -- Frank Baxter as The Scientist
|
||||
"Where do I set the hands of the clock?" -- Les Tremayne as The King
|
||||
"Oh that--you can set them any place you want." -- Frank Baxter as The Scientist
|
||||
(from the Bell System film "About Time")
|
||||
|
||||
The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
|
||||
|
@ -364,6 +364,11 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
|
||||
# See Africa/Lagos.
|
||||
|
||||
# Eritrea
|
||||
# See Africa/Nairobi.
|
||||
|
||||
# Eswatini (formerly Swaziland)
|
||||
# See Africa/Johannesburg.
|
||||
|
||||
# Ethiopia
|
||||
# See Africa/Nairobi.
|
||||
#
|
||||
@ -1188,7 +1193,7 @@ Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
|
||||
1:30 - SAST 1903 Mar
|
||||
2:00 SA SAST
|
||||
Link Africa/Johannesburg Africa/Maseru # Lesotho
|
||||
Link Africa/Johannesburg Africa/Mbabane # Swaziland
|
||||
Link Africa/Johannesburg Africa/Mbabane # Eswatini
|
||||
#
|
||||
# Marion and Prince Edward Is
|
||||
# scientific station since 1947
|
||||
@ -1230,9 +1235,6 @@ Zone Africa/Juba 2:06:28 - LMT 1931
|
||||
2:00 Sudan CA%sT 2000 Jan 15 12:00
|
||||
3:00 - EAT
|
||||
|
||||
# Swaziland
|
||||
# See Africa/Johannesburg.
|
||||
|
||||
# Tanzania
|
||||
# See Africa/Nairobi.
|
||||
|
||||
|
@ -1620,6 +1620,24 @@ Rule Zion 1974 only - Jul 7 0:00 1:00 D
|
||||
Rule Zion 1974 only - Oct 13 0:00 0 S
|
||||
Rule Zion 1975 only - Apr 20 0:00 1:00 D
|
||||
Rule Zion 1975 only - Aug 31 0:00 0 S
|
||||
|
||||
# From Alois Treindl (2019-03-06):
|
||||
# http://www.moin.gov.il/Documents/שעון קיץ/clock-50-years-7-2014.pdf
|
||||
# From Isaac Starkman (2019-03-06):
|
||||
# Summer time was in that period in 1980 and 1984, see
|
||||
# https://www.ynet.co.il/articles/0,7340,L-3951073,00.html
|
||||
# You can of course read it in translation.
|
||||
# I checked the local newspapers for that years.
|
||||
# It started on midnight and end at 01.00 am.
|
||||
# From Paul Eggert (2019-03-06):
|
||||
# Also see this thread about the moin.gov.il URL:
|
||||
# https://mm.icann.org/pipermail/tz/2018-November/027194.html
|
||||
Rule Zion 1980 only - Aug 2 0:00 1:00 D
|
||||
Rule Zion 1980 only - Sep 13 1:00 0 S
|
||||
Rule Zion 1984 only - May 5 0:00 1:00 D
|
||||
Rule Zion 1984 only - Aug 25 1:00 0 S
|
||||
|
||||
# From Shanks & Pottenger:
|
||||
Rule Zion 1985 only - Apr 14 0:00 1:00 D
|
||||
Rule Zion 1985 only - Sep 15 0:00 0 S
|
||||
Rule Zion 1986 only - May 18 0:00 1:00 D
|
||||
@ -3071,9 +3089,15 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
||||
# the official website, though the decree did not specify the exact
|
||||
# time of the time shift.
|
||||
# http://www.palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e7a42ab7-ee23-435a-b9c8-a4f7e81f3817
|
||||
|
||||
# From Even Scharning (2019-03-23):
|
||||
# DST in Palestine will start on 30 March this year, not 23 March as the time
|
||||
# zone database predicted.
|
||||
# https://ramallah.news/post/123610
|
||||
#
|
||||
# From Paul Eggert (2018-03-16):
|
||||
# For 2016 on, predict spring transitions on March's fourth Saturday at 01:00.
|
||||
# From Tim Parenti (2019-03-23):
|
||||
# Combining this with the rules observed since 2016, adjust our spring
|
||||
# transition guess to Mar Sat>=24.
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
|
||||
@ -3104,7 +3128,7 @@ Rule Palestine 2012 only - Sep 21 1:00 0 -
|
||||
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
|
||||
Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 -
|
||||
Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
|
||||
Rule Palestine 2016 max - Mar Sat>=22 1:00 1:00 S
|
||||
Rule Palestine 2016 max - Mar Sat>=24 1:00 1:00 S
|
||||
Rule Palestine 2016 max - Oct lastSat 1:00 0 -
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
@ -3596,5 +3620,17 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
|
||||
8:00 - +08 1975 Jun 13
|
||||
7:00 - +07
|
||||
|
||||
# From Paul Eggert (2019-02-19):
|
||||
#
|
||||
# The Ho Chi Minh entry suffices for most purposes as it agrees with all of
|
||||
# Vietnam since 1975-06-13. Presumably clocks often changed in south Vietnam
|
||||
# in the early 1970s as locations changed hands during the war; however the
|
||||
# details are unknown and would likely be too voluminous for this database.
|
||||
#
|
||||
# For timestamps in north Vietnam back to 1970 (the tzdb cutoff),
|
||||
# use Asia/Bangkok; see the VN entries in the file zone1970.tab.
|
||||
# For timestamps before 1970, see Asia/Hanoi in the file 'backzone'.
|
||||
|
||||
|
||||
# Yemen
|
||||
# See Asia/Riyadh.
|
||||
|
@ -77,6 +77,7 @@ Link Pacific/Easter Chile/EasterIsland
|
||||
Link America/Havana Cuba
|
||||
Link Africa/Cairo Egypt
|
||||
Link Europe/Dublin Eire
|
||||
Link Etc/UTC Etc/UCT
|
||||
Link Europe/London Europe/Belfast
|
||||
Link Europe/Chisinau Europe/Tiraspol
|
||||
Link Europe/London GB
|
||||
@ -111,7 +112,7 @@ Link Asia/Taipei ROC
|
||||
Link Asia/Seoul ROK
|
||||
Link Asia/Singapore Singapore
|
||||
Link Europe/Istanbul Turkey
|
||||
Link Etc/UCT UCT
|
||||
Link Etc/UTC UCT
|
||||
Link America/Anchorage US/Alaska
|
||||
Link America/Adak US/Aleutian
|
||||
Link America/Phoenix US/Arizona
|
||||
|
@ -204,7 +204,7 @@ Zone Africa/Maseru 1:50:00 - LMT 1903 Mar
|
||||
2:00 1:00 SAST 1944 Mar 19 2:00
|
||||
2:00 - SAST
|
||||
|
||||
# Swaziland
|
||||
# Eswatini (formerly Swaziland)
|
||||
Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar
|
||||
2:00 - SAST
|
||||
|
||||
@ -625,7 +625,7 @@ Zone Europe/Sarajevo 1:13:40 - LMT 1884
|
||||
1:00 - CET 1982 Nov 27
|
||||
1:00 EU CE%sT
|
||||
|
||||
# Macedonia
|
||||
# North Macedonia
|
||||
Zone Europe/Skopje 1:25:44 - LMT 1884
|
||||
1:00 - CET 1941 Apr 18 23:00
|
||||
1:00 C-Eur CE%sT 1945 May 8 2:00s
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
Zone Etc/GMT 0 - GMT
|
||||
Zone Etc/UTC 0 - UTC
|
||||
Zone Etc/UCT 0 - UCT
|
||||
|
||||
# The following link uses older naming conventions,
|
||||
# but it belongs here, not in the file 'backward',
|
||||
|
@ -1855,7 +1855,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
|
||||
1:00 Belgium CE%sT 1977
|
||||
1:00 EU CE%sT
|
||||
|
||||
# Macedonia
|
||||
# North Macedonia
|
||||
# See Europe/Belgrade.
|
||||
|
||||
# Malta
|
||||
@ -3359,7 +3359,7 @@ Zone Europe/Belgrade 1:22:00 - LMT 1884
|
||||
Link Europe/Belgrade Europe/Ljubljana # Slovenia
|
||||
Link Europe/Belgrade Europe/Podgorica # Montenegro
|
||||
Link Europe/Belgrade Europe/Sarajevo # Bosnia and Herzegovina
|
||||
Link Europe/Belgrade Europe/Skopje # Macedonia
|
||||
Link Europe/Belgrade Europe/Skopje # North Macedonia
|
||||
Link Europe/Belgrade Europe/Zagreb # Croatia
|
||||
|
||||
# Slovakia
|
||||
|
@ -204,10 +204,10 @@
|
||||
# current -- the update time stamp, the data and the name of the file
|
||||
# will not change.
|
||||
#
|
||||
# Updated through IERS Bulletin C56
|
||||
# File expires on: 28 June 2019
|
||||
# Updated through IERS Bulletin C57
|
||||
# File expires on: 28 December 2019
|
||||
#
|
||||
#@ 3770668800
|
||||
#@ 3786480000
|
||||
#
|
||||
2272060800 10 # 1 Jan 1972
|
||||
2287785600 11 # 1 Jul 1972
|
||||
@ -252,4 +252,4 @@
|
||||
# the hash line is also ignored in the
|
||||
# computation.
|
||||
#
|
||||
#h 62ca19f6 96a4ae0a 3708451c 9f8693f4 016604eb
|
||||
#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a
|
||||
|
@ -63,7 +63,7 @@ Leap 2016 Dec 31 23:59:60 + S
|
||||
|
||||
# POSIX timestamps for the data in this file:
|
||||
#updated 1467936000
|
||||
#expires 1561680000
|
||||
#expires 1577491200
|
||||
|
||||
# Updated through IERS Bulletin C56
|
||||
# File expires on: 28 June 2019
|
||||
# Updated through IERS Bulletin C57
|
||||
# File expires on: 28 December 2019
|
||||
|
@ -609,6 +609,15 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
|
||||
# In a 2018-12-11 special election, Metlakatla voted to go back to
|
||||
# Alaska time (including daylight saving time) starting next year.
|
||||
# https://www.krbd.org/2018/12/12/metlakatla-to-follow-alaska-standard-time-allow-liquor-sales/
|
||||
#
|
||||
# From Ryan Stanley (2019-01-11):
|
||||
# The community will be changing back on the 20th of this month...
|
||||
# From Tim Parenti (2019-01-11):
|
||||
# Per an announcement on the Metlakatla community's official Facebook page, the
|
||||
# "fall back" will be on Sunday 2019-01-20 at 02:00:
|
||||
# https://www.facebook.com/141055983004923/photos/607150969728753/
|
||||
# So they won't be waiting for Alaska to join them on 2019-03-10, but will
|
||||
# rather change their clocks twice in seven weeks.
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone America/Juneau 15:02:19 - LMT 1867 Oct 19 15:33:32
|
||||
@ -637,7 +646,7 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 19 15:44:55
|
||||
-8:00 US P%sT 1983 Oct 30 2:00
|
||||
-8:00 - PST 2015 Nov 1 2:00
|
||||
-9:00 US AK%sT 2018 Nov 4 2:00
|
||||
-8:00 - PST 2019 Mar Sun>=8 3:00
|
||||
-8:00 - PST 2019 Jan 20 2:00
|
||||
-9:00 US AK%sT
|
||||
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 19 15:12:18
|
||||
-9:18:55 - LMT 1900 Aug 20 12:00
|
||||
|
@ -15,7 +15,7 @@
|
||||
<ul>
|
||||
<li><a href="#scope">Scope of the <code><abbr>tz</abbr></code>
|
||||
database</a></li>
|
||||
<li><a href="#naming">Names of timezones</a></li>
|
||||
<li><a href="#naming">Timezone identifiers</a></li>
|
||||
<li><a href="#abbreviations">Time zone abbreviations</a></li>
|
||||
<li><a href="#accuracy">Accuracy of the <code><abbr>tz</abbr></code>
|
||||
database</a></li>
|
||||
@ -107,9 +107,9 @@ It does not always make sense to talk about a timezone's
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 id="naming">Names of timezones</h2>
|
||||
<h2 id="naming">Timezone identifiers</h2>
|
||||
<p>
|
||||
Each timezone has a unique name.
|
||||
Each timezone has a name that uniquely identifies the timezone.
|
||||
Inexperienced users are not expected to select these names unaided.
|
||||
Distributors should provide documentation and/or a simple selection
|
||||
interface that explains each name via a map or via descriptive text like
|
||||
@ -142,10 +142,12 @@ among the following goals:
|
||||
</li>
|
||||
<li>
|
||||
Be robust in the presence of political changes.
|
||||
For example, names of countries are ordinarily not used, to avoid
|
||||
For example, names are typically not tied to countries, to avoid
|
||||
incompatibilities when countries change their name (e.g.,
|
||||
Zaire→Congo) or when locations change countries (e.g., Hong
|
||||
Swaziland→Eswatini) or when locations change countries (e.g., Hong
|
||||
Kong from UK colony to China).
|
||||
There is no requirement that every country or national
|
||||
capital must have a timezone name.
|
||||
</li>
|
||||
<li>
|
||||
Be portable to a wide variety of implementations.
|
||||
@ -214,19 +216,18 @@ in decreasing order of importance:
|
||||
Uninhabited regions like the North Pole and Bouvet Island
|
||||
do not need locations, since local time is not defined there.
|
||||
</li>
|
||||
<li>
|
||||
There should typically be at least one name for each <a
|
||||
href="https://en.wikipedia.org/wiki/ISO_3166-1"><abbr
|
||||
title="International Organization for Standardization">ISO</abbr>
|
||||
3166-1</a> officially assigned two-letter code for an inhabited
|
||||
country or territory.
|
||||
</li>
|
||||
<li>
|
||||
If all the clocks in a timezone have agreed since 1970,
|
||||
do not bother to include more than one timezone
|
||||
even if some of the clocks disagreed before 1970.
|
||||
Otherwise these tables would become annoyingly large.
|
||||
</li>
|
||||
<li>
|
||||
If boundaries between regions are fluid, such as during a war or
|
||||
insurrection, do not bother to create a new timezone merely
|
||||
because of yet another boundary change. This helps prevent table
|
||||
bloat and simplifies maintenance.
|
||||
</li>
|
||||
<li>
|
||||
If a name is ambiguous, use a less ambiguous alternative;
|
||||
e.g., many cities are named San José and Georgetown, so
|
||||
@ -299,29 +300,23 @@ in decreasing order of importance:
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The file '<code>zone1970.tab</code>' lists geographical locations used
|
||||
to name timezones.
|
||||
It is intended to be an exhaustive list of names for geographic
|
||||
regions as described above; this is a subset of the timezones in the data.
|
||||
Although a '<code>zone1970.tab</code>' location's
|
||||
<a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
|
||||
corresponds to
|
||||
its <a href="https://en.wikipedia.org/wiki/Local_mean_time">local mean
|
||||
time (<abbr>LMT</abbr>)</a> offset with one hour for every 15°
|
||||
east longitude, this relationship is not exact.
|
||||
Guidelines have evolved with time, and names following old versions of
|
||||
this guideline might not follow the current version. When guidelines
|
||||
have changed, old names continue to be supported. Guideline changes
|
||||
have included the following:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Older versions of this package used a different naming scheme,
|
||||
and these older names are still supported.
|
||||
<ul>
|
||||
<li>
|
||||
Older versions of this package used a different naming scheme.
|
||||
See the file '<code>backward</code>' for most of these older names
|
||||
(e.g., '<code>US/Eastern</code>' instead of '<code>America/New_York</code>').
|
||||
The other old-fashioned names still supported are
|
||||
'<code>WET</code>', '<code>CET</code>', '<code>MET</code>', and
|
||||
'<code>EET</code>' (see the file '<code>europe</code>').
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<p>
|
||||
<li>
|
||||
Older versions of this package defined legacy names that are
|
||||
incompatible with the first guideline of location names, but which are
|
||||
still supported.
|
||||
@ -332,6 +327,31 @@ Also, the file '<code>backward</code>' defines the legacy names
|
||||
and the file '<code>northamerica</code>' defines the legacy names
|
||||
'<code>EST5EDT</code>', '<code>CST6CDT</code>',
|
||||
'<code>MST7MDT</code>', and '<code>PST8PDT</code>'.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Older versions of this guideline said that
|
||||
there should typically be at least one name for each <a
|
||||
href="https://en.wikipedia.org/wiki/ISO_3166-1"><abbr
|
||||
title="International Organization for Standardization">ISO</abbr>
|
||||
3166-1</a> officially assigned two-letter code for an inhabited
|
||||
country or territory.
|
||||
This old guideline has been dropped, as it was not needed to handle
|
||||
timestamps correctly and it increased maintenance burden.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The file '<code>zone1970.tab</code>' lists geographical locations used
|
||||
to name timezones.
|
||||
It is intended to be an exhaustive list of names for geographic
|
||||
regions as described above; this is a subset of the timezones in the data.
|
||||
Although a '<code>zone1970.tab</code>' location's
|
||||
<a href="https://en.wikipedia.org/wiki/Longitude">longitude</a>
|
||||
corresponds to
|
||||
its <a href="https://en.wikipedia.org/wiki/Local_mean_time">local mean
|
||||
time (<abbr>LMT</abbr>)</a> offset with one hour for every 15°
|
||||
east longitude, this relationship is not exact.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -983,7 +1003,9 @@ an older <code>zic</code>.
|
||||
constrained to be a string containing abbreviations
|
||||
and numeric data as described <a href="#POSIX">above</a>.
|
||||
The file's format is <dfn><abbr>TZif</abbr></dfn>,
|
||||
a timezone information format that contains binary data.
|
||||
a timezone information format that contains binary data; see
|
||||
<a href="https://tools.ietf.org/html/8536">Internet
|
||||
<abbr>RFC</abbr> 8536</a>.
|
||||
The daylight saving time rules to be used for a
|
||||
particular timezone are encoded in the
|
||||
<abbr>TZif</abbr> file; the format of the file allows <abbr>US</abbr>,
|
||||
@ -1166,7 +1188,7 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces:
|
||||
<ul>
|
||||
<li>
|
||||
A set of timezone names as per
|
||||
"<a href="#naming">Names of timezones</a>" above.
|
||||
"<a href="#naming">Timezone identifiers</a>" above.
|
||||
</li>
|
||||
<li>
|
||||
Library functions described in "<a href="#functions">Time and date
|
||||
@ -1213,6 +1235,17 @@ For example, users should not rely on particular <abbr>UT</abbr>
|
||||
offsets or abbreviations for timestamps, as data entries are often
|
||||
based on guesswork and these guesses may be corrected or improved.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Timezone boundaries are not part of the stable interface.
|
||||
For example, even though the <samp>Asia/Bangkok</samp> timezone
|
||||
currently includes Chang Mai, Hanoi, and Phnom Penh, this is not part
|
||||
of the stable interface and the timezone can split at any time.
|
||||
If a calendar application records a future event in some location other
|
||||
than Bangkok by putting "<samp>Asia/Bangkok</samp>" in the event's record,
|
||||
the application should be robust in the presence of timezone splits
|
||||
between now and the future time.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
@ -1 +1 @@
|
||||
2018i
|
||||
2019a
|
||||
|
@ -16,6 +16,9 @@
|
||||
__RCSID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef VMWARE_GUEST_WORKAROUND
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
@ -1954,6 +1957,15 @@ fill_default_options(Options * options)
|
||||
{
|
||||
char *all_cipher, *all_mac, *all_kex, *all_key;
|
||||
int r;
|
||||
#ifdef VMWARE_GUEST_WORKAROUND
|
||||
char scval[7]; /* "vmware\0" */
|
||||
size_t scsiz = sizeof(scval);
|
||||
int vmwguest = 0;
|
||||
|
||||
if (sysctlbyname("kern.vm_guest", scval, &scsiz, NULL, 0) == 0 &&
|
||||
strcmp(scval, "vmware") == 0)
|
||||
vmwguest = 1;
|
||||
#endif
|
||||
|
||||
if (options->forward_agent == -1)
|
||||
options->forward_agent = 0;
|
||||
@ -2088,8 +2100,18 @@ fill_default_options(Options * options)
|
||||
if (options->visual_host_key == -1)
|
||||
options->visual_host_key = 0;
|
||||
if (options->ip_qos_interactive == -1)
|
||||
#ifdef VMWARE_GUEST_WORKAROUND
|
||||
if (vmwguest)
|
||||
options->ip_qos_interactive = IPTOS_LOWDELAY;
|
||||
else
|
||||
#endif
|
||||
options->ip_qos_interactive = IPTOS_DSCP_AF21;
|
||||
if (options->ip_qos_bulk == -1)
|
||||
#ifdef VMWARE_GUEST_WORKAROUND
|
||||
if (vmwguest)
|
||||
options->ip_qos_bulk = IPTOS_THROUGHPUT;
|
||||
else
|
||||
#endif
|
||||
options->ip_qos_bulk = IPTOS_DSCP_CS1;
|
||||
if (options->request_tty == -1)
|
||||
options->request_tty = REQUEST_TTY_AUTO;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */
|
||||
/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */
|
||||
/*
|
||||
* scp - secure remote copy. This is basically patched BSD rcp which
|
||||
* uses ssh to do the data transfer (instead of using rcmd).
|
||||
@ -626,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **hostp, int *portp,
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Appends a string to an array; returns 0 on success, -1 on alloc failure */
|
||||
static int
|
||||
append(char *cp, char ***ap, size_t *np)
|
||||
{
|
||||
char **tmp;
|
||||
|
||||
if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL)
|
||||
return -1;
|
||||
tmp[(*np)] = cp;
|
||||
(*np)++;
|
||||
*ap = tmp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finds the start and end of the first brace pair in the pattern.
|
||||
* returns 0 on success or -1 for invalid patterns.
|
||||
*/
|
||||
static int
|
||||
find_brace(const char *pattern, int *startp, int *endp)
|
||||
{
|
||||
int i;
|
||||
int in_bracket, brace_level;
|
||||
|
||||
*startp = *endp = -1;
|
||||
in_bracket = brace_level = 0;
|
||||
for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) {
|
||||
switch (pattern[i]) {
|
||||
case '\\':
|
||||
/* skip next character */
|
||||
if (pattern[i + 1] != '\0')
|
||||
i++;
|
||||
break;
|
||||
case '[':
|
||||
in_bracket = 1;
|
||||
break;
|
||||
case ']':
|
||||
in_bracket = 0;
|
||||
break;
|
||||
case '{':
|
||||
if (in_bracket)
|
||||
break;
|
||||
if (pattern[i + 1] == '}') {
|
||||
/* Protect a single {}, for find(1), like csh */
|
||||
i++; /* skip */
|
||||
break;
|
||||
}
|
||||
if (*startp == -1)
|
||||
*startp = i;
|
||||
brace_level++;
|
||||
break;
|
||||
case '}':
|
||||
if (in_bracket)
|
||||
break;
|
||||
if (*startp < 0) {
|
||||
/* Unbalanced brace */
|
||||
return -1;
|
||||
}
|
||||
if (--brace_level <= 0)
|
||||
*endp = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* unbalanced brackets/braces */
|
||||
if (*endp < 0 && (*startp >= 0 || in_bracket))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assembles and records a successfully-expanded pattern, returns -1 on
|
||||
* alloc failure.
|
||||
*/
|
||||
static int
|
||||
emit_expansion(const char *pattern, int brace_start, int brace_end,
|
||||
int sel_start, int sel_end, char ***patternsp, size_t *npatternsp)
|
||||
{
|
||||
char *cp;
|
||||
int o = 0, tail_len = strlen(pattern + brace_end + 1);
|
||||
|
||||
if ((cp = malloc(brace_start + (sel_end - sel_start) +
|
||||
tail_len + 1)) == NULL)
|
||||
return -1;
|
||||
|
||||
/* Pattern before initial brace */
|
||||
if (brace_start > 0) {
|
||||
memcpy(cp, pattern, brace_start);
|
||||
o = brace_start;
|
||||
}
|
||||
/* Current braced selection */
|
||||
if (sel_end - sel_start > 0) {
|
||||
memcpy(cp + o, pattern + sel_start,
|
||||
sel_end - sel_start);
|
||||
o += sel_end - sel_start;
|
||||
}
|
||||
/* Remainder of pattern after closing brace */
|
||||
if (tail_len > 0) {
|
||||
memcpy(cp + o, pattern + brace_end + 1, tail_len);
|
||||
o += tail_len;
|
||||
}
|
||||
cp[o] = '\0';
|
||||
if (append(cp, patternsp, npatternsp) != 0) {
|
||||
free(cp);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Expand the first encountered brace in pattern, appending the expanded
|
||||
* patterns it yielded to the *patternsp array.
|
||||
*
|
||||
* Returns 0 on success or -1 on allocation failure.
|
||||
*
|
||||
* Signals whether expansion was performed via *expanded and whether
|
||||
* pattern was invalid via *invalid.
|
||||
*/
|
||||
static int
|
||||
brace_expand_one(const char *pattern, char ***patternsp, size_t *npatternsp,
|
||||
int *expanded, int *invalid)
|
||||
{
|
||||
int i;
|
||||
int in_bracket, brace_start, brace_end, brace_level;
|
||||
int sel_start, sel_end;
|
||||
|
||||
*invalid = *expanded = 0;
|
||||
|
||||
if (find_brace(pattern, &brace_start, &brace_end) != 0) {
|
||||
*invalid = 1;
|
||||
return 0;
|
||||
} else if (brace_start == -1)
|
||||
return 0;
|
||||
|
||||
in_bracket = brace_level = 0;
|
||||
for (i = sel_start = brace_start + 1; i < brace_end; i++) {
|
||||
switch (pattern[i]) {
|
||||
case '{':
|
||||
if (in_bracket)
|
||||
break;
|
||||
brace_level++;
|
||||
break;
|
||||
case '}':
|
||||
if (in_bracket)
|
||||
break;
|
||||
brace_level--;
|
||||
break;
|
||||
case '[':
|
||||
in_bracket = 1;
|
||||
break;
|
||||
case ']':
|
||||
in_bracket = 0;
|
||||
break;
|
||||
case '\\':
|
||||
if (i < brace_end - 1)
|
||||
i++; /* skip */
|
||||
break;
|
||||
}
|
||||
if (pattern[i] == ',' || i == brace_end - 1) {
|
||||
if (in_bracket || brace_level > 0)
|
||||
continue;
|
||||
/* End of a selection, emit an expanded pattern */
|
||||
|
||||
/* Adjust end index for last selection */
|
||||
sel_end = (i == brace_end - 1) ? brace_end : i;
|
||||
if (emit_expansion(pattern, brace_start, brace_end,
|
||||
sel_start, sel_end, patternsp, npatternsp) != 0)
|
||||
return -1;
|
||||
/* move on to the next selection */
|
||||
sel_start = i + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (in_bracket || brace_level > 0) {
|
||||
*invalid = 1;
|
||||
return 0;
|
||||
}
|
||||
/* success */
|
||||
*expanded = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Expand braces from pattern. Returns 0 on success, -1 on failure */
|
||||
static int
|
||||
brace_expand(const char *pattern, char ***patternsp, size_t *npatternsp)
|
||||
{
|
||||
char *cp, *cp2, **active = NULL, **done = NULL;
|
||||
size_t i, nactive = 0, ndone = 0;
|
||||
int ret = -1, invalid = 0, expanded = 0;
|
||||
|
||||
*patternsp = NULL;
|
||||
*npatternsp = 0;
|
||||
|
||||
/* Start the worklist with the original pattern */
|
||||
if ((cp = strdup(pattern)) == NULL)
|
||||
return -1;
|
||||
if (append(cp, &active, &nactive) != 0) {
|
||||
free(cp);
|
||||
return -1;
|
||||
}
|
||||
while (nactive > 0) {
|
||||
cp = active[nactive - 1];
|
||||
nactive--;
|
||||
if (brace_expand_one(cp, &active, &nactive,
|
||||
&expanded, &invalid) == -1) {
|
||||
free(cp);
|
||||
goto fail;
|
||||
}
|
||||
if (invalid)
|
||||
fatal("%s: invalid brace pattern \"%s\"", __func__, cp);
|
||||
if (expanded) {
|
||||
/*
|
||||
* Current entry expanded to new entries on the
|
||||
* active list; discard the progenitor pattern.
|
||||
*/
|
||||
free(cp);
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Pattern did not expand; append the finename component to
|
||||
* the completed list
|
||||
*/
|
||||
if ((cp2 = strrchr(cp, '/')) != NULL)
|
||||
*cp2++ = '\0';
|
||||
else
|
||||
cp2 = cp;
|
||||
if (append(xstrdup(cp2), &done, &ndone) != 0) {
|
||||
free(cp);
|
||||
goto fail;
|
||||
}
|
||||
free(cp);
|
||||
}
|
||||
/* success */
|
||||
*patternsp = done;
|
||||
*npatternsp = ndone;
|
||||
done = NULL;
|
||||
ndone = 0;
|
||||
ret = 0;
|
||||
fail:
|
||||
for (i = 0; i < nactive; i++)
|
||||
free(active[i]);
|
||||
free(active);
|
||||
for (i = 0; i < ndone; i++)
|
||||
free(done[i]);
|
||||
free(done);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
toremote(int argc, char **argv)
|
||||
{
|
||||
@ -989,7 +1236,8 @@ sink(int argc, char **argv, const char *src)
|
||||
unsigned long long ull;
|
||||
int setimes, targisdir, wrerrno = 0;
|
||||
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048];
|
||||
char *src_copy = NULL, *restrict_pattern = NULL;
|
||||
char **patterns = NULL;
|
||||
size_t n, npatterns = 0;
|
||||
struct timeval tv[2];
|
||||
|
||||
#define atime tv[0]
|
||||
@ -1019,16 +1267,13 @@ sink(int argc, char **argv, const char *src)
|
||||
* Prepare to try to restrict incoming filenames to match
|
||||
* the requested destination file glob.
|
||||
*/
|
||||
if ((src_copy = strdup(src)) == NULL)
|
||||
fatal("strdup failed");
|
||||
if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
|
||||
*restrict_pattern++ = '\0';
|
||||
}
|
||||
if (brace_expand(src, &patterns, &npatterns) != 0)
|
||||
fatal("%s: could not expand pattern", __func__);
|
||||
}
|
||||
for (first = 1;; first = 0) {
|
||||
cp = buf;
|
||||
if (atomicio(read, remin, cp, 1) != 1)
|
||||
return;
|
||||
goto done;
|
||||
if (*cp++ == '\n')
|
||||
SCREWUP("unexpected <newline>");
|
||||
do {
|
||||
@ -1054,7 +1299,7 @@ sink(int argc, char **argv, const char *src)
|
||||
}
|
||||
if (buf[0] == 'E') {
|
||||
(void) atomicio(vwrite, remout, "", 1);
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
if (ch == '\n')
|
||||
*--cp = 0;
|
||||
@ -1129,9 +1374,14 @@ sink(int argc, char **argv, const char *src)
|
||||
run_err("error: unexpected filename: %s", cp);
|
||||
exit(1);
|
||||
}
|
||||
if (restrict_pattern != NULL &&
|
||||
fnmatch(restrict_pattern, cp, 0) != 0)
|
||||
SCREWUP("filename does not match request");
|
||||
if (npatterns > 0) {
|
||||
for (n = 0; n < npatterns; n++) {
|
||||
if (fnmatch(patterns[n], cp, 0) == 0)
|
||||
break;
|
||||
}
|
||||
if (n >= npatterns)
|
||||
SCREWUP("filename does not match request");
|
||||
}
|
||||
if (targisdir) {
|
||||
static char *namebuf;
|
||||
static size_t cursize;
|
||||
@ -1290,7 +1540,15 @@ bad: run_err("%s: %s", np, strerror(errno));
|
||||
break;
|
||||
}
|
||||
}
|
||||
done:
|
||||
for (n = 0; n < npatterns; n++)
|
||||
free(patterns[n]);
|
||||
free(patterns);
|
||||
return;
|
||||
screwup:
|
||||
for (n = 0; n < npatterns; n++)
|
||||
free(patterns[n]);
|
||||
free(patterns);
|
||||
run_err("protocol error: %s", why);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd
|
||||
NO_SHARED?= yes
|
||||
.endif
|
||||
|
||||
DPADD= ${GNURELTOP}/libbfd/libbfd.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
|
||||
DPADD+= ${GNURELTOP}/libopcodes/libopcodes.a
|
||||
DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a
|
||||
LDADD= ${DPADD}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -51,8 +51,8 @@ CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
|
||||
.if ${MK_SHARED_TOOLCHAIN} == "no"
|
||||
NO_SHARED?= yes
|
||||
.endif
|
||||
DPADD= ${GNURELTOP}/libbfd/libbfd.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
|
||||
DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
|
||||
LDADD= ${DPADD}
|
||||
CLEANDIRS+= ldscripts
|
||||
CLEANFILES+= ldemul-list.h stringify.sed
|
||||
|
@ -9,9 +9,9 @@ SRCS= objcopy.c not-strip.c
|
||||
CFLAGS+= -D_GNU_SOURCE
|
||||
CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils
|
||||
CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd
|
||||
DPADD= ${GNURELTOP}/libbinutils/libbinutils.a
|
||||
DPADD+= ${GNURELTOP}/libbfd/libbfd.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
|
||||
DPADD= ${GNURELTOP}/libbinutils/libbinutils${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
|
||||
LDADD= ${DPADD}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -10,10 +10,10 @@ CFLAGS+= -D_GNU_SOURCE
|
||||
CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils
|
||||
CFLAGS+= -I${SRCDIR}/binutils
|
||||
CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
|
||||
DPADD= ${GNURELTOP}/libbinutils/libbinutils.a
|
||||
DPADD+= ${GNURELTOP}/libopcodes/libopcodes.a
|
||||
DPADD+= ${GNURELTOP}/libbfd/libbfd.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
|
||||
DPADD= ${GNURELTOP}/libbinutils/libbinutils${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
|
||||
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
|
||||
LDADD= ${DPADD}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -538,6 +538,7 @@ ${PACKAGE}FILES+= test_read_format_ustar_filename_eucjp.tar.Z.uu
|
||||
${PACKAGE}FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu
|
||||
${PACKAGE}FILES+= test_read_format_warc.warc.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip.zip.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_bz2_hang.zip.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_bzip2.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_bzip2_multi.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_comment_stored_1.zip.uu
|
||||
@ -565,6 +566,8 @@ ${PACKAGE}FILES+= test_read_format_zip_padded1.zip.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_padded2.zip.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_padded3.zip.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_ppmd8.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_ppmd8_crash_1.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_ppmd8_crash_2.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_ppmd8_multi.zipx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_sfx.uu
|
||||
${PACKAGE}FILES+= test_read_format_zip_symlink.zip.uu
|
||||
|
@ -6,8 +6,6 @@ SHLIBDIR?= /lib
|
||||
|
||||
.include <src.opts.mk>
|
||||
|
||||
# BIND_NOW in libc results in segfault at startup (PR 233333)
|
||||
MK_BIND_NOW= no
|
||||
# Force building of libc_pic.a
|
||||
MK_TOOLCHAIN= yes
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
.\" Manual page, using -mandoc macros
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd July 19, 2014
|
||||
.Dd March 21, 2019
|
||||
.Dt ARC4RANDOM 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -116,7 +116,7 @@ and
|
||||
functions using
|
||||
.Fn arc4random :
|
||||
.Pp
|
||||
.Dl "#define foo4random() (arc4random() % ((unsigned)RAND_MAX + 1))"
|
||||
.Dl "#define foo4random() (arc4random_uniform(RAND_MAX + 1))"
|
||||
.Sh SEE ALSO
|
||||
.Xr rand 3 ,
|
||||
.Xr rand48 3 ,
|
||||
|
@ -647,9 +647,9 @@ fts_build(FTS *sp, int type)
|
||||
*/
|
||||
#ifdef FTS_WHITEOUT
|
||||
if (ISSET(FTS_WHITEOUT))
|
||||
oflag = DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_NODUP;
|
||||
else
|
||||
oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_HIDEW | DTF_NODUP;
|
||||
#else
|
||||
#define __opendir2(path, flag) opendir(path)
|
||||
#endif
|
||||
|
@ -644,9 +644,9 @@ fts_build(FTS11 *sp, int type)
|
||||
*/
|
||||
#ifdef FTS_WHITEOUT
|
||||
if (ISSET(FTS_WHITEOUT))
|
||||
oflag = DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_NODUP;
|
||||
else
|
||||
oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_HIDEW | DTF_NODUP;
|
||||
#else
|
||||
#define __opendir2(path, flag) opendir(path)
|
||||
#endif
|
||||
|
@ -641,9 +641,9 @@ fts_build(FTS *sp, int type)
|
||||
*/
|
||||
#ifdef FTS_WHITEOUT
|
||||
if (ISSET(FTS_WHITEOUT))
|
||||
oflag = DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_NODUP;
|
||||
else
|
||||
oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
|
||||
oflag = DTF_HIDEW | DTF_NODUP;
|
||||
#else
|
||||
#define __opendir2(path, flag) opendir(path)
|
||||
#endif
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 22, 2017
|
||||
.Dd March 22, 2019
|
||||
.Dt SYSCTL 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -284,6 +284,7 @@ privilege may change the value.
|
||||
.It Dv HW_FLOATINGPT Ta integer Ta no
|
||||
.It Dv HW_MACHINE_ARCH Ta string Ta no
|
||||
.It Dv HW_REALMEM Ta integer Ta no
|
||||
.It Dv HW_AVAILPAGES Ta integer Ta no
|
||||
.El
|
||||
.Bl -tag -width 6n
|
||||
.It Li HW_MACHINE
|
||||
@ -295,9 +296,10 @@ The number of cpus.
|
||||
.It Li HW_BYTEORDER
|
||||
The byteorder (4321 or 1234).
|
||||
.It Li HW_PHYSMEM
|
||||
The bytes of physical memory.
|
||||
Amount of physical memory (in bytes), minus the amount used by the kernel,
|
||||
pre-loaded modules, and (on x86) the dcons buffer.
|
||||
.It Li HW_USERMEM
|
||||
The bytes of non-kernel memory.
|
||||
Amount of memory (in bytes) which is not wired.
|
||||
.It Li HW_PAGESIZE
|
||||
The software page size.
|
||||
.\".It Fa HW_DISKNAMES
|
||||
@ -307,7 +309,13 @@ Nonzero if the floating point support is in hardware.
|
||||
.It Li HW_MACHINE_ARCH
|
||||
The machine dependent architecture type.
|
||||
.It Li HW_REALMEM
|
||||
The bytes of real memory.
|
||||
Amount of memory (in bytes) reported by the firmware.
|
||||
That value is sometimes not sane; in that case, the kernel reports the max
|
||||
memory address instead.
|
||||
.It Li HW_AVAILPAGES
|
||||
The same value as
|
||||
.Li HW_PHYSMEM ,
|
||||
measured in pages rather than bytes.
|
||||
.El
|
||||
.Ss CTL_KERN
|
||||
The string and integer information available for the CTL_KERN level
|
||||
|
@ -9,7 +9,6 @@ PACKAGE= clibs
|
||||
SHLIBDIR?= /lib
|
||||
|
||||
.include <src.opts.mk>
|
||||
MK_BIND_NOW= no
|
||||
MK_SSP= no
|
||||
|
||||
LIB=thr
|
||||
|
@ -100,8 +100,9 @@ pidfile_read(int dirfd, const char *filename, pid_t *pidptr)
|
||||
}
|
||||
|
||||
struct pidfh *
|
||||
pidfile_open(const char *path, mode_t mode, pid_t *pidptr)
|
||||
pidfile_open(const char *pathp, mode_t mode, pid_t *pidptr)
|
||||
{
|
||||
char path[MAXPATHLEN];
|
||||
struct pidfh *pfh;
|
||||
struct stat sb;
|
||||
int error, fd, dirfd, dirlen, filenamelen, count;
|
||||
@ -112,19 +113,22 @@ pidfile_open(const char *path, mode_t mode, pid_t *pidptr)
|
||||
if (pfh == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (path == NULL) {
|
||||
if (pathp == NULL) {
|
||||
dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir),
|
||||
"/var/run/");
|
||||
filenamelen = snprintf(pfh->pf_filename,
|
||||
sizeof(pfh->pf_filename), "%s.pid", getprogname());
|
||||
} else {
|
||||
dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir),
|
||||
"%s", path);
|
||||
filenamelen = snprintf(pfh->pf_filename,
|
||||
sizeof(pfh->pf_filename), "%s", path);
|
||||
|
||||
dirname(pfh->pf_dir);
|
||||
basename(pfh->pf_filename);
|
||||
if (strlcpy(path, pathp, sizeof(path)) >= sizeof(path)) {
|
||||
free(pfh);
|
||||
errno = ENAMETOOLONG;
|
||||
return (NULL);
|
||||
}
|
||||
dirlen = strlcpy(pfh->pf_dir, dirname(path),
|
||||
sizeof(pfh->pf_dir));
|
||||
(void)strlcpy(path, pathp, sizeof(path));
|
||||
filenamelen = strlcpy(pfh->pf_filename, basename(path),
|
||||
sizeof(pfh->pf_filename));
|
||||
}
|
||||
|
||||
if (dirlen >= (int)sizeof(pfh->pf_dir) ||
|
||||
|
@ -263,6 +263,40 @@ test_pidfile_inherited(void)
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure we handle relative pidfile paths correctly.
|
||||
*/
|
||||
static const char *
|
||||
test_pidfile_relative(void)
|
||||
{
|
||||
char path[PATH_MAX], pid[32], tmpdir[PATH_MAX];
|
||||
struct pidfh *pfh;
|
||||
int fd;
|
||||
|
||||
(void)snprintf(tmpdir, sizeof(tmpdir), "%s.XXXXXX", __func__);
|
||||
if (mkdtemp(tmpdir) == NULL)
|
||||
return (strerror(errno));
|
||||
(void)snprintf(path, sizeof(path), "%s/pidfile", tmpdir);
|
||||
|
||||
pfh = pidfile_open(path, 0600, NULL);
|
||||
if (pfh == NULL)
|
||||
return (strerror(errno));
|
||||
if (pidfile_write(pfh) != 0)
|
||||
return (strerror(errno));
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return (strerror(errno));
|
||||
if (read(fd, pid, sizeof(pid)) < 0)
|
||||
return (strerror(errno));
|
||||
if (atoi(pid) != getpid())
|
||||
return ("pid mismatch");
|
||||
if (close(fd) != 0)
|
||||
return (strerror(errno));
|
||||
if (pidfile_close(pfh) != 0)
|
||||
return (strerror(errno));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static struct test {
|
||||
const char *name;
|
||||
const char *(*func)(void);
|
||||
@ -271,6 +305,7 @@ static struct test {
|
||||
{ "pidfile_self", test_pidfile_self },
|
||||
{ "pidfile_contested", test_pidfile_contested },
|
||||
{ "pidfile_inherited", test_pidfile_inherited },
|
||||
{ "pidfile_relative", test_pidfile_relative },
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -325,21 +325,21 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
|
||||
if (src->Type == MEMBUF) {
|
||||
for (srcline=srcy, dstline=dsty; srcline<srcy+hight; srcline++, dstline++) {
|
||||
WriteVerticalLine(dst, dstx, dstline, width,
|
||||
(src->Bitmap+(srcline*src->VXsize)+srcx));
|
||||
src->Bitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes);
|
||||
}
|
||||
}
|
||||
else if (dst->Type == MEMBUF) {
|
||||
for (srcline=srcy, dstline=dsty; srcline<srcy+hight; srcline++, dstline++) {
|
||||
ReadVerticalLine(src, srcx, srcline, width,
|
||||
(dst->Bitmap+(dstline*dst->VXsize)+dstx));
|
||||
dst->Bitmap+(dstline*dst->VXsize+dstx)*src->PixelBytes);
|
||||
}
|
||||
}
|
||||
else {
|
||||
byte buffer[2048]; /* XXX */
|
||||
byte *p;
|
||||
|
||||
if (width > sizeof(buffer)) {
|
||||
p = malloc(width);
|
||||
if (width * src->PixelBytes > sizeof(buffer)) {
|
||||
p = malloc(width * src->PixelBytes);
|
||||
if (p == NULL)
|
||||
return 1;
|
||||
} else {
|
||||
@ -349,7 +349,7 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
|
||||
ReadVerticalLine(src, srcx, srcline, width, p);
|
||||
WriteVerticalLine(dst, dstx, dstline, width, p);
|
||||
}
|
||||
if (width > sizeof(buffer))
|
||||
if (width * src->PixelBytes > sizeof(buffer))
|
||||
free(p);
|
||||
}
|
||||
return 0;
|
||||
@ -361,9 +361,13 @@ VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
|
||||
{
|
||||
int error;
|
||||
|
||||
VGLMouseFreeze(dstx, dsty, width, hight, 0);
|
||||
if (src->Type != MEMBUF)
|
||||
VGLMouseFreeze(srcx, srcy, width, hight, 0);
|
||||
if (dst->Type != MEMBUF)
|
||||
VGLMouseFreeze(dstx, dsty, width, hight, 0);
|
||||
error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, hight);
|
||||
VGLMouseUnFreeze();
|
||||
if (src->Type != MEMBUF || dst->Type != MEMBUF)
|
||||
VGLMouseUnFreeze();
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -387,6 +391,7 @@ VGLBitmap
|
||||
object->Xorigin = 0;
|
||||
object->Yorigin = 0;
|
||||
object->Bitmap = bits;
|
||||
object->PixelBytes = VGLDisplay->PixelBytes;
|
||||
return object;
|
||||
}
|
||||
|
||||
@ -401,7 +406,7 @@ VGLBitmapDestroy(VGLBitmap *object)
|
||||
int
|
||||
VGLBitmapAllocateBits(VGLBitmap *object)
|
||||
{
|
||||
object->Bitmap = (byte *)malloc(object->VXsize*object->VYsize);
|
||||
object->Bitmap = malloc(object->VXsize*object->VYsize*object->PixelBytes);
|
||||
if (object->Bitmap == NULL)
|
||||
return -1;
|
||||
return 0;
|
||||
|
@ -132,7 +132,7 @@ int
|
||||
VGLInit(int mode)
|
||||
{
|
||||
struct vt_mode smode;
|
||||
int adptype;
|
||||
int adptype, depth;
|
||||
|
||||
if (VGLInitDone)
|
||||
return -1;
|
||||
@ -188,6 +188,7 @@ VGLInit(int mode)
|
||||
return -4;
|
||||
}
|
||||
VGLDisplay->Type = VIDBUF4;
|
||||
VGLDisplay->PixelBytes = 1;
|
||||
break;
|
||||
case V_INFO_MM_PACKED:
|
||||
/* we can do only 256 color packed modes */
|
||||
@ -294,14 +295,17 @@ VGLInit(int mode)
|
||||
|
||||
VGLDisplay->Xsize = VGLModeInfo.vi_width;
|
||||
VGLDisplay->Ysize = VGLModeInfo.vi_height;
|
||||
depth = VGLModeInfo.vi_depth;
|
||||
if (depth == 15)
|
||||
depth = 16;
|
||||
VGLDisplay->VXsize = VGLAdpInfo.va_line_width
|
||||
*8/(VGLModeInfo.vi_depth/VGLModeInfo.vi_planes);
|
||||
*8/(depth/VGLModeInfo.vi_planes);
|
||||
VGLDisplay->VYsize = VGLBufSize/VGLModeInfo.vi_planes/VGLAdpInfo.va_line_width;
|
||||
VGLDisplay->Xorigin = 0;
|
||||
VGLDisplay->Yorigin = 0;
|
||||
|
||||
VGLMem = (byte*)mmap(0, VGLAdpInfo.va_window_size, PROT_READ|PROT_WRITE,
|
||||
MAP_FILE, 0, 0);
|
||||
MAP_FILE | MAP_SHARED, 0, 0);
|
||||
if (VGLMem == MAP_FAILED) {
|
||||
VGLEnd();
|
||||
return -7;
|
||||
@ -350,7 +354,7 @@ VGLCheckSwitch()
|
||||
ioctl(0, VGLMode, 0);
|
||||
VGLCurWindow = 0;
|
||||
VGLMem = (byte*)mmap(0, VGLAdpInfo.va_window_size, PROT_READ|PROT_WRITE,
|
||||
MAP_FILE, 0, 0);
|
||||
MAP_FILE | MAP_SHARED, 0, 0);
|
||||
|
||||
/* XXX: what if mmap() has failed! */
|
||||
VGLDisplay->Type = VIDBUF8; /* XXX */
|
||||
@ -530,6 +534,8 @@ VGLSetSegment(unsigned int offset)
|
||||
int
|
||||
VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize)
|
||||
{
|
||||
int depth;
|
||||
|
||||
if (VXsize < object->Xsize || VYsize < object->Ysize)
|
||||
return -1;
|
||||
if (object->Type == MEMBUF)
|
||||
@ -537,8 +543,11 @@ VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize)
|
||||
if (ioctl(0, FBIO_SETLINEWIDTH, &VXsize))
|
||||
return -1;
|
||||
ioctl(0, CONS_ADPINFO, &VGLAdpInfo); /* FBIO_ADPINFO */
|
||||
depth = VGLModeInfo.vi_depth;
|
||||
if (depth == 15)
|
||||
depth = 16;
|
||||
object->VXsize = VGLAdpInfo.va_line_width
|
||||
*8/(VGLModeInfo.vi_depth/VGLModeInfo.vi_planes);
|
||||
*8/(depth/VGLModeInfo.vi_planes);
|
||||
object->VYsize = VGLBufSize/VGLModeInfo.vi_planes/VGLAdpInfo.va_line_width;
|
||||
if (VYsize < object->VYsize)
|
||||
object->VYsize = VYsize;
|
||||
|
@ -82,7 +82,7 @@ static VGLBitmap VGLMouseStdAndMask =
|
||||
static VGLBitmap VGLMouseStdOrMask =
|
||||
VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask);
|
||||
static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask;
|
||||
static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
|
||||
static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4];
|
||||
static VGLBitmap VGLMouseSave =
|
||||
VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, map);
|
||||
static int VGLMouseVisible = 0;
|
||||
@ -95,13 +95,14 @@ static int VGLMouseButtons = 0;
|
||||
void
|
||||
VGLMousePointerShow()
|
||||
{
|
||||
byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
|
||||
byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4];
|
||||
VGLBitmap buffer =
|
||||
VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf);
|
||||
byte crtcidx, crtcval, gdcidx, gdcval;
|
||||
int pos;
|
||||
int i, pos, pos1;
|
||||
|
||||
if (!VGLMouseVisible) {
|
||||
VGLMouseFrozen++;
|
||||
VGLMouseVisible = 1;
|
||||
crtcidx = inb(0x3c4);
|
||||
crtcval = inb(0x3c5);
|
||||
@ -109,16 +110,22 @@ VGLMousePointerShow()
|
||||
gdcval = inb(0x3cf);
|
||||
__VGLBitmapCopy(VGLDisplay, VGLMouseXpos, VGLMouseYpos,
|
||||
&VGLMouseSave, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
|
||||
bcopy(VGLMouseSave.Bitmap, buffer.Bitmap, MOUSE_IMG_SIZE*MOUSE_IMG_SIZE);
|
||||
bcopy(VGLMouseSave.Bitmap, buffer.Bitmap,
|
||||
MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*VGLDisplay->PixelBytes);
|
||||
for (pos = 0; pos < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; pos++)
|
||||
buffer.Bitmap[pos]=(buffer.Bitmap[pos]&~(VGLMouseAndMask->Bitmap[pos])) |
|
||||
VGLMouseOrMask->Bitmap[pos];
|
||||
for (i = 0; i < VGLDisplay->PixelBytes; i++) {
|
||||
pos1 = pos * VGLDisplay->PixelBytes + i;
|
||||
buffer.Bitmap[pos1] = (buffer.Bitmap[pos1] &
|
||||
~VGLMouseAndMask->Bitmap[pos]) |
|
||||
VGLMouseOrMask->Bitmap[pos];
|
||||
}
|
||||
__VGLBitmapCopy(&buffer, 0, 0, VGLDisplay,
|
||||
VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
|
||||
outb(0x3c4, crtcidx);
|
||||
outb(0x3c5, crtcval);
|
||||
outb(0x3ce, gdcidx);
|
||||
outb(0x3cf, gdcval);
|
||||
VGLMouseFrozen--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,6 +135,7 @@ VGLMousePointerHide()
|
||||
byte crtcidx, crtcval, gdcidx, gdcval;
|
||||
|
||||
if (VGLMouseVisible) {
|
||||
VGLMouseFrozen++;
|
||||
VGLMouseVisible = 0;
|
||||
crtcidx = inb(0x3c4);
|
||||
crtcval = inb(0x3c5);
|
||||
@ -139,6 +147,7 @@ VGLMousePointerHide()
|
||||
outb(0x3c5, crtcval);
|
||||
outb(0x3ce, gdcidx);
|
||||
outb(0x3cf, gdcval);
|
||||
VGLMouseFrozen--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +174,7 @@ VGLMouseAction(int dummy)
|
||||
struct mouse_info mouseinfo;
|
||||
|
||||
if (VGLMouseFrozen) {
|
||||
VGLMouseFrozen++;
|
||||
VGLMouseFrozen += 8;
|
||||
return;
|
||||
}
|
||||
mouseinfo.operation = MOUSE_GETINFO;
|
||||
@ -205,8 +214,22 @@ int
|
||||
VGLMouseInit(int mode)
|
||||
{
|
||||
struct mouse_info mouseinfo;
|
||||
int error;
|
||||
int error, i, mask;
|
||||
|
||||
switch (VGLModeInfo.vi_mem_model) {
|
||||
case V_INFO_MM_PACKED:
|
||||
case V_INFO_MM_PLANAR:
|
||||
mask = 0x0f;
|
||||
break;
|
||||
case V_INFO_MM_VGAX:
|
||||
mask = 0x3f;
|
||||
break;
|
||||
default:
|
||||
mask = 0xff;
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < 256; i++)
|
||||
VGLMouseStdOrMask.Bitmap[i] &= mask;
|
||||
VGLMouseSetStdImage();
|
||||
mouseinfo.operation = MOUSE_MODE;
|
||||
mouseinfo.u.mode.signal = SIGUSR2;
|
||||
@ -234,11 +257,12 @@ VGLMouseStatus(int *x, int *y, char *buttons)
|
||||
}
|
||||
|
||||
int
|
||||
VGLMouseFreeze(int x, int y, int width, int hight, byte color)
|
||||
VGLMouseFreeze(int x, int y, int width, int hight, u_long color)
|
||||
{
|
||||
if (!VGLMouseFrozen) {
|
||||
VGLMouseFrozen = 1;
|
||||
if (width > 1 || hight > 1) { /* bitmap */
|
||||
int i, xstride, ystride;
|
||||
|
||||
VGLMouseFrozen++;
|
||||
if (width > 1 || hight > 1 || (color & 0xc0000000) == 0) { /* bitmap */
|
||||
if (VGLMouseShown == 1) {
|
||||
int overlap;
|
||||
|
||||
@ -260,28 +284,40 @@ VGLMouseFreeze(int x, int y, int width, int hight, byte color)
|
||||
if (VGLMouseShown &&
|
||||
x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE &&
|
||||
y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE) {
|
||||
VGLMouseSave.Bitmap[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)] =
|
||||
(color);
|
||||
if (VGLMouseAndMask->Bitmap
|
||||
[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) {
|
||||
return 1;
|
||||
xstride = VGLDisplay->PixelBytes;
|
||||
ystride = MOUSE_IMG_SIZE * xstride;
|
||||
if (color & 0x40000000) { /* Get */
|
||||
color = 0;
|
||||
for (i = xstride - 1; i >= 0; i--)
|
||||
color = (color << 8) |
|
||||
VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+
|
||||
(x-VGLMouseXpos)*xstride+i];
|
||||
return 0x40000000 | (color & 0xffffff);
|
||||
} else { /* Set */
|
||||
color &= 0xffffff; /* discard flag and other garbage */
|
||||
for (i = 0; i < xstride; i++, color >>= 8)
|
||||
VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+
|
||||
(x-VGLMouseXpos)*xstride+i] = color;
|
||||
if (VGLMouseAndMask->Bitmap
|
||||
[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
VGLMouseUnFreeze()
|
||||
{
|
||||
if (VGLMouseFrozen > 1) {
|
||||
if (VGLMouseFrozen > 8) {
|
||||
VGLMouseFrozen = 0;
|
||||
VGLMouseAction(0);
|
||||
}
|
||||
else {
|
||||
VGLMouseFrozen = 0;
|
||||
if (VGLMouseShown == VGL_MOUSESHOW && !VGLMouseVisible)
|
||||
VGLMousePointerShow();
|
||||
VGLMouseFrozen = 0;
|
||||
}
|
||||
}
|
||||
|
@ -98,9 +98,19 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
||||
|
||||
VGLCheckSwitch();
|
||||
if (x>=0 && x<object->VXsize && y>=0 && y<object->VYsize) {
|
||||
if (!VGLMouseFreeze(x, y, 1, 1, color)) {
|
||||
if (object->Type == MEMBUF ||
|
||||
!VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) {
|
||||
switch (object->Type) {
|
||||
case MEMBUF:
|
||||
switch (object->PixelBytes) {
|
||||
case 2:
|
||||
goto vidbuf16;
|
||||
case 3:
|
||||
goto vidbuf24;
|
||||
case 4:
|
||||
goto vidbuf32;
|
||||
}
|
||||
/* fallthrough */
|
||||
case VIDBUF8:
|
||||
object->Bitmap[y*object->VXsize+x]=((byte)color);
|
||||
break;
|
||||
@ -108,8 +118,11 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
||||
object->Bitmap[VGLSetSegment(y*object->VXsize+x)]=((byte)color);
|
||||
break;
|
||||
case VIDBUF16:
|
||||
vidbuf16:
|
||||
case VIDBUF24:
|
||||
vidbuf24:
|
||||
case VIDBUF32:
|
||||
vidbuf32:
|
||||
color2mem(color, b, object->PixelBytes);
|
||||
bcopy(b, &object->Bitmap[(y*object->VXsize+x) * object->PixelBytes],
|
||||
object->PixelBytes);
|
||||
@ -139,33 +152,41 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color)
|
||||
object->Bitmap[offset] |= (byte)color;
|
||||
}
|
||||
}
|
||||
VGLMouseUnFreeze();
|
||||
if (object->Type != MEMBUF)
|
||||
VGLMouseUnFreeze();
|
||||
}
|
||||
}
|
||||
|
||||
u_long
|
||||
VGLGetXY(VGLBitmap *object, int x, int y)
|
||||
static u_long
|
||||
__VGLGetXY(VGLBitmap *object, int x, int y)
|
||||
{
|
||||
int offset;
|
||||
byte b[4];
|
||||
#if 0
|
||||
int i;
|
||||
u_long color;
|
||||
byte mask;
|
||||
#endif
|
||||
|
||||
VGLCheckSwitch();
|
||||
if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize)
|
||||
return 0;
|
||||
switch (object->Type) {
|
||||
case MEMBUF:
|
||||
switch (object->PixelBytes) {
|
||||
case 2:
|
||||
goto vidbuf16;
|
||||
case 3:
|
||||
goto vidbuf24;
|
||||
case 4:
|
||||
goto vidbuf32;
|
||||
}
|
||||
/* fallthrough */
|
||||
case VIDBUF8:
|
||||
return object->Bitmap[((y*object->VXsize)+x)];
|
||||
case VIDBUF8S:
|
||||
return object->Bitmap[VGLSetSegment(y*object->VXsize+x)];
|
||||
case VIDBUF16:
|
||||
vidbuf16:
|
||||
case VIDBUF24:
|
||||
vidbuf24:
|
||||
case VIDBUF32:
|
||||
vidbuf32:
|
||||
bcopy(&object->Bitmap[(y*object->VXsize+x) * object->PixelBytes],
|
||||
b, object->PixelBytes);
|
||||
return (mem2color(b, object->PixelBytes));
|
||||
@ -185,21 +206,39 @@ VGLGetXY(VGLBitmap *object, int x, int y)
|
||||
case VIDBUF4:
|
||||
offset = y*VGLAdpInfo.va_line_width + x/8;
|
||||
get_planar:
|
||||
#if 1
|
||||
return (object->Bitmap[offset]&(0x80>>(x%8))) ? 1 : 0; /* XXX */
|
||||
#else
|
||||
color = 0;
|
||||
mask = 0x80 >> (x%8);
|
||||
for (i = 0; i < VGLModeInfo.vi_planes; i++) {
|
||||
outb(0x3ce, 0x04); outb(0x3cf, i);
|
||||
color |= (object->Bitmap[offset] & mask) ? (1 << i) : 0;
|
||||
color |= (((volatile VGLBitmap *)object)->Bitmap[offset] & mask) ?
|
||||
(1 << i) : 0;
|
||||
}
|
||||
return color;
|
||||
#endif
|
||||
}
|
||||
return 0; /* XXX black? */
|
||||
}
|
||||
|
||||
u_long
|
||||
VGLGetXY(VGLBitmap *object, int x, int y)
|
||||
{
|
||||
u_long color;
|
||||
|
||||
VGLCheckSwitch();
|
||||
if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize)
|
||||
return 0;
|
||||
if (object->Type != MEMBUF) {
|
||||
color = VGLMouseFreeze(x, y, 1, 1, 0x40000000);
|
||||
if (color & 0x40000000) {
|
||||
VGLMouseUnFreeze();
|
||||
return color & 0xffffff;
|
||||
}
|
||||
}
|
||||
color = __VGLGetXY(object, x, y);
|
||||
if (object->Type != MEMBUF)
|
||||
VGLMouseUnFreeze();
|
||||
return color;
|
||||
}
|
||||
|
||||
/*
|
||||
* Symmetric Double Step Line Algorithm by Brian Wyvill from
|
||||
* "Graphics Gems", Academic Press, 1990.
|
||||
@ -209,7 +248,7 @@ VGLGetXY(VGLBitmap *object, int x, int y)
|
||||
#define SL_ABSOLUTE(i,j,k) ( (i-j)*(k = ( (i-j)<0 ? -1 : 1)))
|
||||
|
||||
void
|
||||
plot(VGLBitmap * object, int x, int y, int flag, byte color)
|
||||
plot(VGLBitmap * object, int x, int y, int flag, u_long color)
|
||||
{
|
||||
/* non-zero flag indicates the pixels need swapping back. */
|
||||
if (flag)
|
||||
@ -506,9 +545,19 @@ VGLClear(VGLBitmap *object, u_long color)
|
||||
byte b[4];
|
||||
|
||||
VGLCheckSwitch();
|
||||
VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); /* XXX */
|
||||
if (object->Type != MEMBUF)
|
||||
VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color);
|
||||
switch (object->Type) {
|
||||
case MEMBUF:
|
||||
switch (object->PixelBytes) {
|
||||
case 2:
|
||||
goto vidbuf16;
|
||||
case 3:
|
||||
goto vidbuf24;
|
||||
case 4:
|
||||
goto vidbuf32;
|
||||
}
|
||||
/* fallthrough */
|
||||
case VIDBUF8:
|
||||
memset(object->Bitmap, (byte)color, object->VXsize*object->VYsize);
|
||||
break;
|
||||
@ -523,8 +572,11 @@ VGLClear(VGLBitmap *object, u_long color)
|
||||
}
|
||||
break;
|
||||
case VIDBUF16:
|
||||
vidbuf16:
|
||||
case VIDBUF24:
|
||||
vidbuf24:
|
||||
case VIDBUF32:
|
||||
vidbuf32:
|
||||
color2mem(color, b, object->PixelBytes);
|
||||
total = object->VXsize*object->VYsize*object->PixelBytes;
|
||||
for (i = 0; i < total; i += object->PixelBytes)
|
||||
@ -540,7 +592,8 @@ VGLClear(VGLBitmap *object, u_long color)
|
||||
VGLSetSegment(offset);
|
||||
len = min(total - offset, VGLAdpInfo.va_window_size);
|
||||
for (i = 0; i < len; i += object->PixelBytes)
|
||||
bcopy(b, object->Bitmap + offset + i, object->PixelBytes);
|
||||
bcopy(b, object->Bitmap + (offset + i) % VGLAdpInfo.va_window_size,
|
||||
object->PixelBytes);
|
||||
offset += len;
|
||||
}
|
||||
break;
|
||||
@ -569,7 +622,8 @@ VGLClear(VGLBitmap *object, u_long color)
|
||||
outb(0x3ce, 0x05); outb(0x3cf, 0x00);
|
||||
break;
|
||||
}
|
||||
VGLMouseUnFreeze();
|
||||
if (object->Type != MEMBUF)
|
||||
VGLMouseUnFreeze();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,7 +66,7 @@ FILE *fd;
|
||||
VGLTextFont->BitmapArray =
|
||||
(byte*)malloc(256*((VGLTextFont->Width + 7)/8)*VGLTextFont->Height);
|
||||
fread(VGLTextFont->BitmapArray, 1,
|
||||
(256*VGLTextFont->Width* VGLTextFont->Height), fd);
|
||||
(256*((VGLTextFont->Width + 7)/8)*VGLTextFont->Height), fd);
|
||||
fclose(fd);
|
||||
}
|
||||
return 0;
|
||||
@ -74,46 +74,50 @@ FILE *fd;
|
||||
|
||||
void
|
||||
VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch,
|
||||
byte fgcol, byte bgcol, int fill, int dir)
|
||||
u_long fgcol, u_long bgcol, int fill, int dir)
|
||||
{
|
||||
int lin, bit;
|
||||
int b, Bpc, Bpl, lin, bit, topbit;
|
||||
|
||||
Bpl = (VGLTextFont->Width + 7) / 8;
|
||||
Bpc = Bpl * VGLTextFont->Height;
|
||||
topbit = VGLTextFont->Width - 1;
|
||||
for(lin = 0; lin < VGLTextFont->Height; lin++) {
|
||||
for(bit = 0; bit < VGLTextFont->Width; bit++) {
|
||||
if (VGLTextFont->BitmapArray[((ch*VGLTextFont->Height)+lin)]&(1<<bit))
|
||||
b = bit + (-VGLTextFont->Width & 7);
|
||||
if (VGLTextFont->BitmapArray[(ch*Bpc)+(lin*Bpl)+(b/8)]&(1<<(b%8)))
|
||||
switch (dir) {
|
||||
case 0:
|
||||
VGLSetXY(Object, (x+7-bit), (y+lin), fgcol);
|
||||
VGLSetXY(Object, (x+topbit-bit), (y+lin), fgcol);
|
||||
break;
|
||||
case 1:
|
||||
VGLSetXY(Object, (x+lin), (y-7+bit), fgcol);
|
||||
VGLSetXY(Object, (x+lin), (y-topbit+bit), fgcol);
|
||||
break;
|
||||
case 2:
|
||||
VGLSetXY(Object, (x-7+bit), (y-lin), fgcol);
|
||||
VGLSetXY(Object, (x-topbit+bit), (y-lin), fgcol);
|
||||
break;
|
||||
case 3:
|
||||
VGLSetXY(Object, (x-lin), (y+7-bit), fgcol);
|
||||
VGLSetXY(Object, (x-lin), (y+topbit-bit), fgcol);
|
||||
break;
|
||||
case 4:
|
||||
VGLSetXY(Object, (x+lin+7-bit), (y+lin+bit), fgcol);
|
||||
VGLSetXY(Object, (x+lin+topbit-bit), (y+lin+bit), fgcol);
|
||||
break;
|
||||
}
|
||||
else if (fill)
|
||||
switch (dir) {
|
||||
case 0:
|
||||
VGLSetXY(Object, (x+7-bit), (y+lin), bgcol);
|
||||
VGLSetXY(Object, (x+topbit-bit), (y+lin), bgcol);
|
||||
break;
|
||||
case 1:
|
||||
VGLSetXY(Object, (x+lin), (y-7+bit), bgcol);
|
||||
VGLSetXY(Object, (x+lin), (y-topbit+bit), bgcol);
|
||||
break;
|
||||
case 2:
|
||||
VGLSetXY(Object, (x-7+bit), (y-lin), bgcol);
|
||||
VGLSetXY(Object, (x-topbit+bit), (y-lin), bgcol);
|
||||
break;
|
||||
case 3:
|
||||
VGLSetXY(Object, (x-lin), (y+7-bit), bgcol);
|
||||
VGLSetXY(Object, (x-lin), (y+topbit-bit), bgcol);
|
||||
break;
|
||||
case 4:
|
||||
VGLSetXY(Object, (x+lin+7-bit), (y+lin+bit), bgcol);
|
||||
VGLSetXY(Object, (x+lin+topbit-bit), (y+lin+bit), bgcol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -122,7 +126,7 @@ VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch,
|
||||
|
||||
void
|
||||
VGLBitmapString(VGLBitmap *Object, int x, int y, char *str,
|
||||
byte fgcol, byte bgcol, int fill, int dir)
|
||||
u_long fgcol, u_long bgcol, int fill, int dir)
|
||||
{
|
||||
int pos;
|
||||
|
||||
|
@ -117,9 +117,9 @@
|
||||
.Ft int
|
||||
.Fn VGLBitmapCopy "VGLBitmap *src" "int srcx" "int srcy" "VGLBitmap *dst" "int dstx" "int dsty" "int width" "int hight"
|
||||
.Ft void
|
||||
.Fn VGLBitmapPutChar "VGLBitmap *Object" "int x" "int y" "byte ch" "byte fgcol" "byte bgcol" "int fill" "int dir"
|
||||
.Fn VGLBitmapPutChar "VGLBitmap *Object" "int x" "int y" "byte ch" "u_long fgcol" "u_long bgcol" "int fill" "int dir"
|
||||
.Ft void
|
||||
.Fn VGLBitmapString "VGLBitmap *Object" "int x" "int y" "char *str" "byte fgcol" "byte bgcol" "int fill" "int dir"
|
||||
.Fn VGLBitmapString "VGLBitmap *Object" "int x" "int y" "char *str" "u_long fgcol" "u_long bgcol" "int fill" "int dir"
|
||||
.Ft void
|
||||
.Fn VGLClear "VGLBitmap *object" "u_long color"
|
||||
.Ft void
|
||||
@ -238,7 +238,7 @@ retrieves the color of the pixel located at
|
||||
.Va x , y ,
|
||||
coordinates of the
|
||||
.Va object
|
||||
argument, and returns it as a byte value.
|
||||
argument, and returns it as a u_long value.
|
||||
.Pp
|
||||
.Fn VGLSetXY
|
||||
sets the color of the pixel located at
|
||||
@ -247,7 +247,7 @@ coordinates of the
|
||||
.Va object
|
||||
argument to
|
||||
.Va color
|
||||
byte value.
|
||||
u_long value.
|
||||
.Pp
|
||||
.Fn VGLLine
|
||||
draw a line from
|
||||
|
@ -49,7 +49,7 @@ typedef struct {
|
||||
} VGLBitmap;
|
||||
|
||||
#define VGLBITMAP_INITIALIZER(t, x, y, bits) \
|
||||
{ (t), (x), (y), (x), (y), 0, 0, (bits) }
|
||||
{ (t), (x), (y), (x), (y), 0, 0, (bits), -1 }
|
||||
|
||||
/*
|
||||
* Defined Type's
|
||||
@ -131,7 +131,7 @@ void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
|
||||
void VGLMouseSetStdImage(void);
|
||||
int VGLMouseInit(int mode);
|
||||
int VGLMouseStatus(int *x, int *y, char *buttons);
|
||||
int VGLMouseFreeze(int x, int y, int width, int hight, byte color);
|
||||
int VGLMouseFreeze(int x, int y, int width, int hight, u_long color);
|
||||
void VGLMouseUnFreeze(void);
|
||||
/* simple.c */
|
||||
void VGLSetXY(VGLBitmap *object, int x, int y, u_long color);
|
||||
@ -150,7 +150,7 @@ void VGLSetBorder(byte color);
|
||||
void VGLBlankDisplay(int blank);
|
||||
/* text.c */
|
||||
int VGLTextSetFontFile(char *filename);
|
||||
void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir);
|
||||
void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir);
|
||||
void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, u_long fgcol, u_long bgcol, int fill, int dir);
|
||||
void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, u_long fgcol, u_long bgcol, int fill, int dir);
|
||||
|
||||
#endif /* !_VGL_H_ */
|
||||
|
@ -196,6 +196,10 @@ ipfilter_program="/sbin/ipf" # where the ipfilter program lives
|
||||
ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see
|
||||
# /usr/src/contrib/ipfilter/rules for examples
|
||||
ipfilter_flags="" # additional flags for ipfilter
|
||||
ippool_enable="NO" # Set to YES to enable ip filter pools
|
||||
ippool_program="/sbin/ippool" # where the ippool program lives
|
||||
ippool_rules="/etc/ippool.tables" # rules definition file for ippool
|
||||
ippool_flags="" # additional flags for ippool
|
||||
ipnat_enable="NO" # Set to YES to enable ipnat functionality
|
||||
ipnat_program="/sbin/ipnat" # where the ipnat program lives
|
||||
ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat
|
||||
|
@ -215,7 +215,8 @@ CONFS+= inetd
|
||||
CONFS+= ipfilter \
|
||||
ipfs \
|
||||
ipmon \
|
||||
ipnat
|
||||
ipnat \
|
||||
ippool
|
||||
.endif
|
||||
|
||||
.if ${MK_IPFW} != "no"
|
||||
|
@ -34,6 +34,15 @@ ipfw_prestart()
|
||||
if checkyesno firewall_nat_enable; then
|
||||
required_modules="$required_modules ipfw_nat"
|
||||
fi
|
||||
if checkyesno firewall_nat64_enable; then
|
||||
required_modules="$required_modules ipfw_nat64"
|
||||
fi
|
||||
if checkyesno firewall_nptv6_enable; then
|
||||
required_modules="$required_modules ipfw_nptv6"
|
||||
fi
|
||||
if checkyesno firewall_pmod_enable; then
|
||||
required_modules="$required_modules ipfw_pmod"
|
||||
fi
|
||||
}
|
||||
|
||||
ipfw_start()
|
||||
|
37
libexec/rc/rc.d/ippool
Executable file
37
libexec/rc/rc.d/ippool
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
# PROVIDE: ippool
|
||||
# REQUIRE: FILESYSTEMS
|
||||
# BEFORE: ipfilter
|
||||
# KEYWORD: nojail
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="ippool"
|
||||
desc="user interface to the IPFilter pools"
|
||||
rcvar="ippool_enable"
|
||||
load_rc_config $name
|
||||
start_precmd="ippool_start_precmd"
|
||||
stop_cmd="${ippool_program} -F"
|
||||
reload_cmd="ippool_reload"
|
||||
extra_commands="reload"
|
||||
required_files="${ippool_rules}"
|
||||
required_modules="ipl:ipfilter"
|
||||
|
||||
ippool_start_precmd()
|
||||
{
|
||||
rc_flags="-f ${ippool_rules} ${rc_flags}"
|
||||
}
|
||||
|
||||
ippool_reload()
|
||||
{
|
||||
echo "Reloading IP Pools."
|
||||
${stop_cmd}
|
||||
${start_cmd}
|
||||
}
|
||||
|
||||
|
||||
run_rc_command "$1"
|
@ -6,7 +6,6 @@
|
||||
|
||||
.include <src.opts.mk>
|
||||
PACKAGE= clibs
|
||||
MK_BIND_NOW= no
|
||||
MK_PIE= no # Always position independent using local rules
|
||||
MK_SSP= no
|
||||
|
||||
|
@ -2956,14 +2956,14 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, int flags,
|
||||
if (obj->ifuncs_resolved)
|
||||
return (0);
|
||||
obj->ifuncs_resolved = true;
|
||||
if (obj->irelative && reloc_iresolve(obj, lockstate) == -1)
|
||||
if (!obj->irelative && !((obj->bind_now || bind_now) && obj->gnu_ifunc))
|
||||
return (0);
|
||||
if (obj_disable_relro(obj) == -1 ||
|
||||
(obj->irelative && reloc_iresolve(obj, lockstate) == -1) ||
|
||||
((obj->bind_now || bind_now) && obj->gnu_ifunc &&
|
||||
reloc_gnu_ifunc(obj, flags, lockstate) == -1) ||
|
||||
obj_enforce_relro(obj) == -1)
|
||||
return (-1);
|
||||
if ((obj->bind_now || bind_now) && obj->gnu_ifunc) {
|
||||
if (obj_disable_relro(obj) ||
|
||||
reloc_gnu_ifunc(obj, flags, lockstate) == -1 ||
|
||||
obj_enforce_relro(obj))
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
|
||||
EMBEDDEDPORTS="sysutils/u-boot-pine64-lts"
|
||||
FAT_SIZE="54m -b 1m"
|
||||
FAT_TYPE="16"
|
||||
IMAGE_SIZE="2560M"
|
||||
IMAGE_SIZE="3072M"
|
||||
KERNEL="GENERIC"
|
||||
MD_ARGS="-x 63 -y 255"
|
||||
NODOC=1
|
||||
|
@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
|
||||
EMBEDDEDPORTS="sysutils/u-boot-pine64"
|
||||
FAT_SIZE="54m -b 1m"
|
||||
FAT_TYPE="16"
|
||||
IMAGE_SIZE="2560M"
|
||||
IMAGE_SIZE="3072M"
|
||||
KERNEL="GENERIC"
|
||||
MD_ARGS="-x 63 -y 255"
|
||||
NODOC=1
|
||||
|
@ -9,7 +9,7 @@ EMBEDDEDBUILD=1
|
||||
EMBEDDEDPORTS="sysutils/u-boot-pinebook"
|
||||
FAT_SIZE="54m -b 1m"
|
||||
FAT_TYPE="16"
|
||||
IMAGE_SIZE="2560M"
|
||||
IMAGE_SIZE="3072M"
|
||||
KERNEL="GENERIC"
|
||||
MD_ARGS="-x 63 -y 255"
|
||||
NODOC=1
|
||||
|
@ -11,7 +11,7 @@ EMBEDDEDBUILD=1
|
||||
EMBEDDEDPORTS="sysutils/u-boot-rpi3 sysutils/rpi-firmware"
|
||||
FAT_SIZE="50m -b 1m"
|
||||
FAT_TYPE="16"
|
||||
IMAGE_SIZE="2560M"
|
||||
IMAGE_SIZE="3072M"
|
||||
KERNEL="GENERIC"
|
||||
MD_ARGS="-x 63 -y 255"
|
||||
NODOC=1
|
||||
|
@ -212,6 +212,10 @@ static struct fw_vendor vendors_list[] = {
|
||||
0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT},
|
||||
{VENDOR_SMART, "SmrtStor", T_DIRECT,
|
||||
0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT},
|
||||
{VENDOR_HGST, "WD", T_DIRECT,
|
||||
0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT},
|
||||
{VENDOR_HGST, "WDC", T_DIRECT,
|
||||
0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT},
|
||||
|
||||
/*
|
||||
* We match any ATA device. This is really just a placeholder,
|
||||
|
@ -35,6 +35,7 @@ static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -329,8 +330,11 @@ delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl,
|
||||
}
|
||||
off = startcl * boot->bpbSecPerClust + boot->ClusterOffset;
|
||||
off *= boot->bpbBytesPerSec;
|
||||
if (lseek(f, off, SEEK_SET) != off
|
||||
|| read(f, delbuf, clsz) != clsz) {
|
||||
if (lseek(f, off, SEEK_SET) != off) {
|
||||
perr("Unable to lseek to %" PRId64, off);
|
||||
return FSFATAL;
|
||||
}
|
||||
if (read(f, delbuf, clsz) != clsz) {
|
||||
perr("Unable to read directory");
|
||||
return FSFATAL;
|
||||
}
|
||||
@ -338,8 +342,11 @@ delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl,
|
||||
*s = SLOT_DELETED;
|
||||
s += 32;
|
||||
}
|
||||
if (lseek(f, off, SEEK_SET) != off
|
||||
|| write(f, delbuf, clsz) != clsz) {
|
||||
if (lseek(f, off, SEEK_SET) != off) {
|
||||
perr("Unable to lseek to %" PRId64, off);
|
||||
return FSFATAL;
|
||||
}
|
||||
if (write(f, delbuf, clsz) != clsz) {
|
||||
perr("Unable to write directory");
|
||||
return FSFATAL;
|
||||
}
|
||||
|
@ -1083,7 +1083,7 @@ execute_script(char *argv[])
|
||||
error = access(script, X_OK);
|
||||
if (error == 0) {
|
||||
execv(script, argv + 1);
|
||||
warning("can't exec %s: %m", script);
|
||||
warning("can't directly exec %s: %m", script);
|
||||
} else if (errno != EACCES) {
|
||||
warning("can't access %s: %m", script);
|
||||
}
|
||||
|
@ -37,6 +37,9 @@ LIBADD+= crypto
|
||||
CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
|
||||
.endif
|
||||
|
||||
# Workaround VMware Workstation NAT bug
|
||||
CFLAGS+=-DVMWARE_GUEST_WORKAROUND
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
@ -45,8 +45,9 @@
|
||||
# Additionally the following CPU types are recognized by clang:
|
||||
# Intel x86 architecture (for both amd64 and i386):
|
||||
# (AMD CPUs) znver1, bdver4, bdver3, bdver2, bdver1, btver2, btver1
|
||||
# (Intel CPUs) cannonlake, knm, skylake-avx512, knl, goldmont,
|
||||
# skylake, broadwell, haswell, ivybridge,
|
||||
# (Intel CPUs) cascadelake, tremont, goldmont-plus, icelake-server,
|
||||
# icelake-client, cannonlake, knm, skylake-avx512, knl,
|
||||
# goldmont, skylake, broadwell, haswell, ivybridge,
|
||||
# sandybridge, westmere, nehalem, silvermont, bonnell
|
||||
#
|
||||
# (?= allows to buildworld for a different CPUTYPE.)
|
||||
|
@ -546,6 +546,7 @@ MAN= aac.4 \
|
||||
${_virtio_console.4} \
|
||||
${_virtio_random.4} \
|
||||
${_virtio_scsi.4} \
|
||||
${_vmci.4} \
|
||||
vkbd.4 \
|
||||
vlan.4 \
|
||||
vxlan.4 \
|
||||
@ -821,6 +822,7 @@ _spkr.4= spkr.4
|
||||
_tpm.4= tpm.4
|
||||
_urtw.4= urtw.4
|
||||
_viawd.4= viawd.4
|
||||
_vmci.4= vmci.4
|
||||
_wbwd.4= wbwd.4
|
||||
_wpi.4= wpi.4
|
||||
_xen.4= xen.4
|
||||
|
@ -25,7 +25,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 9, 2006
|
||||
.Dd February 26, 2019
|
||||
.Dt GEOM_UZIP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -34,7 +34,7 @@
|
||||
.\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd August 6, 2018
|
||||
.Dd March 23, 2019
|
||||
.Dt TCP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -459,7 +459,7 @@ The actual limit applied to a session's reassembly queue will be the lower of
|
||||
the system-calculated automatic limit and the user-specified
|
||||
.Va reass.maxqueuelen
|
||||
limit.
|
||||
.It Va rexmit_min , rexmit_slop
|
||||
.It Va rexmit_initial , rexmit_min , rexmit_slop
|
||||
Adjust the retransmit timer calculation for
|
||||
.Tn TCP .
|
||||
The slop is
|
||||
@ -481,6 +481,7 @@ code.
|
||||
For this reason, we use 200ms of slop and a near-0
|
||||
minimum, which gives us an effective minimum of 200ms (similar to
|
||||
.Tn Linux ) .
|
||||
The initial value is used before an RTT measurement has been performed.
|
||||
.It Va initcwnd_segments
|
||||
Enable the ability to specify initial congestion window in number of segments.
|
||||
The default value is 10 as suggested by RFC 6928.
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 19, 2018
|
||||
.Dd March 21, 2019
|
||||
.Dt RC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -573,9 +573,11 @@ equivalent of
|
||||
.Va natd_enable .
|
||||
Setting this to
|
||||
.Dq Li YES
|
||||
enables kernel NAT.
|
||||
will automatically load the
|
||||
.Xr ipfw 8
|
||||
NAT kernel module if
|
||||
.Va firewall_enable
|
||||
must also be set to
|
||||
is also set to
|
||||
.Dq Li YES .
|
||||
.It Va firewall_nat_interface
|
||||
.Pq Vt str
|
||||
@ -588,6 +590,36 @@ kernel NAT should run.
|
||||
.It Va firewall_nat_flags
|
||||
.Pq Vt str
|
||||
Additional configuration parameters for kernel NAT should be placed here.
|
||||
.It Va firewall_nat64_enable
|
||||
.Pq Vt bool
|
||||
Setting this to
|
||||
.Dq Li YES
|
||||
will automatically load the
|
||||
.Xr ipfw 8
|
||||
NAT64 kernel module if
|
||||
.Va firewall_enable
|
||||
is also set to
|
||||
.Dq Li YES .
|
||||
.It Va firewall_nptv6_enable
|
||||
.Pq Vt bool
|
||||
Setting this to
|
||||
.Dq Li YES
|
||||
will automatically load the
|
||||
.Xr ipfw 8
|
||||
NPTv6 kernel module if
|
||||
.Va firewall_enable
|
||||
is also set to
|
||||
.Dq Li YES .
|
||||
.It Va firewall_pmod_enable
|
||||
.Pq Vt bool
|
||||
Setting this to
|
||||
.Dq Li YES
|
||||
will automatically load the
|
||||
.Xr ipfw 8
|
||||
pmod kernel module if
|
||||
.Va firewall_enable
|
||||
is also set to
|
||||
.Dq Li YES .
|
||||
.It Va dummynet_enable
|
||||
.Pq Vt bool
|
||||
Setting this to
|
||||
|
@ -254,6 +254,7 @@ maxim [label="Maxim Konovalov\nmaxim@FreeBSD.org\n2002/02/07"]
|
||||
mdf [label="Matthew Fleming\nmdf@FreeBSD.org\n2010/06/04"]
|
||||
mdodd [label="Matthew N. Dodd\nmdodd@FreeBSD.org\n1999/07/27"]
|
||||
melifaro [label="Alexander V. Chernikov\nmelifaro@FreeBSD.org\n2011/10/04"]
|
||||
mhorne [label="Mitchell Horne\nmhorne@FreeBSD.org\n2019/03/20"]
|
||||
miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2011/02/18\n2018/06/14"]
|
||||
mizhka [label="Michael Zhilin\nmizhka@FreeBSD.org\n2016/07/19"]
|
||||
mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"]
|
||||
@ -693,6 +694,7 @@ marcel -> sjg
|
||||
|
||||
markj -> cem
|
||||
markj -> lwhsu
|
||||
markj -> mhorne
|
||||
markj -> rlibby
|
||||
|
||||
markm -> jasone
|
||||
|
@ -232,7 +232,7 @@ LK LKA 144 Sri Lanka
|
||||
SD SDN 729 Sudan
|
||||
SR SUR 740 Suriname
|
||||
SJ SJM 744 Svalbard and Jan Mayen
|
||||
SZ SWZ 748 Swaziland
|
||||
SZ SWZ 748 Eswatini
|
||||
SE SWE 752 Sweden
|
||||
CH CHE 756 Switzerland
|
||||
SY SYR 760 Syrian Arab Republic
|
||||
|
@ -31,6 +31,8 @@ MACHINE_CPU = ultrasparc
|
||||
. if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
|
||||
. if ${CPUTYPE} == "barcelona"
|
||||
CPUTYPE = amdfam10
|
||||
. elif ${CPUTYPE} == "skx"
|
||||
CPUTYPE = skylake-avx512
|
||||
. elif ${CPUTYPE} == "core-avx2"
|
||||
CPUTYPE = haswell
|
||||
. elif ${CPUTYPE} == "core-avx-i"
|
||||
@ -199,15 +201,18 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586
|
||||
MACHINE_CPU = mmx k6 k5 i586
|
||||
. elif ${CPUTYPE} == "k5"
|
||||
MACHINE_CPU = k5 i586
|
||||
. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
|
||||
${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl"
|
||||
. elif ${CPUTYPE} == "cascadelake" || ${CPUTYPE} == "icelake-server" || \
|
||||
${CPUTYPE} == "icelake-client" || ${CPUTYPE} == "cannonlake" || \
|
||||
${CPUTYPE} == "knm" || ${CPUTYPE} == "skylake-avx512" || \
|
||||
${CPUTYPE} == "knl"
|
||||
MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
|
||||
. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \
|
||||
${CPUTYPE} == "haswell"
|
||||
MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
|
||||
. elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
|
||||
MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
|
||||
. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
|
||||
. elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \
|
||||
${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
|
||||
${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont"
|
||||
MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
|
||||
. elif ${CPUTYPE} == "penryn"
|
||||
@ -262,15 +267,18 @@ MACHINE_CPU = k8 3dnow sse3
|
||||
. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
|
||||
${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8"
|
||||
MACHINE_CPU = k8 3dnow
|
||||
. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
|
||||
${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl"
|
||||
. elif ${CPUTYPE} == "cascadelake" || ${CPUTYPE} == "icelake-server" || \
|
||||
${CPUTYPE} == "icelake-client" || ${CPUTYPE} == "cannonlake" || \
|
||||
${CPUTYPE} == "knm" || ${CPUTYPE} == "skylake-avx512" || \
|
||||
${CPUTYPE} == "knl"
|
||||
MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3
|
||||
. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \
|
||||
${CPUTYPE} == "haswell"
|
||||
MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3
|
||||
. elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
|
||||
MACHINE_CPU = avx sse42 sse41 ssse3 sse3
|
||||
. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
|
||||
. elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \
|
||||
${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
|
||||
${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont"
|
||||
MACHINE_CPU = sse42 sse41 ssse3 sse3
|
||||
. elif ${CPUTYPE} == "penryn"
|
||||
|
@ -9,7 +9,8 @@ GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1
|
||||
GTESTS_CXXFLAGS+= -frtti
|
||||
GTESTS_CXXFLAGS+= -std=${CXXSTD}
|
||||
|
||||
# XXX: src.libnames.mk should handle adding this directory.
|
||||
GTESTS_CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private
|
||||
# XXX: src.libnames.mk should handle adding this directory for libgtest's,
|
||||
# libgmock's, etc, headers.
|
||||
CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private
|
||||
|
||||
NO_WTHREAD_SAFETY=
|
||||
|
@ -182,7 +182,6 @@ __DEFAULT_YES_OPTIONS = \
|
||||
TELNET \
|
||||
TEXTPROC \
|
||||
TFTP \
|
||||
TIMED \
|
||||
UNBOUND \
|
||||
USB \
|
||||
UTMPX \
|
||||
|
@ -129,15 +129,8 @@ ptable_print(void *arg, const char *pname, const struct ptable_entry *part)
|
||||
dev.dd.d_dev = pa->dev->dd.d_dev;
|
||||
dev.dd.d_unit = pa->dev->dd.d_unit;
|
||||
dev.d_slice = part->index;
|
||||
dev.d_partition = -1;
|
||||
dev.d_partition = D_PARTNONE;
|
||||
if (disk_open(&dev, partsize, sectsize) == 0) {
|
||||
/*
|
||||
* disk_open() for partition -1 on a bsd slice assumes
|
||||
* you want the first bsd partition. Reset things so
|
||||
* that we're looking at the start of the raw slice.
|
||||
*/
|
||||
dev.d_partition = -1;
|
||||
dev.d_offset = part->start;
|
||||
table = ptable_open(&dev, partsize, sectsize, ptblread);
|
||||
if (table != NULL) {
|
||||
sprintf(line, " %s%s", pa->prefix, pname);
|
||||
@ -244,8 +237,8 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize)
|
||||
*/
|
||||
memcpy(&partdev, dev, sizeof(partdev));
|
||||
partdev.d_offset = 0;
|
||||
partdev.d_slice = -1;
|
||||
partdev.d_partition = -1;
|
||||
partdev.d_slice = D_SLICENONE;
|
||||
partdev.d_partition = D_PARTNONE;
|
||||
|
||||
dev->d_offset = 0;
|
||||
table = NULL;
|
||||
@ -373,9 +366,9 @@ disk_fmtdev(struct disk_devdesc *dev)
|
||||
char *cp;
|
||||
|
||||
cp = buf + sprintf(buf, "%s%d", dev->dd.d_dev->dv_name, dev->dd.d_unit);
|
||||
if (dev->d_slice >= 0) {
|
||||
if (dev->d_slice > D_SLICENONE) {
|
||||
#ifdef LOADER_GPT_SUPPORT
|
||||
if (dev->d_partition == 255) {
|
||||
if (dev->d_partition == D_PARTISGPT) {
|
||||
sprintf(cp, "p%d:", dev->d_slice);
|
||||
return (buf);
|
||||
} else
|
||||
@ -384,7 +377,7 @@ disk_fmtdev(struct disk_devdesc *dev)
|
||||
cp += sprintf(cp, "s%d", dev->d_slice);
|
||||
#endif
|
||||
}
|
||||
if (dev->d_partition >= 0)
|
||||
if (dev->d_partition > D_PARTNONE)
|
||||
cp += sprintf(cp, "%c", dev->d_partition + 'a');
|
||||
strcat(cp, ":");
|
||||
return (buf);
|
||||
@ -398,7 +391,9 @@ disk_parsedev(struct disk_devdesc *dev, const char *devspec, const char **path)
|
||||
char *cp;
|
||||
|
||||
np = devspec;
|
||||
unit = slice = partition = -1;
|
||||
unit = -1;
|
||||
slice = D_SLICEWILD;
|
||||
partition = D_PARTWILD;
|
||||
if (*np != '\0' && *np != ':') {
|
||||
unit = strtol(np, &cp, 10);
|
||||
if (cp == np)
|
||||
|
@ -32,32 +32,35 @@
|
||||
*
|
||||
* Whole disk access:
|
||||
*
|
||||
* d_slice = -1
|
||||
* d_partition = -1
|
||||
* d_slice = D_SLICENONE
|
||||
* d_partition = <doesn't matter>
|
||||
*
|
||||
* Whole MBR slice:
|
||||
*
|
||||
* d_slice = MBR slice number (typically 1..4)
|
||||
* d_partition = -1
|
||||
* d_partition = D_PARTNONE
|
||||
*
|
||||
* BSD disklabel partition within an MBR slice:
|
||||
*
|
||||
* d_slice = MBR slice number (typically 1..4)
|
||||
* d_partition = disklabel partition (typically 0..19)
|
||||
* d_partition = disklabel partition (typically 0..19 or D_PARTWILD)
|
||||
*
|
||||
* BSD disklabel partition on the true dedicated disk:
|
||||
*
|
||||
* d_slice = -1
|
||||
* d_partition = disklabel partition (typically 0..19)
|
||||
* d_slice = D_SLICENONE
|
||||
* d_partition = disklabel partition (typically 0..19 or D_PARTWILD)
|
||||
*
|
||||
* GPT partition:
|
||||
*
|
||||
* d_slice = GPT partition number (typically 1..N)
|
||||
* d_partition = 255
|
||||
* d_partition = D_PARTISGPT
|
||||
*
|
||||
* For both MBR and GPT, to automatically find the 'best' slice or partition,
|
||||
* set d_slice to zero. This uses the partition type to decide which partition
|
||||
* to use according to the following list of preferences:
|
||||
* For MBR, setting d_partition to D_PARTWILD will automatically use the first
|
||||
* partition within the slice.
|
||||
*
|
||||
* For both MBR and GPT, to automatically find the 'best' slice and partition,
|
||||
* set d_slice to D_SLICEWILD. This uses the partition type to decide which
|
||||
* partition to use according to the following list of preferences:
|
||||
*
|
||||
* FreeBSD (active)
|
||||
* FreeBSD (inactive)
|
||||
@ -81,6 +84,12 @@
|
||||
#ifndef _DISK_H
|
||||
#define _DISK_H
|
||||
|
||||
#define D_SLICENONE -1
|
||||
#define D_SLICEWILD 0
|
||||
#define D_PARTNONE -1
|
||||
#define D_PARTWILD -2
|
||||
#define D_PARTISGPT 255
|
||||
|
||||
struct disk_devdesc {
|
||||
struct devdesc dd; /* Must be first. */
|
||||
int d_slice;
|
||||
|
@ -813,8 +813,8 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t *pdlist, int verbose)
|
||||
pd->pd_blkio = blkio;
|
||||
pd_dev.dd.d_dev = dev;
|
||||
pd_dev.dd.d_unit = pd->pd_unit;
|
||||
pd_dev.d_slice = -1;
|
||||
pd_dev.d_partition = -1;
|
||||
pd_dev.d_slice = D_SLICENONE;
|
||||
pd_dev.d_partition = D_PARTNONE;
|
||||
ret = disk_open(&pd_dev, blkio->Media->BlockSize *
|
||||
(blkio->Media->LastBlock + 1),
|
||||
blkio->Media->BlockSize);
|
||||
|
@ -217,12 +217,12 @@ set_currdev_pdinfo(pdinfo_t *dp)
|
||||
currdev.dd.d_dev = dp->pd_devsw;
|
||||
if (dp->pd_parent == NULL) {
|
||||
currdev.dd.d_unit = dp->pd_unit;
|
||||
currdev.d_slice = -1;
|
||||
currdev.d_partition = -1;
|
||||
currdev.d_slice = D_SLICENONE;
|
||||
currdev.d_partition = D_PARTNONE;
|
||||
} else {
|
||||
currdev.dd.d_unit = dp->pd_parent->pd_unit;
|
||||
currdev.d_slice = dp->pd_unit;
|
||||
currdev.d_partition = 255; /* Assumes GPT */
|
||||
currdev.d_partition = D_PARTISGPT; /* XXX Assumes GPT */
|
||||
}
|
||||
set_currdev_devdesc((struct devdesc *)&currdev);
|
||||
} else {
|
||||
|
@ -691,8 +691,8 @@ bd_print_common(struct devsw *dev, bdinfo_list_t *bdi, int verbose)
|
||||
|
||||
devd.dd.d_dev = dev;
|
||||
devd.dd.d_unit = i;
|
||||
devd.d_slice = -1;
|
||||
devd.d_partition = -1;
|
||||
devd.d_slice = D_SLICENONE;
|
||||
devd.d_partition = D_PARTNONE;
|
||||
if (disk_open(&devd,
|
||||
bd->bd_sectorsize * bd->bd_sectors,
|
||||
bd->bd_sectorsize) == 0) {
|
||||
@ -745,8 +745,8 @@ bd_disk_get_sectors(struct disk_devdesc *dev)
|
||||
|
||||
disk.dd.d_dev = dev->dd.d_dev;
|
||||
disk.dd.d_unit = dev->dd.d_unit;
|
||||
disk.d_slice = -1;
|
||||
disk.d_partition = -1;
|
||||
disk.d_slice = D_SLICENONE;
|
||||
disk.d_partition = D_PARTNONE;
|
||||
disk.d_offset = 0;
|
||||
|
||||
size = bd->bd_sectors * bd->bd_sectorsize;
|
||||
|
@ -78,6 +78,3 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
|
||||
SRCS= zfsboot.c
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
# XXX: clang integrated-as doesn't grok .codeNN directives yet
|
||||
CFLAGS.zfsldr.S= ${CLANG_NO_IAS}
|
||||
|
@ -588,7 +588,7 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid)
|
||||
int slice = dev->d_slice;
|
||||
|
||||
free(dev);
|
||||
if (partition != -1 && slice != -1) {
|
||||
if (partition != D_PARTNONE && slice != D_SLICENONE) {
|
||||
ret = zfs_probe(pa.fd, pool_guid);
|
||||
if (ret == 0)
|
||||
return (0);
|
||||
|
@ -45,7 +45,6 @@ local MSG_FAILOPENCFG = "Failed to open config: '%s'"
|
||||
local MSG_FAILREADCFG = "Failed to read config: '%s'"
|
||||
local MSG_FAILPARSECFG = "Failed to parse config: '%s'"
|
||||
local MSG_FAILEXBEF = "Failed to execute '%s' before loading '%s'"
|
||||
local MSG_FAILEXMOD = "Failed to execute '%s'"
|
||||
local MSG_FAILEXAF = "Failed to execute '%s' after loading '%s'"
|
||||
local MSG_MALFORMED = "Malformed line (%d):\n\t'%s'"
|
||||
local MSG_DEFAULTKERNFAIL = "No kernel set, failed to load from module_path"
|
||||
|
@ -494,7 +494,7 @@ function menu.autoboot(delay)
|
||||
end
|
||||
|
||||
-- CLI commands
|
||||
function cli.menu(...)
|
||||
function cli.menu()
|
||||
menu.run()
|
||||
end
|
||||
|
||||
|
@ -40,6 +40,12 @@ local show_password_mask = false
|
||||
local twiddle_chars = {"/", "-", "\\", "|"}
|
||||
local screen_setup = false
|
||||
|
||||
local function setup_screen()
|
||||
screen.clear()
|
||||
screen.defcursor()
|
||||
screen_setup = true
|
||||
end
|
||||
|
||||
-- Module exports
|
||||
function password.read(prompt_length)
|
||||
local str = ""
|
||||
@ -90,9 +96,7 @@ function password.check()
|
||||
end
|
||||
|
||||
if not screen_setup then
|
||||
screen.clear()
|
||||
screen.defcursor()
|
||||
screen_setup = true
|
||||
setup_screen()
|
||||
end
|
||||
|
||||
while true do
|
||||
@ -131,6 +135,11 @@ function password.check()
|
||||
local pwd = loader.getenv("password")
|
||||
if pwd ~= nil then
|
||||
core.autoboot()
|
||||
-- The autoboot sequence was interrupted, so we'll need to
|
||||
-- prompt for a password. Put the screen back into a known
|
||||
-- good state, otherwise we're drawing back a couple lines
|
||||
-- in the middle of other text.
|
||||
setup_screen()
|
||||
end
|
||||
compare("Loader password:", pwd)
|
||||
end
|
||||
|
@ -129,8 +129,8 @@ beri_cfi_disk_print(int verbose)
|
||||
return (ret);
|
||||
dev.dd.d_dev = &beri_cfi_disk;
|
||||
dev.dd.d_unit = 0;
|
||||
dev.d_slice = -1;
|
||||
dev.d_partition = -1;
|
||||
dev.d_slice = D_SLICENONE;
|
||||
dev.d_partition = D_PARTNONE;
|
||||
if (disk_open(&dev, cfi_get_mediasize(), cfi_get_sectorsize()) == 0) {
|
||||
snprintf(line, sizeof(line), " cfi%d", 0);
|
||||
ret = disk_print(&dev, line, verbose);
|
||||
|
@ -135,8 +135,8 @@ beri_sdcard_disk_print(int verbose)
|
||||
return (ret);
|
||||
dev.dd.d_dev = &beri_sdcard_disk;
|
||||
dev.dd.d_unit = 0;
|
||||
dev.d_slice = -1;
|
||||
dev.d_partition = -1;
|
||||
dev.d_slice = D_SLICENONE;
|
||||
dev.d_partition = D_PARTNONE;
|
||||
if (disk_open(&dev, altera_sdcard_get_mediasize(),
|
||||
altera_sdcard_get_sectorsize()) == 0) {
|
||||
snprintf(line, sizeof(line), " sdcard%d", 0);
|
||||
|
@ -213,8 +213,8 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
|
||||
|
||||
*type = DEV_TYP_NONE;
|
||||
*unit = -1;
|
||||
*slice = 0;
|
||||
*partition = -1;
|
||||
*slice = D_SLICEWILD;
|
||||
*partition = D_PARTWILD;
|
||||
|
||||
devstr = ub_env_get("loaderdev");
|
||||
if (devstr == NULL) {
|
||||
@ -295,7 +295,7 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
|
||||
if (p == endp) {
|
||||
*type = DEV_TYP_NONE;
|
||||
*unit = -1;
|
||||
*slice = 0;
|
||||
*slice = D_SLICEWILD;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
|
||||
if (*p != '.') {
|
||||
*type = DEV_TYP_NONE;
|
||||
*unit = -1;
|
||||
*slice = 0;
|
||||
*slice = D_SLICEWILD;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -329,8 +329,8 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
|
||||
/* Junk beyond partition number. */
|
||||
*type = DEV_TYP_NONE;
|
||||
*unit = -1;
|
||||
*slice = 0;
|
||||
*partition = -1;
|
||||
*slice = D_SLICEWILD;
|
||||
*partition = D_PARTWILD;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -339,15 +339,20 @@ print_disk_probe_info()
|
||||
char slice[32];
|
||||
char partition[32];
|
||||
|
||||
if (currdev.d_disk.d_slice > 0)
|
||||
sprintf(slice, "%d", currdev.d_disk.d_slice);
|
||||
if (currdev.d_disk.d_slice == D_SLICENONE)
|
||||
strlcpy(slice, "<none>", sizeof(slice));
|
||||
else if (currdev.d_disk.d_slice == D_SLICEWILD)
|
||||
strlcpy(slice, "<auto>", sizeof(slice));
|
||||
else
|
||||
strcpy(slice, "<auto>");
|
||||
snprintf(slice, sizeof(slice), "%d", currdev.d_disk.d_slice);
|
||||
|
||||
if (currdev.d_disk.d_partition >= 0)
|
||||
sprintf(partition, "%d", currdev.d_disk.d_partition);
|
||||
if (currdev.d_disk.d_partition == D_PARTNONE)
|
||||
strlcpy(partition, "<none>", sizeof(partition));
|
||||
else if (currdev.d_disk.d_partition == D_PARTWILD)
|
||||
strlcpy(partition, "<auto>", sizeof(partition));
|
||||
else
|
||||
strcpy(partition, "<auto>");
|
||||
snprintf(partition, sizeof(partition), "%d",
|
||||
currdev.d_disk.d_partition);
|
||||
|
||||
printf(" Checking unit=%d slice=%s partition=%s...",
|
||||
currdev.dd.d_unit, slice, partition);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user