Page MenuHomeFreeBSD

Fix for boot(8) mistakenly stating that a `?` at the end of the path lists directory contents
AbandonedPublic

Authored by bcr on Apr 25 2026, 2:49 PM.
Tags
None
Referenced Files
F166870613: D56634.id.diff
Mon, Aug 17, 8:54 AM
F166846753: D56634.id.diff
Mon, Aug 17, 1:41 AM
Unknown Object (File)
Thu, Aug 13, 1:00 AM
Unknown Object (File)
Wed, Aug 12, 6:14 PM
Unknown Object (File)
Mon, Aug 10, 12:22 PM
Unknown Object (File)
Mon, Aug 10, 7:47 AM
Unknown Object (File)
Sat, Aug 8, 6:08 PM
Unknown Object (File)
Sat, Aug 8, 10:49 AM
Subscribers

Details

Reviewers
None
Group Reviewers
manpages
Summary

Patch submitted for bug 263278.

Test Plan
  1. Apply patch
  2. Check the man page
  3. Review or approve

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bcr requested review of this revision.Apr 25 2026, 2:49 PM

Now that lead me down the rabbit hole.
boot2 doesn't do this in boot2.c. It calls lookup() which is in ufsread.c in libsa. And that has this loop to parse the path (path is a cursor variable that walks through the path, s is the end of this segment of the path):

        for (;;) {
                if (*path == '/')
                        path++;
...
                for (s = path; *s && *s != '/'; s++);
...
                ls = *path == '?' && n == 1 && !*s;
...
                if ((dt = fsfind(name, &ino)) <= 0)
                        break;
                path = s;
        }

n == 1 means that ? is the only character (ignoring degenerate cases) after the / and is the last character of the string. So ? or /bin/? or /usr/local/lib/? will trigger ls == true. fsfind checks the global variable 'ls' and will just print all the files in that directory and return 0 so this loop terminates.

So I think the document as written is correct.

After @imp did some rabbit holing, abandon this review and close the bug attached as "works as intended". Thanks for taking a look, Warner!