Permalink
Browse files

nickserv/logout: Improve logging for external logout:

 * Log authentication failures.
 * Only register a bad password attempt if a password was actually given.
  • Loading branch information...
1 parent 112525b commit 8733f796e5adff8289087d7a7157d7d69ce78efd @jillest jillest committed Dec 20, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 modules/nickserv/logout.c
@@ -61,12 +61,18 @@ static void ns_cmd_logout(sourceinfo_t *si, int parc, char *parv[])
if (u->myuser == si->smu || (pass != NULL && verify_password(u->myuser, pass)))
notice(nicksvs.nick, u->nick, "You were logged out by \2%s\2.", si->su->nick);
- else
+ else if (pass != NULL)
{
+ logcommand(si, CMDLOG_LOGIN, "failed LOGOUT \2%s\2 (bad password)", u->nick);
command_fail(si, fault_authfail, _("Authentication failed. Invalid password for \2%s\2."), entity(u->myuser)->name);
bad_password(si, u->myuser);
return;
}
+ else
+ {
+ command_fail(si, fault_authfail, _("You may not log out \2%s\2."), u->nick);
+ return;
+ }
}
else if (si->su == NULL)
{

0 comments on commit 8733f79

Please sign in to comment.