summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-08-26 10:47:03 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-08-26 10:47:12 +0200
commit0c45010096cdf89d9bc8f570234e923a59c2a42f (patch)
treedf8adfa96943169059824c57646fa941ef90fe64 /pykolab
parent1c4d7bb4154143752af6e2542cdbfaf2f7372cb5 (diff)
downloadpykolab-0c45010096cdf89d9bc8f570234e923a59c2a42f.tar.gz
Resolve T1454
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_roundcube.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index 82073cc..2b48b51 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -265,6 +265,8 @@ password='%s'
root_uid = 0
+ webserver_gid = None
+
for webserver_group in [ 'apache', 'www-data', 'www' ]:
try:
(a,b,webserver_gid,c) = grp.getgrnam(webserver_group)
@@ -272,10 +274,18 @@ password='%s'
except Exception, errmsg:
pass
- if not rccpath == None:
- for root, directories, filenames in os.walk(rccpath):
- for filename in filenames:
- os.chown(os.path.join(root, filename), root_uid, webserver_gid)
+ if webserver_gid is not None:
+ if rccpath is not None:
+ for root, directories, filenames in os.walk(rccpath):
+ for filename in filenames:
+ try:
+ os.chown(
+ os.path.join(root, filename),
+ root_uid,
+ webserver_gid
+ )
+ except Exception, errmsg:
+ pass
httpservice = 'httpd.service'
if os.path.isfile('/usr/lib/systemd/system/apache2.service'):