]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/console/authenticate.c
Don't require default level
[bacula/bacula] / bacula / src / console / authenticate.c
index b378a0976f84a6b1f544a8ad0f9dce563568d67a..ef679da18266d8966abe49b2e57879e6c8e73fe7 100644 (file)
@@ -33,6 +33,9 @@
 #include "jcr.h"
 
 
+void senditf(char *fmt, ...);
+void sendit(char *buf); 
+
 /* Commands sent to Director */
 static char hello[]    = "Hello %s calling\n";
 
@@ -56,24 +59,23 @@ int authenticate_director(JCR *jcr, DIRRES *director)
 
    if (!cram_md5_get_auth(dir, director->password, ssl_need) || 
        !cram_md5_auth(dir, director->password, ssl_need)) {
-      Pmsg0(-1, _("Director authorization problem.\n"
+      sendit( _("Director authorization problem.\n"
             "Most likely the passwords do not agree.\n"));  
       return 0;
    }
 
    Dmsg1(6, ">dird: %s", dir->msg);
    if (bnet_recv(dir) <= 0) {
-      Pmsg1(-1, "Bad response to Hello command: ERR=%s\n",
+      senditf(_("Bad response to Hello command: ERR=%s\n"),
         bnet_strerror(dir));
-      Pmsg0(-1, "The Director is probably not running.\n");
       return 0;
    }
    Dmsg1(10, "<dird: %s", dir->msg);
    if (strncmp(dir->msg, OKhello, sizeof(OKhello)-1) != 0) {
-      Pmsg0(-1, "Director rejected Hello command\n");
+      sendit(_("Director rejected Hello command\n"));
       return 0;
    } else {
-      Pmsg1(-1, "%s", dir->msg);
+      sendit(dir->msg);
    }
    return 1;
 }