From 494c079e4f3ee9bf6f786a14e790510e27fb7395 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 11 Jul 2003 21:26:44 +0000 Subject: [PATCH] Doc updates + fixed win32 crash in idcache cleanups + dlist class git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@632 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 13 ++++++++++++- bacula/ReleaseNotes | 7 ++++--- bacula/kernstodo | 20 ++++++++++++++++++++ bacula/src/dird/admin.c | 2 -- bacula/src/filed/job.c | 4 +--- bacula/src/filed/restore.c | 2 -- bacula/src/findlib/bfile.c | 1 - bacula/src/findlib/find.c | 12 ++++++------ bacula/src/findlib/find_one.c | 5 +++++ bacula/src/lib/attr.c | 10 +++------- bacula/src/lib/idcache.c | 2 ++ bacula/src/lib/message.c | 2 -- bacula/src/stored/acquire.c | 5 +++-- bacula/src/stored/block.c | 4 ++-- bacula/src/stored/btape.c | 10 +++++----- bacula/src/version.h | 4 ++-- 16 files changed, 65 insertions(+), 38 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 00df4f4423..57f5d1acc2 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,16 @@ -2003-07-xx Version 1.31 Beta xxJul03 +2003-07-12 Version 1.31 Beta 10Jul03 +- Manual updates. +- Clean up some unused variables detected by the IRIX compiler. +- Test two directories on Win32 -- caused a crash. I forgot + to NULL the uid cache pointer after releasing it. +- Use bstrncpy() instead of strcpy() in find_files. +- Clear a few linked lists in the temp directory packed in find_one.c +- Eliminate an unnecessary variable in attr.c +- Clear the cache pointer after release in idcache.c +- Implement a new C++ doubly linked list class. + +2003-07-08 Version 1.31 Beta 08Jul03 - Update document for Win32 stuff. - Ensure VolStatus value for update is permitted. - Fix cached_path so that it is local to the jcr, otherwise, there diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 0f97e8e369..a6d1600490 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,10 +1,10 @@ Release Notes for Bacula 1.31 - Bacula code: Total files = 253 Total lines = 75,225 (*.h *.c *.in) + Bacula code: Total files = 253 Total lines = 75,240 (*.h *.c *.in) Major Changes this Release: -- The database format has changed. Please see below. +- The database format has changed from version 1.30a. Please see below. - Support to save and restore all files on WinNT/2K/XP systems including the permissions. Unfortunately files that are in use by another program cannot be saved. @@ -17,7 +17,8 @@ Major Changes this Release: it is not installed in your system libraries. - Implemented generalized tape label formats including counter variables for automatic naming of Volumes. -- Multiple simultaneous jobs now work. +- Multiple simultaneous jobs now work. However, I still don't highly + recommend it. - Implemented tape block rejection, which means that restores with several incremental backups will run orders of magnitude faster. diff --git a/bacula/kernstodo b/bacula/kernstodo index 6b702b0b98..86495102e2 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -32,6 +32,26 @@ Testing to do: (painful) - Figure out how to use ssh or stunnel to protect Bacula communications. For 1.31 release: +- Backup on havana gave: + *status storage + The defined Storage resources are: + 1: File + 2: DDS-3 + Select Storage resource (1-2): 2 + Connecting to Storage daemon DDS-3 at havana:9103 + + havana-sd Version: 1.31 (08 Jul 2003) + Daemon started 10-Jul-2003 19:06, 0 Jobs run. + Device /tmp is not open. + Device /dev/nst0 is mounted with Volume "msu-8Jul03" + Device is being initialized. + Total Bytes Read=4,629,249,084,728,272,628 Blocks Read=0 Bytes/block=134,735,604 + Positioned at File=0 Block=0 + Full Backup job msu-8Jul03 using Volume "msu-backup.2003-07-10_19.06.42" on device /dev/nst0 + Files=0 Bytes=0 Bytes/sec=0 + FDReadSeqNo=6 in_msg=6 out_msg=6 fd=7 + ==== + - Do full check the command line args in update (e.g. VolStatus ...). - Maybe remove multiple simultaneous devices code in SD. - Increment DB version prior to releasing. diff --git a/bacula/src/dird/admin.c b/bacula/src/dird/admin.c index 0b4f0144f1..6d919e625a 100644 --- a/bacula/src/dird/admin.c +++ b/bacula/src/dird/admin.c @@ -79,7 +79,6 @@ static void admin_cleanup(JCR *jcr, int TermCode) char *term_msg; int msg_type; MEDIA_DBR mr; - utime_t RunTime; Dmsg0(100, "Enter backup_cleanup()\n"); memset(&mr, 0, sizeof(mr)); @@ -113,7 +112,6 @@ static void admin_cleanup(JCR *jcr, int TermCode) } bstrftime(sdt, sizeof(sdt), jcr->jr.StartTime); bstrftime(edt, sizeof(edt), jcr->jr.EndTime); - RunTime = jcr->jr.EndTime - jcr->jr.StartTime; Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\ JobId: %d\n\ diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 8c6652c441..186252429d 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -904,12 +904,10 @@ static void filed_free_jcr(JCR *jcr) */ int response(JCR *jcr, BSOCK *sd, char *resp, char *cmd) { - int n; - if (sd->errors) { return 0; } - if ((n = bget_msg(sd)) > 0) { + if (bget_msg(sd) > 0) { Dmsg0(110, sd->msg); if (strcmp(sd->msg, resp) == 0) { return 1; diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index bf1116abc8..068306b060 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -42,7 +42,6 @@ static char rec_header[] = "rechdr %ld %ld %ld %ld %ld"; */ void do_restore(JCR *jcr) { - int wherelen; BSOCK *sd; int32_t stream; uint32_t size; @@ -60,7 +59,6 @@ void do_restore(JCR *jcr) int prog_name_msg = 0; ATTR *attr; - wherelen = strlen(jcr->where); binit(&bfd); sd = jcr->store_bsock; diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index a82c424e2f..30761e1051 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -57,7 +57,6 @@ char *stream_to_ascii(int stream) return "GZIP data"; case STREAM_SPARSE_GZIP_DATA: return "GZIP sparse data"; - return "Win32 attributes"; case STREAM_WIN32_DATA: return "Win32 data"; case STREAM_WIN32_GZIP_DATA: diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index edd6e9e4ef..e4d544e274 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -105,15 +105,15 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time, int mtime_only) int find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) { - char *file; struct s_included_file *inc = NULL; while (!job_canceled(jcr) && (inc = get_next_included_file(ff, inc))) { - file = inc->fname; - strcpy(ff->VerifyOpts, inc->VerifyOpts); /* Copy options for this file */ - Dmsg1(50, "find_files: file=%s\n", file); - if (!file_is_excluded(ff, file)) { - if (!find_one_file(jcr, ff, callback, his_pkt, file, (dev_t)-1, 1)) { + /* Copy options for this file */ + bstrncpy(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts)); + Dmsg1(50, "find_files: file=%s\n", inc->fname); + if (!file_is_excluded(ff, inc->fname)) { + if (!find_one_file(jcr, ff, callback, his_pkt, inc->fname, + (dev_t)-1, 1)) { return 0; /* error return */ } } diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index b4d8240d97..f10b80b795 100755 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -252,11 +252,16 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), * during the restore, the directory permissions will * be reset after all the files have been restored. */ + Dmsg1(300, "Create temp ff packet for dir: %s\n", ff_pkt->fname); FF_PKT *dir_ff_pkt = (FF_PKT *)bmalloc(sizeof(FF_PKT)); memcpy(dir_ff_pkt, ff_pkt, sizeof(FF_PKT)); dir_ff_pkt->fname = bstrdup(ff_pkt->fname); dir_ff_pkt->link = bstrdup(ff_pkt->link); dir_ff_pkt->sys_fname = get_pool_memory(PM_FNAME); + dir_ff_pkt->included_files_list = NULL; + dir_ff_pkt->excluded_files_list = NULL; + dir_ff_pkt->excluded_paths_list = NULL; + dir_ff_pkt->linklist = NULL; ff_pkt->link = ff_pkt->fname; /* reset "link" */ diff --git a/bacula/src/lib/attr.c b/bacula/src/lib/attr.c index 4147da5670..49023bea59 100644 --- a/bacula/src/lib/attr.c +++ b/bacula/src/lib/attr.c @@ -181,15 +181,11 @@ void print_ls_output(JCR *jcr, ATTR *attr) char buf[5000]; char ec1[30]; char *p, *f; - int n; p = encode_mode(attr->statp.st_mode, buf); - n = sprintf(p, " %2d ", (uint32_t)attr->statp.st_nlink); - p += n; - n = sprintf(p, "%-8.8s %-8.8s", getuser(attr->statp.st_uid), getgroup(attr->statp.st_gid)); - p += n; - n = sprintf(p, "%8.8s ", edit_uint64(attr->statp.st_size, ec1)); - p += n; + p += sprintf(p, " %2d ", (uint32_t)attr->statp.st_nlink); + p += sprintf(p, "%-8.8s %-8.8s", getuser(attr->statp.st_uid), getgroup(attr->statp.st_gid)); + p += sprintf(p, "%8.8s ", edit_uint64(attr->statp.st_size, ec1)); p = encode_time(attr->statp.st_ctime, p); *p++ = ' '; *p++ = ' '; diff --git a/bacula/src/lib/idcache.c b/bacula/src/lib/idcache.c index 96f253bd10..8343df5d0d 100644 --- a/bacula/src/lib/idcache.c +++ b/bacula/src/lib/idcache.c @@ -77,6 +77,7 @@ void free_getuser_cache() tail = tail->next; free(otail); } + user_alist = NULL; V(mutex); } @@ -126,5 +127,6 @@ void free_getgroup_cache() tail = tail->next; free(otail); } + group_alist = NULL; V(mutex); } diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 436743fa00..3ceb904022 100755 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -794,8 +794,6 @@ t_msg(char *file, int line, int level, char *fmt,...) va_list arg_ptr; int details = TRUE; - return; - if (level < 0) { details = FALSE; level = -level; diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 5ea0884d76..0138bbd32b 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -44,6 +44,7 @@ int acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) int tape_previously_mounted; VOL_LIST *vol; int autochanger = 0; + int i; lock_device(dev); block_device(dev, BST_DOING_ACQUIRE); @@ -63,12 +64,12 @@ int acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) goto get_out; } jcr->CurVolume++; - for (int i=1; iCurVolume; i++) { + for (i=1; iCurVolume; i++) { vol = vol->next; } pm_strcpy(&jcr->VolumeName, vol->VolumeName); - for (int i=0; i<5; i++) { + for (i=0; i<5; i++) { if (job_canceled(jcr)) { Mmsg0(&dev->errmsg, _("Job canceled.\n")); goto get_out; /* error return */ diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 3f95c792ae..50a7cfa955 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -439,12 +439,12 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) /* Now back up over what we wrote and read the last block */ if (bsf_dev(dev, 1) != 0 || bsf_dev(dev, 1) != 0) { ok = FALSE; - Jmsg(jcr, M_ERROR, 0, _("Back space file at EOT failed. ERR=%s\n"), strerror(dev->dev_errno)); + Jmsg(jcr, M_ERROR, 0, _("Backspace file at EOT failed. ERR=%s\n"), strerror(dev->dev_errno)); } /* Backspace over record */ if (ok && bsr_dev(dev, 1) != 0) { ok = FALSE; - Jmsg(jcr, M_ERROR, 0, _("Back space record at EOT failed. ERR=%s\n"), strerror(dev->dev_errno)); + Jmsg(jcr, M_ERROR, 0, _("Backspace record at EOT failed. ERR=%s\n"), strerror(dev->dev_errno)); /* * On FreeBSD systems, if the user got here, it is likely that his/her * tape drive is "frozen". The correct thing to do is a diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index fedf6e60b1..44f1eabea4 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -439,7 +439,7 @@ static void bsfcmd() if ((stat=bsf_dev(dev, 1)) < 0) { Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror(errno)); } else { - Pmsg0(0, _("Back spaced one file.\n")); + Pmsg0(0, _("Backspaced one file.\n")); } } @@ -453,7 +453,7 @@ static void bsrcmd() if ((stat=bsr_dev(dev, 1)) < 0) { Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror(errno)); } else { - Pmsg0(0, _("Back spaced one record.\n")); + Pmsg0(0, _("Backspaced one record.\n")); } } @@ -613,16 +613,16 @@ static int re_read_block_test() weofcmd(); weofcmd(); if (bsf_dev(dev, 1) != 0) { - Pmsg1(0, _("Back space file failed! ERR=%s\n"), strerror(dev->dev_errno)); + Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno)); goto bail_out; } if (bsf_dev(dev, 1) != 0) { - Pmsg1(0, _("Back space file failed! ERR=%s\n"), strerror(dev->dev_errno)); + Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror(dev->dev_errno)); goto bail_out; } Pmsg0(0, "Backspaced over two EOFs OK.\n"); if (bsr_dev(dev, 1) != 0) { - Pmsg1(0, _("Back space record failed! ERR=%s\n"), strerror(dev->dev_errno)); + Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror(dev->dev_errno)); goto bail_out; } Pmsg0(0, "Backspace record OK.\n"); diff --git a/bacula/src/version.h b/bacula/src/version.h index 344dc34f64..7c67104845 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.31" #define VSTRING "1" -#define BDATE "08 Jul 2003" -#define LSMDATE "08Jul03" +#define BDATE "10 Jul 2003" +#define LSMDATE "10Jul03" /* Debug flags */ #define DEBUG 1 -- 2.39.5