From: Kern Sibbald Date: Tue, 20 Aug 2002 07:41:46 +0000 (+0000) Subject: Verify fix, allow short response to yes/mod/no X-Git-Tag: Release-1.25~34 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a484c9a216deb7fd5f6e2c3a508f5bc92652b654;p=bacula%2Fbacula Verify fix, allow short response to yes/mod/no git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@109 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index b10c44e136..ea1bde9378 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1029,10 +1029,10 @@ static int delete_volume(UAContext *ua) "and all Jobs saved on that volume from the Catalog\n"), mr.VolumeName); - if (!get_cmd(ua, _("If you want to continue enter pretty please: "))) { + if (!get_cmd(ua, _("Are you sure you want to delete this Volume? (yes/no): "))) { return 1; } - if (strcmp(ua->cmd, _("pretty please")) == 0) { + if (strcasecmp(ua->cmd, _("yes")) == 0) { db_delete_media_record(ua->db, &mr); } return 1; @@ -1050,10 +1050,10 @@ static int delete_pool(UAContext *ua) if (!get_pool_dbr(ua, &pr)) { return 1; } - if (!get_cmd(ua, _("If you want to continue enter pretty please: "))) { + if (!get_cmd(ua, _("Are you sure you want to delete this Pool? (yes/no): "))) { return 1; } - if (strcmp(ua->cmd, _("pretty please")) == 0) { + if (strcasecmp(ua->cmd, _("yes")) == 0) { db_delete_pool_record(ua->db, &pr); } return 1; diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index aafd9e1bda..87b4a8dfaa 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -350,7 +350,12 @@ JobId: %s\n"), /* * At user request modify parameters of job to be run. */ - if (strcasecmp(ua->cmd, _("mod")) == 0) { + if (strlen(ua->cmd) == 0) { + bsendmsg(ua, _("Job not run.\n")); + free_jcr(jcr); + return 0; /* do not run */ + } + if (strncasecmp(ua->cmd, _("mod"), strlen(ua->cmd)) == 0) { FILE *fd; start_prompt(ua, _("Parameters to modify:\n")); @@ -504,13 +509,14 @@ JobId: %s\n"), free_jcr(jcr); return 0; /* error do no run Job */ } - if (strcasecmp(ua->cmd, _("yes")) != 0) { - bsendmsg(ua, _("Job not run.\n")); - free_jcr(jcr); - return 0; /* do not run */ + if (strncasecmp(ua->cmd, _("yes"), strlen(ua->cmd)) == 0) { + Dmsg1(200, "Calling run_job job=%x\n", jcr->job); + run_job(jcr); + return 1; } - Dmsg1(200, "Calling run_job job=%x\n", jcr->job); - run_job(jcr); - return 1; + bsendmsg(ua, _("Job not run.\n")); + free_jcr(jcr); + return 0; /* do not run */ + } diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index 699f99ce44..08dc1bee7d 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -375,6 +375,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) char buf[MAXSTRING]; POOLMEM *fname = get_pool_memory(PM_MESSAGE); int do_MD5 = FALSE; + long file_index = 0, attr_file_index = 0; memset(&fdbr, 0, sizeof(FILE_DBR)); fd = jcr->file_bsock; @@ -392,7 +393,6 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) * Link name ??? */ while ((n=bget_msg(fd, 0)) > 0 && !job_cancelled(jcr)) { - long file_index = 0, attr_file_index = 0; int stream; char *attr, *p, *fn; char Opts_MD5[MAXSTRING]; /* Verify Opts or MD5 signature */ diff --git a/bacula/src/filed/win32/Makefile.in b/bacula/src/filed/win32/Makefile.in index 414991fead..7d19f65d2f 100755 --- a/bacula/src/filed/win32/Makefile.in +++ b/bacula/src/filed/win32/Makefile.in @@ -90,7 +90,7 @@ binary-release: @cp -f ../bacula-fd.exe wr/$(sbindir)/bacula-fd.exe @cp -f ../../tools/smtp.exe wr/$(sbindir)/smtp.exe @echo "Copying bacula-fd.conf..." - @cp -f ../bacula-fd.conf wr/$(sysconfdir)/bacula-fd.conf + @cp -f ../bacula-fd.conf wr/$(sysconfdir)/bacula-fd.conf.new # the two dummy files are necessary to insure that WinZip # actually creates the directories. @echo "dummy" >wr/tmp/dummy.txt diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 0f9383063b..4be0de27c5 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -1102,6 +1102,7 @@ void detach_jcr_from_device(DEVICE *dev, JCR *jcr) if (jcr->next_dev) { jcr->next_dev->prev_dev = jcr->prev_dev; } + jcr->next_dev = jcr->prev_dev = NULL; Dmsg1(000, "Detached Job %s\n", jcr->Job); } diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index 4c873d3a01..96f61041b7 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -336,6 +336,9 @@ void stored_free_jcr(JCR *jcr) free_pool_memory(jcr->RestoreBootstrap); jcr->RestoreBootstrap = NULL; } + if (jcr->next_dev && jcr->prev_dev) { + Emsg0(M_FATAL, 0, _("In free_jcr(), but still attached to device!!!!\n")); + } return; } diff --git a/bacula/src/version.h b/bacula/src/version.h index 37e1d0340b..b6f44d505c 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.25" #define VSTRING "1" -#define DATE "19 August 2002" -#define LSMDATE "19Aug02" +#define DATE "20 August 2002" +#define LSMDATE "20Aug02" /* Debug flags */ #define DEBUG 1