pkgng/pkgng a3eb382tests/lib fetch_http.c

test: attempt to fix sigpipe on linux
DeltaFile
+25-5tests/lib/fetch_http.c
+25-51 files

pkgng/pkgng 3f9aa42libpkg pkg_add.c pkg.h.in, libpkg/private pkg.h

feat: add PKG_EVENT_RC_SCRIPT for rc.d script actions

Introduce a dedicated event for rc script start/stop/restart, with
display in src/event.c and pipe JSON in libpkg/pkg_event.c.

Renamed internal PKG_RC_START/STOP to PKG_RC_ATTR_START/STOP to avoid
conflict with the new public pkg_rc_action_t enum.
DeltaFile
+35-0libpkg/pkg_event.c
+23-0src/event.c
+12-5libpkg/rcscripts.c
+14-0libpkg/pkg.h.in
+4-4libpkg/pkg_add.c
+2-2libpkg/private/pkg.h
+90-112 files not shown
+93-138 files

pkgng/pkgng 3fb5feclibpkg rcscripts.c

fix: fix deffered rc script execution

Fixes: #2723
DeltaFile
+3-5libpkg/rcscripts.c
+3-51 files

pkgng/pkgng 2282f1dlibpkg pkg_repo.c

pkg_repo: Fix incompatible pointer

Fix incompatible variable pointer which causes compile to fail in Linux
systems.

Fix variable clevel_buf that was 'char **'' which is corrected type to 'char *'
DeltaFile
+1-1libpkg/pkg_repo.c
+1-11 files

pkgng/pkgng 49ad8aalibpkg pkg_jobs.c

pkg_jobs: Fix UAF during additional SAT cycle
DeltaFile
+2-1libpkg/pkg_jobs.c
+2-11 files

pkgng/pkgng ae23524docs pkg-rwhich.8 pkg.conf.5, libpkg pkg_config.c

rwhich: add a global configuration and a per repo configuration

This helps fine grained control on the usage of the rwhich database
DeltaFile
+33-0docs/pkg.conf.5
+22-0docs/pkg-rwhich.8
+11-0libpkg/pkg_config.c
+5-0libpkg/repo/binary/query.c
+3-1libpkg/repo/binary/update.c
+3-0libpkg/private/pkg.h
+77-16 files

pkgng/pkgng 8d714edlibpkg pkg_repo_create.c pkg_repo.c

compression: respect compression_level for the file db and the metadata
DeltaFile
+6-0libpkg/pkg_repo.c
+1-1libpkg/pkg_repo_create.c
+7-12 files

pkgng/pkgng e121173libpkg/repo/binary query.c

fix: only allocate the archive reader when we will actually use it
DeltaFile
+3-1libpkg/repo/binary/query.c
+3-11 files

pkgng/pkgng 995be31libpkg/repo/binary query.c

fix: plug another minor memleak
DeltaFile
+3-1libpkg/repo/binary/query.c
+3-11 files

pkgng/pkgng b08b018libpkg/repo/binary query.c

fix: plug memory leak
DeltaFile
+11-2libpkg/repo/binary/query.c
+11-21 files

pkgng/pkgng 04b424dlibpkg fetch.c pkg_audit.c, libpkg/private pkg.h

Bound vulnerability database handling

The audit updater writes an unbounded remote download and decompressed
output before validation. An HTTP attacker can fill temporary or package
database storage.

Set fixed maxima and also limit each stage to half its filesystem.
Build a temporary database and atomically replace the existing one after
success.
DeltaFile
+158-17libpkg/pkg_audit.c
+10-2libpkg/fetch.c
+2-0libpkg/private/pkg.h
+170-193 files

pkgng/pkgng 9c59aa4libpkg pkg_sandbox.c

Drop privileges in sandboxed callbacks

The callback sandbox processes untrusted archive and signature parsers
after forking, but retains root identity. It also inherits a descriptor
for /, so Capsicum alone does not remove root filesystem authority.

Drop to nobody before entering Capsicum, matching the string-returning
callback path.
DeltaFile
+2-0libpkg/pkg_sandbox.c
+2-01 files

pkgng/pkgng a092d55libpkg/repo/binary query.c

portability: use funopen instead of fopencookie

funopen is already available in compat/ for linux and used in pkg
elsewhere.

This fixes build on macOS
DeltaFile
+10-9libpkg/repo/binary/query.c
+10-91 files

pkgng/pkgng a529dd7libpkg/repo/binary query.c

fix: plug memory leak
DeltaFile
+1-0libpkg/repo/binary/query.c
+1-01 files

pkgng/pkgng 66d7184libpkg pkg_repo.c, libpkg/private pkg.h

rwhich: verify signature and store as raw compressed file
DeltaFile
+60-56libpkg/pkg_repo.c
+31-80libpkg/repo/binary/query.c
+1-12libpkg/repo/binary/update.c
+2-1libpkg/private/pkg.h
+94-1494 files

pkgng/pkgng 9dc5efdlibpkg pkg.h.in

rwhich: fix build
DeltaFile
+6-0libpkg/pkg.h.in
+6-01 files

pkgng/pkgng 8feba77libpkg fetch.c fetch_file.c, libpkg/private fetch.h

Enforce signed package size while fetching

The HTTP fetcher replaces the signed package size with server metadata.
It validates size only after writing the cache file. An HTTP attacker
can fill that filesystem before rejection.

Keep the trusted expected size separate from response metadata. Cap the
stream at that size, including unknown-length responses.
DeltaFile
+19-1libpkg/fetch_file.c
+6-0libpkg/fetch.c
+1-0libpkg/private/fetch.h
+26-13 files

pkgng/pkgng 07e51bdlibpkg pkg_config.c

Reject invalid repository signature types

