tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

blocklistd detects a failure for a killed ssh session



On Monday 21 Nov 2022, at 23:21, Anthony Mallet wrote:
> Would there be a way to improve this, by detecting properly
> established connections and not notify blacklistd anymore about these?

Maybe like this?

Index: crypto/external/bsd/openssh/dist/pfilter.c
===================================================================
RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/pfilter.c,v
retrieving revision 1.8
diff -u -r1.8 pfilter.c
--- crypto/external/bsd/openssh/dist/pfilter.c	15 Jun 2020 01:57:29 -0000	1.8
+++ crypto/external/bsd/openssh/dist/pfilter.c	21 Nov 2022 23:39:42 -0000
@@ -3,6 +3,8 @@
 #include "includes.h"
 #include "ssh.h"
 #include "packet.h"
+#include "hostfile.h"
+#include "auth.h"
 #include "log.h"
 #include "pfilter.h"
 #include <blocklist.h>
@@ -23,6 +25,7 @@
 }
 
 extern struct ssh *the_active_state;
+extern Authctxt *the_authctxt;
 
 void
 pfilter_notify(int a)
@@ -31,6 +34,8 @@
 	int fd;
 	if (the_active_state == NULL)
 		return;
+	if (the_authctxt != NULL && the_authctxt->authenticated == 1)
+		return;
 	if (blstate == NULL)
 		pfilter_init();
 	if (blstate == NULL)


Home | Main Index | Thread Index | Old Index