Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reset_acl_ufs {
- find $1 -type d -exec $SUDO setfacl -r -s 'user::rwx,group::rwx,other:---,default:user::rw-,default:group::rw-,default:other:---' {} '\;'
- find $1 -type d -exec $SUDO chmod g+s {} '\;'
- find $1 -type f -o -type l -exec $SUDO setfacl -r -s 'user::rw-,group::rw-,other::---' {} '\;'
- }
- function reset_acl {
- if [[ $FS = 'ufs' ]]; then
- reset_acl_ufs $1
- else
- reset_acl_zfs $1
- fi
- }
- function reset_acl_zfs {
- $SUDO chmod -R A- $1
- $SUDO chown -R $INSTRUCTOR_USER:$INSTRUCTOR_GROUP $1
- find $1 -type d -exec $SUDO chmod 1770 {} '\;'
- find $1 -type d -exec $SUDO chmod g+s {} '\;'
- find $1 -type f -o -type l -exec $SUDO chmod 660 {} '\;'
- }
- function acl_ufs_student {
- find $1 -type d -exec $SUDO setfacl -r -m 'default:user:$1:rw-,user:$1:rwx' {} '\;'
- find $1 -type f -exec $SUDO setfacl -r -m 'user:$1:rw-' {}'\;'
- }
- function acl_zfs_student { #$1 = teamdir, $2 = user
- $SUDO chmod -R "A+user:$2:wpDrcaRWAC:fdi:allow" $1
- }
- function acl_student { # $1 = teamdir, $2 = user
- if [[ $FS = 'zfs' ]]
- then
- acl_zfs_student $1 $2
- else
- acl_ufs_student $1 $2
- fi
- }
Add Comment
Please, Sign In to add comment