sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-10-08 00:42:41 +00:00
parent a959d2beea
commit 3252c81e6b
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
29 changed files with 283 additions and 186 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ls.c,v 1.54 2020/10/07 21:03:09 millert Exp $ */ /* $OpenBSD: ls.c,v 1.56 2023/10/07 13:29:08 schwarze Exp $ */
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */ /* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/* /*
@ -436,12 +436,12 @@ display(FTSENT *p, FTSENT *list)
unsigned long long btotal; unsigned long long btotal;
blkcnt_t maxblock; blkcnt_t maxblock;
ino_t maxinode; ino_t maxinode;
unsigned int maxmajor, maxminor;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser, maxlen; int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser, maxlen;
int entries, needstats; int entries, needstats;
int width; int width;
const char *user, *group; const char *user, *group;
char nuser[12], ngroup[12]; char nuser[12], ngroup[12];
char buf[21]; /* 64 bits == 20 digits */
char *flags = NULL; char *flags = NULL;
needstats = f_inode || f_longform || f_size; needstats = f_inode || f_longform || f_size;
@ -449,6 +449,7 @@ display(FTSENT *p, FTSENT *list)
btotal = maxblock = maxinode = maxlen = maxnlink = 0; btotal = maxblock = maxinode = maxlen = maxnlink = 0;
bcfile = 0; bcfile = 0;
maxuser = maxgroup = maxflags = 0; maxuser = maxgroup = maxflags = 0;
maxmajor = maxminor = 0;
maxsize = 0; maxsize = 0;
for (cur = list, entries = 0; cur != NULL; cur = cur->fts_link) { for (cur = list, entries = 0; cur != NULL; cur = cur->fts_link) {
if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) { if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) {
@ -523,9 +524,13 @@ display(FTSENT *p, FTSENT *list)
(void)strlcpy(np->group, group, glen + 1); (void)strlcpy(np->group, group, glen + 1);
if (S_ISCHR(sp->st_mode) || if (S_ISCHR(sp->st_mode) ||
S_ISBLK(sp->st_mode)) S_ISBLK(sp->st_mode)) {
bcfile = 1; bcfile = 1;
if (maxmajor < major(sp->st_rdev))
maxmajor = major(sp->st_rdev);
if (maxminor < minor(sp->st_rdev))
maxminor = minor(sp->st_rdev);
}
if (f_flags) { if (f_flags) {
np->flags = &np->data[ulen + 1 + glen + 1]; np->flags = &np->data[ulen + 1 + glen + 1];
(void)strlcpy(np->flags, flags, flen + 1); (void)strlcpy(np->flags, flags, flen + 1);
@ -551,25 +556,29 @@ display(FTSENT *p, FTSENT *list)
d.entries = entries; d.entries = entries;
d.maxlen = maxlen; d.maxlen = maxlen;
if (needstats) { if (needstats) {
d.bcfile = bcfile;
d.btotal = btotal; d.btotal = btotal;
(void)snprintf(buf, sizeof(buf), "%llu", d.s_block = snprintf(NULL, 0, "%llu",
(unsigned long long)maxblock); (unsigned long long)maxblock);
d.s_block = strlen(buf);
d.s_flags = maxflags; d.s_flags = maxflags;
d.s_group = maxgroup; d.s_group = maxgroup;
(void)snprintf(buf, sizeof(buf), "%llu", d.s_inode = snprintf(NULL, 0, "%llu",
(unsigned long long)maxinode); (unsigned long long)maxinode);
d.s_inode = strlen(buf); d.s_nlink = snprintf(NULL, 0, "%lu",
(void)snprintf(buf, sizeof(buf), "%lu",
(unsigned long)maxnlink); (unsigned long)maxnlink);
d.s_nlink = strlen(buf); if (!f_humanval)
if (!f_humanval) { d.s_size = snprintf(NULL, 0, "%lld",
(void)snprintf(buf, sizeof(buf), "%lld",
(long long)maxsize); (long long)maxsize);
d.s_size = strlen(buf); else
} else
d.s_size = FMT_SCALED_STRSIZE-2; /* no - or '\0' */ d.s_size = FMT_SCALED_STRSIZE-2; /* no - or '\0' */
d.s_major = d.s_minor = 3;
if (bcfile) {
d.s_major = snprintf(NULL, 0, "%u", maxmajor);
d.s_minor = snprintf(NULL, 0, "%u", maxminor);
if (d.s_size <= d.s_major + 2 + d.s_minor)
d.s_size = d.s_major + 2 + d.s_minor;
else
d.s_major = d.s_size - 2 - d.s_minor;
}
d.s_user = maxuser; d.s_user = maxuser;
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ls.h,v 1.9 2013/05/30 16:34:32 guenther Exp $ */ /* $OpenBSD: ls.h,v 1.10 2023/10/07 11:51:08 schwarze Exp $ */
/* $NetBSD: ls.h,v 1.7 1995/03/21 09:06:33 cgd Exp $ */ /* $NetBSD: ls.h,v 1.7 1995/03/21 09:06:33 cgd Exp $ */
/* /*
@ -55,7 +55,6 @@ extern int f_typedir; /* add type character for directories */
typedef struct { typedef struct {
FTSENT *list; FTSENT *list;
unsigned long long btotal; unsigned long long btotal;
int bcfile;
int entries; int entries;
int maxlen; int maxlen;
int s_block; int s_block;
@ -64,6 +63,8 @@ typedef struct {
int s_inode; int s_inode;
int s_nlink; int s_nlink;
int s_size; int s_size;
int s_major;
int s_minor;
int s_user; int s_user;
} DISPLAY; } DISPLAY;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: print.c,v 1.39 2020/10/07 21:03:09 millert Exp $ */ /* $OpenBSD: print.c,v 1.40 2023/10/07 11:51:08 schwarze Exp $ */
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */ /* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/* /*
@ -110,12 +110,9 @@ printlong(DISPLAY *dp)
if (f_flags) if (f_flags)
(void)printf("%-*s ", dp->s_flags, np->flags); (void)printf("%-*s ", dp->s_flags, np->flags);
if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode)) if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode))
(void)printf("%3u, %3u ", (void)printf("%*u, %*u ",
major(sp->st_rdev), minor(sp->st_rdev)); dp->s_major, major(sp->st_rdev),
else if (dp->bcfile) dp->s_minor, minor(sp->st_rdev));
(void)printf("%*s%*lld ",
8 - dp->s_size, "", dp->s_size,
(long long)sp->st_size);
else else
printsize(dp->s_size, sp->st_size); printsize(dp->s_size, sp->st_size);
if (f_accesstime) if (f_accesstime)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: fvwrite.c,v 1.20 2017/03/17 16:06:33 millert Exp $ */ /* $OpenBSD: fvwrite.c,v 1.21 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -34,7 +34,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "local.h" #include "local.h"
#include "fvwrite.h" #include "fvwrite.h"
@ -58,10 +57,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
if ((len = uio->uio_resid) == 0) if ((len = uio->uio_resid) == 0)
return (0); return (0);
/* make sure we can write */ /* make sure we can write */
if (cantwrite(fp)) { if (cantwrite(fp))
errno = EBADF;
return (EOF); return (EOF);
}
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))
#define COPY(n) (void)memcpy(fp->_p, p, n) #define COPY(n) (void)memcpy(fp->_p, p, n)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: putc.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */ /* $OpenBSD: putc.c,v 1.14 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -32,7 +32,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include "local.h" #include "local.h"
/* /*
@ -43,10 +42,8 @@
int int
putc_unlocked(int c, FILE *fp) putc_unlocked(int c, FILE *fp)
{ {
if (cantwrite(fp)) { if (cantwrite(fp))
errno = EBADF;
return (EOF); return (EOF);
}
_SET_ORIENTATION(fp, -1); _SET_ORIENTATION(fp, -1);
return (__sputc(c, fp)); return (__sputc(c, fp));
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: vfprintf.c,v 1.81 2021/09/08 15:57:27 jca Exp $ */ /* $OpenBSD: vfprintf.c,v 1.82 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -457,10 +457,8 @@ __vfprintf(FILE *fp, const char *fmt0, __va_list ap)
_SET_ORIENTATION(fp, -1); _SET_ORIENTATION(fp, -1);
/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
if (cantwrite(fp)) { if (cantwrite(fp))
errno = EBADF;
return (EOF); return (EOF);
}
/* optimise fprintf(stderr) (and other unbuffered Unix files) */ /* optimise fprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&

View File

@ -1,4 +1,4 @@
/* $OpenBSD: vfwprintf.c,v 1.22 2021/09/08 15:57:27 jca Exp $ */ /* $OpenBSD: vfwprintf.c,v 1.23 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -451,10 +451,8 @@ __vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, __va_list ap)
_SET_ORIENTATION(fp, 1); _SET_ORIENTATION(fp, 1);
/* sorry, fwprintf(read_only_file, "") returns EOF, not 0 */ /* sorry, fwprintf(read_only_file, "") returns EOF, not 0 */
if (cantwrite(fp)) { if (cantwrite(fp))
errno = EBADF;
return (EOF); return (EOF);
}
/* optimise fwprintf(stderr) (and other unbuffered Unix files) */ /* optimise fwprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&

View File

@ -1,4 +1,4 @@
/* $OpenBSD: wbuf.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */ /* $OpenBSD: wbuf.c,v 1.14 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -32,7 +32,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include "local.h" #include "local.h"
/* /*
@ -54,10 +53,8 @@ __swbuf(int c, FILE *fp)
* calls might wrap _w from negative to positive. * calls might wrap _w from negative to positive.
*/ */
fp->_w = fp->_lbfsize; fp->_w = fp->_lbfsize;
if (cantwrite(fp)) { if (cantwrite(fp))
errno = EBADF;
return (EOF); return (EOF);
}
c = (unsigned char)c; c = (unsigned char)c;
/* /*

View File

@ -1,4 +1,4 @@
/* $OpenBSD: wsetup.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */ /* $OpenBSD: wsetup.c,v 1.8 2023/10/06 16:41:02 millert Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -31,6 +31,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "local.h" #include "local.h"
@ -38,7 +39,7 @@
/* /*
* Various output routines call wsetup to be sure it is safe to write, * Various output routines call wsetup to be sure it is safe to write,
* because either _flags does not include __SWR, or _buf is NULL. * because either _flags does not include __SWR, or _buf is NULL.
* _wsetup returns 0 if OK to write, nonzero otherwise. * __swsetup returns 0 if OK to write, nonzero otherwise, setting errno.
*/ */
int int
__swsetup(FILE *fp) __swsetup(FILE *fp)
@ -51,8 +52,11 @@ __swsetup(FILE *fp)
* If we are not writing, we had better be reading and writing. * If we are not writing, we had better be reading and writing.
*/ */
if ((fp->_flags & __SWR) == 0) { if ((fp->_flags & __SWR) == 0) {
if ((fp->_flags & __SRW) == 0) if ((fp->_flags & __SRW) == 0) {
errno = EBADF;
fp->_flags |= __SERR;
return (EOF); return (EOF);
}
if (fp->_flags & __SRD) { if (fp->_flags & __SRD) {
/* clobber any ungetc data */ /* clobber any ungetc data */
if (HASUB(fp)) if (HASUB(fp))
@ -68,8 +72,11 @@ __swsetup(FILE *fp)
* Make a buffer if necessary, then set _w. * Make a buffer if necessary, then set _w.
*/ */
if (fp->_bf._base == NULL) { if (fp->_bf._base == NULL) {
if ((fp->_flags & (__SSTR | __SALC)) == __SSTR) if ((fp->_flags & (__SSTR | __SALC)) == __SSTR) {
errno = EINVAL;
fp->_flags |= __SERR;
return (EOF); return (EOF);
}
__smakebuf(fp); __smakebuf(fp);
} }
if (fp->_flags & __SLBF) { if (fp->_flags & __SLBF) {

View File

@ -1,4 +1,4 @@
# $OpenBSD: agent-pkcs11.sh,v 1.9 2021/07/25 12:13:03 dtucker Exp $ # $OpenBSD: agent-pkcs11.sh,v 1.11 2023/10/06 03:32:15 djm Exp $
# Placed in the Public Domain. # Placed in the Public Domain.
tid="pkcs11 agent test" tid="pkcs11 agent test"
@ -38,6 +38,7 @@ export SSH_ASKPASS
unset DISPLAY unset DISPLAY
# start command w/o tty, so ssh-add accepts pin from stdin # start command w/o tty, so ssh-add accepts pin from stdin
# XXX could force askpass instead
notty() { notty() {
perl -e 'use POSIX; POSIX::setsid(); perl -e 'use POSIX; POSIX::setsid();
if (fork) { wait; exit($? >> 8); } else { exec(@ARGV) }' "$@" if (fork) { wait; exit($? >> 8); } else { exec(@ARGV) }' "$@"
@ -45,18 +46,23 @@ notty() {
trace "generating keys" trace "generating keys"
RSA=${DIR}/RSA RSA=${DIR}/RSA
RSAP8=${DIR}/RSAP8
ECPARAM=${DIR}/ECPARAM
EC=${DIR}/EC EC=${DIR}/EC
$OPENSSL_BIN genpkey -algorithm rsa > $RSA ECP8=${DIR}/ECP8
$OPENSSL_BIN pkcs8 -nocrypt -in $RSA |\ $OPENSSL_BIN genpkey -algorithm rsa > $RSA || fatal "genpkey RSA fail"
softhsm2-util --slot "$slot" --label 01 --id 01 --pin "$TEST_SSH_PIN" --import /dev/stdin $OPENSSL_BIN pkcs8 -nocrypt -in $RSA > $RSAP8 || fatal "pkcs8 RSA fail"
softhsm2-util --slot "$slot" --label 01 --id 01 \
--pin "$TEST_SSH_PIN" --import $RSAP8 || fatal "softhsm import RSA fail"
$OPENSSL_BIN genpkey \ $OPENSSL_BIN genpkey \
-genparam \ -genparam \
-algorithm ec \ -algorithm ec \
-pkeyopt ec_paramgen_curve:prime256v1 |\ -pkeyopt ec_paramgen_curve:prime256v1 > $ECPARAM || fatal "param EC fail"
$OPENSSL_BIN genpkey \ $OPENSSL_BIN genpkey -paramfile $ECPARAM > $EC || fatal "genpkey EC fail"
-paramfile /dev/stdin > $EC $OPENSSL_BIN pkcs8 -nocrypt -in $EC > $ECP8 || fatal "pkcs8 EC fail"
$OPENSSL_BIN pkcs8 -nocrypt -in $EC |\ softhsm2-util --slot "$slot" --label 02 --id 02 \
softhsm2-util --slot "$slot" --label 02 --id 02 --pin "$TEST_SSH_PIN" --import /dev/stdin --pin "$TEST_SSH_PIN" --import $ECP8 || fatal "softhsm import EC fail"
trace "start agent" trace "start agent"
eval `${SSHAGENT} ${EXTRA_AGENT_ARGS} -s` > /dev/null eval `${SSHAGENT} ${EXTRA_AGENT_ARGS} -s` > /dev/null
@ -83,7 +89,8 @@ else
chmod 600 $k chmod 600 $k
ssh-keygen -y -f $k > $k.pub ssh-keygen -y -f $k > $k.pub
pub=$(cat $k.pub) pub=$(cat $k.pub)
${SSHADD} -L | grep -q "$pub" || fail "key $k missing in ssh-add -L" ${SSHADD} -L | grep -q "$pub" || \
fail "key $k missing in ssh-add -L"
${SSHADD} -T $k.pub || fail "ssh-add -T with $k failed" ${SSHADD} -T $k.pub || fail "ssh-add -T with $k failed"
# add to authorized keys # add to authorized keys

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.86 2022/05/10 09:42:32 bluhm Exp $ # $OpenBSD: Makefile,v 1.87 2023/10/06 06:00:18 espie Exp $
REGRESS_TARGETS=pkgnames pkgpaths signatures depends-check longnames pkgcfl \ REGRESS_TARGETS=pkgnames pkgpaths signatures depends-check longnames pkgcfl \
collision-check1 collision-check2 collision-check3 \ collision-check1 collision-check2 collision-check3 \
@ -24,6 +24,8 @@ REGRESS_EXPECTED_FAILURES = collision-check1 collision-check2 \
PERLSCRIPT = perl -I ${.CURDIR} ${.CURDIR} PERLSCRIPT = perl -I ${.CURDIR} ${.CURDIR}
WAVE_PLIST=-DREGRESSION_TESTING=plist_checks
ADD_PKG = ${PERLSCRIPT}/my add -Dchecksum ADD_PKG = ${PERLSCRIPT}/my add -Dchecksum
DELETE_PKG = ${PERLSCRIPT}/my delete -Dchecksum DELETE_PKG = ${PERLSCRIPT}/my delete -Dchecksum
INFO_PKG = ${PERLSCRIPT}/my info INFO_PKG = ${PERLSCRIPT}/my info
@ -353,22 +355,22 @@ rep0/intb-0.tgz:
@${CREATE_PKG} -P't/inta:inta-*:inta-0' ${EMPTY} $@ @${CREATE_PKG} -P't/inta:inta-*:inta-0' ${EMPTY} $@
rep1/o-1.tgz: rep1/o-1.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/p:p-*:p-0' -W'coincoin.0.0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/p:p-*:p-0' -W'coincoin.0.0' ${EMPTY} $@
rep1/o1-1.tgz: rep1/o1-1.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/p1:p1-*:p1-0' -W'coincoin.0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/p1:p1-*:p1-0' -W'coincoin.0' ${EMPTY} $@
rep1/o2-1.tgz: rep1/o2-1.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/p2:p2-*:p2-0' -W'coincoin.0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/p2:p2-*:p2-0' -W'coincoin.0' ${EMPTY} $@
rep0/o3-0.tgz: rep0/o3-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'unlikelylibraryname.0.0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'unlikelylibraryname.0.0' ${EMPTY} $@
rep1/p-0.tgz rep1/p1-0.tgz: plist8 rep1/p-0.tgz rep1/p1-0.tgz: plist8
@${WITH} -B src13 -DLIBcoincoin_VERSION=0.0 -f plist8 $@ ${CPKG} @${WITH} -B src13 -DLIBcoincoin_VERSION=0.0 -f plist8 $@ ${CPKG}
rep1/p2-0.tgz: plist8 rep1/p2-0.tgz: plist8
@${WITH} -DREGRESSION_TESTING -B src14 -DLIBcoincoin_VERSION=0 -f plist8 $@ ${CPKG} @${WITH} ${WAVE_PLIST} -B src14 -DLIBcoincoin_VERSION=0 -f plist8 $@ ${CPKG}
rep0/p4-0.tgz: plist12 rep0/p4-0.tgz: plist12
@${WITH} -B src15 -DLIBa_VERSION=0.0 -f plist12 $@ ${CPKG} @${WITH} -B src15 -DLIBa_VERSION=0.0 -f plist12 $@ ${CPKG}
@ -377,31 +379,31 @@ rep1/p4-1.tgz: plist12
@${WITH} -B src31 -DLIBa_VERSION=1.0 -f plist12 $@ ${CPKG} @${WITH} -B src31 -DLIBa_VERSION=1.0 -f plist12 $@ ${CPKG}
rep0/boost-0.tgz: rep0/boost-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@
rep1/boost-0.tgz: rep1/boost-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.1.0' -P't/p4:p4-*:p4-1' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.1.0' -P't/p4:p4-*:p4-1' ${EMPTY} $@
rep0/Imath-0.tgz: rep0/Imath-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/boots:boost-*:boost-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/boots:boost-*:boost-0' ${EMPTY} $@
rep1/Imath-0.tgz: rep1/Imath-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/boots:boost-*:boost-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/boots:boost-*:boost-0' ${EMPTY} $@
rep0/o4-0.tgz: rep0/o4-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.1.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.1.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@
rep0/o5-0.tgz: rep0/o5-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.0.2' -P't/p4:p4-*:p4-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.0.2' -P't/p4:p4-*:p4-0' ${EMPTY} $@
rep0/o6-0.tgz: rep0/o6-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@
rep0/oo6-0.tgz: rep0/oo6-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'a.0.0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'a.0.0' ${EMPTY} $@
rep0/o7-0.tgz: rep0/o7-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W'dir/a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W'dir/a.0.0' -P't/p4:p4-*:p4-0' ${EMPTY} $@
rep1/b-1.tgz: rep1/b-1.tgz:
@${CREATE_PKG} -P't/a:a-*:a-1' ${EMPTY} $@ @${CREATE_PKG} -P't/a:a-*:a-1' ${EMPTY} $@
@ -589,14 +591,14 @@ rep1/ol-1.tgz: plist21
CUPS_FILES += rep2/$o.tgz CUPS_FILES += rep2/$o.tgz
rep2/$o.tgz: ${.CURDIR}/oldcups/$o/+CONTENTS rep2/$o.tgz: ${.CURDIR}/oldcups/$o/+CONTENTS
mkdir -p rep2 mkdir -p rep2
cd rep2 && pkg_create -DREGRESSION_TESTING -Dstub -f ${.CURDIR}/oldcups/$o/+CONTENTS cd rep2 && pkg_create ${WAVE_PLIST} -Dstub -f ${.CURDIR}/oldcups/$o/+CONTENTS
.endfor .endfor
.for n in cups-2.2.8 cups-filters-1.20.3 cups-libs-2.2.8 ghostscript-9.07p7 .for n in cups-2.2.8 cups-filters-1.20.3 cups-libs-2.2.8 ghostscript-9.07p7
CUPS_FILES += rep3/$n.tgz CUPS_FILES += rep3/$n.tgz
rep3/$n.tgz: ${.CURDIR}/newcups/$n/+CONTENTS rep3/$n.tgz: ${.CURDIR}/newcups/$n/+CONTENTS
mkdir -p rep3 mkdir -p rep3
cd rep3 && pkg_create -DREGRESSION_TESTING -Dstub -f ${.CURDIR}/newcups/$n/+CONTENTS cd rep3 && pkg_create ${WAVE_PLIST} -Dstub -f ${.CURDIR}/newcups/$n/+CONTENTS
.endfor .endfor
cups-bug: ${CUPS_FILES} cups-bug: ${CUPS_FILES}
@ -651,10 +653,10 @@ rep5/gnutls-0.tgz:
@${CREATE_PKG} -P't/libnettle:libnettle-*:libnettle-1' ${EMPTY} $@ @${CREATE_PKG} -P't/libnettle:libnettle-*:libnettle-1' ${EMPTY} $@
rep4/gtk+3-cups-0.tgz: rep4/gtk+3-cups-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W nettle.0.0 -P't/cups-libs:cups-libs-*:cups-libs-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W nettle.0.0 -P't/cups-libs:cups-libs-*:cups-libs-0' ${EMPTY} $@
rep5/gtk+3-cups-0.tgz: rep5/gtk+3-cups-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -W nettle.1.0 -P't/cups-libs:cups-libs-*:cups-libs-0' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -W nettle.1.0 -P't/cups-libs:cups-libs-*:cups-libs-0' ${EMPTY} $@
rep5/libnettle-1.tgz: plist22 rep5/libnettle-1.tgz: plist22
@${WITH} -B src24 -DLIBnettle_VERSION=1.0 -f plist22 $@ ${CPKG} @${WITH} -B src24 -DLIBnettle_VERSION=1.0 -f plist22 $@ ${CPKG}
@ -766,10 +768,10 @@ rep6/avahi-0.tgz: plist25
@${WITH} -B src28 -DLIBavahi_VERSION=0.0 -f plist25 $@ ${CPKG} @${WITH} -B src28 -DLIBavahi_VERSION=0.0 -f plist25 $@ ${CPKG}
rep6/cups-0.tgz: rep6/cups-0.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/avahi:avahi-*:avahi-0' -W avahi.0.0 ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/avahi:avahi-*:avahi-0' -W avahi.0.0 ${EMPTY} $@
rep7/avahi-1.tgz: rep7/avahi-1.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/avahi-libs:avahi-libs-*:avahi-libs-1' ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/avahi-libs:avahi-libs-*:avahi-libs-1' ${EMPTY} $@
rep7/avahi-libs-1.tgz: plist27 rep7/avahi-libs-1.tgz: plist27
@${WITH} -B src28 -f plist27 $@ ${CPKG} @${WITH} -B src28 -f plist27 $@ ${CPKG}
@ -778,7 +780,7 @@ rep7/avahi-glib-1.tgz: plist26
@${WITH} -B src28 -DLIBavahi_VERSION=0.0 -f plist26 $@ ${CPKG} @${WITH} -B src28 -DLIBavahi_VERSION=0.0 -f plist26 $@ ${CPKG}
rep7/cups-1.tgz: rep7/cups-1.tgz:
@${CREATE_PKG} -DREGRESSION_TESTING -P't/avahi-libs:avahi-libs-*:avahi-libs-0' -P't/avahi-glib:avahi-glib-*:avahi-glib-1' -W avahi.0.0 ${EMPTY} $@ @${CREATE_PKG} ${WAVE_PLIST} -P't/avahi-libs:avahi-libs-*:avahi-libs-0' -P't/avahi-glib:avahi-glib-*:avahi-glib-1' -W avahi.0.0 ${EMPTY} $@
rep0/sym-0.tgz: plist19 rep0/sym-0.tgz: plist19

View File

@ -1,4 +1,4 @@
/* $OpenBSD: bioctl.c,v 1.155 2023/09/02 09:14:47 kn Exp $ */ /* $OpenBSD: bioctl.c,v 1.157 2023/10/07 12:20:10 kn Exp $ */
/* /*
* Copyright (c) 2004, 2005 Marco Peereboom * Copyright (c) 2004, 2005 Marco Peereboom
@ -90,7 +90,7 @@ int human;
int verbose; int verbose;
u_int32_t cflags = 0; u_int32_t cflags = 0;
int rflag = -1; /* auto */ int rflag = -1; /* auto */
char *password; char *passfile;
void *bio_cookie; void *bio_cookie;
@ -175,7 +175,7 @@ main(int argc, char *argv[])
changepass = 1; changepass = 1;
break; break;
case 'p': case 'p':
password = optarg; passfile = optarg;
break; break;
case 'r': case 'r':
if (strcmp(optarg, "auto") == 0) { if (strcmp(optarg, "auto") == 0) {
@ -1334,8 +1334,8 @@ derive_key(u_int32_t type, int rounds, u_int8_t *key, size_t keysz,
errx(1, "number of KDF rounds is too small: %d", rounds); errx(1, "number of KDF rounds is too small: %d", rounds);
/* get passphrase */ /* get passphrase */
if (password) { if (passfile) {
if ((f = fopen(password, "r")) == NULL) if ((f = fopen(passfile, "r")) == NULL)
err(1, "invalid passphrase file"); err(1, "invalid passphrase file");
if (fstat(fileno(f), &sb) == -1) if (fstat(fileno(f), &sb) == -1)
@ -1361,9 +1361,15 @@ derive_key(u_int32_t type, int rounds, u_int8_t *key, size_t keysz,
if (readpassphrase(prompt, passphrase, sizeof(passphrase), if (readpassphrase(prompt, passphrase, sizeof(passphrase),
rpp_flag) == NULL) rpp_flag) == NULL)
err(1, "unable to read passphrase"); err(1, "unable to read passphrase");
if (*passphrase == '\0') {
warnx("invalid passphrase length");
if (interactive)
goto retry;
exit(1);
}
} }
if (verify && !password) { if (verify && !passfile) {
/* request user to re-type it */ /* request user to re-type it */
if (readpassphrase("Re-type passphrase: ", verifybuf, if (readpassphrase("Re-type passphrase: ", verifybuf,
sizeof(verifybuf), rpp_flag) == NULL) { sizeof(verifybuf), rpp_flag) == NULL) {

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: register-plist.1,v 1.6 2020/06/10 07:44:38 espie Exp $ .\" $OpenBSD: register-plist.1,v 1.7 2023/10/06 12:45:45 espie Exp $
.\" .\"
.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org> .\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
.\" .\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: June 10 2020 $ .Dd $Mdocdate: October 6 2023 $
.Dt REGISTER-PLIST 1 .Dt REGISTER-PLIST 1
.Os .Os
.Sh NAME .Sh NAME
@ -38,10 +38,18 @@
is used to check that a packing-list for a given package name doesn't change. is used to check that a packing-list for a given package name doesn't change.
By default, it is invoked at the end of By default, it is invoked at the end of
.Li make package , .Li make package ,
and compares a temporary package with the
.Pa ${PLIST_REPOSITORY}
before moving it to
.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all
.Po
see see
.Ev PACKAGE_REPOSITORY .Ev PACKAGE_REPOSITORY
and
.Ev PLIST_REPOSITORY
in in
.Xr bsd.port.mk 5 . .Xr bsd.port.mk 5
.Pc .
Package names (package stem plus version) are used to uniquely identify Package names (package stem plus version) are used to uniquely identify
packages. packages.
When something in the package changes, the package name should change, When something in the package changes, the package name should change,

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: man.7,v 1.60 2021/08/05 14:31:06 schwarze Exp $ .\" $OpenBSD: man.7,v 1.61 2023/10/07 21:26:29 schwarze Exp $
.\" .\"
.\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org> .\" Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
@ -17,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: August 5 2021 $ .Dd $Mdocdate: October 7 2023 $
.Dt MAN 7 .Dt MAN 7
.Os .Os
.Sh NAME .Sh NAME
@ -97,10 +97,11 @@ but can be found in the alphabetical reference below.
.It Ic SH Ta section header (one line) .It Ic SH Ta section header (one line)
.It Ic SS Ta subsection header (one line) .It Ic SS Ta subsection header (one line)
.It Ic PP Ta start an undecorated paragraph (no arguments) .It Ic PP Ta start an undecorated paragraph (no arguments)
.It Ic RS , RE Ta reset the left margin: Op Ar width
.It Ic IP Ta indented paragraph: Op Ar head Op Ar width .It Ic IP Ta indented paragraph: Op Ar head Op Ar width
.It Ic TP Ta tagged paragraph: Op Ar width .It Ic TP Ta tagged paragraph: Op Ar width
.It Ic PD Ta set vertical paragraph distance: Op Ar height .It Ic PD Ta set vertical paragraph distance: Op Ar height
.It Ic EX , EE Ta display an example (no arguments)
.It Ic RS , RE Ta reset the left margin: Op Ar width
.It Ic in Ta additional indent: Op Ar width .It Ic in Ta additional indent: Op Ar width
.El .El
.Ss Physical markup .Ss Physical markup
@ -162,7 +163,9 @@ This has no effect unless the tabulator positions were changed with the
.Ic ta .Ic ta
request. request.
.It Ic EE .It Ic EE
This is a non-standard Version 9 End an example block started with
.Ic EX .
This is a Version 9
.At .At
extension later adopted by GNU. extension later adopted by GNU.
In In
@ -172,7 +175,8 @@ it does the same as the
.Ic fi .Ic fi
request (switch to fill mode). request (switch to fill mode).
.It Ic EX .It Ic EX
This is a non-standard Version 9 Begin a block to display an example.
This is a Version 9
.At .At
extension later adopted by GNU. extension later adopted by GNU.
In In
@ -234,10 +238,10 @@ A synonym for
.It Ic ME .It Ic ME
End a mailto block started with End a mailto block started with
.Ic MT . .Ic MT .
This is a non-standard GNU extension. This is a GNU extension.
.It Ic MT .It Ic MT
Begin a mailto block. Begin a mailto block.
This is a non-standard GNU extension. This is a GNU extension.
It has the following syntax: It has the following syntax:
.Bd -unfilled -offset indent .Bd -unfilled -offset indent
.Pf . Ic MT Ar address .Pf . Ic MT Ar address
@ -246,7 +250,7 @@ link description to be shown
.Ed .Ed
.It Ic OP .It Ic OP
Optional command-line argument. Optional command-line argument.
This is a non-standard DWB extension. This is a rarely used DWB extension.
It has the following syntax: It has the following syntax:
.Pp .Pp
.D1 Pf . Ic OP Ar key Op Ar value .D1 Pf . Ic OP Ar key Op Ar value
@ -373,8 +377,7 @@ Begin a synopsis block with the following syntax:
.Pf . Ic YS .Pf . Ic YS
.Ed .Ed
.Pp .Pp
This is a non-standard GNU extension This is a GNU extension and rarely used even in GNU manual pages.
and very rarely used even in GNU manual pages.
Formatting is similar to Formatting is similar to
.Ic IP . .Ic IP .
.It Ic TH .It Ic TH
@ -437,8 +440,7 @@ unspecified, the saved or default width is used.
Like Like
.Ic TP , .Ic TP ,
except that no vertical spacing is inserted before the paragraph. except that no vertical spacing is inserted before the paragraph.
This is a non-standard GNU extension This is a GNU extension and rarely used even in GNU manual pages.
and very rarely used even in GNU manual pages.
.It Ic UC .It Ic UC
Sets the volume for the footer for compatibility with man pages from Sets the volume for the footer for compatibility with man pages from
.Bx .Bx
@ -449,10 +451,10 @@ This macro is an extension that first appeared in
.It Ic UE .It Ic UE
End a uniform resource identifier block started with End a uniform resource identifier block started with
.Ic UR . .Ic UR .
This is a non-standard GNU extension. This is a GNU extension.
.It Ic UR .It Ic UR
Begin a uniform resource identifier block. Begin a uniform resource identifier block.
This is a non-standard GNU extension. This is a GNU extension.
It has the following syntax: It has the following syntax:
.Bd -unfilled -offset indent .Bd -unfilled -offset indent
.Pf . Ic UR Ar uri .Pf . Ic UR Ar uri
@ -462,7 +464,7 @@ link description to be shown
.It Ic YS .It Ic YS
End a synopsis block started with End a synopsis block started with
.Ic SY . .Ic SY .
This is a non-standard GNU extension. This is a GNU extension.
.It Ic in .It Ic in
Indent relative to the current indentation: Indent relative to the current indentation:
.Pp .Pp

View File

@ -1,4 +1,4 @@
/* $OpenBSD: if_iwx.c,v 1.176 2023/08/26 09:05:34 stsp Exp $ */ /* $OpenBSD: if_iwx.c,v 1.177 2023/10/06 15:15:29 stsp Exp $ */
/* /*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de> * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@ -10127,6 +10127,16 @@ iwx_rx_pkt(struct iwx_softc *sc, struct iwx_rx_data *data, struct mbuf_list *ml)
case IWX_WIDE_ID(IWX_DATA_PATH_GROUP, IWX_RLC_CONFIG_CMD): case IWX_WIDE_ID(IWX_DATA_PATH_GROUP, IWX_RLC_CONFIG_CMD):
break; break;
/*
* Ignore for now. The Linux driver only acts on this request
* with 160Mhz channels in 11ax mode.
*/
case IWX_WIDE_ID(IWX_DATA_PATH_GROUP,
IWX_THERMAL_DUAL_CHAIN_REQUEST):
DPRINTF(("%s: thermal dual-chain request received\n",
DEVNAME(sc)));
break;
/* undocumented notification from iwx-ty-a0-gf-a0-77 image */ /* undocumented notification from iwx-ty-a0-gf-a0-77 image */
case IWX_WIDE_ID(IWX_DATA_PATH_GROUP, 0xf8): case IWX_WIDE_ID(IWX_DATA_PATH_GROUP, 0xf8):
break; break;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: if_iwxreg.h,v 1.51 2023/03/06 11:18:37 stsp Exp $ */ /* $OpenBSD: if_iwxreg.h,v 1.52 2023/10/06 15:15:41 stsp Exp $ */
/*- /*-
* Based on BSD-licensed source modules in the Linux iwlwifi driver, * Based on BSD-licensed source modules in the Linux iwlwifi driver,
@ -2010,6 +2010,7 @@ struct iwx_tx_queue_cfg_rsp {
#define IWX_RX_BAID_ALLOCATION_CONFIG_CMD 0x16 #define IWX_RX_BAID_ALLOCATION_CONFIG_CMD 0x16
#define IWX_SCD_QUEUE_CONFIG_CMD 0x17 #define IWX_SCD_QUEUE_CONFIG_CMD 0x17
#define IWX_RX_NO_DATA_NOTIF 0xf5 #define IWX_RX_NO_DATA_NOTIF 0xf5
#define IWX_THERMAL_DUAL_CHAIN_REQUEST 0xf6
#define IWX_TLC_MNG_UPDATE_NOTIF 0xf7 #define IWX_TLC_MNG_UPDATE_NOTIF 0xf7
/* REGULATORY_AND_NVM group subcommand IDs */ /* REGULATORY_AND_NVM group subcommand IDs */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ucom.c,v 1.77 2023/10/02 23:38:11 krw Exp $ */ /* $OpenBSD: ucom.c,v 1.78 2023/10/06 16:06:11 krw Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */ /* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/* /*
@ -1256,7 +1256,7 @@ sysctl_ucominit(void)
int rslt; int rslt;
unsigned int unit; unsigned int unit;
uint32_t route; uint32_t route;
uint8_t bus, ifaceidx; uint8_t bus, ifaceno;
KERNEL_ASSERT_LOCKED(); KERNEL_ASSERT_LOCKED();
@ -1272,11 +1272,11 @@ sysctl_ucominit(void)
if (sc == NULL || sc->sc_iface == NULL) if (sc == NULL || sc->sc_iface == NULL)
continue; continue;
if (usbd_get_location(sc->sc_uparent, sc->sc_iface, if (usbd_get_location(sc->sc_uparent, sc->sc_iface,
&bus, &route, &ifaceidx) == -1) &bus, &route, &ifaceno) == -1)
continue; continue;
rslt = snprintf(name, sizeof(name), rslt = snprintf(name, sizeof(name),
"%s:usb%u.%u.%05x.%u,", sc->sc_dev.dv_xname, bus, "%s:usb%u.%u.%05x.%u,", sc->sc_dev.dv_xname, bus,
ROUTEROOTPORT(route), ROUTESTRING(route), ifaceidx); ROUTEROOTPORT(route), ROUTESTRING(route), ifaceno);
if (rslt < sizeof(name) && (strlen(ucoms) + rslt) < if (rslt < sizeof(name) && (strlen(ucoms) + rslt) <
ucomslen) ucomslen)
strlcat(ucoms, name, ucomslen); strlcat(ucoms, name, ucomslen);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: usb_subr.c,v 1.161 2023/10/02 23:38:11 krw Exp $ */ /* $OpenBSD: usb_subr.c,v 1.162 2023/10/06 16:06:11 krw Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */ /* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@ -1362,7 +1362,7 @@ usbd_get_routestring(struct usbd_device *dev, uint32_t *route)
int int
usbd_get_location(struct usbd_device *dev, struct usbd_interface *iface, usbd_get_location(struct usbd_device *dev, struct usbd_interface *iface,
uint8_t *bus, uint32_t *route, uint8_t *ifaceidx) uint8_t *bus, uint32_t *route, uint8_t *ifaceno)
{ {
int i; int i;
uint32_t r; uint32_t r;
@ -1380,7 +1380,7 @@ usbd_get_location(struct usbd_device *dev, struct usbd_interface *iface,
if (iface == &dev->ifaces[i]) { if (iface == &dev->ifaces[i]) {
*bus = dev->bus->usbctl->dv_unit; *bus = dev->bus->usbctl->dv_unit;
*route = (usbd_get_routestring(dev, &r)) ? 0 : r; *route = (usbd_get_routestring(dev, &r)) ? 0 : r;
*ifaceidx = i; *ifaceno = i;
return 0; return 0;
} }
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kern_sig.c,v 1.319 2023/09/29 12:47:34 claudio Exp $ */ /* $OpenBSD: kern_sig.c,v 1.320 2023/10/06 08:58:13 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/* /*
@ -1812,7 +1812,6 @@ sys_nosys(struct proc *p, void *v, register_t *retval)
int int
sys___thrsigdivert(struct proc *p, void *v, register_t *retval) sys___thrsigdivert(struct proc *p, void *v, register_t *retval)
{ {
static int sigwaitsleep;
struct sys___thrsigdivert_args /* { struct sys___thrsigdivert_args /* {
syscallarg(sigset_t) sigmask; syscallarg(sigset_t) sigmask;
syscallarg(siginfo_t *) info; syscallarg(siginfo_t *) info;
@ -1863,8 +1862,7 @@ sys___thrsigdivert(struct proc *p, void *v, register_t *retval)
if (error != 0) if (error != 0)
break; break;
error = tsleep_nsec(&sigwaitsleep, PPAUSE|PCATCH, "sigwait", error = tsleep_nsec(&nowake, PPAUSE|PCATCH, "sigwait", nsecs);
nsecs);
} }
if (error == 0) { if (error == 0) {

View File

@ -25,6 +25,11 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the This file lists all bug fixes, changes, etc., made since the
second edition of the AWK book was published in September 2023. second edition of the AWK book was published in September 2023.
Sep 24, 2023:
fnematch and getrune have been overhauled to solve issues around
unicode FS and RS. also fixed gsub null match issue with unicode.
big thanks to Arnold Robbins.
Sep 12, 2023: Sep 12, 2023:
Fixed a length error in u8_byte2char that set RSTART to Fixed a length error in u8_byte2char that set RSTART to
incorrect (cannot happen) value for EOL match(str, /$/). incorrect (cannot happen) value for EOL match(str, /$/).

View File

@ -1,4 +1,4 @@
/* $OpenBSD: b.c,v 1.42 2023/09/21 17:19:06 millert Exp $ */ /* $OpenBSD: b.c,v 1.44 2023/10/06 22:31:21 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -81,6 +81,8 @@ int patlen;
fa *fatab[NFA]; fa *fatab[NFA];
int nfatab = 0; /* entries in fatab */ int nfatab = 0; /* entries in fatab */
extern int u8_nextlen(const char *s);
/* utf-8 mechanism: /* utf-8 mechanism:
@ -114,6 +116,7 @@ int nfatab = 0; /* entries in fatab */
static int get_gototab(fa*, int, int); static int get_gototab(fa*, int, int);
static int set_gototab(fa*, int, int, int); static int set_gototab(fa*, int, int, int);
static void reset_gototab(fa*, int);
extern int u8_rune(int *, const uschar *); extern int u8_rune(int *, const uschar *);
static int * static int *
@ -274,8 +277,7 @@ int makeinit(fa *f, bool anchor)
} }
if ((f->posns[2])[1] == f->accept) if ((f->posns[2])[1] == f->accept)
f->out[2] = 1; f->out[2] = 1;
for (i = 0; i < NCHARS; i++) reset_gototab(f, 2);
set_gototab(f, 2, 0, 0); /* f->gototab[2][i] = 0; */
f->curstat = cgoto(f, 2, HAT); f->curstat = cgoto(f, 2, HAT);
if (anchor) { if (anchor) {
*f->posns[2] = k-1; /* leave out position 0 */ *f->posns[2] = k-1; /* leave out position 0 */
@ -611,6 +613,11 @@ static int get_gototab(fa *f, int state, int ch) /* hide gototab inplementation
return 0; return 0;
} }
static void reset_gototab(fa *f, int state) /* hide gototab inplementation */
{
memset(f->gototab[state], 0, f->gototab_len * sizeof(**f->gototab));
}
static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab inplementation */ static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab inplementation */
{ {
int i; int i;
@ -760,33 +767,59 @@ int nematch(fa *f, const char *p0) /* non-empty match, for sub */
return (0); return (0);
} }
static int getrune(FILE *fp, char **pbuf, int *pbufsize, int quantum,
int *curpos, int *lastpos)
{
int c = 0;
char *buf = *pbuf;
static const int max_bytes = 4; // max multiple bytes in UTF-8 is 4
int i, rune;
uschar private_buf[max_bytes + 1];
for (i = 0; i <= max_bytes; i++) { #define MAX_UTF_BYTES 4 // UTF-8 is up to 4 bytes long
if (++*curpos == *lastpos) {
if (*lastpos == *pbufsize) // Read one rune at a time from the given FILE*. Return both
if (!adjbuf((char **) pbuf, pbufsize, *pbufsize+1, quantum, 0, "getrune")) // the bytes and the actual rune.
FATAL("stream '%.30s...' too long", buf);
buf[(*lastpos)++] = (c = getc(fp)) != EOF ? c : 0; struct runedata {
private_buf[i] = c; int rune;
} size_t len;
if (c == 0 || c < 128 || (c >> 6) == 4) { // 10xxxxxx starts a new character char bytes[6];
ungetc(c, fp); };
private_buf[i] = 0;
break; struct runedata getrune(FILE *fp)
} {
struct runedata result;
int c, i, next;
memset(&result, 0, sizeof(result));
c = getc(fp);
if (c == EOF)
return result; // result.rune == 0 --> EOF
else if (c < 128 || awk_mb_cur_max == 1) {
result.bytes[0] = c;
result.len = 1;
result.rune = c;
return result;
} }
u8_rune(& rune, private_buf); // need to get bytes and fill things in
result.bytes[0] = c;
result.len = 1;
return rune; next = 1;
for (i = 1; i < MAX_UTF_BYTES; i++) {
c = getc(fp);
if (c == EOF)
break;
result.bytes[next++] = c;
result.len++;
}
// put back any extra input bytes
int actual_len = u8_nextlen(result.bytes);
while (result.len > actual_len) {
ungetc(result.bytes[--result.len], fp);
}
result.bytes[result.len] = '\0';
(void) u8_rune(& result.rune, (uschar *) result.bytes);
return result;
} }
@ -809,8 +842,8 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum)
{ {
char *buf = *pbuf; char *buf = *pbuf;
int bufsize = *pbufsize; int bufsize = *pbufsize;
int c, i, j, k, ns, s; int i, j, k, ns, s;
int rune; struct runedata r;
s = pfa->initstat; s = pfa->initstat;
patlen = 0; patlen = 0;
@ -819,42 +852,38 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum)
* All indices relative to buf. * All indices relative to buf.
* i <= j <= k <= bufsize * i <= j <= k <= bufsize
* *
* i: origin of active substring * i: origin of active substring (first byte of first character)
* j: current character * j: current character (last byte of current character)
* k: destination of next getc() * k: destination of next getc()
*/ */
i = -1, k = 0; i = -1, k = 0;
do { do {
j = i++; j = i++;
do { do {
if (++j == k) { r = getrune(f);
if (k == bufsize) if ((++j + r.len) >= k) {
if (k >= bufsize)
if (!adjbuf(&buf, &bufsize, bufsize+1, quantum, 0, "fnematch")) if (!adjbuf(&buf, &bufsize, bufsize+1, quantum, 0, "fnematch"))
FATAL("stream '%.30s...' too long", buf); FATAL("stream '%.30s...' too long", buf);
buf[k++] = (c = getc(f)) != EOF ? c : 0;
}
c = (uschar)buf[j];
if (c < 128 || awk_mb_cur_max == 1)
rune = c;
else {
j--;
k--;
ungetc(c, f);
rune = getrune(f, &buf, &bufsize, quantum, &j, &k);
} }
memcpy(buf + k, r.bytes, r.len);
j += r.len - 1; // incremented next time around the loop
k += r.len;
if ((ns = get_gototab(pfa, s, rune)) != 0) if ((ns = get_gototab(pfa, s, r.rune)) != 0)
s = ns; s = ns;
else else
s = cgoto(pfa, s, rune); s = cgoto(pfa, s, r.rune);
if (pfa->out[s]) { /* final state */ if (pfa->out[s]) { /* final state */
patlen = j - i + 1; patlen = j - i + 1;
if (c == 0) /* don't count $ */ if (r.rune == 0) /* don't count $ */
patlen--; patlen--;
} }
} while (buf[j] && s != 1); } while (buf[j] && s != 1);
s = 2; s = 2;
if (r.len > 1)
i += r.len - 1; // i incremented around the loop
} while (buf[i] && !patlen); } while (buf[i] && !patlen);
/* adjbuf() may have relocated a resized buffer. Inform the world. */ /* adjbuf() may have relocated a resized buffer. Inform the world. */
@ -874,10 +903,12 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum)
* (except for EOF's nullbyte, if present) and null * (except for EOF's nullbyte, if present) and null
* terminate the buffer. * terminate the buffer.
*/ */
do do {
if (buf[--k] && ungetc(buf[k], f) == EOF) int ii;
FATAL("unable to ungetc '%c'", buf[k]); for (ii = r.len; ii > 0; ii--)
while (k > i + patlen); if (buf[--k] && ungetc(buf[k], f) == EOF)
FATAL("unable to ungetc '%c'", buf[k]);
} while (k > i + patlen);
buf[k] = '\0'; buf[k] = '\0';
return true; return true;
} }
@ -1466,8 +1497,6 @@ int cgoto(fa *f, int s, int c)
/* add tmpset to current set of states */ /* add tmpset to current set of states */
++(f->curstat); ++(f->curstat);
resize_state(f, f->curstat); resize_state(f, f->curstat);
for (i = 0; i < NCHARS; i++)
set_gototab(f, f->curstat, 0, 0);
xfree(f->posns[f->curstat]); xfree(f->posns[f->curstat]);
p = intalloc(setcnt + 1, __func__); p = intalloc(setcnt + 1, __func__);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: lib.c,v 1.51 2023/09/17 14:49:44 millert Exp $ */ /* $OpenBSD: lib.c,v 1.52 2023/10/06 22:29:24 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -234,6 +234,7 @@ int readrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* read one rec
} else if (*rs && rs[1]) { } else if (*rs && rs[1]) {
bool found; bool found;
memset(buf, 0, bufsize);
fa *pfa = makedfa(rs, 1); fa *pfa = makedfa(rs, 1);
if (newflag) if (newflag)
found = fnematch(pfa, inf, &buf, &bufsize, recsize); found = fnematch(pfa, inf, &buf, &bufsize, recsize);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: main.c,v 1.62 2023/09/20 16:57:12 millert Exp $ */ /* $OpenBSD: main.c,v 1.63 2023/10/06 22:29:24 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE. THIS SOFTWARE.
****************************************************************/ ****************************************************************/
const char *version = "version 20230913"; const char *version = "version 20231001";
#define DEBUG #define DEBUG
#include <stdio.h> #include <stdio.h>

View File

@ -1,4 +1,4 @@
/* $OpenBSD: run.c,v 1.78 2023/09/20 16:49:13 millert Exp $ */ /* $OpenBSD: run.c,v 1.79 2023/10/06 22:29:24 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -2587,6 +2587,7 @@ Cell *gsub(Node **a, int nnn) /* global substitute */
fa *pfa; fa *pfa;
int mflag, tempstat, num; int mflag, tempstat, num;
int bufsz = recsize; int bufsz = recsize;
int charlen = 0;
if ((buf = (char *) malloc(bufsz)) == NULL) if ((buf = (char *) malloc(bufsz)) == NULL)
FATAL("out of memory in gsub"); FATAL("out of memory in gsub");
@ -2628,7 +2629,9 @@ Cell *gsub(Node **a, int nnn) /* global substitute */
if (*t == '\0') /* at end */ if (*t == '\0') /* at end */
goto done; goto done;
adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gsub"); adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gsub");
*pb++ = *t++; charlen = u8_nextlen(t);
while (charlen-- > 0)
*pb++ = *t++;
if (pb > buf + bufsz) /* BUG: not sure of this test */ if (pb > buf + bufsz) /* BUG: not sure of this test */
FATAL("gsub result0 %.30s too big; can't happen", buf); FATAL("gsub result0 %.30s too big; can't happen", buf);
mflag = 0; mflag = 0;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dhcpd.c,v 1.58 2023/10/05 18:46:14 mvs Exp $ */ /* $OpenBSD: dhcpd.c,v 1.59 2023/10/06 05:31:54 jmc Exp $ */
/* /*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org> * Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@ -276,7 +276,7 @@ usage(void)
{ {
extern char *__progname; extern char *__progname;
fprintf(stderr, "usage: %s [-dfn] [-A abandoned_ip_table]", fprintf(stderr, "usage: %s [-dfnv] [-A abandoned_ip_table]",
__progname); __progname);
fprintf(stderr, " [-C changed_ip_table]\n"); fprintf(stderr, " [-C changed_ip_table]\n");
fprintf(stderr, "\t[-c config-file] [-L leased_ip_table]"); fprintf(stderr, "\t[-c config-file] [-L leased_ip_table]");

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl #! /usr/bin/perl
# ex:ts=8 sw=4: # ex:ts=8 sw=4:
# $OpenBSD: PkgAdd.pm,v 1.143 2023/07/03 19:12:08 espie Exp $ # $OpenBSD: PkgAdd.pm,v 1.144 2023/10/07 09:11:26 espie Exp $
# #
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
# #
@ -1112,6 +1112,16 @@ sub grab_debug_package($class, $d, $dbg, $state)
} }
} }
sub report_cantupdate($state, $cantupdate)
{
if ($state->tracker->did_something) {
$state->say("Couldn't find updates for #1",
join(' ', sort @$cantupdate));
} else {
$state->say("Couldn't find any update");
}
}
sub inform_user_of_problems($state) sub inform_user_of_problems($state)
{ {
my @cantupdate = $state->tracker->cant_list; my @cantupdate = $state->tracker->cant_list;
@ -1120,10 +1130,8 @@ sub inform_user_of_problems($state)
sub($quirks) { sub($quirks) {
$quirks->filter_obsolete(\@cantupdate, $state); $quirks->filter_obsolete(\@cantupdate, $state);
}); });
$state->say("Couldn't find updates for #1",
join(' ', sort @cantupdate)) if @cantupdate > 0;
if (@cantupdate > 0) { if (@cantupdate > 0) {
report_cantupdate($state, \@cantupdate);
$state->{bad}++; $state->{bad}++;
} }
} }

View File

@ -1,6 +1,6 @@
#! /usr/bin/perl #! /usr/bin/perl
# ex:ts=8 sw=4: # ex:ts=8 sw=4:
# $OpenBSD: PkgCreate.pm,v 1.195 2023/07/20 17:56:37 espie Exp $ # $OpenBSD: PkgCreate.pm,v 1.196 2023/10/07 09:09:07 espie Exp $
# #
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
# #
@ -1684,7 +1684,7 @@ sub run_command($self, $state)
} }
$state->{stash} = {}; $state->{stash} = {};
if ($state->{bad} && !$state->defines('REGRESSION_TESTING')) { if ($state->{bad} && !$state->{regression}{plist_checks}) {
$state->fatal("can't continue"); $state->fatal("can't continue");
} }
$state->{bad} = 0; $state->{bad} = 0;

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4: # ex:ts=8 sw=4:
# $OpenBSD: Tracker.pm,v 1.31 2023/06/13 09:07:17 espie Exp $ # $OpenBSD: Tracker.pm,v 1.32 2023/10/07 09:10:03 espie Exp $
# #
# Copyright (c) 2009 Marc Espie <espie@openbsd.org> # Copyright (c) 2009 Marc Espie <espie@openbsd.org>
# #
@ -101,6 +101,9 @@ sub add_set($self, $set)
for my $n ($set->kept) { for my $n ($set->kept) {
delete $self->{to_update}{$n->pkgname}; delete $self->{to_update}{$n->pkgname};
$self->{uptodate}{$n->pkgname} = 1; $self->{uptodate}{$n->pkgname} = 1;
if ($n->{is_firmware}) {
$self->{firmware}{$n->pkgname} = 1;
}
} }
$self->known($set); $self->known($set);
$self->handle_set($set); $self->handle_set($set);
@ -134,6 +137,9 @@ sub uptodate($self, $set)
$self->remove_set($set); $self->remove_set($set);
for my $n ($set->older, $set->kept) { for my $n ($set->older, $set->kept) {
$self->{uptodate}{$n->pkgname} = 1; $self->{uptodate}{$n->pkgname} = 1;
if ($n->{is_firmware}) {
$self->{firmware}{$n->pkgname} = 1;
}
} }
} }
@ -198,6 +204,15 @@ sub cant_list($self)
return keys %{$self->{cant_update}}; return keys %{$self->{cant_update}};
} }
sub did_something($self)
{
for my $k (keys %{$self->{uptodate}}) {
next if $self->{firmware}{$k};
return 1;
}
return 0;
}
sub cant_install_list($self) sub cant_install_list($self)
{ {
return keys %{$self->{cant_install}}; return keys %{$self->{cant_install}};

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4: # ex:ts=8 sw=4:
# $OpenBSD: Update.pm,v 1.170 2023/06/13 09:07:17 espie Exp $ # $OpenBSD: Update.pm,v 1.171 2023/10/07 09:10:03 espie Exp $
# #
# Copyright (c) 2004-2014 Marc Espie <espie@openbsd.org> # Copyright (c) 2004-2014 Marc Espie <espie@openbsd.org>
# #
@ -117,6 +117,7 @@ sub process_handle($self, $set, $h, $state)
if ($plist->has('firmware') && !$state->defines('FW_UPDATE')) { if ($plist->has('firmware') && !$state->defines('FW_UPDATE')) {
$set->move_kept($h); $set->move_kept($h);
$h->{is_firmware} = 1;
return 0; return 0;
} }