Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / add
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
pkg_install: fix null pointer dereference The pkg_add -m option crashes on null pointer dereference if the input has a slash but then no space. Patch by riastradh@ in PR pkg/59991.
pkg_install: include err.h for errx()
pkg_install: Fix mistake in previous: this is strchr, not strchrnul. Either if ((q = strchr(p, '/')) == NULL) or if (*(q = strchrnul(p, '/')) == '\0') will work, but not if (*(q = strchr(p, '/')) == '\0') which will crash with a null pointer dereference. Let's get the right version of this committed, not the wrong one! Oops. While here, reset PKGREVISION like I meant to do yesterday.
pkg_install-20240125: Extend `-m' syntax to allow OPSYS too.
- If there's no slash `/', take it all as ${MACHINE_ARCH}.
- If there is a slash, then split it by `/' and ` ' into:
${OPSYS}/${MACHINE_ARCH} ${OPSYS_VERSION}
For example:
NetBSD/aarch64 10.0
All the variables are restricted to lie in a safe set [a-zA-Z0-9._-],
so the notation can be extended later.
No change to existing syntax (no MACHINE_ARCH has `/' in it, or
anything outside the safe set), and `-m' is generally only used with
cross builds anyway, so this shouldn't break existing cross builds
and should have no impact on native builds.
Proposed on tech-pkg:
https://mail-index.netbsd.org/tech-pkg/2024/01/13/msg028825.html