From 64181d51ca59ce5502e0a20af8b55cd294f895a3 Mon Sep 17 00:00:00 2001
From: sarthurdev <965089+sarthurdev@users.noreply.github.com>
Date: Fri, 23 Feb 2024 13:14:12 +0100
Subject: pki: T6055: Cleanup unnecessary sudo, preserve env when sudo is
needed
(cherry picked from commit 1f22ac1bb0a32d3e7ef06713f42e7f6f1c3f3775)
---
op-mode-definitions/pki.xml.in | 106 ++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 53 deletions(-)
diff --git a/op-mode-definitions/pki.xml.in b/op-mode-definitions/pki.xml.in
index 4b8d9c47a..a81c8d4f7 100644
--- a/op-mode-definitions/pki.xml.in
+++ b/op-mode-definitions/pki.xml.in
@@ -27,7 +27,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "$7" --sign "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --ca "$7" --sign "$5" --file
@@ -36,10 +36,10 @@
<certificate name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "$7" --sign "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --ca "$7" --sign "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "noname" --sign "$5"
+ ${vyos_op_scripts_dir}/pki.py --action generate --ca "noname" --sign "$5"
@@ -48,7 +48,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --ca "$5" --file
@@ -57,10 +57,10 @@
<CA name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --ca "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ca "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --ca "noname"
@@ -79,7 +79,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$6" --self-sign --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$6" --self-sign --file
@@ -88,10 +88,10 @@
<certificate name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$6" --self-sign --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$6" --self-sign --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname" --self-sign
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname" --self-sign
@@ -108,7 +108,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$7" --sign "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$7" --sign "$5" --file
@@ -117,10 +117,10 @@
<certificate name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$7" --sign "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$7" --sign "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname" --sign "$5"
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname" --sign "$5"
@@ -129,7 +129,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$5" --file
@@ -138,10 +138,10 @@
<certificate name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --certificate "noname"
@@ -158,16 +158,16 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4" --file
Commands for installing generated CRL into running configuration
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4"
+ ${vyos_op_scripts_dir}/pki.py --action generate --crl "$4"
@@ -181,7 +181,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --dh "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --dh "$5" --file
@@ -190,10 +190,10 @@
<DH name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --dh "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --dh "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --dh "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --dh "noname"
@@ -207,7 +207,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --keypair "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --keypair "$5" --file
@@ -216,10 +216,10 @@
<key name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --keypair "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --keypair "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --keypair "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --keypair "noname"
@@ -238,7 +238,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "$6" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "$6" --file
@@ -247,10 +247,10 @@
<key name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "$6" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "$6" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --openvpn "noname"
@@ -266,7 +266,7 @@
<filename>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ssh "$5" --file
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action generate --ssh "$5" --file
@@ -275,10 +275,10 @@
<key name>
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ssh "$5" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --ssh "$5" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --ssh "noname"
+ ${vyos_op_scripts_dir}/pki.py --action generate --ssh "noname"
@@ -302,12 +302,12 @@
interfaces wireguard
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --key --interface "$7" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --key --interface "$7" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --key
+ ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --key
@@ -334,14 +334,14 @@
interfaces wireguard ${COMP_WORDS[COMP_CWORD-2]} peer
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --psk --interface "$7" --peer "$9" --install
+ ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --psk --interface "$7" --peer "$9" --install
- sudo ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --psk
+ ${vyos_op_scripts_dir}/pki.py --action generate --wireguard --psk
@@ -371,13 +371,13 @@
Path to CA certificate file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --ca "$4" --filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --ca "$4" --filename "$6"
Path to private key file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --ca "$4" --key-filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --ca "$4" --key-filename "$6"
@@ -393,13 +393,13 @@
Path to certificate file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --certificate "$4" --filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --certificate "$4" --filename "$6"
Path to private key file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --certificate "$4" --key-filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --certificate "$4" --key-filename "$6"
@@ -415,7 +415,7 @@
Path to CRL file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --crl "$4" --filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --crl "$4" --filename "$6"
@@ -431,7 +431,7 @@
Path to DH parameters file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --dh "$4" --filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --dh "$4" --filename "$6"
@@ -447,13 +447,13 @@
Path to public key file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --keypair "$4" --filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --keypair "$4" --filename "$6"
Path to private key file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --keypair "$4" --key-filename "$6"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --keypair "$4" --key-filename "$6"
@@ -474,7 +474,7 @@
Path to shared secret key file
- sudo ${vyos_op_scripts_dir}/pki.py --action import --openvpn "$5" --filename "$7"
+ sudo -E ${vyos_op_scripts_dir}/pki.py --action import --openvpn "$5" --filename "$7"
@@ -495,7 +495,7 @@
Show x509 CA certificates
- sudo ${vyos_op_scripts_dir}/pki.py --action show --ca "all"
+ ${vyos_op_scripts_dir}/pki.py --action show --ca "all"
@@ -504,13 +504,13 @@
pki ca
- sudo ${vyos_op_scripts_dir}/pki.py --action show --ca "$4"
+ ${vyos_op_scripts_dir}/pki.py --action show --ca "$4"
Show x509 CA certificate in PEM format
- sudo ${vyos_op_scripts_dir}/pki.py --action show --ca "$4" --pem
+ ${vyos_op_scripts_dir}/pki.py --action show --ca "$4" --pem
@@ -518,7 +518,7 @@
Show x509 certificates
- sudo ${vyos_op_scripts_dir}/pki.py --action show --certificate "all"
+ ${vyos_op_scripts_dir}/pki.py --action show --certificate "all"
@@ -527,7 +527,7 @@
pki certificate
- sudo ${vyos_op_scripts_dir}/pki.py --action show --certificate "$4"
+ ${vyos_op_scripts_dir}/pki.py --action show --certificate "$4"
@@ -542,7 +542,7 @@
sha256 sha384 sha512
- sudo ${vyos_op_scripts_dir}/pki.py --action show --certificate "$4" --fingerprint "$6"
+ ${vyos_op_scripts_dir}/pki.py --action show --certificate "$4" --fingerprint "$6"
@@ -550,7 +550,7 @@
Show x509 certificate revocation lists
- sudo ${vyos_op_scripts_dir}/pki.py --action show --crl "all"
+ ${vyos_op_scripts_dir}/pki.py --action show --crl "all"
@@ -559,18 +559,18 @@
pki ca
- sudo ${vyos_op_scripts_dir}/pki.py --action show --crl "$4"
+ ${vyos_op_scripts_dir}/pki.py --action show --crl "$4"
Show x509 certificate revocation lists by CA name in PEM format
- sudo ${vyos_op_scripts_dir}/pki.py --action show --crl "$4" --pem
+ ${vyos_op_scripts_dir}/pki.py --action show --crl "$4" --pem
- sudo ${vyos_op_scripts_dir}/pki.py --action show
+ ${vyos_op_scripts_dir}/pki.py --action show
--
cgit v1.2.3
From 1c7fd8a7635e9a8c87de178fcb0735c6ed83b669 Mon Sep 17 00:00:00 2001
From: sarthurdev <965089+sarthurdev@users.noreply.github.com>
Date: Fri, 23 Feb 2024 13:14:54 +0100
Subject: pki: T3642: Fix typo in PKI includes
(cherry picked from commit e2adfdef9e79aa7550e82a12d661718a479aba90)
---
interface-definitions/include/pki/cli-private-key-base64.xml.i | 2 +-
interface-definitions/include/pki/cli-public-key-base64.xml.i | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/interface-definitions/include/pki/cli-private-key-base64.xml.i b/interface-definitions/include/pki/cli-private-key-base64.xml.i
index 3a7ee0ce9..f57e9b198 100644
--- a/interface-definitions/include/pki/cli-private-key-base64.xml.i
+++ b/interface-definitions/include/pki/cli-private-key-base64.xml.i
@@ -1,4 +1,4 @@
-
+
Private key in PEM format
diff --git a/interface-definitions/include/pki/cli-public-key-base64.xml.i b/interface-definitions/include/pki/cli-public-key-base64.xml.i
index 3a7ee0ce9..f7cffae55 100644
--- a/interface-definitions/include/pki/cli-public-key-base64.xml.i
+++ b/interface-definitions/include/pki/cli-public-key-base64.xml.i
@@ -1,11 +1,11 @@
-
+
- Private key in PEM format
+ Public key in PEM format
- Private key is not base64-encoded
+ Public key is not base64-encoded
--
cgit v1.2.3