changeset 12843:dc4b386c586d

6968467 native wrapping should warn of missing cmd
author <gerald.jelinek@sun.com>
date Thu, 15 Jul 2010 10:59:37 -0600
parents 30a30d80e478
children f4172e28e09f
files usr/src/lib/brand/solaris10/cmd/s10_isaexec_wrapper.sh usr/src/lib/brand/solaris10/cmd/s10_python_wrapper.sh usr/src/lib/brand/solaris10/zone/s10_boot.ksh
diffstat 3 files changed, 24 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/brand/solaris10/cmd/s10_isaexec_wrapper.sh	Thu Jul 15 07:50:26 2010 -0700
+++ b/usr/src/lib/brand/solaris10/cmd/s10_isaexec_wrapper.sh	Thu Jul 15 10:59:37 2010 -0600
@@ -40,12 +40,6 @@
 # If this script gets setup with a mode that makes it suid, then things won't
 # work because the script will be running with the incorrect name.
 #
-# The code in s10_native() which which cleans up the initial arguments for
-# a wrapped command relies on a well formatted argument list.  It assumes that
-# the -e options immediately follow the native ld.so.1 command and that these
-# options are contiguous with no extra spaces.  If additional non -e ld.so.1
-# options are added here, that code must also be updated.
-#
 n=/.SUNWnative
 
 bname=`/usr/bin/basename $0`
@@ -56,6 +50,13 @@
 LC_ALL=C /usr/bin/file $n/$dname/$bname | /usr/bin/grep "64-bit" \
     >/dev/null && arch64=/64/
 
+# This wrapper is running in the S10 zone so there is no L10N for the
+# following error msg.
+if [ ! -f $n$dname/$bname ]; then
+	echo "Error: \"$dname/$bname\" is not installed in the global zone"
+	exit 1
+fi
+
 exec $n/usr/lib/brand/solaris10/s10_native \
     $n/lib${arch64}ld.so.1 \
     -e LD_NOENVIRON=1 \
--- a/usr/src/lib/brand/solaris10/cmd/s10_python_wrapper.sh	Thu Jul 15 07:50:26 2010 -0700
+++ b/usr/src/lib/brand/solaris10/cmd/s10_python_wrapper.sh	Thu Jul 15 10:59:37 2010 -0600
@@ -35,18 +35,19 @@
 # bit linker and /.SUNWnative/lib/64/ld.so.1 as our 64-bit linker.
 # For convience we define "n" to be the native path prefix.
 #
-# The code in s10_native() which which cleans up the initial arguments for
-# a wrapped command relies on a well formatted argument list.  It assumes that
-# the -e options immediately follow the native ld.so.1 command and that these
-# options are contiguous with no extra spaces.  If additional non -e ld.so.1
-# options are added here, that code must also be updated.
-#
 pyname=$0
 n=/.SUNWnative
 
 PYTHONPATH=/.SUNWnative/usr/lib/python2.4/vendor-packages
 export PYTHONPATH
 
+# This wrapper is running in the S10 zone so there is no L10N for the
+# following error msg.
+if [ ! -f $n$pyname ]; then
+	echo "Error: \"$pyname\" is not installed in the global zone"
+	exit 1
+fi
+
 exec $n/usr/lib/brand/solaris10/s10_native \
     $n/lib/ld.so.1 \
     -e LD_NOENVIRON=1 \
--- a/usr/src/lib/brand/solaris10/zone/s10_boot.ksh	Thu Jul 15 07:50:26 2010 -0700
+++ b/usr/src/lib/brand/solaris10/zone/s10_boot.ksh	Thu Jul 15 10:59:37 2010 -0600
@@ -33,6 +33,8 @@
 ZONEPATH=$2
 ZONEROOT=$ZONEPATH/root
 
+w_missing=$(gettext "Warning: \"%s\" is not installed in the global zone")
+
 arch=`uname -p`
 if [ "$arch" = "i386" ]; then
 	ARCH32=i86
@@ -74,6 +76,8 @@
 #
 replace_with_native() {
 	path_dname=$ZONEROOT/`dirname $1`
+
+	[ ! -f $1 ] && printf "$w_missing" "$1"
 	if [ ! -h $path_dname -a -d $path_dname ]; then
 		safe_replace $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3 \
 		    remove
@@ -82,6 +86,9 @@
 
 replace_with_native_py() {
 	path_dname=$ZONEROOT/`dirname $1`
+
+	[ ! -f $1 ] && printf "$w_missing" "$1"
+
 	if [ ! -h $path_dname -a -d $path_dname ]; then
 		safe_replace $ZONEROOT/$1 $BRANDDIR/s10_python_wrapper $2 $3 \
 		    remove
@@ -89,6 +96,9 @@
 }
 
 wrap_with_native() {
+
+	[ ! -f $1 ] && printf "$w_missing" "$1"
+
 	safe_wrap $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3
 }
 
@@ -175,7 +185,6 @@
 replace_with_native /sbin/zpool 0555 root:bin
 replace_with_native /usr/lib/fs/ufs/quota 0555 root:bin
 replace_with_native /usr/lib/fs/zfs/fstyp 0555 root:bin
-replace_with_native /usr/lib/fs/zfs/zfsdle 0555 root:bin
 replace_with_native /usr/lib/zfs/availdevs 0555 root:bin
 replace_with_native /usr/sbin/df 0555 root:bin
 replace_with_native /usr/sbin/zstreamdump 0555 root:bin