[Bug 251409] getprogname(3) does not work for rescue binaries

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Nov 26 18:40:47 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251409

            Bug ID: 251409
           Summary: getprogname(3) does not work for rescue binaries
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: asomers at FreeBSD.org

Some utilities (e.g. reboot, ping, fsck_ffs) install multiple hard links and
use getprogname(3) to tell which was invoked, triggering different behavior
based on the name of the invoked link.  However, when built as part of
rescue(8), getprogname doesn't work.  It always returns the same name,
regardless of how the binary was invoked.  For example:

> /rescue/fsck_ffs --help
fsck_ffs: illegal option -- -
usage: /rescue/iscsid [-BCdEFfnpRrSyZ] [-b block] [-c level] [-m mode]
filesystem ...

Notice that the usage string contains "/rescue/iscsid", which is obviously not
correct.

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


More information about the freebsd-bugs mailing list