Log foreign IP address together with hostname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1376 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -579,7 +579,8 @@ user(char *name)
|
|||||||
reply(530, "User %s unknown.", name);
|
reply(530, "User %s unknown.", name);
|
||||||
if (!askpasswd && logging)
|
if (!askpasswd && logging)
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"ANONYMOUS FTP LOGIN REFUSED FROM %s", remotehost);
|
"ANONYMOUS FTP LOGIN REFUSED FROM %s(%s)",
|
||||||
|
remotehost, inet_ntoa(his_addr.sin_addr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((auth_level & AUTH_PLAIN) == 0 && !auth_complete){
|
if((auth_level & AUTH_PLAIN) == 0 && !auth_complete){
|
||||||
@@ -598,8 +599,10 @@ user(char *name)
|
|||||||
reply(530, "User %s access denied.", name);
|
reply(530, "User %s access denied.", name);
|
||||||
if (logging)
|
if (logging)
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"FTP LOGIN REFUSED FROM %s, %s",
|
"FTP LOGIN REFUSED FROM %s(%s), %s",
|
||||||
remotehost, name);
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr),
|
||||||
|
name);
|
||||||
pw = (struct passwd *) NULL;
|
pw = (struct passwd *) NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -727,8 +730,10 @@ int do_login(int code, char *passwd)
|
|||||||
setproctitle(proctitle);
|
setproctitle(proctitle);
|
||||||
#endif /* HAVE_SETPROCTITLE */
|
#endif /* HAVE_SETPROCTITLE */
|
||||||
if (logging)
|
if (logging)
|
||||||
syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s, %s",
|
syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s(%s), %s",
|
||||||
remotehost, passwd);
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr),
|
||||||
|
passwd);
|
||||||
} else {
|
} else {
|
||||||
reply(code, "User %s logged in.", pw->pw_name);
|
reply(code, "User %s logged in.", pw->pw_name);
|
||||||
#ifdef HAVE_SETPROCTITLE
|
#ifdef HAVE_SETPROCTITLE
|
||||||
@@ -736,8 +741,10 @@ int do_login(int code, char *passwd)
|
|||||||
setproctitle(proctitle);
|
setproctitle(proctitle);
|
||||||
#endif /* HAVE_SETPROCTITLE */
|
#endif /* HAVE_SETPROCTITLE */
|
||||||
if (logging)
|
if (logging)
|
||||||
syslog(LOG_INFO, "FTP LOGIN FROM %s as %s",
|
syslog(LOG_INFO, "FTP LOGIN FROM %s(%s) as %s",
|
||||||
remotehost, pw->pw_name);
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr),
|
||||||
|
pw->pw_name);
|
||||||
}
|
}
|
||||||
umask(defumask);
|
umask(defumask);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -810,13 +817,16 @@ pass(char *passwd)
|
|||||||
reply(530, "Login incorrect.");
|
reply(530, "Login incorrect.");
|
||||||
if (logging)
|
if (logging)
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"FTP LOGIN FAILED FROM %s, %s",
|
"FTP LOGIN FAILED FROM %s(%s), %s",
|
||||||
remotehost, curname);
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr),
|
||||||
|
curname);
|
||||||
pw = NULL;
|
pw = NULL;
|
||||||
if (login_attempts++ >= 5) {
|
if (login_attempts++ >= 5) {
|
||||||
syslog(LOG_NOTICE,
|
syslog(LOG_NOTICE,
|
||||||
"repeated login failures from %s",
|
"repeated login failures from %s(%s)",
|
||||||
remotehost);
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr));
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -1651,7 +1661,9 @@ dolog(struct sockaddr_in *sin)
|
|||||||
#endif /* HAVE_SETPROCTITLE */
|
#endif /* HAVE_SETPROCTITLE */
|
||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
syslog(LOG_INFO, "connection from %s", remotehost);
|
syslog(LOG_INFO, "connection from %s(%s)",
|
||||||
|
remotehost,
|
||||||
|
inet_ntoa(his_addr.sin_addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user