From ad309a99b840bf850a220825d6bb9c119990d2b9 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 13 Apr 2003 14:40:05 +0000 Subject: [PATCH] Fix directory times, modes on restore git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@437 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ReleaseNotes | 2 +- bacula/src/filed/backup.c | 33 +++++++++++++++++---------------- bacula/src/version.h | 6 +++--- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 75972c52c0..8d9ff8a7a4 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,6 +1,6 @@ Release Notes for Bacula 1.30 - Bacula code: Total files = 233 Total lines = 66,066 (*.h *.c *.in) + Bacula code: Total files = 235 Total lines = 66,579 (*.h *.c *.in) Major Changes this Release: - The Windows Client now uses Cygwin 1.3.20 and should be much diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 6983dfaa0a..794e26c953 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -93,7 +93,7 @@ int blast_data_to_storage_daemon(JCR *jcr, char *addr) * * Send the file and its data to the Storage daemon. */ -static int save_file(FF_PKT *ff_pkt, void *ijcr) +static int save_file(FF_PKT *ff_pkt, void *vjcr) { char attribs[MAXSTRING]; char attribsEx[MAXSTRING]; @@ -102,9 +102,9 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) struct SHA1Context sha1c; int gotMD5 = 0; int gotSHA1 = 0; - unsigned char signature[25]; /* large enough for either signature */ + unsigned char signature[30]; /* large enough for either signature */ BSOCK *sd; - JCR *jcr = (JCR *)ijcr; + JCR *jcr = (JCR *)vjcr; POOLMEM *msgsave; if (job_canceled(jcr)) { @@ -175,6 +175,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) return 1; } + /* Open any file with data that we intend to save */ if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) && ff_pkt->statp.st_size > 0) || ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO) { @@ -192,7 +193,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } stop_thread_timer(tid); } else { - binit(&ff_pkt->bfd); + binit(&ff_pkt->bfd); /* mark file not opened */ } Dmsg1(130, "bfiled: sending %s to stored\n", ff_pkt->fname); @@ -210,7 +211,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) * Send Attributes header to Storage daemon * */ -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream)) { if (is_bopen(&ff_pkt->bfd)) { bclose(&ff_pkt->bfd); @@ -255,7 +256,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) return 0; } bnet_sig(sd, BNET_EOD); /* indicate end of attributes data */ -#endif +/* #endif */ /* * If the file has data, read it and send to the Storage daemon @@ -300,7 +301,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } #endif -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ /* * Send Data header to Storage daemon * @@ -311,7 +312,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) return 0; } Dmsg1(100, ">stored: datahdr %s\n", sd->msg); -#endif +/* #endif */ if (ff_pkt->flags & FO_MD5) { MD5Init(&md5c); @@ -383,7 +384,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } #endif -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ /* Send the buffer to the Storage daemon */ if (!sparseBlock) { if (ff_pkt->flags & FO_SPARSE) { @@ -399,7 +400,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } } Dmsg1(130, "Send data to SD len=%d\n", sd->msglen); -#endif +/* #endif */ jcr->JobBytes += sd->msglen; /* count bytes saved possibly compressed */ sd->msg = msgsave; /* restore read buffer */ @@ -411,38 +412,38 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } bclose(&ff_pkt->bfd); /* close file */ -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ if (!bnet_sig(sd, BNET_EOD)) { /* indicate end of file data */ set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } -#endif /* NO_FD_SEND_TEST */ +/* #endif */ } /* Terminate any MD5 signature and send it to Storage daemon and the Director */ if (gotMD5 && ff_pkt->flags & FO_MD5) { MD5Final(signature, &md5c); -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_MD5_SIGNATURE); Dmsg1(100, "bfiled>stored:header %s\n", sd->msg); memcpy(sd->msg, signature, 16); sd->msglen = 16; bnet_send(sd); bnet_sig(sd, BNET_EOD); /* end of MD5 */ -#endif +/* #endif */ gotMD5 = 0; } else if (gotSHA1 && ff_pkt->flags & FO_SHA1) { /* Terminate any SHA1 signature and send it to Storage daemon and the Director */ SHA1Final(&sha1c, signature); -#ifndef NO_FD_SEND_TEST +/* #ifndef FD_NO_SEND_TEST */ bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_SHA1_SIGNATURE); Dmsg1(100, "bfiled>stored:header %s\n", sd->msg); memcpy(sd->msg, signature, 20); sd->msglen = 20; bnet_send(sd); bnet_sig(sd, BNET_EOD); /* end of SHA1 */ -#endif +/* #endif */ gotMD5 = 0; } return 1; diff --git a/bacula/src/version.h b/bacula/src/version.h index bb796f578d..2500bbaf02 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.30" #define VSTRING "1" -#define BDATE "12 April 2003" -#define LSMDATE "12Apr03" +#define BDATE "14 April 2003" +#define LSMDATE "14Apr03" /* Debug flags */ #define DEBUG 1 @@ -18,5 +18,5 @@ /* #define NO_ATTRIBUTES_TEST 1 */ /* #define NO_TAPE_WRITE_TEST 1 */ -/* #define NO_FD_SEND TEST 1 */ +/* #define FD_NO_SEND TEST 1 */ /* #define DEBUG_MUTEX 1 */ -- 2.39.5