Path: blob/main/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.c
49061 views
--- ftpd.c.orig 2026-05-07 15:15:50 UTC1+++ ftpd.c2@@ -77,7 +77,7 @@3#include <security/pam_appl.h>4#endif56-#include "blocklist_client.h"7+#include "blacklist_client.h"8#include "pathnames.h"9#include "extern.h"1011@@ -126,7 +126,7 @@ int noguestmod = 1; /* anon users may not modify exis12int noguestretr = 0; /* RETR command is disabled for anon users. */13int noguestmkd = 0; /* MKD command is disabled for anon users. */14int noguestmod = 1; /* anon users may not modify existing files. */15-int use_blocklist = 0;16+int use_blacklist = 0;1718off_t file_size;19off_t byte_count;20@@ -293,10 +293,10 @@ main(int argc, char *argv[], char **envp)21break;2223case 'B':24-#ifdef USE_BLOCKLIST25- use_blocklist = 1;26+#ifdef USE_BLACKLIST27+ use_blacklist = 1;28#else29- syslog(LOG_WARNING, "not compiled with USE_BLOCKLIST support");30+ syslog(LOG_WARNING, "not compiled with USE_BLACKLIST support");31#endif32break;3334@@ -630,7 +630,7 @@ gotchild:35reply(220, "%s FTP server (%s) ready.", hostname, version);36else37reply(220, "FTP server ready.");38- BLOCKLIST_INIT();39+ BLACKLIST_INIT();40for (;;)41(void) yyparse();42/* NOTREACHED */43@@ -1043,7 +1043,7 @@ user(char *name)44(checkuser(_PATH_FTPUSERS, name, 1, NULL, &ecode) ||45(ecode != 0 && ecode != ENOENT))) {46reply(530, "User %s access denied.", name);47- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied");48+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied");49if (logging)50syslog(LOG_NOTICE,51"FTP LOGIN REFUSED FROM %s, %s",52@@ -1387,7 +1387,7 @@ skip:53*/54if (rval) {55reply(530, "Login incorrect.");56- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Login incorrect");57+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Login incorrect");58if (logging) {59syslog(LOG_NOTICE,60"FTP LOGIN FAILED FROM %s",61@@ -1405,7 +1405,7 @@ skip:62}63return;64} else {65- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_OK, STDIN_FILENO, "Login successful");66+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK, STDIN_FILENO, "Login successful");67}68}69login_attempts = 0; /* this time successful */70@@ -1425,7 +1425,7 @@ skip:71*remote_ip = 0;72remote_ip[sizeof(remote_ip) - 1] = 0;73if (!auth_hostok(lc, remotehost, remote_ip)) {74- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied");75+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied");76syslog(LOG_INFO|LOG_AUTH,77"FTP LOGIN FAILED (HOST) as %s: permission denied.",78pw->pw_name);798081