From 189d110301f4e612000740c5f440fe9ccabb7535 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 18 Dec 2002 18:02:27 +0000 Subject: [PATCH] Allow Nul Where on restore git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@243 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Makefile.in | 2 +- bacula/src/dird/Makefile.in | 2 +- bacula/src/filed/filed_conf.c | 2 +- bacula/src/filed/job.c | 12 ++++++++++-- bacula/src/findlib/create_file.c | 6 +++--- bacula/src/stored/stored_conf.c | 2 +- bacula/src/version.h | 4 ++-- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 86aaedf97f..4ab7734af8 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -130,7 +130,7 @@ clean: # clean for distribution distclean: @for I in $(subdirs); do (cd $$I; $(MAKE) $@ || exit 1); done - @for I in $(subdirs); do (cd $$I; $(RMF) startit stopit btraceback btraceback.gdb); done + @for I in $(subdirs); do (cd $$I; $(RMF) startit stopit btraceback); done @(cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status config.out) @(cd $(srcdir); $(RMF) Makefile autoconf/Make.common) @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1) diff --git a/bacula/src/dird/Makefile.in b/bacula/src/dird/Makefile.in index 1d8581139a..479c24543e 100644 --- a/bacula/src/dird/Makefile.in +++ b/bacula/src/dird/Makefile.in @@ -94,7 +94,7 @@ install: all echo "${INSTALL_DATA} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \ ${INSTALL_DATA} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf if test -f ${DESTDIR}${sysconfdir}/query.sql; then \ - @$(MV) -f ${DESTDIR}${sysconfdir}/query.sql ${DESTDIR}${sysconfdir}/query.sql.save; \ + $(MV) -f ${DESTDIR}${sysconfdir}/query.sql ${DESTDIR}${sysconfdir}/query.sql.save; \ fi ${INSTALL_DATA} query.sql ${DESTDIR}${sysconfdir}/query.sql diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index 484116c1bf..5f40d95419 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -78,7 +78,7 @@ static struct res_items cli_items[] = { {"workingdirectory", store_dir, ITEM(res_client.working_directory), 0, ITEM_REQUIRED, 0}, {"piddirectory", store_dir, ITEM(res_client.pid_directory), 0, ITEM_REQUIRED, 0}, {"subsysdirectory", store_dir, ITEM(res_client.subsys_directory), 0, ITEM_REQUIRED, 0}, - {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 2}, + {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 3}, {"messages", store_res, ITEM(res_client.messages), R_MSGS, 0, 0}, {NULL, NULL, NULL, 0, 0, 0} }; diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 7cf38b46f1..dc8ccfc7c5 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -91,6 +91,7 @@ static char jobcmd[] = "JobId=%d Job=%127s SDid=%d SDtime=%d Authorization=% static char storaddr[] = "storage address=%s port=%d\n"; static char sessioncmd[] = "session %s %ld %ld %ld %ld %ld %ld\n"; static char restorecmd[] = "restore replace=%c where=%s\n"; +static char restorecmd1[] = "restore replace=%c where=\n"; static char verifycmd[] = "verify level=%20s\n"; /* Responses sent to Director */ @@ -687,8 +688,15 @@ static int restore_cmd(JCR *jcr) *where = 0; if (sscanf(dir->msg, restorecmd, &replace, where) != 2) { - Jmsg(jcr, M_FATAL, 0, _("Bad replace command.\n")); - return 0; + if (sscanf(dir->msg, restorecmd1, &replace) != 1) { + Jmsg(jcr, M_FATAL, 0, _("Bad replace command. CMD=%s\n"), dir->msg); + return 0; + } + *where = 0; + } + /* Turn / into nothing */ + if (where[0] == '/' && where[1] == 0) { + where[0] = 0; } Dmsg2(150, "Got replace %c, where=%s\n", replace, where); diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index b1d83cc07e..97fb350250 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -170,19 +170,19 @@ int create_file(void *jcr, char *fname, char *ofile, char *lname, return 0; case FT_SPEC: if (S_ISFIFO(statp->st_mode)) { - Dmsg1(0, "Restore fifo: %s\n", ofile); + Dmsg1(200, "Restore fifo: %s\n", ofile); if (mkfifo(ofile, statp->st_mode) != 0) { Jmsg2(jcr, M_ERROR, 0, _("Cannot make fifo %s: ERR=%s\n"), ofile, strerror(errno)); return 0; } } else { - Dmsg1(0, "Restore node: %s\n", ofile); + Dmsg1(200, "Restore node: %s\n", ofile); if (mknod(ofile, statp->st_mode, statp->st_rdev) != 0) { Jmsg2(jcr, M_ERROR, 0, _("Cannot make node %s: ERR=%s\n"), ofile, strerror(errno)); return 0; } } - Dmsg1(0, "FT_SPEC %s\n", ofile); + Dmsg1(200, "FT_SPEC %s\n", ofile); return 0; /* The following should not occur */ diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 2ff9448bee..b342433014 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -62,7 +62,7 @@ static struct res_items store_items[] = { {"workingdirectory", store_dir, ITEM(res_store.working_directory), 0, ITEM_REQUIRED, 0}, {"piddirectory", store_dir, ITEM(res_store.pid_directory), 0, ITEM_REQUIRED, 0}, {"subsysdirectory", store_dir, ITEM(res_store.subsys_directory), 0, ITEM_REQUIRED, 0}, - {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 2}, + {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 3}, {NULL, NULL, 0, 0, 0, 0} }; diff --git a/bacula/src/version.h b/bacula/src/version.h index cce09b1e2a..f582505abf 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.28" #define VSTRING "1" -#define DATE "17 December 2002" -#define LSMDATE "17Dec02" +#define DATE "18 December 2002" +#define LSMDATE "18Dec02" /* Debug flags */ #define DEBUG 1 -- 2.39.5