Fri Jan 26 12:40:04 2024 UTC (122d)
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.


(riastradh)
diff -r1.15 -r1.16 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
diff -r1.238 -r1.239 pkgsrc/pkgtools/pkg_install/Makefile
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkg_install/files/add/parse_cross.c
diff -r1.190 -r1.191 pkgsrc/pkgtools/pkg_install/files/lib/version.h

cvs diff -r1.15 -r1.16 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk 2024/01/26 03:24:58 1.15
+++ pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk 2024/01/26 12:40:04 1.16
@@ -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
8PKGSRC_MESSAGE_RECIPIENTS?= # empty 8PKGSRC_MESSAGE_RECIPIENTS?= # empty
9 9
10.if !empty(PKGSRC_MESSAGE_RECIPIENTS) 10.if !empty(PKGSRC_MESSAGE_RECIPIENTS)
11USE_TOOLS+= mail 11USE_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
31PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info 31PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info
32LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm 32LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm
33 33
34NATIVE_PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN} 34NATIVE_PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN}
35NATIVE_PKG_ADD_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_add 35NATIVE_PKG_ADD_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_add
36NATIVE_PKG_ADMIN_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_admin 36NATIVE_PKG_ADMIN_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_admin
37NATIVE_PKG_CREATE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_create 37NATIVE_PKG_CREATE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_create
38NATIVE_PKG_DELETE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_delete 38NATIVE_PKG_DELETE_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_delete
39NATIVE_PKG_INFO_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_info 39NATIVE_PKG_INFO_CMD?= ${NATIVE_PKG_TOOLS_BIN}/pkg_info
40NATIVE_LINKFARM_CMD?= ${NATIVE_PKG_TOOLS_BIN}/linkfarm 40NATIVE_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"
44PKGTOOLS_REQD= 20240125 44PKGTOOLS_REQD= 20240126
45.elif !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss]) 45.elif !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss])
46PKGTOOLS_REQD= 20191008 46PKGTOOLS_REQD= 20191008
47.else 47.else
48PKGTOOLS_REQD= 20100914 48PKGTOOLS_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
51PKGTOOLS_VERSION_REQD= 20091115 51PKGTOOLS_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#
56PKGTOOLS_ENV?= # empty 56PKGTOOLS_ENV?= # empty
57 57

cvs diff -r1.238 -r1.239 pkgsrc/pkgtools/pkg_install/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/Makefile 2024/01/03 12:32:59 1.238
+++ pkgsrc/pkgtools/pkg_install/Makefile 2024/01/26 12:40:04 1.239
@@ -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
9PKGNAME= pkg_install-${VERSION} 9PKGNAME= pkg_install-${VERSION}
10PKGREVISION= 2 
11CATEGORIES= pkgtools 10CATEGORIES= pkgtools
12 11
13MAINTAINER= agc@NetBSD.org 12MAINTAINER= agc@NetBSD.org
14HOMEPAGE= https://www.pkgsrc.org/ 13HOMEPAGE= https://www.pkgsrc.org/
15COMMENT= Package management and administration tools for pkgsrc 14COMMENT= Package management and administration tools for pkgsrc
16LICENSE= modified-bsd 15LICENSE= modified-bsd
17 16
18BOOTSTRAP_PKG= yes 17BOOTSTRAP_PKG= yes
19SKIP_LICENSE_CHECK= yes 18SKIP_LICENSE_CHECK= yes
20 19
21CONFLICTS+= audit-packages-[0-9]* 20CONFLICTS+= audit-packages-[0-9]*
22 21
23GNU_CONFIGURE= yes 22GNU_CONFIGURE= yes

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkg_install/files/add/parse_cross.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/parse_cross.c 2024/01/26 03:24:49 1.1
+++ pkgsrc/pkgtools/pkg_install/files/add/parse_cross.c 2024/01/26 12:40:04 1.2
@@ -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 */
22void 22void
23parse_cross(const char *text, char **machine_arch, char **opsys, 23parse_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 */

cvs diff -r1.190 -r1.191 pkgsrc/pkgtools/pkg_install/files/lib/version.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/lib/version.h 2024/01/26 03:24:49 1.190
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h 2024/01/26 12:40:04 1.191
@@ -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_ */