]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove new bnet_sig
authorKern Sibbald <kern@sibbald.com>
Wed, 21 Dec 2005 12:22:32 +0000 (12:22 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 21 Dec 2005 12:22:32 +0000 (12:22 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2697 91ce42f0-d328-0410-95d8-f526ca767f89

14 files changed:
bacula/kes-1.38
bacula/kes-1.39
bacula/platforms/mandrake/bacula.spec.in
bacula/platforms/redhat/bacula.spec.in
bacula/platforms/suse/bacula.spec.in
bacula/src/dird/restore.c
bacula/src/dird/ua.h
bacula/src/dird/ua_output.c
bacula/src/dird/ua_select.c
bacula/src/dird/ua_server.c
bacula/src/lib/bnet_pkt.c [deleted file]
bacula/src/lib/bsock.h
bacula/src/lib/bsys.c
bacula/src/stored/dev.c

index 4fc228650b3d2293b32529362e6d738306fba7a2..068af6f153d9bfb6842d79c63c602c4aeecac21f 100644 (file)
@@ -3,9 +3,21 @@
 
 General:
 
-Beta release 20Dec05:
 Changes to 1.38.3:
 20Dec05
+- Modify gui on command to set only GUI mode and not batch.
+- Modify .messages command to always print messages regardless
+  of the mode.
+- If GUI mode is on, suppress automatic printing of 
+  You have messages. 
+- Delete old bnet packet code.
+- Ignore new BNET_START_SELECT and BNET_END_SELECT signals in
+  wx-console.
+- Modify restore command in wx-console to set gui on and to use
+  only .messages instead of messages.  Hopefully this fixes bug
+  #514.
+Beta release 20Dec05:
+20Dec05
 - Fix seg fault in exit of acquire when canceling a job --
   reported by Wolfgang Denk
 19Dec05
index 0093df18f3dfd38d27d9826db4a5efb82a38dace..0584dc246d78de42af7285f29178ba3862e08b23 100644 (file)
@@ -5,6 +5,19 @@ General:
 
 Changes to 1.39.3:
 20Dec05
+- Modify gui on command to set only GUI mode and not batch.
+- Modify .messages command to always print messages regardless
+  of the mode.
+- If GUI mode is on, suppress automatic printing of 
+  You have messages. 
+- Delete old bnet packet code.
+- Ignore new BNET_START_SELECT and BNET_END_SELECT signals in
+  wx-console.
+- Modify restore command in wx-console to set gui on and to use
+  only .messages instead of messages.  Hopefully this fixes bug
+  #514.
+- Fix seg fault in exit of acquire when canceling a job --
+  reported by Wolfgang Denk
 - Pull in latest reservation system changes from 1.38
 - Make .messages command always print messages regardless
   of the automessages flag.
index c65223bc0907f37be0e01a7552fe7b342ad6a066..e0df4a6af148bb2c729ad494da582736deea7f8a 100644 (file)
@@ -529,6 +529,17 @@ export LDFLAGS=-L/usr/lib64
 export LDFLAGS=-L/usr/lib64/mysql
 %endif
 
+%configure \
+        --prefix=/usr \
+        --sbindir=/usr/sbin \
+        --sysconfdir=/etc/bacula \
+        --with-scriptdir=/etc/bacula \
+        --enable-smartalloc \
+        --enable-client-only \
+        --enable-static-fd
+
+make
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -624,6 +635,8 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
 %endif
 
+rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
+
 # install the init scripts
 %if %{su9}
 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
@@ -695,6 +708,9 @@ cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
+touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
+cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
+rm -f src/filed/static-bacula-fd
 
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
index c65223bc0907f37be0e01a7552fe7b342ad6a066..e0df4a6af148bb2c729ad494da582736deea7f8a 100644 (file)
@@ -529,6 +529,17 @@ export LDFLAGS=-L/usr/lib64
 export LDFLAGS=-L/usr/lib64/mysql
 %endif
 
+%configure \
+        --prefix=/usr \
+        --sbindir=/usr/sbin \
+        --sysconfdir=/etc/bacula \
+        --with-scriptdir=/etc/bacula \
+        --enable-smartalloc \
+        --enable-client-only \
+        --enable-static-fd
+
+make
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -624,6 +635,8 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
 %endif
 
+rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
+
 # install the init scripts
 %if %{su9}
 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
@@ -695,6 +708,9 @@ cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
+touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
+cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
+rm -f src/filed/static-bacula-fd
 
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
index c65223bc0907f37be0e01a7552fe7b342ad6a066..e0df4a6af148bb2c729ad494da582736deea7f8a 100644 (file)
@@ -529,6 +529,17 @@ export LDFLAGS=-L/usr/lib64
 export LDFLAGS=-L/usr/lib64/mysql
 %endif
 
+%configure \
+        --prefix=/usr \
+        --sbindir=/usr/sbin \
+        --sysconfdir=/etc/bacula \
+        --with-scriptdir=/etc/bacula \
+        --enable-smartalloc \
+        --enable-client-only \
+        --enable-static-fd
+
+make
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -624,6 +635,8 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
 %endif
 
+rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
+
 # install the init scripts
 %if %{su9}
 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
@@ -695,6 +708,9 @@ cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
+touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
+cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
+rm -f src/filed/static-bacula-fd
 
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
index 4c442816c87652e6880b212bd6d5262333ce1a08..3e5cc366fa198f9bae9c852aa63cbc46d2a6a5c1 100644 (file)
@@ -119,18 +119,6 @@ bool do_restore(JCR *jcr)
    fd = jcr->file_bsock;
    set_jcr_job_status(jcr, JS_Running);
 
-#ifdef xxx
-   if (!send_include_list(jcr)) {
-      restore_cleanup(jcr, JS_ErrorTerminated);
-      return false;
-   }
-
-   if (!send_exclude_list(jcr)) {
-      restore_cleanup(jcr, JS_ErrorTerminated);
-      return false;
-   }
-#endif
-
    /*
     * send Storage daemon address to the File daemon,
     *   then wait for File daemon to make connection
index 4498f05560b9a1e63d22cc973af9bd6f5a786ad0..e88143095a48c3a2771fc557d0d66b6d0424eaa9 100644 (file)
@@ -9,19 +9,14 @@
    Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -49,6 +44,7 @@ struct UAContext {
    bool quit;                         /* if set, quit */
    bool verbose;                      /* set for normal UA verbosity */
    bool batch;                        /* set for non-interactive mode */
+   bool gui;                          /* set if talking to GUI program */
    uint32_t pint32_val;               /* positive integer */
    int32_t  int32_val;                /* positive/negative */
    int64_t  int64_val;                /* big int */
index 33a8343e5b68872e56c50c731f094898abe05ab7..d97bf8a7fb26984fdf7e0b534bb9cc0987051c05 100644 (file)
@@ -55,10 +55,10 @@ int autodisplay_cmd(UAContext *ua, const char *cmd)
 
    switch (find_arg_keyword(ua, kw)) {
    case 0:
-      ua->auto_display_messages = 1;
+      ua->auto_display_messages = true;
       break;
    case 1:
-      ua->auto_display_messages = 0;
+      ua->auto_display_messages = false;
       break;
    default:
       bsendmsg(ua, _("ON or OFF keyword missing.\n"));
@@ -68,7 +68,7 @@ int autodisplay_cmd(UAContext *ua, const char *cmd)
 }
 
 /*
- * Turn batch processing on/off
+ * Turn GUI mode on/off
  */
 int gui_cmd(UAContext *ua, const char *cmd)
 {
@@ -79,12 +79,10 @@ int gui_cmd(UAContext *ua, const char *cmd)
 
    switch (find_arg_keyword(ua, kw)) {
    case 0:
-      ua->batch = true;
-      ua->jcr->gui = true;
+      ua->jcr->gui = ua->gui = true;
       break;
    case 1:
-      ua->batch = false;
-      ua->jcr->gui = false;
+      ua->jcr->gui = ua->gui = false;
       break;
    default:
       bsendmsg(ua, _("ON or OFF keyword missing.\n"));
@@ -649,7 +647,7 @@ void do_messages(UAContext *ua, const char *cmd)
       do_truncate = true;
    }
    if (do_truncate) {
-      ftruncate(fileno(con_fd), 0L);
+      (void)ftruncate(fileno(con_fd), 0L);
    }
    console_msg_pending = FALSE;
    ua->user_notified_msg_pending = FALSE;
index 41765194a59b1a89e85b3759dc9d6c5c6c5fa2eb..7a3b2e8254407f3ef3b4dd026ff99ee64ab6973e 100644 (file)
@@ -711,10 +711,12 @@ int do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt,
       item = -1;
       goto done;
    }
+// bnet_sig(ua->UA_sock, BNET_START_SELECT);
    bsendmsg(ua, ua->prompt[0]);
    for (i=1; i < ua->num_prompts; i++) {
       bsendmsg(ua, "%6d: %s\n", i, ua->prompt[i]);
    }
+// bnet_sig(ua->UA_sock, BNET_END_SELECT);
 
    for ( ;; ) {
       /* First item is the prompt string, not the items */
index f4adaa2916c24d3b668a0829354f13b9f91b8fca..0ec2f11d3fce42a60624e349b622c91ca9bb9991 100644 (file)
@@ -138,7 +138,7 @@ static void *handle_UA_client_request(void *arg)
                pm_strcpy(ua->cmd, "messages");
                qmessagescmd(ua, ua->cmd);
                ua->user_notified_msg_pending = FALSE;
-            } else if (!ua->user_notified_msg_pending && console_msg_pending) {
+            } else if (!ua->gui && !ua->user_notified_msg_pending && console_msg_pending) {
                bsendmsg(ua, _("You have messages.\n"));
                ua->user_notified_msg_pending = TRUE;
             }
diff --git a/bacula/src/lib/bnet_pkt.c b/bacula/src/lib/bnet_pkt.c
deleted file mode 100644 (file)
index d84d241..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Network Packet Utility Routines
- *
- *  by Kern Sibbald, July MMII
- *
- *
- *   Version $Id$
- */
-/*
-   Copyright (C) 2002-2004 Kern Sibbald and John Walker
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
-
- */
-
-#ifdef implemented
-
-#include "bacula.h"
-
-/*
- * Receive a message from the other end. Each message consists of
- * two packets. The first is a header that contains the size
- * of the data that follows in the second packet.
- * Returns number of bytes read
- * Returns 0 on end of file
- * Returns -1 on hard end of file (i.e. network connection close)
- * Returns -2 on error
- */
-int32_t
-bnet_recv_pkt(BSOCK *bsock, BPKT *pkt, int *version)
-{
-   unser_declare;
-   short lversion;
-   int type;
-
-   unser_begin(bsock->msg, 0);
-   unser_uint16(lversion);
-   *version = (int)lversion;
-
-
-   for ( ; pkt->type != BP_EOF; pkt++) {
-      if (pkt->id) {
-        ser_int8(BP_ID);
-        ser_string((char *)pkt->id);
-      }
-      ser_int8(pkt->type);
-      switch (pkt->type) {
-      case BP_CHAR:
-        ser_int8(*(int8_t *)pkt->value);
-        break;
-      case BP_INT32:
-        ser_int32(*(int32_t *)pkt->value);
-        break;
-      case BP_UINT32:
-        break;
-        ser_unit32(*(uint32_t *)pkt->value);
-        break;
-      case BP_INT64:
-        ser_int64(*(int64_t *)pkt->value);
-        break;
-      case BP_BTIME:
-      case BP_UTIME:
-      case BP_UINT64:
-        ser_uint64(*(uint64_t *)pkt->value);
-        break;
-      case BP_POOL:
-      case BP_STRING:
-      case BP_NAME:
-        ser_string((char *)pkt->value);
-        break;
-      case BP_BYTES:
-        ser_uint32(*(uint32_t *)pkt->len);
-        ser_bytes((char *)pkt->value, pkt->len);
-        break;
-      default:
-        Emsg1(M_ABORT, 0, _("Unknown BPKT type: %d\n"), pkt->type);
-      }
-   }
-   unser_end(bsock->msg, 0);
-
-}
-
-/*
- * Send a message over the network. The send consists of
- * two network packets. The first is sends a 32 bit integer containing
- * the length of the data packet which follows.
- *
- * Returns: 0 on failure
- *         1 on success
- */
-int
-bnet_send_pkt(BSOCK *bsock, BPKT *pkt, int version)
-{
-   ser_declare;
-
-   ser_begin(bsock->msg, 0);
-   ser_uint16(version);
-
-   for ( ; pkt->type != BP_EOF; pkt++) {
-      if (pkt->id) {
-        ser_int8(BP_ID);
-        ser_string((char *)pkt->id);
-      }
-      ser_int8(pkt->type);
-      switch (pkt->type) {
-      case BP_CHAR:
-        ser_int8(*(int8_t *)pkt->value);
-        break;
-      case BP_INT32:
-        ser_int32(*(int32_t *)pkt->value);
-        break;
-      case BP_UINT32:
-        break;
-        ser_unit32(*(uint32_t *)pkt->value);
-        break;
-      case BP_INT64:
-        ser_int64(*(int64_t *)pkt->value);
-        break;
-      case BP_BTIME:
-      case BP_UTIME:
-      case BP_UINT64:
-        ser_uint64(*(uint64_t *)pkt->value);
-        break;
-      case BP_POOL:
-      case BP_STRING:
-      case BP_NAME:
-        ser_string((char *)pkt->value);
-        break;
-      case BP_BYTES:
-        ser_uint32(*(uint32_t *)pkt->len);
-        ser_bytes((char *)pkt->value, pkt->len);
-        break;
-      default:
-        Emsg1(M_ABORT, 0, _("Unknown BPKT type: %d\n"), pkt->type);
-      }
-   }
-   ser_end(bsock->msg, 0);
-}
-
-#endif
index 1282aa671be733a0b51722b78ef0ef80a16365b9..22ed040f2698a02a1b5c69d68dcf31ae7106e409 100644 (file)
@@ -66,7 +66,9 @@ enum {
    BNET_HB_RESPONSE    = -7,          /* Only response permited to HB */
    BNET_PROMPT         = -8,          /* Prompt for UA */
    BNET_BTIME          = -9,          /* Send UTC btime */
-   BNET_BREAK          = -10          /* Stop current command -- ctl-c */
+   BNET_BREAK          = -10,         /* Stop current command -- ctl-c */
+   BNET_START_SELECT   = -11,         /* Start of a selection list */
+   BNET_END_SELECT     = -12          /* End of a select list */
 };
 
 #define BNET_SETBUF_READ  1           /* Arg for bnet_set_buffer_size */
@@ -85,35 +87,3 @@ enum {
 #define BNET_TLS_OK       1           /* can do, but not required on my end */
 #define BNET_TLS_REQUIRED 2           /* TLS is required */
 
-/*
- * This is the structure of the in memory BPKT
- */
-typedef struct s_bpkt {
-   char *id;                          /* String identifier or name of field */
-   uint8_t type;                      /* field type */
-   uint32_t len;                      /* field length for string, name, bytes */
-   void *value;                       /* pointer to value */
-} BPKT;
-
-/*
- * These are the data types that can be sent.
- * For all values other than string, the storage space
- *  is assumed to be allocated in the receiving packet.
- *  For BP_STRING if the *value is non-zero, it is a
- *  pointer to a POOLMEM buffer, and the Memory Pool
- *  routines will be used to assure that the length is
- *  adequate. NOTE!!! This pointer will be changed
- *  if the memory is reallocated (sort of like Mmsg(&pool)
- *  does). If the pointer is NULL, a POOLMEM
- *  buffer will be allocated.
- */
-#define BP_EOF       0                /* end of file */
-#define BP_CHAR      1                /* Character */
-#define BP_INT32     1                /* 32 bit integer */
-#define BP_UINT32    3                /* Unsigned 32 bit integer */
-#define BP_INT64     4                /* 64 bit integer */
-#define BP_STRING    5                /* string */
-#define BP_NAME      6                /* Name string -- limited length */
-#define BP_BYTES     7                /* Binary bytes */
-#define BP_FLOAT32   8                /* 32 bit floating point */
-#define BP_FLOAT64   9                /* 64 bit floating point */
index 9c1a29d353de795aa49e170977603beea6a4c19d..14e51cae1a48ba20fc13476cd88b7f1d5d9728a1 100644 (file)
@@ -659,7 +659,7 @@ char *bfgets(char *s, int size, FILE *fd)
             *p = 0;
          }
          else { /* Mac (\r only) */
-            ungetc(ch, fd); /* Push next character back to fd */
+            (void)ungetc(ch, fd); /* Push next character back to fd */
          }
          break;
       }
index 86dbca7dd2138d2b6eeead78283959d05c6800ab..1a3813b051663409c492fcccc2395e7caa13b7a4 100644 (file)
@@ -266,6 +266,7 @@ DEVICE::open(DCR *dcr, int omode)
       } else {
         ::close(fd); /* use system close so correct mode will be used on open */
         fd = -1;
+        clear_opened();
         Dmsg0(100, "Close fd for mode change.\n");
       }
    }
