pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/rc.subr/files Solaris su(1) does not have an ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3ff32636726f
branches:  trunk
changeset: 508273:3ff32636726f
user:      sketch <sketch%pkgsrc.org@localhost>
date:      Fri Feb 17 15:15:56 2006 +0000

description:
Solaris su(1) does not have an -m argument; re-work so that this can be
supported.

diffstat:

 pkgtools/rc.subr/files/rc.subr |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 509d240f5cb9 -r 3ff32636726f pkgtools/rc.subr/files/rc.subr
--- a/pkgtools/rc.subr/files/rc.subr    Fri Feb 17 14:43:49 2006 +0000
+++ b/pkgtools/rc.subr/files/rc.subr    Fri Feb 17 15:15:56 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.5 2004/10/11 19:32:14 tv Exp $
+# $NetBSD: rc.subr,v 1.6 2006/02/17 15:15:56 sketch Exp $
 #
 # Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -62,6 +62,7 @@
 
 _RCARG_psformat="-o pid,command"
 _RCARG_ps="-ax"
+_RCARG_su="-m"
 
 _osname=$(uname -s)
 case $_osname in
@@ -74,6 +75,7 @@
                _RCCMD_whoami="/usr/ucb/whoami"
                _RCARG_psformat="-o pid,comm"
                _RCARG_ps="-ef"
+               _RCARG_su=""
                ;;
        Interix)
                bsd_echo () {
@@ -609,7 +611,7 @@
 ${_RCCMD_chroot} $_chroot"
                                        if [ -n "$_user" ]; then
                                                _doit="\
-$_doit ${_RCCMD_su} -m $_user \
+$_doit ${_RCCMD_su} ${_RCARG_su} $_user \
 -c '${_RCCMD_sh} -c'"
                                        fi
                                        _doit="\
@@ -628,7 +630,7 @@
 ${_systrace:+${_RCCMD_systrace} $_systrace }\
 $command $rc_flags $command_args"
                                if [ -n "$_user" ]; then
-                                   _doit="${_RCCMD_su} -m $_user \
+                                   _doit="${_RCCMD_su} ${_RCARG_su} $_user \
                                        -c '${_RCCMD_sh} -c \"$_doit\"'"
                                fi
                        fi
@@ -668,7 +670,7 @@
                        ${_RCCMD_echo} "Stopping ${name}."
                        _doit="${_RCCMD_kill} -${sig_stop:-TERM} $rc_pid"
                        if [ -n "$_user" ]; then
-                               _doit="${_RCCMD_su} -m $_user \
+                               _doit="${_RCCMD_su} ${_RCARG_su} $_user \
                                    -c '${_RCCMD_sh} -c \"$_doit\"'"
                        fi
 
@@ -701,7 +703,7 @@
                        fi
                        _doit="${_RCCMD_kill} -${sig_reload:-HUP} $rc_pid"
                        if [ -n "$_user" ]; then
-                               _doit="${_RCCMD_su} -m $_user -c '${_RCCMD_sh} -c \"$_doit\"'"
+                               _doit="${_RCCMD_su} ${_RCARG_su} $_user -c '${_RCCMD_sh} -c \"$_doit\"'"
                        fi
                        if ! eval $_doit && [ -z "$rc_force" ]; then
                                return 1



Home | Main Index | Thread Index | Old Index