Skip to content

Commit

Permalink
bconsole: show error messages when connecting to the Director fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Jul 10, 2019
1 parent 171c294 commit 2506fd1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/console/console.cc
Expand Up @@ -1071,25 +1071,33 @@ int main(int argc, char* argv[])
BStringList response_args;

UA_sock = ConnectToDirector(jcr, heart_beat, response_args, response_id);
if (!UA_sock) { return 1; }
if (!UA_sock) {
ConsoleOutput(_("Failed to connect to Director. Giving up.\n"));
TerminateConsole(0);
return 1;
}

UA_sock->OutputCipherMessageString(ConsoleOutput);

if (response_id == kMessageIdPamRequired) {
#if defined(HAVE_PAM)
if (!ExaminePamAuthentication(use_pam_credentials_file,
pam_credentials_filename)) {
ConsoleOutput(_("PAM authentication failed. Giving up.\n"));
TerminateConsole(0);
return 1;
}
response_args.clear();
if (!UA_sock->ReceiveAndEvaluateResponseMessage(response_id,
response_args)) {
ConsoleOutput(_("PAM authentication failed. Giving up.\n"));
TerminateConsole(0);
return 1;
}
#else
Dmsg0(200, "This console does not have the pam feature\n");
ConsoleOutput(
_("PAM authentication requested by Director, however this console "
"does not have this feature. Giving up.\n"));
TerminateConsole(0);
return 1;
#endif /* HAVE_PAM */
Expand Down

0 comments on commit 2506fd1

Please sign in to comment.