From: Kern Sibbald Date: Mon, 22 Jul 2002 09:03:17 +0000 (+0000) Subject: MySQL 4.0 fixes -- kes22Jul02 X-Git-Tag: Release-1.23~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b7cd4a9905b9362a8b14465b71bca4544796731a;p=bacula%2Fbacula MySQL 4.0 fixes -- kes22Jul02 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@66 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 242b5681c6..3b283e8f2e 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -11,6 +11,8 @@ To do: - Document specifically how to add new File daemon to config files. - Document forcing a new tape to be used. +- Eliminate MySQL shared libraries from smtp and daemons not + using MySQL. - Pass "Catalog Files = no" to storage daemon to eliminate network traffic. - Implement alter_sqlite_tables diff --git a/bacula/src/cats/create_mysql_database.in b/bacula/src/cats/create_mysql_database.in index 4313515899..f0bae06f48 100644 --- a/bacula/src/cats/create_mysql_database.in +++ b/bacula/src/cats/create_mysql_database.in @@ -2,4 +2,15 @@ # # shell script to create Bacula database(s) # -# Nothing to do + +bindir=@SQL_BINDIR@ + +if $bindir/mysql -f <max_length, field->name); + sprintf(buf, " %-*s |", (int)field->max_length, field->name); send(ctx, buf); } send(ctx, "\n"); @@ -307,12 +307,12 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx) for (i = 0; i < sql_num_fields(mdb); i++) { field = sql_fetch_field(mdb); if (row[i] == NULL) { - sprintf(buf, " %-*s |", field->max_length, "NULL"); + sprintf(buf, " %-*s |", (int)field->max_length, "NULL"); } else if (IS_NUM(field->type)) { - sprintf(buf, " %*s |", field->max_length, + sprintf(buf, " %*s |", (int)field->max_length, add_commas(row[i], ewc)); } else { - sprintf(buf, " %-*s |", field->max_length, row[i]); + sprintf(buf, " %-*s |", (int)field->max_length, row[i]); } send(ctx, buf); } diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 83228fff2b..841f56405f 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -219,6 +219,10 @@ getVolName: bsendmsg(ua, _("Volume name too long.\n")); goto getVolName; } + if (strlen(ua->cmd) == 0) { + bsendmsg(ua, _("Volume name must be at least one character long.\n")); + goto getVolName; + } strcpy(name, ua->cmd); if (num > 0) { @@ -1118,6 +1122,10 @@ gotVol: bsendmsg(ua, _("Volume name too long.\n")); goto getVol; } + if (strlen(ua->cmd) == 0) { + bsendmsg(ua, _("Volume name must be at least one character long.\n")); + goto getVol; + } memset(&mr, 0, sizeof(mr)); strcpy(mr.VolumeName, ua->cmd); diff --git a/bacula/src/version.h b/bacula/src/version.h index df41c22102..0ffb565361 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.23" #define VSTRING "1" -#define DATE "20 July 2002" -#define LSMDATE "20Jul02" +#define DATE "22 July 2002" +#define LSMDATE "22Jul02" /* Debug flags */ #define DEBUG 1