#include "jcr.h"
+void senditf(char *fmt, ...);
+void sendit(char *buf);
+
/* Commands sent to Director */
static char hello[] = "Hello %s calling\n";
int authenticate_director(JCR *jcr, DIRRES *director)
{
BSOCK *dir = jcr->dir_bsock;
+ int ssl_need = BNET_SSL_NONE;
/*
* Send my name to the Director then do authentication
*/
bnet_fsend(dir, hello, "UserAgent");
- if (!cram_md5_get_auth(dir, director->password) ||
- !cram_md5_auth(dir, director->password)) {
- Pmsg0(-1, _("Director authorization problem.\n"
+ if (!cram_md5_get_auth(dir, director->password, ssl_need) ||
+ !cram_md5_auth(dir, director->password, ssl_need)) {
+ 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;
}