From 6c0a21f45f8bd2c3edc626d0fae8dd7a174fd3b5 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 01 Sep 2011 12:02:06 +0200
Subject: [PATCH] chgrp httpd for domain admin

---
 hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
index 0ef8e45..79b8c56 100644
--- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -194,12 +194,21 @@
 		Pac pac = domUser.getPac();
 		boolean dynamicWeb = pac.isDynamicWeb();
 		String pacName = pac.getName();
-		String domsDir = domUser.getHomedir() + "/doms";
+		String homeDir = domUser.getHomedir();
+		String domsDir = homeDir + "/doms";
 		String userName = domUser.getName();
 		String domainDir = domsDir + "/" + dom.getName();
 		String[] subDirs = dynamicWeb ? DW_STRUCTURE : SW_STRUCTURE;
+		String httpdRights = "";
+		if (pacName != userName) {
+			httpdRights =
+				"chgrp httpd " + homeDir + " && " +
+				"chmod g+rx " + homeDir + " && ";
+		}
 		Processor mkDomainDirProzessor = 
-			new ShellProcessor(
+			new ShellProcessor( httpdRights + 
+					"chgrp httpd " + homeDir + " && " +
+					"chmod g+rx " + homeDir + " && " +
 					"mkdir --mode=1550 --parents " + domsDir + " && " +
 					"chown httpd:" + pacName + " " + domsDir + " && " +
 					"mkdir --mode=750 " + domainDir + " && " +

--
Gitblit v1.9.0-SNAPSHOT