]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Add PATH command to SunOS part of mtx-changer.in so that sed and
authorKern Sibbald <kern@sibbald.com>
Tue, 16 Oct 2007 19:10:47 +0000 (19:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 16 Oct 2007 19:10:47 +0000 (19:10 +0000)
     awk are on the path.
kes  Redirect stderror to stdin on mt status command in mtx-changer.in
     since the status is returned on stderr on Solaris.
kes  Activate Close button on tray-monitor window. This fixes
     bug #986.
kes  Check for NULL item in parse_conf.c before calling it.  In the
     case of Device, there is no item and this caused a seg fault when
     Device appears in the conf file.
kes  Add a #define __CONFIG_H when including config.h in bacula.h. This
     avoids pulling in config.h multiple times in some new code.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5753 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/LICENSE
bacula/patches/2.2.5-nextvol.patch [new file with mode: 0644]
bacula/patches/2.2.5-tray-monitor.patch [new file with mode: 0644]
bacula/scripts/mtx-changer.in
bacula/src/bacula.h
bacula/src/bc_types.h
bacula/src/dird/newvol.c
bacula/src/lib/parse_conf.c
bacula/src/lib/res.c
bacula/src/stored/scan.c
bacula/technotes-2.3

index 83f25f9a71befc12fa70053d731ef90743ad3f0c..d9b5fd4fb3fe94da70ce782f692fcd20f2b39c9f 100644 (file)
@@ -36,7 +36,7 @@ with the OpenSSL license, and so with the exception that we have
 made to the GPLv2 above, Bacula can be freely linked and distributed
 with the OpenSSL libraries.
 
-IP rights:
+Intellectual Property rights:
 Recipient understands that although each Contributor grants the
 licenses to its Contributions set forth herein, no assurances are
 provided by any Contributor that the Program does not infringe
diff --git a/bacula/patches/2.2.5-nextvol.patch b/bacula/patches/2.2.5-nextvol.patch
new file mode 100644 (file)
index 0000000..27bf0d5
--- /dev/null
@@ -0,0 +1,29 @@
+
+  This bug fixes the warning message that prints each time an automatic
+  Volume name is created.  This fixes bug #979
+
+  This patch applies to Bacula version 2.2.5 (not to previous versions),
+  and can be applied with the following:
+
+  cd <bacula-source>
+  patch -p0 <2.2.5-newvol.patch
+  ./configure (your options)
+  make
+  ...
+  make install
+
+
+
+Index: src/dird/newvol.c
+===================================================================
+--- src/dird/newvol.c  (revision 5717)
++++ src/dird/newvol.c  (working copy)
+@@ -124,7 +124,7 @@
+    mr->VolumeName[0] = 0;
+    bstrncpy(name, pr->LabelFormat, sizeof(name));
+    ctx.value = 0;
+-   Mmsg(query, "SELECT MAX(MediaId) FROM Media,POOL WHERE Pool.PoolId=%s", 
++   Mmsg(query, "SELECT MAX(MediaId) FROM Media,Pool WHERE Pool.PoolId=%s", 
+         edit_int64(pr->PoolId, ed1));
+    if (!db_sql_query(jcr->db, query.c_str(), db_int64_handler, (void *)&ctx)) {
+       Jmsg(jcr, M_WARNING, 0, _("SQL failed, but ignored. ERR=%s\n"), db_strerror(jcr->db));
diff --git a/bacula/patches/2.2.5-tray-monitor.patch b/bacula/patches/2.2.5-tray-monitor.patch
new file mode 100644 (file)
index 0000000..542aea7
--- /dev/null
@@ -0,0 +1,25 @@
+
+ This patch activates the Close button in the tray monitor window.
+ It fixes bug #986.
+
+ Apply it to Bacula version 2.2.5 with:
+
+ cd <bacula-source>
+ patch -p0 <2.2.5-tray-monitor.patch
+ make
+ ...
+ make install
+
+Index: src/tray-monitor/tray-monitor.c
+===================================================================
+--- src/tray-monitor/tray-monitor.c    (revision 5717)
++++ src/tray-monitor/tray-monitor.c    (working copy)
+@@ -478,7 +478,7 @@
+    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
+    button = new_image_button("gtk-close", _("Close"));
+-// g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window));
++   g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window));
+    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
index 0b475a672dff6f769c16203169aed6fdeec7609a..60630a5531e8aeb8dba60eca7cb40a88736c39b4 100644 (file)
@@ -57,6 +57,8 @@ OS=`uname`
 case ${OS} in
   SunOS)
     ready="No Additional Sense"
+    # Sun sed/awk etc are not sufficient, working versions are in /usr/xpg4/bin
+    export PATH="/usr/local/sbin:/usr/local/bin:/usr/sfw/bin:/usr/xpg4/bin:/usr/bin"
     ;;
   FreeBSD)
     ready="Current Driver State: at rest."
