NetBSD Problem Report #58464

From www@netbsd.org  Thu Jul 25 01:07:25 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A52681A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 25 Jul 2024 01:07:25 +0000 (UTC)
Message-Id: <20240725010720.948061A923B@mollari.NetBSD.org>
Date: Thu, 25 Jul 2024 01:07:20 +0000 (UTC)
From: fstd@pr0.tips
Reply-To: fstd@pr0.tips
To: gnats-bugs@NetBSD.org
Subject: sysutils/sandboxctl can't create sandbox if /usr/sbin/certctl is absent
X-Send-Pr-Version: www-1.0

>Number:         58464
>Category:       pkg
>Synopsis:       sysutils/sandboxctl can't create sandbox if /usr/sbin/certctl is absent
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    schmonz
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 25 01:10:00 +0000 2024
>Last-Modified:  Thu Jul 25 05:40:26 +0000 2024
>Originator:     Timo Buhrmester
>Release:        2024Q2
>Organization:
>Environment:
NetBSD kiwi.pr0.tips 9.4_STABLE NetBSD 9.4_STABLE (KIWIKERN) #0: Mon Jul 22 14:15:25 CEST 2024  build@kiwi.pr0.tips:/stor/netbsd/obj/sys/arch/amd64/compile/KIWIKERN amd64
>Description:
sysutils/sandboxctl fails to create the sandbox if the certctl program isn't available.  A recent commit (https://github.com/NetBSD/pkgsrc/commit/1c1a80da5944fa48162f413dab502ebacac70197) added a check for this binary, to be run if available:

+chroot "${root}" /bin/sh -c "[ -x /usr/sbin/certctl ] && /usr/sbin/certctl rehash"

but didn't consider that absence of certctl will make the overall command return a non-zero exit status, and being the last command in the function, will cause the function itself to return that.  Ultimately, sandbox creation fails due to this.
>How-To-Repeat:
don't have /usr/sbin/certctl in the sets that will be used to create the sandbox, and run sandboxctl create with a sandbox type "netbsd-release"
>Fix:
adding a || true to that chroot command is one way

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->schmonz
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Thu, 25 Jul 2024 05:40:26 +0000
Responsible-Changed-Why:
Over to committer of the change mentioned in the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.