]> git.proxmox.com Git - pmg-api.git/commitdiff
acme: recursively create account directory
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 18 Mar 2021 15:14:47 +0000 (16:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Mar 2021 15:31:46 +0000 (16:31 +0100)
to account for the new layout

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/API2/ACME.pm

index 1b355111d9fed7d9b51f886c26704da9d7bc2d19..7aee17a7d870724b9b246c8a1667139c1ae746c1 100644 (file)
@@ -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;