make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / user-tools / override / chmod
blob70070602052d15ff5ff4414b50e9ae3ee1756e4d
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 chmod - Call system's chmod(1) just warns if one of the files have ACL permissions set.
10 =cut
12 EOF
15 declare -a argv=("$@")
16 shiftparam=1
18 while [ $# != 0 ]
20 case "$1" in
21 --reference|--reference=*|-[rwxXst]|-[ugo])
22 shiftparam=0
24 -*)
25 true
28 if [ $shiftparam -gt 0 ]
29 then
30 let shiftparam--
31 else
32 if [ -n "$(getfacl --skip-base --physical --numeric --omit-header --absolute-names "$1" 2>/dev/null)" ]
33 then
34 echo "${0##*/}: $1: Warning, the file has ACL records" >&2
38 esac
39 shift
40 done
42 exec -a chmod /bin/chmod "${argv[@]}"