2 # Alex Dehnert --- 2009-04-24, 2009-06-27, and later
3 # Check the ownership and other properties of various mailing lists
4 # Takes a list-of-lists and allowed owners on the commandline
8 publicpat=${3:-"-listeners$"}
10 #owners=$(blanche $ownerslist -m | grep LIST | cut -d : -f 2)
12 echo Allowed owners: $owners
13 owners="GUARD $owners GUARD"
15 for list in $(blanche $cont | grep LIST | cut -d : -f 2); do
16 hidden=$(athrun ops qy -s -f hidden glin $list)
17 if [[ "x$hidden" == "x" ]]; then
18 echo $list is probably hidden
20 if [[ "$hidden" == 1 ]]; then
21 echo $list is definitely hidden, but I can see it, so continuing
23 info=$(blanche $list -i)
24 public=$(athrun ops qy -s -f publicflg glin $list)
25 owner=$(athrun ops qy -s -f ace_name glin $list)
26 towner=$(athrun ops qy -s -f ace_type glin $list)
27 macl=$(athrun ops qy -s -f memace_name glin $list)
28 tmacl=$(athrun ops qy -s -f memace_type glin $list)
29 if [[ "$towner" == "USER" ]]; then
30 echo "$list is owned by a user ($owner)"
31 elif [[ "$tmacl" == "USER" ]]; then
32 echo "$list is memacl'd by a user ($macl)"
33 elif [[ "$towner" == "KERBEROS" || "$tmacl" == "KERBEROS" ]]; then
34 echo "$list is owned or memacl'd by a Kerberos principal"
35 elif [[ "$towner" == "LIST" && ( "$tmacl" == "LIST" || "$tmacl" == "NONE" ) ]]; then
38 echo "$list is owned or memacl'd by something funky"
40 if [[ "$towner" == "LIST" ]]; then
41 if [[ "$owner" == "GUARD" ]]; then
42 echo "$list owned by GUARD, which shouldn't even exist"
43 elif ( echo $owners | grep -q -- " $owner " ); then
44 # Owned by standard owner
46 elif [[ "$owner" == "$list-chairs" || "$owner" == "$list-request" ]]; then
47 # Chair / request owned
49 #elif ( echo "$list" | sed -e 's/-\(listeners\|members\)$/-chairs/' | grep -q --fixed-strings --line-regexp -- "$owner" ); then
50 # # Chair owned, for a listeners/members structure
53 echo $list owned by $owner, not one of the allowed owners
56 if [[ "$public" == "1" ]]; then
57 if ( echo $list | grep -q -- "$publicpat" ); then
58 # We're allowed to be public
64 fi # hidden heuristic end