-Fix credentials plugin to not block install if not allowed

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1220 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-04-29 13:57:57 +00:00
parent 2300e25357
commit 4359838818
3 changed files with 16 additions and 9 deletions

14
xCAT/postscripts/allowcred.awk Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/awk -f
BEGIN {
listener = "/inet/tcp/300/0/0"
quit = "no"
while (match(quit,"no") && (listener |& getline) > 0) {
if (match($0,"CREDOKBYYOU?")) {
print "CREDOKBYME" |& listener
quit="yes"
}
}
close(listener)
}

View File

@ -1,6 +1,5 @@
#!/usr/bin/awk -f
BEGIN {
listener = "/inet/tcp/300/0/0"
server = "/inet/tcp/0/127.0.0.1/400"
quit = "no"
@ -11,14 +10,6 @@ BEGIN {
print " <arg>"ARGV[1]"</arg>" |& server
print "</xcatrequest>" |& server
while (match(quit,"no") && (listener |& getline) > 0) {
if (match($0,"CREDOKBYYOU?")) {
print "CREDOKBYME" |& listener
quit="yes"
}
}
close(listener)
while (server |& getline) {
print $0
}

View File

@ -56,6 +56,8 @@ sleep 1
umask 0077
mkdir -p /root/.ssh/
allowcred.awk &
sleep 1
getcredentials.awk ssh_root_key | grep -v '<'|sed -e 's/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /root/.ssh/id_rsa
if ! grep "PRIVATE KEY" /root/.ssh/id_rsa > /dev/null 2>&1 ; then
rm /root/.ssh/id_rsa