diff --git a/bureau/class/m_admin.php b/bureau/class/m_admin.php index 78f2fa4f..fa3571ee 100644 --- a/bureau/class/m_admin.php +++ b/bureau/class/m_admin.php @@ -318,12 +318,12 @@ class m_admin { } if (!$force) { if ($mail=="") { - $err->raise("admin",6); - return false; + $err->raise("admin",6); + return false; } if (checkmail($mail)!=0){ - $err->raise("admin",5); - return false; + $err->raise("admin",5); + return false; } } // Vérification de la conformité du login diff --git a/debian/alternc.postinst b/debian/alternc.postinst index c62a4c41..ac80b30c 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -103,7 +103,7 @@ SQLBACKUP_OVERWRITE="" ALTERNC_SLAVES="" EOF - chown root:www-data $CONFIGFILE + chown root:alterncpanel $CONFIGFILE chmod 640 $CONFIGFILE fi diff --git a/debian/alternc.preinst b/debian/alternc.preinst index 5cdd8946..c78a04db 100644 --- a/debian/alternc.preinst +++ b/debian/alternc.preinst @@ -6,7 +6,7 @@ set -e # Create AlternC Panel user for web server addgroup --system --gid 1999 alterncpanel -adduser --system --home "$ALTERNC_LOC/bureau" --no-create-home \ +adduser --system --home "/etc/alternc/.alterncpanel" \ --disabled-password --uid 1999 --ingroup alterncpanel alterncpanel case "$1" in @@ -14,6 +14,13 @@ case "$1" in ;; upgrade) + # Set correct rights on files + echo "/!\ Warning /!\ Defaults ACL will be applied" + echo "If error, please remount $ALTERNC_LOC with ACL" + echo "and re-run /usr/lib/alternc/fixperms.sh " + /usr/lib/alternc/fixperms.sh + + if dpkg --compare-versions "$2" lt "0.9.4"; then echo "Upgrading bind configuration" # Move /etc/bind files around diff --git a/debian/rules b/debian/rules index 3df1533f..4eb0bf64 100755 --- a/debian/rules +++ b/debian/rules @@ -54,7 +54,7 @@ install: build # Fix permisions chmod 755 debian/alternc/etc/alternc chmod 644 debian/alternc/etc/alternc/phpmyadmin.inc.php - chown -R root:www-data debian/alternc/var/alternc/bureau + chown -R alterncpanel:alterncpanel debian/alternc/var/alternc/bureau chmod 1733 debian/alternc/var/alternc/sessions chmod -R 644 debian/alternc/var/alternc/bureau chmod -R a+X debian/alternc/var/alternc/bureau diff --git a/install/alternc.install b/install/alternc.install index 36764bd1..41c5bcf8 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -320,24 +320,13 @@ done # Last touches # -# Changing owner of web panel's files -chown -R alterncpanel:alterncpanel "$ALTERNC_LOC/bureau" - -# Set correct rights on files -echo "/!\ Warning /!\ Defaults ACL will be applied" -echo "If error, please remount $ALTERNC_LOC with ACL" -echo "and re-run /usr/lib/alternc/fixperms.sh " -echo "" -read -/usr/lib/alternc/fixperms.sh - # Creating admin user if needed HAS_ROOT=`mysql --defaults-file=/etc/alternc/my.cnf -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1` if [ "$HAS_ROOT" != "1" ]; then echo "Creating admin user..." echo "" - if su - www-data -c /usr/share/alternc/install/newone.php + if su - alterncpanel -c /usr/share/alternc/install/newone.php then echo "*******************************************" echo "* *" @@ -354,10 +343,11 @@ if [ "$HAS_ROOT" != "1" ]; then fi fi +# Changing owner of web panel's files +chown -R alterncpanel:alterncpanel "$ALTERNC_LOC/bureau" + # We force the re-computing of the DNS zones, since we may have changed the IP address (see #460) -MYSQL_CONFIG="/etc/alternc/my.cnf" -mysql="/usr/bin/mysql --defaults-file=$MYSQL_CONFIG" -$mysql -B -e "update domaines set dns_action='update';" +/usr/bin/mysql --defaults-file="/etc/alternc/my.cnf" -B -e "update domaines set dns_action='update';" # We should restart apaches after all configuration stuff ... for service in $SERVICES; do diff --git a/src/fixperms.sh b/src/fixperms.sh index 10ccbe3a..3701107e 100755 --- a/src/fixperms.sh +++ b/src/fixperms.sh @@ -61,11 +61,8 @@ doone() { chmod 2770 -R "$REP" # Delete existings ACL - find $REP -exec setfacl -bk '{}' \; - # Set the defaults acl on directory - find $REP -type d -exec setfacl -m d:g:alterncpanel:rw- '{}' \; - # Set the acl on all the files - find $REP -exec setfacl -m g:alterncpanel:rw- '{}' \; + # Set the defaults acl on all the files + setfacl -b -k -m d:g:alterncpanel:rw- -R "$REP" \; read GID LOGIN done diff --git a/src/mem_add b/src/mem_add index 77d54f2f..c7ba55eb 100755 --- a/src/mem_add +++ b/src/mem_add @@ -31,8 +31,9 @@ my @create_paths = ($PTH); for my $p (@create_paths) { mkdir($p); - chown(33, $uid, $p); + chown($uid, $uid, $p); system("/bin/chmod 02770 '$p'"); + system("/usr/bin/setfacl -m d:g:alterncpanel:rw- -m d:u:$uid:rw- -m d:g:$uid:rw- '$p'"); } 0;