]> git.proxmox.com Git - pmg-api.git/blobdiff - src/PMG/API2/ACME.pm
acme: recursively create account directory
[pmg-api.git] / 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;