mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	Ensure mypostscript has permission 700 (#3847)
Only root needs to run this script
This commit is contained in:
		@@ -77,7 +77,7 @@ do
 | 
			
		||||
         done
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
         chmod +x /xcatpost/mypostscript
 | 
			
		||||
         chmod 700 /xcatpost/mypostscript
 | 
			
		||||
			GOTIT=1
 | 
			
		||||
			break
 | 
			
		||||
		fi
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ do
 | 
			
		||||
            done
 | 
			
		||||
 | 
			
		||||
            # Make executable
 | 
			
		||||
            chmod +x /xcatpost/mypostscript
 | 
			
		||||
            chmod 700 /xcatpost/mypostscript
 | 
			
		||||
            GOTIT=1
 | 
			
		||||
            break
 | 
			
		||||
        fi
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ do
 | 
			
		||||
            done
 | 
			
		||||
 | 
			
		||||
            # Make executable
 | 
			
		||||
            chmod +x /xcatpost/mypostscript
 | 
			
		||||
            chmod 700 /xcatpost/mypostscript
 | 
			
		||||
            GOTIT=1
 | 
			
		||||
            break
 | 
			
		||||
        fi
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ do
 | 
			
		||||
            done
 | 
			
		||||
         
 | 
			
		||||
            # Make executable
 | 
			
		||||
            chmod +x /tmp/mypostscript
 | 
			
		||||
            chmod 700 /tmp/mypostscript
 | 
			
		||||
            GOTIT=1
 | 
			
		||||
            break
 | 
			
		||||
        fi
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ do
 | 
			
		||||
            done
 | 
			
		||||
         
 | 
			
		||||
            # Make executable
 | 
			
		||||
            chmod +x /tmp/mypostscript
 | 
			
		||||
            chmod 700 /tmp/mypostscript
 | 
			
		||||
            GOTIT=1
 | 
			
		||||
            break
 | 
			
		||||
        fi
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,7 @@ if [ "$?" = "0" ]; then
 | 
			
		||||
        msgutil_r "$MASTER_IP" "debug" "precreated mypostscript downloaded successfully" "/var/log/xcat/xcat.log"
 | 
			
		||||
    fi
 | 
			
		||||
    mv /xcatpost/mypostscript.$NODE /xcatpost/mypostscript
 | 
			
		||||
    chmod +x /xcatpost/mypostscript
 | 
			
		||||
    chmod 700 /xcatpost/mypostscript
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
USEOPENSSLFORXCAT=1 #Though this is the only method going forward, flag to allow backward compatibility with 2.2 generated netboot images
 | 
			
		||||
@@ -404,7 +404,7 @@ if [ \"\$return_value\" -ne \"0\" ]; then
 | 
			
		||||
fi
 | 
			
		||||
" >> /xcatpost/mypostscript
 | 
			
		||||
 | 
			
		||||
chmod 755 /xcatpost/mypostscript
 | 
			
		||||
chmod 700 /xcatpost/mypostscript
 | 
			
		||||
 | 
			
		||||
export ARCH=#TABLE:nodetype:THISNODE:arch#
 | 
			
		||||
export CONSOLEPORT=#TABLEBLANKOKAY:nodehm:THISNODE:serialport#
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ fi
 | 
			
		||||
 | 
			
		||||
#config static ip address for mgt interface
 | 
			
		||||
echo './confignics -s' >> ./mypostscript
 | 
			
		||||
chmod +x ./mypostscript
 | 
			
		||||
chmod 700 ./mypostscript
 | 
			
		||||
./mypostscript
 | 
			
		||||
rc=$?
 | 
			
		||||
if [ "$rc" != "0" ]; then
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,7 @@ cat /tmp/resp.xml | egrep  '<data>' | sed  -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed
 | 
			
		||||
#will be supported if there is requrement on this
 | 
			
		||||
sed -i -e "/# postscripts-start-here/,$ d" /xcatpost/mypostscript
 | 
			
		||||
 | 
			
		||||
chmod 700 /xcatpost/mypostscript
 | 
			
		||||
rm -f /tmp/req.xml
 | 
			
		||||
rm -f /tmp/resp.xml
 | 
			
		||||
exit 0
 | 
			
		||||
 
 | 
			
		||||
@@ -963,7 +963,7 @@ if [ "$MODE" = "1" ] || [ "$MODE" = "2" ] || [ "$MODE" = "5" ]; then
 | 
			
		||||
  echo "exit \$return_value" >> /$xcatpost/mypostscript
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
chmod +x /$xcatpost/mypostscript
 | 
			
		||||
chmod 700 /$xcatpost/mypostscript
 | 
			
		||||
if [ -x /$xcatpost/mypostscript ];then
 | 
			
		||||
   echolog "debug" "running /$xcatpost/mypostscript"   
 | 
			
		||||
   /$xcatpost/mypostscript
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user