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.diff -r1.15 -r1.16 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
(riastradh)
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: pkgformat-vars.mk,v 1.15 2024/01/26 03:24:58 riastradh Exp $ | 1 | # $NetBSD: pkgformat-vars.mk,v 1.16 2024/01/26 12:40:04 riastradh Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment is included indirectly by bsd.prefs.mk and | 3 | # This Makefile fragment is included indirectly by bsd.prefs.mk and | |
4 | # defines some variables which must be defined earlier than where | 4 | # defines some variables which must be defined earlier than where | |
5 | # pkgformat.mk is included. | 5 | # pkgformat.mk is included. | |
6 | # | 6 | # | |
7 | 7 | |||
8 | PKGSRC_MESSAGE_RECIPIENTS?= # empty | 8 | PKGSRC_MESSAGE_RECIPIENTS?= # empty | |
9 | 9 | |||
10 | .if !empty(PKGSRC_MESSAGE_RECIPIENTS) | 10 | .if !empty(PKGSRC_MESSAGE_RECIPIENTS) | |
11 | USE_TOOLS+= mail | 11 | USE_TOOLS+= mail | |
12 | .endif | 12 | .endif | |
13 | 13 | |||
14 | .if defined(PKG_PRESERVE) | 14 | .if defined(PKG_PRESERVE) | |
@@ -31,27 +31,27 @@ PKG_DELETE_CMD?= ${PKG_TOOLS_BIN}/pkg_de | @@ -31,27 +31,27 @@ PKG_DELETE_CMD?= ${PKG_TOOLS_BIN}/pkg_de | |||
31 | PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info | 31 | PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info | |
32 | LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm | 32 | LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm | |
33 | 33 | |||
34 | NATIVE_PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN} | 34 | NATIVE_PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN} | |
35 | NATIVE_PKG_ADD_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_add | 35 | NATIVE_PKG_ADD_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_add | |
36 | NATIVE_PKG_ADMIN_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_admin | 36 | NATIVE_PKG_ADMIN_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_admin | |
37 | NATIVE_PKG_CREATE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_create | 37 | NATIVE_PKG_CREATE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_create | |
38 | NATIVE_PKG_DELETE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_delete | 38 | NATIVE_PKG_DELETE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_delete | |
39 | NATIVE_PKG_INFO_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_info | 39 | NATIVE_PKG_INFO_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_info | |
40 | NATIVE_LINKFARM_CMD?= ${NATIVE_PKG_TOOLS_BIN}/linkfarm | 40 | NATIVE_LINKFARM_CMD?= ${NATIVE_PKG_TOOLS_BIN}/linkfarm | |
41 | 41 | |||
42 | # Latest versions of tools required for correct pkgsrc operation. | 42 | # Latest versions of tools required for correct pkgsrc operation. | |
43 | .if ${USE_CROSS_COMPILE:tl} == "yes" | 43 | .if ${USE_CROSS_COMPILE:tl} == "yes" | |
44 | PKGTOOLS_REQD= 20240125 | 44 | PKGTOOLS_REQD= 20240126 | |
45 | .elif !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss]) | 45 | .elif !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss]) | |
46 | PKGTOOLS_REQD= 20191008 | 46 | PKGTOOLS_REQD= 20191008 | |
47 | .else | 47 | .else | |
48 | PKGTOOLS_REQD= 20100914 | 48 | PKGTOOLS_REQD= 20100914 | |
49 | .endif | 49 | .endif | |
50 | # Latest version of pkg_install required to extract packages | 50 | # Latest version of pkg_install required to extract packages | |
51 | PKGTOOLS_VERSION_REQD= 20091115 | 51 | PKGTOOLS_VERSION_REQD= 20091115 | |
52 | 52 | |||
53 | # Environment used when invoking package tools. This is used to pass | 53 | # Environment used when invoking package tools. This is used to pass | |
54 | # environment variables to the package install and deinstall scripts. | 54 | # environment variables to the package install and deinstall scripts. | |
55 | # | 55 | # | |
56 | PKGTOOLS_ENV?= # empty | 56 | PKGTOOLS_ENV?= # empty | |
57 | 57 |
@@ -1,23 +1,22 @@ | @@ -1,23 +1,22 @@ | |||
1 | # $NetBSD: Makefile,v 1.238 2024/01/03 12:32:59 gdt Exp $ | 1 | # $NetBSD: Makefile,v 1.239 2024/01/26 12:40:04 riastradh Exp $ | |
2 | 2 | |||
3 | # Notes to package maintainers: | 3 | # Notes to package maintainers: | |
4 | # | 4 | # | |
5 | # Updating this package does not automatically necessitate bumping | 5 | # Updating this package does not automatically necessitate bumping | |
6 | # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical | 6 | # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical | |
7 | # change in the pkg_* tools that pkgsrc relies on for proper operation. | 7 | # change in the pkg_* tools that pkgsrc relies on for proper operation. | |
8 | 8 | |||
9 | PKGNAME= pkg_install-${VERSION} | 9 | PKGNAME= pkg_install-${VERSION} | |
10 | PKGREVISION= 2 | |||
11 | CATEGORIES= pkgtools | 10 | CATEGORIES= pkgtools | |
12 | 11 | |||
13 | MAINTAINER= agc@NetBSD.org | 12 | MAINTAINER= agc@NetBSD.org | |
14 | HOMEPAGE= https://www.pkgsrc.org/ | 13 | HOMEPAGE= https://www.pkgsrc.org/ | |
15 | COMMENT= Package management and administration tools for pkgsrc | 14 | COMMENT= Package management and administration tools for pkgsrc | |
16 | LICENSE= modified-bsd | 15 | LICENSE= modified-bsd | |
17 | 16 | |||
18 | BOOTSTRAP_PKG= yes | 17 | BOOTSTRAP_PKG= yes | |
19 | SKIP_LICENSE_CHECK= yes | 18 | SKIP_LICENSE_CHECK= yes | |
20 | 19 | |||
21 | CONFLICTS+= audit-packages-[0-9]* | 20 | CONFLICTS+= audit-packages-[0-9]* | |
22 | 21 | |||
23 | GNU_CONFIGURE= yes | 22 | GNU_CONFIGURE= yes |
@@ -1,50 +1,50 @@ | @@ -1,50 +1,50 @@ | |||
1 | /* $NetBSD: parse_cross.c,v 1.1 2024/01/26 03:24:49 riastradh Exp $ */ | 1 | /* $NetBSD: parse_cross.c,v 1.2 2024/01/26 12:40:04 riastradh Exp $ */ | |
2 | 2 | |||
3 | #if HAVE_CONFIG_H | 3 | #if HAVE_CONFIG_H | |
4 | #include "config.h" | 4 | #include "config.h" | |
5 | #endif | 5 | #endif | |
6 | #include <nbcompat.h> | 6 | #include <nbcompat.h> | |
7 | #if HAVE_SYS_CDEFS_H | 7 | #if HAVE_SYS_CDEFS_H | |
8 | #include <sys/cdefs.h> | 8 | #include <sys/cdefs.h> | |
9 | #endif | 9 | #endif | |
10 | __RCSID("$NetBSD: parse_cross.c,v 1.1 2024/01/26 03:24:49 riastradh Exp $"); | 10 | __RCSID("$NetBSD: parse_cross.c,v 1.2 2024/01/26 12:40:04 riastradh Exp $"); | |
11 | 11 | |||
12 | #include "lib.h" | 12 | #include "lib.h" | |
13 | #include "add.h" | 13 | #include "add.h" | |
14 | 14 | |||
15 | /* | 15 | /* | |
16 | * ${OPSYS}/${MACHINE_ARCH} ${OS_VERSION} | 16 | * ${OPSYS}/${MACHINE_ARCH} ${OS_VERSION} | |
17 | * | 17 | * | |
18 | * or just | 18 | * or just | |
19 | * | 19 | * | |
20 | * ${MACHINE_ARCH} | 20 | * ${MACHINE_ARCH} | |
21 | */ | 21 | */ | |
22 | void | 22 | void | |
23 | parse_cross(const char *text, char **machine_arch, char **opsys, | 23 | parse_cross(const char *text, char **machine_arch, char **opsys, | |
24 | char **os_version) | 24 | char **os_version) | |
25 | { | 25 | { | |
26 | static const char safeset[] = /* XXX */ | 26 | static const char safeset[] = /* XXX */ | |
27 | "abcdefghijklmnopqrstuvwxyz" | 27 | "abcdefghijklmnopqrstuvwxyz" | |
28 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | 28 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
29 | "0123456789" | 29 | "0123456789" | |
30 | "-._"; | 30 | "-._"; | |
31 | char *copy = xstrdup(text); | 31 | char *copy = xstrdup(text); | |
32 | char *p = copy, *q, *r; | 32 | char *p = copy, *q, *r; | |
33 | 33 | |||
34 | /* | 34 | /* | |
35 | * If there's no /, treat it as a single MACHINE_ARCH. | 35 | * If there's no /, treat it as a single MACHINE_ARCH. | |
36 | */ | 36 | */ | |
37 | if (*(q = strchr(p, '/')) == '\0') { | 37 | if ((q = strchr(p, '/')) == NULL) { | |
38 | *machine_arch = copy; | 38 | *machine_arch = copy; | |
39 | *opsys = NULL; | 39 | *opsys = NULL; | |
40 | *os_version = NULL; | 40 | *os_version = NULL; | |
41 | } else { | 41 | } else { | |
42 | /* | 42 | /* | |
43 | * NUL-terminate at the slash so p := text[0..slash) | 43 | * NUL-terminate at the slash so p := text[0..slash) | |
44 | * is the OPSYS. | 44 | * is the OPSYS. | |
45 | */ | 45 | */ | |
46 | *q++ = '\0'; | 46 | *q++ = '\0'; | |
47 | 47 | |||
48 | /* | 48 | /* | |
49 | * If there's no SPC, fail. | 49 | * If there's no SPC, fail. | |
50 | */ | 50 | */ |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: version.h,v 1.190 2024/01/26 03:24:49 riastradh Exp $ */ | 1 | /* $NetBSD: version.h,v 1.191 2024/01/26 12:40:04 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Thomas Klausner. All rights reserved. | 4 | * Copyright (c) 2001 Thomas Klausner. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -17,16 +17,16 @@ | @@ -17,16 +17,16 @@ | |||
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
25 | */ | 25 | */ | |
26 | 26 | |||
27 | #ifndef _INST_LIB_VERSION_H_ | 27 | #ifndef _INST_LIB_VERSION_H_ | |
28 | #define _INST_LIB_VERSION_H_ | 28 | #define _INST_LIB_VERSION_H_ | |
29 | 29 | |||
30 | #define PKGTOOLS_VERSION 20240125 | 30 | #define PKGTOOLS_VERSION 20240126 | |
31 | 31 | |||
32 | #endif /* _INST_LIB_VERSION_H_ */ | 32 | #endif /* _INST_LIB_VERSION_H_ */ |