summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-08-11 11:44:20 -0400
committerjim-p <jimp@pfsense.org>2011-08-11 11:44:52 -0400
commitcfb5b1b18a44869de26bf0d9d54230c1ab9cd280 (patch)
tree621874007627512cb773818a11375068de0b4ac4 /etc/inc
parentd560b783c53ef2600a7a67507029a31dc8beaa5a (diff)
downloadpfsense-cfb5b1b18a44869de26bf0d9d54230c1ab9cd280.zip
pfsense-cfb5b1b18a44869de26bf0d9d54230c1ab9cd280.tar.gz
Fix privilege matching so that it respects wildcards better, especially when leading.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/priv.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index f150aaf..16dd112 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -122,8 +122,10 @@ function cmp_page_matches($page, & $matches, $fullwc = true) {
$wcpos = strpos($match, "*");
if ($wcpos === false)
$result = strcmp($page, $match);
- else
- $result = strncmp($page, $match, $wcpos);
+ else {
+ $match = "/" . str_replace(array(".", "*"), array("\.", ".*"), $match) . "/";
+ $result = !preg_match($match, $page);
+ }
if (!$result)
return true;
OpenPOWER on IntegriCloud