From: Kern Sibbald Date: Sun, 14 Feb 2010 09:42:02 +0000 (+0100) Subject: First cut cd to dir during save and restore X-Git-Tag: Release-5.2.1~1747 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=99d3bceb051ced2fcb7da6cb1b8384f35132c25f;p=bacula%2Fbacula First cut cd to dir during save and restore --- diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 3616754f31..b03976476b 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -227,10 +227,12 @@ void *handle_client_request(void *dirp) JCR *jcr; BSOCK *dir = (BSOCK *)dirp; const char jobname[12] = "*Director*"; + saveCWD save_cwd; jcr = new_jcr(sizeof(JCR), filed_free_jcr); /* create JCR */ jcr->dir_bsock = dir; jcr->ff = init_find_files(); + save_cwd.save(jcr); jcr->start_time = time(NULL); jcr->RunScripts = New(alist(10, not_owned_by_alist)); jcr->last_fname = get_pool_memory(PM_FNAME); @@ -381,6 +383,8 @@ void *handle_client_request(void *dirp) ff->fileset = NULL; Dmsg0(100, "Calling term_find_files\n"); term_find_files(jcr->ff); + save_cwd.restore(jcr); + save_cwd.release(); jcr->ff = NULL; Dmsg0(100, "Done with term_find_files\n"); free_jcr(jcr); /* destroy JCR record */ diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index e1a7803a1c..3fa6afcaee 100644 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2008 Free Software Foundation Europe e.V. + Copyright (C) 2001-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -36,6 +36,7 @@ #include "jcr.h" #include "bfile.h" +#include "savecwd.h" #include "../filed/fd_plugins.h" #ifdef HAVE_DIRENT_H diff --git a/bacula/src/findlib/savecwd.c b/bacula/src/findlib/savecwd.c index 68e2267795..2bfac47309 100644 --- a/bacula/src/findlib/savecwd.c +++ b/bacula/src/findlib/savecwd.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2008 Free Software Foundation Europe e.V. + Copyright (C) 2007-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -29,7 +29,6 @@ /* * Kern Sibbald, August MMVII * - * Version $Id$ */ #include "bacula.h" diff --git a/bacula/src/findlib/savecwd.h b/bacula/src/findlib/savecwd.h index 2c8263c436..a97454c45b 100644 --- a/bacula/src/findlib/savecwd.h +++ b/bacula/src/findlib/savecwd.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -29,7 +29,6 @@ /* * Kern Sibbald, August MMVII * - * Version $Id$ */ #ifndef _SAVECWD_H