An unrecognized signature_type is silently treated as none. A misspelled
repository policy can disable verification. An HTTP attacker can then
replace package metadata.

Accept only pubkey, fingerprints, and none. Reject invalid values before
creating a repository or modifying an existing repository.
DeltaFile
+18-8libpkg/pkg_config.c
+18-81 files

pkgng/pkgng 51be7f5docs pkg-rwhich.8

rwhich(8): update documentation
DeltaFile
+33-2docs/pkg-rwhich.8
+33-21 files

pkgng/pkgng 472c575. NEWS, docs pkg.conf.5

fetch: fix SRV/mirror server failover (#296955)

- move server-list discovery before the fetch loop and seed the
  walking pointer once; it was reset to the list head every iteration,
  so only the first SRV record / mirror was ever tried
- give each server its own FETCH_RETRY budget before advancing to the
  next; the list is walked at most once then we give up
- report SRV and mirror-list lookup failures and fall back to the
  configured URL host instead of silently trying host:0
- update pkg.conf.5 FETCH_RETRY docs to per-server semantics
DeltaFile
+225-0tests/lib/fetch_http.c
+108-43libpkg/fetch_libfetch.c
+11-1docs/pkg.conf.5
+5-2tests/Makefile.in
+3-0NEWS
+2-0libpkg/private/fetch.h
+354-466 files

pkgng/pkgng 563486elibpkg pkg.c pkg_repo.c, libpkg/repo/binary binary_private.h update.c

Store filesite as compressed archive, parse in memory for rwhich

Remove pkg_files and file_dirs tables from the repo SQLite database
(~96% of the DB size). The compressed filesite archive is now saved
as a standalone "files" file in the repo directory during pkg update.
pkg rwhich decompresses and streams the archive on demand, keeping
only the directory dictionary in memory.

While at here: expand the path in the output for more clarity
DeltaFile
+848-53libpkg/repo/binary/query.c
+9-160libpkg/repo/binary/update.c
+94-0libpkg/pkg_repo.c
+38-0tests/frontend/rwhich.sh
+1-23libpkg/repo/binary/binary_private.h
+9-0libpkg/pkg.c
+999-2365 files not shown
+1,009-24611 files

pkgng/pkgng 79ac1c2libpkg fetch.c fetch_file.c, libpkg/private fetch.h

Bound repository archive handling

Repository archives are downloaded and extracted before signatures are
verified. A spoofed response could use either a large download or a
compressed member to exhaust filesystem space before rejection.

Limit downloaded archives and extracted target members to 1 GiB or half
of currently free temporary storage. Limit repository metadata to 1 MiB.
Reject duplicate members and check target member size before extraction.
DeltaFile
+71-10libpkg/pkg_repo.c
+16-1libpkg/fetch_file.c
+6-0libpkg/fetch.c
+1-0libpkg/private/fetch.h
+94-114 files

pkgng/pkgng 4b944a0libpkg pkg_sandbox.c pkg_repo.c

Bound repository signature extraction

Repository signature entries are extracted in a sandbox, but the
privileged parent previously accumulated the entire callback response before
fingerprint verification. A spoofed repository response could exhaust memory
without a valid signing key.

Limit the sandbox callback response to 8 MiB and reject archives with more
than eight signature entries or an entry larger than 1 MiB. This bounds both
the parent allocation and the child extraction workload before verification.
DeltaFile
+23-3libpkg/pkg_repo.c
+20-3libpkg/pkg_sandbox.c
+43-62 files

pkgng/pkgng 7a4cc34src utils.c

utils: always print signature_type
DeltaFile
+1-3src/utils.c
+1-31 files

pkgng/pkgng 0bc2b7ftests/frontend repo.sh

tests: use bsdtar instead of tar in repo tests

GNU tar does not behave 100% like bsdtar, Use bsdtar explicitly
DeltaFile
+4-4tests/frontend/repo.sh
+4-41 files

pkgng/pkgng 90b994clibpkg/repo/binary update.c

repo: open catalogue read-only when checking validity

pkg_repo_binary_update opened the repo DB read-write just to sanity
check it, even when no update was needed. Open read-only instead;
the actual read-write open in pkg_repo_binary_init_update already
runs only after new data is fetched.
DeltaFile
+7-1libpkg/repo/binary/update.c
+7-11 files

pkgng/pkgng 45874a6tests/frontend repo.sh

tests: add repo_filelist_data regression test

Verify that data.pkg never contains file lists or directories
regardless of --list-files, and that -l still generates the file
database (files.pkg) listing the package files.
DeltaFile
+38-1tests/frontend/repo.sh
+38-11 files

pkgng/pkgng 1891a25libpkg pkg_repo_create.c

repo: keep file lists out of the data catalog

The data catalog (data.pkg) and per-package manifest must not contain
file lists or directories; those belong only to the file database emitted
via -l/--list-files.  Emit the data catalog in compact form so data.pkg
is identical whether or not --list-files is used.  Previously -l caused the
full +MANIFEST (with files) to be read and re-emitted into data, ballooning
the catalog (e.g. a full i386 repo grew from ~60MB to ~2GB).
DeltaFile
+9-1libpkg/pkg_repo_create.c
+9-11 files

pkgng/pkgng 5abec8a. configure.def NEWS

Release 2.8.1
DeltaFile
+8-0NEWS
+1-1configure.def
+9-12 files

pkgng/pkgng 6f7c0e7libpkg binfmt_macho.c

macho: map macOS 26 / iOS 19 to Darwin 25

Add missing Tahoe/iOS 19 entries so pkg config abi reports Darwin:25
instead of falling back to the macOS 15 (Darwin 24) row.
DeltaFile
+9-0libpkg/binfmt_macho.c
+9-01 files