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
Unknown Object (File)
Fri, Jul 24, 9:04 PM
Unknown Object (File)
Thu, Jul 23, 2:49 AM
Unknown Object (File)
Mon, Jul 20, 3:16 PM
Unknown Object (File)
Sat, Jul 11, 5:06 PM
Unknown Object (File)
Jun 23 2026, 1:51 AM
Unknown Object (File)
Jun 3 2026, 7:21 PM
Unknown Object (File)
May 30 2026, 2:14 AM
Unknown Object (File)
May 27 2026, 4:18 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!