2 This patch fixes the default behavior of a non-DEVELOPER version of Bacula
3 to close STDIN, STDOUT, and STDERR so that an ssh that starts bacula
4 will not hang. It also fixes a crash in bat when bat is executed and
5 cannot connect to the Director (e.g. it is not running).
6 This patch fixes bugs #991 and #993.
8 Apply this fix to Bacula version 2.2.5 with:
11 patch -p0 <2.2.5-daemon.patch
12 ./configure (your options)
18 Index: src/lib/message.c
19 ===================================================================
20 --- src/lib/message.c (revision 5744)
21 +++ src/lib/message.c (working copy)
24 const char *working_directory = NULL; /* working directory path stored here */
25 int verbose = 0; /* increase User messages */
26 -int debug_level = 1; /* debug level */
27 +/* Keep debug level set to zero by default */
28 +int debug_level = 0; /* debug level */
29 time_t daemon_start_time = 0; /* Daemon start time */
30 const char *version = VERSION " (" BDATE ")";
31 char my_name[30]; /* daemon name is stored here */
33 jcr = get_jcr_from_tsd();
35 /* If no jcr or dequeuing send to daemon to avoid recursion */
36 - if (!jcr || jcr->dequeuing) {
37 + if ((jcr && !jcr->msg_queue) || !jcr || jcr->dequeuing) {
38 /* jcr==NULL => daemon message, safe to send now */
39 Jmsg(jcr, item->type, item->mtime, "%s", item->msg);