* [PATCH v3] sshd-regen-keys: do not enable ssh server if previously disabled
@ 2021-02-25 7:47 Q. Gylstorff
2021-03-02 10:03 ` Henning Schild
0 siblings, 1 reply; 2+ messages in thread
From: Q. Gylstorff @ 2021-02-25 7:47 UTC (permalink / raw)
To: isar-users; +Cc: Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
The code 'test -n $SSHD_ENABLED' always returns "0" and enables ssh
even if deactivated previously. Adding quotes(") to evaluate the
variable content instead of variable name.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
Changes V2:
- add missing space
Changes V#:
- clarify commit message
meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh
index 910d879..50f45eb 100644
--- a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh
+++ b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh
@@ -12,7 +12,7 @@ rm -v /etc/ssh/ssh_host_*_key*
echo "Regenerating keys ..."
dpkg-reconfigure openssh-server
-if test -n $SSHD_ENABLED; then
+if [ -n "$SSHD_ENABLED" ]; then
echo "Reenabling ssh server ..."
systemctl enable --no-reload ssh
fi
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-25 7:47 [PATCH v3] sshd-regen-keys: do not enable ssh server if previously disabled Q. Gylstorff
@ 2021-03-02 10:03 ` Henning Schild
0 siblings, 0 replies; 2+ messages in thread
From: Henning Schild @ 2021-03-02 10:03 UTC (permalink / raw)
To: [ext] Q. Gylstorff; +Cc: isar-users
LGTM, i am always a fan of bumping package versions but that is often
not done. You might want to do that here, but i do not feel strong
about it.
Henning
Am Thu, 25 Feb 2021 08:47:12 +0100
schrieb "[ext] Q. Gylstorff" <Quirin.Gylstorff@siemens.com>:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> The code 'test -n $SSHD_ENABLED' always returns "0" and enables ssh
> even if deactivated previously. Adding quotes(") to evaluate the
> variable content instead of variable name.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> Changes V2:
> - add missing space
> Changes V#:
> - clarify commit message
> meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh
> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh index
> 910d879..50f45eb 100644 ---
> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh +++
> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh @@
> -12,7 +12,7 @@ rm -v /etc/ssh/ssh_host_*_key* echo "Regenerating keys
> ..." dpkg-reconfigure openssh-server
> -if test -n $SSHD_ENABLED; then
> +if [ -n "$SSHD_ENABLED" ]; then
> echo "Reenabling ssh server ..."
> systemctl enable --no-reload ssh
> fi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-02 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 7:47 [PATCH v3] sshd-regen-keys: do not enable ssh server if previously disabled Q. Gylstorff
2021-03-02 10:03 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox