[Fusionforge-commits] r11147 - trunk/tests/openvz

Christian Bayle cbayle at libremir.placard.fr.eu.org
Fri Oct 22 18:17:56 CEST 2010


Author: cbayle
Date: 2010-10-22 18:17:56 +0200 (Fri, 22 Oct 2010)
New Revision: 11147

Modified:
   trunk/tests/openvz/Makefile
Log:
 A bit of hardening


Modified: trunk/tests/openvz/Makefile
===================================================================
--- trunk/tests/openvz/Makefile	2010-10-22 16:12:21 UTC (rev 11146)
+++ trunk/tests/openvz/Makefile	2010-10-22 16:17:56 UTC (rev 11147)
@@ -61,7 +61,7 @@
 	##echo "debian6.local" > $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/etc/hostname
 	#
 	[ -c $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/dev/ptmx ] || chroot $(VZPRIVATEDIR)/$(VEIDDEBTEMP) /bin/mknod /dev/ptmx c 5 2
-	mkdir -p $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/root/.ssh
+	[ -d $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/root/.ssh ] || mkdir -p $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/root/.ssh
 	cp $(SSHPUBKEY) $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/root/.ssh/authorized_keys
 	cp ssh/ssh_host_* $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/etc/ssh/
 	cd $(VZPRIVATEDIR)/$(VEIDDEBTEMP)/ ; tar --numeric-owner -zcf $(VZTEMPLATEDIR)/cache/debian-$(DEBVERS)-$(ARCH)-minimal.tar.gz .
@@ -100,7 +100,7 @@
 	touch $(VZPRIVATEDIR)/$(VEIDCENTEMP)/etc/fstab
 	grep -q devpts $(VZPRIVATEDIR)/$(VEIDCENTEMP)/etc/fstab || \
 		echo "none /dev/pts devpts mode=0620 0 0" >> $(VZPRIVATEDIR)/$(VEIDCENTEMP)/etc/fstab
-	mkdir $(VZPRIVATEDIR)/$(VEIDCENTEMP)/root/.ssh
+	[ -d $(VZPRIVATEDIR)/$(VEIDCENTEMP)/root/.ssh ] || mkdir $(VZPRIVATEDIR)/$(VEIDCENTEMP)/root/.ssh
 	cp $(SSHPUBKEY) $(VZPRIVATEDIR)/$(VEIDCENTEMP)/root/.ssh/authorized_keys
 	cp ssh/ssh_host_* $(VZPRIVATEDIR)/$(VEIDCENTEMP)/etc/ssh/
 	cd $(VZPRIVATEDIR)/$(VEIDCENTEMP)/ ; tar --numeric-owner -zcf $(VZTEMPLATEDIR)/cache/centos-$(CENTVERS)-$(ARCH)-minimal.tar.gz .




More information about the Fusionforge-commits mailing list