Making sure chmod and chown does not follow symlinks

This commit is contained in:
myvesta 2021-03-14 00:23:23 +01:00
commit c981edee63
3 changed files with 21 additions and 9 deletions

View file

@ -1085,3 +1085,15 @@ vesta_generate_pass() {
done
echo "$PASS"
}
# Simple chmod wrapper that skips symlink files after glob expand
# Taken from HestiaCP
no_symlink_chmod() {
local filemode=$1; shift;
for i in "$@"; do
[[ -L ${i} ]] && continue
chmod "${filemode}" "${i}"
done
}