🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #85

[Bug 299336] mtree sometimes treats \052 (asterisk) in file names in verifications as a glob wildcard, likely [...] and ? notati...

#85
From: bugzilla-noreply
Date: Mon, 12 Oct 2026 15:39
121 lines
6425 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299336

            Bug ID: 299336
           Summary: mtree sometimes treats \052 (asterisk) in file names
                    in verifications as a glob wildcard, likely [...] and
                    ? notation too
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: marklmi26-fbsd@yahoo.com

The examples used for this note are limited to use of \052 (for asterisk)
but likely other glob pattern notations have the same sort of issue.

The discovery context involved usage by poudriere(-devel)'s check_leftovers 
and check_fs_violation and getting false positives. This report is in terms 
of such a context.

The description is in terms of hacks to the poudriere(-devel) common.sh
script to avoid some specific failures from using a wrong file for 
comparison. bulk -t of science/psi4 gets a false negative in 
check_fs_violation when science/libint2-psi4 is checked. It involves file 
names like:

# pkg info -l libint2-psi4 | grep 6-31\*g | sort
        /usr/local/share/libint/2.8.1/basis/6-311g**.g94
        /usr/local/share/libint/2.8.1/basis/6-311gss.g94
        /usr/local/share/libint/2.8.1/basis/6-31g**.g94
        /usr/local/share/libint/2.8.1/basis/6-31g*.g94
        /usr/local/share/libint/2.8.1/basis/6-31g.g94
        /usr/local/share/libint/2.8.1/basis/6-31gs.g94
        /usr/local/share/libint/2.8.1/basis/6-31gss.g94

The mtree.* files end up with \052 notation instead of the asterisk literals
but they still end up being handled in places as asterisk global pattern 
matching characters that sometimes do not pick the right file for comparison, 
leading to mismatched sizes in the example context. There were also
complaints about some of those files being missing.

A tested investigatory hack to avoid the problem via use of the notation 
[\052] that would translate to a glob pattern for a literal asterisk was:

# diff -u /mnt/usr/local/share/poudriere/common.sh
/usr/local/share/poudriere/common.sh
--- /mnt/usr/local/share/poudriere/common.sh    2026-06-07 18:52:42.088132000
-0700
+++ /usr/local/share/poudriere/common.sh        2026-10-12 07:22:07.622065000
-0700
@@ -5171,8 +5171,9 @@
        local mnt="${1}"

        ( cd "${mnt:?}" && \
+sed 's/\\052/[\052]/g' .p/mtree.preinst "${MNT_DATADIR:?}/mtree.preinst}" | \
            mtree -X "${MASTER_DATADIR:?}/mtree.preinstexclude${PORTTESTING}" \
-           -f "${MNT_DATADIR:?}/mtree.preinst" -p . ) | \
+           -f - -p . ) | \
            while mapfile_read_loop_redir l; do
                local changed read_again

@@ -5251,8 +5252,9 @@
        tmpfile=$(mktemp -t check_fs_violation)
        msg_n "${status_msg}..."
        ( cd "${mnt:?}" && \
+sed 's/\\052/[\052]/g' .p/mtree.prebuild
"${MNT_DATADIR:?}/mtree.${mtree_target}" | \
                mtree -X
"${MASTER_DATADIR:?}/mtree.${mtree_target}exclude${PORTTESTING}" \
-               -f "${MNT_DATADIR:?}/mtree.${mtree_target}" \
+               -f - \
                -p . ) >> "${tmpfile:?}"
        echo " done"


With that the bulk -t no longer reported the false positives because the
correct files were used and psi4 was not rejected.

(No claim that the hack handles all possible file names with asterisk
character(s)
well. Imagine if the original file name had a [*] : it would end up with
[[\052]]
which would not specify a correct glob for the original sequence.)

See: 

https://github.com/freebsd/poudriere/issues/843#issuecomment-6102113392

and the following comment about some example ports and installation files with
file
names that include text that is also glob pattern text. (Just a quick attempt
at
finding some of the examples.)


Given the apparently long history of the mtree validation behavior, avoiding
Astonishment Issues might mean that a mode-control command line argument
addition
would be appropriate if anything is done about the behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-299336-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 299336] mtree sometimes treats \052 (asterisk) in file names in
 verifications as a glob wildcard, likely [...] and ? notation too
Date: Mon, 12 Oct 2026 15:39:39 +0000
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-bugs@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-299336-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="47553"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1791819579;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=dfRygxpNcxpR4XugUhEoFmXmLOkoBXlwrtWwPWX5bXc=;
	b=LD9edRGLL3n8npOoX9fAT1629e1za+KGJ9E9B5sDLkVuZsPp0SpNYu0beHwvmzIlgVNxcr
	AwN9EBa8UmrU9a5RRW9qje5LwfXhOZQIniM729yFDDGkDXqTx994jL4IFJk/di9okQDA3S
	u4pUrpIJVTKXjbWl52d9arQUhl0RlKIMjiI4BP6X6hljIMki5/Kvt5TJW5GueWiJa6aPgc
	Wxv9Oh81f6QoJOSNsuOun07XwQW34s4wjqgVQZKJ3W75JV4YsT/nOeu4vQiq9Ue9anI69Z
	X2xYwHwXro2WjrmsfmJ6l7nkMy+5To+d/QcH4h2SBSobiI5CbHefNh48ra0qpg==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes