From eb9d62194856caf90e9e804cfccc83a95998d03e Mon Sep 17 00:00:00 2001 From: purplerain Date: Mon, 19 Aug 2024 17:15:41 +0000 Subject: [PATCH] sync with OpenBSD -current --- bin/ed/test/Makefile | 26 --- games/adventure/glorkz | 6 +- games/hack/OWNER | 2 - games/hack/rumors | 2 +- games/phantasia/monsters.asc | 2 +- games/quiz/datfiles/latin | 2 +- games/quiz/datfiles/murders | 2 +- games/quiz/datfiles/poetry | 2 +- games/quiz/datfiles/trek | 2 +- games/quiz/datfiles/ucc | 2 +- gnu/usr.bin/Makefile.inc | 2 +- lib/libc/include/thread_private.h | 11 +- lib/libc/locale/___runetype_mb.c | 4 +- lib/libc/locale/_wctrans.c | 5 +- lib/libc/locale/rune.c | 5 +- lib/libc/locale/rune.h | 4 +- lib/libc/locale/rune_local.h | 5 +- lib/libc/locale/runetable.c | 1 - lib/libc/locale/setlocale.c | 3 +- lib/libc/locale/wctype.c | 3 +- lib/libc/thread/rthread_cb.h | 10 +- lib/libc/time/localtime.c | 3 +- lib/libcrypto/conf/conf_def.c | 149 ++++++++---------- lib/libcrypto/man/X509_REQ_add_extensions.3 | 32 +--- regress/bin/ed/Makefile | 4 +- {bin/ed/test => regress/bin/ed}/README | 2 +- {bin/ed/test => regress/bin/ed}/TODO | 2 +- {bin/ed/test => regress/bin/ed}/a.d | 0 {bin/ed/test => regress/bin/ed}/a.r | 0 {bin/ed/test => regress/bin/ed}/a.t | 0 {bin/ed/test => regress/bin/ed}/a1.err | 0 {bin/ed/test => regress/bin/ed}/a2.err | 0 {bin/ed/test => regress/bin/ed}/addr.d | 0 {bin/ed/test => regress/bin/ed}/addr.r | 0 {bin/ed/test => regress/bin/ed}/addr.t | 0 {bin/ed/test => regress/bin/ed}/addr1.err | 0 {bin/ed/test => regress/bin/ed}/addr2.err | 0 {bin/ed/test => regress/bin/ed}/ascii.d | Bin {bin/ed/test => regress/bin/ed}/ascii.r | Bin {bin/ed/test => regress/bin/ed}/ascii.t | 0 {bin/ed/test => regress/bin/ed}/bang1.d | 0 {bin/ed/test => regress/bin/ed}/bang1.err | 0 {bin/ed/test => regress/bin/ed}/bang1.r | 0 {bin/ed/test => regress/bin/ed}/bang1.t | 0 {bin/ed/test => regress/bin/ed}/bang2.err | 0 {bin/ed/test => regress/bin/ed}/c.d | 0 {bin/ed/test => regress/bin/ed}/c.r | 0 {bin/ed/test => regress/bin/ed}/c.t | 0 {bin/ed/test => regress/bin/ed}/c1.err | 0 {bin/ed/test => regress/bin/ed}/c2.err | 0 {bin/ed/test => regress/bin/ed}/ckscripts.sh | 2 +- {bin/ed/test => regress/bin/ed}/d.d | 0 {bin/ed/test => regress/bin/ed}/d.err | 0 {bin/ed/test => regress/bin/ed}/d.r | 0 {bin/ed/test => regress/bin/ed}/d.t | 0 {bin/ed/test => regress/bin/ed}/d0.d | 0 {bin/ed/test => regress/bin/ed}/d0.r | 0 {bin/ed/test => regress/bin/ed}/d0.t | 0 {bin/ed/test => regress/bin/ed}/d1.d | 0 {bin/ed/test => regress/bin/ed}/d1.r | 0 {bin/ed/test => regress/bin/ed}/d1.t | 0 {bin/ed/test => regress/bin/ed}/d2.d | 0 {bin/ed/test => regress/bin/ed}/d2.r | 0 {bin/ed/test => regress/bin/ed}/d2.t | 0 {bin/ed/test => regress/bin/ed}/d3.d | 0 {bin/ed/test => regress/bin/ed}/d3.r | 0 {bin/ed/test => regress/bin/ed}/d3.t | 0 {bin/ed/test => regress/bin/ed}/d4.d | 0 {bin/ed/test => regress/bin/ed}/d4.r | 0 {bin/ed/test => regress/bin/ed}/d4.t | 0 {bin/ed/test => regress/bin/ed}/d5.d | 0 {bin/ed/test => regress/bin/ed}/d5.r | 0 {bin/ed/test => regress/bin/ed}/d5.t | 0 {bin/ed/test => regress/bin/ed}/e1.d | 0 {bin/ed/test => regress/bin/ed}/e1.err | 0 {bin/ed/test => regress/bin/ed}/e1.r | 0 {bin/ed/test => regress/bin/ed}/e1.t | 0 {bin/ed/test => regress/bin/ed}/e2.d | 0 {bin/ed/test => regress/bin/ed}/e2.err | 0 {bin/ed/test => regress/bin/ed}/e2.r | 0 {bin/ed/test => regress/bin/ed}/e2.t | 0 {bin/ed/test => regress/bin/ed}/e3.d | 0 {bin/ed/test => regress/bin/ed}/e3.err | 0 {bin/ed/test => regress/bin/ed}/e3.r | 0 {bin/ed/test => regress/bin/ed}/e3.t | 0 {bin/ed/test => regress/bin/ed}/e4.d | 0 {bin/ed/test => regress/bin/ed}/e4.r | 0 {bin/ed/test => regress/bin/ed}/e4.t | 0 {bin/ed/test => regress/bin/ed}/eq.err | 0 {bin/ed/test => regress/bin/ed}/f1.err | 0 {bin/ed/test => regress/bin/ed}/f2.err | 0 {bin/ed/test => regress/bin/ed}/g1.d | 0 {bin/ed/test => regress/bin/ed}/g1.err | 0 {bin/ed/test => regress/bin/ed}/g1.r | 0 {bin/ed/test => regress/bin/ed}/g1.t | 0 {bin/ed/test => regress/bin/ed}/g2.d | 0 {bin/ed/test => regress/bin/ed}/g2.err | 0 {bin/ed/test => regress/bin/ed}/g2.r | 0 {bin/ed/test => regress/bin/ed}/g2.t | 0 {bin/ed/test => regress/bin/ed}/g3.d | 0 {bin/ed/test => regress/bin/ed}/g3.err | 0 {bin/ed/test => regress/bin/ed}/g3.r | 0 {bin/ed/test => regress/bin/ed}/g3.t | 0 {bin/ed/test => regress/bin/ed}/g4.d | 0 {bin/ed/test => regress/bin/ed}/g4.r | 0 {bin/ed/test => regress/bin/ed}/g4.t | 0 {bin/ed/test => regress/bin/ed}/g5.d | 0 {bin/ed/test => regress/bin/ed}/g5.r | 0 {bin/ed/test => regress/bin/ed}/g5.t | 0 {bin/ed/test => regress/bin/ed}/h.err | 0 {bin/ed/test => regress/bin/ed}/i.d | 0 {bin/ed/test => regress/bin/ed}/i.r | 0 {bin/ed/test => regress/bin/ed}/i.t | 0 {bin/ed/test => regress/bin/ed}/i0.d | 0 {bin/ed/test => regress/bin/ed}/i0.r | 0 {bin/ed/test => regress/bin/ed}/i0.t | 0 {bin/ed/test => regress/bin/ed}/i1.err | 0 {bin/ed/test => regress/bin/ed}/i2.err | 0 {bin/ed/test => regress/bin/ed}/j.d | 0 {bin/ed/test => regress/bin/ed}/j.r | 0 {bin/ed/test => regress/bin/ed}/j.t | 0 {bin/ed/test => regress/bin/ed}/k.d | 0 {bin/ed/test => regress/bin/ed}/k.r | 0 {bin/ed/test => regress/bin/ed}/k.t | 0 {bin/ed/test => regress/bin/ed}/k1.err | 0 {bin/ed/test => regress/bin/ed}/k2.err | 0 {bin/ed/test => regress/bin/ed}/k3.err | 0 {bin/ed/test => regress/bin/ed}/k4.err | 0 {bin/ed/test => regress/bin/ed}/l.d | 0 {bin/ed/test => regress/bin/ed}/l.r | 0 {bin/ed/test => regress/bin/ed}/l.t | 0 {bin/ed/test => regress/bin/ed}/m.d | 0 {bin/ed/test => regress/bin/ed}/m.err | 0 {bin/ed/test => regress/bin/ed}/m.r | 0 {bin/ed/test => regress/bin/ed}/m.t | 0 regress/bin/ed/mkscripts.sh | 76 +++++++++ {bin/ed/test => regress/bin/ed}/n.d | 0 {bin/ed/test => regress/bin/ed}/n.r | 0 {bin/ed/test => regress/bin/ed}/n.t | 0 {bin/ed/test => regress/bin/ed}/nl1.d | 0 {bin/ed/test => regress/bin/ed}/nl1.r | 0 {bin/ed/test => regress/bin/ed}/nl1.t | 0 {bin/ed/test => regress/bin/ed}/nl2.d | 0 {bin/ed/test => regress/bin/ed}/nl2.r | 0 {bin/ed/test => regress/bin/ed}/nl2.t | 0 {bin/ed/test => regress/bin/ed}/p.d | 0 {bin/ed/test => regress/bin/ed}/p.r | 0 {bin/ed/test => regress/bin/ed}/p.t | 0 {bin/ed/test => regress/bin/ed}/q.d | 0 {bin/ed/test => regress/bin/ed}/q.r | 0 {bin/ed/test => regress/bin/ed}/q.t | 0 {bin/ed/test => regress/bin/ed}/q1.err | 0 {bin/ed/test => regress/bin/ed}/r1.d | 0 {bin/ed/test => regress/bin/ed}/r1.err | 0 {bin/ed/test => regress/bin/ed}/r1.r | 0 {bin/ed/test => regress/bin/ed}/r1.t | 0 {bin/ed/test => regress/bin/ed}/r2.d | 0 {bin/ed/test => regress/bin/ed}/r2.err | 0 {bin/ed/test => regress/bin/ed}/r2.r | 0 {bin/ed/test => regress/bin/ed}/r2.t | 0 {bin/ed/test => regress/bin/ed}/r3.d | 0 {bin/ed/test => regress/bin/ed}/r3.r | 0 {bin/ed/test => regress/bin/ed}/r3.t | 0 {bin/ed/test => regress/bin/ed}/s1.d | 0 {bin/ed/test => regress/bin/ed}/s1.err | 0 {bin/ed/test => regress/bin/ed}/s1.r | 0 {bin/ed/test => regress/bin/ed}/s1.t | 0 {bin/ed/test => regress/bin/ed}/s10.err | 0 {bin/ed/test => regress/bin/ed}/s2.d | 0 {bin/ed/test => regress/bin/ed}/s2.r | 0 {bin/ed/test => regress/bin/ed}/s2.t | 0 {bin/ed/test => regress/bin/ed}/s3.d | 0 {bin/ed/test => regress/bin/ed}/s3.err | 0 {bin/ed/test => regress/bin/ed}/s3.r | 0 {bin/ed/test => regress/bin/ed}/s3.t | 0 {bin/ed/test => regress/bin/ed}/s4.d | 0 {bin/ed/test => regress/bin/ed}/s4.err | 0 {bin/ed/test => regress/bin/ed}/s4.r | 0 {bin/ed/test => regress/bin/ed}/s4.t | 0 {bin/ed/test => regress/bin/ed}/s5.err | 0 {bin/ed/test => regress/bin/ed}/s6.err | 0 {bin/ed/test => regress/bin/ed}/s7.err | 0 {bin/ed/test => regress/bin/ed}/s8.err | 0 {bin/ed/test => regress/bin/ed}/s9.err | 0 {bin/ed/test => regress/bin/ed}/t.d | 0 {bin/ed/test => regress/bin/ed}/t.r | 0 {bin/ed/test => regress/bin/ed}/t.t | 0 {bin/ed/test => regress/bin/ed}/t1.d | 0 {bin/ed/test => regress/bin/ed}/t1.err | 0 {bin/ed/test => regress/bin/ed}/t1.r | 0 {bin/ed/test => regress/bin/ed}/t1.t | 0 {bin/ed/test => regress/bin/ed}/t2.d | 0 {bin/ed/test => regress/bin/ed}/t2.err | 0 {bin/ed/test => regress/bin/ed}/t2.r | 0 {bin/ed/test => regress/bin/ed}/t2.t | 0 {bin/ed/test => regress/bin/ed}/u.d | 0 {bin/ed/test => regress/bin/ed}/u.err | 0 {bin/ed/test => regress/bin/ed}/u.r | 0 {bin/ed/test => regress/bin/ed}/u.t | 0 {bin/ed/test => regress/bin/ed}/v.d | 0 {bin/ed/test => regress/bin/ed}/v.r | 0 {bin/ed/test => regress/bin/ed}/v.t | 0 {bin/ed/test => regress/bin/ed}/w.d | 0 {bin/ed/test => regress/bin/ed}/w.r | 0 {bin/ed/test => regress/bin/ed}/w.t | 0 {bin/ed/test => regress/bin/ed}/w1.err | 0 {bin/ed/test => regress/bin/ed}/w2.err | 0 {bin/ed/test => regress/bin/ed}/w3.err | 0 {bin/ed/test => regress/bin/ed}/x.err | 0 {bin/ed/test => regress/bin/ed}/z.err | 0 regress/lib/libssl/interop/Makefile | 6 +- regress/lib/libssl/interop/botan/Makefile | 8 +- regress/lib/libssl/interop/cert/Makefile | 8 +- regress/lib/libssl/interop/cipher/Makefile | 17 +- regress/lib/libssl/interop/netcat/Makefile | 8 +- regress/lib/libssl/interop/openssl30/Makefile | 43 ----- regress/lib/libssl/interop/openssl32/Makefile | 43 +++++ regress/lib/libssl/interop/session/Makefile | 8 +- regress/lib/libssl/interop/version/Makefile | 8 +- sbin/mount_nfs/mount_nfs.c | 19 +-- sbin/pfctl/pfctl_table.c | 4 +- share/dict/web2a | 2 +- sys/arch/amd64/amd64/bus_dma.c | 23 ++- sys/arch/arm/cortex/cortex.c | 5 +- sys/arch/arm/mainbus/mainbus.c | 5 +- sys/arch/arm64/dev/mainbus.c | 5 +- sys/arch/i386/i386/bios.c | 5 +- sys/arch/i386/i386/mainbus.c | 5 +- sys/dev/acpi/acpi.c | 21 +-- sys/dev/acpi/pchgpio.c | 63 +++++++- sys/dev/dt/dt_dev.c | 89 +++++------ sys/dev/i2c/iatp.c | 16 +- sys/dev/i2c/ietp.c | 13 +- sys/dev/i2c/ihidev.c | 33 ++-- sys/dev/ic/qwx.c | 20 ++- sys/dev/ic/qwz.c | 5 +- sys/dev/isa/if_eg.c | 6 +- sys/dev/isa/if_le_isapnp.c | 4 +- sys/dev/pci/auixp.c | 3 +- sys/dev/pci/azalia.c | 17 +- sys/dev/pci/cs4280.c | 3 +- sys/dev/pci/cs4281.c | 3 +- sys/dev/pci/drm/apple/apldcp.c | 11 +- sys/dev/pci/drm/i915/gem/i915_gem_mman.c | 3 +- sys/dev/pci/esa.c | 10 +- sys/dev/pci/eso.c | 3 +- sys/dev/pci/glxpcib.c | 6 +- sys/dev/pci/if_bnx.c | 4 +- sys/dev/pci/maestro.c | 10 +- sys/dev/pci/yds.c | 4 +- sys/dev/pckbc/pms.c | 10 +- sys/dev/pv/pvbus.c | 28 +--- sys/dev/sdmmc/sdmmc.c | 4 +- sys/dev/softraid.c | 19 ++- sys/dev/usb/usb.c | 11 +- sys/kern/subr_hibernate.c | 6 +- sys/netinet6/mld6.c | 4 +- sys/uvm/uvm_pmemrange.c | 13 +- usr.bin/cal/cal.c | 2 +- usr.bin/gprof/gprof.flat | 10 +- usr.bin/m4/NOTES | 18 +-- usr.bin/openssl/apps.c | 4 +- usr.bin/tmux/input.c | 36 +++-- usr.bin/tmux/tty-keys.c | 4 +- usr.bin/w/w.c | 55 +++++-- usr.bin/ypwhich/ypwhich.c | 22 +-- usr.sbin/cron/entry.c | 9 +- usr.sbin/fw_update/patterns.c | 3 +- usr.sbin/pppd/chat/Makefile | 2 +- usr.sbin/rpki-client/version.h | 4 +- 270 files changed, 666 insertions(+), 538 deletions(-) delete mode 100644 bin/ed/test/Makefile delete mode 100644 games/hack/OWNER rename {bin/ed/test => regress/bin/ed}/README (95%) rename {bin/ed/test => regress/bin/ed}/TODO (90%) rename {bin/ed/test => regress/bin/ed}/a.d (100%) rename {bin/ed/test => regress/bin/ed}/a.r (100%) rename {bin/ed/test => regress/bin/ed}/a.t (100%) rename {bin/ed/test => regress/bin/ed}/a1.err (100%) rename {bin/ed/test => regress/bin/ed}/a2.err (100%) rename {bin/ed/test => regress/bin/ed}/addr.d (100%) rename {bin/ed/test => regress/bin/ed}/addr.r (100%) rename {bin/ed/test => regress/bin/ed}/addr.t (100%) rename {bin/ed/test => regress/bin/ed}/addr1.err (100%) rename {bin/ed/test => regress/bin/ed}/addr2.err (100%) rename {bin/ed/test => regress/bin/ed}/ascii.d (100%) rename {bin/ed/test => regress/bin/ed}/ascii.r (100%) rename {bin/ed/test => regress/bin/ed}/ascii.t (100%) rename {bin/ed/test => regress/bin/ed}/bang1.d (100%) rename {bin/ed/test => regress/bin/ed}/bang1.err (100%) rename {bin/ed/test => regress/bin/ed}/bang1.r (100%) rename {bin/ed/test => regress/bin/ed}/bang1.t (100%) rename {bin/ed/test => regress/bin/ed}/bang2.err (100%) rename {bin/ed/test => regress/bin/ed}/c.d (100%) rename {bin/ed/test => regress/bin/ed}/c.r (100%) rename {bin/ed/test => regress/bin/ed}/c.t (100%) rename {bin/ed/test => regress/bin/ed}/c1.err (100%) rename {bin/ed/test => regress/bin/ed}/c2.err (100%) rename {bin/ed/test => regress/bin/ed}/ckscripts.sh (93%) rename {bin/ed/test => regress/bin/ed}/d.d (100%) rename {bin/ed/test => regress/bin/ed}/d.err (100%) rename {bin/ed/test => regress/bin/ed}/d.r (100%) rename {bin/ed/test => regress/bin/ed}/d.t (100%) rename {bin/ed/test => regress/bin/ed}/d0.d (100%) rename {bin/ed/test => regress/bin/ed}/d0.r (100%) rename {bin/ed/test => regress/bin/ed}/d0.t (100%) rename {bin/ed/test => regress/bin/ed}/d1.d (100%) rename {bin/ed/test => regress/bin/ed}/d1.r (100%) rename {bin/ed/test => regress/bin/ed}/d1.t (100%) rename {bin/ed/test => regress/bin/ed}/d2.d (100%) rename {bin/ed/test => regress/bin/ed}/d2.r (100%) rename {bin/ed/test => regress/bin/ed}/d2.t (100%) rename {bin/ed/test => regress/bin/ed}/d3.d (100%) rename {bin/ed/test => regress/bin/ed}/d3.r (100%) rename {bin/ed/test => regress/bin/ed}/d3.t (100%) rename {bin/ed/test => regress/bin/ed}/d4.d (100%) rename {bin/ed/test => regress/bin/ed}/d4.r (100%) rename {bin/ed/test => regress/bin/ed}/d4.t (100%) rename {bin/ed/test => regress/bin/ed}/d5.d (100%) rename {bin/ed/test => regress/bin/ed}/d5.r (100%) rename {bin/ed/test => regress/bin/ed}/d5.t (100%) rename {bin/ed/test => regress/bin/ed}/e1.d (100%) rename {bin/ed/test => regress/bin/ed}/e1.err (100%) rename {bin/ed/test => regress/bin/ed}/e1.r (100%) rename {bin/ed/test => regress/bin/ed}/e1.t (100%) rename {bin/ed/test => regress/bin/ed}/e2.d (100%) rename {bin/ed/test => regress/bin/ed}/e2.err (100%) rename {bin/ed/test => regress/bin/ed}/e2.r (100%) rename {bin/ed/test => regress/bin/ed}/e2.t (100%) rename {bin/ed/test => regress/bin/ed}/e3.d (100%) rename {bin/ed/test => regress/bin/ed}/e3.err (100%) rename {bin/ed/test => regress/bin/ed}/e3.r (100%) rename {bin/ed/test => regress/bin/ed}/e3.t (100%) rename {bin/ed/test => regress/bin/ed}/e4.d (100%) rename {bin/ed/test => regress/bin/ed}/e4.r (100%) rename {bin/ed/test => regress/bin/ed}/e4.t (100%) rename {bin/ed/test => regress/bin/ed}/eq.err (100%) rename {bin/ed/test => regress/bin/ed}/f1.err (100%) rename {bin/ed/test => regress/bin/ed}/f2.err (100%) rename {bin/ed/test => regress/bin/ed}/g1.d (100%) rename {bin/ed/test => regress/bin/ed}/g1.err (100%) rename {bin/ed/test => regress/bin/ed}/g1.r (100%) rename {bin/ed/test => regress/bin/ed}/g1.t (100%) rename {bin/ed/test => regress/bin/ed}/g2.d (100%) rename {bin/ed/test => regress/bin/ed}/g2.err (100%) rename {bin/ed/test => regress/bin/ed}/g2.r (100%) rename {bin/ed/test => regress/bin/ed}/g2.t (100%) rename {bin/ed/test => regress/bin/ed}/g3.d (100%) rename {bin/ed/test => regress/bin/ed}/g3.err (100%) rename {bin/ed/test => regress/bin/ed}/g3.r (100%) rename {bin/ed/test => regress/bin/ed}/g3.t (100%) rename {bin/ed/test => regress/bin/ed}/g4.d (100%) rename {bin/ed/test => regress/bin/ed}/g4.r (100%) rename {bin/ed/test => regress/bin/ed}/g4.t (100%) rename {bin/ed/test => regress/bin/ed}/g5.d (100%) rename {bin/ed/test => regress/bin/ed}/g5.r (100%) rename {bin/ed/test => regress/bin/ed}/g5.t (100%) rename {bin/ed/test => regress/bin/ed}/h.err (100%) rename {bin/ed/test => regress/bin/ed}/i.d (100%) rename {bin/ed/test => regress/bin/ed}/i.r (100%) rename {bin/ed/test => regress/bin/ed}/i.t (100%) rename {bin/ed/test => regress/bin/ed}/i0.d (100%) rename {bin/ed/test => regress/bin/ed}/i0.r (100%) rename {bin/ed/test => regress/bin/ed}/i0.t (100%) rename {bin/ed/test => regress/bin/ed}/i1.err (100%) rename {bin/ed/test => regress/bin/ed}/i2.err (100%) rename {bin/ed/test => regress/bin/ed}/j.d (100%) rename {bin/ed/test => regress/bin/ed}/j.r (100%) rename {bin/ed/test => regress/bin/ed}/j.t (100%) rename {bin/ed/test => regress/bin/ed}/k.d (100%) rename {bin/ed/test => regress/bin/ed}/k.r (100%) rename {bin/ed/test => regress/bin/ed}/k.t (100%) rename {bin/ed/test => regress/bin/ed}/k1.err (100%) rename {bin/ed/test => regress/bin/ed}/k2.err (100%) rename {bin/ed/test => regress/bin/ed}/k3.err (100%) rename {bin/ed/test => regress/bin/ed}/k4.err (100%) rename {bin/ed/test => regress/bin/ed}/l.d (100%) rename {bin/ed/test => regress/bin/ed}/l.r (100%) rename {bin/ed/test => regress/bin/ed}/l.t (100%) rename {bin/ed/test => regress/bin/ed}/m.d (100%) rename {bin/ed/test => regress/bin/ed}/m.err (100%) rename {bin/ed/test => regress/bin/ed}/m.r (100%) rename {bin/ed/test => regress/bin/ed}/m.t (100%) create mode 100644 regress/bin/ed/mkscripts.sh rename {bin/ed/test => regress/bin/ed}/n.d (100%) rename {bin/ed/test => regress/bin/ed}/n.r (100%) rename {bin/ed/test => regress/bin/ed}/n.t (100%) rename {bin/ed/test => regress/bin/ed}/nl1.d (100%) rename {bin/ed/test => regress/bin/ed}/nl1.r (100%) rename {bin/ed/test => regress/bin/ed}/nl1.t (100%) rename {bin/ed/test => regress/bin/ed}/nl2.d (100%) rename {bin/ed/test => regress/bin/ed}/nl2.r (100%) rename {bin/ed/test => regress/bin/ed}/nl2.t (100%) rename {bin/ed/test => regress/bin/ed}/p.d (100%) rename {bin/ed/test => regress/bin/ed}/p.r (100%) rename {bin/ed/test => regress/bin/ed}/p.t (100%) rename {bin/ed/test => regress/bin/ed}/q.d (100%) rename {bin/ed/test => regress/bin/ed}/q.r (100%) rename {bin/ed/test => regress/bin/ed}/q.t (100%) rename {bin/ed/test => regress/bin/ed}/q1.err (100%) rename {bin/ed/test => regress/bin/ed}/r1.d (100%) rename {bin/ed/test => regress/bin/ed}/r1.err (100%) rename {bin/ed/test => regress/bin/ed}/r1.r (100%) rename {bin/ed/test => regress/bin/ed}/r1.t (100%) rename {bin/ed/test => regress/bin/ed}/r2.d (100%) rename {bin/ed/test => regress/bin/ed}/r2.err (100%) rename {bin/ed/test => regress/bin/ed}/r2.r (100%) rename {bin/ed/test => regress/bin/ed}/r2.t (100%) rename {bin/ed/test => regress/bin/ed}/r3.d (100%) rename {bin/ed/test => regress/bin/ed}/r3.r (100%) rename {bin/ed/test => regress/bin/ed}/r3.t (100%) rename {bin/ed/test => regress/bin/ed}/s1.d (100%) rename {bin/ed/test => regress/bin/ed}/s1.err (100%) rename {bin/ed/test => regress/bin/ed}/s1.r (100%) rename {bin/ed/test => regress/bin/ed}/s1.t (100%) rename {bin/ed/test => regress/bin/ed}/s10.err (100%) rename {bin/ed/test => regress/bin/ed}/s2.d (100%) rename {bin/ed/test => regress/bin/ed}/s2.r (100%) rename {bin/ed/test => regress/bin/ed}/s2.t (100%) rename {bin/ed/test => regress/bin/ed}/s3.d (100%) rename {bin/ed/test => regress/bin/ed}/s3.err (100%) rename {bin/ed/test => regress/bin/ed}/s3.r (100%) rename {bin/ed/test => regress/bin/ed}/s3.t (100%) rename {bin/ed/test => regress/bin/ed}/s4.d (100%) rename {bin/ed/test => regress/bin/ed}/s4.err (100%) rename {bin/ed/test => regress/bin/ed}/s4.r (100%) rename {bin/ed/test => regress/bin/ed}/s4.t (100%) rename {bin/ed/test => regress/bin/ed}/s5.err (100%) rename {bin/ed/test => regress/bin/ed}/s6.err (100%) rename {bin/ed/test => regress/bin/ed}/s7.err (100%) rename {bin/ed/test => regress/bin/ed}/s8.err (100%) rename {bin/ed/test => regress/bin/ed}/s9.err (100%) rename {bin/ed/test => regress/bin/ed}/t.d (100%) rename {bin/ed/test => regress/bin/ed}/t.r (100%) rename {bin/ed/test => regress/bin/ed}/t.t (100%) rename {bin/ed/test => regress/bin/ed}/t1.d (100%) rename {bin/ed/test => regress/bin/ed}/t1.err (100%) rename {bin/ed/test => regress/bin/ed}/t1.r (100%) rename {bin/ed/test => regress/bin/ed}/t1.t (100%) rename {bin/ed/test => regress/bin/ed}/t2.d (100%) rename {bin/ed/test => regress/bin/ed}/t2.err (100%) rename {bin/ed/test => regress/bin/ed}/t2.r (100%) rename {bin/ed/test => regress/bin/ed}/t2.t (100%) rename {bin/ed/test => regress/bin/ed}/u.d (100%) rename {bin/ed/test => regress/bin/ed}/u.err (100%) rename {bin/ed/test => regress/bin/ed}/u.r (100%) rename {bin/ed/test => regress/bin/ed}/u.t (100%) rename {bin/ed/test => regress/bin/ed}/v.d (100%) rename {bin/ed/test => regress/bin/ed}/v.r (100%) rename {bin/ed/test => regress/bin/ed}/v.t (100%) rename {bin/ed/test => regress/bin/ed}/w.d (100%) rename {bin/ed/test => regress/bin/ed}/w.r (100%) rename {bin/ed/test => regress/bin/ed}/w.t (100%) rename {bin/ed/test => regress/bin/ed}/w1.err (100%) rename {bin/ed/test => regress/bin/ed}/w2.err (100%) rename {bin/ed/test => regress/bin/ed}/w3.err (100%) rename {bin/ed/test => regress/bin/ed}/x.err (100%) rename {bin/ed/test => regress/bin/ed}/z.err (100%) delete mode 100644 regress/lib/libssl/interop/openssl30/Makefile create mode 100644 regress/lib/libssl/interop/openssl32/Makefile diff --git a/bin/ed/test/Makefile b/bin/ed/test/Makefile deleted file mode 100644 index de3e737f7..000000000 --- a/bin/ed/test/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 1996/06/23 14:20:05 deraadt Exp $ -# $NetBSD: Makefile,v 1.11 1995/03/21 09:05:14 cgd Exp $ - -SHELL= /bin/sh -ED= ../obj/ed - -all: check - @: - -check: build test - @if grep -h '\*\*\*' errs.o scripts.o; then :; else \ - echo "tests completed successfully."; \ - fi - -build: mkscripts.sh - @if [ -f errs.o ]; then :; else \ - echo "building test scripts for $(ED) ..."; \ - $(SHELL) mkscripts.sh $(ED); \ - fi - -test: build ckscripts.sh - @echo testing $(ED) ... - @$(SHELL) ckscripts.sh $(ED) - -clean: - rm -f *.ed *.red *.[oz] *~ diff --git a/games/adventure/glorkz b/games/adventure/glorkz index c65c8fd38..a00d400f0 100644 --- a/games/adventure/glorkz +++ b/games/adventure/glorkz @@ -135,7 +135,7 @@ 71 combined. 72 You are in a large low room. Crawls lead north, SE, and SW. 73 Dead end crawl. -74 You are in a secret canyon which here runs e/w. It crosses over a +74 You are in a secret canyon which here runs E/W. It crosses over a 74 very tight canyon 15 feet below. If you go down you may not be able 74 to get back up. 75 You are at a wide place in a very tight N/S canyon. @@ -182,7 +182,7 @@ 99 distance. An extremely tight tunnel leads east. It looks like a very 99 tight squeeze. An eerie light can be seen at the other end. 100 You're in a small chamber lit by an eerie green light. An extremely -100 narrow tunnel exits to the west. A dark corridor leads ne. +100 narrow tunnel exits to the west. A dark corridor leads NE. 101 You're in the Dark-Room. A corridor leading south is the only exit. 102 You are in an arched hall. A coral passage once continued up and east 102 from here, but is now blocked by debris. The air smells of sea water. @@ -249,7 +249,7 @@ 119 You are in a secret canyon which exits to the north and east. 120 You are in a secret canyon which exits to the north and east. 121 You are in a secret canyon which exits to the north and east. -122 You are on the far side of the chasm. A ne path leads away from the +122 You are on the far side of the chasm. A NE path leads away from the 122 chasm on this side. 123 You're in a long east/west corridor. A faint rumbling noise can be 123 heard in the distance. diff --git a/games/hack/OWNER b/games/hack/OWNER deleted file mode 100644 index be2d1e530..000000000 --- a/games/hack/OWNER +++ /dev/null @@ -1,2 +0,0 @@ -Andries Brouwer -mcvax!aeb diff --git a/games/hack/rumors b/games/hack/rumors index 9435a5fec..39c6cc918 100644 --- a/games/hack/rumors +++ b/games/hack/rumors @@ -191,7 +191,7 @@ If you can't learn to do it well, learn to enjoy doing it badly. If you need a wand of digging, kindly ask the minotaur. If you see nurses you better start looking somewhere for a doctor. If you turn blind: don't expect your dog to be turned into a seeing-eye dog. -If you want to feal great, you must eat something real big. +If you want to feel great, you must eat something real big. If you want to float you'd better eat a floating eye. If you want to genocide nurses, genocide @'s. If you want to hit, use a dagger. diff --git a/games/phantasia/monsters.asc b/games/phantasia/monsters.asc index 3d426a9b8..f2eb533cb 100644 --- a/games/phantasia/monsters.asc +++ b/games/phantasia/monsters.asc @@ -1,6 +1,6 @@ A Water Leaper 12 14 16 24 59 0 0 62 A Leech 4 19 29 30 66 0 0 73 -An Urisk 13 30 15 46 127 1 0 3 +An Urisk 13 30 15 46 127 1 0 3 Shellycoat 28 21 18 63 226 2 0 0 A Naiad 21 62 27 58 378 2 0 11 A Nixie 22 58 28 108 604 3 0 6 diff --git a/games/quiz/datfiles/latin b/games/quiz/datfiles/latin index 0b03bd3ee..93025f68d 100644 --- a/games/quiz/datfiles/latin +++ b/games/quiz/datfiles/latin @@ -141,7 +141,7 @@ osculum:lip libo:sip|touch|kiss nata:daughter haereo:{I }[stick to|adhere] -promitto:primise +promitto:promise sublimis:high|uplifted|up high quando:since|when|because arcanum:{a }secret diff --git a/games/quiz/datfiles/murders b/games/quiz/datfiles/murders index 30cf324de..aaad53b85 100644 --- a/games/quiz/datfiles/murders +++ b/games/quiz/datfiles/murders @@ -19,7 +19,7 @@ Pompeii:Vesuvius {Yukio }Mishima:{Yukio }Mishima {Alexander }Hamilton:{Aaron }Burr Cleopatra:{the |an }asp -[Ann Boleyn|Catharine Howard]:Henry{ VIII} +[Ann Boleyn|Catherine Howard]:Henry{ VIII} vaudeville:{the }movies|film {the }movies|film:TV|television {the }VA patients:{the }nurses diff --git a/games/quiz/datfiles/poetry b/games/quiz/datfiles/poetry index f4c07d698..ca42ef6d8 100644 --- a/games/quiz/datfiles/poetry +++ b/games/quiz/datfiles/poetry @@ -66,7 +66,7 @@ The curfew tolls the knell of parting day{,}:\ The lowing herd wind slowly o'er the lea:\ Elegy{ Written in a Country Church{-| }Yard:\ {Thomas }Gray -The best laid schemes o' mice an' men gang aft a-gley{,}:\ +The best laid schemes o' mice an' men gang aft agley{,}:\ An{'|d} lea{'|v}e us nought but grief an{'|d} pain for promised joy{.}:\ To a Mouse:\ {Robert }Burns diff --git a/games/quiz/datfiles/trek b/games/quiz/datfiles/trek index 11740b8b2..eb55ba3f2 100644 --- a/games/quiz/datfiles/trek +++ b/games/quiz/datfiles/trek @@ -1,5 +1,5 @@ captain's name:{James |Jim }{T. }Kirk|{james |jim }{t. }kirk -first officers name:Spock|spock|Mr. Spock|mr. spock +first officer's name:Spock|spock|Mr. Spock|mr. spock name of ship:{the }{u.s.s. }enterprise|Enterprise name of the "good guys":{the }Federation|federation|{the }federation name of the "bad guys":{the }klingons|{the }romulans diff --git a/games/quiz/datfiles/ucc b/games/quiz/datfiles/ucc index d852b9540..01e923334 100644 --- a/games/quiz/datfiles/ucc +++ b/games/quiz/datfiles/ucc @@ -117,7 +117,7 @@ 9-305:when possession by secured party perfects security interest without filing 9-306:proceeds; secured party's rights on disposition of collateral 9-307:protection of buyers of goods -9-310:periority of certain liens arising by opration of law (mechanic's liens) +9-310:periority of certain liens arising by operation of law (mechanic's liens) 9-311:alienability of debtor's rights; judicial process 9-312:priorities among conflicting security interests in the same collateral 9-405:assignment of security interest diff --git a/gnu/usr.bin/Makefile.inc b/gnu/usr.bin/Makefile.inc index 6ec3a6b2e..ff6e780e2 100644 --- a/gnu/usr.bin/Makefile.inc +++ b/gnu/usr.bin/Makefile.inc @@ -1,3 +1,3 @@ -# $Id: Makefile.inc,v 1.1.1.1 1995/10/18 08:38:45 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.2 2024/08/18 20:14:49 deraadt Exp $ BINDIR?= /usr/bin diff --git a/lib/libc/include/thread_private.h b/lib/libc/include/thread_private.h index 237c3fbd0..1ec107116 100644 --- a/lib/libc/include/thread_private.h +++ b/lib/libc/include/thread_private.h @@ -1,11 +1,11 @@ -/* $OpenBSD: thread_private.h,v 1.36 2021/01/06 19:54:17 otto Exp $ */ +/* $OpenBSD: thread_private.h,v 1.37 2024/08/18 02:25:51 guenther Exp $ */ /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman */ #ifndef _THREAD_PRIVATE_H_ #define _THREAD_PRIVATE_H_ -#include /* for FILE and __isthreaded */ +extern int __isthreaded; #define _MALLOC_MUTEXES 32 void _malloc_init(int); @@ -77,14 +77,15 @@ PROTO_NORMAL(_malloc_init); * Returns the address of the thread's TCB. */ +struct __sFILE; struct pthread; struct thread_callbacks { int *(*tc_errnoptr)(void); /* MUST BE FIRST */ void *(*tc_tcb)(void); __dead void (*tc_canceled)(void); - void (*tc_flockfile)(FILE *); - int (*tc_ftrylockfile)(FILE *); - void (*tc_funlockfile)(FILE *); + void (*tc_flockfile)(struct __sFILE *); + int (*tc_ftrylockfile)(struct __sFILE *); + void (*tc_funlockfile)(struct __sFILE *); void (*tc_malloc_lock)(int); void (*tc_malloc_unlock)(int); void (*tc_atexit_lock)(void); diff --git a/lib/libc/locale/___runetype_mb.c b/lib/libc/locale/___runetype_mb.c index 68a257702..b422b50ac 100644 --- a/lib/libc/locale/___runetype_mb.c +++ b/lib/libc/locale/___runetype_mb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ___runetype_mb.c,v 1.3 2017/09/05 03:16:13 schwarze Exp $ */ +/* $OpenBSD: ___runetype_mb.c,v 1.4 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: ___runetype_mb.c,v 1.10 2005/02/10 19:19:57 tnozaki Exp $ */ /*- @@ -34,7 +34,7 @@ */ #include -#include "rune.h" +#include "runetype.h" #include "rune_local.h" _RuneType diff --git a/lib/libc/locale/_wctrans.c b/lib/libc/locale/_wctrans.c index 4394587bf..d0b26a3c0 100644 --- a/lib/libc/locale/_wctrans.c +++ b/lib/libc/locale/_wctrans.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _wctrans.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */ +/* $OpenBSD: _wctrans.c,v 1.3 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: _wctrans.c,v 1.6 2005/02/10 19:19:57 tnozaki Exp $ */ /*- @@ -62,8 +62,7 @@ #include #include #include -#include "rune.h" -#include "rune_local.h" +#include "runetype.h" #include "_wctrans_local.h" /* diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c index 12614a65b..474576ec8 100644 --- a/lib/libc/locale/rune.c +++ b/lib/libc/locale/rune.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rune.c,v 1.10 2022/07/27 20:00:11 guenther Exp $ */ +/* $OpenBSD: rune.c,v 1.11 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: rune.c,v 1.26 2004/05/09 11:26:33 kleink Exp $ */ /*- @@ -63,12 +63,13 @@ #include #include #include +#include #include #include #include #include #include -#include "rune.h" +#include "runetype.h" #include "rune_local.h" #define SAFE_ADD(x, y) \ diff --git a/lib/libc/locale/rune.h b/lib/libc/locale/rune.h index 18b077562..daf6d3921 100644 --- a/lib/libc/locale/rune.h +++ b/lib/libc/locale/rune.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rune.h,v 1.5 2024/02/04 12:46:01 jca Exp $ */ +/* $OpenBSD: rune.h,v 1.6 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: rune.h,v 1.9 2003/08/07 16:43:04 agc Exp $ */ /*- @@ -39,8 +39,6 @@ #define _RUNE_H_ #include -#include -#include #include "runetype.h" #define _LOCALE_NONE (locale_t)0 diff --git a/lib/libc/locale/rune_local.h b/lib/libc/locale/rune_local.h index 337e8891c..6c373b417 100644 --- a/lib/libc/locale/rune_local.h +++ b/lib/libc/locale/rune_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rune_local.h,v 1.8 2022/07/27 20:00:11 guenther Exp $ */ +/* $OpenBSD: rune_local.h,v 1.9 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: rune_local.h,v 1.7 2003/03/02 22:18:15 tshiozak Exp $ */ /*- @@ -30,6 +30,9 @@ #ifndef _RUNE_LOCAL_H_ #define _RUNE_LOCAL_H_ +#include +#include + __BEGIN_HIDDEN_DECLS /* rune.c */ diff --git a/lib/libc/locale/runetable.c b/lib/libc/locale/runetable.c index 0990fe58c..d16a11f4c 100644 --- a/lib/libc/locale/runetable.c +++ b/lib/libc/locale/runetable.c @@ -40,7 +40,6 @@ #include #include #include "rune.h" -#include "rune_local.h" #include "citrus_ctype.h" _RuneLocale _DefaultRuneLocale = { diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index da5e2fe25..e37f36c99 100644 --- a/lib/libc/locale/setlocale.c +++ b/lib/libc/locale/setlocale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setlocale.c,v 1.30 2019/07/03 03:24:04 deraadt Exp $ */ +/* $OpenBSD: setlocale.c,v 1.31 2024/08/18 02:20:29 guenther Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze * @@ -16,6 +16,7 @@ */ #include +#include #include #include diff --git a/lib/libc/locale/wctype.c b/lib/libc/locale/wctype.c index 5e2fe786a..12135236c 100644 --- a/lib/libc/locale/wctype.c +++ b/lib/libc/locale/wctype.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wctype.c,v 1.2 2024/02/04 12:46:01 jca Exp $ */ +/* $OpenBSD: wctype.c,v 1.3 2024/08/18 02:22:29 guenther Exp $ */ /* $NetBSD: iswctype.c,v 1.15 2005/02/09 21:35:46 kleink Exp $ */ /* @@ -38,7 +38,6 @@ #include #include #include -#include "rune.h" #include "runetype.h" static struct _WCTypeEntry wctype_entries[_WCTYPE_NINDEXES] = diff --git a/lib/libc/thread/rthread_cb.h b/lib/libc/thread/rthread_cb.h index d82c8b649..abf02f741 100644 --- a/lib/libc/thread/rthread_cb.h +++ b/lib/libc/thread/rthread_cb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_cb.h,v 1.3 2021/01/06 19:54:17 otto Exp $ */ +/* $OpenBSD: rthread_cb.h,v 1.4 2024/08/18 02:25:51 guenther Exp $ */ /* * Copyright (c) 2016 Philip Guenther * All Rights Reserved. @@ -16,12 +16,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +struct __sFILE; __BEGIN_HIDDEN_DECLS -void _thread_flockfile(FILE *); -int _thread_ftrylockfile(FILE *); -void _thread_funlockfile(FILE *); +void _thread_flockfile(struct __sFILE *); +int _thread_ftrylockfile(struct __sFILE *); +void _thread_funlockfile(struct __sFILE *); void _thread_malloc_lock(int); void _thread_malloc_unlock(int); void _thread_atexit_lock(void); diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index 82a3347bd..7c72c6776 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: localtime.c,v 1.66 2024/04/04 02:20:01 millert Exp $ */ +/* $OpenBSD: localtime.c,v 1.67 2024/08/18 02:20:29 guenther Exp $ */ /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson. @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index dbd2e6a2e..de1212ad3 100644 --- a/lib/libcrypto/conf/conf_def.c +++ b/lib/libcrypto/conf/conf_def.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_def.c,v 1.34 2024/04/09 13:56:30 beck Exp $ */ +/* $OpenBSD: conf_def.c,v 1.35 2024/08/18 17:50:10 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -80,57 +80,6 @@ static char *scan_quote(CONF *conf, char *p); static char *scan_dquote(CONF *conf, char *p); #define scan_esc(conf,p) (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2))) -static CONF *def_create(CONF_METHOD *meth); -static int def_init_default(CONF *conf); -static int def_init_WIN32(CONF *conf); -static int def_destroy(CONF *conf); -static int def_destroy_data(CONF *conf); -static int def_load(CONF *conf, const char *name, long *eline); -static int def_load_bio(CONF *conf, BIO *bp, long *eline); -static int def_dump(const CONF *conf, BIO *bp); -static int def_is_number(const CONF *conf, char c); -static int def_to_int(const CONF *conf, char c); - -static CONF_METHOD default_method = { - .name = "OpenSSL default", - .create = def_create, - .init = def_init_default, - .destroy = def_destroy, - .destroy_data = def_destroy_data, - .load_bio = def_load_bio, - .dump = def_dump, - .is_number = def_is_number, - .to_int = def_to_int, - .load = def_load -}; - -static CONF_METHOD WIN32_method = { - "WIN32", - def_create, - def_init_WIN32, - def_destroy, - def_destroy_data, - def_load_bio, - def_dump, - def_is_number, - def_to_int, - def_load -}; - -CONF_METHOD * -NCONF_default(void) -{ - return &default_method; -} -LCRYPTO_ALIAS(NCONF_default); - -CONF_METHOD * -NCONF_WIN32(void) -{ - return &WIN32_method; -} -LCRYPTO_ALIAS(NCONF_WIN32); - static CONF * def_create(CONF_METHOD *meth) { @@ -151,7 +100,7 @@ def_init_default(CONF *conf) if (conf == NULL) return 0; - conf->meth = &default_method; + conf->meth = NCONF_default(); conf->meth_data = CONF_type_default; conf->data = NULL; @@ -164,23 +113,13 @@ def_init_WIN32(CONF *conf) if (conf == NULL) return 0; - conf->meth = &WIN32_method; + conf->meth = NCONF_WIN32(); conf->meth_data = (void *)CONF_type_win32; conf->data = NULL; return 1; } -static int -def_destroy(CONF *conf) -{ - if (def_destroy_data(conf)) { - free(conf); - return 1; - } - return 0; -} - static int def_destroy_data(CONF *conf) { @@ -191,24 +130,13 @@ def_destroy_data(CONF *conf) } static int -def_load(CONF *conf, const char *name, long *line) +def_destroy(CONF *conf) { - int ret; - BIO *in = NULL; - - in = BIO_new_file(name, "rb"); - if (in == NULL) { - if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE) - CONFerror(CONF_R_NO_SUCH_FILE); - else - CONFerror(ERR_R_SYS_LIB); - return 0; + if (def_destroy_data(conf)) { + free(conf); + return 1; } - - ret = def_load_bio(conf, in, line); - BIO_free(in); - - return ret; + return 0; } static int @@ -416,6 +344,27 @@ err: return (0); } +static int +def_load(CONF *conf, const char *name, long *line) +{ + int ret; + BIO *in = NULL; + + in = BIO_new_file(name, "rb"); + if (in == NULL) { + if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE) + CONFerror(CONF_R_NO_SUCH_FILE); + else + CONFerror(ERR_R_SYS_LIB); + return 0; + } + + ret = def_load_bio(conf, in, line); + BIO_free(in); + + return ret; +} + static void clear_comments(CONF *conf, char *p) { @@ -698,3 +647,43 @@ def_to_int(const CONF *conf, char c) { return c - '0'; } + +static CONF_METHOD default_method = { + .name = "OpenSSL default", + .create = def_create, + .init = def_init_default, + .destroy = def_destroy, + .destroy_data = def_destroy_data, + .load_bio = def_load_bio, + .dump = def_dump, + .is_number = def_is_number, + .to_int = def_to_int, + .load = def_load +}; + +static CONF_METHOD WIN32_method = { + "WIN32", + def_create, + def_init_WIN32, + def_destroy, + def_destroy_data, + def_load_bio, + def_dump, + def_is_number, + def_to_int, + def_load +}; + +CONF_METHOD * +NCONF_default(void) +{ + return &default_method; +} +LCRYPTO_ALIAS(NCONF_default); + +CONF_METHOD * +NCONF_WIN32(void) +{ + return &WIN32_method; +} +LCRYPTO_ALIAS(NCONF_WIN32); diff --git a/lib/libcrypto/man/X509_REQ_add_extensions.3 b/lib/libcrypto/man/X509_REQ_add_extensions.3 index 8610edf8c..ff33edf47 100644 --- a/lib/libcrypto/man/X509_REQ_add_extensions.3 +++ b/lib/libcrypto/man/X509_REQ_add_extensions.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_REQ_add_extensions.3,v 1.1 2021/10/27 14:54:07 schwarze Exp $ +.\" $OpenBSD: X509_REQ_add_extensions.3,v 1.2 2024/08/18 11:04:55 tb Exp $ .\" .\" Copyright (c) 2021 Ingo Schwarze .\" @@ -14,15 +14,13 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 27 2021 $ +.Dd $Mdocdate: August 18 2024 $ .Dt X509_REQ_ADD_EXTENSIONS 3 .Os .Sh NAME .Nm X509_REQ_add_extensions , .Nm X509_REQ_add_extensions_nid , .Nm X509_REQ_get_extensions , -.Nm X509_REQ_set_extension_nids , -.Nm X509_REQ_get_extension_nids , .Nm X509_REQ_extension_nid .Nd extensions in certification requests .Sh SYNOPSIS @@ -40,10 +38,6 @@ .Fc .Ft STACK_OF(X509_EXTENSION) * .Fn X509_REQ_get_extensions "X509_REQ *req" -.Ft void -.Fn X509_REQ_set_extension_nids "int *nids" -.Ft int * -.Fn X509_REQ_get_extension_nids void .Ft int .Fn X509_REQ_extension_nid "int nid" .Sh DESCRIPTION @@ -77,21 +71,6 @@ and .Dv NID_ms_ext_req are considered appropriate. .Pp -.Fn X509_REQ_set_extension_nids -replaces the list of attribute types that -.Fn X509_REQ_get_extensions -considers appropriate for storing extensions. -The -.Fa nids -argument is interpreted as a pointer to the first element -of a variable-sized array of -.Vt int . -The last element of the array has to be -.Dv NID_undef . -The array needs to remain valid until -.Fn X509_REQ_set_extension_nids -is called again with a different argument. -.Pp .Fn X509_REQ_extension_nid checks whether .Fn X509_REQ_get_extensions @@ -118,13 +97,6 @@ does not contain contains no attribute of an appropriate type, or if decoding or memory allocation fails. .Pp -.Fn X509_REQ_get_extension_nids -returns the pointer installed with -.Fn X509_REQ_set_extension_nids -or a pointer to a static array -.Brq Dv NID_ext_req , NID_ms_ext_req , NID_undef -by default. -.Pp .Fn X509_REQ_extension_nid returns 1 if .Fa nid diff --git a/regress/bin/ed/Makefile b/regress/bin/ed/Makefile index a4654d502..b4c0230f1 100644 --- a/regress/bin/ed/Makefile +++ b/regress/bin/ed/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.3 2020/12/17 00:51:11 bluhm Exp $ +# $OpenBSD: Makefile,v 1.4 2024/08/19 01:43:23 deraadt Exp $ ED ?= /bin/ed -TESTDIR = ${.CURDIR}/../../../bin/ed/test +TESTDIR = ${.CURDIR} TS != cd ${TESTDIR} && ls *.t ERRS != cd ${TESTDIR} && ls *.err diff --git a/bin/ed/test/README b/regress/bin/ed/README similarity index 95% rename from bin/ed/test/README rename to regress/bin/ed/README index 27ad28dd9..aba7599c5 100644 --- a/bin/ed/test/README +++ b/regress/bin/ed/README @@ -1,4 +1,4 @@ -$OpenBSD: README,v 1.3 2018/01/09 00:43:10 bluhm Exp $ +$OpenBSD: README,v 1.1 2024/08/19 01:43:23 deraadt Exp $ $NetBSD: README,v 1.8 1995/03/21 09:05:18 cgd Exp $ The files in this directory with suffixes `.t', `.d', `.r' and `.err' are diff --git a/bin/ed/test/TODO b/regress/bin/ed/TODO similarity index 90% rename from bin/ed/test/TODO rename to regress/bin/ed/TODO index a119709bf..cb566f641 100644 --- a/bin/ed/test/TODO +++ b/regress/bin/ed/TODO @@ -1,4 +1,4 @@ -$OpenBSD: TODO,v 1.2 1996/06/23 14:20:06 deraadt Exp $ +$OpenBSD: TODO,v 1.1 2024/08/19 01:43:23 deraadt Exp $ $NetBSD: TODO,v 1.3 1995/03/21 09:05:20 cgd Exp $ Some missing tests: diff --git a/bin/ed/test/a.d b/regress/bin/ed/a.d similarity index 100% rename from bin/ed/test/a.d rename to regress/bin/ed/a.d diff --git a/bin/ed/test/a.r b/regress/bin/ed/a.r similarity index 100% rename from bin/ed/test/a.r rename to regress/bin/ed/a.r diff --git a/bin/ed/test/a.t b/regress/bin/ed/a.t similarity index 100% rename from bin/ed/test/a.t rename to regress/bin/ed/a.t diff --git a/bin/ed/test/a1.err b/regress/bin/ed/a1.err similarity index 100% rename from bin/ed/test/a1.err rename to regress/bin/ed/a1.err diff --git a/bin/ed/test/a2.err b/regress/bin/ed/a2.err similarity index 100% rename from bin/ed/test/a2.err rename to regress/bin/ed/a2.err diff --git a/bin/ed/test/addr.d b/regress/bin/ed/addr.d similarity index 100% rename from bin/ed/test/addr.d rename to regress/bin/ed/addr.d diff --git a/bin/ed/test/addr.r b/regress/bin/ed/addr.r similarity index 100% rename from bin/ed/test/addr.r rename to regress/bin/ed/addr.r diff --git a/bin/ed/test/addr.t b/regress/bin/ed/addr.t similarity index 100% rename from bin/ed/test/addr.t rename to regress/bin/ed/addr.t diff --git a/bin/ed/test/addr1.err b/regress/bin/ed/addr1.err similarity index 100% rename from bin/ed/test/addr1.err rename to regress/bin/ed/addr1.err diff --git a/bin/ed/test/addr2.err b/regress/bin/ed/addr2.err similarity index 100% rename from bin/ed/test/addr2.err rename to regress/bin/ed/addr2.err diff --git a/bin/ed/test/ascii.d b/regress/bin/ed/ascii.d similarity index 100% rename from bin/ed/test/ascii.d rename to regress/bin/ed/ascii.d diff --git a/bin/ed/test/ascii.r b/regress/bin/ed/ascii.r similarity index 100% rename from bin/ed/test/ascii.r rename to regress/bin/ed/ascii.r diff --git a/bin/ed/test/ascii.t b/regress/bin/ed/ascii.t similarity index 100% rename from bin/ed/test/ascii.t rename to regress/bin/ed/ascii.t diff --git a/bin/ed/test/bang1.d b/regress/bin/ed/bang1.d similarity index 100% rename from bin/ed/test/bang1.d rename to regress/bin/ed/bang1.d diff --git a/bin/ed/test/bang1.err b/regress/bin/ed/bang1.err similarity index 100% rename from bin/ed/test/bang1.err rename to regress/bin/ed/bang1.err diff --git a/bin/ed/test/bang1.r b/regress/bin/ed/bang1.r similarity index 100% rename from bin/ed/test/bang1.r rename to regress/bin/ed/bang1.r diff --git a/bin/ed/test/bang1.t b/regress/bin/ed/bang1.t similarity index 100% rename from bin/ed/test/bang1.t rename to regress/bin/ed/bang1.t diff --git a/bin/ed/test/bang2.err b/regress/bin/ed/bang2.err similarity index 100% rename from bin/ed/test/bang2.err rename to regress/bin/ed/bang2.err diff --git a/bin/ed/test/c.d b/regress/bin/ed/c.d similarity index 100% rename from bin/ed/test/c.d rename to regress/bin/ed/c.d diff --git a/bin/ed/test/c.r b/regress/bin/ed/c.r similarity index 100% rename from bin/ed/test/c.r rename to regress/bin/ed/c.r diff --git a/bin/ed/test/c.t b/regress/bin/ed/c.t similarity index 100% rename from bin/ed/test/c.t rename to regress/bin/ed/c.t diff --git a/bin/ed/test/c1.err b/regress/bin/ed/c1.err similarity index 100% rename from bin/ed/test/c1.err rename to regress/bin/ed/c1.err diff --git a/bin/ed/test/c2.err b/regress/bin/ed/c2.err similarity index 100% rename from bin/ed/test/c2.err rename to regress/bin/ed/c2.err diff --git a/bin/ed/test/ckscripts.sh b/regress/bin/ed/ckscripts.sh similarity index 93% rename from bin/ed/test/ckscripts.sh rename to regress/bin/ed/ckscripts.sh index b401a7905..a8ee9e7b7 100644 --- a/bin/ed/test/ckscripts.sh +++ b/regress/bin/ed/ckscripts.sh @@ -1,5 +1,5 @@ #!/bin/sh - -# $OpenBSD: ckscripts.sh,v 1.3 1998/07/12 03:49:08 todd Exp $ +# $OpenBSD: ckscripts.sh,v 1.1 2024/08/19 01:43:23 deraadt Exp $ # $NetBSD: ckscripts.sh,v 1.9 1995/04/23 10:07:34 cgd Exp $ # # This script runs the .ed scripts generated by mkscripts.sh diff --git a/bin/ed/test/d.d b/regress/bin/ed/d.d similarity index 100% rename from bin/ed/test/d.d rename to regress/bin/ed/d.d diff --git a/bin/ed/test/d.err b/regress/bin/ed/d.err similarity index 100% rename from bin/ed/test/d.err rename to regress/bin/ed/d.err diff --git a/bin/ed/test/d.r b/regress/bin/ed/d.r similarity index 100% rename from bin/ed/test/d.r rename to regress/bin/ed/d.r diff --git a/bin/ed/test/d.t b/regress/bin/ed/d.t similarity index 100% rename from bin/ed/test/d.t rename to regress/bin/ed/d.t diff --git a/bin/ed/test/d0.d b/regress/bin/ed/d0.d similarity index 100% rename from bin/ed/test/d0.d rename to regress/bin/ed/d0.d diff --git a/bin/ed/test/d0.r b/regress/bin/ed/d0.r similarity index 100% rename from bin/ed/test/d0.r rename to regress/bin/ed/d0.r diff --git a/bin/ed/test/d0.t b/regress/bin/ed/d0.t similarity index 100% rename from bin/ed/test/d0.t rename to regress/bin/ed/d0.t diff --git a/bin/ed/test/d1.d b/regress/bin/ed/d1.d similarity index 100% rename from bin/ed/test/d1.d rename to regress/bin/ed/d1.d diff --git a/bin/ed/test/d1.r b/regress/bin/ed/d1.r similarity index 100% rename from bin/ed/test/d1.r rename to regress/bin/ed/d1.r diff --git a/bin/ed/test/d1.t b/regress/bin/ed/d1.t similarity index 100% rename from bin/ed/test/d1.t rename to regress/bin/ed/d1.t diff --git a/bin/ed/test/d2.d b/regress/bin/ed/d2.d similarity index 100% rename from bin/ed/test/d2.d rename to regress/bin/ed/d2.d diff --git a/bin/ed/test/d2.r b/regress/bin/ed/d2.r similarity index 100% rename from bin/ed/test/d2.r rename to regress/bin/ed/d2.r diff --git a/bin/ed/test/d2.t b/regress/bin/ed/d2.t similarity index 100% rename from bin/ed/test/d2.t rename to regress/bin/ed/d2.t diff --git a/bin/ed/test/d3.d b/regress/bin/ed/d3.d similarity index 100% rename from bin/ed/test/d3.d rename to regress/bin/ed/d3.d diff --git a/bin/ed/test/d3.r b/regress/bin/ed/d3.r similarity index 100% rename from bin/ed/test/d3.r rename to regress/bin/ed/d3.r diff --git a/bin/ed/test/d3.t b/regress/bin/ed/d3.t similarity index 100% rename from bin/ed/test/d3.t rename to regress/bin/ed/d3.t diff --git a/bin/ed/test/d4.d b/regress/bin/ed/d4.d similarity index 100% rename from bin/ed/test/d4.d rename to regress/bin/ed/d4.d diff --git a/bin/ed/test/d4.r b/regress/bin/ed/d4.r similarity index 100% rename from bin/ed/test/d4.r rename to regress/bin/ed/d4.r diff --git a/bin/ed/test/d4.t b/regress/bin/ed/d4.t similarity index 100% rename from bin/ed/test/d4.t rename to regress/bin/ed/d4.t diff --git a/bin/ed/test/d5.d b/regress/bin/ed/d5.d similarity index 100% rename from bin/ed/test/d5.d rename to regress/bin/ed/d5.d diff --git a/bin/ed/test/d5.r b/regress/bin/ed/d5.r similarity index 100% rename from bin/ed/test/d5.r rename to regress/bin/ed/d5.r diff --git a/bin/ed/test/d5.t b/regress/bin/ed/d5.t similarity index 100% rename from bin/ed/test/d5.t rename to regress/bin/ed/d5.t diff --git a/bin/ed/test/e1.d b/regress/bin/ed/e1.d similarity index 100% rename from bin/ed/test/e1.d rename to regress/bin/ed/e1.d diff --git a/bin/ed/test/e1.err b/regress/bin/ed/e1.err similarity index 100% rename from bin/ed/test/e1.err rename to regress/bin/ed/e1.err diff --git a/bin/ed/test/e1.r b/regress/bin/ed/e1.r similarity index 100% rename from bin/ed/test/e1.r rename to regress/bin/ed/e1.r diff --git a/bin/ed/test/e1.t b/regress/bin/ed/e1.t similarity index 100% rename from bin/ed/test/e1.t rename to regress/bin/ed/e1.t diff --git a/bin/ed/test/e2.d b/regress/bin/ed/e2.d similarity index 100% rename from bin/ed/test/e2.d rename to regress/bin/ed/e2.d diff --git a/bin/ed/test/e2.err b/regress/bin/ed/e2.err similarity index 100% rename from bin/ed/test/e2.err rename to regress/bin/ed/e2.err diff --git a/bin/ed/test/e2.r b/regress/bin/ed/e2.r similarity index 100% rename from bin/ed/test/e2.r rename to regress/bin/ed/e2.r diff --git a/bin/ed/test/e2.t b/regress/bin/ed/e2.t similarity index 100% rename from bin/ed/test/e2.t rename to regress/bin/ed/e2.t diff --git a/bin/ed/test/e3.d b/regress/bin/ed/e3.d similarity index 100% rename from bin/ed/test/e3.d rename to regress/bin/ed/e3.d diff --git a/bin/ed/test/e3.err b/regress/bin/ed/e3.err similarity index 100% rename from bin/ed/test/e3.err rename to regress/bin/ed/e3.err diff --git a/bin/ed/test/e3.r b/regress/bin/ed/e3.r similarity index 100% rename from bin/ed/test/e3.r rename to regress/bin/ed/e3.r diff --git a/bin/ed/test/e3.t b/regress/bin/ed/e3.t similarity index 100% rename from bin/ed/test/e3.t rename to regress/bin/ed/e3.t diff --git a/bin/ed/test/e4.d b/regress/bin/ed/e4.d similarity index 100% rename from bin/ed/test/e4.d rename to regress/bin/ed/e4.d diff --git a/bin/ed/test/e4.r b/regress/bin/ed/e4.r similarity index 100% rename from bin/ed/test/e4.r rename to regress/bin/ed/e4.r diff --git a/bin/ed/test/e4.t b/regress/bin/ed/e4.t similarity index 100% rename from bin/ed/test/e4.t rename to regress/bin/ed/e4.t diff --git a/bin/ed/test/eq.err b/regress/bin/ed/eq.err similarity index 100% rename from bin/ed/test/eq.err rename to regress/bin/ed/eq.err diff --git a/bin/ed/test/f1.err b/regress/bin/ed/f1.err similarity index 100% rename from bin/ed/test/f1.err rename to regress/bin/ed/f1.err diff --git a/bin/ed/test/f2.err b/regress/bin/ed/f2.err similarity index 100% rename from bin/ed/test/f2.err rename to regress/bin/ed/f2.err diff --git a/bin/ed/test/g1.d b/regress/bin/ed/g1.d similarity index 100% rename from bin/ed/test/g1.d rename to regress/bin/ed/g1.d diff --git a/bin/ed/test/g1.err b/regress/bin/ed/g1.err similarity index 100% rename from bin/ed/test/g1.err rename to regress/bin/ed/g1.err diff --git a/bin/ed/test/g1.r b/regress/bin/ed/g1.r similarity index 100% rename from bin/ed/test/g1.r rename to regress/bin/ed/g1.r diff --git a/bin/ed/test/g1.t b/regress/bin/ed/g1.t similarity index 100% rename from bin/ed/test/g1.t rename to regress/bin/ed/g1.t diff --git a/bin/ed/test/g2.d b/regress/bin/ed/g2.d similarity index 100% rename from bin/ed/test/g2.d rename to regress/bin/ed/g2.d diff --git a/bin/ed/test/g2.err b/regress/bin/ed/g2.err similarity index 100% rename from bin/ed/test/g2.err rename to regress/bin/ed/g2.err diff --git a/bin/ed/test/g2.r b/regress/bin/ed/g2.r similarity index 100% rename from bin/ed/test/g2.r rename to regress/bin/ed/g2.r diff --git a/bin/ed/test/g2.t b/regress/bin/ed/g2.t similarity index 100% rename from bin/ed/test/g2.t rename to regress/bin/ed/g2.t diff --git a/bin/ed/test/g3.d b/regress/bin/ed/g3.d similarity index 100% rename from bin/ed/test/g3.d rename to regress/bin/ed/g3.d diff --git a/bin/ed/test/g3.err b/regress/bin/ed/g3.err similarity index 100% rename from bin/ed/test/g3.err rename to regress/bin/ed/g3.err diff --git a/bin/ed/test/g3.r b/regress/bin/ed/g3.r similarity index 100% rename from bin/ed/test/g3.r rename to regress/bin/ed/g3.r diff --git a/bin/ed/test/g3.t b/regress/bin/ed/g3.t similarity index 100% rename from bin/ed/test/g3.t rename to regress/bin/ed/g3.t diff --git a/bin/ed/test/g4.d b/regress/bin/ed/g4.d similarity index 100% rename from bin/ed/test/g4.d rename to regress/bin/ed/g4.d diff --git a/bin/ed/test/g4.r b/regress/bin/ed/g4.r similarity index 100% rename from bin/ed/test/g4.r rename to regress/bin/ed/g4.r diff --git a/bin/ed/test/g4.t b/regress/bin/ed/g4.t similarity index 100% rename from bin/ed/test/g4.t rename to regress/bin/ed/g4.t diff --git a/bin/ed/test/g5.d b/regress/bin/ed/g5.d similarity index 100% rename from bin/ed/test/g5.d rename to regress/bin/ed/g5.d diff --git a/bin/ed/test/g5.r b/regress/bin/ed/g5.r similarity index 100% rename from bin/ed/test/g5.r rename to regress/bin/ed/g5.r diff --git a/bin/ed/test/g5.t b/regress/bin/ed/g5.t similarity index 100% rename from bin/ed/test/g5.t rename to regress/bin/ed/g5.t diff --git a/bin/ed/test/h.err b/regress/bin/ed/h.err similarity index 100% rename from bin/ed/test/h.err rename to regress/bin/ed/h.err diff --git a/bin/ed/test/i.d b/regress/bin/ed/i.d similarity index 100% rename from bin/ed/test/i.d rename to regress/bin/ed/i.d diff --git a/bin/ed/test/i.r b/regress/bin/ed/i.r similarity index 100% rename from bin/ed/test/i.r rename to regress/bin/ed/i.r diff --git a/bin/ed/test/i.t b/regress/bin/ed/i.t similarity index 100% rename from bin/ed/test/i.t rename to regress/bin/ed/i.t diff --git a/bin/ed/test/i0.d b/regress/bin/ed/i0.d similarity index 100% rename from bin/ed/test/i0.d rename to regress/bin/ed/i0.d diff --git a/bin/ed/test/i0.r b/regress/bin/ed/i0.r similarity index 100% rename from bin/ed/test/i0.r rename to regress/bin/ed/i0.r diff --git a/bin/ed/test/i0.t b/regress/bin/ed/i0.t similarity index 100% rename from bin/ed/test/i0.t rename to regress/bin/ed/i0.t diff --git a/bin/ed/test/i1.err b/regress/bin/ed/i1.err similarity index 100% rename from bin/ed/test/i1.err rename to regress/bin/ed/i1.err diff --git a/bin/ed/test/i2.err b/regress/bin/ed/i2.err similarity index 100% rename from bin/ed/test/i2.err rename to regress/bin/ed/i2.err diff --git a/bin/ed/test/j.d b/regress/bin/ed/j.d similarity index 100% rename from bin/ed/test/j.d rename to regress/bin/ed/j.d diff --git a/bin/ed/test/j.r b/regress/bin/ed/j.r similarity index 100% rename from bin/ed/test/j.r rename to regress/bin/ed/j.r diff --git a/bin/ed/test/j.t b/regress/bin/ed/j.t similarity index 100% rename from bin/ed/test/j.t rename to regress/bin/ed/j.t diff --git a/bin/ed/test/k.d b/regress/bin/ed/k.d similarity index 100% rename from bin/ed/test/k.d rename to regress/bin/ed/k.d diff --git a/bin/ed/test/k.r b/regress/bin/ed/k.r similarity index 100% rename from bin/ed/test/k.r rename to regress/bin/ed/k.r diff --git a/bin/ed/test/k.t b/regress/bin/ed/k.t similarity index 100% rename from bin/ed/test/k.t rename to regress/bin/ed/k.t diff --git a/bin/ed/test/k1.err b/regress/bin/ed/k1.err similarity index 100% rename from bin/ed/test/k1.err rename to regress/bin/ed/k1.err diff --git a/bin/ed/test/k2.err b/regress/bin/ed/k2.err similarity index 100% rename from bin/ed/test/k2.err rename to regress/bin/ed/k2.err diff --git a/bin/ed/test/k3.err b/regress/bin/ed/k3.err similarity index 100% rename from bin/ed/test/k3.err rename to regress/bin/ed/k3.err diff --git a/bin/ed/test/k4.err b/regress/bin/ed/k4.err similarity index 100% rename from bin/ed/test/k4.err rename to regress/bin/ed/k4.err diff --git a/bin/ed/test/l.d b/regress/bin/ed/l.d similarity index 100% rename from bin/ed/test/l.d rename to regress/bin/ed/l.d diff --git a/bin/ed/test/l.r b/regress/bin/ed/l.r similarity index 100% rename from bin/ed/test/l.r rename to regress/bin/ed/l.r diff --git a/bin/ed/test/l.t b/regress/bin/ed/l.t similarity index 100% rename from bin/ed/test/l.t rename to regress/bin/ed/l.t diff --git a/bin/ed/test/m.d b/regress/bin/ed/m.d similarity index 100% rename from bin/ed/test/m.d rename to regress/bin/ed/m.d diff --git a/bin/ed/test/m.err b/regress/bin/ed/m.err similarity index 100% rename from bin/ed/test/m.err rename to regress/bin/ed/m.err diff --git a/bin/ed/test/m.r b/regress/bin/ed/m.r similarity index 100% rename from bin/ed/test/m.r rename to regress/bin/ed/m.r diff --git a/bin/ed/test/m.t b/regress/bin/ed/m.t similarity index 100% rename from bin/ed/test/m.t rename to regress/bin/ed/m.t diff --git a/regress/bin/ed/mkscripts.sh b/regress/bin/ed/mkscripts.sh new file mode 100644 index 000000000..25c0a0a24 --- /dev/null +++ b/regress/bin/ed/mkscripts.sh @@ -0,0 +1,76 @@ +#!/bin/sh - +# $OpenBSD: mkscripts.sh,v 1.1 2024/08/19 01:43:23 deraadt Exp $ +# $NetBSD: mkscripts.sh,v 1.10 1995/04/23 10:07:36 cgd Exp $ +# +# This script generates ed test scripts (.ed) from .t files + +PATH="/bin:/usr/bin:/usr/local/bin/:." +ED=$1 +[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; } + +for i in *.t; do +# base=${i%.*} +# base=`echo $i | sed 's/\..*//'` +# base=`expr $i : '\([^.]*\)'` +# ( +# echo "#!/bin/sh -" +# echo "$ED - <<\EOT" +# echo "r $base.d" +# cat $i +# echo "w $base.o" +# echo EOT +# ) >$base.ed +# chmod +x $base.ed +# The following is pretty ugly way of doing the above, and not appropriate +# use of ed but the point is that it can be done... + base=`$ED - \!"echo $i" <<-EOF + s/\..* + EOF` + $ED - <<-EOF + a + #!/bin/sh - + $ED - <<\EOT + H + r $base.d + w $base.o + EOT + . + -2r $i + w $base.ed + !chmod +x $base.ed + EOF +done + +for i in *.err; do +# base=${i%.*} +# base=`echo $i | sed 's/\..*//'` +# base=`expr $i : '\([^.]*\)'` +# ( +# echo "#!/bin/sh -" +# echo "$ED - <<\EOT" +# echo H +# echo "r $base.err" +# cat $i +# echo "w $base.o" +# echo EOT +# ) >$base-err.ed +# chmod +x $base-err.ed +# The following is pretty ugly way of doing the above, and not appropriate +# use of ed but the point is that it can be done... + base=`$ED - \!"echo $i" <<-EOF + s/\..* + EOF` + $ED - <<-EOF + a + #!/bin/sh - + $ED - <<\EOT + H + r $base.err + w $base.o + EOT + . + -2r $i + w ${base}.red + !chmod +x ${base}.red + EOF +done diff --git a/bin/ed/test/n.d b/regress/bin/ed/n.d similarity index 100% rename from bin/ed/test/n.d rename to regress/bin/ed/n.d diff --git a/bin/ed/test/n.r b/regress/bin/ed/n.r similarity index 100% rename from bin/ed/test/n.r rename to regress/bin/ed/n.r diff --git a/bin/ed/test/n.t b/regress/bin/ed/n.t similarity index 100% rename from bin/ed/test/n.t rename to regress/bin/ed/n.t diff --git a/bin/ed/test/nl1.d b/regress/bin/ed/nl1.d similarity index 100% rename from bin/ed/test/nl1.d rename to regress/bin/ed/nl1.d diff --git a/bin/ed/test/nl1.r b/regress/bin/ed/nl1.r similarity index 100% rename from bin/ed/test/nl1.r rename to regress/bin/ed/nl1.r diff --git a/bin/ed/test/nl1.t b/regress/bin/ed/nl1.t similarity index 100% rename from bin/ed/test/nl1.t rename to regress/bin/ed/nl1.t diff --git a/bin/ed/test/nl2.d b/regress/bin/ed/nl2.d similarity index 100% rename from bin/ed/test/nl2.d rename to regress/bin/ed/nl2.d diff --git a/bin/ed/test/nl2.r b/regress/bin/ed/nl2.r similarity index 100% rename from bin/ed/test/nl2.r rename to regress/bin/ed/nl2.r diff --git a/bin/ed/test/nl2.t b/regress/bin/ed/nl2.t similarity index 100% rename from bin/ed/test/nl2.t rename to regress/bin/ed/nl2.t diff --git a/bin/ed/test/p.d b/regress/bin/ed/p.d similarity index 100% rename from bin/ed/test/p.d rename to regress/bin/ed/p.d diff --git a/bin/ed/test/p.r b/regress/bin/ed/p.r similarity index 100% rename from bin/ed/test/p.r rename to regress/bin/ed/p.r diff --git a/bin/ed/test/p.t b/regress/bin/ed/p.t similarity index 100% rename from bin/ed/test/p.t rename to regress/bin/ed/p.t diff --git a/bin/ed/test/q.d b/regress/bin/ed/q.d similarity index 100% rename from bin/ed/test/q.d rename to regress/bin/ed/q.d diff --git a/bin/ed/test/q.r b/regress/bin/ed/q.r similarity index 100% rename from bin/ed/test/q.r rename to regress/bin/ed/q.r diff --git a/bin/ed/test/q.t b/regress/bin/ed/q.t similarity index 100% rename from bin/ed/test/q.t rename to regress/bin/ed/q.t diff --git a/bin/ed/test/q1.err b/regress/bin/ed/q1.err similarity index 100% rename from bin/ed/test/q1.err rename to regress/bin/ed/q1.err diff --git a/bin/ed/test/r1.d b/regress/bin/ed/r1.d similarity index 100% rename from bin/ed/test/r1.d rename to regress/bin/ed/r1.d diff --git a/bin/ed/test/r1.err b/regress/bin/ed/r1.err similarity index 100% rename from bin/ed/test/r1.err rename to regress/bin/ed/r1.err diff --git a/bin/ed/test/r1.r b/regress/bin/ed/r1.r similarity index 100% rename from bin/ed/test/r1.r rename to regress/bin/ed/r1.r diff --git a/bin/ed/test/r1.t b/regress/bin/ed/r1.t similarity index 100% rename from bin/ed/test/r1.t rename to regress/bin/ed/r1.t diff --git a/bin/ed/test/r2.d b/regress/bin/ed/r2.d similarity index 100% rename from bin/ed/test/r2.d rename to regress/bin/ed/r2.d diff --git a/bin/ed/test/r2.err b/regress/bin/ed/r2.err similarity index 100% rename from bin/ed/test/r2.err rename to regress/bin/ed/r2.err diff --git a/bin/ed/test/r2.r b/regress/bin/ed/r2.r similarity index 100% rename from bin/ed/test/r2.r rename to regress/bin/ed/r2.r diff --git a/bin/ed/test/r2.t b/regress/bin/ed/r2.t similarity index 100% rename from bin/ed/test/r2.t rename to regress/bin/ed/r2.t diff --git a/bin/ed/test/r3.d b/regress/bin/ed/r3.d similarity index 100% rename from bin/ed/test/r3.d rename to regress/bin/ed/r3.d diff --git a/bin/ed/test/r3.r b/regress/bin/ed/r3.r similarity index 100% rename from bin/ed/test/r3.r rename to regress/bin/ed/r3.r diff --git a/bin/ed/test/r3.t b/regress/bin/ed/r3.t similarity index 100% rename from bin/ed/test/r3.t rename to regress/bin/ed/r3.t diff --git a/bin/ed/test/s1.d b/regress/bin/ed/s1.d similarity index 100% rename from bin/ed/test/s1.d rename to regress/bin/ed/s1.d diff --git a/bin/ed/test/s1.err b/regress/bin/ed/s1.err similarity index 100% rename from bin/ed/test/s1.err rename to regress/bin/ed/s1.err diff --git a/bin/ed/test/s1.r b/regress/bin/ed/s1.r similarity index 100% rename from bin/ed/test/s1.r rename to regress/bin/ed/s1.r diff --git a/bin/ed/test/s1.t b/regress/bin/ed/s1.t similarity index 100% rename from bin/ed/test/s1.t rename to regress/bin/ed/s1.t diff --git a/bin/ed/test/s10.err b/regress/bin/ed/s10.err similarity index 100% rename from bin/ed/test/s10.err rename to regress/bin/ed/s10.err diff --git a/bin/ed/test/s2.d b/regress/bin/ed/s2.d similarity index 100% rename from bin/ed/test/s2.d rename to regress/bin/ed/s2.d diff --git a/bin/ed/test/s2.r b/regress/bin/ed/s2.r similarity index 100% rename from bin/ed/test/s2.r rename to regress/bin/ed/s2.r diff --git a/bin/ed/test/s2.t b/regress/bin/ed/s2.t similarity index 100% rename from bin/ed/test/s2.t rename to regress/bin/ed/s2.t diff --git a/bin/ed/test/s3.d b/regress/bin/ed/s3.d similarity index 100% rename from bin/ed/test/s3.d rename to regress/bin/ed/s3.d diff --git a/bin/ed/test/s3.err b/regress/bin/ed/s3.err similarity index 100% rename from bin/ed/test/s3.err rename to regress/bin/ed/s3.err diff --git a/bin/ed/test/s3.r b/regress/bin/ed/s3.r similarity index 100% rename from bin/ed/test/s3.r rename to regress/bin/ed/s3.r diff --git a/bin/ed/test/s3.t b/regress/bin/ed/s3.t similarity index 100% rename from bin/ed/test/s3.t rename to regress/bin/ed/s3.t diff --git a/bin/ed/test/s4.d b/regress/bin/ed/s4.d similarity index 100% rename from bin/ed/test/s4.d rename to regress/bin/ed/s4.d diff --git a/bin/ed/test/s4.err b/regress/bin/ed/s4.err similarity index 100% rename from bin/ed/test/s4.err rename to regress/bin/ed/s4.err diff --git a/bin/ed/test/s4.r b/regress/bin/ed/s4.r similarity index 100% rename from bin/ed/test/s4.r rename to regress/bin/ed/s4.r diff --git a/bin/ed/test/s4.t b/regress/bin/ed/s4.t similarity index 100% rename from bin/ed/test/s4.t rename to regress/bin/ed/s4.t diff --git a/bin/ed/test/s5.err b/regress/bin/ed/s5.err similarity index 100% rename from bin/ed/test/s5.err rename to regress/bin/ed/s5.err diff --git a/bin/ed/test/s6.err b/regress/bin/ed/s6.err similarity index 100% rename from bin/ed/test/s6.err rename to regress/bin/ed/s6.err diff --git a/bin/ed/test/s7.err b/regress/bin/ed/s7.err similarity index 100% rename from bin/ed/test/s7.err rename to regress/bin/ed/s7.err diff --git a/bin/ed/test/s8.err b/regress/bin/ed/s8.err similarity index 100% rename from bin/ed/test/s8.err rename to regress/bin/ed/s8.err diff --git a/bin/ed/test/s9.err b/regress/bin/ed/s9.err similarity index 100% rename from bin/ed/test/s9.err rename to regress/bin/ed/s9.err diff --git a/bin/ed/test/t.d b/regress/bin/ed/t.d similarity index 100% rename from bin/ed/test/t.d rename to regress/bin/ed/t.d diff --git a/bin/ed/test/t.r b/regress/bin/ed/t.r similarity index 100% rename from bin/ed/test/t.r rename to regress/bin/ed/t.r diff --git a/bin/ed/test/t.t b/regress/bin/ed/t.t similarity index 100% rename from bin/ed/test/t.t rename to regress/bin/ed/t.t diff --git a/bin/ed/test/t1.d b/regress/bin/ed/t1.d similarity index 100% rename from bin/ed/test/t1.d rename to regress/bin/ed/t1.d diff --git a/bin/ed/test/t1.err b/regress/bin/ed/t1.err similarity index 100% rename from bin/ed/test/t1.err rename to regress/bin/ed/t1.err diff --git a/bin/ed/test/t1.r b/regress/bin/ed/t1.r similarity index 100% rename from bin/ed/test/t1.r rename to regress/bin/ed/t1.r diff --git a/bin/ed/test/t1.t b/regress/bin/ed/t1.t similarity index 100% rename from bin/ed/test/t1.t rename to regress/bin/ed/t1.t diff --git a/bin/ed/test/t2.d b/regress/bin/ed/t2.d similarity index 100% rename from bin/ed/test/t2.d rename to regress/bin/ed/t2.d diff --git a/bin/ed/test/t2.err b/regress/bin/ed/t2.err similarity index 100% rename from bin/ed/test/t2.err rename to regress/bin/ed/t2.err diff --git a/bin/ed/test/t2.r b/regress/bin/ed/t2.r similarity index 100% rename from bin/ed/test/t2.r rename to regress/bin/ed/t2.r diff --git a/bin/ed/test/t2.t b/regress/bin/ed/t2.t similarity index 100% rename from bin/ed/test/t2.t rename to regress/bin/ed/t2.t diff --git a/bin/ed/test/u.d b/regress/bin/ed/u.d similarity index 100% rename from bin/ed/test/u.d rename to regress/bin/ed/u.d diff --git a/bin/ed/test/u.err b/regress/bin/ed/u.err similarity index 100% rename from bin/ed/test/u.err rename to regress/bin/ed/u.err diff --git a/bin/ed/test/u.r b/regress/bin/ed/u.r similarity index 100% rename from bin/ed/test/u.r rename to regress/bin/ed/u.r diff --git a/bin/ed/test/u.t b/regress/bin/ed/u.t similarity index 100% rename from bin/ed/test/u.t rename to regress/bin/ed/u.t diff --git a/bin/ed/test/v.d b/regress/bin/ed/v.d similarity index 100% rename from bin/ed/test/v.d rename to regress/bin/ed/v.d diff --git a/bin/ed/test/v.r b/regress/bin/ed/v.r similarity index 100% rename from bin/ed/test/v.r rename to regress/bin/ed/v.r diff --git a/bin/ed/test/v.t b/regress/bin/ed/v.t similarity index 100% rename from bin/ed/test/v.t rename to regress/bin/ed/v.t diff --git a/bin/ed/test/w.d b/regress/bin/ed/w.d similarity index 100% rename from bin/ed/test/w.d rename to regress/bin/ed/w.d diff --git a/bin/ed/test/w.r b/regress/bin/ed/w.r similarity index 100% rename from bin/ed/test/w.r rename to regress/bin/ed/w.r diff --git a/bin/ed/test/w.t b/regress/bin/ed/w.t similarity index 100% rename from bin/ed/test/w.t rename to regress/bin/ed/w.t diff --git a/bin/ed/test/w1.err b/regress/bin/ed/w1.err similarity index 100% rename from bin/ed/test/w1.err rename to regress/bin/ed/w1.err diff --git a/bin/ed/test/w2.err b/regress/bin/ed/w2.err similarity index 100% rename from bin/ed/test/w2.err rename to regress/bin/ed/w2.err diff --git a/bin/ed/test/w3.err b/regress/bin/ed/w3.err similarity index 100% rename from bin/ed/test/w3.err rename to regress/bin/ed/w3.err diff --git a/bin/ed/test/x.err b/regress/bin/ed/x.err similarity index 100% rename from bin/ed/test/x.err rename to regress/bin/ed/x.err diff --git a/bin/ed/test/z.err b/regress/bin/ed/z.err similarity index 100% rename from bin/ed/test/z.err rename to regress/bin/ed/z.err diff --git a/regress/lib/libssl/interop/Makefile b/regress/lib/libssl/interop/Makefile index 82bef2314..21dfce359 100644 --- a/regress/lib/libssl/interop/Makefile +++ b/regress/lib/libssl/interop/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.18 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.20 2024/08/18 10:02:10 tb Exp $ -SUBDIR = libressl openssl11 openssl30 openssl31 +SUBDIR = libressl openssl11 openssl31 openssl32 # the above binaries must have been built before we can continue SUBDIR += netcat @@ -10,7 +10,7 @@ SUBDIR += botan # What is below takes a long time. # setting REGRESS_SKIP_SLOW to "yes" in mk.conf # will skip the tests that do not test libressl -# but do things like test openssl11 to openssl30 +# but do things like test openssl11 to openssl 3 SUBDIR += version SUBDIR += cipher # This takes a really long time. diff --git a/regress/lib/libssl/interop/botan/Makefile b/regress/lib/libssl/interop/botan/Makefile index b9570b815..e20553012 100644 --- a/regress/lib/libssl/interop/botan/Makefile +++ b/regress/lib/libssl/interop/botan/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.9 2024/08/18 10:02:10 tb Exp $ .include @@ -23,12 +23,12 @@ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) LIBRARIES += openssl31 .endif +.if exists(/usr/local/bin/eopenssl32) +LIBRARIES += openssl32 +.endif PROGS = client SRCS_client = client.cpp diff --git a/regress/lib/libssl/interop/cert/Makefile b/regress/lib/libssl/interop/cert/Makefile index ae755be22..ab35d03d7 100644 --- a/regress/lib/libssl/interop/cert/Makefile +++ b/regress/lib/libssl/interop/cert/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.11 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.13 2024/08/18 10:02:10 tb Exp $ # Connect a client to a server. Both can be current libressl, or # openssl 1.1 or 3.0. Create client and server certificates @@ -10,12 +10,12 @@ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) LIBRARIES += openssl31 .endif +.if exists(/usr/local/bin/eopenssl32) +LIBRARIES += openssl32 +.endif .for cca in noca ca fakeca .for sca in noca ca fakeca diff --git a/regress/lib/libssl/interop/cipher/Makefile b/regress/lib/libssl/interop/cipher/Makefile index 3a116d5ed..bf4a1e28d 100644 --- a/regress/lib/libssl/interop/cipher/Makefile +++ b/regress/lib/libssl/interop/cipher/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2024/02/03 15:58:34 beck Exp $ +# $OpenBSD: Makefile,v 1.16 2024/08/18 10:02:10 tb Exp $ # Connect a client to a server. Both can be current libressl, or # openssl 1.1 or 3.0. Create lists of supported ciphers @@ -10,12 +10,12 @@ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) LIBRARIES += openssl31 .endif +.if exists(/usr/local/bin/eopenssl32) +LIBRARIES += openssl32 +.endif CLEANFILES = *.tmp *.ciphers ciphers.mk @@ -45,8 +45,8 @@ client-${clib}-server-${slib}.ciphers: \ # we are only interested in ciphers supported by libressl sort $@ client-libressl.ciphers >$@.tmp . if "${clib}" == "openssl11" || "${slib}" == "openssl11" || \ - "${clib}" == "openssl30" || "${slib}" == "openssl30" || \ - "${clib}" == "openssl31" || "${slib}" == "openssl31" + "${clib}" == "openssl31" || "${slib}" == "openssl31" || \ + "${clib}" == "openssl32" || "${slib}" == "openssl32" # OpenSSL's SSL_CTX_set_cipher_list doesn't accept TLSv1.3 ciphers sed -i '/^TLS_/d' $@.tmp . endif @@ -75,7 +75,8 @@ regress: ciphers.mk LEVEL_libressl = LEVEL_openssl11 = ,@SECLEVEL=0 -LEVEL_openssl30 = ,@SECLEVEL=0 +LEVEL_openssl31 = ,@SECLEVEL=0 +LEVEL_openssl32 = ,@SECLEVEL=0 .for clib in ${LIBRARIES} .for slib in ${LIBRARIES} @@ -136,7 +137,7 @@ check-cipher-${cipher}-client-${clib}-server-${slib}: \ . endif . if "${clib}" == "libressl" # libressl client may prefer chacha-poly if aes-ni is not supported -. if "${slib}" == "openssl11" || "${slib}" == "openssl30" || "${slib}" == "openssl31" +. if "${slib}" == "openssl11" || "${slib}" == "openssl31" || "${slib}" == "openssl32" egrep -q ' Cipher *: TLS_(AES_256_GCM_SHA384|CHACHA20_POLY1305_SHA256)$$' ${@:S/^check/server/}.out . else egrep -q ' Cipher *: TLS_(AES_256_GCM_SHA384|CHACHA20_POLY1305_SHA256)$$' ${@:S/^check/server/}.out diff --git a/regress/lib/libssl/interop/netcat/Makefile b/regress/lib/libssl/interop/netcat/Makefile index 568c4d255..ee6fc7e10 100644 --- a/regress/lib/libssl/interop/netcat/Makefile +++ b/regress/lib/libssl/interop/netcat/Makefile @@ -1,15 +1,15 @@ -# $OpenBSD: Makefile,v 1.7 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.9 2024/08/18 10:02:10 tb Exp $ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) LIBRARIES += openssl31 .endif +.if exists(/usr/local/bin/eopenssl32) +LIBRARIES += openssl32 +.endif # run netcat server and connect with test client diff --git a/regress/lib/libssl/interop/openssl30/Makefile b/regress/lib/libssl/interop/openssl30/Makefile deleted file mode 100644 index d667d1b17..000000000 --- a/regress/lib/libssl/interop/openssl30/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2023/01/27 08:28:36 tb Exp $ - -.if ! exists(/usr/local/bin/eopenssl30) -regress: - # install openssl-3.0 from ports for interop tests - @echo 'Run "pkg_add openssl--%3.0" to run tests against OpenSSL 3.0' - @echo SKIPPED -.else - -PROGS = client server -CPPFLAGS = -I /usr/local/include/eopenssl30 -LDFLAGS = -L /usr/local/lib/eopenssl30 -LDADD = -lssl -lcrypto -DPADD = /usr/local/lib/eopenssl30/libssl.a \ - /usr/local/lib/eopenssl30/libcrypto.a -LD_LIBRARY_PATH = /usr/local/lib/eopenssl30 -REGRESS_TARGETS = run-self-client-server -.for p in ${PROGS} -REGRESS_TARGETS += run-ldd-$p run-version-$p run-protocol-$p -.endfor - -.for p in ${PROGS} - -run-ldd-$p: ldd-$p.out - # check that $p is linked with OpenSSL 3.0 - grep -q /usr/local/lib/eopenssl30/libcrypto.so ldd-$p.out - grep -q /usr/local/lib/eopenssl30/libssl.so ldd-$p.out - # check that $p is not linked with LibreSSL - ! grep -v libc.so ldd-$p.out | grep /usr/lib/ - -run-version-$p: $p-self.out - # check that runtime version is OpenSSL 3.0 - grep 'SSLEAY_VERSION: OpenSSL 3.0' $p-self.out - -run-protocol-$p: $p-self.out - # check that OpenSSL 3.0 protocol version is TLS 1.3 - grep 'Protocol *: TLSv1.3' $p-self.out - -.endfor - -.endif # exists(/usr/local/bin/eopenssl30) - -.include diff --git a/regress/lib/libssl/interop/openssl32/Makefile b/regress/lib/libssl/interop/openssl32/Makefile new file mode 100644 index 000000000..12536d0c8 --- /dev/null +++ b/regress/lib/libssl/interop/openssl32/Makefile @@ -0,0 +1,43 @@ +# $OpenBSD: Makefile,v 1.1 2024/08/18 09:14:17 tb Exp $ + +.if ! exists(/usr/local/bin/eopenssl32) +regress: + # install openssl-3.2 ports for interop tests + @echo 'Run "pkg_add openssl--%3.2" to run tests against OpenSSL 3.2' + @echo SKIPPED +.else + +PROGS = client server +CPPFLAGS = -I /usr/local/include/eopenssl32 +LDFLAGS = -L /usr/local/lib/eopenssl32 +LDADD = -lssl -lcrypto +DPADD = /usr/local/lib/eopenssl32/libssl.a \ + /usr/local/lib/eopenssl32/libcrypto.a +LD_LIBRARY_PATH = /usr/local/lib/eopenssl32 +REGRESS_TARGETS = run-self-client-server +.for p in ${PROGS} +REGRESS_TARGETS += run-ldd-$p run-version-$p run-protocol-$p +.endfor + +.for p in ${PROGS} + +run-ldd-$p: ldd-$p.out + # check that $p is linked with OpenSSL 3.2 + grep -q /usr/local/lib/eopenssl32/libcrypto.so ldd-$p.out + grep -q /usr/local/lib/eopenssl32/libssl.so ldd-$p.out + # check that $p is not linked with LibreSSL + ! grep -v libc.so ldd-$p.out | grep /usr/lib/ + +run-version-$p: $p-self.out + # check that runtime version is OpenSSL 3.2 + grep 'SSLEAY_VERSION: OpenSSL 3.2' $p-self.out + +run-protocol-$p: $p-self.out + # check that OpenSSL 3.2 protocol version is TLS 1.3 + grep 'Protocol *: TLSv1.3' $p-self.out + +.endfor + +.endif # exists(/usr/local/bin/eopenssl32) + +.include diff --git a/regress/lib/libssl/interop/session/Makefile b/regress/lib/libssl/interop/session/Makefile index 99daa4ba4..ab6503c97 100644 --- a/regress/lib/libssl/interop/session/Makefile +++ b/regress/lib/libssl/interop/session/Makefile @@ -1,15 +1,15 @@ -# $OpenBSD: Makefile,v 1.9 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.11 2024/08/18 10:02:10 tb Exp $ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -#LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) #LIBRARIES += openssl31 .endif +.if exists(/usr/local/bin/eopenssl32) +#LIBRARIES += openssl32 +.endif run-session-client-libressl-server-libressl \ run-session-client-libressl-server-openssl11 \ diff --git a/regress/lib/libssl/interop/version/Makefile b/regress/lib/libssl/interop/version/Makefile index bb4641afa..aa5883fa2 100644 --- a/regress/lib/libssl/interop/version/Makefile +++ b/regress/lib/libssl/interop/version/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2023/10/30 17:15:21 tb Exp $ +# $OpenBSD: Makefile,v 1.9 2024/08/18 10:02:10 tb Exp $ # Connect a client to a server. Both can be current libressl, or # openssl 1.1 or openssl 3.0. Pin client or server to a fixed TLS @@ -10,9 +10,6 @@ LIBRARIES = libressl .if exists(/usr/local/bin/eopenssl11) LIBRARIES += openssl11 .endif -.if exists(/usr/local/bin/eopenssl30) -LIBRARIES += openssl30 -.endif .if exists(/usr/local/bin/eopenssl31) LIBRARIES += openssl31 .endif @@ -32,8 +29,7 @@ FAIL_${cver}_${sver} = ! .for slib in ${LIBRARIES} .if ("${cver}" != TLS1_3 && "${sver}" != TLS1_3) && \ - ((("${clib}" != openssl30 && "${slib}" != openssl30) && \ - ("${clib}" != openssl31 && "${slib}" != openssl31)) || \ + ((("${clib}" != openssl31 && "${slib}" != openssl31)) || \ (("${cver}" != any && "${sver}" != any) && \ ("${cver}" != TLS1 && "${sver}" != TLS1) && \ ("${cver}" != TLS1_1 && "${sver}" != TLS1_1))) diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 1c2ecf8fb..a1163d4cb 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_nfs.c,v 1.55 2020/01/22 06:24:08 tedu Exp $ */ +/* $OpenBSD: mount_nfs.c,v 1.56 2024/08/19 05:58:41 florian Exp $ */ /* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */ /* @@ -383,7 +383,7 @@ int getnfsargs(char *spec, struct nfs_args *nfsargsp) { CLIENT *clp; - struct hostent *hp; + struct addrinfo hints, *res; static struct sockaddr_in saddr; struct timeval pertry, try; enum clnt_stat clnt_stat; @@ -411,14 +411,15 @@ getnfsargs(char *spec, struct nfs_args *nfsargsp) /* * Handle an internet host address */ - if (inet_aton(hostp, &saddr.sin_addr) == 0) { - hp = gethostbyname(hostp); - if (hp == NULL) { - warnx("can't resolve address for host %s", hostp); - return (0); - } - memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + + if (getaddrinfo(hostp, NULL, &hints, &res) != 0) { + warnx("can't resolve address for host %s", hostp); + return (0); } + saddr.sin_addr = ((struct sockaddr_in *)res->ai_addr)->sin_addr; + freeaddrinfo(res); if (force2) { nfsvers = NFS_VER2; diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 0d8c326a8..a0a4c52a1 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_table.c,v 1.89 2024/07/14 19:51:08 sashan Exp $ */ +/* $OpenBSD: pfctl_table.c,v 1.90 2024/08/19 13:01:47 jsg Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -529,7 +529,7 @@ pfctl_define_table(char *name, int flags, int addrs, const char *anchor, bzero(&tbl_buf, sizeof(tbl_buf)); tbl = &tbl_buf; } else { - if (ab->pfrb_size != 0) { + if (ab->pfrb_size != 0) { /* * copy IP addresses which come with table from * temporal buffer to buffer attached to table. diff --git a/share/dict/web2a b/share/dict/web2a index d4696e71d..902848ccf 100644 --- a/share/dict/web2a +++ b/share/dict/web2a @@ -59704,7 +59704,7 @@ stock book stock buckle stock card stock cattle -stock cerificate +stock certificate stock change stock company stock dividend diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c index 1d58dfcc5..6ad6583bc 100644 --- a/sys/arch/amd64/amd64/bus_dma.c +++ b/sys/arch/amd64/amd64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.52 2024/08/14 18:31:33 bluhm Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.53 2024/08/18 21:04:29 bluhm Exp $ */ /* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -96,6 +96,11 @@ #include +/* #define FORCE_BOUNCE_BUFFER 1 */ +#ifndef FORCE_BOUNCE_BUFFER +#define FORCE_BOUNCE_BUFFER 0 +#endif + int _bus_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int, paddr_t *, int *, int); @@ -115,6 +120,8 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void *mapstore; int npages, error; const struct kmem_dyn_mode *kd; + /* allocate and use bounce buffers when running as SEV guest */ + int use_bounce_buffer = cpu_sev_guestmode || FORCE_BOUNCE_BUFFER; /* * Allocate and initialize the DMA map. The end of the map @@ -131,8 +138,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, mapsize = sizeof(struct bus_dmamap) + (sizeof(bus_dma_segment_t) * (nsegments - 1)); - /* allocate and use bounce buffers when running as SEV guest */ - if (cpu_sev_guestmode) { + if (use_bounce_buffer) { /* this many pages plus one in case we get split */ npages = round_page(size) / PAGE_SIZE + 1; if (npages < nsegments) @@ -150,13 +156,13 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, map->_dm_segcnt = nsegments; map->_dm_maxsegsz = maxsegsz; map->_dm_boundary = boundary; - if (cpu_sev_guestmode) { + if (use_bounce_buffer) { map->_dm_pages = (void *)&map->dm_segs[nsegments]; map->_dm_npages = npages; } map->_dm_flags = flags & ~(BUS_DMA_WAITOK|BUS_DMA_NOWAIT); - if (!cpu_sev_guestmode) { + if (!use_bounce_buffer) { *dmamp = map; return (0); } @@ -478,8 +484,9 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t addr, bus_dma_segment_t *sg; int i, off = addr; bus_size_t l; + int use_bounce_buffer = cpu_sev_guestmode || FORCE_BOUNCE_BUFFER; - if (!cpu_sev_guestmode) + if (!use_bounce_buffer) return; for (i = map->_dm_segcnt, sg = map->dm_segs; size && i--; sg++) { @@ -685,6 +692,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, int seg, page, off; pmap_t pmap; struct vm_page *pg; + int use_bounce_buffer = cpu_sev_guestmode || FORCE_BOUNCE_BUFFER; if (p != NULL) pmap = p->p_vmspace->vm_map.pmap; @@ -705,8 +713,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, panic("Non dma-reachable buffer at curaddr %#lx(raw)", curaddr); - if (cpu_sev_guestmode) { - /* use bounce buffer */ + if (use_bounce_buffer) { if (map->_dm_nused + 1 >= map->_dm_npages) return (ENOMEM); diff --git a/sys/arch/arm/cortex/cortex.c b/sys/arch/arm/cortex/cortex.c index 3a55612aa..9666b42fb 100644 --- a/sys/arch/arm/cortex/cortex.c +++ b/sys/arch/arm/cortex/cortex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cortex.c,v 1.7 2022/03/12 14:40:41 mpi Exp $ */ +/* $OpenBSD: cortex.c,v 1.8 2024/08/18 15:50:47 deraadt Exp $ */ /* $NetBSD: mainbus.c,v 1.3 2001/06/13 17:52:43 nathanw Exp $ */ /* @@ -81,8 +81,7 @@ int cortexsearch(struct device *, void *, void *); /* attach and device structures for the device */ const struct cfattach cortex_ca = { - sizeof(struct device), cortexmatch, cortexattach, NULL, - config_activate_children + sizeof(struct device), cortexmatch, cortexattach }; struct cfdriver cortex_cd = { diff --git a/sys/arch/arm/mainbus/mainbus.c b/sys/arch/arm/mainbus/mainbus.c index ba76890c8..1247d50ae 100644 --- a/sys/arch/arm/mainbus/mainbus.c +++ b/sys/arch/arm/mainbus/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.24 2022/03/12 14:40:41 mpi Exp $ */ +/* $OpenBSD: mainbus.c,v 1.25 2024/08/18 15:50:49 deraadt Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * Copyright (c) 2017 Mark Kettenis @@ -51,8 +51,7 @@ struct mainbus_softc { }; const struct cfattach mainbus_ca = { - sizeof(struct mainbus_softc), mainbus_match, mainbus_attach, NULL, - config_activate_children + sizeof(struct mainbus_softc), mainbus_match, mainbus_attach }; struct cfdriver mainbus_cd = { diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c index d3b8bcb9d..b3a7da206 100644 --- a/sys/arch/arm64/dev/mainbus.c +++ b/sys/arch/arm64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.29 2024/01/29 14:52:25 kettenis Exp $ */ +/* $OpenBSD: mainbus.c,v 1.30 2024/08/18 15:50:49 deraadt Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * Copyright (c) 2017 Mark Kettenis @@ -60,8 +60,7 @@ struct mainbus_softc { }; const struct cfattach mainbus_ca = { - sizeof(struct mainbus_softc), mainbus_match, mainbus_attach, NULL, - config_activate_children + sizeof(struct mainbus_softc), mainbus_match, mainbus_attach }; struct cfdriver mainbus_cd = { diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 347f56fa3..d876443b8 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.129 2023/03/15 08:20:52 jsg Exp $ */ +/* $OpenBSD: bios.c,v 1.130 2024/08/18 15:50:49 deraadt Exp $ */ /* * Copyright (c) 1997-2001 Michael Shalayeff @@ -81,8 +81,7 @@ int bios_print(void *, const char *); char *fixstring(char *); const struct cfattach bios_ca = { - sizeof(struct bios_softc), biosprobe, biosattach, NULL, - config_activate_children + sizeof(struct bios_softc), biosprobe, biosattach }; struct cfdriver bios_cd = { diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c index 1f4329e11..17e272e55 100644 --- a/sys/arch/i386/i386/mainbus.c +++ b/sys/arch/i386/i386/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.61 2023/01/30 10:49:05 jsg Exp $ */ +/* $OpenBSD: mainbus.c,v 1.62 2024/08/18 15:50:49 deraadt Exp $ */ /* $NetBSD: mainbus.c,v 1.21 1997/06/06 23:14:20 thorpej Exp $ */ /* @@ -84,8 +84,7 @@ int mainbus_match(struct device *, void *, void *); void mainbus_attach(struct device *, struct device *, void *); const struct cfattach mainbus_ca = { - sizeof(struct device), mainbus_match, mainbus_attach, NULL, - config_activate_children + sizeof(struct device), mainbus_match, mainbus_attach }; struct cfdriver mainbus_cd = { diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index de66b0a45..5da2524cb 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.437 2024/08/10 23:28:17 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.438 2024/08/18 02:53:08 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2502,16 +2502,19 @@ acpi_init_states(struct acpi_softc *sc) snprintf(name, sizeof(name), "_S%d_", i); sc->sc_sleeptype[i].slp_typa = -1; sc->sc_sleeptype[i].slp_typb = -1; - if (aml_evalname(sc, sc->sc_root, name, 0, NULL, &res) == 0) { - if (res.type == AML_OBJTYPE_PACKAGE) { - sc->sc_sleeptype[i].slp_typa = - aml_val2int(res.v_package[0]); - sc->sc_sleeptype[i].slp_typb = - aml_val2int(res.v_package[1]); - printf(" S%d", i); - } + if (aml_evalname(sc, sc->sc_root, name, 0, NULL, &res) != 0) + continue; + if (res.type != AML_OBJTYPE_PACKAGE) { aml_freevalue(&res); + continue; } + sc->sc_sleeptype[i].slp_typa = aml_val2int(res.v_package[0]); + sc->sc_sleeptype[i].slp_typb = aml_val2int(res.v_package[1]); + aml_freevalue(&res); + + printf(" S%d", i); + if (i == 0 && (sc->sc_fadt->flags & FADT_POWER_S0_IDLE_CAPABLE)) + printf("ix"); } } diff --git a/sys/dev/acpi/pchgpio.c b/sys/dev/acpi/pchgpio.c index 61d1fde2f..d31f1f2c4 100644 --- a/sys/dev/acpi/pchgpio.c +++ b/sys/dev/acpi/pchgpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pchgpio.c,v 1.15 2023/11/27 00:39:42 jsg Exp $ */ +/* $OpenBSD: pchgpio.c,v 1.16 2024/08/18 11:10:10 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis * Copyright (c) 2020 James Hastings @@ -117,6 +117,8 @@ const char *pchgpio_hids[] = { "INTC1055", "INTC1056", "INTC1057", + "INTC1082", + "INTC1083", "INTC1085", NULL }; @@ -386,6 +388,63 @@ const struct pchgpio_device adl_n_device = .npins = 384, }; +/* Meteor Lake-P */ + +const struct pchgpio_group mtl_p_groups[] = +{ + /* Community 0 */ + { 0, 1, 5, 28, 32 }, /* GPP_V */ + { 0, 2, 29, 52, 64 }, /* GPP_C */ + + /* Community 1 */ + { 1, 0, 53, 77, 96 }, /* GPP_A */ + { 1, 1, 78, 102, 128 }, /* GPP_E */ + + /* Community 3 */ + { 2, 0, 103, 128, 160 }, /* GPP_H */ + { 2, 1, 129, 154, 192 }, /* GPP_F */ + + /* Community 4 */ + { 3, 0, 184, 191, 288 }, /* GPP_S */ + + /* Community 5 */ + { 4, 0, 204, 228, 352 }, /* GPP_B */ + { 4, 1, 229, 253, 384 }, /* GPP_D */ +}; + +const struct pchgpio_device mtl_p_device = +{ + .pad_size = 16, + .gpi_is = 0x200, + .gpi_ie = 0x210, + .groups = mtl_p_groups, + .ngroups = nitems(mtl_p_groups), + .npins = 416, +}; + +/* Meteor Lake-S */ + +const struct pchgpio_group mtl_s_groups[] = +{ + /* Community 0 */ + { 0, 0, 0, 27, 0 }, /* GPP_A */ + { 0, 2, 47, 73, 64 }, /* GPP_C */ + + /* Community 1 */ + { 1, 0, 74, 93, 96 }, /* GPP_B */ + { 1, 2, 96, 119, 160 }, /* GPP_D */ +}; + +const struct pchgpio_device mtl_s_device = +{ + .pad_size = 16, + .gpi_is = 0x200, + .gpi_ie = 0x210, + .groups = mtl_s_groups, + .ngroups = nitems(mtl_s_groups), + .npins = 192, +}; + struct pchgpio_match pchgpio_devices[] = { { "INT344B", &spt_lp_device }, { "INT3450", &cnl_h_device }, @@ -398,6 +457,8 @@ struct pchgpio_match pchgpio_devices[] = { { "INTC1056", &adl_s_device }, { "INTC1057", &adl_n_device }, { "INTC1085", &adl_s_device }, + { "INTC1082", &mtl_s_device }, + { "INTC1083", &mtl_p_device }, }; int pchgpio_read_pin(void *, int); diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c index 2d01b4f5e..99ce128b9 100644 --- a/sys/dev/dt/dt_dev.c +++ b/sys/dev/dt/dt_dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dt_dev.c,v 1.33 2024/04/06 11:18:02 mpi Exp $ */ +/* $OpenBSD: dt_dev.c,v 1.34 2024/08/18 08:23:58 mpi Exp $ */ /* * Copyright (c) 2019 Martin Pieuchot @@ -99,8 +99,6 @@ struct dt_softc { struct mutex ds_mtx; struct dt_pcb_list ds_pcbs; /* [K] list of enabled PCBs */ - struct dt_evt *ds_bufqueue; /* [K] copy evts to userland */ - size_t ds_bufqlen; /* [K] length of the queue */ int ds_recording; /* [K] currently recording? */ int ds_evtcnt; /* [m] # of readable evts */ @@ -140,7 +138,8 @@ int dt_ioctl_probe_enable(struct dt_softc *, struct dtioc_req *); int dt_ioctl_probe_disable(struct dt_softc *, struct dtioc_req *); int dt_ioctl_get_auxbase(struct dt_softc *, struct dtioc_getaux *); -int dt_pcb_ring_copy(struct dt_pcb *, struct dt_evt *, size_t, uint64_t *); +int dt_pcb_ring_copy(struct dt_pcb *, struct uio *, size_t, size_t *, + uint64_t *); void dtattach(struct device *parent, struct device *self, void *aux) @@ -161,8 +160,6 @@ int dtopen(dev_t dev, int flags, int mode, struct proc *p) { struct dt_softc *sc; - struct dt_evt *queue; - size_t qlen; int unit = minor(dev); if (!allowdt) @@ -172,19 +169,8 @@ dtopen(dev_t dev, int flags, int mode, struct proc *p) if (sc == NULL) return ENOMEM; - /* - * Enough space to empty 2 full rings of events in a single read. - */ - qlen = 2 * DT_EVTRING_SIZE; - queue = mallocarray(qlen, sizeof(*queue), M_DEVBUF, M_WAITOK|M_CANFAIL); - if (queue == NULL) { - free(sc, M_DEVBUF, sizeof(*sc)); - return ENOMEM; - } - /* no sleep after this point */ if (dtlookup(unit) != NULL) { - free(queue, M_DEVBUF, qlen * sizeof(*queue)); free(sc, M_DEVBUF, sizeof(*sc)); return EBUSY; } @@ -193,8 +179,6 @@ dtopen(dev_t dev, int flags, int mode, struct proc *p) sc->ds_pid = p->p_p->ps_pid; TAILQ_INIT(&sc->ds_pcbs); mtx_init(&sc->ds_mtx, IPL_HIGH); - sc->ds_bufqlen = qlen; - sc->ds_bufqueue = queue; sc->ds_evtcnt = 0; sc->ds_readevt = 0; sc->ds_dropevt = 0; @@ -221,8 +205,6 @@ dtclose(dev_t dev, int flags, int mode, struct proc *p) dt_ioctl_record_stop(sc); dt_pcb_purge(&sc->ds_pcbs); - free(sc->ds_bufqueue, M_DEVBUF, - sc->ds_bufqlen * sizeof(*sc->ds_bufqueue)); free(sc, M_DEVBUF, sizeof(*sc)); return 0; @@ -232,17 +214,16 @@ int dtread(dev_t dev, struct uio *uio, int flags) { struct dt_softc *sc; - struct dt_evt *estq; struct dt_pcb *dp; int error = 0, unit = minor(dev); - size_t qlen, count, read = 0; + size_t count, max, read = 0; uint64_t dropped = 0; sc = dtlookup(unit); KASSERT(sc != NULL); - count = howmany(uio->uio_resid, sizeof(struct dt_evt)); - if (count < 1) + max = howmany(uio->uio_resid, sizeof(struct dt_evt)); + if (max < 1) return (EMSGSIZE); while (!sc->ds_evtcnt) { @@ -254,20 +235,18 @@ dtread(dev_t dev, struct uio *uio, int flags) if (error) return error; - estq = sc->ds_bufqueue; - qlen = MIN(sc->ds_bufqlen, count); - KERNEL_ASSERT_LOCKED(); TAILQ_FOREACH(dp, &sc->ds_pcbs, dp_snext) { - count = dt_pcb_ring_copy(dp, estq, qlen, &dropped); + count = 0; + error = dt_pcb_ring_copy(dp, uio, max, &count, &dropped); + if (error || count == 0) + break; + read += count; - estq += count; /* pointer arithmetic */ - qlen -= count; - if (qlen == 0) + max -= count; + if (max == 0) break; } - if (read > 0) - uiomove(sc->ds_bufqueue, read * sizeof(struct dt_evt), uio); mtx_enter(&sc->ds_mtx); sc->ds_evtcnt -= read; @@ -275,7 +254,7 @@ dtread(dev_t dev, struct uio *uio, int flags) sc->ds_dropevt += dropped; mtx_leave(&sc->ds_mtx); - return 0; + return error; } int @@ -743,21 +722,25 @@ dt_pcb_ring_consume(struct dt_pcb *dp, struct dt_evt *dtev) } /* - * Copy at most `qlen' events from `dp', producing the same amount + * Copy at most `max' events from `dp', producing the same amount * of free slots. */ int -dt_pcb_ring_copy(struct dt_pcb *dp, struct dt_evt *estq, size_t qlen, - uint64_t *dropped) +dt_pcb_ring_copy(struct dt_pcb *dp, struct uio *uio, size_t max, + size_t *rcvd, uint64_t *dropped) { size_t count, copied = 0; unsigned int cons, prod; + int error = 0; - KASSERT(qlen > 0); + KASSERT(max > 0); mtx_enter(&dp->dp_mtx); cons = dp->dp_cons; prod = dp->dp_prod; + *dropped += dp->dp_dropevt; + dp->dp_dropevt = 0; + mtx_leave(&dp->dp_mtx); if (cons < prod) count = DT_EVTRING_SIZE - prod; @@ -765,30 +748,34 @@ dt_pcb_ring_copy(struct dt_pcb *dp, struct dt_evt *estq, size_t qlen, count = cons - prod; if (count == 0) - goto out; + return 0; - *dropped += dp->dp_dropevt; - dp->dp_dropevt = 0; - - count = MIN(count, qlen); - - memcpy(&estq[0], &dp->dp_ring[prod], count * sizeof(*estq)); + count = MIN(count, max); + error = uiomove(&dp->dp_ring[prod], count * sizeof(struct dt_evt), uio); + if (error) + return error; copied += count; /* Produce */ prod = (prod + count) % DT_EVTRING_SIZE; - /* If the queue is full or the ring didn't wrap, stop here. */ - if (qlen == copied || prod != 0 || cons == 0) + /* If the ring didn't wrap, stop here. */ + if (max == copied || prod != 0 || cons == 0) + goto out; + + count = MIN(cons, (max - copied)); + error = uiomove(&dp->dp_ring[0], count * sizeof(struct dt_evt), uio); + if (error) goto out; - count = MIN(cons, (qlen - copied)); - memcpy(&estq[copied], &dp->dp_ring[0], count * sizeof(*estq)); copied += count; prod += count; out: + mtx_enter(&dp->dp_mtx); dp->dp_prod = prod; mtx_leave(&dp->dp_mtx); - return copied; + + *rcvd = copied; + return error; } diff --git a/sys/dev/i2c/iatp.c b/sys/dev/i2c/iatp.c index 7c233dede..e18f800d2 100644 --- a/sys/dev/i2c/iatp.c +++ b/sys/dev/i2c/iatp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iatp.c,v 1.9 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: iatp.c,v 1.11 2024/08/19 14:24:24 deraadt Exp $ */ /* * Atmel maXTouch i2c touchscreen/touchpad driver * Copyright (c) 2016 joshua stein @@ -295,24 +295,24 @@ int iatp_activate(struct device *self, int act) { struct iatp_softc *sc = (struct iatp_softc *)self; + int rv; switch (act) { case DVACT_QUIESCE: -#if 0 - /* XXX: causes dwiic troubles */ + rv = config_activate_children(self, act); iatp_t7_set_power_mode(sc, MXT_T7_POWER_MODE_DEEP_SLEEP); -#endif break; case DVACT_WAKEUP: sc->sc_busy = 1; iatp_init(sc); sc->sc_busy = 0; + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - - config_activate_children(self, act); - - return 0; + return rv; } int diff --git a/sys/dev/i2c/ietp.c b/sys/dev/i2c/ietp.c index 353eb9073..fac002bab 100644 --- a/sys/dev/i2c/ietp.c +++ b/sys/dev/i2c/ietp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ietp.c,v 1.2 2023/07/21 02:19:49 jcs Exp $ */ +/* $OpenBSD: ietp.c,v 1.3 2024/08/18 03:25:04 deraadt Exp $ */ /* * Elan I2C Touchpad driver * @@ -304,11 +304,13 @@ int ietp_activate(struct device *self, int act) { struct ietp_softc *sc = (struct ietp_softc *)self; + int rv; DPRINTF(("%s(%d)\n", __func__, act)); switch (act) { case DVACT_QUIESCE: + rv = config_activate_children(self, act); sc->sc_dying = 1; if (ietp_set_power(sc, I2C_HID_POWER_OFF)) printf("%s: failed to power down\n", @@ -317,12 +319,13 @@ ietp_activate(struct device *self, int act) case DVACT_WAKEUP: ietp_reset(sc); sc->sc_dying = 0; + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - - config_activate_children(self, act); - - return 0; + return rv; } void diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c index ca930a12f..b676ae700 100644 --- a/sys/dev/i2c/ihidev.c +++ b/sys/dev/i2c/ihidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ihidev.c,v 1.29 2023/08/12 10:03:05 kettenis Exp $ */ +/* $OpenBSD: ihidev.c,v 1.32 2024/08/19 09:26:58 kettenis Exp $ */ /* * HID-over-i2c driver * @@ -145,11 +145,7 @@ ihidev_attach(struct device *parent, struct device *self, void *aux) sc->sc_nrepid++; sc->sc_subdevs = mallocarray(sc->sc_nrepid, sizeof(struct ihidev *), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc->sc_subdevs == NULL) { - printf("%s: failed allocating memory\n", sc->sc_dev.dv_xname); - return; - } + M_DEVBUF, M_WAITOK | M_ZERO); /* find largest report size and allocate memory for input buffer */ sc->sc_isize = letoh16(sc->hid_desc.wMaxInputLength); @@ -163,7 +159,7 @@ ihidev_attach(struct device *parent, struct device *self, void *aux) DPRINTF(("%s: repid %d size %d\n", sc->sc_dev.dv_xname, repid, repsz)); } - sc->sc_ibuf = malloc(sc->sc_isize, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->sc_ibuf = malloc(sc->sc_isize, M_DEVBUF, M_WAITOK | M_ZERO); iha.iaa = ia; iha.parent = sc; @@ -233,11 +229,13 @@ int ihidev_activate(struct device *self, int act) { struct ihidev_softc *sc = (struct ihidev_softc *)self; + int rv; DPRINTF(("%s(%d)\n", __func__, act)); switch (act) { case DVACT_QUIESCE: + rv = config_activate_children(self, act); sc->sc_dying = 1; if (sc->sc_poll && timeout_initialized(&sc->sc_timer)) { DPRINTF(("%s: cancelling polling\n", @@ -254,12 +252,13 @@ ihidev_activate(struct device *self, int act) sc->sc_dying = 0; if (sc->sc_poll && timeout_initialized(&sc->sc_timer)) timeout_add(&sc->sc_timer, 2000); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - - config_activate_children(self, act); - - return 0; + return rv; } void @@ -371,7 +370,7 @@ ihidev_hid_command(struct ihidev_softc *sc, int hidcmd, void *arg) * rreq->data. */ report_len += report_id_len; - tmprep = malloc(report_len, M_DEVBUF, M_NOWAIT | M_ZERO); + tmprep = malloc(report_len, M_DEVBUF, M_WAITOK | M_ZERO); /* type 3 id 8: 22 00 38 02 23 00 */ res = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, @@ -462,7 +461,7 @@ ihidev_hid_command(struct ihidev_softc *sc, int hidcmd, void *arg) cmd[dataoff] = rreq->id; finalcmd = malloc(cmdlen + rreq->len, M_DEVBUF, - M_NOWAIT | M_ZERO); + M_WAITOK | M_ZERO); memcpy(finalcmd, cmd, cmdlen); memcpy(finalcmd + cmdlen, rreq->data, rreq->len); @@ -599,7 +598,7 @@ ihidev_hid_desc_parse(struct ihidev_softc *sc) } sc->sc_reportlen = letoh16(sc->hid_desc.wReportDescLength); - sc->sc_report = malloc(sc->sc_reportlen, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->sc_report = malloc(sc->sc_reportlen, M_DEVBUF, M_WAITOK | M_ZERO); if (ihidev_hid_command(sc, I2C_HID_REPORT_DESCR, 0)) { printf("%s: failed fetching HID report\n", @@ -629,9 +628,6 @@ ihidev_intr(void *arg) u_char *p; u_int rep = 0; - if (sc->sc_dying) - return 1; - if (sc->sc_poll && !sc->sc_frompoll) { DPRINTF(("%s: received interrupt while polling, disabling " "polling\n", sc->sc_dev.dv_xname)); @@ -708,7 +704,8 @@ ihidev_intr(void *arg) return (1); } - scd->sc_intr(scd, p, psize); + if (!sc->sc_dying) + scd->sc_intr(scd, p, psize); if (sc->sc_poll && (fast != sc->sc_fastpoll)) { DPRINTF(("%s: %s->%s polling\n", sc->sc_dev.dv_xname, diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index 860f215ba..369d5cace 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwx.c,v 1.64 2024/08/17 08:12:46 stsp Exp $ */ +/* $OpenBSD: qwx.c,v 1.66 2024/08/19 08:22:30 jsg Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -158,6 +158,7 @@ int qwx_wmi_vdev_install_key(struct qwx_softc *, int qwx_dp_peer_rx_pn_replay_config(struct qwx_softc *, struct qwx_vif *, struct ieee80211_node *, struct ieee80211_key *, int); void qwx_setkey_clear(struct qwx_softc *); +void qwx_vif_free_all(struct qwx_softc *); int qwx_scan(struct qwx_softc *); void qwx_scan_abort(struct qwx_softc *); @@ -172,7 +173,8 @@ qwx_node_alloc(struct ieee80211com *ic) struct qwx_node *nq; nq = malloc(sizeof(struct qwx_node), M_DEVBUF, M_NOWAIT | M_ZERO); - nq->peer.peer_id = HAL_INVALID_PEERID; + if (nq != NULL) + nq->peer.peer_id = HAL_INVALID_PEERID; return (struct ieee80211_node *)nq; } @@ -348,6 +350,8 @@ qwx_stop(struct ifnet *ifp) /* power off hardware */ qwx_core_deinit(sc); + qwx_vif_free_all(sc); + splx(s); } @@ -22815,6 +22819,18 @@ qwx_vif_free(struct qwx_softc *sc, struct qwx_vif *arvif) free(arvif, M_DEVBUF, sizeof(*arvif)); } +void +qwx_vif_free_all(struct qwx_softc *sc) +{ + struct qwx_vif *arvif; + + while (!TAILQ_EMPTY(&sc->vif_list)) { + arvif = TAILQ_FIRST(&sc->vif_list); + TAILQ_REMOVE(&sc->vif_list, arvif, entry); + qwx_vif_free(sc, arvif); + } +} + struct qwx_vif * qwx_vif_alloc(struct qwx_softc *sc) { diff --git a/sys/dev/ic/qwz.c b/sys/dev/ic/qwz.c index 063631bc0..0de2e61e5 100644 --- a/sys/dev/ic/qwz.c +++ b/sys/dev/ic/qwz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwz.c,v 1.4 2024/08/16 00:26:54 patrick Exp $ */ +/* $OpenBSD: qwz.c,v 1.5 2024/08/19 08:22:30 jsg Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -172,7 +172,8 @@ qwz_node_alloc(struct ieee80211com *ic) struct qwz_node *nq; nq = malloc(sizeof(struct qwz_node), M_DEVBUF, M_NOWAIT | M_ZERO); - nq->peer.peer_id = HAL_INVALID_PEERID; + if (nq != NULL) + nq->peer.peer_id = HAL_INVALID_PEERID; return (struct ieee80211_node *)nq; } diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c index 525108356..f69e1d426 100644 --- a/sys/dev/isa/if_eg.c +++ b/sys/dev/isa/if_eg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eg.c,v 1.52 2023/09/11 08:41:26 mvs Exp $ */ +/* $OpenBSD: if_eg.c,v 1.53 2024/08/19 03:08:27 jsg Exp $ */ /* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */ /* @@ -442,11 +442,11 @@ eginit(register struct eg_softc *sc) printf("%s: configure card command failed\n", sc->sc_dev.dv_xname); - if (sc->eg_inbuf == 0) + if (sc->eg_inbuf == NULL) sc->eg_inbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT); sc->eg_incount = 0; - if (sc->eg_outbuf == 0) + if (sc->eg_outbuf == NULL) sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT); bus_space_write_1(bst, bsh, EG_CONTROL, EG_CTL_CMDE); diff --git a/sys/dev/isa/if_le_isapnp.c b/sys/dev/isa/if_le_isapnp.c index 867efd834..48813c37c 100644 --- a/sys/dev/isa/if_le_isapnp.c +++ b/sys/dev/isa/if_le_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_isapnp.c,v 1.15 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_le_isapnp.c,v 1.16 2024/08/19 03:08:27 jsg Exp $ */ /* $NetBSD: if_le_isa.c,v 1.2 1996/05/12 23:52:56 mycroft Exp $ */ /*- @@ -102,7 +102,7 @@ le_isapnp_attach(struct device *parent, struct device *self, void *aux) sc->sc_arpcom.ac_enaddr[i] = bus_space_read_1(iot, ioh, i); sc->sc_mem = malloc(16384, M_DEVBUF, M_NOWAIT); - if (sc->sc_mem == 0) { + if (sc->sc_mem == NULL) { printf(": couldn't allocate memory for card\n"); return; } diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 629fcb64f..8ba695515 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.53 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: auixp.c,v 1.54 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -911,6 +911,7 @@ auixp_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); auixp_disable_interrupts(sc); break; case DVACT_RESUME: diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index b450b46b2..a2d0e62c9 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.288 2024/08/13 22:32:58 deraadt Exp $ */ +/* $OpenBSD: azalia.c,v 1.290 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -598,13 +598,12 @@ azalia_pci_activate(struct device *self, int act) azalia_t *sc = (azalia_t*)self; int rv = 0; + if (sc->detached) + return (0); + switch (act) { case DVACT_QUIESCE: rv = config_activate_children(self, act); - - if (sc->detached) - break; - /* stop interrupts and clear status registers */ AZ_WRITE_4(sc, INTCTL, 0); AZ_WRITE_2(sc, STATESTS, HDA_STATESTS_SDIWAKE); @@ -612,15 +611,17 @@ azalia_pci_activate(struct device *self, int act) (void) AZ_READ_4(sc, INTSTS); break; case DVACT_SUSPEND: + rv = config_activate_children(self, act); azalia_suspend(sc); break; - case DVACT_POWERDOWN: - azalia_shutdown(sc); - break; case DVACT_RESUME: azalia_resume(sc); rv = config_activate_children(self, act); break; + case DVACT_POWERDOWN: + rv = config_activate_children(self, act); + azalia_shutdown(sc); + break; default: rv = config_activate_children(self, act); break; diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 9efd04197..ad57ea888 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.61 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: cs4280.c,v 1.62 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -1571,6 +1571,7 @@ cs4280_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* should I powerdown here ? */ cs4280_write_codec(sc, AC97_REG_POWER, CS4280_POWER_DOWN_ALL); break; diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 33b34dcf2..6e536720d 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4281.c,v 1.46 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: cs4281.c,v 1.47 2024/08/18 14:42:56 deraadt Exp $ */ /* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */ /* @@ -960,6 +960,7 @@ cs4281_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* should I powerdown here ? */ cs4281_write_codec(sc, AC97_REG_POWER, CS4281_POWER_DOWN_ALL); break; diff --git a/sys/dev/pci/drm/apple/apldcp.c b/sys/dev/pci/drm/apple/apldcp.c index 6ab379c6b..d64682cc5 100644 --- a/sys/dev/pci/drm/apple/apldcp.c +++ b/sys/dev/pci/drm/apple/apldcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apldcp.c,v 1.2 2024/07/12 10:01:28 tobhe Exp $ */ +/* $OpenBSD: apldcp.c,v 1.3 2024/08/18 10:50:22 kettenis Exp $ */ /* * Copyright (c) 2023 Mark Kettenis * @@ -115,14 +115,13 @@ struct apple_rtkit_ep { uint8_t ep; }; -static struct pool rtktask_pool; - struct apple_rtkit { struct rtkit_state *state; struct apple_rtkit_ep ep[64]; void *cookie; struct platform_device *pdev; const struct apple_rtkit_ops *ops; + struct pool task_pool; struct taskq *tq; }; @@ -181,7 +180,7 @@ apple_rtkit_do_recv(void *arg) struct apple_rtkit *rtk = rtkep->rtk; rtk->ops->recv_message(rtk->cookie, rtkep->ep, rtktask->msg); - pool_put(&rtktask_pool, rtktask); + pool_put(&rtk->task_pool, rtktask); } void @@ -191,7 +190,7 @@ apple_rtkit_recv(void *cookie, uint64_t msg) struct apple_rtkit *rtk = rtkep->rtk; struct apple_rtkit_task *rtktask; - rtktask = pool_get(&rtktask_pool, PR_NOWAIT | PR_ZERO); + rtktask = pool_get(&rtk->task_pool, PR_NOWAIT | PR_ZERO); KASSERT(rtktask != NULL); rtktask->rtkep = rtkep; @@ -251,7 +250,7 @@ devm_apple_rtkit_init(struct device *dev, void *cookie, return ERR_PTR(ENOMEM); } - pool_init(&rtktask_pool, sizeof(struct apple_rtkit_task), 0, IPL_TTY, + pool_init(&rtk->task_pool, sizeof(struct apple_rtkit_task), 0, IPL_TTY, 0, "apldcp_rtkit", NULL); rk = malloc(sizeof(*rk), M_DEVBUF, M_WAITOK | M_ZERO); diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c index dcbb86323..8ee2a8c1f 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c @@ -753,8 +753,9 @@ vm_fault_gtt(struct i915_mmap_offset *mmo, struct uvm_faultinfo *ufi, int srcu; int ret; - obj_offset = entry->offset - drm_vma_node_start(&mmo->vma_node); + obj_offset = (entry->offset >> PAGE_SHIFT) - drm_vma_node_start(&mmo->vma_node); page_offset = (vaddr - entry->start) >> PAGE_SHIFT; + page_offset += obj_offset; trace_i915_gem_object_fault(obj, page_offset, true, write); diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 3bdf82cfb..0c6b6ee50 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.43 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: esa.c,v 1.44 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -1489,16 +1489,22 @@ int esa_activate(struct device *self, int act) { struct esa_softc *sc = (struct esa_softc *)self; + int rv; switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); esa_suspend(sc); break; case DVACT_RESUME: esa_resume(sc); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - return 0; + return rv; } void diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index f8c14f926..3eb81fa3b 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eso.c,v 1.55 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: eso.c,v 1.56 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */ /* @@ -1966,6 +1966,7 @@ eso_activate(struct device *self, int act) bus_space_write_1(sc->sc_iot, sc->sc_ioh, ESO_IO_IRQCTL, tmp); break; case DVACT_SUSPEND: + rv = config_activate_children(self, act); bus_space_write_1(sc->sc_iot, sc->sc_ioh, ESO_IO_A2DMAM, 0); bus_space_write_1(sc->sc_dmac_iot, sc->sc_dmac_ioh, ESO_DMAC_CLEAR, 0); diff --git a/sys/dev/pci/glxpcib.c b/sys/dev/pci/glxpcib.c index 31622d13c..81c302f0e 100644 --- a/sys/dev/pci/glxpcib.c +++ b/sys/dev/pci/glxpcib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxpcib.c,v 1.16 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: glxpcib.c,v 1.17 2024/08/19 00:01:40 deraadt Exp $ */ /* * Copyright (c) 2007 Marc Balmer @@ -431,6 +431,7 @@ glxpcib_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); #ifndef SMALL_KERNEL if (sc->sc_wdog) { sc->sc_wdog_period = bus_space_read_2(sc->sc_iot, @@ -438,7 +439,6 @@ glxpcib_activate(struct device *self, int act) glxpcib_wdogctl_cb(sc, 0); } #endif - rv = config_activate_children(self, act); #ifndef SMALL_KERNEL for (i = 0; i < nitems(glxpcib_msrlist); i++) sc->sc_msrsave[i] = rdmsr(glxpcib_msrlist[i]); @@ -455,11 +455,11 @@ glxpcib_activate(struct device *self, int act) rv = config_activate_children(self, act); break; case DVACT_POWERDOWN: + rv = config_activate_children(self, act); #ifndef SMALL_KERNEL if (sc->sc_wdog) wdog_shutdown(self); #endif - rv = config_activate_children(self, act); break; default: rv = config_activate_children(self, act); diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 66a0edbce..9a07c7a21 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.133 2023/11/10 15:51:20 bluhm Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.134 2024/08/19 03:08:27 jsg Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -1950,7 +1950,7 @@ bnx_nvram_write(struct bnx_softc *sc, u_int32_t offset, u_int8_t *data_buf, if (align_start || align_end) { buf = malloc(len32, M_DEVBUF, M_NOWAIT); - if (buf == 0) + if (buf == NULL) return (ENOMEM); if (align_start) diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 42178252c..37e29dcb6 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.52 2024/05/24 06:02:58 jsg Exp $ */ +/* $OpenBSD: maestro.c,v 1.54 2024/08/18 20:28:41 deraadt Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -1349,9 +1349,11 @@ int maestro_activate(struct device *self, int act) { struct maestro_softc *sc = (struct maestro_softc *)self; + int rv; switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* Power down device on shutdown. */ DPRINTF(("maestro: power down\n")); if (sc->record.mode & MAESTRO_RUNNING) { @@ -1382,9 +1384,13 @@ maestro_activate(struct device *self, int act) if (sc->record.mode & MAESTRO_RUNNING) maestro_channel_start(&sc->record); maestro_update_timer(sc); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - return 0; + return rv; } void diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index 67feff2bf..c81231dff 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.65 2024/06/26 01:40:49 jsg Exp $ */ +/* $OpenBSD: yds.c,v 1.66 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -1571,11 +1571,11 @@ yds_activate(struct device *self, int act) switch (act) { case DVACT_QUIESCE: + rv = config_activate_children(self, act); if (sc->sc_play.intr || sc->sc_rec.intr) sc->sc_resume_active = 1; else sc->sc_resume_active = 0; - rv = config_activate_children(self, act); if (sc->sc_resume_active) yds_close(sc); break; diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c index 108d0f75d..7756c70e7 100644 --- a/sys/dev/pckbc/pms.c +++ b/sys/dev/pckbc/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.98 2023/08/16 20:53:47 bru Exp $ */ +/* $OpenBSD: pms.c,v 1.99 2024/08/18 15:09:49 deraadt Exp $ */ /* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -778,9 +778,11 @@ int pmsactivate(struct device *self, int act) { struct pms_softc *sc = (struct pms_softc *)self; + int rv; switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); if (sc->sc_state == PMS_STATE_ENABLED) pms_change_state(sc, PMS_STATE_SUSPENDED, PMS_DEV_IGNORE); @@ -789,9 +791,13 @@ pmsactivate(struct device *self, int act) if (sc->sc_state == PMS_STATE_SUSPENDED) pms_change_state(sc, PMS_STATE_ENABLED, PMS_DEV_IGNORE); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - return (0); + return (rv); } int diff --git a/sys/dev/pv/pvbus.c b/sys/dev/pv/pvbus.c index 389109738..165fcc9fb 100644 --- a/sys/dev/pv/pvbus.c +++ b/sys/dev/pv/pvbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pvbus.c,v 1.28 2024/05/24 10:05:55 jsg Exp $ */ +/* $OpenBSD: pvbus.c,v 1.29 2024/08/19 00:03:12 deraadt Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -45,7 +45,6 @@ int has_hv_cpuid = 0; extern void rdrand(void *); -int pvbus_activate(struct device *, int); int pvbus_match(struct device *, void *, void *); void pvbus_attach(struct device *, struct device *, void *); int pvbus_print(void *, const char *); @@ -64,8 +63,6 @@ const struct cfattach pvbus_ca = { sizeof(struct pvbus_softc), pvbus_match, pvbus_attach, - NULL, - pvbus_activate }; struct cfdriver pvbus_cd = { @@ -218,29 +215,6 @@ pvbus_init_cpu(void) } } -int -pvbus_activate(struct device *self, int act) -{ - int rv = 0; - - switch (act) { - case DVACT_SUSPEND: - rv = config_activate_children(self, act); - break; - case DVACT_RESUME: - rv = config_activate_children(self, act); - break; - case DVACT_POWERDOWN: - rv = config_activate_children(self, act); - break; - default: - rv = config_activate_children(self, act); - break; - } - - return (rv); -} - int pvbus_search(struct device *parent, void *arg, void *aux) { diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c index 795005047..348261ecd 100644 --- a/sys/dev/sdmmc/sdmmc.c +++ b/sys/dev/sdmmc/sdmmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc.c,v 1.61 2023/04/19 02:01:02 dlg Exp $ */ +/* $OpenBSD: sdmmc.c,v 1.62 2024/08/18 15:03:01 deraadt Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -202,8 +202,8 @@ sdmmc_activate(struct device *self, int act) sc->sc_dying = -1; break; case DVACT_RESUME: - rv = config_activate_children(self, act); wakeup(&sc->sc_tskq); + rv = config_activate_children(self, act); break; default: rv = config_activate_children(self, act); diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index b73f2d1de..3acccfaf6 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.430 2024/02/03 18:51:58 beck Exp $ */ +/* $OpenBSD: softraid.c,v 1.431 2024/08/18 19:44:10 phessler Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -4862,10 +4862,25 @@ bad: void sr_sensors_delete(struct sr_discipline *sd) { + struct sr_softc *sc = sd->sd_sc; + DNPRINTF(SR_D_STATE, "%s: sr_sensors_delete\n", DEVNAME(sd->sd_sc)); - if (sd->sd_vol.sv_sensor_attached) + if (sd->sd_vol.sv_sensor_attached) { sensor_detach(&sd->sd_sc->sc_sensordev, &sd->sd_vol.sv_sensor); + sd->sd_vol.sv_sensor_attached = 0; + } + + /* + * Unregister the refresh task if we detached our last sensor. + */ + TAILQ_FOREACH(sd, &sc->sc_dis_list, sd_link) + if (sd->sd_vol.sv_sensor_attached) + return; + if (sc->sc_sensor_task != NULL) { + sensor_task_unregister(sc->sc_sensor_task); + sc->sc_sensor_task = NULL; + } } void diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 87ca505bb..662a0aba2 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.131 2024/05/23 03:21:09 jsg Exp $ */ +/* $OpenBSD: usb.c,v 1.132 2024/08/18 02:59:51 deraadt Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -901,13 +901,8 @@ usb_activate(struct device *self, int act) break; case DVACT_RESUME: sc->sc_bus->dying = 0; - - /* - * Make sure the root hub is present before interrupts - * get enabled. As long as the bus is in polling mode - * it is safe to call usbd_new_device() now since root - * hub transfers do not need to sleep. - */ + break; + case DVACT_WAKEUP: sc->sc_bus->use_polling++; if (!usb_attach_roothub(sc)) usb_needs_explore(sc->sc_bus->root_hub, 0); diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index 5499969d3..464bc48ba 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.141 2024/06/05 11:04:17 krw Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.142 2024/08/18 08:01:03 mpi Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt @@ -470,10 +470,6 @@ uvm_pmr_alloc_pig(paddr_t *pa, psize_t sz, paddr_t piglet_pa) * Piglets are aligned. * * sz and align in bytes. - * - * The call will sleep for the pagedaemon to attempt to free memory. - * The pagedaemon may decide its not possible to free enough memory, causing - * the allocation to fail. */ int uvm_pmr_alloc_piglet(vaddr_t *va, paddr_t *pa, vsize_t sz, paddr_t align) diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 61ff4274c..3efb7a969 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mld6.c,v 1.63 2024/08/12 11:25:27 bluhm Exp $ */ +/* $OpenBSD: mld6.c,v 1.64 2024/08/19 08:07:16 jsg Exp $ */ /* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */ /* @@ -344,7 +344,7 @@ void mld6_fasttimeo(void) { struct ifnet *ifp; - int running; + int running = 0; /* * Quick check to see if any work needs to be done, in order diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c index 6222bfa15..5bd5a07f6 100644 --- a/sys/uvm/uvm_pmemrange.c +++ b/sys/uvm/uvm_pmemrange.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pmemrange.c,v 1.66 2024/05/01 12:54:27 mpi Exp $ */ +/* $OpenBSD: uvm_pmemrange.c,v 1.67 2024/08/18 08:18:49 mpi Exp $ */ /* * Copyright (c) 2024 Martin Pieuchot @@ -2303,8 +2303,19 @@ uvm_pmr_cache_put(struct vm_page *pg) { struct uvm_pmr_cache *upc = &curcpu()->ci_uvm; struct uvm_pmr_cache_item *upci; + struct uvm_pmemrange *pmr; int s; + /* + * Always give back low pages to the allocator to not accelerate + * their exhaustion. + */ + pmr = uvm_pmemrange_find(atop(VM_PAGE_TO_PHYS(pg))); + if (pmr->use > 0) { + uvm_pmr_freepages(pg, 1); + return; + } + s = splvm(); upci = &upc->upc_magz[upc->upc_actv]; if (upci->upci_npages >= UVM_PMR_CACHEMAGSZ) { diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c index 741d5c703..cc090d8ec 100644 --- a/usr.bin/cal/cal.c +++ b/usr.bin/cal/cal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cal.c,v 1.31 2022/12/04 23:50:47 cheloha Exp $ */ +/* $OpenBSD: cal.c,v 1.32 2024/08/18 19:58:35 deraadt Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* diff --git a/usr.bin/gprof/gprof.flat b/usr.bin/gprof/gprof.flat index d9cccd46c..01f970090 100644 --- a/usr.bin/gprof/gprof.flat +++ b/usr.bin/gprof/gprof.flat @@ -18,15 +18,15 @@ calls the number of times this function was invoked, if self the average number of milliseconds spent in this ms/call function per call, if this function is profiled, - else blank. + else blank. total the average number of milliseconds spent in this ms/call function and its descendents per call, if this - function is profiled, else blank. + function is profiled, else blank. name the name of the function. This is the minor sort for this listing. The index shows the location of - the function in the gprof listing. If the index is - in parenthesis it shows where it would appear in - the gprof listing if it were to be printed. + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. diff --git a/usr.bin/m4/NOTES b/usr.bin/m4/NOTES index d60f80eb5..e2da04b20 100644 --- a/usr.bin/m4/NOTES +++ b/usr.bin/m4/NOTES @@ -1,8 +1,8 @@ m4 - macro processor -PD m4 is based on the macro tool distributed with the software -tools (VOS) package, and described in the "SOFTWARE TOOLS" and -"SOFTWARE TOOLS IN PASCAL" books. It has been expanded to include +PD m4 is based on the macro tool distributed with the software +tools (VOS) package, and described in the "SOFTWARE TOOLS" and +"SOFTWARE TOOLS IN PASCAL" books. It has been expanded to include most of the command set of SysV m4, the standard UN*X macro processor. Since both PD m4 and UN*X m4 are based on SOFTWARE TOOLS macro, @@ -31,12 +31,12 @@ References: Implementation Notes: -[1] PD m4 uses a different (and simpler) stack mechanism than the one - described in Software Tools and Software Tools in Pascal books. - The triple stack thing is replaced with a single stack containing - the call frames and the arguments. Each frame is back-linked to a - previous stack frame, which enables us to rewind the stack after - each nested call is completed. Each argument is a character pointer +[1] PD m4 uses a different (and simpler) stack mechanism than the one + described in Software Tools and Software Tools in Pascal books. + The triple stack thing is replaced with a single stack containing + the call frames and the arguments. Each frame is back-linked to a + previous stack frame, which enables us to rewind the stack after + each nested call is completed. Each argument is a character pointer to the beginning of the argument string within the string space. The only exceptions to this are (*) arg 0 and arg 1, which are the macro definition and macro name strings, stored dynamically diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 6ffbe6f0c..f58aa5365 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.67 2023/11/21 17:56:19 tb Exp $ */ +/* $OpenBSD: apps.c,v 1.68 2024/08/18 20:24:11 tb Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -1053,7 +1053,7 @@ load_config(BIO *err, CONF *cnf) if (cnf == NULL) return 1; - OPENSSL_load_builtin_modules(); + OPENSSL_config(NULL); if (CONF_modules_load(cnf, NULL, 0) <= 0) { BIO_printf(err, "Error configuring OpenSSL\n"); diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 7ee811379..00268e8e9 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.225 2024/06/24 08:30:50 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.226 2024/08/19 08:31:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -109,10 +109,11 @@ struct input_ctx { int utf8started; int ch; - int last; + struct utf8_data last; int flags; #define INPUT_DISCARD 0x1 +#define INPUT_LAST 0x2 const struct input_state *state; @@ -867,8 +868,6 @@ input_reset(struct input_ctx *ictx, int clear) input_clear(ictx); - ictx->last = -1; - ictx->state = &input_state_ground; ictx->flags = 0; } @@ -1149,7 +1148,9 @@ input_print(struct input_ctx *ictx) utf8_set(&ictx->cell.cell.data, ictx->ch); screen_write_collect_add(sctx, &ictx->cell.cell); - ictx->last = ictx->ch; + + utf8_copy(&ictx->last, &ictx->cell.cell.data); + ictx->flags |= INPUT_LAST; ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; @@ -1261,7 +1262,7 @@ input_c0_dispatch(struct input_ctx *ictx) break; } - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; return (0); } @@ -1337,7 +1338,7 @@ input_esc_dispatch(struct input_ctx *ictx) break; } - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; return (0); } @@ -1570,12 +1571,12 @@ input_csi_dispatch(struct input_ctx *ictx) if (n > m) n = m; - if (ictx->last == -1) + if (~ictx->flags & INPUT_LAST) break; - ictx->ch = ictx->last; + utf8_copy(&ictx->cell.cell.data, &ictx->last); for (i = 0; i < n; i++) - input_print(ictx); + screen_write_collect_add(sctx, &ictx->cell.cell); break; case INPUT_CSI_RCP: input_restore_state(ictx); @@ -1645,7 +1646,7 @@ input_csi_dispatch(struct input_ctx *ictx) } - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; return (0); } @@ -2266,7 +2267,7 @@ input_enter_dcs(struct input_ctx *ictx) input_clear(ictx); input_start_timer(ictx); - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; } /* DCS terminator (ST) received. */ @@ -2310,7 +2311,7 @@ input_enter_osc(struct input_ctx *ictx) input_clear(ictx); input_start_timer(ictx); - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; } /* OSC terminator (ST) received. */ @@ -2405,7 +2406,7 @@ input_enter_apc(struct input_ctx *ictx) input_clear(ictx); input_start_timer(ictx); - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; } /* APC terminator (ST) received. */ @@ -2434,7 +2435,7 @@ input_enter_rename(struct input_ctx *ictx) input_clear(ictx); input_start_timer(ictx); - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; } /* Rename terminator (ST) received. */ @@ -2478,7 +2479,7 @@ input_top_bit_set(struct input_ctx *ictx) struct screen_write_ctx *sctx = &ictx->ctx; struct utf8_data *ud = &ictx->utf8data; - ictx->last = -1; + ictx->flags &= ~INPUT_LAST; if (!ictx->utf8started) { if (utf8_open(ud, ictx->ch) != UTF8_MORE) @@ -2504,6 +2505,9 @@ input_top_bit_set(struct input_ctx *ictx) utf8_copy(&ictx->cell.cell.data, ud); screen_write_collect_add(sctx, &ictx->cell.cell); + utf8_copy(&ictx->last, &ictx->cell.cell.data); + ictx->flags |= INPUT_LAST; + return (0); } diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 9b0a1d120..67b7f5844 100644 --- a/usr.bin/tmux/tty-keys.c +++ b/usr.bin/tmux/tty-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.175 2024/07/12 11:21:18 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.176 2024/08/19 08:29:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1212,7 +1212,7 @@ tty_keys_clipboard(struct tty *tty, const char *buf, size_t len, size_t *size) } if (end == len) return (1); - *size = end + terminator; + *size = end + 1; /* Skip the initial part. */ buf += 5; diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index c21c0b6a3..d5d508331 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.68 2022/12/04 23:50:50 cheloha Exp $ */ +/* $OpenBSD: w.c,v 1.69 2024/08/19 07:28:22 florian Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -98,13 +98,13 @@ static void pr_header(time_t *, int); static struct stat *ttystat(char *); static void usage(int); +static char *hostlookup(char *, char *); int main(int argc, char *argv[]) { extern char *__progname; struct kinfo_proc *kp; - struct hostent *hp; struct stat *stp; FILE *ut; struct in_addr addr; @@ -295,29 +295,27 @@ main(int argc, char *argv[]) for (ep = ehead; ep != NULL; ep = ep->next) { p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; - for (x = NULL, i = 0; p[i] != '\0' && i < UT_HOSTSIZE; i++) + for (x = NULL, i = 0; p[i] != '\0' && i < UT_HOSTSIZE; i++) { if (p[i] == ':') { x = &p[i]; *x++ = '\0'; break; } - if (!nflag && inet_aton(p, &addr) && - (hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET))) { - if (domain[0] != '\0') { - p = hp->h_name; - p += strlen(hp->h_name); - p -= strlen(domain); - if (p > hp->h_name && - strcasecmp(p, domain) == 0) - *p = '\0'; - } - p = hp->h_name; } + if (x) { (void)snprintf(buf, sizeof(buf), "%s:%.*s", p, (int)(ep->utmp.ut_host + UT_HOSTSIZE - x), x); p = buf; } + + if (!nflag) { + char *tmp; + + if ((tmp = hostlookup(p, domain)) != NULL) + p = tmp; + } + (void)printf("%-*.*s %-2.2s %-*.*s ", NAME_WIDTH, UT_NAMESIZE, ep->utmp.ut_name, strncmp(ep->utmp.ut_line, "tty", 3) ? @@ -509,3 +507,32 @@ usage(int wcmd) "usage: uptime\n"); exit (1); } + +static char* +hostlookup(char *host, char *domain) +{ + static char buf[NI_MAXHOST]; + struct addrinfo hints, *res; + int error; + char *p; + + memset(&hints, 0, sizeof(hints)); + if (getaddrinfo(host, NULL, &hints, &res) != 0) + return NULL; + + error = getnameinfo(res->ai_addr, res->ai_addr->sa_len, buf, + sizeof(buf), NULL, 0, 0); + freeaddrinfo(res); + + if (error) + return NULL; + + if (domain[0] != '\0') { + p = buf; + p += strlen(buf); + p -= strlen(domain); + if (p > buf && strcasecmp(p, domain) == 0) + *p = '\0'; + } + return buf; +} diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c index 798fc066f..06b380faa 100644 --- a/usr.bin/ypwhich/ypwhich.c +++ b/usr.bin/ypwhich/ypwhich.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypwhich.c,v 1.23 2015/02/08 23:40:35 deraadt Exp $ */ +/* $OpenBSD: ypwhich.c,v 1.24 2024/08/19 06:00:18 florian Exp $ */ /* $NetBSD: ypwhich.c,v 1.6 1996/05/13 02:43:48 thorpej Exp $ */ /* @@ -137,7 +137,7 @@ main(int argc, char *argv[]) int notrans = 0, mode = 0, c, r, i; struct ypmaplist *ypml, *y; struct sockaddr_in sin; - struct hostent *hent; + struct addrinfo hints, *res; CLIENT *client = NULL; yp_get_default_domain(&domain); @@ -181,17 +181,17 @@ main(int argc, char *argv[]) break; case 1: bzero(&sin, sizeof sin); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; sin.sin_family = AF_INET; - if (inet_aton(argv[0], &sin.sin_addr) == 0) { - hent = gethostbyname(argv[0]); - if (!hent) { - fprintf(stderr, "ypwhich: host %s unknown\n", - argv[0]); - exit(1); - } - bcopy(hent->h_addr, &sin.sin_addr, - sizeof sin.sin_addr); + if (getaddrinfo(argv[0], NULL, &hints, &res) != 0) { + fprintf(stderr, "ypwhich: host %s unknown\n", + argv[0]); + exit(1); } + sin.sin_addr = + ((struct sockaddr_in *)res->ai_addr)->sin_addr; + freeaddrinfo(res); if (bind_host(domain, &sin)) exit(1); break; diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c index 536085410..622e62869 100644 --- a/usr.sbin/cron/entry.c +++ b/usr.sbin/cron/entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entry.c,v 1.59 2023/07/19 21:26:02 millert Exp $ */ +/* $OpenBSD: entry.c,v 1.60 2024/08/19 15:08:21 millert Exp $ */ /* * Copyright 1988,1990,1993,1994 by Paul Vixie @@ -625,7 +625,10 @@ get_number(int *numptr, int low, const char *names[], int ch, FILE *file, /* got a number, check for valid terminator */ if (!strchr(terms, ch)) goto bad; - *numptr = atoi(temp); + i = atoi(temp); + if (i < 0) + goto bad; + *numptr = i; return (ch); } @@ -675,7 +678,7 @@ set_range(bitstr_t *bits, int low, int high, int start, int stop, int step) start -= low; stop -= low; - if (step == 1) { + if (step <= 1 || step > stop) { bit_nset(bits, start, stop); } else { for (i = start; i <= stop; i += step) diff --git a/usr.sbin/fw_update/patterns.c b/usr.sbin/fw_update/patterns.c index 5a6c2d0d2..df24ad2a3 100644 --- a/usr.sbin/fw_update/patterns.c +++ b/usr.sbin/fw_update/patterns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: patterns.c,v 1.13 2024/05/22 12:33:07 claudio Exp $ */ +/* $OpenBSD: patterns.c,v 1.14 2024/08/18 14:58:47 phessler Exp $ */ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou. All rights reserved. @@ -117,6 +117,7 @@ main(void) printf("%s\n", "qcpas"); printf("%s\n", "qcpas ^ppb0*\"Qualcomm SC8280XP PCIe\""); printf("%s\n", "qwx"); + printf("%s\n", "qwz"); printf("%s\n", "radeondrm"); print_devices("radeondrm", radeon_devices, nitems(radeon_devices)); printf("%s\n", "rsu"); diff --git a/usr.sbin/pppd/chat/Makefile b/usr.sbin/pppd/chat/Makefile index 2e040b6e3..cc9613fca 100644 --- a/usr.sbin/pppd/chat/Makefile +++ b/usr.sbin/pppd/chat/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:48:00 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 2024/08/18 20:08:58 deraadt Exp $ PROG= chat SRCS= chat.c diff --git a/usr.sbin/rpki-client/version.h b/usr.sbin/rpki-client/version.h index 89dbe65b6..fbccd5d6b 100644 --- a/usr.sbin/rpki-client/version.h +++ b/usr.sbin/rpki-client/version.h @@ -1,3 +1,3 @@ -/* $OpenBSD: version.h,v 1.23 2024/06/12 04:11:19 tb Exp $ */ +/* $OpenBSD: version.h,v 1.24 2024/08/19 12:44:33 job Exp $ */ -#define RPKI_VERSION "9.1" +#define RPKI_VERSION "9.2"