diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 8aa5dac22..deaadde40 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -128,7 +128,12 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + if [ -f "/usr/bin/nice" ]; then + RANDOMBYTES="-rand /usr/bin/nice" + else + RANDOMBYTES="" + fi + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} ${RANDOMBYTES} 2>/dev/null } diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 67300becf..0cbf2fdfb 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { - server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index 985b34dcb..e4ffd3006 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index c9af5345b..0c85ae262 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400"