@@ -108,7 +110,7 @@ make_temp_file() {
 wait_for_drive() {
   i=0 
   while [ $i -le 300 ]; do  # Wait max 300 seconds
-    if mt -f $1 status | grep "${ready}" >/dev/null 2>&1; then
+    if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then
       break
     fi
     debug "Device $1 - not ready, retrying..."
index fe95239896f91d2d057998c02ac771032cd0fba9..07b1af6ceacdb9a10c7e37eaf8eeefe5495899e2 100644 (file)
@@ -48,6 +48,7 @@
 #else
 #include "config.h"
 #endif
+#define __CONFIG_H
 
 
 #define _REENTRANT    1
index 7829b6d10797aad37e879d71ce6eefe99925c390..cb289f2319d0dfc3b1627ebf4a2d5eaec93c06f5 100644 (file)
@@ -1,25 +1,7 @@
-/*
-    Define integer types for Bacula -- Kern Sibbald
-
-    Integer types.  These types should be be used in all
-    contexts in which the length of an integer stored on
-    removable media must be known regardless of the
-    architecture of the platform.
-
-    Bacula types are:
-
-    int8_t,  int16_t,  int32_t,  int64_t
-    uint8_t, uint16_t, uint32_t, uint64_t
-
-    Also, we define types such as file address lengths.
-
-    Version $Id$
-
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+    Define integer types for Bacula -- Kern Sibbald
+
+    Integer types.  These types should be be used in all
+    contexts in which the length of an integer stored on
+    removable media must be known regardless of the
+    architecture of the platform.
+
+    Bacula types are:
+
+    int8_t,  int16_t,  int32_t,  int64_t
+    uint8_t, uint16_t, uint32_t, uint64_t
+
+    Also, we define types such as file address lengths.
+
+    Version $Id$
+
+ */
 
 
 #ifndef __bc_types_INCLUDED
index c66b8133258fb70711a16d4c9af125535cf243af..b15ade839d102e66c9ac2e3b15652acb9290b936 100644 (file)
@@ -124,7 +124,7 @@ static bool create_simple_name(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr)
    mr->VolumeName[0] = 0;
    bstrncpy(name, pr->LabelFormat, sizeof(name));
    ctx.value = 0;
-   Mmsg(query, "SELECT MAX(MediaId) FROM Media,POOL WHERE Pool.PoolId=%s", 
+   Mmsg(query, "SELECT MAX(MediaId) FROM Media,Pool WHERE Pool.PoolId=%s", 
         edit_int64(pr->PoolId, ed1));
    if (!db_sql_query(jcr->db, query.c_str(), db_int64_handler, (void *)&ctx)) {
       Jmsg(jcr, M_WARNING, 0, _("SQL failed, but ignored. ERR=%s\n"), db_strerror(jcr->db));
index 8968853cb208331b2a79b20e98bbb76f14b4651e..ac7536b173f74580e7bea91d3fe0a962dbc00ab7 100644 (file)
@@ -823,7 +823,8 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type)
       }
       lex_set_error_handler_error_type(lc, err_type) ;
       while ((token=lex_get_token(lc, T_ALL)) != T_EOF) {
-         Dmsg1(900, "parse got token=%s\n", lex_tok_to_str(token));
+         Dmsg3(900, "parse state=%d pass=%d got token=%s\n", state, pass,
+              lex_tok_to_str(token));
          switch (state) {
          case p_none:
             if (token == T_EOL) {
@@ -841,8 +842,11 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type)
             }
             for (i=0; resources[i].name; i++) {
                if (strcasecmp(resources[i].name, lc->str) == 0) {
-                  state = p_resource;
                   items = resources[i].items;
+                  if (!items) {
+                     break;
+                  }
+                  state = p_resource;
                   res_type = resources[i].rcode;
                   init_resource(res_type, items, pass);
                   break;
index 886f1a220b79119eafe5a63391fa26a20581b105..728cafb3f5d41f61f731c146288e165ff5227c7d 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *  This file handles locking and seaching resources
- *
- *     Kern Sibbald, January MM
- *       Split from parse_conf.c April MMV
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *  This file handles locking and seaching resources
+ *
+ *     Kern Sibbald, January MM
+ *       Split from parse_conf.c April MMV
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 
index e69dd94bdb01adf70cc6f2be26f6ac950fd79839..c1d033cf070d50314e42c18dacc7ec7ebbb7485d 100644 (file)
@@ -1,16 +1,7 @@
-/*
- *
- *   scan.c scan a directory (on a removable file) for a valid
- *      Volume name. If found, open the file for append.
- *
- *    Kern Sibbald, MMVI
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2006-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   scan.c scan a directory (on a removable file) for a valid
+ *      Volume name. If found, open the file for append.
+ *
+ *    Kern Sibbald, MMVI
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 #include "stored.h"
index 184da7bed422fad14e33106348c9f4be27cddbf9..200d24e750cd13d422b3aca491e0fcfc4fdeab86 100644 (file)
@@ -1,6 +1,21 @@
               Technical notes on version 2.3
 
 General:
+16Oct07
+kes  Add PATH command to SunOS part of mtx-changer.in so that sed and
+     awk are on the path.  
+kes  Redirect stderror to stdin on mt status command in mtx-changer.in
+     since the status is returned on stderr on Solaris.              
+kes  Activate Close button on tray-monitor window. This fixes
+     bug #986.
+kes  Check for NULL item in parse_conf.c before calling it.  In the
+     case of Device, there is no item and this caused a seg fault when
+     Device appears in the conf file.
+kes  Add a #define __CONFIG_H when including config.h in bacula.h. This
+     avoids pulling in config.h multiple times in some new code.
+12Oct07
+kes  Fix spurious warning message printed when creating a volume with
+     a LabelFormat. This fixes bug #976.
 07Oct07
 kes  Make maxvol-test and new more strict maxvol2-test work. 
 kes  Print JobId in all Jmsg() job output.