]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/authenticate.c
Use the command line utility dropdb instead of the psql command
[bacula/bacula] / bacula / src / stored / authenticate.c
index fa9b215497ceffeb01f7584afe3666b21d0da1e2..5b0ce30e9eac0a0c098eedb1258c792b80a78c40 100644 (file)
@@ -41,6 +41,7 @@ static int authenticate(int rcode, BSOCK *bs)
 {
    POOLMEM *dirname;
    DIRRES *director = NULL;
+   int ssl_need = BNET_SSL_NONE;
 
    if (rcode != R_DIRECTOR) {
       Emsg1(M_FATAL, 0, _("I only authenticate Directors, not %d\n"), rcode);
@@ -73,8 +74,8 @@ static int authenticate(int rcode, BSOCK *bs)
            dirname, bs->who);
       goto bail_out;
    }
-   if (!cram_md5_auth(bs, director->password) ||
-       !cram_md5_get_auth(bs, director->password)) {
+   if (!cram_md5_auth(bs, director->password, ssl_need) ||
+       !cram_md5_get_auth(bs, director->password, ssl_need)) {
       Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"));
       goto bail_out;
    }
@@ -105,7 +106,7 @@ int authenticate_director(JCR *jcr)
    if (!authenticate(R_DIRECTOR, dir)) {
       bnet_fsend(dir, "%s", Dir_sorry);
       Emsg1(M_ERROR, 0, _("Unable to authenticate Director at %s.\n"), dir->who);
-      sleep(5);
+      bmicrosleep(5, 0);
       return 0;
    }
    return bnet_fsend(dir, "%s", OK_hello);
@@ -114,9 +115,10 @@ int authenticate_director(JCR *jcr)
 int authenticate_filed(JCR *jcr)
 {
    BSOCK *fd = jcr->file_bsock;
+   int ssl_need = BNET_SSL_NONE;
 
-   if (cram_md5_auth(fd, jcr->sd_auth_key) &&
-       cram_md5_get_auth(fd, jcr->sd_auth_key)) {
+   if (cram_md5_auth(fd, jcr->sd_auth_key, ssl_need) &&
+       cram_md5_get_auth(fd, jcr->sd_auth_key, ssl_need)) {
       jcr->authenticated = TRUE;
    }
    if (!jcr->authenticated) {