pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/47371: pkgsrc/pkgtools/rc.subr uses optional tools (whoami) [at least in solaris zones]



>Number:         47371
>Category:       pkg
>Synopsis:       pkgsrc/pkgtools/rc.subr uses optional tools (whoami) [at least 
>in solaris zones]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 27 17:40:00 +0000 2012
>Originator:     Richard PALO
>Release:        pkgsrc trunk
>Organization:
>Environment:
SunOS devzoneX 5.11 oi_151a7 i86pc i386 i86pc Solaris

>Description:
using pkgtools/rc.subr on a NG solaris (illumos) zone, I noticed the following:
richard@devzoneX:~/src/pkgsrc$ pfexec /etc/rc.d/pgsql status
/etc/rc.subr: line 525: /usr/bin/whoami: No such file or directory
pgsql is not running.

richard@devzoneX:~/src/pkgsrc$ pkg search whoami
INDEX      ACTION VALUE              PACKAGE
basename   file   usr/ucb/whoami     pkg:/compatibility/ucb@0.5.11-0.151.1.7
basename   file   usr/bin/whoami     pkg:/file/gnu-coreutils@8.5-0.151.1.7
basename   file   usr/gnu/bin/whoami pkg:/file/gnu-coreutils@8.5-0.151.1.7
richard@devzoneX:~/src/pkgsrc$ find /usr -name whoami
richard@devzoneX:~/src/pkgsrc$ find /opt/pkg -name whoami
/opt/pkg/gnu/bin/whoami
find: /opt/pkg/scgi_temp: Permission denied
richard@devzoneX:~/src/pkgsrc$ grep whoami sysutils/coreutils/PLIST
bin/gwhoami
gnu/bin/whoami
gnu/man/man1/whoami.1
man/man1/gwhoami.1

Indeed, rc.subr presumes that whoami is core installed, even makes some 
somewhat questionable presumptions here:

...
_RCCMD_whoami="/usr/bin/whoami"
...
case $_osname in
        SunOS)
                _RCCMD_chown="/bin/chown"
#               _RCCMD_ci="/usr/bin/ci"                 # not in Solaris 9
#               _RCCMD_co="/usr/bin/co"                 # not in Solaris 9
#               _RCCMD_systrace="/bin/systrace"         # not in Solaris 9
                _RCARG_psformat="-o pid,comm"
                _RCARG_ps="-ef"
                _RCARG_su=""
                if [ "$_osrelease" = "5.11" ]; then
                        bsd_echo () {
                                if [ "$1" = "-n" ]; then
                                        shift; echo "$@\c"
                                else
                                        echo "$@"
                                fi
                        }
                        _RCCMD_echo="bsd_echo"
                else
                        _RCCMD_echo="/usr/ucb/echo"     # not in Solaris 11
                        _RCCMD_whoami="/usr/ucb/whoami" # not in Solaris 11
                fi
                ;;


perhaps sysutils/coreutils can come to the rescue if the core system is missing 
some required utilities.
>How-To-Repeat:
install a minimal non-global zone in OpenIndiana

do not install in addition pkg:/compatibility/ucb nor pkg:/file/gnu-coreutils

execute /etc/rc.d/<daemon> status
where the script uses the rc.subr default "status" command.
>Fix:



Home | Main Index | Thread Index | Old Index