From 1481e4c31ec72a3e81a772d62db9eb00923f64f9 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 24 Jan 2004 16:19:05 +0000 Subject: [PATCH] various see kes-1.33 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1018 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/platforms/redhat/bacula.spec.in | 17 +- .../src/cats/create_sqlite_database.in.patch | 4 + bacula/src/console/console.c | 1 + bacula/src/console2.glade | 329 ++++++++++-------- bacula/src/dird/ua_run.c | 5 +- bacula/src/gnome2-console/console.c | 15 +- bacula/src/gnome2-console/console_conf.c | 91 +++-- bacula/src/gnome2-console/console_conf.h | 19 +- bacula/src/gnome2-console/interface.c | 32 +- bacula/src/gnome2-console/support.c | 2 +- bacula/src/lib/bnet.c | 5 +- bacula/src/stored/dircmd.c | 8 +- 12 files changed, 310 insertions(+), 218 deletions(-) create mode 100644 bacula/src/cats/create_sqlite_database.in.patch diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index 75c47ba49b..8160b3f5be 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -56,7 +56,7 @@ BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 BuildRequires: libbonoboui-devel >= 2.0 -BuildRequires: bonobo-activation-devel >= 2.0 +BuildRequires: bonobo-activation-devel BuildRequires: GConf2-devel BuildRequires: linc-devel %endif @@ -102,7 +102,7 @@ Requires: ORBit2 Requires: libart_lgpl >= 2.0 Requires: libbonobo >= 2.0 Requires: libbonoboui >= 2.0 -Requires: bonobo-activation >= 2.0 +Requires: bonobo-activation Requires: GConf2 Requires: linc %endif @@ -204,6 +204,9 @@ cd ${cwd} # patch the make_sqlite_tables script for installation bindir patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +# patch the create_sqlite_database script for installation bindir +patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch + # patch the make_catalog_backup script for installation bindir patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch @@ -214,7 +217,7 @@ patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-gnome \ - --enable-static-fd \ + --enable-static-fd \ %if %{mysql} --with-mysql \ %else @@ -431,7 +434,10 @@ echo "Creating bacula tables..." # add execute permission for console chmod 0755 /usr/sbin/gnome-console -# create the tables +# create the database and tables +echo "Creating SQLite database..." +/etc/bacula/create_sqlite_database +echo "Creating the SQLite tables..." /etc/bacula/make_sqlite_tables %preun sqlite @@ -518,6 +524,9 @@ rm -f /etc/bacula/rescue/sfdisk rm -rf /etc/bacula/rescue/diskinfo/* %changelog +* Sat Jan 24 2004 D. Scott Barninger +- added patch for create_sqlite_database to fix the installed bindir +- added execute of create_sqlite_database to post of sqlite package * Sat Jan 10 2004 D. Scott Barninger - added virtual package Provides bacula-dir, bacula-sd, bacula-fd - added bacula-fd as Requires for rescue package diff --git a/bacula/src/cats/create_sqlite_database.in.patch b/bacula/src/cats/create_sqlite_database.in.patch new file mode 100644 index 0000000000..85d2dcbe8c --- /dev/null +++ b/bacula/src/cats/create_sqlite_database.in.patch @@ -0,0 +1,4 @@ +5c5 +< bindir=@SQL_BINDIR@ +--- +> bindir=/usr/lib/sqlite diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 6436ab9a35..3e3dc3cf7b 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -404,6 +404,7 @@ try_again: LockRes(); CONRES *cons = (CONRES *)GetNextRes(R_CONSOLE, (RES *)NULL); UnlockRes(); + /* If cons==NULL, default console will be used */ if (!authenticate_director(&jcr, dir, cons)) { fprintf(stderr, "ERR=%s", UA_sock->msg); terminate_console(0); diff --git a/bacula/src/console2.glade b/bacula/src/console2.glade index 2c2619445c..c62ae83ae8 100644 --- a/bacula/src/console2.glade +++ b/bacula/src/console2.glade @@ -2,6 +2,7 @@ + True @@ -998,204 +999,218 @@ - + True - False - 0 + 0.5 + 0.5 + 1 + 1 - + True False 0 - + True - Job: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - + False + 0 - - - True - True - False - False - True - False - - - + + + 66 + 16 True - True - False - True - 0 - - True - * - False - + Job: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + - - + + True - GTK_SELECTION_BROWSE + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + - - + + True + GTK_SELECTION_BROWSE - + True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + 1 + True + True + - - - 1 - True - True - - - - - - True - Type: - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - True - True - False - False - True - False - - - + + True - True - False - True - 0 - - True - * - False + Type: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + - - + + + 141 + 24 True - GTK_SELECTION_BROWSE + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + - - + + True + GTK_SELECTION_BROWSE - + True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + 0 + False + False + - 6 + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 30 False False - - 0 - True - True - - - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 30 - False - False - @@ -1213,6 +1228,8 @@ + 65 + 16 True Client: False @@ -1327,6 +1344,8 @@ + 66 + 16 True FileSet: False @@ -1407,6 +1426,8 @@ + 93 + 26 True True View FileSet @@ -1457,6 +1478,8 @@ + 66 + 16 True Level: False @@ -1593,6 +1616,8 @@ + 66 + 16 True Pool: False @@ -1729,6 +1754,8 @@ + 66 + 16 True Storage: False @@ -1865,6 +1892,8 @@ + 66 + 16 True Messages: False @@ -1979,6 +2008,8 @@ + 66 + 16 True Where: False @@ -2060,6 +2091,8 @@ + 66 + 16 True When: False diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index e95e050b06..2753409556 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -289,11 +289,14 @@ int run_cmd(UAContext *ua, char *cmd) pool = (POOL *)GetResWithName(R_POOL, pool_name); if (!pool) { bsendmsg(ua, _("Pool \"%s\" not found.\n"), pool_name); - pool = get_pool_resource(ua); + pool = select_pool_resource(ua); } } else { pool = job->pool; /* use default */ } + if (!pool) { + return 1; + } if (client_name) { client = (CLIENT *)GetResWithName(R_CLIENT, client_name); diff --git a/bacula/src/gnome2-console/console.c b/bacula/src/gnome2-console/console.c index b0b9b2b9f6..02459c1ec6 100644 --- a/bacula/src/gnome2-console/console.c +++ b/bacula/src/gnome2-console/console.c @@ -68,7 +68,6 @@ static void set_scroll_bar_to_end(void); /* Static variables */ static char *configfile = NULL; static DIRRES *dir; -static CONRES *con; static int ndir; static int director_reader_running = FALSE; static bool at_prompt = false; @@ -106,6 +105,7 @@ int main(int argc, char *argv[]) int test_config = FALSE; int gargc = 1; char *gargv[2] = {"gnome-console", NULL}; + CONFONTRES *con_font; init_stack_dump(); my_name_is(argc, argv, "gnome-console"); @@ -208,18 +208,18 @@ Without that I don't how to speak to the Director :-(\n"), configfile); */ LockRes(); - foreach_res(con, R_CONSOLE) { - if (!con->fontface) { - Dmsg1(400, "No fontface for %s\n", con->hdr.name); + foreach_res(con_font, R_CONSOLE_FONT) { + if (!con_font->fontface) { + Dmsg1(400, "No fontface for %s\n", con_font->hdr.name); continue; } - text_font = gdk_font_load(con->fontface); + text_font = gdk_font_load(con_font->fontface); if (text_font == NULL) { Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n", - con->hdr.name, con->fontface); + con_font->hdr.name, con_font->fontface); } else { Dmsg2(400, "ConsoleFont \"%s\" (%s) loaded.\n", - con->hdr.name, con->fontface); + con_font->hdr.name, con_font->fontface); break; } } @@ -404,6 +404,7 @@ int connect_to_director(gpointer data) jcr.dir_bsock = UA_sock; LockRes(); + /* If cons==NULL, default console will be used */ CONRES *cons = (CONRES *)GetNextRes(R_CONSOLE, (RES *)NULL); UnlockRes(); if (!authenticate_director(&jcr, dir, cons)) { diff --git a/bacula/src/gnome2-console/console_conf.c b/bacula/src/gnome2-console/console_conf.c index 813e353ab5..5c798a04b0 100644 --- a/bacula/src/gnome2-console/console_conf.c +++ b/bacula/src/gnome2-console/console_conf.c @@ -67,24 +67,32 @@ int res_all_size = sizeof(res_all); * information. */ static struct res_items dir_items[] = { - {"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0}, - {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, - {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101}, - {"address", store_str, ITEM(res_dir.address), 0, ITEM_REQUIRED, 0}, - {"password", store_password, ITEM(res_dir.password), 0, 0, 0}, - {"enablessl", store_yesno, ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0}, + {"name", store_name, ITEM(dir_res.hdr.name), 0, ITEM_REQUIRED, 0}, + {"description", store_str, ITEM(dir_res.hdr.desc), 0, 0, 0}, + {"dirport", store_int, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101}, + {"address", store_str, ITEM(dir_res.address), 0, ITEM_REQUIRED, 0}, + {"password", store_password, ITEM(dir_res.password), 0, 0, 0}, + {"enablessl", store_yesno, ITEM(dir_res.enable_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; static struct res_items con_items[] = { - {"name", store_name, ITEM(con_dir.hdr.name), 0, ITEM_REQUIRED, 0}, - {"description", store_str, ITEM(con_dir.hdr.desc), 0, 0, 0}, - {"font", store_str, ITEM(con_dir.fontface), 0, 0, 0}, - {"password", store_password, ITEM(con_dir.password), 0, ITEM_REQUIRED, 0}, - {"requiressl", store_yesno, ITEM(con_dir.require_ssl), 1, ITEM_DEFAULT, 0}, + {"name", store_name, ITEM(con_res.hdr.name), 0, ITEM_REQUIRED, 0}, + {"description", store_str, ITEM(con_res.hdr.desc), 0, 0, 0}, + {"password", store_password, ITEM(con_res.password), 0, ITEM_REQUIRED, 0}, + {"requiressl", store_yesno, ITEM(con_res.require_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; +static struct res_items con_font_items[] = { + {"name", store_name, ITEM(con_font.hdr.name), 0, ITEM_REQUIRED, 0}, + {"description", store_str, ITEM(con_font.hdr.desc), 0, 0, 0}, + {"font", store_str, ITEM(con_font.fontface), 0, 0, 0}, + {"requiressl", store_yesno, ITEM(con_font.require_ssl), 1, ITEM_DEFAULT, 0}, + {NULL, NULL, NULL, 0, 0, 0} +}; + + /* * This is the master resource definition. * It must have one item for each of the resources. @@ -92,6 +100,7 @@ static struct res_items con_items[] = { struct s_res resources[] = { {"director", dir_items, R_DIRECTOR, NULL}, {"console", con_items, R_CONSOLE, NULL}, + {"consolefont", con_font_items, R_CONSOLE_FONT, NULL}, {NULL, NULL, 0, NULL} }; @@ -113,17 +122,20 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ... switch (type) { case R_DIRECTOR: printf("Director: name=%s address=%s DIRport=%d\n", reshdr->name, - res->res_dir.address, res->res_dir.DIRport); + res->dir_res.address, res->dir_res.DIRport); break; case R_CONSOLE: - printf("Console: name=%s font face=%s\n", - reshdr->name, NPRT(res->con_dir.fontface)); + printf("Console: name=%s\n", reshdr->name); + break; + case R_CONSOLE_FONT: + printf("ConsoleFont: name=%s font face=%s\n", + reshdr->name, NPRT(res->con_font.fontface)); break; default: printf("Unknown resource type %d\n", type); } - if (recurse && res->res_dir.hdr.next) { - dump_resource(type, res->res_dir.hdr.next, sendit, sock); + if (recurse && res->dir_res.hdr.next) { + dump_resource(type, res->dir_res.hdr.next, sendit, sock); } } @@ -146,23 +158,28 @@ void free_resource(int type) return; /* common stuff -- free the resource name */ - nres = (RES *)res->res_dir.hdr.next; - if (res->res_dir.hdr.name) { - free(res->res_dir.hdr.name); + nres = (RES *)res->dir_res.hdr.next; + if (res->dir_res.hdr.name) { + free(res->dir_res.hdr.name); } - if (res->res_dir.hdr.desc) { - free(res->res_dir.hdr.desc); + if (res->dir_res.hdr.desc) { + free(res->dir_res.hdr.desc); } switch (type) { case R_DIRECTOR: - if (res->res_dir.address) { - free(res->res_dir.address); + if (res->dir_res.address) { + free(res->dir_res.address); } break; case R_CONSOLE: - if (res->con_dir.fontface) { - free(res->con_dir.fontface); + if (res->con_res.password) { + free(res->con_res.password); + } + break; + case R_CONSOLE_FONT: + if (res->con_font.fontface) { + free(res->con_font.fontface); } break; default: @@ -192,7 +209,7 @@ void save_resource(int type, struct res_items *items, int pass) */ for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { - if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { + if (!bit_is_set(i, res_all.dir_res.hdr.item_present)) { Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n", items[i].name, resources[rindex]); } @@ -211,6 +228,7 @@ void save_resource(int type, struct res_items *items, int pass) break; case R_CONSOLE: + case R_CONSOLE_FONT: break; default: @@ -221,13 +239,13 @@ void save_resource(int type, struct res_items *items, int pass) /* Note, the resoure name was already saved during pass 1, * so here, we can just release it. */ - if (res_all.res_dir.hdr.name) { - free(res_all.res_dir.hdr.name); - res_all.res_dir.hdr.name = NULL; + if (res_all.dir_res.hdr.name) { + free(res_all.dir_res.hdr.name); + res_all.dir_res.hdr.name = NULL; } - if (res_all.res_dir.hdr.desc) { - free(res_all.res_dir.hdr.desc); - res_all.res_dir.hdr.desc = NULL; + if (res_all.dir_res.hdr.desc) { + free(res_all.dir_res.hdr.desc); + res_all.dir_res.hdr.desc = NULL; } return; } @@ -237,6 +255,9 @@ void save_resource(int type, struct res_items *items, int pass) case R_DIRECTOR: size = sizeof(DIRRES); break; + case R_CONSOLE_FONT: + size = sizeof(CONFONTRES); + break; case R_CONSOLE: size = sizeof(CONRES); break; @@ -255,15 +276,15 @@ void save_resource(int type, struct res_items *items, int pass) RES *next; /* Add new res to end of chain */ for (next=resources[rindex].res_head; next->next; next=next->next) { - if (strcmp(next->name, res->res_dir.hdr.name) == 0) { + if (strcmp(next->name, res->dir_res.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), - resources[rindex].name, res->res_dir.hdr.name); + resources[rindex].name, res->dir_res.hdr.name); } } next->next = (RES *)res; Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type), - res->res_dir.hdr.name); + res->dir_res.hdr.name); } } } diff --git a/bacula/src/gnome2-console/console_conf.h b/bacula/src/gnome2-console/console_conf.h index c9dde14855..9fba0fd7dd 100644 --- a/bacula/src/gnome2-console/console_conf.h +++ b/bacula/src/gnome2-console/console_conf.h @@ -16,10 +16,11 @@ enum { R_DIRECTOR = 1001, R_CONSOLE, + R_CONSOLE_FONT, }; #define R_FIRST R_DIRECTOR -#define R_LAST R_CONSOLE +#define R_LAST R_CONSOLE_FONT /* * Some resource attributes @@ -41,20 +42,28 @@ struct s_res_dir { }; typedef struct s_res_dir DIRRES; -struct s_con_dir { +struct s_con_font { RES hdr; char *fontface; /* Console Font specification */ + int require_ssl; /* Require SSL on all connections */ +}; +typedef struct s_con_font CONFONTRES; + +struct s_con_res { + RES hdr; char *password; /* UA server password */ int require_ssl; /* Require SSL on all connections */ }; -typedef struct s_con_dir CONRES; +typedef struct s_con_res CONRES; + /* Define the Union of all the above * resource structure definitions. */ union u_res { - struct s_res_dir res_dir; - struct s_con_dir con_dir; + struct s_res_dir dir_res; + struct s_con_font con_font; + struct s_con_res con_res; RES hdr; }; diff --git a/bacula/src/gnome2-console/interface.c b/bacula/src/gnome2-console/interface.c index d536d15a2d..d9f585cbd0 100644 --- a/bacula/src/gnome2-console/interface.c +++ b/bacula/src/gnome2-console/interface.c @@ -601,6 +601,7 @@ create_RunDialog (void) GtkWidget *vbox11; GtkWidget *vbox12; GtkWidget *label62; + GtkWidget *alignment1; GtkWidget *hbox28; GtkWidget *hbox29; GtkWidget *label63; @@ -611,7 +612,7 @@ create_RunDialog (void) GtkWidget *combo_type; GList *combo_type_items = NULL; GtkWidget *entry_type; - GtkWidget *label65; + GtkWidget *label114; GtkWidget *hbox30; GtkWidget *label66; GtkWidget *combo_client; @@ -682,9 +683,13 @@ create_RunDialog (void) gtk_box_pack_start (GTK_BOX (vbox12), label62, FALSE, FALSE, 2); gtk_misc_set_padding (GTK_MISC (label62), 0, 9); + alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment1); + gtk_box_pack_start (GTK_BOX (vbox12), alignment1, FALSE, FALSE, 2); + hbox28 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox28); - gtk_box_pack_start (GTK_BOX (vbox12), hbox28, FALSE, FALSE, 2); + gtk_container_add (GTK_CONTAINER (alignment1), hbox28); hbox29 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox29); @@ -693,6 +698,7 @@ create_RunDialog (void) label63 = gtk_label_new (_("Job:")); gtk_widget_show (label63); gtk_box_pack_start (GTK_BOX (hbox29), label63, FALSE, FALSE, 0); + gtk_widget_set_size_request (label63, 66, 16); gtk_label_set_justify (GTK_LABEL (label63), GTK_JUSTIFY_RIGHT); combo_job = gtk_combo_new (); @@ -717,7 +723,8 @@ create_RunDialog (void) g_object_set_data (G_OBJECT (GTK_COMBO (combo_type)->popwin), "GladeParentKey", combo_type); gtk_widget_show (combo_type); - gtk_box_pack_start (GTK_BOX (hbox29), combo_type, FALSE, FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox29), combo_type, FALSE, FALSE, 0); + gtk_widget_set_size_request (combo_type, 141, 24); gtk_combo_set_value_in_list (GTK_COMBO (combo_type), TRUE, FALSE); combo_type_items = g_list_append (combo_type_items, (gpointer) ""); gtk_combo_set_popdown_strings (GTK_COMBO (combo_type), combo_type_items); @@ -727,9 +734,10 @@ create_RunDialog (void) gtk_widget_show (entry_type); gtk_editable_set_editable (GTK_EDITABLE (entry_type), FALSE); - label65 = gtk_label_new (_(" ")); - gtk_widget_show (label65); - gtk_box_pack_start (GTK_BOX (hbox28), label65, FALSE, FALSE, 30); + label114 = gtk_label_new (_(" ")); + gtk_widget_show (label114); + gtk_box_pack_start (GTK_BOX (hbox28), label114, FALSE, FALSE, 30); + gtk_label_set_justify (GTK_LABEL (label114), GTK_JUSTIFY_LEFT); hbox30 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox30); @@ -738,6 +746,7 @@ create_RunDialog (void) label66 = gtk_label_new (_("Client:")); gtk_widget_show (label66); gtk_box_pack_start (GTK_BOX (hbox30), label66, FALSE, FALSE, 0); + gtk_widget_set_size_request (label66, 65, 16); gtk_label_set_justify (GTK_LABEL (label66), GTK_JUSTIFY_RIGHT); combo_client = gtk_combo_new (); @@ -765,6 +774,7 @@ create_RunDialog (void) label68 = gtk_label_new (_("FileSet: ")); gtk_widget_show (label68); gtk_box_pack_start (GTK_BOX (hbox31), label68, FALSE, FALSE, 0); + gtk_widget_set_size_request (label68, 66, 16); gtk_label_set_justify (GTK_LABEL (label68), GTK_JUSTIFY_RIGHT); combo_fileset = gtk_combo_new (); @@ -784,6 +794,7 @@ create_RunDialog (void) view_fileset_button = gtk_button_new_with_mnemonic (_(" View FileSet ")); gtk_widget_show (view_fileset_button); gtk_box_pack_start (GTK_BOX (hbox31), view_fileset_button, FALSE, TRUE, 10); + gtk_widget_set_size_request (view_fileset_button, 93, 26); label69 = gtk_label_new (_(" ")); gtk_widget_show (label69); @@ -796,6 +807,7 @@ create_RunDialog (void) label70 = gtk_label_new (_("Level:")); gtk_widget_show (label70); gtk_box_pack_start (GTK_BOX (hbox32), label70, FALSE, FALSE, 0); + gtk_widget_set_size_request (label70, 66, 16); gtk_label_set_justify (GTK_LABEL (label70), GTK_JUSTIFY_RIGHT); combo_level = gtk_combo_new (); @@ -824,6 +836,7 @@ create_RunDialog (void) label72 = gtk_label_new (_("Pool:")); gtk_widget_show (label72); gtk_box_pack_start (GTK_BOX (hbox33), label72, FALSE, FALSE, 0); + gtk_widget_set_size_request (label72, 66, 16); combo_pool = gtk_combo_new (); g_object_set_data (G_OBJECT (GTK_COMBO (combo_pool)->popwin), @@ -851,6 +864,7 @@ create_RunDialog (void) label96 = gtk_label_new (_("Storage:")); gtk_widget_show (label96); gtk_box_pack_start (GTK_BOX (hbox39), label96, FALSE, FALSE, 0); + gtk_widget_set_size_request (label96, 66, 16); combo_storage = gtk_combo_new (); g_object_set_data (G_OBJECT (GTK_COMBO (combo_storage)->popwin), @@ -878,6 +892,7 @@ create_RunDialog (void) label98 = gtk_label_new (_("Messages:")); gtk_widget_show (label98); gtk_box_pack_start (GTK_BOX (hbox40), label98, FALSE, FALSE, 0); + gtk_widget_set_size_request (label98, 66, 16); combo_messages = gtk_combo_new (); g_object_set_data (G_OBJECT (GTK_COMBO (combo_messages)->popwin), @@ -904,6 +919,7 @@ create_RunDialog (void) label77 = gtk_label_new (_("Where: ")); gtk_widget_show (label77); gtk_box_pack_start (GTK_BOX (hbox34), label77, FALSE, FALSE, 0); + gtk_widget_set_size_request (label77, 66, 16); entry_where = gtk_entry_new (); gtk_widget_show (entry_where); @@ -920,6 +936,7 @@ create_RunDialog (void) label100 = gtk_label_new (_("When:")); gtk_widget_show (label100); gtk_box_pack_start (GTK_BOX (hbox41), label100, FALSE, FALSE, 0); + gtk_widget_set_size_request (label100, 66, 16); entry_when = gtk_entry_new (); gtk_widget_show (entry_when); @@ -972,6 +989,7 @@ create_RunDialog (void) GLADE_HOOKUP_OBJECT (RunDialog, vbox11, "vbox11"); GLADE_HOOKUP_OBJECT (RunDialog, vbox12, "vbox12"); GLADE_HOOKUP_OBJECT (RunDialog, label62, "label62"); + GLADE_HOOKUP_OBJECT (RunDialog, alignment1, "alignment1"); GLADE_HOOKUP_OBJECT (RunDialog, hbox28, "hbox28"); GLADE_HOOKUP_OBJECT (RunDialog, hbox29, "hbox29"); GLADE_HOOKUP_OBJECT (RunDialog, label63, "label63"); @@ -980,7 +998,7 @@ create_RunDialog (void) GLADE_HOOKUP_OBJECT (RunDialog, label64, "label64"); GLADE_HOOKUP_OBJECT (RunDialog, combo_type, "combo_type"); GLADE_HOOKUP_OBJECT (RunDialog, entry_type, "entry_type"); - GLADE_HOOKUP_OBJECT (RunDialog, label65, "label65"); + GLADE_HOOKUP_OBJECT (RunDialog, label114, "label114"); GLADE_HOOKUP_OBJECT (RunDialog, hbox30, "hbox30"); GLADE_HOOKUP_OBJECT (RunDialog, label66, "label66"); GLADE_HOOKUP_OBJECT (RunDialog, combo_client, "combo_client"); diff --git a/bacula/src/gnome2-console/support.c b/bacula/src/gnome2-console/support.c index 7f065549dc..06a04b7dd5 100644 --- a/bacula/src/gnome2-console/support.c +++ b/bacula/src/gnome2-console/support.c @@ -29,7 +29,7 @@ lookup_widget (GtkWidget *widget, else parent = widget->parent; if (!parent) - parent = (GtkWidget *)g_object_get_data (G_OBJECT (widget), "GladeParentKey"); + parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); if (parent == NULL) break; widget = parent; diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 76350d7d30..c55d953c5d 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -318,11 +318,10 @@ bnet_send(BSOCK *bsock) int32_t pktsiz; int32_t msglen; - if (bsock->errors || bsock->terminated) { + if (bsock->errors || bsock->terminated || bsock->msglen > 1000000) { return 0; } msglen = bsock->msglen; - ASSERT(bsock->msglen < 1000000); pktsiz = htonl((int32_t)bsock->msglen); /* send int32_t containing size of data packet */ bsock->timer_start = watchdog_time; /* start timer */ @@ -354,7 +353,6 @@ bnet_send(BSOCK *bsock) bsock->out_msg_no++; /* increment message number */ if (bsock->msglen <= 0) { /* length only? */ - ASSERT(msglen == bsock->msglen); return 1; /* yes, no data */ } @@ -381,7 +379,6 @@ bnet_send(BSOCK *bsock) } return 0; } - ASSERT(msglen == bsock->msglen); return 1; } diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index b3ddd63418..89748b4c0d 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -300,12 +300,8 @@ static int do_label(JCR *jcr, int relabel) P(dev->mutex); /* Use P to avoid indefinite block */ if (!(dev->state & ST_OPENED)) { - if (open_dev(dev, newname, READ_WRITE) < 0) { - bnet_fsend(dir, _("3994 Connot open device: %s\n"), strerror_dev(dev)); - } else { - label_volume_if_ok(jcr, dev, oldname, newname, poolname, slot, relabel); - force_close_dev(dev); - } + label_volume_if_ok(jcr, dev, oldname, newname, poolname, slot, relabel); + force_close_dev(dev); /* Under certain "safe" conditions, we can steal the lock */ } else if (dev->dev_blocked && (dev->dev_blocked == BST_UNMOUNTED || -- 2.39.5