]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Add security event message after incorrect connection to a FD
authorEric Bollengier <eric@baculasystems.com>
Wed, 6 Apr 2022 10:26:21 +0000 (12:26 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
bacula/src/filed/job.c

index d2d1d6702f8ddb1b50efa4dea88777ac7d6c3414..d745e97ae9f139660d1bb61dd392dc0eb07c81b4 100644 (file)
@@ -353,6 +353,10 @@ static void *handle_director_request(BSOCK *dir)
    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 */
 
@@ -441,7 +445,6 @@ static void *handle_director_request(BSOCK *dir)
       dir->fsend(EndJob, jcr->JobStatus, jcr->JobFiles,
               jcr->ReadBytes, jcr->JobBytes, jcr->JobErrors, vss,
               encrypt, CommBytes, CommCompressedBytes);
-      //Dmsg0(0, dir->msg);
    }
 
    generate_daemon_event(jcr, "JobEnd");
@@ -453,6 +456,12 @@ static void *handle_director_request(BSOCK *dir)
                    (intptr_t)jcr, "Director disconnection");
 
 bail_out:
+   /* Keep track of the important events */
+   if (dir && !jcr->authenticated) {
+      events_send_msg(jcr, "FS0001", EVENTS_TYPE_SECURITY,
+                      from, (intptr_t)jcr, "Authentication failed");
+   }
+
    dequeue_messages(jcr);  /* send any queued messages, will no longer impact
                             * the job status... */
    dequeue_daemon_messages(jcr);