root/tags/omega-1.0.0-rc3/engine/setup/set-engine-permissions.sh

Revision 745, 2.7 KB (checked in by raphael, 17 months ago)

Fixed #566: Undefined template variable: THEME_CHARSET in orderpanel
Partially fixed #476: /etc/ispcp/ispcp.conf is world readable
Applied patch from #387
Fixed #563: old config backups should be removed

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3# ispCP ω (OMEGA) a Virtual Hosting Control Panel
4# Copyright (c) 2001-2006 by moleSoftware GmbH
5# http://www.molesoftware.com
6# Copyright (c) 2006-2007 by isp Control Panel
7# http://isp-control.net
8#
9#
10# License:
11#    This program is free software; you can redistribute it and/or
12#    modify it under the terms of the MPL Mozilla Public License
13#    as published by the Free Software Foundation; either version 1.1
14#    of the License, or (at your option) any later version.
15#
16#    This program is distributed in the hope that it will be useful,
17#    but WITHOUT ANY WARRANTY; without even the implied warranty of
18#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19#    MPL Mozilla Public License for more details.
20#
21#    You may have received a copy of the MPL Mozilla Public License
22#    along with this program.
23#
24#    An on-line copy of the MPL Mozilla Public License can be found
25#    http://www.mozilla.org/MPL/MPL-1.1.html
26#
27#
28# The ispCP ω Home Page is at:
29#
30#    http://isp-control.net
31#
32
33# for activating debug, please set to 1;
34DEBUG=0
35
36# read needed entries from ispcp.conf
37for a in `cat /etc/ispcp/ispcp.conf | grep -E '(ROOT_DIR|MTA_MAILBOX_|^LOG_DIR)' | sed -e 's/ //g'`; do
38    export $a
39done
40
41#
42# fixing engine permissions;
43#
44
45echo -n "    Setting Engine Permissions: ";
46
47if [ $DEBUG -eq 1 ]; then
48    echo        "";
49fi
50
51# Fix ispcp.conf perms
52if [ $DEBUG -eq 1 ]; then
53    echo -e "\tug+r,u+w,o-r root:vu2000 /etc/ispcp/ispcp.conf";
54else
55    echo -n ".";
56fi
57
58#chmod ug+r,u+w,o-r /etc/ispcp/ispcp.conf
59chown root:vu2000 /etc/ispcp/ispcp.conf
60
61for i in `find $ROOT_DIR/engine/`; do
62
63        if [[ -f $i ]]; then
64
65                if [ $DEBUG -eq 1 ]; then
66                        echo -e "\t0700 root:root $i";
67                fi
68
69                chmod 0700 $i;
70                chown root:root $i;
71
72        elif [[ -d $i ]]; then
73
74                if [ $DEBUG -eq 1 ]; then
75                        echo "0700 root:root [$i]";
76                else
77                        echo -n ".";
78                fi
79
80                chmod 0700 $i;
81                chown root:root $i;
82        fi
83
84done
85
86#
87# fixing engine folder permissions;
88#
89
90                chmod 0755 $ROOT_DIR/engine;
91                chown root:root $ROOT_DIR/engine;
92
93#
94# fixing messager permissions;
95#
96
97i="$ROOT_DIR/engine/messager"
98
99if [ $DEBUG -eq 1 ]; then
100        echo "0700 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME [$i]";
101else
102        echo -n ".";
103fi
104
105                chmod -R 0700 $i;
106                chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i;
107
108
109#
110# fixing messager folder permissions;
111#
112
113i="$ROOT_DIR/engine/messager"
114
115if [ $DEBUG -eq 1 ]; then
116        echo "0755 root:root folder [$i]";
117else
118        echo -n ".";
119fi
120
121
122                chmod 0755 $i;
123                chown root:root $i;
124
125
126#
127# fixing messager log folder permissions;
128#
129
130i="${LOG_DIR}/ispcp-arpl-msgr"
131
132if [ $DEBUG -eq 1 ]; then
133        echo "0755 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME folder [$i]";
134else
135        echo -n ".";
136fi
137
138                chmod 0755 $i;
139                chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i;
140
141echo "done";
Note: See TracBrowser for help on using the browser.