#!/bin/sh
# ACL_OVERRIDE="${ACL_OVERRIDE:-Admin:read,write}"
-ACL_DEFAULT="${ACL_DEFAULT:-All:read${BR}Known:read,write}"
+ACL_DEFAULT="${ACL_DEFAULT:-Known:read,write${BR}All:read}"
acl_cachepath=''
acl_collection=''
continue
fi
- n=20; while read -r head acl; do
- if [ "$head" = "%acl" ]; then
- acl_collection="${acl%${CR}}${BR}"
- printf "%s\n" "${acl%${CR}}"
- n=$((n+1))
- fi
+ acl="$(sed -En '
+ s;\r$;;;
+ /^%acl([\t ]+.*)?$/bACL;
+ 20q;
+ b;
- n="$((n - 1))"
- [ "$n" -eq 0 ] && break
- done <"$pagefile"
+ :ACL
+ s;(%(acl)?)?[\t ]*;;
+ p; n; s;\r$;;;
+ /^(%[ \t]+|%acl[ \t]+|[ \t]+)[^ \t\r]+$/bACL;
+ /^(%[ \t]*|%acl[ \t]*)$/bACL;
+ ' <"$pagefile")"
+
+ printf %s\\n "${acl}"
+ acl_collection="${acl_collection}${acl}${BR}"
done
printf '%s\n' "$ACL_DEFAULT"