Modified acl setting. NEEDS TESTING
This commit is contained in:
parent
b8ae56cf0a
commit
d7e6e8cbe5
|
@ -122,7 +122,7 @@ for i in "$ALTERNC_HTML" "$ALTERNC_MAIL" "$ALTERNC_LOGS" ; do
|
|||
done
|
||||
|
||||
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z _ 0 1 2 3 4 5 6 7 8 9; do
|
||||
test -d "$ALTERNC_HTML/$i" || ( mkdir -p "$ALTERNC_HTML/$i" && chown alterncpanel:alterncpanel "$ALTERNC_HTML/$i" )
|
||||
test -d "$ALTERNC_HTML/$i" || ( mkdir -p "$ALTERNC_HTML/$i" && chown alterncpanel:alterncpanel "$ALTERNC_HTML/$i" && chmod 775 "$ALTERNC_HTML/$i" )
|
||||
test -d "$ALTERNC_MAIL/$i" || ( mkdir -p "$ALTERNC_MAIL/$i" && chown vmail:vmail "$ALTERNC_MAIL/$i" && chmod 775 "$ALTERNC_MAIL/$i" )
|
||||
done
|
||||
|
||||
|
|
|
@ -117,11 +117,13 @@ doone() {
|
|||
chown -R $GID:$GID "$REP"
|
||||
chmod 2770 -R "$REP"
|
||||
|
||||
# Delete existings ACL
|
||||
# Set the defaults acl on all the files
|
||||
setfacl -b -k -n -R -m d:g:alterncpanel:rwx -m d:u::rwx -m d:g::rwx -m d:u:$GID:rwx -m d:g:$GID:rwx -m d:o::--- -m d:mask:rwx\
|
||||
-Rm g:alterncpanel:rwx -m u:$GID:rwx -m g:$GID:rwx -m mask:rwx\
|
||||
"$REP"
|
||||
# # Delete existings ACL
|
||||
# # Set the defaults acl on all the files
|
||||
# setfacl -b -k -n -R -m d:g:alterncpanel:rwx -m d:u::rwx -m d:g::rwx -m d:u:$GID:rwx -m d:g:$GID:rwx -m d:o::--- -m d:mask:rwx\
|
||||
# -Rm g:alterncpanel:rwx -m u:$GID:rwx -m g:$GID:rwx -m mask:rwx\
|
||||
# "$REP"
|
||||
setfacl -bknR -m d:u:alterncpanel:rwx -m d:g:alterncpanel:rwx -m u:alterncpanel:rwx -m g:alterncpanel:rwx -m d:o::--- -m o::---\
|
||||
-m d:u:$GID:rwx -m d:g:$GID:rwx -m u:$GID:rwx -m g:$GID:rwx -m d:mask:rwx -m mask:rwx "$REP"
|
||||
|
||||
read GID LOGIN || true
|
||||
done
|
||||
|
@ -146,9 +148,12 @@ fixdir() {
|
|||
|
||||
# Delete existings ACL
|
||||
# Set the defaults acl on all the files
|
||||
setfacl -b -k -n -R -m d:g:alterncpanel:rwx -m d:u::rwx -m d:g::rwx -m d:u:$REP_ID:rwx -m d:g:$REP_ID:rwx -m d:o::--- -m d:mask:rwx\
|
||||
-Rm g:alterncpanel:rwx -m u:$REP_ID:rwx -m g:$REP_ID:rwx -m mask:rwx\
|
||||
"$REP"
|
||||
# setfacl -b -k -n -R -m d:g:alterncpanel:rwx -m d:u::rwx -m d:g::rwx -m d:u:$REP_ID:rwx -m d:g:$REP_ID:rwx -m d:o::--- -m d:mask:rwx\
|
||||
# -Rm g:alterncpanel:rwx -m u:$REP_ID:rwx -m g:$REP_ID:rwx -m mask:rwx\
|
||||
# "$REP"
|
||||
setfacl -bknR -m d:u:alterncpanel:rwx -m d:g:alterncpanel:rwx -m u:alterncpanel:rwx -m g:alterncpanel:rwx -m d:o::--- -m o::---\
|
||||
-m d:u:$GID:rwx -m d:g:$GID:rwx -m u:$GID:rwx -m g:$GID:rwx -m d:mask:rwx -m mask:rwx "$REP"
|
||||
|
||||
echo -e "\nDone"
|
||||
}
|
||||
|
||||
|
@ -158,7 +163,7 @@ fixfile() {
|
|||
REP_ID="$(get_uid_by_path "$file")"
|
||||
chown $REP_ID:$REP_ID "$file"
|
||||
chmod 0770 "$file"
|
||||
/usr/bin/setfacl -m u:$REP_ID:rw- -m g:$REP_ID:rw- -m g:alterncpanel:rw- -m u:$REP_ID:rw- -m g:$REP_ID:rw- "$file"
|
||||
/usr/bin/setfacl -m u:$REP_ID:rw- -m g:$REP_ID:rw- -m u:alterncpanel:rw- -m g:alterncpanel:rw- "$file"
|
||||
echo file ownership and ACLs changed
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue