summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-03 15:59:15 -0500
committersullrich <sullrich@pfsense.org>2009-12-03 15:59:15 -0500
commitdd415d521f762111eebbcfced77e83c7662e4401 (patch)
treee5d14808c5dc5b60b722bc0da5c2fd473a04702f /etc
parentae2951d351024dad570e6ee3554120ef85437847 (diff)
downloadpfsense-dd415d521f762111eebbcfced77e83c7662e4401.zip
pfsense-dd415d521f762111eebbcfced77e83c7662e4401.tar.gz
Roll custom run_plugins routine
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/priv.inc27
1 files changed, 26 insertions, 1 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index ad00a3b..4ff4905 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -45,8 +45,33 @@
*/
/* Load and process custom privs. */
-run_plugins("/etc/inc/priv/");
+function load_custom_privs() {
+ global $priv_list;
+ $directory = "/etc/inc/priv";
+ $dir_array = array();
+ if(!is_dir($directory))
+ return;
+ if ($dh = opendir($directory)) {
+ while (($file = readdir($dh)) !== false) {
+ $canadd = 0;
+ if($file == ".")
+ $canadd = 1;
+ if($file == "..")
+ $canadd = 1;
+ if($canadd == 0)
+ array_push($dir_array, $file);
+ }
+ closedir($dh);
+ }
+ if(!is_array($dir_array))
+ return;
+ foreach ($dir_array as $file)
+ if (!is_dir("{$directory}/{$file}") && stristr($file,".inc"))
+ include("{$directory}/{$file}");
+}
+// Load and sort privs
+load_custom_privs();
sort_privs($priv_list);
function cmp_privkeys($a, $b) {
OpenPOWER on IntegriCloud