summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-21 19:24:53 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-21 19:24:53 +0000
commit29f9dd5216360cb878f16c3d51f819f237feef72 (patch)
treea3bfcfecb68a79d2983b06ee8b5d3f59a15839fb
parentd4b86b9d4aa49ff19c1076be2127535432edb84e (diff)
downloadpfsense-29f9dd5216360cb878f16c3d51f819f237feef72.zip
pfsense-29f9dd5216360cb878f16c3d51f819f237feef72.tar.gz
Try to fix make_dirs
-rw-r--r--etc/inc/pfsense-utils.inc16
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index cf1824b..7040a97 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -820,14 +820,15 @@ function rmdir_recursive($path,$follow_links=false) {
*/
function safe_mkdir($path, $mode=0755) {
global $g;
-
+
+ /* cdrom is ro. */
if($g['platform'] == "cdrom")
return false;
- if (!is_file($path) && !is_dir($path))
- return make_dirs($path, $mode);
- else
- return false;
+ if(is_dir($path))
+ return;
+
+ make_dirs($path, $mode);
}
/*
@@ -838,7 +839,10 @@ function make_dirs($path, $mode = 0755) {
/* is dir already created? */
if(is_dir($path)) return;
/* create directory in question */
- mkdir(dirname($path), $mode);
+ $to_create = split("/", $path);
+ foreach($to_create as $tc)
+ if(!is_dir($tc))
+ make_dirs($path, $mode);
}
/*
OpenPOWER on IntegriCloud