From b46b6376eee70224f8cbd9e4a0d5167052400e26 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 28 Dec 2006 17:14:00 +0000 Subject: [PATCH] kes Convert dbcheck to use 64 bit DB IDs. kes Update projects kes Make rescue work. kes Clarify Volume migration error message. kes Look for Job keyword when opening DB in console. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3851 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 37 ++++++++++ bacula/kernstodo | 21 ++++++ bacula/projects | 22 +++++- bacula/src/dird/migrate.c | 7 +- bacula/src/dird/ua_cmds.c | 45 +++++++++--- bacula/src/gnome2-console/callbacks.c | 4 +- bacula/src/tools/dbcheck.c | 100 +++++++++++++++----------- bacula/src/version.h | 4 +- bacula/technotes-1.39 | 6 ++ 9 files changed, 189 insertions(+), 57 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 2d668a37a0..f8fea00d2f 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,6 +1,43 @@ Technical notes on version 1.39 General: +28Dec06 +kes Update projects +kes Make rescue work. +kes Clarify Volume migration error message. +kes Look for Job keyword when opening DB in console. +23Dec06 +kes Add code in catreq.c to reject volumes not marked Enabled. +kes Add a few more ACL access checks. +kes Add \n in gnome2-console restore command so that output prints + nicer -- i.e. lines do not run together. +kes Fix autolabeling so that it will not mark a volume in error + if the volume was not actually opened. This should fix bugs + #737 and 738. +kes Require tape drive to be open before autolabeling. +kes Require explicit mount command on non-tapes before autolabeling. +kes Implement an open_client_db() that searches the keywords for + either a catolg or client, and opens the appropriate catalog. + This makes Bacula adjust better to multiple catalogs. +kes Use more name() methods for resources rather than hdr.name. +22Dec06 +kes Fix code to check for two resources of same name. It forgot + to check the last entry. Fixes bug #734. +kes Apply scanvolume patch from Richard Mortimer that fixes bug + #738. +kes Apply Eric's patch for recycling the Scratch pool. +kes Note, for the tray-monitor (or almost any restricted console_ + to work, in version 1.39.x you must add CatalogACL = catalog-name +kes Add appropriate new #undefs to autoconf/acconfig.h so that + configure works correctly. +kes Implement configure code to allow the user to disable IPv6 with + --disable-ipv6 +kes Apply Richard Mortimer's patch to prevent seg fault if mount point + not specified -- SD refuses to start. +kes Add magic.bacula from bug #715 to the scripts directory along with + Arno's explanation of how to install it. +kes Convert a bunch of hdr.name into name() method calls. +kes Fix the code to remove .bsr files. Fixes bug #736 -- Martin. Version 1.39.32 released: 20Dec06 diff --git a/bacula/kernstodo b/bacula/kernstodo index 1df1b05a4e..96a346b931 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -60,6 +60,27 @@ Priority: - bacula-1.38.2-ssl.patch - Bare-metal recovery Windows (todo) +Projects: +- GUI + - Admin + - Management reports + - Look at Webmin + http://www.orangecrate.com/modules.php?name=News&file=article&sid=501 +- Performance + - FD-SD quick disconnect + - Despool attributes in separate thread + - Database speedups + - Embedded MySQL +- Features + - Better scheduling + - Full at least once a month, ... + - Cancel Inc if Diff/Full running + - More intelligent re-run + - New/deleted file backup + - FD plugins + - Incremental backup -- rsync, Stow + + For 1.39: diff --git a/bacula/projects b/bacula/projects index 94c6047c4e..cdafc7ee83 100644 --- a/bacula/projects +++ b/bacula/projects @@ -1072,9 +1072,27 @@ Item 1: Cause daemons to use a specific IP address to source communications 10.0.0.1 and zone transfers will always originate from 10.0.0.2. -Kern notes: I think this would add very little functionality, but a *lot* of - additional overhead to Bacula. +Item n: Multiple threads in file daemon for the same job + Date: 27 November 2005 + Origin: Ove Risberg (Ove.Risberg at octocode dot com) + Status: + + What: I want the file daemon to start multiple threads for a backup + job so the fastest possible backup can be made. + + The file daemon could parse the FileSet information and start + one thread for each File entry located on a separate + filesystem. + + A confiuration option in the job section should be used to + enable or disable this feature. The confgutration option could + specify the maximum number of threads in the file daemon. + + If the theads could spool the data to separate spool files + the restore process will not be much slower. + Why: Multiple concurrent backups of a large fileserver with many + disks and controllers will be much faster. ============= Empty Feature Request form =========== diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 98689e8604..11d497b546 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -872,9 +872,10 @@ static bool find_mediaid_then_jobids(JCR *jcr, idpkt *ids, const char *query1, } if (ids->count == 0) { Jmsg(jcr, M_INFO, 0, _("No %ss found to migrate.\n"), type); - } - if (ids->count != 1) { - Jmsg(jcr, M_FATAL, 0, _("SQL logic error. Count should be 1 but is %d\n"), + ok = true; /* Not an error */ + goto bail_out; + } else if (ids->count != 1) { + Jmsg(jcr, M_FATAL, 0, _("SQL error. Expected 1 MediaId got %d\n"), ids->count); goto bail_out; } diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 24e6d2ad4d..d5bf15931e 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1618,19 +1618,22 @@ static int version_cmd(UAContext *ua, const char *cmd) * This call explicitly checks for a catalog=xxx and * if given, opens that catalog. It also checks for * client=xxx and if found, opens the catalog - * corresponding to that client. + * corresponding to that client. If we still don't + * have a catalog, look for a Job keyword and get the + * catalog from its client record. */ bool open_client_db(UAContext *ua) { int i; CAT *catalog; CLIENT *client; + JOB *job; /* Try for catalog keyword */ i = find_arg_with_value(ua, NT_("catalog")); if (i >= 0) { if (!acl_access_ok(ua, Catalog_ACL, ua->argv[i])) { - bsendmsg(ua, _("No authorization for catalog \"%s\"\n"), ua->argv[i]); + bsendmsg(ua, _("No authorization for Catalog \"%s\"\n"), ua->argv[i]); return false; } catalog = (CAT *)GetResWithName(R_CATALOG, ua->argv[i]); @@ -1646,25 +1649,51 @@ bool open_client_db(UAContext *ua) /* Try for client keyword */ i = find_arg_with_value(ua, NT_("client")); if (i >= 0) { - if (!acl_access_ok(ua, Catalog_ACL, ua->argv[i])) { - bsendmsg(ua, _("No authorization for client \"%s\"\n"), ua->argv[i]); + if (!acl_access_ok(ua, Client_ACL, ua->argv[i])) { + bsendmsg(ua, _("No authorization for Client \"%s\"\n"), ua->argv[i]); return false; } client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]); if (client) { - if (ua->catalog && ua->catalog != client->catalog) { + catalog = client->catalog; + if (ua->catalog && ua->catalog != catalog) { + close_db(ua); + } + if (!acl_access_ok(ua, Catalog_ACL, catalog->name())) { + bsendmsg(ua, _("No authorization for Catalog \"%s\"\n"), catalog->name()); + return false; + } + ua->catalog = catalog; + return open_db(ua); + } + } + + /* Try for Job keyword */ + i = find_arg_with_value(ua, NT_("job")); + if (i >= 0) { + if (!acl_access_ok(ua, Job_ACL, ua->argv[i])) { + bsendmsg(ua, _("No authorization for Job \"%s\"\n"), ua->argv[i]); + return false; + } + job = (JOB *)GetResWithName(R_JOB, ua->argv[i]); + if (job) { + catalog = job->client->catalog; + if (ua->catalog && ua->catalog != catalog) { close_db(ua); } - ua->catalog = client->catalog; + if (!acl_access_ok(ua, Catalog_ACL, catalog->name())) { + bsendmsg(ua, _("No authorization for Catalog \"%s\"\n"), catalog->name()); + return false; + } + ua->catalog = catalog; return open_db(ua); } } + return open_db(ua); } - - /* * Open the catalog database. */ diff --git a/bacula/src/gnome2-console/callbacks.c b/bacula/src/gnome2-console/callbacks.c index 9bd6cf0b68..d88f0c49fc 100644 --- a/bacula/src/gnome2-console/callbacks.c +++ b/bacula/src/gnome2-console/callbacks.c @@ -434,7 +434,7 @@ on_run_ok_clicked(GtkButton *button, gpointer user_data) bsnprintf(cmd, sizeof(cmd), "run job=\"%s\" fileset=\"%s\" level=%s client=\"%s\" pool=\"%s\" " - "when=\"%s\" where=\"%s\" storage=\"%s\" priority=\"%s\"", + "when=\"%s\" where=\"%s\" storage=\"%s\" priority=\"%s\"\n", job, fileset, level, client, pool, when, where, storage, priority); write_director(cmd); set_text(cmd, strlen(cmd)); @@ -507,7 +507,7 @@ on_label_ok_clicked(GtkButton *button, gpointer user_data) } bsnprintf(cmd, sizeof(cmd), - "label volume=\"%s\" pool=\"%s\" storage=\"%s\" slot=%s", + "label volume=\"%s\" pool=\"%s\" storage=\"%s\" slot=%s\n", volume, pool, storage, slot); write_director(cmd); set_text(cmd, strlen(cmd)); diff --git a/bacula/src/tools/dbcheck.c b/bacula/src/tools/dbcheck.c index 15458084c3..10daeabc6d 100644 --- a/bacula/src/tools/dbcheck.c +++ b/bacula/src/tools/dbcheck.c @@ -46,7 +46,7 @@ int generate_daemon_event(JCR *jcr, const char *event) { return 1; } typedef struct s_id_ctx { - uint32_t *Id; /* ids to be modified */ + int64_t *Id; /* ids to be modified */ int num_ids; /* ids stored */ int max_ids; /* size of array */ int num_del; /* number deleted */ @@ -482,13 +482,13 @@ static int id_list_handler(void *ctx, int num_fields, char **row) if (lst->num_ids == lst->max_ids) { if (lst->max_ids == 0) { lst->max_ids = 10000; - lst->Id = (uint32_t *)bmalloc(sizeof(uint32_t) * lst->max_ids); + lst->Id = (int64_t *)bmalloc(sizeof(int64_t) * lst->max_ids); } else { lst->max_ids = (lst->max_ids * 3) / 2; - lst->Id = (uint32_t *)brealloc(lst->Id, sizeof(uint32_t) * lst->max_ids); + lst->Id = (int64_t *)brealloc(lst->Id, sizeof(int64_t) * lst->max_ids); } } - lst->Id[lst->num_ids++] = (uint32_t)strtod(row[0], NULL); + lst->Id[lst->num_ids++] = str_to_int64(row[0]); return 0; } @@ -623,14 +623,15 @@ static void eliminate_duplicate_filenames() } /* Force all records to use the first id then delete the other ids */ for (int j=1; j 1) { printf("%s\n", buf); } db_sql_query(db, buf, NULL, NULL); - bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%u", - id_list.Id[j]); + bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%s", + ed2); if (verbose > 2) { printf("%s\n", buf); } @@ -680,14 +681,14 @@ static void eliminate_duplicate_paths() } /* Force all records to use the first id then delete the other ids */ for (int j=1; j 1) { printf("%s\n", buf); } db_sql_query(db, buf, NULL, NULL); - bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%u", - id_list.Id[j]); + bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%s", ed2); if (verbose > 2) { printf("%s\n", buf); } @@ -712,9 +713,11 @@ static void eliminate_orphaned_jobmedia_records() printf(_("Found %d orphaned JobMedia records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT JobMedia.JobMediaId,JobMedia.JobId,Media.VolumeName FROM JobMedia,Media " -"WHERE JobMedia.JobMediaId=%u AND Media.MediaId=JobMedia.MediaId", id_list.Id[i]); +"WHERE JobMedia.JobMediaId=%s AND Media.MediaId=JobMedia.MediaId", + edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_jobmedia_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -726,7 +729,7 @@ static void eliminate_orphaned_jobmedia_records() if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned JobMedia records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM JobMedia WHERE JobMediaId=%u", &id_list); + delete_id_list("DELETE FROM JobMedia WHERE JobMediaId=%s", &id_list); } } @@ -747,9 +750,11 @@ static void eliminate_orphaned_file_records() printf(_("Found %d orphaned File records.\n"), id_list.num_ids); if (name_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT File.FileId,File.JobId,Filename.Name FROM File,Filename " -"WHERE File.FileId=%u AND File.FilenameId=Filename.FilenameId", id_list.Id[i]); +"WHERE File.FileId=%s AND File.FilenameId=Filename.FilenameId", + edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_file_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -760,7 +765,7 @@ static void eliminate_orphaned_file_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned File records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM File WHERE FileId=%u", &id_list); + delete_id_list("DELETE FROM File WHERE FileId=%s", &id_list); } } @@ -781,7 +786,9 @@ static void eliminate_orphaned_path_records() printf(_("Found %d orphaned Path records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { - bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]); + char ed1[50]; + bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%s", + edit_int64(id_list.Id[i], ed1)); db_sql_query(db, buf, print_name_handler, NULL); } } @@ -790,7 +797,7 @@ static void eliminate_orphaned_path_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned Path records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Path WHERE PathId=%u", &id_list); + delete_id_list("DELETE FROM Path WHERE PathId=%s", &id_list); } } @@ -811,7 +818,9 @@ static void eliminate_orphaned_filename_records() printf(_("Found %d orphaned Filename records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { - bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]); + char ed1[50]; + bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%s", + edit_int64(id_list.Id[i], ed1)); db_sql_query(db, buf, print_name_handler, NULL); } } @@ -820,7 +829,7 @@ static void eliminate_orphaned_filename_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned Filename records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Filename WHERE FilenameId=%u", &id_list); + delete_id_list("DELETE FROM Filename WHERE FilenameId=%s", &id_list); } } @@ -841,8 +850,9 @@ static void eliminate_orphaned_fileset_records() printf(_("Found %d orphaned FileSet records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT FileSetId,FileSet,MD5 FROM FileSet " - "WHERE FileSetId=%u", id_list.Id[i]); + "WHERE FileSetId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_fileset_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -853,7 +863,7 @@ static void eliminate_orphaned_fileset_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned FileSet records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM FileSet WHERE FileSetId=%u", &id_list); + delete_id_list("DELETE FROM FileSet WHERE FileSetId=%s", &id_list); } } @@ -881,8 +891,9 @@ static void eliminate_orphaned_client_records() printf(_("Found %d orphaned Client records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT ClientId,Name FROM Client " - "WHERE ClientId=%u", id_list.Id[i]); + "WHERE ClientId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_client_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -893,7 +904,7 @@ static void eliminate_orphaned_client_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned Client records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Client WHERE ClientId=%u", &id_list); + delete_id_list("DELETE FROM Client WHERE ClientId=%s", &id_list); } } @@ -921,8 +932,9 @@ static void eliminate_orphaned_job_records() printf(_("Found %d orphaned Job records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job " - "WHERE JobId=%u", id_list.Id[i]); + "WHERE JobId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_job_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -933,11 +945,11 @@ static void eliminate_orphaned_job_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d orphaned Job records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list); + delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list); printf(_("Deleting JobMedia records of orphaned Job records.\n")); - delete_id_list("DELETE FROM JobMedia WHERE JobId=%u", &id_list); + delete_id_list("DELETE FROM JobMedia WHERE JobId=%s", &id_list); printf(_("Deleting Log records of orphaned Job records.\n")); - delete_id_list("DELETE FROM Log WHERE JobId=%u", &id_list); + delete_id_list("DELETE FROM Log WHERE JobId=%s", &id_list); } } @@ -958,8 +970,9 @@ static void eliminate_admin_records() printf(_("Found %d Admin Job records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job " - "WHERE JobId=%u", id_list.Id[i]); + "WHERE JobId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_job_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -970,7 +983,7 @@ static void eliminate_admin_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d Admin Job records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list); + delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list); } } @@ -990,8 +1003,9 @@ static void eliminate_restore_records() printf(_("Found %d Restore Job records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (int i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job " - "WHERE JobId=%u", id_list.Id[i]); + "WHERE JobId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_job_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -1002,7 +1016,7 @@ static void eliminate_restore_records() } if (fix && id_list.num_ids > 0) { printf(_("Deleting %d Restore Job records.\n"), id_list.num_ids); - delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list); + delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list); } } @@ -1026,8 +1040,10 @@ static void repair_bad_filenames() printf(_("Found %d bad Filename records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), - "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]); + "SELECT Name FROM Filename WHERE FilenameId=%s", + edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_name_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -1042,8 +1058,10 @@ static void repair_bad_filenames() printf(_("Reparing %d bad Filename records.\n"), id_list.num_ids); for (i=0; i < id_list.num_ids; i++) { int len; + char ed1[50]; bsnprintf(buf, sizeof(buf), - "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]); + "SELECT Name FROM Filename WHERE FilenameId=%s", + edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, get_name_handler, name)) { printf("%s\n", db_strerror(db)); } @@ -1059,8 +1077,8 @@ static void repair_bad_filenames() db_escape_string(esc_name, name, len); } bsnprintf(buf, sizeof(buf), - "UPDATE Filename SET Name='%s' WHERE FilenameId=%u", - esc_name, id_list.Id[i]); + "UPDATE Filename SET Name='%s' WHERE FilenameId=%s", + esc_name, edit_int64(id_list.Id[i], ed1)); if (verbose > 1) { printf("%s\n", buf); } @@ -1086,8 +1104,9 @@ static void repair_bad_paths() printf(_("Found %d bad Path records.\n"), id_list.num_ids); if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) { for (i=0; i < id_list.num_ids; i++) { + char ed1[50]; bsnprintf(buf, sizeof(buf), - "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]); + "SELECT Path FROM Path WHERE PathId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, print_name_handler, NULL)) { printf("%s\n", db_strerror(db)); } @@ -1102,8 +1121,9 @@ static void repair_bad_paths() printf(_("Reparing %d bad Filename records.\n"), id_list.num_ids); for (i=0; i < id_list.num_ids; i++) { int len; + char ed1[50]; bsnprintf(buf, sizeof(buf), - "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]); + "SELECT Path FROM Path WHERE PathId=%s", edit_int64(id_list.Id[i], ed1)); if (!db_sql_query(db, buf, get_name_handler, name)) { printf("%s\n", db_strerror(db)); } @@ -1114,8 +1134,8 @@ static void repair_bad_paths() /* Add trailing slash */ len = pm_strcat(&name, "/"); db_escape_string(esc_name, name, len); - bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%u", - esc_name, id_list.Id[i]); + bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%s", + esc_name, edit_int64(id_list.Id[i], ed1)); if (verbose > 1) { printf("%s\n", buf); } diff --git a/bacula/src/version.h b/bacula/src/version.h index 4c7a6fb8b8..162db16d16 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.39.33" -#define BDATE "23 December 2006" -#define LSMDATE "23Dec06" +#define BDATE "28 December 2006" +#define LSMDATE "28Dec06" #define PROG_COPYRIGHT "Copyright (C) %d-2006 Free Software Foundation Europe e.V.\n" #define BYEAR "2006" /* year for copyright messages in progs */ diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index aced453911..0c5c16db6a 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -1,6 +1,12 @@ Technical notes on version 1.39 General: +28Dec06 +kes Convert dbcheck to use 64 bit DB IDs. +kes Update projects +kes Make rescue work. +kes Clarify Volume migration error message. +kes Look for Job keyword when opening DB in console. 23Dec06 kes Add code in catreq.c to reject volumes not marked Enabled. kes Add a few more ACL access checks. -- 2.39.5