* [PATCH] sshd-regen-keys: do not enable ssh server if previously disabled
@ 2021-02-24 13:32 Q. Gylstorff
2021-02-24 13:41 ` [PATCH v2] " Q. Gylstorff
2021-02-24 13:45 ` [PATCH] " florian.bezdeka
0 siblings, 2 replies; 6+ messages in thread
From: Q. Gylstorff @ 2021-02-24 13:32 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.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
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..efcff3e 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] 6+ messages in thread
* [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-24 13:32 [PATCH] sshd-regen-keys: do not enable ssh server if previously disabled Q. Gylstorff
@ 2021-02-24 13:41 ` Q. Gylstorff
2021-02-24 20:26 ` Henning Schild
2021-02-24 13:45 ` [PATCH] " florian.bezdeka
1 sibling, 1 reply; 6+ messages in thread
From: Q. Gylstorff @ 2021-02-24 13:41 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.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
Changes V2:
add missing space
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] 6+ messages in thread
* Re: [PATCH] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-24 13:32 [PATCH] sshd-regen-keys: do not enable ssh server if previously disabled Q. Gylstorff
2021-02-24 13:41 ` [PATCH v2] " Q. Gylstorff
@ 2021-02-24 13:45 ` florian.bezdeka
1 sibling, 0 replies; 6+ messages in thread
From: florian.bezdeka @ 2021-02-24 13:45 UTC (permalink / raw)
To: quirin.gylstorff, isar-users
On Wed, 2021-02-24 at 14:32 +0100, [ext] Q. Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> The code 'test -n $SSHD_ENABLED' always returns "0" and enables ssh
> even if deactivated previously.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> 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..efcff3e 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
Isn't that a syntax error?
- if [-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] 6+ messages in thread
* Re: [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-24 13:41 ` [PATCH v2] " Q. Gylstorff
@ 2021-02-24 20:26 ` Henning Schild
2021-02-24 20:32 ` Henning Schild
0 siblings, 1 reply; 6+ messages in thread
From: Henning Schild @ 2021-02-24 20:26 UTC (permalink / raw)
To: [ext] Q. Gylstorff; +Cc: isar-users
Am Wed, 24 Feb 2021 14:41:45 +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.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> Changes V2:
> add missing space
> 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
Not sure i understand that. But i guess 'test -n "$SSHD_ENABLED"' would
also work, so we are looking at a quoting problem and the whole [] is
just syntactic sugar.
Sugar i would approve, just asking.
Henning
> echo "Reenabling ssh server ..."
> systemctl enable --no-reload ssh
> fi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-24 20:26 ` Henning Schild
@ 2021-02-24 20:32 ` Henning Schild
2021-02-25 7:36 ` Gylstorff Quirin
0 siblings, 1 reply; 6+ messages in thread
From: Henning Schild @ 2021-02-24 20:32 UTC (permalink / raw)
To: [ext] Q. Gylstorff; +Cc: isar-users
Am Wed, 24 Feb 2021 21:26:12 +0100
schrieb "[ext] Henning Schild" <henning.schild@siemens.com>:
> Am Wed, 24 Feb 2021 14:41:45 +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.
> >
> > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > ---
> > Changes V2:
> > add missing space
> > 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
>
> Not sure i understand that. But i guess 'test -n "$SSHD_ENABLED"'
> would also work, so we are looking at a quoting problem and the whole
> [] is just syntactic sugar.
>
> Sugar i would approve, just asking.
If it is all about quoting, maybe the commit message can be improved to
reflect that.
Henning
> Henning
>
> > echo "Reenabling ssh server ..."
> > systemctl enable --no-reload ssh
> > fi
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled
2021-02-24 20:32 ` Henning Schild
@ 2021-02-25 7:36 ` Gylstorff Quirin
0 siblings, 0 replies; 6+ messages in thread
From: Gylstorff Quirin @ 2021-02-25 7:36 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 2/24/21 9:32 PM, Henning Schild wrote:
> Am Wed, 24 Feb 2021 21:26:12 +0100
> schrieb "[ext] Henning Schild" <henning.schild@siemens.com>:
>
>> Am Wed, 24 Feb 2021 14:41:45 +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.
>>>
>>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>> ---
>>> Changes V2:
>>> add missing space
>>> 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
>>
>> Not sure i understand that. But i guess 'test -n "$SSHD_ENABLED"'
>> would also work, so we are looking at a quoting problem and the whole
>> [] is just syntactic sugar.
>>
>> Sugar i would approve, just asking.
>
> If it is all about quoting, maybe the commit message can be improved to
> reflect that.
>
> Henning
It is a quoting problem. I will add some text to the commit message and
send a v3.
Quirin
>
>> Henning
>>
>>> echo "Reenabling ssh server ..."
>>> systemctl enable --no-reload ssh
>>> fi
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-25 7:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 13:32 [PATCH] sshd-regen-keys: do not enable ssh server if previously disabled Q. Gylstorff
2021-02-24 13:41 ` [PATCH v2] " Q. Gylstorff
2021-02-24 20:26 ` Henning Schild
2021-02-24 20:32 ` Henning Schild
2021-02-25 7:36 ` Gylstorff Quirin
2021-02-24 13:45 ` [PATCH] " florian.bezdeka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox