sync with OpenBSD -current

This commit is contained in:
purplerain 2025-02-06 01:03:22 +00:00
parent 55a56ce945
commit e5db03a272
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
20 changed files with 169 additions and 108 deletions

View file

@ -2683,8 +2683,8 @@
./usr/libexec/ssh-keysign ./usr/libexec/ssh-keysign
./usr/libexec/ssh-pkcs11-helper ./usr/libexec/ssh-pkcs11-helper
./usr/libexec/ssh-sk-helper ./usr/libexec/ssh-sk-helper
./usr/libexec/sshd-session
./usr/libexec/sshd-auth ./usr/libexec/sshd-auth
./usr/libexec/sshd-session
./usr/libexec/tradcpp ./usr/libexec/tradcpp
./usr/libexec/vi.recover ./usr/libexec/vi.recover
./usr/local ./usr/local

View file

@ -1,4 +1,4 @@
# $OpenBSD: lacnic.constraints,v 1.6 2024/04/17 14:31:59 job Exp $ # $OpenBSD: lacnic.constraints,v 1.7 2025/02/05 20:45:00 job Exp $
# From https://www.iana.org/assignments/ipv6-unicast-address-assignments # From https://www.iana.org/assignments/ipv6-unicast-address-assignments
allow 2001:1200::/23 allow 2001:1200::/23
@ -685,8 +685,7 @@ allow 26426
allow 26434 allow 26434
allow 26473 allow 26473
allow 26505 allow 26505
allow 26592 - 26596 allow 26592 - 26623
allow 26598 - 26623
# AFRINIC Internet Number Resources cannot be transferred # AFRINIC Internet Number Resources cannot be transferred
# From https://www.iana.org/assignments/ipv4-address-space/ # From https://www.iana.org/assignments/ipv4-address-space/

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: python-module.5,v 1.15 2025/01/17 08:52:01 sthen Exp $ .\" $OpenBSD: python-module.5,v 1.16 2025/02/05 11:10:19 sthen Exp $
.\" .\"
.\" Copyright (c) 2008 Marc Espie .\" Copyright (c) 2008 Marc Espie
.\" .\"
@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd $Mdocdate: January 17 2025 $ .Dd $Mdocdate: February 5 2025 $
.Dt PYTHON-MODULE 5 .Dt PYTHON-MODULE 5
.Os .Os
.Sh NAME .Sh NAME
@ -59,7 +59,7 @@ and
.Ev MODPY_ADJ_FILES .Ev MODPY_ADJ_FILES
accordingly. accordingly.
.Pp .Pp
The module also appends to The module also adds a dependency on the Python interpreter to
.Bl -bullet .Bl -bullet
.It .It
.Ev RUN_DEPENDS .Ev RUN_DEPENDS
@ -106,10 +106,10 @@ If the port provides a
file, check the "build-backend" line in the [build-system] section. file, check the "build-backend" line in the [build-system] section.
.Nm .Nm
currently supports flit, flit_core, hatchling, hatch-vcs, jupyter_packaging, currently supports flit, flit_core, hatchling, hatch-vcs, jupyter_packaging,
maturin, pdm, poetry-core, setuptools, setuptools-rust, and setuptools_scm. maturin, pbr, pdm, poetry-core, setuptools, setuptools-rust, and setuptools_scm.
If no If no
.Pa pyproject.toml .Pa pyproject.toml
is provided then it probably uses setuptools. is provided then it most likely uses setuptools.
Setting Setting
.Ev MODPY_PYBUILD .Ev MODPY_PYBUILD
adds the backend to adds the backend to
@ -124,6 +124,10 @@ can be set to
to use the PEP 517 build mechanism without adding a dependency to use the PEP 517 build mechanism without adding a dependency
for a backend. for a backend.
.Pp .Pp
Some checks are done to warn during "make fake" if
.Ev MODPY_PYBUILD
appears to be set incorrectly.
.Pp
Python 2 and some older Python 3 ports using setuptools still set Python 2 and some older Python 3 ports using setuptools still set
.Ev MODPY_SETUPTOOLS .Ev MODPY_SETUPTOOLS
to Yes, which appends to to Yes, which appends to
@ -146,11 +150,11 @@ with some small changes to the port.
.Ev MODPY_SETUPTOOLS .Ev MODPY_SETUPTOOLS
should not be used for new ports. should not be used for new ports.
.Pp .Pp
Ports which use the pytest module should set Ports using pytest should set
.Ev MODPY_PYTEST .Ev MODPY_PYTEST
to Yes. to Yes unless
This is set automatically for builds using .Ev MODPY_PYBUILD
.Ev MODPY_PYBUILD . is used, when it is already set by default.
Arguments can be passed to pytest during Arguments can be passed to pytest during
.Cm test .Cm test
with with
@ -164,7 +168,7 @@ or to disable certain individual tests with
User setting User setting
.Ev MODPY_PYTEST_USERARGS , .Ev MODPY_PYTEST_USERARGS ,
if present, is passed on the command line. if present, is passed on the command line.
This allows setting py.test flags to increase verbosity, This allows setting pytest flags to increase verbosity,
show test durations, enable colours, etc. show test durations, enable colours, etc.
.Pp .Pp
If If
@ -224,13 +228,5 @@ and set
the subdirectory can be overridden with the subdirectory can be overridden with
.Ev MODPY_PI_DIR .Ev MODPY_PI_DIR
.Pc . .Pc .
.Ss Packing-list generation
Python 2.x places .pyc files in the same directory as the associated .py file.
Python 3.x places these in a separate __pycache__ directory and uses an
additional suffix that includes the Python version.
In some cases, an ABI tag is also used for names of compiled extensions.
The python module defines variables so that a
.Pa PLIST
is likely to still work with a newer Python version without changes.
.Sh SEE ALSO .Sh SEE ALSO
.Xr port-modules 5 .Xr port-modules 5

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acpitz.c,v 1.60 2024/05/13 01:15:50 jsg Exp $ */ /* $OpenBSD: acpitz.c,v 1.61 2025/02/05 11:03:36 kettenis Exp $ */
/* /*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org> * Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
@ -196,6 +196,8 @@ acpitz_attach(struct device *parent, struct device *self, void *aux)
for (i = 0; i < ACPITZ_MAX_AC; i++) for (i = 0; i < ACPITZ_MAX_AC; i++)
TAILQ_INIT(&sc->sc_alx[i]); TAILQ_INIT(&sc->sc_alx[i]);
printf("\n");
/* /*
* Preread the trip points (discard/ignore values read here as we will * Preread the trip points (discard/ignore values read here as we will
* re-read them later) * re-read them later)
@ -207,19 +209,18 @@ acpitz_attach(struct device *parent, struct device *self, void *aux)
snprintf(name, sizeof(name), "_AC%d", i); snprintf(name, sizeof(name), "_AC%d", i);
acpitz_getreading(sc, name); acpitz_getreading(sc, name);
} }
acpitz_gettempreading(sc, "_TMP");
sc->sc_lasttmp = -1; sc->sc_lasttmp = -1;
if ((sc->sc_tmp = acpitz_gettempreading(sc, "_TMP")) == -1) { if ((sc->sc_tmp = acpitz_gettempreading(sc, "_TMP")) == -1) {
dnprintf(10, ": failed to read _TMP"); dnprintf(10, "%s: failed to read _TMP\n", DEVNAME(sc));
printf("\n");
return; return;
} }
if ((sc->sc_crt = acpitz_gettempreading(sc, "_CRT")) == -1) if ((sc->sc_crt = acpitz_gettempreading(sc, "_CRT")) == -1)
printf(": no critical temperature defined\n"); printf("%s: no critical temperature defined\n", DEVNAME(sc));
else else
printf(": critical temperature is %d degC\n", KTOC(sc->sc_crt)); printf("%s: critical temperature is %d degC\n", DEVNAME(sc),
KTOC(sc->sc_crt));
sc->sc_hot = acpitz_gettempreading(sc, "_HOT"); sc->sc_hot = acpitz_gettempreading(sc, "_HOT");
sc->sc_tc1 = acpitz_getreading(sc, "_TC1"); sc->sc_tc1 = acpitz_getreading(sc, "_TC1");

View file

@ -1,4 +1,4 @@
/* $OpenBSD: qwx.c,v 1.67 2024/09/01 03:08:56 jsg Exp $ */ /* $OpenBSD: qwx.c,v 1.68 2025/02/05 09:28:01 stsp Exp $ */
/* /*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org> * Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@ -22182,14 +22182,31 @@ qwx_reg_update_chan_list(struct qwx_softc *sc, uint8_t pdev_id)
int num_channels = 0; int num_channels = 0;
size_t params_size; size_t params_size;
int ret; int ret;
int scan_2ghz = 1, scan_5ghz = 1;
#if 0 #if 0
if (ar->state == ATH11K_STATE_RESTARTING) if (ar->state == ATH11K_STATE_RESTARTING)
return 0; return 0;
#endif #endif
/*
* Scan an appropriate subset of channels if we are running
* in a fixed, user-specified phy mode.
*/
if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) != IFM_AUTO) {
if (ic->ic_curmode == IEEE80211_MODE_11A ||
ic->ic_curmode == IEEE80211_MODE_11AC)
scan_2ghz = 0;
if (ic->ic_curmode == IEEE80211_MODE_11B ||
ic->ic_curmode == IEEE80211_MODE_11G)
scan_5ghz = 0;
}
lastc = &ic->ic_channels[IEEE80211_CHAN_MAX]; lastc = &ic->ic_channels[IEEE80211_CHAN_MAX];
for (channel = &ic->ic_channels[1]; channel <= lastc; channel++) { for (channel = &ic->ic_channels[1]; channel <= lastc; channel++) {
if (channel->ic_flags == 0) if (channel->ic_flags == 0)
continue; continue;
if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(channel)) ||
(!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(channel)))
continue;
num_channels++; num_channels++;
} }
@ -22215,6 +22232,9 @@ qwx_reg_update_chan_list(struct qwx_softc *sc, uint8_t pdev_id)
for (channel = &ic->ic_channels[1]; channel <= lastc; channel++) { for (channel = &ic->ic_channels[1]; channel <= lastc; channel++) {
if (channel->ic_flags == 0) if (channel->ic_flags == 0)
continue; continue;
if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(channel)) ||
(!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(channel)))
continue;
#ifdef notyet #ifdef notyet
/* TODO: Set to true/false based on some condition? */ /* TODO: Set to true/false based on some condition? */
ch->allow_ht = true; ch->allow_ht = true;
@ -24843,6 +24863,7 @@ qwx_scan(struct qwx_softc *sc)
struct ieee80211_channel *chan, *lastc; struct ieee80211_channel *chan, *lastc;
int ret = 0, num_channels, i; int ret = 0, num_channels, i;
uint32_t scan_timeout; uint32_t scan_timeout;
int scan_2ghz = 1, scan_5ghz = 1;
if (arvif == NULL) { if (arvif == NULL) {
printf("%s: no vdev found\n", sc->sc_dev.dv_xname); printf("%s: no vdev found\n", sc->sc_dev.dv_xname);
@ -24910,11 +24931,27 @@ qwx_scan(struct qwx_softc *sc)
} else } else
arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE; arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE;
/*
* Scan an appropriate subset of channels if we are running
* in a fixed, user-specified phy mode.
*/
if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) != IFM_AUTO) {
if (ic->ic_curmode == IEEE80211_MODE_11A ||
ic->ic_curmode == IEEE80211_MODE_11AC)
scan_2ghz = 0;
if (ic->ic_curmode == IEEE80211_MODE_11B ||
ic->ic_curmode == IEEE80211_MODE_11G)
scan_5ghz = 0;
}
lastc = &ic->ic_channels[IEEE80211_CHAN_MAX]; lastc = &ic->ic_channels[IEEE80211_CHAN_MAX];
num_channels = 0; num_channels = 0;
for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) { for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) {
if (chan->ic_flags == 0) if (chan->ic_flags == 0)
continue; continue;
if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(chan)) ||
(!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(chan)))
continue;
num_channels++; num_channels++;
} }
if (num_channels) { if (num_channels) {
@ -24931,6 +24968,9 @@ qwx_scan(struct qwx_softc *sc)
for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) { for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) {
if (chan->ic_flags == 0) if (chan->ic_flags == 0)
continue; continue;
if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(chan)) ||
(!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(chan)))
continue;
if (isset(sc->wmi.svc_map, if (isset(sc->wmi.svc_map,
WMI_TLV_SERVICE_SCAN_CONFIG_PER_CHANNEL)) { WMI_TLV_SERVICE_SCAN_CONFIG_PER_CHANNEL)) {
arg->chan_list[i++] = chan->ic_freq & arg->chan_list[i++] = chan->ic_freq &
@ -24984,7 +25024,7 @@ qwx_scan(struct qwx_softc *sc)
* The current mode might have been fixed during association. * The current mode might have been fixed during association.
* Ensure all channels get scanned. * Ensure all channels get scanned.
*/ */
if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
ieee80211_setmode(ic, IEEE80211_MODE_AUTO); ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
} }
#if 0 #if 0

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_malloc.c,v 1.153 2025/01/14 18:37:51 mvs Exp $ */ /* $OpenBSD: kern_malloc.c,v 1.154 2025/02/05 18:29:17 mvs Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/* /*
@ -175,7 +175,7 @@ malloc(size_t size, int type, int flags)
} }
#endif #endif
if (size > 65535 * PAGE_SIZE) { if (size > MALLOC_MAX) {
if (flags & M_CANFAIL) { if (flags & M_CANFAIL) {
#ifndef SMALL_KERNEL #ifndef SMALL_KERNEL
if (ratecheck(&malloc_lasterr, &malloc_errintvl)) if (ratecheck(&malloc_lasterr, &malloc_errintvl))

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_sig.c,v 1.359 2025/01/25 19:21:40 claudio Exp $ */ /* $OpenBSD: kern_sig.c,v 1.360 2025/02/05 12:21:27 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 $ */
/* /*
@ -2081,7 +2081,7 @@ userret(struct proc *p)
int signum; int signum;
if (p->p_flag & P_SUSPSINGLE) if (p->p_flag & P_SUSPSINGLE)
single_thread_check(p, 0); proc_suspend_check(p, 0);
/* send SIGPROF or SIGVTALRM if their timers interrupted this thread */ /* send SIGPROF or SIGVTALRM if their timers interrupted this thread */
if (p->p_flag & P_PROFPEND) { if (p->p_flag & P_PROFPEND) {
@ -2118,7 +2118,7 @@ userret(struct proc *p)
} }
int int
single_thread_check_locked(struct proc *p, int deep) proc_suspend_check_locked(struct proc *p, int deep)
{ {
struct process *pr = p->p_p; struct process *pr = p->p_p;
@ -2166,12 +2166,12 @@ single_thread_check_locked(struct proc *p, int deep)
} }
int int
single_thread_check(struct proc *p, int deep) proc_suspend_check(struct proc *p, int deep)
{ {
int error; int error;
mtx_enter(&p->p_p->ps_mtx); mtx_enter(&p->p_p->ps_mtx);
error = single_thread_check_locked(p, deep); error = proc_suspend_check_locked(p, deep);
mtx_leave(&p->p_p->ps_mtx); mtx_leave(&p->p_p->ps_mtx);
return error; return error;
@ -2196,7 +2196,7 @@ single_thread_set(struct proc *p, int flags)
KASSERT(curproc == p); KASSERT(curproc == p);
mtx_enter(&pr->ps_mtx); mtx_enter(&pr->ps_mtx);
error = single_thread_check_locked(p, flags & SINGLE_DEEP); error = proc_suspend_check_locked(p, flags & SINGLE_DEEP);
if (error) { if (error) {
mtx_leave(&pr->ps_mtx); mtx_leave(&pr->ps_mtx);
return error; return error;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_synch.c,v 1.218 2025/01/22 16:14:22 claudio Exp $ */ /* $OpenBSD: kern_synch.c,v 1.219 2025/02/05 12:21:27 claudio Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/* /*
@ -461,7 +461,7 @@ sleep_signal_check(struct proc *p, int after_sleep)
struct sigctx ctx; struct sigctx ctx;
int err, sig; int err, sig;
if ((err = single_thread_check(p, 1)) != 0) { if ((err = proc_suspend_check(p, 1)) != 0) {
if (err != EWOULDBLOCK) if (err != EWOULDBLOCK)
return err; return err;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: uipc_socket.c,v 1.370 2025/02/03 09:00:55 mvs Exp $ */ /* $OpenBSD: uipc_socket.c,v 1.371 2025/02/05 08:28:25 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/* /*
@ -77,6 +77,9 @@ int filt_sowprocess(struct knote *kn, struct kevent *kev);
int filt_sormodify(struct kevent *kev, struct knote *kn); int filt_sormodify(struct kevent *kev, struct knote *kn);
int filt_sorprocess(struct knote *kn, struct kevent *kev); int filt_sorprocess(struct knote *kn, struct kevent *kev);
int filt_soemodify(struct kevent *kev, struct knote *kn);
int filt_soeprocess(struct knote *kn, struct kevent *kev);
const struct filterops soread_filtops = { const struct filterops soread_filtops = {
.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE, .f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
.f_attach = NULL, .f_attach = NULL,
@ -100,8 +103,8 @@ const struct filterops soexcept_filtops = {
.f_attach = NULL, .f_attach = NULL,
.f_detach = filt_sordetach, .f_detach = filt_sordetach,
.f_event = filt_soexcept, .f_event = filt_soexcept,
.f_modify = filt_sormodify, .f_modify = filt_soemodify,
.f_process = filt_sorprocess, .f_process = filt_soeprocess,
}; };
#ifndef SOMINCONN #ifndef SOMINCONN
@ -2241,38 +2244,6 @@ sohasoutofband(struct socket *so)
knote(&so->so_rcv.sb_klist, 0); knote(&so->so_rcv.sb_klist, 0);
} }
void
sofilt_lock(struct socket *so, struct sockbuf *sb)
{
switch (so->so_proto->pr_domain->dom_family) {
case PF_INET:
case PF_INET6:
NET_LOCK_SHARED();
break;
default:
rw_enter_write(&so->so_lock);
break;
}
mtx_enter(&sb->sb_mtx);
}
void
sofilt_unlock(struct socket *so, struct sockbuf *sb)
{
mtx_leave(&sb->sb_mtx);
switch (so->so_proto->pr_domain->dom_family) {
case PF_INET:
case PF_INET6:
NET_UNLOCK_SHARED();
break;
default:
rw_exit_write(&so->so_lock);
break;
}
}
int int
soo_kqfilter(struct file *fp, struct knote *kn) soo_kqfilter(struct file *fp, struct knote *kn)
{ {
@ -2470,9 +2441,13 @@ filt_sormodify(struct kevent *kev, struct knote *kn)
struct socket *so = kn->kn_fp->f_data; struct socket *so = kn->kn_fp->f_data;
int rv; int rv;
sofilt_lock(so, &so->so_rcv); if (so->so_proto->pr_flags & PR_WANTRCVD)
solock_shared(so);
mtx_enter(&so->so_rcv.sb_mtx);
rv = knote_modify(kev, kn); rv = knote_modify(kev, kn);
sofilt_unlock(so, &so->so_rcv); mtx_leave(&so->so_rcv.sb_mtx);
if (so->so_proto->pr_flags & PR_WANTRCVD)
sounlock_shared(so);
return (rv); return (rv);
} }
@ -2483,9 +2458,39 @@ filt_sorprocess(struct knote *kn, struct kevent *kev)
struct socket *so = kn->kn_fp->f_data; struct socket *so = kn->kn_fp->f_data;
int rv; int rv;
sofilt_lock(so, &so->so_rcv); if (so->so_proto->pr_flags & PR_WANTRCVD)
solock_shared(so);
mtx_enter(&so->so_rcv.sb_mtx);
rv = knote_process(kn, kev); rv = knote_process(kn, kev);
sofilt_unlock(so, &so->so_rcv); mtx_leave(&so->so_rcv.sb_mtx);
if (so->so_proto->pr_flags & PR_WANTRCVD)
sounlock_shared(so);
return (rv);
}
int
filt_soemodify(struct kevent *kev, struct knote *kn)
{
struct socket *so = kn->kn_fp->f_data;
int rv;
mtx_enter(&so->so_rcv.sb_mtx);
rv = knote_modify(kev, kn);
mtx_leave(&so->so_rcv.sb_mtx);
return (rv);
}
int
filt_soeprocess(struct knote *kn, struct kevent *kev)
{
struct socket *so = kn->kn_fp->f_data;
int rv;
mtx_enter(&so->so_rcv.sb_mtx);
rv = knote_process(kn, kev);
mtx_leave(&so->so_rcv.sb_mtx);
return (rv); return (rv);
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bpf.c,v 1.230 2025/01/19 03:27:27 dlg Exp $ */ /* $OpenBSD: bpf.c,v 1.231 2025/02/05 18:29:17 mvs Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/* /*
@ -1813,7 +1813,7 @@ bpf_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
atomic_load_int(&bpf_maxbufsize)); atomic_load_int(&bpf_maxbufsize));
case NET_BPF_MAXBUFSIZE: case NET_BPF_MAXBUFSIZE:
return sysctl_int_bounded(oldp, oldlenp, newp, newlen, return sysctl_int_bounded(oldp, oldlenp, newp, newlen,
&bpf_maxbufsize, BPF_MINBUFSIZE, INT_MAX); &bpf_maxbufsize, BPF_MINBUFSIZE, MALLOC_MAX);
default: default:
return (EOPNOTSUPP); return (EOPNOTSUPP);
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: in_pcb.c,v 1.310 2025/01/09 16:47:24 bluhm Exp $ */ /* $OpenBSD: in_pcb.c,v 1.311 2025/02/05 10:15:10 bluhm Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/* /*
@ -635,6 +635,13 @@ in_pcbsolock_ref(struct inpcb *inp)
if (so == NULL) if (so == NULL)
return NULL; return NULL;
rw_enter_write(&so->so_lock); rw_enter_write(&so->so_lock);
/* between mutex and rwlock inpcb could be detached */
if (so->so_pcb == NULL) {
rw_exit_write(&so->so_lock);
sorele(so);
return NULL;
}
KASSERT(inp->inp_socket == so && sotoinpcb(so) == inp);
return so; return so;
} }
@ -643,7 +650,6 @@ in_pcbsounlock_rele(struct inpcb *inp, struct socket *so)
{ {
if (so == NULL) if (so == NULL)
return; return;
KASSERT(inp->inp_socket == NULL || inp->inp_socket == so);
rw_exit_write(&so->so_lock); rw_exit_write(&so->so_lock);
sorele(so); sorele(so);
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: malloc.h,v 1.126 2023/12/19 14:40:04 deraadt Exp $ */ /* $OpenBSD: malloc.h,v 1.127 2025/02/05 18:29:17 mvs Exp $ */
/* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */ /* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */
/* /*
@ -369,6 +369,7 @@ struct kmembuckets {
#define MINALLOCSIZE (1 << MINBUCKET) #define MINALLOCSIZE (1 << MINBUCKET)
#define MAXALLOCSAVE (2 * PAGE_SIZE) #define MAXALLOCSAVE (2 * PAGE_SIZE)
#define MALLOC_MAX (65535 * PAGE_SIZE)
/* /*
* Turn virtual addresses into kmem map indices * Turn virtual addresses into kmem map indices

View file

@ -1,4 +1,4 @@
/* $OpenBSD: proc.h,v 1.378 2025/01/25 19:21:40 claudio Exp $ */ /* $OpenBSD: proc.h,v 1.379 2025/02/05 12:21:27 claudio Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*- /*-
@ -601,7 +601,8 @@ refreshcreds(struct proc *p)
int single_thread_set(struct proc *, int); int single_thread_set(struct proc *, int);
int single_thread_wait(struct process *, int); int single_thread_wait(struct process *, int);
void single_thread_clear(struct proc *); void single_thread_clear(struct proc *);
int single_thread_check(struct proc *, int);
int proc_suspend_check(struct proc *, int);
void child_return(void *); void child_return(void *);

View file

@ -25,6 +25,20 @@ 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.
Jan 14, 2025
Fix incorrect error line number issues. unput has
no business managing lineno. Thanks to Ozan Yigit.
Jan 05, 2025
Fix hex detection in is_valid_number.
Fix indirect field specification with non-numeric string
eg. $("foo") in indirect. This is not illegal.
Thanks to Arnold Robbins.
Jan 01, 2025
Fixed openfile to not try to read from a directory.
Thanks to Arnold Robbins.
Jul 28, 2024 Jul 28, 2024
Fixed readcsvrec resize segfault when reading csv records longer Fixed readcsvrec resize segfault when reading csv records longer
than 8k. Thanks to Ozan Yigit. than 8k. Thanks to Ozan Yigit.

View file

@ -1,4 +1,4 @@
/* $OpenBSD: b.c,v 1.54 2024/08/03 21:12:16 millert Exp $ */ /* $OpenBSD: b.c,v 1.55 2025/02/05 20:32:56 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -619,7 +619,7 @@ static void resize_gototab(fa *f, int state)
if (p == NULL) if (p == NULL)
overflo(__func__); overflo(__func__);
// need to initialized the new memory to zero // need to initialize the new memory to zero
size_t orig_size = f->gototab[state].allocated; // 2nd half of new mem is this size size_t orig_size = f->gototab[state].allocated; // 2nd half of new mem is this size
memset(p + orig_size, 0, orig_size * sizeof(gtte)); // clean it out memset(p + orig_size, 0, orig_size * sizeof(gtte)); // clean it out

View file

@ -1,4 +1,4 @@
/* $OpenBSD: lex.c,v 1.34 2024/06/03 00:58:04 millert Exp $ */ /* $OpenBSD: lex.c,v 1.35 2025/02/05 20:32:56 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -226,11 +226,6 @@ int yylex(void)
while ((c = input()) != '\n' && c != 0) while ((c = input()) != '\n' && c != 0)
; ;
unput(c); unput(c);
/*
* Next line is a hack, it compensates for
* unput's treatment of \n.
*/
lineno++;
break; break;
case ';': case ';':
RET(';'); RET(';');
@ -651,8 +646,6 @@ int input(void) /* get next lexical input character */
void unput(int c) /* put lexical character back on input */ void unput(int c) /* put lexical character back on input */
{ {
if (c == '\n')
lineno--;
if (yysptr >= yysbuf + sizeof(yysbuf)) if (yysptr >= yysbuf + sizeof(yysbuf))
FATAL("pushed back too much: %.20s...", yysbuf); FATAL("pushed back too much: %.20s...", yysbuf);
*yysptr++ = c; *yysptr++ = c;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: lib.c,v 1.59 2024/08/03 21:12:16 millert Exp $ */ /* $OpenBSD: lib.c,v 1.60 2025/02/05 20:32:56 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -887,7 +887,7 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok,
s++; s++;
/* no hex floating point, sorry */ /* no hex floating point, sorry */
if (s[0] == '0' && tolower((uschar)s[1]) == 'x') if (s[0] == '0' && tolower((uschar)s[1]) == 'x' && isxdigit((uschar)s[2]))
return false; return false;
/* allow +nan, -nan, +inf, -inf, any other letter, no */ /* allow +nan, -nan, +inf, -inf, any other letter, no */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: main.c,v 1.72 2024/08/03 21:12:16 millert Exp $ */ /* $OpenBSD: main.c,v 1.73 2025/02/05 20:32:56 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 20240728"; const char *version = "version 20250116";
#define DEBUG #define DEBUG
#include <stdio.h> #include <stdio.h>

View file

@ -1,4 +1,4 @@
/* $OpenBSD: run.c,v 1.88 2024/06/04 14:40:46 millert Exp $ */ /* $OpenBSD: run.c,v 1.89 2025/02/05 20:32:56 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -36,6 +36,7 @@ THIS SOFTWARE.
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "awk.h" #include "awk.h"
#include "awkgram.tab.h" #include "awkgram.tab.h"
@ -956,16 +957,12 @@ Cell *indirect(Node **a, int n) /* $( a[0] ) */
Awkfloat val; Awkfloat val;
Cell *x; Cell *x;
int m; int m;
char *s;
x = execute(a[0]); x = execute(a[0]);
val = getfval(x); /* freebsd: defend against super large field numbers */ val = getfval(x); /* freebsd: defend against super large field numbers */
if ((Awkfloat)INT_MAX < val) if ((Awkfloat)INT_MAX < val)
FATAL("trying to access out of range field %s", x->nval); FATAL("trying to access out of range field %s", x->nval);
m = (int) val; m = (int) val;
if (m == 0 && !is_number(s = getsval(x), NULL)) /* suspicion! */
FATAL("illegal field $(%s), name \"%s\"", s, x->nval);
/* BUG: can x->nval ever be null??? */
tempfree(x); tempfree(x);
x = fieldadr(m); x = fieldadr(m);
x->ctype = OCELL; /* BUG? why are these needed? */ x->ctype = OCELL; /* BUG? why are these needed? */
@ -2370,9 +2367,11 @@ FILE *openfile(int a, const char *us, bool *pnewflag)
size_t i; size_t i;
int m; int m;
FILE *fp = NULL; FILE *fp = NULL;
struct stat sbuf;
if (*s == '\0') if (*s == '\0')
FATAL("null file name in print or getline"); FATAL("null file name in print or getline");
for (i = 0; i < nfiles; i++) for (i = 0; i < nfiles; i++)
if (files[i].fname && strcmp(s, files[i].fname) == 0 && if (files[i].fname && strcmp(s, files[i].fname) == 0 &&
(a == files[i].mode || (a==APPEND && files[i].mode==GT) || (a == files[i].mode || (a==APPEND && files[i].mode==GT) ||
@ -2383,7 +2382,6 @@ FILE *openfile(int a, const char *us, bool *pnewflag)
} }
if (a == FFLUSH) /* didn't find it, so don't create it! */ if (a == FFLUSH) /* didn't find it, so don't create it! */
return NULL; return NULL;
for (i = 0; i < nfiles; i++) for (i = 0; i < nfiles; i++)
if (files[i].fp == NULL) if (files[i].fp == NULL)
break; break;
@ -2397,7 +2395,14 @@ FILE *openfile(int a, const char *us, bool *pnewflag)
nfiles = nnf; nfiles = nnf;
files = nf; files = nf;
} }
fflush(stdout); /* force a semblance of order */ fflush(stdout); /* force a semblance of order */
/* don't try to read or write a directory */
if (a == LT || a == GT || a == APPEND)
if (stat(s, &sbuf) == 0 && S_ISDIR(sbuf.st_mode))
return NULL;
m = a; m = a;
if (a == GT) { if (a == GT) {
fp = fopen(s, "w"); fp = fopen(s, "w");

View file

@ -1,3 +1,3 @@
/* $OpenBSD: version.h,v 1.18 2024/12/16 16:14:46 claudio Exp $ */ /* $OpenBSD: version.h,v 1.19 2025/02/05 12:11:25 claudio Exp $ */
#define BGPD_VERSION "8.7" #define BGPD_VERSION "8.8"