user->recv(); /* Get first message */
if (!authenticate_user_agent(ua)) {
+ events_send_msg(ua->jcr, "DS0001", EVENTS_TYPE_SECURITY,
+ user->host(), (intptr_t)ua->jcr,
+ "Authentication failed from %s",
+ user->host());
goto getout;
}
bool found, quit;
bool first = true;
JCR *jcr;
-
- char from[512];
- dir->get_peer(from, sizeof(from));
-
suspendres_t suspend;
prevent_os_suspensions(suspend); /* do not suspend during backup/restore */
bail_out:
/* Keep track of the important events */
- if (dir && !jcr->authenticated) {
+ if (dir && jcr && !jcr->authenticated) {
events_send_msg(jcr, "FS0001", EVENTS_TYPE_SECURITY,
- from, (intptr_t)jcr, "Authentication failed");
+ dir->host(), (intptr_t)jcr,
+ "Authentication failed from %s",
+ dir->host());
}
dequeue_messages(jcr); /* send any queued messages, will no longer impact
Qmsg3(jcr, M_SECURITY, 0, _("Connection from unknown Director %s at %s:%s rejected.\n"
"Please see " MANUAL_AUTH_URL " for help.\n"),
dirname, dir->who(), dir->host());
+
+ events_send_msg(jcr, "SS0001", EVENTS_TYPE_SECURITY,
+ dir->host(), (intptr_t)jcr,
+ "Authentication failed from %s",
+ dir->host());
free_pool_memory(dirname);
sleep(5);
return false;