|
Revision 1922, 2.2 kB
(checked in by anarcat, 1 year ago)
|
retirer la fonction dupliquee init_dom_letter, remplaceee par print_domain_letter. utiliser print_user_letter au lieu code custom
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
#!/bin/sh |
|---|
| 2 |
|
|---|
| 3 |
set -e |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
override_d=/var/alternc/apacheconf |
|---|
| 15 |
override_f=${override_d}/override_php.conf |
|---|
| 16 |
extra_paths="/var/alternc/dns/redir:/usr/share/php/:/var/alternc/tmp/:/tmp/" |
|---|
| 17 |
|
|---|
| 18 |
. /etc/alternc/local.sh |
|---|
| 19 |
. /usr/lib/alternc/functions.sh |
|---|
| 20 |
|
|---|
| 21 |
if [ -z "$MYSQL_HOST" ] |
|---|
| 22 |
then |
|---|
| 23 |
MYSQL_HOST="localhost" |
|---|
| 24 |
fi |
|---|
| 25 |
|
|---|
| 26 |
echo -n "adding open_base_dir protection for:" |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
if [ $ |
|---|
| 30 |
for i in "$*" |
|---|
| 31 |
do |
|---|
| 32 |
if echo "$i" | grep -q '^\*\.' |
|---|
| 33 |
then |
|---|
| 34 |
echo skipping wildcard "$i" >&2 |
|---|
| 35 |
continue |
|---|
| 36 |
fi |
|---|
| 37 |
if echo "$i" | grep -q /var/alternc/dns > /dev/null; then |
|---|
| 38 |
dom="$i" |
|---|
| 39 |
else |
|---|
| 40 |
initial_domain=`print_domain_letter "$i"` |
|---|
| 41 |
dom="/var/alternc/dns/$initial_domain/$i" |
|---|
| 42 |
fi |
|---|
| 43 |
doms="$doms $dom" |
|---|
| 44 |
done |
|---|
| 45 |
else |
|---|
| 46 |
doms=`find /var/alternc/dns -type l` |
|---|
| 47 |
fi |
|---|
| 48 |
|
|---|
| 49 |
for i in $doms |
|---|
| 50 |
do |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
if readlink "$i" | grep -q '^/var/alternc/bureau/admin/webmail/*$' || \ |
|---|
| 54 |
readlink "$i" | grep -q '^/var/alternc/bureau/*$' |
|---|
| 55 |
then |
|---|
| 56 |
continue |
|---|
| 57 |
fi |
|---|
| 58 |
domain=`basename "$i"` |
|---|
| 59 |
account=`get_account_by_domain $domain` |
|---|
| 60 |
if [ -z "$account" ]; then |
|---|
| 61 |
continue |
|---|
| 62 |
fi |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
initial_domain=`print_domain_letter "$domain"` |
|---|
| 66 |
|
|---|
| 67 |
initial_account=`print_user_letter "$account"` |
|---|
| 68 |
path1="/var/alternc/dns/$initial_domain/$domain" |
|---|
| 69 |
path2="/var/alternc/html/$initial_account/$account" |
|---|
| 70 |
|
|---|
| 71 |
mkdir -p "$override_d/$initial_domain" |
|---|
| 72 |
if append_no_dupe "$override_d/$initial_domain/$domain" <<EOF |
|---|
| 73 |
<Directory ${path1}> |
|---|
| 74 |
php_admin_value open_basedir ${path2}/:${extra_paths} |
|---|
| 75 |
</Directory> |
|---|
| 76 |
EOF |
|---|
| 77 |
then |
|---|
| 78 |
true |
|---|
| 79 |
else |
|---|
| 80 |
echo -n " $domain" |
|---|
| 81 |
add_dom_entry "Include $override_d/$initial_domain/$domain" |
|---|
| 82 |
fi |
|---|
| 83 |
done |
|---|
| 84 |
|
|---|
| 85 |
echo . |
|---|