From e5db03a2720bcd322436d970e0527c213c6f97f1 Mon Sep 17 00:00:00 2001 From: purplerain Date: Thu, 6 Feb 2025 01:03:22 +0000 Subject: [PATCH] sync with OpenBSD -current --- distrib/sets/lists/base/mi | 2 +- etc/rpki/lacnic.constraints | 5 +- share/man/man5/python-module.5 | 32 ++++++------- sys/dev/acpi/acpitz.c | 13 +++--- sys/dev/ic/qwx.c | 44 +++++++++++++++++- sys/kern/kern_malloc.c | 4 +- sys/kern/kern_sig.c | 12 ++--- sys/kern/kern_synch.c | 4 +- sys/kern/uipc_socket.c | 83 ++++++++++++++++++---------------- sys/net/bpf.c | 4 +- sys/netinet/in_pcb.c | 10 +++- sys/sys/malloc.h | 3 +- sys/sys/proc.h | 5 +- usr.bin/awk/FIXES | 14 ++++++ usr.bin/awk/b.c | 4 +- usr.bin/awk/lex.c | 9 +--- usr.bin/awk/lib.c | 4 +- usr.bin/awk/main.c | 4 +- usr.bin/awk/run.c | 17 ++++--- usr.sbin/bgpd/version.h | 4 +- 20 files changed, 169 insertions(+), 108 deletions(-) diff --git a/distrib/sets/lists/base/mi b/distrib/sets/lists/base/mi index 48b06f7cc..22184e944 100644 --- a/distrib/sets/lists/base/mi +++ b/distrib/sets/lists/base/mi @@ -2683,8 +2683,8 @@ ./usr/libexec/ssh-keysign ./usr/libexec/ssh-pkcs11-helper ./usr/libexec/ssh-sk-helper -./usr/libexec/sshd-session ./usr/libexec/sshd-auth +./usr/libexec/sshd-session ./usr/libexec/tradcpp ./usr/libexec/vi.recover ./usr/local diff --git a/etc/rpki/lacnic.constraints b/etc/rpki/lacnic.constraints index b223bbc1d..c0f8f065c 100644 --- a/etc/rpki/lacnic.constraints +++ b/etc/rpki/lacnic.constraints @@ -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 allow 2001:1200::/23 @@ -685,8 +685,7 @@ allow 26426 allow 26434 allow 26473 allow 26505 -allow 26592 - 26596 -allow 26598 - 26623 +allow 26592 - 26623 # AFRINIC Internet Number Resources cannot be transferred # From https://www.iana.org/assignments/ipv4-address-space/ diff --git a/share/man/man5/python-module.5 b/share/man/man5/python-module.5 index f971854e6..bb9c78d1e 100644 --- a/share/man/man5/python-module.5 +++ b/share/man/man5/python-module.5 @@ -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 .\" @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" 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 .Os .Sh NAME @@ -59,7 +59,7 @@ and .Ev MODPY_ADJ_FILES accordingly. .Pp -The module also appends to +The module also adds a dependency on the Python interpreter to .Bl -bullet .It .Ev RUN_DEPENDS @@ -106,10 +106,10 @@ If the port provides a file, check the "build-backend" line in the [build-system] section. .Nm 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 .Pa pyproject.toml -is provided then it probably uses setuptools. +is provided then it most likely uses setuptools. Setting .Ev MODPY_PYBUILD adds the backend to @@ -124,6 +124,10 @@ can be set to to use the PEP 517 build mechanism without adding a dependency for a backend. .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 .Ev MODPY_SETUPTOOLS to Yes, which appends to @@ -146,11 +150,11 @@ with some small changes to the port. .Ev MODPY_SETUPTOOLS should not be used for new ports. .Pp -Ports which use the pytest module should set +Ports using pytest should set .Ev MODPY_PYTEST -to Yes. -This is set automatically for builds using -.Ev MODPY_PYBUILD . +to Yes unless +.Ev MODPY_PYBUILD +is used, when it is already set by default. Arguments can be passed to pytest during .Cm test with @@ -164,7 +168,7 @@ or to disable certain individual tests with User setting .Ev MODPY_PYTEST_USERARGS , 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. .Pp If @@ -224,13 +228,5 @@ and set the subdirectory can be overridden with .Ev MODPY_PI_DIR .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 .Xr port-modules 5 diff --git a/sys/dev/acpi/acpitz.c b/sys/dev/acpi/acpitz.c index 4099b3b33..20d7a4b9b 100644 --- a/sys/dev/acpi/acpitz.c +++ b/sys/dev/acpi/acpitz.c @@ -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 * Copyright (c) 2005 Marco Peereboom @@ -196,6 +196,8 @@ acpitz_attach(struct device *parent, struct device *self, void *aux) for (i = 0; i < ACPITZ_MAX_AC; i++) TAILQ_INIT(&sc->sc_alx[i]); + printf("\n"); + /* * Preread the trip points (discard/ignore values read here as we will * 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); acpitz_getreading(sc, name); } - acpitz_gettempreading(sc, "_TMP"); sc->sc_lasttmp = -1; if ((sc->sc_tmp = acpitz_gettempreading(sc, "_TMP")) == -1) { - dnprintf(10, ": failed to read _TMP"); - printf("\n"); + dnprintf(10, "%s: failed to read _TMP\n", DEVNAME(sc)); return; } 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 - 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_tc1 = acpitz_getreading(sc, "_TC1"); diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index 67fea2964..bbb4f6ba7 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -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 @@ -22182,14 +22182,31 @@ qwx_reg_update_chan_list(struct qwx_softc *sc, uint8_t pdev_id) int num_channels = 0; size_t params_size; int ret; + int scan_2ghz = 1, scan_5ghz = 1; #if 0 if (ar->state == ATH11K_STATE_RESTARTING) return 0; #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]; for (channel = &ic->ic_channels[1]; channel <= lastc; channel++) { if (channel->ic_flags == 0) continue; + if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(channel)) || + (!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(channel))) + continue; 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++) { if (channel->ic_flags == 0) continue; + if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(channel)) || + (!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(channel))) + continue; #ifdef notyet /* TODO: Set to true/false based on some condition? */ ch->allow_ht = true; @@ -24843,6 +24863,7 @@ qwx_scan(struct qwx_softc *sc) struct ieee80211_channel *chan, *lastc; int ret = 0, num_channels, i; uint32_t scan_timeout; + int scan_2ghz = 1, scan_5ghz = 1; if (arvif == NULL) { printf("%s: no vdev found\n", sc->sc_dev.dv_xname); @@ -24910,11 +24931,27 @@ qwx_scan(struct qwx_softc *sc) } else 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]; num_channels = 0; for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) { if (chan->ic_flags == 0) continue; + if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(chan)) || + (!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(chan))) + continue; num_channels++; } if (num_channels) { @@ -24931,6 +24968,9 @@ qwx_scan(struct qwx_softc *sc) for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) { if (chan->ic_flags == 0) continue; + if ((!scan_2ghz && IEEE80211_IS_CHAN_2GHZ(chan)) || + (!scan_5ghz && IEEE80211_IS_CHAN_5GHZ(chan))) + continue; if (isset(sc->wmi.svc_map, WMI_TLV_SERVICE_SCAN_CONFIG_PER_CHANNEL)) { 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. * 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); } #if 0 diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index b95157c6d..7b92fcf56 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -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 $ */ /* @@ -175,7 +175,7 @@ malloc(size_t size, int type, int flags) } #endif - if (size > 65535 * PAGE_SIZE) { + if (size > MALLOC_MAX) { if (flags & M_CANFAIL) { #ifndef SMALL_KERNEL if (ratecheck(&malloc_lasterr, &malloc_errintvl)) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8b5720c98..9a6c7f47b 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -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 $ */ /* @@ -2081,7 +2081,7 @@ userret(struct proc *p) int signum; 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 */ if (p->p_flag & P_PROFPEND) { @@ -2118,7 +2118,7 @@ userret(struct proc *p) } 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; @@ -2166,12 +2166,12 @@ single_thread_check_locked(struct proc *p, int deep) } int -single_thread_check(struct proc *p, int deep) +proc_suspend_check(struct proc *p, int deep) { int error; 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); return error; @@ -2196,7 +2196,7 @@ single_thread_set(struct proc *p, int flags) KASSERT(curproc == p); 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) { mtx_leave(&pr->ps_mtx); return error; diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index a6b3ffc7f..8548aea1c 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -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 $ */ /* @@ -461,7 +461,7 @@ sleep_signal_check(struct proc *p, int after_sleep) struct sigctx ctx; int err, sig; - if ((err = single_thread_check(p, 1)) != 0) { + if ((err = proc_suspend_check(p, 1)) != 0) { if (err != EWOULDBLOCK) return err; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 88a063845..e518a430f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -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 $ */ /* @@ -77,6 +77,9 @@ int filt_sowprocess(struct knote *kn, struct kevent *kev); int filt_sormodify(struct kevent *kev, struct knote *kn); 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 = { .f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE, .f_attach = NULL, @@ -100,8 +103,8 @@ const struct filterops soexcept_filtops = { .f_attach = NULL, .f_detach = filt_sordetach, .f_event = filt_soexcept, - .f_modify = filt_sormodify, - .f_process = filt_sorprocess, + .f_modify = filt_soemodify, + .f_process = filt_soeprocess, }; #ifndef SOMINCONN @@ -2241,38 +2244,6 @@ sohasoutofband(struct socket *so) 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 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; 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); - 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); } @@ -2483,9 +2458,39 @@ filt_sorprocess(struct knote *kn, struct kevent *kev) struct socket *so = kn->kn_fp->f_data; 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); - 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); } diff --git a/sys/net/bpf.c b/sys/net/bpf.c index e763c7aec..0a384534d 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -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 $ */ /* @@ -1813,7 +1813,7 @@ bpf_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, atomic_load_int(&bpf_maxbufsize)); case NET_BPF_MAXBUFSIZE: return sysctl_int_bounded(oldp, oldlenp, newp, newlen, - &bpf_maxbufsize, BPF_MINBUFSIZE, INT_MAX); + &bpf_maxbufsize, BPF_MINBUFSIZE, MALLOC_MAX); default: return (EOPNOTSUPP); } diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 61525bded..411f1333f 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -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 $ */ /* @@ -635,6 +635,13 @@ in_pcbsolock_ref(struct inpcb *inp) if (so == NULL) return NULL; 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; } @@ -643,7 +650,6 @@ in_pcbsounlock_rele(struct inpcb *inp, struct socket *so) { if (so == NULL) return; - KASSERT(inp->inp_socket == NULL || inp->inp_socket == so); rw_exit_write(&so->so_lock); sorele(so); } diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 6b8b6fc52..df40c2538 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -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 $ */ /* @@ -369,6 +369,7 @@ struct kmembuckets { #define MINALLOCSIZE (1 << MINBUCKET) #define MAXALLOCSAVE (2 * PAGE_SIZE) +#define MALLOC_MAX (65535 * PAGE_SIZE) /* * Turn virtual addresses into kmem map indices diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 7506bc2a7..194258366 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -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 $ */ /*- @@ -601,7 +601,8 @@ refreshcreds(struct proc *p) int single_thread_set(struct proc *, int); int single_thread_wait(struct process *, int); void single_thread_clear(struct proc *); -int single_thread_check(struct proc *, int); + +int proc_suspend_check(struct proc *, int); void child_return(void *); diff --git a/usr.bin/awk/FIXES b/usr.bin/awk/FIXES index ad8bce264..b3bf38f0a 100644 --- a/usr.bin/awk/FIXES +++ b/usr.bin/awk/FIXES @@ -25,6 +25,20 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the 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 Fixed readcsvrec resize segfault when reading csv records longer than 8k. Thanks to Ozan Yigit. diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c index 8b5ef83b2..dddd9e971 100644 --- a/usr.bin/awk/b.c +++ b/usr.bin/awk/b.c @@ -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 All Rights Reserved @@ -619,7 +619,7 @@ static void resize_gototab(fa *f, int state) if (p == NULL) 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 memset(p + orig_size, 0, orig_size * sizeof(gtte)); // clean it out diff --git a/usr.bin/awk/lex.c b/usr.bin/awk/lex.c index 2a9dba2b3..37870cb1d 100644 --- a/usr.bin/awk/lex.c +++ b/usr.bin/awk/lex.c @@ -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 All Rights Reserved @@ -226,11 +226,6 @@ int yylex(void) while ((c = input()) != '\n' && c != 0) ; unput(c); - /* - * Next line is a hack, it compensates for - * unput's treatment of \n. - */ - lineno++; break; case ';': RET(';'); @@ -651,8 +646,6 @@ int input(void) /* get next lexical input character */ void unput(int c) /* put lexical character back on input */ { - if (c == '\n') - lineno--; if (yysptr >= yysbuf + sizeof(yysbuf)) FATAL("pushed back too much: %.20s...", yysbuf); *yysptr++ = c; diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c index 88201c529..d475f7942 100644 --- a/usr.bin/awk/lib.c +++ b/usr.bin/awk/lib.c @@ -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 All Rights Reserved @@ -887,7 +887,7 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok, s++; /* 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; /* allow +nan, -nan, +inf, -inf, any other letter, no */ diff --git a/usr.bin/awk/main.c b/usr.bin/awk/main.c index 584ece4d8..32c3d3ed5 100644 --- a/usr.bin/awk/main.c +++ b/usr.bin/awk/main.c @@ -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 All Rights Reserved @@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20240728"; +const char *version = "version 20250116"; #define DEBUG #include diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index 6f195ede3..75e2aef88 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -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 All Rights Reserved @@ -36,6 +36,7 @@ THIS SOFTWARE. #include #include #include +#include #include #include "awk.h" #include "awkgram.tab.h" @@ -956,16 +957,12 @@ Cell *indirect(Node **a, int n) /* $( a[0] ) */ Awkfloat val; Cell *x; int m; - char *s; x = execute(a[0]); val = getfval(x); /* freebsd: defend against super large field numbers */ if ((Awkfloat)INT_MAX < val) FATAL("trying to access out of range field %s", x->nval); 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); x = fieldadr(m); x->ctype = OCELL; /* BUG? why are these needed? */ @@ -2370,9 +2367,11 @@ FILE *openfile(int a, const char *us, bool *pnewflag) size_t i; int m; FILE *fp = NULL; + struct stat sbuf; if (*s == '\0') FATAL("null file name in print or getline"); + for (i = 0; i < nfiles; i++) if (files[i].fname && strcmp(s, files[i].fname) == 0 && (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! */ return NULL; - for (i = 0; i < nfiles; i++) if (files[i].fp == NULL) break; @@ -2397,7 +2395,14 @@ FILE *openfile(int a, const char *us, bool *pnewflag) nfiles = nnf; files = nf; } + 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; if (a == GT) { fp = fopen(s, "w"); diff --git a/usr.sbin/bgpd/version.h b/usr.sbin/bgpd/version.h index 22a3876a4..76892cf99 100644 --- a/usr.sbin/bgpd/version.h +++ b/usr.sbin/bgpd/version.h @@ -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"