Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160244551
D52748.id164185.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52748.id164185.diff
View Options
diff --git a/crypto/openssh/blocklist.c b/crypto/openssh/blocklist.c
--- a/crypto/openssh/blocklist.c
+++ b/crypto/openssh/blocklist.c
@@ -57,7 +57,7 @@
/* internal definition from bl.h */
struct blocklist *bl_create(bool, char *, void (*)(int, const char *, va_list));
-/* impedence match vsyslog() to sshd's internal logging levels */
+/* impedance match vsyslog() to sshd's internal logging levels */
void
im_log(int priority, const char *message, va_list args)
{
@@ -82,7 +82,6 @@
void
blocklist_init(void)
{
-
if (options.use_blocklist)
blstate = bl_create(false, NULL, im_log);
}
@@ -90,8 +89,17 @@
void
blocklist_notify(struct ssh *ssh, int action, const char *msg)
{
+ int fd;
- if (blstate != NULL && ssh_packet_connection_is_on_socket(ssh))
- (void)blocklist_r(blstate, action,
- ssh_packet_get_connection_in(ssh), msg);
+ if (blstate == NULL)
+ blocklist_init();
+ if (blstate == NULL || ssh == NULL)
+ return;
+ fd = ssh_packet_connection_is_on_socket(ssh) ?
+ ssh_packet_get_connection_in(ssh) : 3; /* XXX: 3? */
+ (void)blocklist_r(blstate, action, fd, msg);
+ if (action == BLOCKLIST_AUTH_OK) {
+ blocklist_close(blstate);
+ blstate = NULL;
+ }
}
diff --git a/crypto/openssh/blocklist_client.h b/crypto/openssh/blocklist_client.h
--- a/crypto/openssh/blocklist_client.h
+++ b/crypto/openssh/blocklist_client.h
@@ -57,5 +57,4 @@
#endif
-
#endif /* BLOCKLIST_CLIENT_H */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 23, 12:48 PM (9 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34246540
Default Alt Text
D52748.id164185.diff (1 KB)
Attached To
Mode
D52748: openssh: blocklist: Cleanup blocklist client
Attached
Detach File
Event Timeline
Log In to Comment