]> git.proxmox.com Git - proxmox-acme.git/commitdiff
plugin-caller: make no-ops always successful
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 16 Jul 2021 13:43:05 +0000 (15:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jul 2021 15:58:48 +0000 (17:58 +0200)
proxmox-acme is used to call the dns-plugins from acme.sh and has the
config editing (saving/clearing) turned int no-ops.

bash's `return` statement w/o argument returns the value of the last
executed command (the one before our no-op method was called) (see
`help return` in bash).
This leads to unexpected behavior in some plugins, which call one of
the methods as last statement join the next step with `&&`.

tested bash behavior with:
```
foo() { return; }; if [ -z 'x' ]; then :; else foo ; fi; echo $?
```

reported in our community-forum:
https://forum.proxmox.com/threads/pmg-acme-dns-with-cyon-failing-to-issue-certificate.92762

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/proxmox-acme

index 9c55521da77e3dd8900cbbc050c3f792038d1114..6cc7b5feba18d62fa9108bfd2d4e883e86d03a4c 100644 (file)
@@ -609,7 +609,7 @@ __red() {
 }
 
 _log() {
 }
 
 _log() {
-    return
+    return 0
 }
 
 _info() {
 }
 
 _info() {
@@ -640,11 +640,11 @@ _readaccountconf_mutable() {
 
 # no-ops:
 _clearaccountconf() {
 
 # no-ops:
 _clearaccountconf() {
-  return
+  return 0
 }
 
 _cleardomainconf() {
 }
 
 _cleardomainconf() {
-  return
+  return 0
 }
 
 _debug() {
 }
 
 _debug() {
@@ -676,23 +676,23 @@ _secure_debug3() {
 }
 
 _saveaccountconf() {
 }
 
 _saveaccountconf() {
-  return
+  return 0
 }
 
 _saveaccountconf_mutable() {
 }
 
 _saveaccountconf_mutable() {
-  return
+  return 0
 }
 
 _save_conf() {
 }
 
 _save_conf() {
-  return
+  return 0
 }
 
 _savedomainconf() {
 }
 
 _savedomainconf() {
-  return
+  return 0
 }
 
 _source_plugin_config() {
 }
 
 _source_plugin_config() {
-  return
+  return 0
 }
 
 # Proxmox implementation to inject the DNSAPI variables
 }
 
 # Proxmox implementation to inject the DNSAPI variables