mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
Scripts: fix wildcard to lower path wildcard edge case
This commit is contained in:
parent
1822897717
commit
4c77605cb1
@ -74,10 +74,16 @@ for WIDGET in ${WIDGETS}; do
|
||||
fi
|
||||
|
||||
for ENDPOINT in ${ENDPOINTS}; do
|
||||
# do a full match here
|
||||
PATTERN=${ENDPOINT#/}
|
||||
if ! grep -q "<pattern>${PATTERN}</pattern>" ${ACLS}; then
|
||||
PATTERN=${PATTERN%/*}
|
||||
if ! grep -q "<pattern>${PATTERN}/\*</pattern>" ${ACLS}; then
|
||||
if ! grep -Fq "<pattern>${PATTERN}</pattern>" ${ACLS}; then
|
||||
if [ -z "${PATTERN%%*/\*}" ]; then
|
||||
# already a wildcard match, allow lower path
|
||||
PATTERN=${PATTERN%/*}
|
||||
fi
|
||||
# do a wildcard match as a fallback
|
||||
PATTERN=${PATTERN%/*}/*
|
||||
if ! grep -Fq "<pattern>${PATTERN}</pattern>" ${ACLS}; then
|
||||
echo "Unknown ACL for ${WIDGET}:"
|
||||
echo ${ENDPOINT}
|
||||
exit 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user