From 7c35d33ef98df0f275be6643d36a13d7e2e3af98 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 07 Jul 2011 18:23:50 +0200
Subject: [PATCH] pac.create

---
 hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
index deebbed..00e6699 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -72,6 +72,13 @@
 						+ unixUser.getUserId() + ":" + unixUser.getUserId()
 						+ ":" + unixUser.getComment() + ":" + unixUser.getHomedir()
 						+ ":" + unixUser.getShell() + "\n");
+		Processor mkdirsProc = new ShellProcessor("chmod 711 " + unixUser.getHomedir() + " && " +
+				"su -l " + unixUser.getName() + " -s \"/bin/bash\" -c \"mkdir " +
+				unixUser.getHomedir() + "/etc " +
+				unixUser.getHomedir() + "/doms " + 
+				unixUser.getHomedir() + "/users " + 
+				"\""
+				);
 		try {
 			InputStream stream = TemplateProcessor.class.getClassLoader().getResourceAsStream("/de/hsadmin/mods/pac/email_new_pac_account.jtpl");
 			Template template = new Template(new InputStreamReader(stream));
@@ -85,7 +92,7 @@
 							"Zugangsdaten des neue Hostsharing Pakets " + pacName, 
 							template.out())
 				);
-			Processor priProcessor = new CompoundProcessor(hostsAppender, interfacesAppender, sudoersAppender, newUsersProc);
+			Processor priProcessor = new CompoundProcessor(newUsersProc, hostsAppender, interfacesAppender, sudoersAppender, mkdirsProc);
 			WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor);
 			secProcessor.appendProcessor(pac.getHiveName(), emailPasswordProc, "send email to customer");
 			return secProcessor;

--
Gitblit v1.9.0-SNAPSHOT