]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/authenticate.c
Cleanup new timeout code for bconsole
[bacula/bacula] / bacula / src / dird / authenticate.c
index 61c9ccfe854b8ade8c5f3c6c272359975e861394..673d431cda2d2c6f2d3afa2aa05c05d3e566ad58 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -50,8 +50,9 @@ extern DIRRES *director;
 static char hello[]    = "Hello Director %s calling\n";
 
 /* Response from Storage daemon */
-static char OKhello[]   = "3000 OK Hello\n";
-static char FDOKhello[] = "2000 OK Hello\n";
+static char OKhello[]      = "3000 OK Hello\n";
+static char FDOKhello[]    = "2000 OK Hello\n";
+static char FDOKnewHello[] = "2000 OK Hello %d\n";
 
 /* Sent to User Agent */
 static char Dir_sorry[]  = "1999 You are not authorized.\n";
@@ -115,7 +116,7 @@ bool authenticate_storage_daemon(JCR *jcr, STORE *store)
             "Passwords or names not the same or\n"
             "Maximum Concurrent Jobs exceeded on the SD or\n"
             "SD networking messed up (restart daemon).\n"
-            "Please see http://www.bacula.org/rel-manual/faq.html#AuthorizationErrors for help.\n"),
+            "Please see http://www.bacula.org/en/rel-manual/Bacula_Freque_Asked_Questi.html#SECTION003760000000000000000 for help.\n"),
             sd->host(), sd->port());
       return 0;
    }
@@ -224,7 +225,7 @@ int authenticate_file_daemon(JCR *jcr)
             "Passwords or names not the same or\n"
             "Maximum Concurrent Jobs exceeded on the FD or\n"
             "FD networking messed up (restart daemon).\n"
-            "Please see http://www.bacula.org/rel-manual/faq.html#AuthorizationErrors for help.\n"),
+            "Please see http://www.bacula.org/en/rel-manual/Bacula_Freque_Asked_Questi.html#SECTION003760000000000000000 for help.\n"),
             fd->host(), fd->port());
       return 0;
    }
@@ -249,7 +250,6 @@ int authenticate_file_daemon(JCR *jcr)
    if (tls_local_need >= BNET_TLS_OK && tls_remote_need >= BNET_TLS_OK) {
       /* Engage TLS! Full Speed Ahead! */
       if (!bnet_tls_client(client->tls_ctx, fd, client->tls_allowed_cns)) {
-
          stop_bsock_timer(tid);
          Jmsg(jcr, M_FATAL, 0, _("TLS negotiation failed with FD at \"%s:%d\".\n"),
               fd->host(), fd->port());
@@ -269,9 +269,11 @@ int authenticate_file_daemon(JCR *jcr)
          fd->host(), fd->port(), fd->bstrerror());
       return 0;
    }
-   Dmsg1(110, "<stored: %s", fd->msg);
+   Dmsg1(110, "<filed: %s", fd->msg);
    stop_bsock_timer(tid);
-   if (strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0) {
+   jcr->FDVersion = 0;
+   if (strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0 &&
+       sscanf(fd->msg, FDOKnewHello, &jcr->FDVersion) != 1) {
       Dmsg0(dbglvl, _("File daemon rejected Hello command\n"));
       Jmsg(jcr, M_FATAL, 0, _("File daemon at \"%s:%d\" rejected Hello command\n"),
            fd->host(), fd->port());