On Fri, Jan 19, 2024 at 12:04:44PM +0100, Philipp Rudo wrote:
Hi Lichen,
looks good to me
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
On Fri, 5 Jan 2024 14:40:12 +0800
Lichen Liu <lichliu(a)redhat.com> wrote:
> Resolves:
https://issues.redhat.com/browse/FC-1046
>
> We require that <user> be explicitly specified in 'ssh
<user>@<hostname>'. When
> forgetting to specify, such as 'ssh 192.168.10.2', a useful error log should
be
> printed instead of exiting directly.
>
> Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
> ---
> kdumpctl | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index 3da5fff..45277a7 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -748,7 +748,12 @@ check_ssh_config()
> [[ "${OPT[_fstype]}" == ssh ]] || return 0
>
> target=$(ssh -G "${OPT[_target]}" | sed -n -e
"s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
> - [[ ${OPT[_target]} =~ .*@.* ]] || return 1
> +
> + if [[ ${OPT[_target]} != *@* ]]; then
> + derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh
<user>@<host>' and that it is properly formatted."
> + return 1
> + fi
> +
> if [[ ${OPT[_target]#*@} != "$target" ]]; then
> derror "Invalid ssh destination ${OPT[_target]} provided."
> return 1
--
_______________________________________________
kexec mailing list -- kexec(a)lists.fedoraproject.org
To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
Do not reply to spam, report it:
https://pagure.io/fedora-infrastructure/new_issue
Patch merged, thanks to Lichen and Philipp!
--
Best regards,
Coiby