Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssh/blacklist.c
- This file was added.
#include <ctype.h> | |||||
rpaulo: Missing some kind of copyright. | |||||
lidlAuthorUnsubmitted Not Done Inline ActionsThis is a verbatim import from NetBSD's patches, but doesn't have a copyright on it. I guess I should put on the NetBSD copyright, and have Christos augment the upstream diffs. lidl: This is a verbatim import from NetBSD's patches, but doesn't have a copyright on it. I guess I… | |||||
#include <stdarg.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <unistd.h> | |||||
#include "ssh.h" | |||||
#include "packet.h" | |||||
#include "log.h" | |||||
#include "blacklist_client.h" | |||||
#include <blacklist.h> | |||||
static struct blacklist *blstate; | |||||
void | |||||
blacklist_init(void) | |||||
{ | |||||
blstate = blacklist_open(); | |||||
} | |||||
void | |||||
blacklist_notify(int a) | |||||
rpauloUnsubmitted Not Done Inline ActionsWhat exactly is "a" ? It's always 1. Please drop the variable if it's not really used. rpaulo: What exactly is "a" ? It's always 1. Please drop the variable if it's not really used. | |||||
lidlAuthorUnsubmitted Not Done Inline ActionsIt's the action (zero = successful login), (one = failed login). Ideally, the code would also send successful login to zero out any bad login counts that are in progress. e.g. - two failed logins from an IP address, and then a successful login would reset the running count of failed logins to zero for that IP address. lidl: It's the action (zero = successful login), (one = failed login).
Ideally, the code would also… | |||||
{ | |||||
int fd; | |||||
if (blstate == NULL) | |||||
blacklist_init(); | |||||
if (blstate == NULL) | |||||
return; | |||||
fd = packet_get_connection_in(); | |||||
Not Done Inline ActionsIndeed, what is fd 3 here? emaste: Indeed, what is fd 3 here? | |||||
if (!packet_connection_is_on_socket()) { | |||||
fprintf(stderr, "packet_connection_is_on_socket: false " | |||||
"(fd = %d)\n", fd); | |||||
} | |||||
(void)blacklist_r(blstate, a, fd, "ssh"); | |||||
} |
Missing some kind of copyright.