2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 01:56:39 +00:00

Merge pull request #6854 from cxhong/nice

Get the correct path for nice command
This commit is contained in:
besawn 2020-10-09 16:14:30 -04:00 committed by GitHub
commit 6ce9e1b891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 7 deletions

View File

@ -128,7 +128,12 @@ GetSyncInfo () {
xCATCmd () {
# $1 is the xCAT server
# $2 is the command
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /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 "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /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
}

View File

@ -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"

View File

@ -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"

View File

@ -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"