@@ -383,6 +384,8 @@ void DEVICE::open_tape_device(DCR *dcr, int omode)
       use_count = 1;
       update_pos_dev(this);                /* update position */
       set_os_device_parameters(this);      /* do system dependent stuff */
+   } else {
+      clear_opened();
    }
 
    /* Stop any open() timer we started */
@@ -429,6 +432,7 @@ void DEVICE::open_file_device(int omode)
       Mmsg(errmsg, _("Could not open file device %s. No Volume name given.\n"),
          print_name());
       fd = -1;
+      clear_opened();
       return;
    }
 
@@ -453,6 +457,7 @@ void DEVICE::open_file_device(int omode)
       dev_errno = errno;
       Mmsg2(errmsg, _("Could not open: %s, ERR=%s\n"), archive_name.c_str(), 
             be.strerror());
+      clear_opened();
       Dmsg1(29, "open failed: %s", errmsg);
       Emsg0(M_FATAL, 0, errmsg);
    } else {
@@ -488,6 +493,7 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
       Mmsg(errmsg, _("Could not open file device %s. No Volume name given.\n"),
          print_name());
       fd = -1;
+      clear_opened();
       return;
    }
 
@@ -598,6 +604,7 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
          /* Use system close() */
          ::close(fd);
          fd = -1;
+         clear_opened();
       } else {
          part_size = filestat.st_size;
          dev_errno = 0;
@@ -618,6 +625,8 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
             }
          }*/
       }
+   } else {
+      clear_opened();
    }
 }