]> git.sur5r.net Git - bacula/bacula/commitdiff
Add VolFiles - use mysql_escape...
authorKern Sibbald <kern@sibbald.com>
Wed, 15 Jan 2003 07:44:27 +0000 (07:44 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 15 Jan 2003 07:44:27 +0000 (07:44 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@294 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/mysql.c
bacula/src/dird/ua_cmds.c
bacula/src/lib/message.c
bacula/src/version.h

index 6168743468c6590e91b26ea0633138f2a2179e7d..6afe546e1c49ae9c56e541e29a11739cacf04aa6 100644 (file)
@@ -226,6 +226,9 @@ int db_next_index(B_DB *mdb, char *table, char *index)
 void
 db_escape_string(char *snew, char *old, int len)
 {
+   mysql_escape_string(snew, old, len);
+
+#ifdef DO_IT_MYSELF
    char *n, *o;
 
    n = snew;
@@ -272,6 +275,7 @@ db_escape_string(char *snew, char *old, int len)
       }
    }
    *n = 0;
+#endif
 }
 
 /*
index 72f72aa309237e71da874d9860b13ff770dcff55..96f0209a1f460bbf11ed8bdbafbb919b91966465 100644 (file)
@@ -650,6 +650,7 @@ static int update_volume(UAContext *ua)
       add_prompt(ua, _("Maximum Volume Bytes"));
       add_prompt(ua, _("Recycle Flag"));
       add_prompt(ua, _("Slot"));
+      add_prompt(ua, _("Volume Files"));
       add_prompt(ua, _("Done"));
       switch (do_prompt(ua, _("Select parameter to modify"), NULL, 0)) {
       case 0:                        /* Volume Status */
@@ -842,6 +843,30 @@ static int update_volume(UAContext *ua)
         free_pool_memory(query);
         break;
 
+      case 8:                        /* Volume Files */
+        int32_t VolFiles;
+         bsendmsg(ua, _("Warning changing Volume Files can result\n"
+                        "in loss of data on your Volume\n\n"));
+         bsendmsg(ua, _("Current Volume Files is: %u\n"), mr.VolFiles);
+         if (!get_cmd(ua, _("Enter new number of Files for Volume: "))) {
+           return 0;
+        }
+        VolFiles = atoi(ua->cmd);
+        if (VolFiles < 0) {
+            bsendmsg(ua, _("Invalid number, it must be 0 or greater\n"));
+           break;
+        } 
+        query = get_pool_memory(PM_MESSAGE);
+         Mmsg(&query, "UPDATE Media SET VolFiles=%u WHERE MediaId=%u",
+           VolFiles, mr.MediaId);
+        if (!db_sql_query(ua->db, query, NULL, NULL)) {  
+            bsendmsg(ua, "%s", db_strerror(ua->db));
+        } else {
+            bsendmsg(ua, _("New Volume Files is: %u\n"), VolFiles);
+        }
+        free_pool_memory(query);
+        break;
+
       default:                       /* Done or error */
          bsendmsg(ua, "Selection done.\n");
         return 1;
index b6e75fd04bb9ff121989a2c377003265b49c6006..340a2757d7b122a1654f05534eb0362c71cc3583 100755 (executable)
@@ -777,7 +777,7 @@ e_msg(char *file, int line, int type, int level, char *fmt,...)
 void 
 Jmsg(void *vjcr, int type, int level, char *fmt,...)
 {
-    char     rbuf[2000];
+    char     rbuf[5000];
     char     *buf;
     va_list   arg_ptr;
     int i, len;
index 02d25dced2dfa1ea405ef881ee8abe0b065b81dc..6046e405f5279c428c34e781235b49f9d538a240 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.29"
 #define VSTRING "1"
-#define DATE    "14 January 2003"
-#define LSMDATE "14Jan03"
+#define DATE    "15 January 2003"
+#define LSMDATE "15Jan03"
 
 /* Debug flags */
 #define DEBUG 1