-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:
parent
2300e25357
commit
4359838818
14
xCAT/postscripts/allowcred.awk
Executable file
14
xCAT/postscripts/allowcred.awk
Executable 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)
|
||||
}
|
@ -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
|
||||
}
|
||||
|
@ -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/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.ssh/id_rsa
|
||||
if ! grep "PRIVATE KEY" /root/.ssh/id_rsa > /dev/null 2>&1 ; then
|
||||
rm /root/.ssh/id_rsa
|
||||
|
Loading…
Reference in New Issue
Block a user