[pmg-devel] [PATCH pmg-api 2/4] acme: recursively create account directory

Stoiko Ivanov s.ivanov at proxmox.com
Thu Mar 18 16:14:47 CET 2021


to account for the new layout

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/API2/ACME.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PMG/API2/ACME.pm b/src/PMG/API2/ACME.pm
index 1b35511..7aee17a 100644
--- a/src/PMG/API2/ACME.pm
+++ b/src/PMG/API2/ACME.pm
@@ -3,6 +3,8 @@ package PMG::API2::ACME;
 use strict;
 use warnings;
 
+use File::Path;
+
 use PVE::Exception qw(raise_param_exc);
 use PVE::JSONSchema qw(get_standard_option);
 use PVE::Tools qw(extract_param);
@@ -142,7 +144,7 @@ __PACKAGE__->register_method ({
 	my $authuser = $rpcenv->get_user();
 
 	my ($account_name, $account_file) = extract_account_name($param);
-	mkdir $acme_account_dir if ! -e $acme_account_dir;
+	File::Path::make_path($acme_account_dir) if ! -e $acme_account_dir;
 
 	raise_param_exc({'name' => "ACME account config file '${account_name}' already exists."})
 	    if -e $account_file;
-- 
2.20.1





More information about the pmg-devel mailing list