Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Nov 2020 18:40:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 251409] getprogname(3) does not work for rescue binaries
Message-ID:  <bug-251409-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251409

            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@FreeBSD.org
          Reporter: asomers@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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251409-227>