[pve-devel] [PATCH manager 1/6] ACMEPlugin: check digest on update

Dominik Csapak d.csapak at proxmox.com
Tue May 5 14:38:13 CEST 2020


and extract the param, otherwise the check dies because of an unknown
field 'digest'

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/ACMEPlugin.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/API2/ACMEPlugin.pm b/PVE/API2/ACMEPlugin.pm
index 92e0dfb6..71f53a35 100644
--- a/PVE/API2/ACMEPlugin.pm
+++ b/PVE/API2/ACMEPlugin.pm
@@ -173,9 +173,11 @@ __PACKAGE__->register_method({
 
 	my $id = extract_param($param, 'id');
 	my $delete = extract_param($param, 'delete');
+	my $digest = extract_param($param, 'digest');
 
 	cfs_lock_file($plugin_config_file, undef, sub {
 	    my $cfg = load_config();
+	    PVE::Tools::assert_if_modified($cfg->{digest}, $digest);
 	    my $plugin_cfg = $cfg->{ids}->{$id};
 	    die "ACME plugin ID '$id' does not exist\n" if !$plugin_cfg;
 
-- 
2.20.1





More information about the pve-devel mailing list