summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2011-09-14 03:43:55 +0200
committerMichael Tänzer <neo@nhng.de>2011-09-14 03:43:55 +0200
commit83479b23af20a17cd59feb89c4b2c2c5ad0c670e (patch)
treeff6545073cb03edd1374fc5104ff187d3105c918
parenteb4d4d1ca50d08211ec230a60cee11f65b74c2bd (diff)
downloadcacert-devel-bug-968.tar.gz
cacert-devel-bug-968.tar.xz
cacert-devel-bug-968.zip
bug 968: Check if directories already exist before creating thembug-968
In function generatecertpath() Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/general.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/general.php b/includes/general.php
index ebdf20e..8481018 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -919,10 +919,13 @@
if($newlayout)
{
$name="../$type/$kind/".intval($id/1000)."/$kind-".intval($id).".$type";
- mkdir("../csr/$kind",0777);
- mkdir("../crt/$kind",0777);
- mkdir("../csr/$kind/".intval($id/1000));
- mkdir("../crt/$kind/".intval($id/1000));
+ if (!is_dir("../csr")) { mkdir("../csr",0777); }
+ if (!is_dir("../crt")) { mkdir("../crt",0777); }
+
+ if (!is_dir("../csr/$kind")) { mkdir("../csr/$kind",0777); }
+ if (!is_dir("../crt/$kind")) { mkdir("../crt/$kind",0777); }
+ if (!is_dir("../csr/$kind/".intval($id/1000))) { mkdir("../csr/$kind/".intval($id/1000)); }
+ if (!is_dir("../crt/$kind/".intval($id/1000))) { mkdir("../crt/$kind/".intval($id/1000)); }
}
return $name;
}