]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.2.x/2.2.5-deamon.patch
This patch prevents the 'status dir' command from trying to use a scratch
[bacula/bacula] / bacula / patches / 2.2.x / 2.2.5-deamon.patch
1
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.
7
8  Apply this fix to Bacula version 2.2.5 with:
9
10  cd <bacula-source>
11  patch -p0 <2.2.5-daemon.patch
12  ./configure (your options)
13  make
14  ...
15  make install
16
17
18 Index: src/lib/message.c
19 ===================================================================
20 --- src/lib/message.c   (revision 5744)
21 +++ src/lib/message.c   (working copy)
22 @@ -52,7 +52,8 @@
23   */
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 */
32 @@ -1338,7 +1339,7 @@
33        jcr = get_jcr_from_tsd();
34     }
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);
40        free(item);