[openssh-commits] [openssh] 03/05: upstream: include line number in Match debug messages, makes it a

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Feb 11 10:35:35 AEDT 2025


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 857ac20f5fe19f183defba5dbf4b7d9e6400230c
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Mon Feb 10 23:16:51 2025 +0000

    upstream: include line number in Match debug messages, makes it a
    
    little easier to see what's going on
    
    OpenBSD-Commit-ID: 1fcf4aa2ee667711b9497ded0fa52d757c69b1df
---
 servconf.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/servconf.c b/servconf.c
index a4905500..61f758b7 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.422 2025/02/10 23:00:29 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.423 2025/02/10 23:16:51 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -1039,16 +1039,17 @@ match_cfg_line(const char *full_line, int *acp, char ***avp,
 	int result = 1, attributes = 0, port;
 	char *arg, *attrib = NULL, *oattrib;
 
-	if (ci == NULL)
-		debug3("checking syntax for 'Match %s'", full_line);
-	else {
+	if (ci == NULL) {
+		debug3("checking syntax for 'Match %s' on line %d",
+		    full_line, line);
+	} else {
 		debug3("checking match for '%s' user %s%s host %s addr %s "
-		    "laddr %s lport %d", full_line,
+		    "laddr %s lport %d on line %d", full_line,
 		    ci->user ? ci->user : "(null)",
 		    ci->user_invalid ? " (invalid)" : "",
 		    ci->host ? ci->host : "(null)",
 		    ci->address ? ci->address : "(null)",
-		    ci->laddress ? ci->laddress : "(null)", ci->lport);
+		    ci->laddress ? ci->laddress : "(null)", ci->lport, line);
 	}
 
 	while ((oattrib = argv_next(acp, avp)) != NULL) {
@@ -1077,10 +1078,8 @@ match_cfg_line(const char *full_line, int *acp, char ***avp,
 		}
 		/* Criterion "invalid-user" also has no argument */
 		if (strcasecmp(attrib, "invalid-user") == 0) {
-			if (ci == NULL) {
-				result = 0;
+			if (ci == NULL)
 				continue;
-			}
 			if (ci->user_invalid == 0)
 				result = 0;
 			else
@@ -1241,7 +1240,7 @@ match_cfg_line(const char *full_line, int *acp, char ***avp,
 	}
  out:
 	if (ci != NULL && result != -1)
-		debug3("match %sfound", result ? "" : "not ");
+		debug3("match %sfound on line %d", result ? "" : "not ", line);
 	free(attrib);
 	return result;
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list