summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornelson%bolyard.com <devnull@localhost>2007-05-07 23:28:46 +0000
committernelson%bolyard.com <devnull@localhost>2007-05-07 23:28:46 +0000
commitffd4bd8fd59de15152be7552847deace5c17be1f (patch)
tree96fb703c50760080391f9d61150477593fb94b50
parentdbb4678691f859b39011636877cfec62494913d2 (diff)
downloadnss-hg-ffd4bd8fd59de15152be7552847deace5c17be1f.tar.gz
Bug 370082 - init.sh tweak for non-linux platforms, r=nelson,alexei
Patch contributed by Martynas Venckus <martynas@openbsd.org>.
-rw-r--r--security/nss/tests/common/init.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/security/nss/tests/common/init.sh b/security/nss/tests/common/init.sh
index dad9ab016..326a8b7d2 100644
--- a/security/nss/tests/common/init.sh
+++ b/security/nss/tests/common/init.sh
@@ -219,9 +219,18 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
mkdir -p ${TESTDIR}
fi
-#HOST and DOMSUF are needed for the server cert
+#HOST and DOMSUF are needed for the server cert
+
+ DOMAINNAME=`which domainname`
+ if [ -z "${DOMSUF}" -a $? -eq 0 -a -n "${DOMAINNAME}" ]; then
+ DOMSUF=`domainname`
+ fi
+
case $HOST in
*\.*)
+ if [ -z "${DOMSUF}" ]; then
+ DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"`
+ fi
HOST=`echo $HOST | sed -e "s/\..*//"`
;;
?*)
@@ -230,6 +239,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
HOST=`uname -n`
case $HOST in
*\.*)
+ if [ -z "${DOMSUF}" ]; then
+ DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"`
+ fi
HOST=`echo $HOST | sed -e "s/\..*//"`
;;
?*)
@@ -243,12 +255,10 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
esac
if [ -z "${DOMSUF}" ]; then
- DOMSUF=`domainname`
- if [ -z "${DOMSUF}" ]; then
- echo "$SCRIPTNAME: Fatal DOMSUF env. variable is not defined."
- exit 1 #does not need to be Exit, very early in script
- fi
+ echo "$SCRIPTNAME: Fatal DOMSUF env. variable is not defined."
+ exit 1 #does not need to be Exit, very early in script
fi
+
#HOSTADDR was a workaround for the dist. stress test, and is probably
#not needed anymore (purpose: be able to use IP address for the server
#cert instead of PC name which was not in the DNS because of dyn IP address