From c34f2d22f9fa0096be742faeccd4385817d60fb3 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 27 Apr 2011 07:29:00 +0000 Subject: [PATCH] defect 3289489: fixed the issue that this awk file hang when no entry in the policy table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9410 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/getcredentials.awk | 5 ++++- xCAT/postscripts/getpostscript.awk | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 781dfc659..92d98a5d8 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk -f BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" + server = "openssl s_client -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" } else { server = "/inet/tcp/0/127.0.0.1/400" } @@ -16,6 +16,9 @@ BEGIN { print "" |& server while (server |& getline) { + if (match($0,/^\s*")) { quit = "yes" diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index 14be03f59..29c40921f 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk -f BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" + server = "openssl s_client -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" } else { server = "/inet/tcp/0/127.0.0.1/400" } @@ -15,7 +15,9 @@ BEGIN { print "" |& server while (server |& getline) { - print $0 + if (match($0,/^\s*")) { quit = "yes" }