From 006127a476572a8772a3bb2019bb4854babcf0e1 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Thu, 13 Feb 2025 12:29:58 +0100 Subject: [PATCH] Fix regression of Match directive processing Related: RHEL-76317 --- openssh-9.9p1-match-regression.patch | 10 +++++++++- openssh.spec | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openssh-9.9p1-match-regression.patch b/openssh-9.9p1-match-regression.patch index d724401..73ea964 100644 --- a/openssh-9.9p1-match-regression.patch +++ b/openssh-9.9p1-match-regression.patch @@ -137,7 +137,7 @@ index 89b8413e..dd774f46 100644 /* Terminate on comment */ if (*attrib == '#') { argv_consume(acp); /* mark all arguments consumed */ -@@ -1062,11 +1063,13 @@ match_cfg_line(const char *full_line, int *acp, char ***avp, +@@ -1062,16 +1063,20 @@ match_cfg_line(const char *full_line, int *acp, char ***avp, *arg != '\0' && *arg != '#')) { error("'all' cannot be combined with other " "Match attributes"); @@ -153,6 +153,14 @@ index 89b8413e..dd774f46 100644 } /* Criterion "invalid-user" also has no argument */ if (strcasecmp(attrib, "invalid-user") == 0) { +- if (ci == NULL) ++ if (ci == NULL) { ++ result = 0; + continue; ++ } + if (ci->user_invalid == 0) + result = 0; + else @@ -1078,11 +1081,26 @@ match_cfg_line(const char *full_line, int *acp, char ***avp, debug("matched invalid-user at line %d", line); continue; diff --git a/openssh.spec b/openssh.spec index 2fbe64f..e87ae6f 100644 --- a/openssh.spec +++ b/openssh.spec @@ -39,12 +39,12 @@ %{?static_openssl:%global static_libcrypto 1} %global openssh_ver 9.9p1 -%global openssh_rel 5 +%global openssh_rel 6 Summary: An open source implementation of SSH protocol version 2 Name: openssh Version: %{openssh_ver} -Release: %{openssh_rel}%{?dist}.1 +Release: %{openssh_rel}%{?dist} URL: http://www.openssh.com/portable.html Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc @@ -666,6 +666,10 @@ test -f %{sysconfig_anaconda} && \ %attr(0755,root,root) %{_libdir}/sshtest/sk-dummy.so %changelog +* Thu Feb 13 2025 Dmitry Belyavskiy - 9.9p1-6 +- Fix regression of Match directive processing + Related: RHEL-76317 + * Mon Jan 27 2025 Dmitry Belyavskiy - 9.9p1-5 - Fix regression of Match directive processing Resolves: RHEL-76317