Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Nov 2020 11:16:28 -0700
From:      Scott Long <scottl@samsco.org>
To:        Brandon Bergren <bdragon@FreeBSD.org>
Cc:        Scott Long <scottl@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r367687 - in head: sbin/nvmecontrol usr.sbin/mailwrapper usr.sbin/pkg
Message-ID:  <F998EF73-13DC-428F-A64B-F31E72602A9C@samsco.org>
In-Reply-To: <f70eeaa9-1aa4-4fcf-a958-2c780fe9555d@www.fastmail.com>
References:  <202011141801.0AEI1FCM000287@repo.freebsd.org> <f70eeaa9-1aa4-4fcf-a958-2c780fe9555d@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I fixed this in r367702, sorry for the breakage.

Scott


> On Nov 15, 2020, at 11:12 AM, Brandon Bergren <bdragon@FreeBSD.org> wrote:
> 
>> --- head/usr.sbin/pkg/pkg.c	Sat Nov 14 17:57:50 2020	(r367686)
>> +++ head/usr.sbin/pkg/pkg.c	Sat Nov 14 18:01:14 2020	(r367687)
>> @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
>> #include <errno.h>
>> #include <fcntl.h>
>> #include <fetch.h>
>> +#include <libutil.h>
>> #include <paths.h>
>> #include <stdbool.h>
>> #include <stdlib.h>
>> @@ -1037,6 +1038,7 @@ main(int argc, char *argv[])
>> {
>> 	char pkgpath[MAXPATHLEN];
>> 	const char *pkgarg;
>> +	size_t len;
>> 	int i;
>> 	bool bootstrap_only, force, yes;
>> 
>> @@ -1045,8 +1047,11 @@ main(int argc, char *argv[])
>> 	pkgarg = NULL;
>> 	yes = false;
>> 
>> -	snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg",
>> -	    getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE);
>> +	if ((len = getlocalbase(pkgpath, MAXPATHLEN)) != 0) {
>> +		fprintf(stderr, "Cannot determine local path\n");
>> +		exit(EXIT_FAILURE);
>> +	}
> 
> This logic is broken, it is failing on kernels that DO have user.localbase.
> 
>> +	strlcat(pkgpath, "/sbin/pkg", MAXPATHLEN - len);
>> 
>> 	if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) {
>> 		bootstrap_only = true;
>> 
> 
> -- 
>  Brandon Bergren
>  bdragon@FreeBSD.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F998EF73-13DC-428F-A64B-F31E72602A9C>