]> git.sur5r.net Git - bacula/bacula/commitdiff
This commit was manufactured by cvs2svn to create tag Release-1.36.3
author(no author) <(no author)@91ce42f0-d328-0410-95d8-f526ca767f89>
Sat, 23 Apr 2005 11:30:19 +0000 (11:30 +0000)
committer(no author) <(no author)@91ce42f0-d328-0410-95d8-f526ca767f89>
Sat, 23 Apr 2005 11:30:19 +0000 (11:30 +0000)
'Release-1.36.3'.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/tags/Release-1.36.3@1954 91ce42f0-d328-0410-95d8-f526ca767f89

247 files changed:
bacula/ChangeLog
bacula/LICENSE
bacula/Makefile.in
bacula/ReleaseNotes
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/examples/conf/fileset_convert.pl [new file with mode: 0755]
bacula/kernstodo
bacula/patches/fix_postgresql_tables [deleted file]
bacula/platforms/gentoo/1.36.2-cdrecord-configure.patch [new file with mode: 0644]
bacula/platforms/gentoo/bacula.ebuild
bacula/platforms/mandrake/bacula.spec.in
bacula/platforms/redhat/bacula-dir.in
bacula/platforms/redhat/bacula-fd.in
bacula/platforms/redhat/bacula-sd.in
bacula/platforms/redhat/bacula.spec.in
bacula/platforms/suse/Makefile.in
bacula/platforms/suse/bacula.spec.in
bacula/scripts/.cvsignore
bacula/scripts/bacula.in
bacula/scripts/btraceback.in
bacula/scripts/logwatch/Makefile.in [new file with mode: 0644]
bacula/scripts/logwatch/bacula [new file with mode: 0755]
bacula/scripts/logwatch/logfile.bacula.conf.in [new file with mode: 0644]
bacula/scripts/logwatch/services.bacula.conf [new file with mode: 0644]
bacula/src/baconfig.h
bacula/src/cats/drop_mysql_tables.in
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/sql_update.c
bacula/src/console/conio.c
bacula/src/console/console.c
bacula/src/dird/admin.c
bacula/src/dird/authenticate.c
bacula/src/dird/dird.c
bacula/src/dird/dird.h
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/fd_cmds.c
bacula/src/dird/getmsg.c
bacula/src/dird/inc_conf.c
bacula/src/dird/job.c
bacula/src/dird/jobq.c
bacula/src/dird/msgchan.c
bacula/src/dird/protos.h
bacula/src/dird/query.sql
bacula/src/dird/recycle.c
bacula/src/dird/scheduler.c
bacula/src/dird/sql_cmds.c
bacula/src/dird/ua.h
bacula/src/dird/ua_acl.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_label.c
bacula/src/dird/ua_query.c
bacula/src/dird/ua_restore.c
bacula/src/dird/ua_run.c
bacula/src/dird/ua_server.c
bacula/src/dird/ua_status.c
bacula/src/dird/ua_tree.c
bacula/src/dird/verify.c
bacula/src/filed/backup.c
bacula/src/filed/estimate.c
bacula/src/filed/filed.c
bacula/src/filed/job.c
bacula/src/filed/restore.c
bacula/src/filed/verify_vol.c
bacula/src/findlib/Makefile.in
bacula/src/findlib/create_file.c
bacula/src/findlib/find.c
bacula/src/findlib/find.h
bacula/src/findlib/find_one.c
bacula/src/findlib/fstype.c [new file with mode: 0644]
bacula/src/findlib/match.c
bacula/src/findlib/protos.h
bacula/src/gnome2-console/console.c
bacula/src/jcr.h
bacula/src/lib/address_conf.c
bacula/src/lib/address_conf.h
bacula/src/lib/alist.c
bacula/src/lib/alist.h
bacula/src/lib/bnet.c
bacula/src/lib/bnet_server.c
bacula/src/lib/bpipe.c
bacula/src/lib/bsys.c
bacula/src/lib/daemon.c
bacula/src/lib/edit.c
bacula/src/lib/fnmatch.c
bacula/src/lib/fnmatch.h
bacula/src/lib/htable.c
bacula/src/lib/htable.h
bacula/src/lib/jcr.c
bacula/src/lib/lex.c
bacula/src/lib/lex.h
bacula/src/lib/mem_pool.c
bacula/src/lib/message.c
bacula/src/lib/protos.h
bacula/src/lib/scan.c
bacula/src/lib/util.c
bacula/src/lib/watchdog.c
bacula/src/lib/workq.c
bacula/src/stored/acquire.c
bacula/src/stored/askdir.c
bacula/src/stored/authenticate.c
bacula/src/stored/bextract.c
bacula/src/stored/block.h
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/bsr.h
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/src/stored/job.c
bacula/src/stored/match_bsr.c
bacula/src/stored/parse_bsr.c
bacula/src/stored/read_record.c
bacula/src/stored/record.c
bacula/src/stored/spool.c
bacula/src/stored/status.c
bacula/src/stored/stored.c
bacula/src/stored/stored.h
bacula/src/stored/stored_conf.c
bacula/src/tools/Makefile.in
bacula/src/tools/dbcheck.c
bacula/src/tools/fstype.c [new file with mode: 0644]
bacula/src/tools/testfind.c
bacula/src/tray-monitor/authenticate.c
bacula/src/tray-monitor/eggmarshalers.c
bacula/src/tray-monitor/eggmarshalers.h
bacula/src/tray-monitor/eggstatusicon.c
bacula/src/tray-monitor/eggstatusicon.h
bacula/src/tray-monitor/eggtrayicon.c
bacula/src/tray-monitor/eggtrayicon.h
bacula/src/tray-monitor/tray-monitor.c
bacula/src/tray-monitor/tray-monitor.h
bacula/src/tray-monitor/tray_conf.c
bacula/src/tray-monitor/tray_conf.h
bacula/src/version.h
bacula/src/win32/compat/compat.cpp
bacula/src/win32/winbacula.nsi.in
bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/Makefile.in
bacula/src/wx-console/console_conf.c
bacula/src/wx-console/console_thread.h
bacula/src/wx-console/wxbconfigfileeditor.h
bacula/src/wx-console/wxbconfigpanel.h
bacula/src/wx-console/wxbhistorytextctrl.h
bacula/src/wx-console/wxblistctrl.h
bacula/src/wx-console/wxbmainframe.cpp
bacula/src/wx-console/wxbmainframe.h
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbrestorepanel.h
bacula/src/wx-console/wxbtableparser.h
bacula/src/wx-console/wxbtreectrl.h
bacula/src/wx-console/wxbutils.h
regress/.cvsignore [deleted file]
regress/Makefile.in [deleted file]
regress/README [deleted file]
regress/all-non-root-2tape-tests [deleted file]
regress/all-non-root-tape-tests [deleted file]
regress/all-non-root-tests [deleted file]
regress/all-root-tests [deleted file]
regress/all-tape-and-file-tests [deleted file]
regress/all-tests [deleted file]
regress/config [deleted file]
regress/do_all [deleted file]
regress/do_all_tapes [deleted file]
regress/file [deleted file]
regress/kern.conf [deleted file]
regress/prototype.conf [deleted file]
regress/run [deleted file]
regress/scripts/.cvsignore [deleted file]
regress/scripts/bacula-dir-tape.conf.in [deleted file]
regress/scripts/bacula-sd-2tape.conf.in [deleted file]
regress/scripts/bacula-sd-tape.conf.in [deleted file]
regress/scripts/bacula-sd.conf.in [deleted file]
regress/scripts/check_for_zombie_jobs [deleted file]
regress/scripts/cleanup [deleted file]
regress/scripts/cleanup-2tape.in [deleted file]
regress/scripts/cleanup-tape.in [deleted file]
regress/scripts/copy-2tape-confs [deleted file]
regress/scripts/copy-confs [deleted file]
regress/scripts/copy-tape-confs [deleted file]
regress/scripts/copy-test-confs [deleted file]
regress/scripts/copy-testa-confs [deleted file]
regress/scripts/do_sed [deleted file]
regress/scripts/exclude-dev-test [deleted file]
regress/scripts/exclude-etc-test [deleted file]
regress/scripts/exclude-lib-test [deleted file]
regress/scripts/flist [deleted file]
regress/scripts/freebsd_tape_options [deleted file]
regress/scripts/linux_osst_tape_options [deleted file]
regress/scripts/linux_tape_options [deleted file]
regress/scripts/new-test-bacula-dir.conf.in [deleted file]
regress/scripts/prepare-two-tapes.in [deleted file]
regress/scripts/regress-config [deleted file]
regress/scripts/setup [deleted file]
regress/scripts/test-bacula-dir.conf.in [deleted file]
regress/scripts/test-bacula-fd.conf.in [deleted file]
regress/scripts/test-bacula-sd.conf.in [deleted file]
regress/scripts/test-console.conf.in [deleted file]
regress/scripts/testa-bacula-dir.conf.in [deleted file]
regress/tape [deleted file]
regress/tests/.cvsignore [deleted file]
regress/tests/auto-label-test [deleted file]
regress/tests/backup-bacula-tape [deleted file]
regress/tests/backup-bacula-test [deleted file]
regress/tests/bextract-test [deleted file]
regress/tests/bscan-tape [deleted file]
regress/tests/bscan-test [deleted file]
regress/tests/bsr-opt-test [deleted file]
regress/tests/btape-fill-full-tape [deleted file]
regress/tests/btape-fill-tape [deleted file]
regress/tests/compressed-test [deleted file]
regress/tests/concurrent-jobs-test [deleted file]
regress/tests/decremental-test [deleted file]
regress/tests/dev-test-root [deleted file]
regress/tests/etc-test-root [deleted file]
regress/tests/fixed-block-size-tape [deleted file]
regress/tests/four-concurrent-jobs-tape [deleted file]
regress/tests/four-concurrent-jobs-test [deleted file]
regress/tests/four-jobs-tape [deleted file]
regress/tests/four-jobs-test [deleted file]
regress/tests/incremental-2tape [deleted file]
regress/tests/incremental-tape [deleted file]
regress/tests/incremental-test [deleted file]
regress/tests/lib-tape-root [deleted file]
regress/tests/lib-test-root [deleted file]
regress/tests/query-test [deleted file]
regress/tests/recycle-test [deleted file]
regress/tests/restore-by-file-tape [deleted file]
regress/tests/restore-by-file-test [deleted file]
regress/tests/restore-disk-seek-test [deleted file]
regress/tests/restore2-by-file-test [deleted file]
regress/tests/six-vol-test [deleted file]
regress/tests/small-file-size-tape [deleted file]
regress/tests/span-vol-test [deleted file]
regress/tests/sparse-compressed-test [deleted file]
regress/tests/sparse-test [deleted file]
regress/tests/test0 [deleted file]
regress/tests/two-jobs-test [deleted file]
regress/tests/two-vol-test [deleted file]
regress/tests/two-volume-tape [deleted file]
regress/tests/usr-tape-root [deleted file]
regress/tests/verify-vol-test [deleted file]
regress/tests/weird-files-test [deleted file]
regress/tests/weird-files2-test [deleted file]
regress/weird-files.tar.gz [deleted file]

index f4d894739ea2314404c77862c98aeea2be6e8761..18e46be42094eefafba8aa012574a9119ebbaf5f 100644 (file)
@@ -1,5 +1,109 @@
 
-Version 1.36.1 released xxNov04:
+Changes to 1.36.3 released 23Apr05:
+22Apr05
+- Correct return type of ftello to avoid overflow --
+  thanks to Peter Eriksson.
+13Apr05
+- Fix seg fault if Name directive missing in Job resource.
+12Apr05
+- Add new LaTeX doc to 1.36.2 branch.
+- Fix SuSE autostart routines to use /etc/init.d instead
+  of /etc/rc.d/init.d.
+- Increase index size on File table Name and Path table Path
+  to improve performance.
+- Second fix for not zeroing SD pointers on restarted job.
+- Turn off old style Include/Excludes.
+01Apr05
+- Use fseeko and ftello so that attributes can exceed 4GB
+- Flush console output after every line.
+- Turn off Multiple Connections in catalog resource, which
+  causes corruped databases.  It is silently ignored.
+- Drop support for old style Include/Exclude.  There is a
+  perl script that will convert them.
+- Inhibit trying to reset attributes on a Win32 drive.
+18Mar05 1.36.2-store.patch
+- This patch fails a job if no Storage resource is specified and
+  the job attempts to call the SD.
+18Mar05 1.36.2-reschedule.patch
+- This patch should fix a Segfault bug when a job is rescheduled.
+  The storage pointers were being released when they should not
+  have been.
+17Mar05 1.36.2-restore-speed.patch
+- This patch will fix a subtle bug that was introduced in 1.36.2
+  which causes Bacula to be very slow restoring a few files. This
+  is because it reads completely to the end of the Volume rather
+  than stopping when all the files on the Volume are loaded. The
+  introduction of the bug was caused by a patch that fixed 
+  Bacula truncating tapes after a restore.
+  Note that all source files will be rebuilt during the make.
+16Mar05 1.36.2-console.patch
+- This patch causes the output directed to a file to be
+  flushed after every line. This is a bit overkill, IMO, but
+  a user complained about it.
+15Mar05 1.36.2-netbsd.patch
+- This patch corrects a compile problem because of no statfs() 
+  on NetBSD. The patch was submitted by kardel with bug 258.
+09Mar05 1.36.2-win32-drive.patch
+- This patch will prevent the Win32 FD from printing an error message
+  when it attempts to restore the permissions for a drive (which Win32
+  doesn't permit). The error is harmless in any case.
+04Mar05 1.36.2-level.patch
+- This patch should fix a problem with th %l editing in the 
+  client (FD) where it edited nothing. With this fix, it should
+  edit "since".  
+04Mar05 1.36.2-pool.patch
+- This patch corrects a problem preventing multiple 
+  simultaneous jobs from different pools.
+
+Changes to 1.36.2 released 28Feb05:
+27Feb05
+- Fix pointer to stack variable in Verify jobs.
+- Change reference to DEV_BSIZE to B_DEV_BSIZE to
+  avoid colision with some OSes.
+- Release storage[i] in job.c if allocated when            
+  starting/restarting a job. Avoids orpahanned buffers.
+24Feb05
+- Add awk check to configure.in
+- Bring over a few files from 1.37.
+18Feb05
+- Fix some lower case character problems in sql_cmds.c reported
+  by Debian.
+- Fix seg fault if debug level 900 set in SD.
+- Truncate Win32 child return code to 8 bits.
+15Feb05
+- Fix deadlock in multiple simultaneous jobs.
+- Fix tape "truncation"/"number of files" after restore bug.
+- Merge a few minor things from the 1.37 stream.
+14Feb05
+- Add a number of new features from 1.37, and apply fixes  
+  for all known bugs. See ReleaseNotes for details.
+- Apply Tim's patch for ACLs.
+
+Version 1.36.1 released 26Nov04:
+24Nov04
+- Take Dan's fix to the fix_postgresql_tables (thanks Dan)
+- Increase Maximum Concurrent Jobs to 20 in SD and FD!
+- Fix improper handling of autochanger Volumes that are not
+  marked InChanger.
+22Nov04
+- Update authentication failure message to indicate possible
+  problem with Maximum Concurrent Jobs. Add to doc too.
+- Commit PostgreSQL BIGINT fix -- apparently some people didn't
+  get it.
+- Do not use a slot unless it is InChanger in the autochanger
+  code, otherwise autochanger gets upset not finding the Volume.
+21Nov04
+- Make authentication timeout compile time configurable.
+  The value is set in src/baconfig.h
+- Fix removing items from watchdog queue, which apparently
+  screwed up if there was more than one item.
+- Rework mediaformat part of manual to separate out old
+  tape format for easier reading.
+- Add a lot of debug code to the authentication code.
+- Add seconds to the start/end times printed in the job report.
+19Nov04
+- Fix mutex deadlock in dequeue of messages.
+- Add debug code to FD authorization.
 18Nov04
 - Increase authentication timeouts to 10 minutes.  
 15Nov04
index 18162b190068c5e4aa71e3a727ad93233e22fa9b..c6875a728245e064d22f28af0265439d0513b97c 100644 (file)
@@ -49,6 +49,8 @@ the copyright license set forth in this Agreement.
 
 Code falling under the above conditions will be marked as follows:
 
+   Copyright (C) 2000-2005 Kern Sibbald
+or
    Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
index e3bb87cce8c1d0ad6d85b515fd97c23e3b028afc..a5b99c1e03daec476441347a5aab8fafbd3164cd 100755 (executable)
@@ -57,7 +57,7 @@ bacula-fd: Makefile
 configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
        cd $(srcdir);
        ${RMF} -f config.cache config.log config.out config.status src/config.h
-       WANT_AUTOCONF=2.5 autoconf --prepend-include=$(srcdir)/autoconf \
+       autoconf --prepend-include=$(srcdir)/autoconf \
        autoconf/configure.in > configure
        chmod 755 configure
 
@@ -76,7 +76,7 @@ config.status:
 autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
        cd $(srcdir);
        ${RMF} -f config.cache config.log config.out config.status src/config.h
-       WANT_AUTOCONF=2.5 autoheader --prepend-include=$(srcdir)/autoconf \
+       autoheader --prepend-include=$(srcdir)/autoconf \
        autoconf/configure.in > autoconf/config.h.in
        chmod 644 autoconf/config.h.in
 
@@ -181,6 +181,8 @@ clean:
        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
        @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
        @$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
+       @$(RMF) -r autom4te.cache
+       @find . -name .#* -exec $(RMF) {} \;
 
 
 # clean for distribution
index 99d6eb5005f65b0258e20ac1449ae2a302fce510..dd3baf589596f7e97451c66ad80ba16684ed35ac 100644 (file)
 
-          Release Notes for Bacula 1.36.0
-
-  Bacula code: Total files = 396 Total lines = 116,418 (*.h *.c *.in)
-
-
-Major Changes:
-- Tray monitor program (really cool)
-- Bacula Rescue CDROM (easy to make and essential for emergencies)
-- Bacula CD Image Manager
-- General bug fixes/stabilization
-- French translation of manual by Ludovic Strappazon well    
-  underway.
-- UTF-8 is supported in conio.
-- Improved conf scanning code allowing FileSet components to
-  be put on a single line (previously everything had to be on
-  a different line).
-- Win32 files restored to an alternate directory will have the
-  colon following the drive letter turned into a / e.g. c: 
-  becomes c/. Previously the c: was stripped. This applies only
-  to files written to an alternate directory (i.e. using a where=).
-- Certain open files (Word for example) can now be saved on
-  Win32 systems.
-- Default for Wild-cards on Win32 systems is to fold case this       
-  should correct most of the problems users are having with
-  exclusion on Win32.
-- Lots of improvements in the Rescue scripts -- better 
-  network detection, better mounting code, ...
-- The attributes spool file can now exceed 2GB.
-- Significant speed improvements when running PostgreSQL.
-- Significantly faster restore command with very large 
-  FileSets while building the in memory directory tree.
-- Patches directory in the source will have all patches
-  that have not been applied and released (new releases are
-  only generated when really critical bugs are found).
-- Bacula forces the tape drive into variable block mode
-  on most systems (providing Bacula is running in variable
-  block mode).
-- dbcheck updated to remove many more orphaned records.
-- Support for IPv6 (untested).
-- Modifications to the license to termination clause for
-  more protection from SCO type predators. No change for
-  normal users.
-- SIGHUP to Director causes it to reload conf file.
-
-- Many improvements in the documentation.
-
-New Directives:
-- Added "Rerun Failed levels = yes/no" in the Job resource
-  of the Director. It will upgrade the current job to a 
-  higher level (Full or Differential) if a previous job
-  of that level failed.
-- Added "Ignore FileSet Changes = yes/no" in the FileSet
-  directive of the Director. It prevents the Director from
-  immediately upgrading the job to a Full save if you modify
-  the contents of the FileSet. Not recommended. 
-- Added "Block positioning = yes/no" in Device resource in SD.
-  If set to no, Bacula should (as yet untested) be able to
-  recover data from tapes where the drive was set to fixed
-  blocksize but Bacula is in variable block size.
-- Added "Multiple connections = yes/no" in Catalog record for
-  allowing multiple simultaneous connections to the database.
-  This is a major performance improvement for PostgreSQL and
-  SQLite, but it is untested, so please test before putting
-  it into production.
-- Alert Command in SD permits checking for tape drive 
-  alerts at the end of every job (or doing anything you want).
-  An example of the command is in the default bacula-sd.conf
-  file as well as in the Storage Configuration chapter of
-  the manual.
+          Release Notes for Bacula 1.36.3
+
+  Bacula code: Total files = 398 Total lines = 118,000 (*.h *.c *.in)
+
+Major Changes to version 1.36.3:
+- Applied all fixes for bugs since version 1.36.2 (see below)
+- Use fseeko and ftello so that attributes can exceed 4 GB.
+- Thanks to Karl Cunningham's hard work and skilled Perl      
+  programming, the manual is now in LaTeX format
+  and has an index!
+- Drop support of old style Include/Excludes (see below).
+
+New Directives in 1.36.3:
+- None, but see 1.36.2 additions below.
 
 New Commands:
-- umount -- same as unmount.
-- delete job now permits multiple jobids and ranges, e.g.:
-    delete job jobid=1,3,5,11-16
-- reload -- reloads bacula-dir.conf in Director.
+- None since 1.36.1
+
+Items to note for 1.36.3!!!
+- Drop support of old style Include/Excludes. Matt Howard has
+  supplied a handy Perl program that will do a good job of
+  converting your FileSets. It can be found in 
+  examples/conf/fileset_convert.pl
+- Dan has reminded us that the arguments for make_catalog_backup
+  changed from 1.34.x to 1.36.1. The old arguments were typically
+  "-U bacula".  The new arguments are typically "bacula bacula",
+  where the first is the database name, and the second is the
+  user name.
+
+Patches applied:
+
+04Mar05 1.36.2-level.patch
+ This patch should fix a problem with th %l editing in the 
+ client (FD) where it edited nothing. With this fix, it should
+ edit "since".  
+
+04Mar05 1.36.2-pool.patch
+ This patch corrects a problem preventing multiple 
+ simultaneous jobs from different pools.
+
+09Mar05 1.36.2-win32-drive.patch
+ This patch will prevent the Win32 FD from printing an error message
+ when it attempts to restore the permissions for a drive (which Win32
+ doesn't permit). The error is harmless in any case.
+
+15Mar05 1.36.2-netbsd.patch
+ This patch corrects a compile problem because of no statfs() 
+ on NetBSD. The patch was submitted by kardel with bug 258.
+
+16Mar05 1.36.2-console.patch
+ This patch causes the output directed to a file to be
+ flushed after every line. This is a bit overkill, IMO, but
+ a user complained about it.
+
+17Mar05 1.36.2-restore-speed.patch
+ This patch will fix a subtle bug that was introduced in 1.36.2
+ which causes Bacula to be very slow restoring a few files. This
+ is because it reads completely to the end of the Volume rather
+ than stopping when all the files on the Volume are loaded. The
+ introduction of the bug was caused by a patch that fixed 
+ Bacula truncating tapes after a restore.
+ Note that all source files will be rebuilt during the make.
+   
+18Mar05 1.36.2-store.patch
+ This patch fails a job if no Storage resource is specified and
+ the job attempts to call the SD.
+
+18Mar05 1.36.2-reschedule.patch
+ This patch should fix a Segfault bug when a job is rescheduled.
+ The storage pointers were being released when they should not
+ have been.
+
+24Mar05 1.36.2-wx-console-bugfixes.patch
+ Major wx-console fixes (see src/wx-console/CHANGELOG for details).
+
+28Mar05 1.36.2-tray-monitor-memleak.patch
+ This patch should fix memory leaks in tray-monitor.
 
-Items to note!!!
+================================================================
+
+Items to note for 1.36.2!!!
+- Dan has reminded us that the arguments for make_catalog_backup
+  changed from 1.34.x to 1.36.1. The old arguments were typically
+  "-U bacula".  The new arguments are typically "bacula bacula",
+  where the first is the database name, and the second is the
+  user name.
+
+Patches applied:
+
+03Dec04  1.36.1-pool.patch
+ This patch should hold jobs in the Director's start queue if
+ more than one simultaneous backup job wants to use the same
+ Storage device with two different Pools (i.e. 2 Volumes).
+
+03Dec04  1.16.1-slots.patch
+ This patch should fix "update slots" with two different
+ magazines in different pools by checking the pool when zapping
+ the InChanger.
+
+18Dec04 1.36.1-spool.patch
+ This patch fixes the despooling size printed in the Job 
+ report. Previously, it reported the total size for the
+ device. This patch makes it report the size for the job.
+
+21Dec04 1.36.1-store.patch
+ This patch fixes a problem with overriding storage daemon
+ specifications. Previously they were not always honored.
+ This implements more uniform handling. It also eliminates
+ an orphaned buffer situation using JobDefs.
+
+21Dec04 1.36.1-reload.patch
+ This patch fixes Bacula so that it does not exit if there
+ is a syntax error in its conf file during a reload command.
+
+24Dec04 1.36.1-fileset.patch
+ This patch should correct a seg fault in the FD that occurs
+ at the end of a job when the job uses old style include/excludes.
+ Old style include/excludes are deprecated and should be
+ converted to the new style as soon as possible.
+
+30Jan05 1.36.1-acl.patch
+ This patch fixes some typos with ACL checking that results
+ in the incorrect name being used for the check.
+ This fixes possible security problems with unwanted 
+ access by restricted consoles.
+
+15Feb05 1.36.1-truncate.patch
+ This patch fixes a bug where a tape gets "truncated" after
+ doing a restore. The number of files in the catalog do not
+ agree with what Bacula thinks is on tape, then the tape is
+ marked in error.
+
+===
+Items to note for version 1.36.1:
+- The output from Job reports has been modified to include the 
+  seconds on the start/end times, the Storage device used, and to
+  indent the output differently.
+- If you created a PostgreSQL database under version 1.36.0, there
+  are two things you might want to do. 1. manually remove some
+  of the File table indexes to improve backup performance. See the
+  make_postgresql_tables script. 2. run fix_postgresql_tables (in
+  src/cats and updatedb) to correct a table. This is necessary only
+  if you are creating disk Volumes greater than 2GB.
 - As of 1.35.5 you MUST do a database update.
   
   cd scripts-dir (or src/cats)
@@ -85,11 +151,47 @@ Items to note!!!
   of the new FileSet features such as regular expressions.
 - Regular expressions are not supported in the Win32 FD.
 
-Other Items:
-- Much better error messages from system errors particularly
-  on Win32 and in running scripts.
-- Many improvements in the SD.
-- Full support for 64 bit machines.
-- btape improved test and fill commands.
-- See the ChangeLog for additional details.
 
+Major Changes to version 1.36.1:
+- There is a new Win32 pebuilder rescue disk thanks to Scott. This
+  is worth the effort to checkout.
+- A number of indexes have been removed from the PostgreSQL
+  database to improve performance during backups. You may need to
+  add these indexes if you do Verifies. See the scripts.
+- We now have a Gentoo ebuild -- thanks Scott.
+- There are a number of new ./configure options for the 
+  bimagemgr. Please see the documentation or ./configure --help
+- The RedHat autostart scripts disable using /lib/tls. If you
+  don't want this you will need to turn it off.
+- Corrected a problem with the default SD and FD conf files that
+  incorrectly set Maximum Concurrent Jobs = 1. This prevented
+  running a job and obtaining the status at the same time.
+- All daemon messages are now prefixed with a short date/time,
+  and queued messages (generated in the comm routines) have the
+  time the message was generated rather than the time the message
+  was sent (usually much later).
+- Fixed a bug with the autochanger code not respecting the InChanger
+  flag.
+
+Other Items:
+- It is now possible to build the Rescue CDROM using a pre-installed
+  static Bacula FD.
+- Corrected a bug in the traceback code when Bacula was executed without
+  a path. Tracebacks should now work in more cases.
+- Corrected a typo in the traceback script.
+- Fixed the mtx autochanger script so that it correctly waits on
+  Linux systems (if you manually enable the code).
+- Added grant all on cdimages for PostgreSQL users of bimagemgr.
+- The actual Job start time is now correctly recorded in the catalog.
+- You can now specify a JobId (or multiple ones separated by commas) on
+  the restore command line.
+- A -d50 will now turn on lots of debug code if you are having
+  authentication errors.
+- Found a workaround to a /lib/tls pthreads bug (a library seg fault).
+- Added an ALERT message class for Alert messages.
+- Fixed a seg fault in the restore tree routine when attempting
+  to select certain files in the root directory.
+- Allow other jobs to request new Volumes while operator intervention
+  is needed -- previously all stalled.
+- Enhancements to btape test (don't loop if certain tape errors occur).
+- Improvements to the Win32 install.
index f195ac729676173ee2a686fa2c6984c82f122935..66087f295aa2d879bc73a5516911243e15cebf3d 100644 (file)
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
-/* Define to 1 if your system has a working POSIX `fnmatch' function. */
-#undef HAVE_FNMATCH
-
 /* Define to 1 if you have the `fork' function. */
 #undef HAVE_FORK
 
+/* Define to 1 if you have the `fseeko' function. */
+#undef HAVE_FSEEKO
+
 /* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
    automatically deduced at run-time.
-        STACK_DIRECTION > 0 => grows toward higher addresses
-        STACK_DIRECTION < 0 => grows toward lower addresses
-        STACK_DIRECTION = 0 => direction of growth unknown */
+       STACK_DIRECTION > 0 => grows toward higher addresses
+       STACK_DIRECTION < 0 => grows toward lower addresses
+       STACK_DIRECTION = 0 => direction of growth unknown */
 #undef STACK_DIRECTION
 
 /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
index 9dc22a53eb11e2baedcca9e0dcc948f66f6000c8..e849c2622290e714a3645c70bbb23a29a261f6dc 100644 (file)
@@ -54,7 +54,6 @@ AC_PATH_PROG(MV, mv, mv)
 AC_PATH_PROG(RM, rm, rm)
 AC_PATH_PROG(CP, cp, cp)
 AC_PATH_PROG(SED, sed, sed)
-AC_PATH_PROG(AWK, awk, awk)
 AC_PATH_PROG(ECHO, echo, echo)
 AC_PATH_PROG(CMP, cmp, cmp)
 AC_PATH_PROG(TBL, tbl, tbl)
@@ -64,7 +63,23 @@ AC_PATH_PROG(OPENSSL, openssl, none)
 AC_PATH_PROG(MTX, mtx, mtx)
 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
 AC_PATH_PROG(WXCONFIG, wx-config, wx-config)
-AC_PATH_PROG(CDRECORD, cdrecord) 
+AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
+AC_PATH_PROG(PIDOF, pidof, pidof)
+AC_PROG_AWK
+# Some AWK programs fail, so test it and warn the user
+if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } 
+      { if ((prog == $2) || (("(" prog ")") == $2) ||
+          (("[" prog "]") == $2) ||
+          ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
+else
+  AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
+   The regex engine of $AWK is too broken to be used you 
+   might want to install GNU AWK.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
+fi
+THE_AWK=$AWK
+AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
+
 
 test -n "$ARFLAG" || ARFLAGS="cr"
 AC_SUBST(ARFLAGS)
@@ -154,6 +169,7 @@ support_static_fd=no
 support_static_sd=no
 support_static_dir=no
 support_static_cons=no
+support_python=no
 build_client_only=no
 cats=
 db_name=Internal
@@ -1005,7 +1021,7 @@ AC_ARG_WITH(bimagemgr-bingroup,
 
 bimagemgr_dataowner=apache
 AC_ARG_WITH(bimagemgr-dataowner,
-   [  --with-bimagemgr-dataowner=USER   specify bimagemgr data file owner],
+   [  --with-bimagemgr-dataowner=USER  specify bimagemgr data file owner],
    [
        if test "x$withval" != "xno" ; then     
           bimagemgr_dataowner=$withval
@@ -1015,7 +1031,7 @@ AC_ARG_WITH(bimagemgr-dataowner,
 
 bimagemgr_datagroup=apache
 AC_ARG_WITH(bimagemgr-datagroup,
-   [  --with-bimagemgr-datagroup=USER   specify bimagemgr data file group],
+   [  --with-bimagemgr-datagroup=USER  specify bimagemgr data file group],
    [
        if test "x$withval" != "xno" ; then     
           bimagemgr_datagroup=$withval
@@ -1488,7 +1504,7 @@ AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
 
 AC_CHECK_FUNCS(chflags) 
 
-AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
+AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname fseeko)
 
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
@@ -1539,7 +1555,7 @@ AC_FUNC_ALLOCA
 AC_FUNC_GETMNTENT
 AC_FUNC_CLOSEDIR_VOID
 AC_FUNC_SETPGRP                      dnl check for BSD setpgrp.
-AC_FUNC_FNMATCH
+# AC_FUNC_FNMATCH    dnl use local version
 
 
 dnl# FreeBSD needs to link libxpg4
@@ -1895,6 +1911,8 @@ AC_OUTPUT([autoconf/Make.common \
           scripts/gnome-console.console_apps \
           scripts/mtx-changer \
           scripts/bacula-tray-monitor.desktop \
+          scripts/logwatch/Makefile \
+          scripts/logwatch/logfile.bacula.conf \
           doc/Makefile \
           src/Makefile \
           src/host.h \
@@ -1958,9 +1976,9 @@ AC_OUTPUT([autoconf/Make.common \
           src/win32/Makefile \
           src/win32/console/bconsole.conf \
           src/win32/wx-console/wx-console.conf \
-        src/win32/pebuilder/Makefile \
-        src/bimagemgr/Makefile \
-        src/bimagemgr/bacula-bimagemgr.spec \
+       src/win32/pebuilder/Makefile \
+       src/bimagemgr/Makefile \
+       src/bimagemgr/bacula-bimagemgr.spec \
           $PFILES ],  
          [(echo "Doing make of dependencies"; ${MAKE:-make} depend;) ]
 )
@@ -2094,4 +2112,4 @@ cat config.out
 
 # old stuff
 # cweb support:              ${got_cweb} ${CWEB_SRC}
-  # gmp support:                     ${got_gmp} ${GMP_SRC}
+# gmp support:               ${got_gmp} ${GMP_SRC}
index 51992be77667434ad96b20472394225004e822d3..46923cf66857a78b5dc7797cbcd1a1a1a511ad08 100755 (executable)
@@ -1,9 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
 #
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -41,7 +41,7 @@ for as_var in \
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -308,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG VERSION DATE LSMDATE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB MV RM CP SED AWK ECHO CMP TBL AR OPENSSL MTX PKGCONFIG WXCONFIG CDRECORD ARFLAGS MAKE_SHELL LOCAL_LIBS LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE INSIDE_GNOME_COMMON_TRUE INSIDE_GNOME_COMMON_FALSE MSGFMT GNOME_INCLUDEDIR GNOMEUI_LIBS GNOME_LIBDIR GNOME_LIBS GNOMEGNORBA_LIBS GTKXMHTML_LIBS ZVT_LIBS GNOME_CONFIG ORBIT_CONFIG ORBIT_IDL HAVE_ORBIT_TRUE HAVE_ORBIT_FALSE ORBIT_CFLAGS ORBIT_LIBS HAVE_GNORBA_TRUE HAVE_GNORBA_FALSE GNORBA_CFLAGS GNORBA_LIBS GNOME_APPLETS_LIBS GNOME_DOCKLETS_LIBS GNOME_CAPPLET_LIBS GNOME_DIR WXCONS_CPPFLAGS WXCONS_LDFLAGS WX_DIR TRAY_MONITOR_CPPFLAGS TRAY_MONITOR_LDFLAGS TRAY_MONITOR_DIR TTOOL_LDFLAGS STATIC_FD STATIC_SD STATIC_DIR STATIC_CONS STATIC_GNOME_CONS STATIC_WX_CONS ALL_DIRS CONS_INC CONS_OBJ CONS_SRC CONS_LIBS CONS_LDFLAGS READLINE_SRC CDSTL working_dir scriptdir dump_email job_email smtp_host piddir subsysdir baseport dir_port fd_port sd_port dir_password fd_password sd_password mon_dir_password mon_fd_password mon_sd_password bimagemgr_cgidir bimagemgr_docdir bimagemgr_binowner bimagemgr_bingroup bimagemgr_dataowner bimagemgr_datagroup dir_user dir_group sd_user sd_group fd_user fd_group SBINPERM SQL_LFLAGS SQL_INCLUDE SQL_BINDIR cats DB_NAME GETCONF ac_ct_GETCONF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBOBJS ALLOCA FDLIBS DEBUG DINCLUDE DLIB DB_LIBS WCFLAGS WLDFLAGS OBJLIST hostname TAPEDRIVE PSCMD WIN32 MACOSX DISTNAME DISTVER LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG VERSION DATE LSMDATE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB MV RM CP SED ECHO CMP TBL AR OPENSSL MTX PKGCONFIG WXCONFIG CDRECORD PIDOF AWK ARFLAGS MAKE_SHELL LOCAL_LIBS LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE INSIDE_GNOME_COMMON_TRUE INSIDE_GNOME_COMMON_FALSE MSGFMT GNOME_INCLUDEDIR GNOMEUI_LIBS GNOME_LIBDIR GNOME_LIBS GNOMEGNORBA_LIBS GTKXMHTML_LIBS ZVT_LIBS GNOME_CONFIG ORBIT_CONFIG ORBIT_IDL HAVE_ORBIT_TRUE HAVE_ORBIT_FALSE ORBIT_CFLAGS ORBIT_LIBS HAVE_GNORBA_TRUE HAVE_GNORBA_FALSE GNORBA_CFLAGS GNORBA_LIBS GNOME_APPLETS_LIBS GNOME_DOCKLETS_LIBS GNOME_CAPPLET_LIBS GNOME_DIR WXCONS_CPPFLAGS WXCONS_LDFLAGS WX_DIR TRAY_MONITOR_CPPFLAGS TRAY_MONITOR_LDFLAGS TRAY_MONITOR_DIR TTOOL_LDFLAGS STATIC_FD STATIC_SD STATIC_DIR STATIC_CONS STATIC_GNOME_CONS STATIC_WX_CONS ALL_DIRS CONS_INC CONS_OBJ CONS_SRC CONS_LIBS CONS_LDFLAGS READLINE_SRC CDSTL working_dir scriptdir dump_email job_email smtp_host piddir subsysdir baseport dir_port fd_port sd_port dir_password fd_password sd_password mon_dir_password mon_fd_password mon_sd_password bimagemgr_cgidir bimagemgr_docdir bimagemgr_binowner bimagemgr_bingroup bimagemgr_dataowner bimagemgr_datagroup dir_user dir_group sd_user sd_group fd_user fd_group SBINPERM SQL_LFLAGS SQL_INCLUDE SQL_BINDIR cats DB_NAME GETCONF ac_ct_GETCONF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBOBJS ALLOCA FDLIBS DEBUG DINCLUDE DLIB DB_LIBS WCFLAGS WLDFLAGS OBJLIST hostname TAPEDRIVE PSCMD WIN32 MACOSX DISTNAME DISTVER LTLIBOBJS'
 ac_subst_files='MCOMMON'
 
 # Initialize some variables set by options.
@@ -667,7 +668,7 @@ done
 
 # Be sure to have absolute paths.
 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
+             localstatedir libdir includedir oldincludedir infodir mandir
 do
   eval ac_val=$`echo $ac_var`
   case $ac_val in
@@ -707,10 +708,10 @@ if test -z "$srcdir"; then
   # Try the directory containing this script, then its parent.
   ac_confdir=`(dirname "$0") 2>/dev/null ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(//\)[^/]' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$0" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -810,9 +811,9 @@ _ACEOF
   cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+                         [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+                         [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -897,8 +898,8 @@ Optional Packages:
   --with-bimagemgr-docdir=DIR   specify bimagemgr doc root dir
   --with-bimagemgr-binowner=USER   specify bimagemgr binary file owner
   --with-bimagemgr-bingroup=USER   specify bimagemgr binary file group
-  --with-bimagemgr-dataowner=USER   specify bimagemgr data file owner
-  --with-bimagemgr-datagroup=USER   specify bimagemgr data file group
+  --with-bimagemgr-dataowner=USER      specify bimagemgr data file owner
+  --with-bimagemgr-datagroup=USER      specify bimagemgr data file group
   --with-dir-user=USER          specify user for Director daemon
   --with-dir-group=GROUP                specify group for Director daemon
   --with-sd-user=USER           specify user for Storage daemon
@@ -969,12 +970,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
     cd $ac_dir
     # Check for guested configure; otherwise get Cygnus style configure.
@@ -985,7 +1019,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
       echo
       $SHELL $ac_srcdir/configure  --help=recursive
     elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
+          test -f $ac_srcdir/configure.in; then
       echo
       $ac_configure --help
     else
@@ -999,8 +1033,7 @@ test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1012,7 +1045,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
 
@@ -1089,19 +1122,19 @@ do
     2)
       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
       if test $ac_must_keep_next = true; then
-        ac_must_keep_next=false # Got value, back to normal.
+       ac_must_keep_next=false # Got value, back to normal.
       else
-        case $ac_arg in
-          *=* | --config-cache | -C | -disable-* | --disable-* \
-          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-          | -with-* | --with-* | -without-* | --without-* | --x)
-            case "$ac_configure_args0 " in
-              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-            esac
-            ;;
-          -* ) ac_must_keep_next=true ;;
-        esac
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
       fi
       ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
       # Get rid of the leading space.
@@ -1135,12 +1168,12 @@ _ASBOX
     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
     *ac_space=\ *)
       sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+       "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
       ;;
     *)
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 }
@@ -1169,7 +1202,7 @@ _ASBOX
       for ac_var in $ac_subst_files
       do
        eval ac_val=$`echo $ac_var`
-        echo "$ac_var='"'"'$ac_val'"'"'"
+       echo "$ac_var='"'"'$ac_val'"'"'"
       done | sort
       echo
     fi
@@ -1188,7 +1221,7 @@ _ASBOX
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core core.* *.core &&
+  rm -f core *.core &&
   rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
      ' 0
@@ -1268,7 +1301,7 @@ fi
 # value.
 ac_cache_corrupted=false
 for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
@@ -1285,13 +1318,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+       { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+       { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+       { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
+       ac_cache_corrupted=:
       fi;;
   esac
   # Pass precious variables to config.status.
@@ -1811,7 +1844,6 @@ ac_compiler=`set X $ac_compile; echo $2`
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -1831,8 +1863,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
@@ -1852,23 +1884,23 @@ do
   test -f "$ac_file" || continue
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-        ;;
+       ;;
     conftest.$ac_ext )
-        # This is the source file.
-        ;;
+       # This is the source file.
+       ;;
     [ab].out )
-        # We found the default executable, but exeext='' is most
-        # certainly right.
-        break;;
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
     *.* )
-        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-        # FIXME: I believe we export ac_cv_exeext for Libtool,
-        # but it would be cool to find out if it's true.  Does anybody
-        # maintain Libtool? --akim.
-        export ac_cv_exeext
-        break;;
+       ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       # FIXME: I believe we export ac_cv_exeext for Libtool,
+       # but it would be cool to find out if it's true.  Does anybody
+       # maintain Libtool? --akim.
+       export ac_cv_exeext
+       break;;
     * )
-        break;;
+       break;;
   esac
 done
 else
@@ -1942,8 +1974,8 @@ for ac_file in conftest.exe conftest conftest.*; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
+         export ac_cv_exeext
+         break;;
     * ) break;;
   esac
 done
@@ -1968,7 +2000,6 @@ if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2019,7 +2050,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2039,11 +2069,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2056,7 +2096,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -2072,7 +2112,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2089,11 +2128,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2106,7 +2155,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_prog_cc_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
@@ -2133,7 +2182,6 @@ else
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2161,6 +2209,16 @@ static char *f (char * (*g) (char **, int), char **p, ...)
   va_end (v);
   return s;
 }
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2187,11 +2245,21 @@ do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2204,7 +2272,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
 done
 rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
@@ -2232,19 +2300,28 @@ cat >conftest.$ac_ext <<_ACEOF
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -2252,14 +2329,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
 $ac_declaration
+#include <stdlib.h>
 int
 main ()
 {
@@ -2270,11 +2346,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2287,9 +2373,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 continue
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2306,11 +2391,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2322,7 +2417,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -2336,7 +2431,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2462,7 +2557,6 @@ if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2482,11 +2576,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2499,7 +2603,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -2515,7 +2619,6 @@ if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2532,11 +2635,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2549,7 +2662,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_prog_cxx_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
@@ -2569,8 +2682,7 @@ else
   fi
 fi
 for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -2578,14 +2690,13 @@ for ac_declaration in \
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
 $ac_declaration
+#include <stdlib.h>
 int
 main ()
 {
@@ -2596,11 +2707,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2613,9 +2734,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 continue
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2632,11 +2752,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2648,7 +2778,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -2676,7 +2806,6 @@ if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2727,11 +2856,11 @@ then
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); };
       then
-        # cc works too.
-        :
+       # cc works too.
+       :
       else
-        # cc exists but doesn't like -o.
-        eval ac_cv_prog_cc_${ac_cc}_c_o=no
+       # cc exists but doesn't like -o.
+       eval ac_cv_prog_cc_${ac_cc}_c_o=no
       fi
     fi
   fi
@@ -2782,7 +2911,6 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2793,7 +2921,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+                    Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2805,6 +2933,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2825,7 +2954,6 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2843,6 +2971,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2889,7 +3018,6 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2900,7 +3028,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+                    Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2912,6 +3040,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2932,7 +3061,6 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2950,6 +3078,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -3012,7 +3141,6 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then
 else
     ac_pattern="Autoconf.*'x'"
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3032,7 +3160,6 @@ rm -f conftest*
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3075,6 +3202,7 @@ fi
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
@@ -3091,6 +3219,7 @@ do
 case $as_dir/ in
   ./ | .// | /cC/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -3098,20 +3227,20 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-          if test $ac_prog = install &&
-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # AIX install.  It has an incompatible calling convention.
-            :
-          elif test $ac_prog = install &&
-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # program-specific install script used by HP pwplus--don't use.
-            :
-          else
-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-            break 3
-          fi
-        fi
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
       done
     done
     ;;
@@ -3381,46 +3510,6 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-# Extract the first word of "awk", so it can be a program name with args.
-set dummy awk; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $AWK in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="awk"
-  ;;
-esac
-fi
-AWK=$ac_cv_path_AWK
-
-if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
 # Extract the first word of "echo", so it can be a program name with args.
 set dummy echo; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3767,6 +3856,7 @@ do
 done
 done
 
+  test -z "$ac_cv_path_CDRECORD" && ac_cv_path_CDRECORD="cdrecord"
   ;;
 esac
 fi
@@ -3780,6 +3870,144 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
+# Extract the first word of "pidof", so it can be a program name with args.
+set dummy pidof; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PIDOF+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PIDOF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PIDOF="$PIDOF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PIDOF="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_PIDOF" && ac_cv_path_PIDOF="pidof"
+  ;;
+esac
+fi
+PIDOF=$ac_cv_path_PIDOF
+
+if test -n "$PIDOF"; then
+  echo "$as_me:$LINENO: result: $PIDOF" >&5
+echo "${ECHO_T}$PIDOF" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+# Some AWK programs fail, so test it and warn the user
+if echo xfoo | $AWK 'BEGIN { prog=ARGV1; ARGC=1 }
+      { if ((prog == $2) || (("(" prog ")") == $2) ||
+          (("" prog "") == $2) ||
+          ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
+else
+  { { echo "$as_me:$LINENO: error: !!!!!!!!! WARNING !!!!!!!!!!!!!!
+   The regex engine of $AWK is too broken to be used you
+   might want to install GNU AWK.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >&5
+echo "$as_me: error: !!!!!!!!! WARNING !!!!!!!!!!!!!!
+   The regex engine of $AWK is too broken to be used you
+   might want to install GNU AWK.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+THE_AWK=$AWK
+# Extract the first word of "$THE_AWK", so it can be a program name with args.
+set dummy $THE_AWK; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AWK in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="$THE_AWK"
+  ;;
+esac
+fi
+AWK=$ac_cv_path_AWK
+
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
 
 test -n "$ARFLAG" || ARFLAGS="cr"
 
@@ -3851,7 +4079,7 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 case $host_os in
   *cygwin* ) CYGWIN=yes;;
-         * ) CYGWIN=no;;
+        * ) CYGWIN=no;;
 esac
 
 if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
@@ -4379,6 +4607,7 @@ support_static_fd=no
 support_static_sd=no
 support_static_dir=no
 support_static_cons=no
+support_python=no
 build_client_only=no
 cats=
 db_name=Internal
@@ -4970,7 +5199,6 @@ if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4991,11 +5219,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5008,12 +5246,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_stdc=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5035,7 +5272,6 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5060,7 +5296,6 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5072,9 +5307,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
 # define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
@@ -5085,7 +5320,7 @@ main ()
   int i;
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
+       || toupper (i) != TOUPPER (i))
       exit(2);
   exit (0);
 }
@@ -5110,7 +5345,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
@@ -5135,7 +5370,7 @@ fi
 
 
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
+                 inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -5144,7 +5379,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5156,11 +5390,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5173,7 +5417,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -5200,7 +5444,6 @@ else
 echo "$as_me:$LINENO: checking termcap.h usability" >&5
 echo $ECHO_N "checking termcap.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5211,11 +5454,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5228,7 +5481,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -5236,7 +5489,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking termcap.h presence" >&5
 echo $ECHO_N "checking termcap.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5254,6 +5506,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -5273,33 +5526,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: termcap.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: termcap.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: termcap.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: termcap.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: termcap.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: termcap.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: termcap.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: termcap.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: termcap.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: termcap.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: termcap.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: termcap.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: termcap.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -5325,7 +5577,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ltermcap  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5349,11 +5600,21 @@ tgetent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5366,7 +5627,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_termcap_tgetent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
@@ -5392,7 +5654,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lncurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5416,11 +5677,21 @@ tgetent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5433,7 +5704,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_ncurses_tgetent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
@@ -5475,7 +5747,6 @@ else
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5486,11 +5757,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5503,7 +5784,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -5511,7 +5792,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5529,6 +5809,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -5548,33 +5829,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -5585,7 +5865,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -5606,7 +5886,6 @@ if test "${ac_cv_header_term_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5621,11 +5900,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5638,7 +5927,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_term_h=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_term_h" >&5
 echo "${ECHO_T}$ac_cv_header_term_h" >&6
@@ -5651,7 +5940,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5675,11 +5963,21 @@ tgetent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5692,7 +5990,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_curses_tgetent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5
@@ -5767,7 +6066,6 @@ else
 echo "$as_me:$LINENO: checking ${with_readline}/readline.h usability" >&5
 echo $ECHO_N "checking ${with_readline}/readline.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5778,11 +6076,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5795,7 +6103,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -5803,7 +6111,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking ${with_readline}/readline.h presence" >&5
 echo $ECHO_N "checking ${with_readline}/readline.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5821,6 +6128,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -5840,33 +6148,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: ${with_readline}/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: ${with_readline}/readline.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -5877,7 +6184,7 @@ echo $ECHO_N "checking for ${with_readline}/readline.h... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -5919,7 +6226,6 @@ else
 echo "$as_me:$LINENO: checking /usr/include/readline/readline.h usability" >&5
 echo $ECHO_N "checking /usr/include/readline/readline.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5930,11 +6236,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5947,7 +6263,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -5955,7 +6271,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking /usr/include/readline/readline.h presence" >&5
 echo $ECHO_N "checking /usr/include/readline/readline.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5973,6 +6288,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -5992,33 +6308,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: /usr/include/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: /usr/include/readline/readline.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -6061,7 +6376,6 @@ else
 echo "$as_me:$LINENO: checking ${TOP_DIR}/depkgs/readline/readline.h usability" >&5
 echo $ECHO_N "checking ${TOP_DIR}/depkgs/readline/readline.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6072,11 +6386,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6089,7 +6413,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -6097,7 +6421,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking ${TOP_DIR}/depkgs/readline/readline.h presence" >&5
 echo $ECHO_N "checking ${TOP_DIR}/depkgs/readline/readline.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6115,6 +6438,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -6134,33 +6458,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -6171,7 +6494,7 @@ echo $ECHO_N "checking for ${TOP_DIR}/depkgs/readline/readline.h... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -6225,7 +6548,6 @@ if test "${ac_cv_header_stat_broken+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6292,7 +6614,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6312,11 +6633,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6329,7 +6660,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -6352,7 +6683,6 @@ else
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6376,11 +6706,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6392,12 +6732,12 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in dir; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6421,11 +6761,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6438,7 +6788,8 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -6459,7 +6810,6 @@ else
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6483,11 +6833,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6499,12 +6859,12 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in x; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6528,11 +6888,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6545,7 +6915,8 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -6576,21 +6947,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -6621,11 +6999,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6638,7 +7026,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -6661,21 +7050,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -6706,11 +7102,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6723,7 +7129,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -6752,7 +7159,6 @@ else
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6763,11 +7169,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6780,7 +7196,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -6788,7 +7204,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6806,6 +7221,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -6825,33 +7241,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -6862,7 +7277,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -7029,21 +7444,28 @@ if test "${ac_cv_func_socket+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define socket to an innocuous variant, in case <limits.h> declares socket.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define socket innocuous_socket
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef socket
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7074,11 +7496,21 @@ return f != socket;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7091,7 +7523,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_socket=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
 echo "${ECHO_T}$ac_cv_func_socket" >&6
@@ -7108,7 +7541,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lxnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7132,11 +7564,21 @@ socket ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7149,7 +7591,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_xnet_socket=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_socket" >&5
@@ -7172,7 +7615,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7196,11 +7638,21 @@ socket ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7213,7 +7665,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_socket_socket=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
@@ -7236,7 +7689,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-linet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7260,11 +7712,21 @@ socket ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7277,7 +7739,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_inet_socket=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_inet_socket" >&5
@@ -7310,7 +7773,6 @@ if test "${with_tcp_wrappers+set}" = set; then
        echo "$as_me:$LINENO: checking for libwrap" >&5
 echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7330,11 +7792,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7356,7 +7828,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
            LIBS="$saved_LIBS -lwrap -lnsl"
            cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7376,11 +7847,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7404,10 +7885,12 @@ echo "$as_me: error: *** libwrap missing" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
     fi
 
 
@@ -7986,21 +8469,28 @@ if test "${ac_cv_func_crypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define crypt to an innocuous variant, in case <limits.h> declares crypt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define crypt innocuous_crypt
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef crypt
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -8031,24 +8521,35 @@ return f != crypt;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_crypt=yes
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_crypt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_crypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_crypt" >&5
 echo "${ECHO_T}$ac_cv_func_crypt" >&6
@@ -8063,7 +8564,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcrypt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8087,11 +8587,21 @@ crypt ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8104,7 +8614,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_crypt_crypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
@@ -8516,7 +9027,6 @@ else
              ac_save_CC="$CC"
              CC="$CC $ac_cv_sys_largefile_CFLAGS"
              cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8533,11 +9043,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8550,7 +9070,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_sys_largefile_CFLAGS=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
              CC="$ac_save_CC"
            esac
       }
@@ -8743,8 +9264,8 @@ _ACEOF
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
     for ac_extension in a so sl; do
       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-         test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+       ac_im_usrlibdir=$ac_im_libdir; break
       fi
     done
     # Screen out bogus values from the imake configuration.  They are
@@ -8804,7 +9325,6 @@ if test "$ac_x_includes" = no; then
   # Guess where to find include files, by looking for Intrinsic.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8822,6 +9342,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8852,7 +9373,6 @@ if test "$ac_x_libraries" = no; then
   ac_save_LIBS=$LIBS
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8869,11 +9389,21 @@ XtMalloc (0)
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8898,7 +9428,8 @@ do
   done
 done
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
 
 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
@@ -8907,7 +9438,7 @@ if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
 else
   # Record where we found X for the cache.
   ac_cv_have_x="have_x=yes \
-               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
 fi
 fi
 
@@ -8954,7 +9485,6 @@ else
 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8971,11 +9501,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8988,7 +9528,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_R_nospace=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
       if test $ac_R_nospace = yes; then
        echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
@@ -8996,7 +9537,6 @@ echo "${ECHO_T}no" >&6
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9013,11 +9553,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9030,7 +9580,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_R_space=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
        if test $ac_R_space = yes; then
          echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
@@ -9056,7 +9607,6 @@ echo "${ECHO_T}neither works" >&6
     # the Alpha needs dnet_stub (dnet does not exist).
     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9080,11 +9630,21 @@ XOpenDisplay ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9103,7 +9663,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9127,11 +9686,21 @@ dnet_ntoa ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9144,7 +9713,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_dnet_dnet_ntoa=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
@@ -9162,7 +9732,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet_stub  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9186,11 +9755,21 @@ dnet_ntoa ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9203,7 +9782,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_dnet_stub_dnet_ntoa=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
@@ -9214,7 +9794,8 @@ fi
 
     fi
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
     LIBS="$ac_xsave_LIBS"
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
@@ -9231,21 +9812,28 @@ if test "${ac_cv_func_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef gethostbyname
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9276,11 +9864,21 @@ return f != gethostbyname;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9293,7 +9891,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_gethostbyname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
@@ -9307,7 +9906,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9331,11 +9929,21 @@ gethostbyname ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9348,7 +9956,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_nsl_gethostbyname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
@@ -9358,7 +9967,7 @@ if test $ac_cv_lib_nsl_gethostbyname = yes; then
 fi
 
       if test $ac_cv_lib_nsl_gethostbyname = no; then
-        echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+       echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9366,7 +9975,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9390,11 +9998,21 @@ gethostbyname ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9407,7 +10025,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_bsd_gethostbyname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
@@ -9432,21 +10051,28 @@ if test "${ac_cv_func_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef connect
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9477,11 +10103,21 @@ return f != connect;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9494,7 +10130,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_connect=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
 echo "${ECHO_T}$ac_cv_func_connect" >&6
@@ -9508,7 +10145,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9532,11 +10168,21 @@ connect ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9549,7 +10195,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_socket_connect=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
@@ -9567,21 +10214,28 @@ if test "${ac_cv_func_remove+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef remove
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9612,11 +10266,21 @@ return f != remove;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9629,7 +10293,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_remove=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
 echo "${ECHO_T}$ac_cv_func_remove" >&6
@@ -9643,7 +10308,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9667,11 +10331,21 @@ remove ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9684,7 +10358,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_posix_remove=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
@@ -9702,21 +10377,28 @@ if test "${ac_cv_func_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef shmat
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9747,11 +10429,21 @@ return f != shmat;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9764,7 +10456,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_shmat=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
 echo "${ECHO_T}$ac_cv_func_shmat" >&6
@@ -9778,7 +10471,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lipc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9802,11 +10494,21 @@ shmat ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9819,7 +10521,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_ipc_shmat=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
@@ -9848,7 +10551,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9872,11 +10574,21 @@ IceConnectionNumber ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9889,7 +10601,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_ICE_IceConnectionNumber=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
@@ -9974,7 +10687,6 @@ else
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9985,11 +10697,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10002,7 +10724,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -10010,7 +10732,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10028,6 +10749,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -10047,33 +10769,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -10084,7 +10805,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -10105,7 +10826,6 @@ if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10126,11 +10846,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10143,12 +10873,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_stdc=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10170,7 +10899,6 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10195,7 +10923,6 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10207,9 +10934,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
 # define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
@@ -10220,7 +10947,7 @@ main ()
   int i;
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
+       || toupper (i) != TOUPPER (i))
       exit(2);
   exit (0);
 }
@@ -10245,7 +10972,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
@@ -10265,7 +10992,6 @@ if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10282,11 +11008,21 @@ return makedev(0, 0);
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10299,7 +11035,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_sys_types_h_makedev=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
@@ -10319,7 +11056,6 @@ else
 echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
 echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10330,11 +11066,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10347,7 +11093,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -10355,7 +11101,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
 echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10373,6 +11118,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -10392,33 +11138,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -10459,7 +11204,6 @@ else
 echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
 echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10470,11 +11214,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10487,7 +11241,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -10495,7 +11249,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
 echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10513,6 +11266,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -10532,33 +11286,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -10601,7 +11354,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10621,11 +11373,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10638,7 +11400,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -10661,7 +11423,6 @@ else
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10685,11 +11446,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10701,12 +11472,12 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in dir; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10730,11 +11501,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10747,7 +11528,8 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -10768,7 +11550,6 @@ else
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10792,28 +11573,38 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_search_opendir="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in x; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10837,11 +11628,21 @@ opendir ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10854,7 +11655,8 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -10874,7 +11676,6 @@ if test "${ac_cv_header_stat_broken+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10933,7 +11734,6 @@ if test "${ac_cv_header_sys_wait_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10960,11 +11760,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10977,7 +11787,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_sys_wait_h=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
@@ -10995,7 +11805,6 @@ if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11016,11 +11825,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11033,7 +11852,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_time=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
@@ -11052,7 +11871,6 @@ if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11071,11 +11889,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11087,7 +11915,6 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11106,11 +11933,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11123,9 +11960,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_member_struct_stat_st_blksize=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
@@ -11149,7 +11986,6 @@ if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11168,11 +12004,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11184,7 +12030,6 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11203,11 +12048,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11220,9 +12075,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_member_struct_stat_st_blocks=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
@@ -11238,7 +12093,14 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 else
-  LIBOBJS="$LIBOBJS fileblocks.$ac_objext"
+  case $LIBOBJS in
+    "fileblocks.$ac_objext"   | \
+  *" fileblocks.$ac_objext"   | \
+    "fileblocks.$ac_objext "* | \
+  *" fileblocks.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;;
+esac
+
 fi
 
 
@@ -11248,7 +12110,6 @@ if test "${ac_cv_struct_tm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11267,11 +12128,21 @@ struct tm *tp; tp->tm_sec;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11284,7 +12155,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
 echo "${ECHO_T}$ac_cv_struct_tm" >&6
@@ -11302,7 +12173,6 @@ if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11324,11 +12194,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11340,7 +12220,6 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11362,11 +12241,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11379,9 +12268,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_member_struct_tm_tm_zone=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
@@ -11407,7 +12296,6 @@ if test "${ac_cv_var_tzname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11428,11 +12316,21 @@ atoi(*tzname);
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11445,7 +12343,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_var_tzname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
 echo "${ECHO_T}$ac_cv_var_tzname" >&6
@@ -11465,7 +12364,6 @@ if test "${ba_cv_header_utime_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11484,11 +12382,21 @@ struct utimbuf foo
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11501,7 +12409,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ba_cv_header_utime_h=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ba_cv_header_utime_h" >&5
 echo "${ECHO_T}$ba_cv_header_utime_h" >&6
@@ -11516,7 +12424,6 @@ if test "${ba_cv_header_socklen_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11535,11 +12442,21 @@ socklen_t x
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11552,7 +12469,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ba_cv_header_socklen_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ba_cv_header_socklen_t" >&5
 echo "${ECHO_T}$ba_cv_header_socklen_t" >&6
@@ -11570,7 +12487,6 @@ else
   ba_cv_bigendian=no
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11598,7 +12514,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ba_cv_bigendian=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 echo "$as_me:$LINENO: result: $ba_cv_bigendian" >&5
@@ -11615,7 +12531,6 @@ if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11678,11 +12593,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11695,7 +12620,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_c_const=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
@@ -11714,7 +12639,6 @@ echo $ECHO_N "checking how to get filesystem type... $ECHO_C" >&6
 fstype=no
 # The order of these tests is important.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11733,6 +12657,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11753,7 +12678,6 @@ fi
 rm -f conftest.err conftest.$ac_ext
 if test $fstype = no; then
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11772,6 +12696,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11793,7 +12718,6 @@ rm -f conftest.err conftest.$ac_ext
 fi
 if test $fstype = no; then
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11812,6 +12736,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11833,7 +12758,6 @@ rm -f conftest.err conftest.$ac_ext
 fi
 if test $fstype = no; then
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11851,6 +12775,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11872,7 +12797,6 @@ rm -f conftest.err conftest.$ac_ext
 fi
 if test $fstype = no; then
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11893,7 +12817,6 @@ rm -f conftest*
 fi
 if test $fstype = no; then
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11912,6 +12835,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11940,7 +12864,6 @@ if test "${ac_cv_type_signal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11967,11 +12890,21 @@ int i;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11984,7 +12917,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_signal=int
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
 echo "${ECHO_T}$ac_cv_type_signal" >&6
@@ -12002,7 +12935,6 @@ if test "${bash_cv_signal_vintage+set}" = set; then
 else
 
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12025,11 +12957,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12042,7 +12984,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12062,11 +13003,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12079,7 +13030,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12102,11 +13052,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12120,13 +13080,16 @@ sed 's/^/| /' conftest.$ac_ext >&5
 bash_cv_signal_vintage=v7
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
 
@@ -12155,7 +13118,6 @@ if test "${ac_cv_type_mode_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12175,11 +13137,21 @@ if (sizeof (mode_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12192,7 +13164,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_mode_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
 echo "${ECHO_T}$ac_cv_type_mode_t" >&6
@@ -12212,7 +13184,6 @@ if test "${ac_cv_type_uid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12251,7 +13222,6 @@ if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12271,11 +13241,21 @@ if (sizeof (size_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12288,7 +13268,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_size_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
 echo "${ECHO_T}$ac_cv_type_size_t" >&6
@@ -12308,7 +13288,6 @@ if test "${ac_cv_type_pid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12328,11 +13307,21 @@ if (sizeof (pid_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12345,7 +13334,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_pid_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
@@ -12365,7 +13354,6 @@ if test "${ac_cv_type_off_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12385,11 +13373,21 @@ if (sizeof (off_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12402,7 +13400,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_off_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
 echo "${ECHO_T}$ac_cv_type_off_t" >&6
@@ -12422,7 +13420,6 @@ if test "${ac_cv_type_ino_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12442,11 +13439,21 @@ if (sizeof (ino_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12459,7 +13466,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_ino_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_ino_t" >&5
 echo "${ECHO_T}$ac_cv_type_ino_t" >&6
@@ -12479,7 +13486,6 @@ if test "${ac_cv_type_dev_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12499,11 +13505,21 @@ if (sizeof (dev_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12516,7 +13532,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_dev_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_dev_t" >&5
 echo "${ECHO_T}$ac_cv_type_dev_t" >&6
@@ -12536,7 +13552,6 @@ if test "${ac_cv_type_daddr_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12556,11 +13571,21 @@ if (sizeof (daddr_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12573,7 +13598,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_daddr_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_daddr_t" >&5
 echo "${ECHO_T}$ac_cv_type_daddr_t" >&6
@@ -12593,7 +13618,6 @@ if test "${ac_cv_type_major_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12613,11 +13637,21 @@ if (sizeof (major_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12630,7 +13664,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_major_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_major_t" >&5
 echo "${ECHO_T}$ac_cv_type_major_t" >&6
@@ -12650,7 +13684,6 @@ if test "${ac_cv_type_minor_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12670,11 +13703,21 @@ if (sizeof (minor_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12687,7 +13730,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_minor_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_minor_t" >&5
 echo "${ECHO_T}$ac_cv_type_minor_t" >&6
@@ -12707,7 +13750,6 @@ if test "${ac_cv_type_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12727,11 +13769,21 @@ if (sizeof (ssize_t))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12744,7 +13796,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_ssize_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
@@ -12764,7 +13816,6 @@ if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12783,11 +13834,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12799,7 +13860,6 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12818,11 +13878,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12835,9 +13905,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_member_struct_stat_st_blocks=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
@@ -12853,7 +13923,14 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 else
-  LIBOBJS="$LIBOBJS fileblocks.$ac_objext"
+  case $LIBOBJS in
+    "fileblocks.$ac_objext"   | \
+  *" fileblocks.$ac_objext"   | \
+    "fileblocks.$ac_objext "* | \
+  *" fileblocks.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;;
+esac
+
 fi
 
 
@@ -12864,7 +13941,6 @@ if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12883,23 +13959,32 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_member_struct_stat_st_rdev=yes
-else
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_member_struct_stat_st_rdev=yes
+else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12918,11 +14003,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12935,9 +14030,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_member_struct_stat_st_rdev=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6
@@ -12961,7 +14056,6 @@ if test "${ac_cv_struct_tm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12980,11 +14074,21 @@ struct tm *tp; tp->tm_sec;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12997,7 +14101,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
 echo "${ECHO_T}$ac_cv_struct_tm" >&6
@@ -13015,7 +14119,6 @@ if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13078,11 +14181,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13095,7 +14208,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_c_const=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
@@ -13115,7 +14228,6 @@ if test "${ac_cv_type_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13135,11 +14247,21 @@ if (sizeof (char))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13152,7 +14274,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_char=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
 echo "${ECHO_T}$ac_cv_type_char" >&6
@@ -13170,7 +14292,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13189,11 +14310,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13202,7 +14333,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13221,11 +14351,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13237,20 +14377,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13269,11 +14408,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13282,7 +14431,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13301,11 +14449,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13317,13 +14475,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -13331,14 +14489,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13357,11 +14514,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13374,7 +14541,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_char=$ac_lo;;
@@ -13393,7 +14560,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13455,7 +14621,7 @@ echo "$as_me: error: cannot compute sizeof (char), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -13476,7 +14642,6 @@ if test "${ac_cv_type_short_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13496,11 +14661,21 @@ if (sizeof (short int))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13513,7 +14688,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_short_int=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_short_int" >&5
 echo "${ECHO_T}$ac_cv_type_short_int" >&6
@@ -13531,7 +14706,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13550,11 +14724,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13563,7 +14747,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13582,11 +14765,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13598,20 +14791,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13630,11 +14822,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13643,7 +14845,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13662,11 +14863,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13678,13 +14889,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -13692,14 +14903,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13718,11 +14928,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13735,7 +14955,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_short_int=$ac_lo;;
@@ -13754,7 +14974,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13816,7 +15035,7 @@ echo "$as_me: error: cannot compute sizeof (short int), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -13837,7 +15056,6 @@ if test "${ac_cv_type_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13857,11 +15075,21 @@ if (sizeof (int))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13874,7 +15102,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_int=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
 echo "${ECHO_T}$ac_cv_type_int" >&6
@@ -13892,7 +15120,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13911,11 +15138,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13924,7 +15161,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13943,11 +15179,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13959,20 +15205,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13991,11 +15236,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14004,7 +15259,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14023,11 +15277,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14039,13 +15303,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -14053,14 +15317,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14079,11 +15342,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14096,7 +15369,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_int=$ac_lo;;
@@ -14115,7 +15388,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14177,7 +15449,7 @@ echo "$as_me: error: cannot compute sizeof (int), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -14198,7 +15470,6 @@ if test "${ac_cv_type_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14218,11 +15489,21 @@ if (sizeof (long int))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14235,7 +15516,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_long_int=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_long_int" >&5
 echo "${ECHO_T}$ac_cv_type_long_int" >&6
@@ -14253,7 +15534,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14272,11 +15552,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14285,7 +15575,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14304,11 +15593,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14320,20 +15619,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14352,11 +15650,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14365,7 +15673,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14384,11 +15691,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14400,13 +15717,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -14414,14 +15731,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14440,11 +15756,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14457,7 +15783,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_long_int=$ac_lo;;
@@ -14476,7 +15802,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14538,7 +15863,7 @@ echo "$as_me: error: cannot compute sizeof (long int), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -14559,7 +15884,6 @@ if test "${ac_cv_type_long_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14579,11 +15903,21 @@ if (sizeof (long long int))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14596,7 +15930,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_long_long_int=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
 echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
@@ -14614,7 +15948,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14633,11 +15966,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14646,7 +15989,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14665,11 +16007,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14681,20 +16033,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14713,11 +16064,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14726,7 +16087,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14745,11 +16105,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14761,13 +16131,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -14775,14 +16145,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14801,11 +16170,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14818,7 +16197,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_long_long_int=$ac_lo;;
@@ -14837,7 +16216,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14899,7 +16277,7 @@ echo "$as_me: error: cannot compute sizeof (long long int), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -14920,7 +16298,6 @@ if test "${ac_cv_type_int_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14940,11 +16317,21 @@ if (sizeof (int *))
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14957,7 +16344,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_type_int_p=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5
 echo "${ECHO_T}$ac_cv_type_int_p" >&6
@@ -14975,7 +16362,6 @@ else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14994,11 +16380,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15007,7 +16403,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15026,11 +16421,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15042,20 +16447,19 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr $ac_mid + 1`
-                    if test $ac_lo -le $ac_mid; then
-                      ac_lo= ac_hi=
-                      break
-                    fi
-                    ac_mid=`expr 2 '*' $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15074,11 +16478,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15087,7 +16501,6 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15106,11 +16519,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15122,13 +16545,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_hi=`expr '(' $ac_mid ')' - 1`
-                       if test $ac_mid -le $ac_hi; then
-                         ac_lo= ac_hi=
-                         break
-                       fi
-                       ac_mid=`expr 2 '*' $ac_mid`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
@@ -15136,14 +16559,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo= ac_hi=
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15162,11 +16584,21 @@ test_array [0] = 0
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15179,7 +16611,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_sizeof_int_p=$ac_lo;;
@@ -15198,7 +16630,6 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15260,7 +16691,7 @@ echo "$as_me: error: cannot compute sizeof (int *), 77
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 rm -f conftest.val
@@ -15284,7 +16715,6 @@ if test "${ac_cv_have_u_int+set}" = set; then
 else
 
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15301,11 +16731,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15319,7 +16759,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_u_int="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_u_int" >&5
@@ -15339,7 +16779,6 @@ if test "${ac_cv_have_intmax_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15356,11 +16795,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15373,7 +16822,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 
         cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15390,11 +16838,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15408,11 +16866,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_intmax_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 fi
@@ -15434,7 +16892,6 @@ if test "${ac_cv_have_u_intmax_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15451,11 +16908,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15468,7 +16935,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 
         cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15485,11 +16951,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15503,11 +16979,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_u_intmax_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_u_intmax_t" >&5
@@ -15528,7 +17004,6 @@ if test "${ac_cv_have_intxx_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15545,11 +17020,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15563,7 +17048,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_intxx_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_intxx_t" >&5
@@ -15583,7 +17068,6 @@ if test "${ac_cv_have_int64_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15600,11 +17084,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15618,7 +17112,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_int64_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_int64_t" >&5
@@ -15638,7 +17132,6 @@ if test "${ac_cv_have_u_intxx_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15655,11 +17148,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15673,7 +17176,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_u_intxx_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_u_intxx_t" >&5
@@ -15693,7 +17196,6 @@ if test "${ac_cv_have_u_int64_t+set}" = set; then
 else
 
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15710,11 +17212,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15728,7 +17240,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_u_int64_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_u_int64_t" >&5
@@ -15747,7 +17259,6 @@ then
    echo "$as_me:$LINENO: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
 echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15766,11 +17277,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15798,7 +17319,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "${ECHO_T}no" >&6
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if test -z "$have_u_intxx_t" ; then
@@ -15809,7 +17330,6 @@ if test "${ac_cv_have_uintxx_t+set}" = set; then
 else
 
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15827,11 +17347,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15845,7 +17375,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  ac_cv_have_uintxx_t="no"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_have_uintxx_t" >&5
@@ -15864,7 +17394,6 @@ then
    echo "$as_me:$LINENO: checking for int64_t and u_int64_t types in sys/bitypes.h" >&5
 echo $ECHO_N "checking for int64_t and u_int64_t types in sys/bitypes.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15882,11 +17411,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15910,7 +17449,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "${ECHO_T}no" >&6
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if (test -z "$have_uintxx_t" && \
@@ -15919,7 +17458,6 @@ then
    echo "$as_me:$LINENO: checking for uintXX_t types in sys/bitypes.h" >&5
 echo $ECHO_N "checking for uintXX_t types in sys/bitypes.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15937,11 +17475,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -15961,7 +17509,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "${ECHO_T}no" >&6
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 
@@ -16004,21 +17552,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16049,11 +17604,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16066,7 +17631,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16092,21 +17658,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16137,11 +17710,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16154,7 +17737,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16179,21 +17763,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16224,11 +17815,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16241,7 +17842,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16267,21 +17869,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16312,11 +17921,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16329,7 +17948,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16346,7 +17966,8 @@ done
 
 
 
-for ac_func in snprintf vsnprintf gethostid getdomainname
+
+for ac_func in snprintf vsnprintf gethostid getdomainname fseeko
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -16355,21 +17976,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16400,11 +18028,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16417,7 +18055,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16443,21 +18082,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16488,11 +18134,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16505,7 +18161,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16525,21 +18182,28 @@ if test "${ac_cv_func_gethostbyname_r+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define gethostbyname_r to an innocuous variant, in case <limits.h> declares gethostbyname_r.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname_r innocuous_gethostbyname_r
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname_r (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef gethostbyname_r
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16570,11 +18234,21 @@ return f != gethostbyname_r;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16587,7 +18261,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_gethostbyname_r=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
 echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6
@@ -16604,7 +18279,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -16628,11 +18302,21 @@ gethostbyname_r ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16645,7 +18329,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_nsl_gethostbyname_r=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname_r" >&5
@@ -16668,7 +18353,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -16692,11 +18376,21 @@ gethostbyname_r ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16709,7 +18403,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_resolv_gethostbyname_r=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname_r" >&5
@@ -16738,21 +18433,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16783,11 +18485,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16800,7 +18512,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16825,21 +18538,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16870,11 +18590,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16887,7 +18617,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16912,21 +18643,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -16957,11 +18695,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -16974,7 +18722,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -16996,7 +18745,6 @@ if test "${ac_cv_struct_sockaddr_sa_len+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17013,11 +18761,21 @@ struct sockaddr s; s.sa_len;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17030,7 +18788,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_struct_sockaddr_sa_len=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_sa_len" >&5
 echo "${ECHO_T}$ac_cv_struct_sockaddr_sa_len" >&6
@@ -17050,7 +18808,6 @@ if test "${ac_cv_ipv6_support+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17070,11 +18827,21 @@ struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_ad
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17087,7 +18854,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_ipv6_support=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_ipv6_support" >&5
 echo "${ECHO_T}$ac_cv_ipv6_support" >&6
@@ -17112,21 +18880,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -17157,11 +18932,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17174,7 +18959,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -17193,7 +18979,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17217,11 +19002,21 @@ strftime ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17234,7 +19029,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_intl_strftime=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
@@ -17260,21 +19056,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -17305,11 +19108,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17322,7 +19135,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -17337,21 +19151,28 @@ if test "${ac_cv_func__doprnt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define _doprnt innocuous__doprnt
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef _doprnt
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -17382,11 +19203,21 @@ return f != _doprnt;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17399,7 +19230,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func__doprnt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
 echo "${ECHO_T}$ac_cv_func__doprnt" >&6
@@ -17423,7 +19255,6 @@ if test "${ac_cv_working_alloca_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17440,11 +19271,21 @@ char *p = (char *) alloca (2 * sizeof (int));
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17457,7 +19298,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_working_alloca_h=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
@@ -17475,7 +19317,6 @@ if test "${ac_cv_func_alloca_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17512,11 +19353,21 @@ char *p = (char *) alloca (1);
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17529,7 +19380,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_alloca_works=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
@@ -17559,7 +19411,6 @@ if test "${ac_cv_os_cray+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17592,21 +19443,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -17637,11 +19495,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17654,7 +19522,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -17679,7 +19548,6 @@ else
   ac_cv_c_stack_direction=0
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17725,7 +19593,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_c_stack_direction=-1
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
@@ -17747,7 +19615,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsun  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17771,11 +19638,21 @@ getmntent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17788,7 +19665,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_sun_getmntent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5
@@ -17804,7 +19682,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lseq  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17828,11 +19705,21 @@ getmntent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17845,7 +19732,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_seq_getmntent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5
@@ -17861,7 +19749,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgen  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17885,11 +19772,21 @@ getmntent ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17902,7 +19799,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_gen_getmntent=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5
@@ -17925,21 +19823,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -17970,11 +19875,21 @@ return f != $ac_func;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -17987,7 +19902,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -18009,7 +19925,6 @@ else
   ac_cv_func_closedir_void=yes
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18049,7 +19964,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_closedir_void=yes
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
@@ -18073,7 +19988,6 @@ echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18114,7 +20028,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_setpgrp_void=yes
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
@@ -18126,79 +20040,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-                     echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5
-echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6
-if test "${ac_cv_func_fnmatch_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Some versions of Solaris, SCO, and the GNU C Library
-   # have a broken or incompatible fnmatch.
-   # So we run a test program.  If we are cross-compiling, take no chance.
-   # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
-   if test "$cross_compiling" = yes; then
-  ac_cv_func_fnmatch_works=cross
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <fnmatch.h>
-#         define y(a, b, c) (fnmatch (a, b, c) == 0)
-#         define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
-
-int
-main ()
-{
-exit
-          (!(y ("a*", "abc", 0)
-             && n ("d*/*1", "d/s/1", FNM_PATHNAME)
-             && y ("a\\\\bc", "abc", 0)
-             && n ("a\\\\bc", "abc", FNM_NOESCAPE)
-             && y ("*x", ".x", 0)
-             && n ("*x", ".x", FNM_PERIOD)
-             && 1));
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_fnmatch_works=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_fnmatch_works=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5
-echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6
-if test $ac_cv_func_fnmatch_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FNMATCH 1
-_ACEOF
-
-fi
-
-
-
+                     # AC_FUNC_FNMATCH    dnl use local version
 
 
 echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5
@@ -18209,7 +20051,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lxpg4  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18233,11 +20074,21 @@ setlocale ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18250,7 +20101,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_xpg4_setlocale=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5
@@ -18270,7 +20122,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsun  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18294,11 +20145,21 @@ getpwnam ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18311,7 +20172,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_sun_getpwnam=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getpwnam" >&5
@@ -18343,7 +20205,6 @@ else
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18354,11 +20215,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18371,7 +20242,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -18379,7 +20250,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18397,6 +20267,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -18416,33 +20287,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -18453,7 +20323,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -18476,7 +20346,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18500,11 +20369,21 @@ deflate ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18517,7 +20396,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_z_deflate=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
@@ -18548,7 +20428,6 @@ else
 echo "$as_me:$LINENO: checking sys/acl.h usability" >&5
 echo $ECHO_N "checking sys/acl.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18559,11 +20438,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18576,7 +20465,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -18584,7 +20473,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking sys/acl.h presence" >&5
 echo $ECHO_N "checking sys/acl.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18602,6 +20490,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -18621,33 +20510,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/acl.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: sys/acl.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: sys/acl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/acl.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/acl.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/acl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/acl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/acl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/acl.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -18674,7 +20562,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lacl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18698,11 +20585,21 @@ acl_get_file ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18715,7 +20612,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_acl_acl_get_file=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5
@@ -18742,7 +20640,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18766,11 +20663,21 @@ pthread_create ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18783,7 +20690,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_pthread_pthread_create=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
@@ -18799,7 +20707,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthreads  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18823,11 +20730,21 @@ pthread_create ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18840,7 +20757,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_pthreads_pthread_create=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5
@@ -18856,7 +20774,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc_r  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18880,11 +20797,21 @@ pthread_create ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18897,7 +20824,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_c_r_pthread_create=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
@@ -18911,21 +20839,28 @@ if test "${ac_cv_func_pthread_create+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define pthread_create to an innocuous variant, in case <limits.h> declares pthread_create.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define pthread_create innocuous_pthread_create
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef pthread_create
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -18956,11 +20891,21 @@ return f != pthread_create;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -18973,7 +20918,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_pthread_create=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_pthread_create" >&5
 echo "${ECHO_T}$ac_cv_func_pthread_create" >&6
@@ -19289,7 +21235,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then
    exit 1
 fi
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/linux/floppy/Makefile rescue/linux/cdrom/Makefile rescue/linux/cdrom/bacula/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/bacula-tray-monitor.desktop doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile src/bimagemgr/Makefile src/bimagemgr/bacula-bimagemgr.spec $PFILES"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/linux/floppy/Makefile rescue/linux/cdrom/Makefile rescue/linux/cdrom/bacula/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile src/bimagemgr/Makefile src/bimagemgr/bacula-bimagemgr.spec $PFILES"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -19319,13 +21265,13 @@ _ACEOF
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
-        "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
       ;;
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 } |
@@ -19355,13 +21301,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[        ]*VPATH[        ]*=/{
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
 s/:*\$(srcdir):*/:/;
 s/:*\${srcdir}:*/:/;
 s/:*@srcdir@:*/:/;
-s/^\([^=]*=[   ]*\):*/\1/;
+s/^\([^=]*=[    ]*\):*/\1/;
 s/:*$//;
-s/^[^=]*=[     ]*$//;
+s/^[^=]*=[      ]*$//;
 }'
 fi
 
@@ -19372,7 +21318,7 @@ ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_i=`echo "$ac_i" |
-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
   # 2. Add them.
   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
@@ -19416,9 +21362,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -19437,7 +21384,7 @@ for as_var in \
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -19616,16 +21563,17 @@ rm -f conf$$ conf$$.exe conf$$.file
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -19652,7 +21600,7 @@ _ASBOX
 cat >&5 <<_CSEOF
 
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -19696,9 +21644,9 @@ Usage: $0 [OPTIONS] [FILE]...
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
+                  instantiate the configuration file FILE
   --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
+                  instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -19715,11 +21663,10 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
@@ -19847,6 +21794,8 @@ do
   "scripts/gnome-console.console_apps" ) CONFIG_FILES="$CONFIG_FILES scripts/gnome-console.console_apps" ;;
   "scripts/mtx-changer" ) CONFIG_FILES="$CONFIG_FILES scripts/mtx-changer" ;;
   "scripts/bacula-tray-monitor.desktop" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-tray-monitor.desktop" ;;
+  "scripts/logwatch/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/Makefile" ;;
+  "scripts/logwatch/logfile.bacula.conf" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/logfile.bacula.conf" ;;
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "src/host.h" ) CONFIG_FILES="$CONFIG_FILES src/host.h" ;;
@@ -20028,7 +21977,6 @@ s,@MV@,$MV,;t t
 s,@RM@,$RM,;t t
 s,@CP@,$CP,;t t
 s,@SED@,$SED,;t t
-s,@AWK@,$AWK,;t t
 s,@ECHO@,$ECHO,;t t
 s,@CMP@,$CMP,;t t
 s,@TBL@,$TBL,;t t
@@ -20038,6 +21986,8 @@ s,@MTX@,$MTX,;t t
 s,@PKGCONFIG@,$PKGCONFIG,;t t
 s,@WXCONFIG@,$WXCONFIG,;t t
 s,@CDRECORD@,$CDRECORD,;t t
+s,@PIDOF@,$PIDOF,;t t
+s,@AWK@,$AWK,;t t
 s,@ARFLAGS@,$ARFLAGS,;t t
 s,@MAKE_SHELL@,$MAKE_SHELL,;t t
 s,@LOCAL_LIBS@,$LOCAL_LIBS,;t t
@@ -20212,9 +22162,9 @@ _ACEOF
       (echo ':t
   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
       if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
       else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
       fi
       ac_sed_frag=`expr $ac_sed_frag + 1`
       ac_beg=$ac_end
@@ -20232,21 +22182,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
   ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -20262,10 +22212,10 @@ echo X"$ac_file" |
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -20303,12 +22253,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
 
   case $INSTALL in
@@ -20330,7 +22313,7 @@ echo "$as_me: creating $ac_file" >&6;}
     configure_input="$ac_file.  "
   fi
   configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                     sed 's,.*/,,'` by configure."
+                                    sed 's,.*/,,'` by configure."
 
   # First look for the input files in the build tree, otherwise in the
   # src tree.
@@ -20339,24 +22322,24 @@ echo "$as_me: creating $ac_file" >&6;}
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+        echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+        fi;;
       esac
     done` || { (exit 1); exit 1; }
 _ACEOF
@@ -20398,12 +22381,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='[       ].*$,\1#\2'
+ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='[        ].*$,\1#\2'
 ac_dC=' '
 ac_dD=',;t'
 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
 ac_uB='$,\1#\2define\3'
 ac_uC=' '
 ac_uD=',;t'
@@ -20412,11 +22395,11 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
@@ -20430,28 +22413,29 @@ echo "$as_me: creating $ac_file" >&6;}
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+        # Do quote $f, to prevent DOS paths from being IFS'd.
+        echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+        fi;;
       esac
     done` || { (exit 1); exit 1; }
   # Remove the trailing spaces.
-  sed 's/[     ]*$//' $ac_file_inputs >$tmp/in
+  sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
 
 _ACEOF
 
@@ -20474,9 +22458,9 @@ s/[\\&,]/\\&/g
 s,[\\$`],\\&,g
 t clear
 : clear
-s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
 t end
-s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 : end
 _ACEOF
 # If some macros were called several times there might be several times
@@ -20490,13 +22474,13 @@ rm -f confdef2sed.sed
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
 cat >>conftest.undefs <<\_ACEOF
-s,^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
 _ACEOF
 
 # Break up conftest.defines because some shells have a limit on the size
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[    ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  if grep "^[     ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
 echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
@@ -20505,7 +22489,7 @@ do
   # Write a limited-size here document to $tmp/defines.sed.
   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#define' lines.
-  echo '/^[    ]*#[    ]*define/!b' >>$CONFIG_STATUS
+  echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -20532,7 +22516,7 @@ do
   # Write a limited-size here document to $tmp/undefs.sed.
   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#undef'
-  echo '/^[    ]*#[    ]*undef/!b' >>$CONFIG_STATUS
+  echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -20566,10 +22550,10 @@ echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -20585,10 +22569,10 @@ echo X"$ac_file" |
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -20620,16 +22604,41 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
   ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
 $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_dest" : 'X\(//\)[^/]' \| \
-         X"$ac_dest" : 'X\(//\)$' \| \
-         X"$ac_dest" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_dest" : 'X\(//\)[^/]' \| \
+        X"$ac_dest" : 'X\(//\)$' \| \
+        X"$ac_dest" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_dest" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
          /^X\(\/\/\)$/{ s//\1/; q; }
          /^X\(\/\).*/{ s//\1/; q; }
          s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
   ac_builddir=.
 
 if test "$ac_dir" != .; then
@@ -20655,12 +22664,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
 
   { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
@@ -20831,4 +22873,4 @@ cat config.out
 
 # old stuff
 # cweb support:              ${got_cweb} ${CWEB_SRC}
-  # gmp support:                     ${got_gmp} ${GMP_SRC}
+# gmp support:               ${got_gmp} ${GMP_SRC}
diff --git a/bacula/examples/conf/fileset_convert.pl b/bacula/examples/conf/fileset_convert.pl
new file mode 100755 (executable)
index 0000000..f39a00d
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+#
+# A nice little script written by Matt Howard that will
+#  convert old style Bacula FileSets into the new style.
+#
+#   fileset_convert.pl bacula-dir.conf >output-file 
+#
+use warnings;
+use strict;
+
+my $in;
+$in .= $_ while (<>);
+
+sub options {
+    return "Options { ".join('; ',split(/\s+/, shift)) . " } ";
+}
+
+sub file_lines {
+    return join($/, map {"    File = $_"} split(/\n\s*/, shift));
+}
+$in =~ s/Include\s*=\s*((?:\w+=\w+\s+)*){\s*((?:.*?\n)+?)\s*}/
+  "Include { " . 
+  ( $1 ? options($1) : '' ) . "\n" .
+  file_lines($2) .
+  "\n  }\n" /eg;
+
+$in =~ s/Exclude\s*=\s*{\s*((?:.*?\n)+?)\s*}/
+  "Exclude {\n" . file_lines($1) . "\n  }\n"/eg;
+
+print $in;
index 683cd3a5fc35145bbfffaf76fd48190abb6f8c88..8816726bd629a4de3979fdf08538531a4f9c457f 100644 (file)
@@ -1,5 +1,5 @@
                     Kern's ToDo List
-                     18 November 2004
+                     20 October 2004
 
 Major development:      
 Project                     Developer
@@ -7,51 +7,15 @@ Project                     Developer
 IPv6_2                      Meno Abels
 Data encryption             Meno Abels (see projects)
 Communication encryption    Meno Abels  
-Version 1.37                Kern (see below)
+Version 1.35                Kern (see below)
 ========================================================
 
-For 1.36.1:
-- Fix orphanned buffers:
-   Orphaned buffer:      24 bytes allocated at line 808 of rufus-dir job.c
-   Orphaned buffer:      40 bytes allocated at line 45 of rufus-dir alist.c
-- Add dump of VolSessionId/Time and FileIndex with bls.
-
-1.37 Projects:
-#3   Migration (Move, Copy, Archive Jobs)
-#4   Embedded Python Scripting
-#5   Events that call a Python program
-#6   Select one from among Multiple Storage Devices for Job
-#7   Single Job Writing to Multiple Storage Devices
-
-
-1.37 Possibilities:
-- Document testing
-- Add performance testing hooks
-- if 2 concurrent backups are attempted on the same tape
-  drive (autoloader) into different tape pools, one of them will exit
-  fatally instead of halting until the drive is idle
-- Add seconds to start and end times in the Job report output.
-- Add disk seeking on restore.  
-- Document that ChangerDevice is used for Alert command.
-- Include within include does it work?
-- Implement a Pool of type Cleaning?
-- Implement VolReadTime and VolWriteTime in SD
-- Modify Backing up Your Database to include a bootstrap file.
-- Add restore of specific JobId to regression.
-- Think about making certain database errors fatal.
-- Look at correcting the time jump in the sceduler for daylight
-  savings time changes.
-- Add a "real" timer to network connections.
-- Tell the "restore" user when browsing is no longer possible.
-- Write non-optimized bsrs from the JobMedia and Media records,
-  even after Files are pruned.
-- Document that Bootstrap files can be written with cataloging
-  turned off.
-- Look at adding full Volume and Pool information to a Volume 
-  label so that bscan can get *all* the info. 
-- Promote to Full = Time period 
-- Scratch Pool where the volumes can be re-assigned to any Pool.
-- Update StartTime if job held in Job Queue.
+1.35 Items to do for release:
+- Finish recovering from a disaster situation.   
+  - How to get back a catalog.
+  
+
+Maybe for 1.35:
 - Despool attributes simultaneously with data in a separate
   thread, rejoined at end of data spooling.
 - Implement Files/Bytes,... stats for restore job.
@@ -66,6 +30,7 @@ For 1.36.1:
 - Add IPv6 to regression
 - Perhaps add read/write programs and/or plugins to FileSets.
 - How to handle backing up portables ...
+- Add "Rerun failed levels = yes/no" to Job resource.
 - Add some sort of guaranteed Interval for upgrading jobs.
 - Can we write the state file after every job terminates? On Win32
   the system crashes and the state file is not updated.
@@ -111,18 +76,70 @@ For 1.37 Testing/Documentation:
   up through the prompt.
 - Detect fixed tape block mode during positioning by looking at
   block numbers in btape "test".  Possibly adjust in Bacula.
+- Implement a Client filename case fold option (default = fold
+  on Win32).
 - Fix list volumes to output volume retention in some other
   units, perhaps via a directive.
 - If opening a tape in read/write mode fails attempt to open
   it in read-only mode, and mark the tape for read only.
 - Add a read-only mode to the mount option.
+- Add "Allow multiple connections" in Catalog resource to open a new 
+  database connection for each job.
 - Allow Simultaneous Priorities = yes  => run up to Max concurrent jobs even
   with multiple priorities.
+- Fix find_device in stored/dircmd.c:462 (see code) 
 - Add db check test to regression. Test each function like delete,
   purge, ...
 - If you use restore replace=never, the directory attributes for
   non-existent directories will not be restored properly.
 
+Fix:
+   Kern,
+   mt status and tapeinfo output are attached. Default blocksize was
+   originally 512 bytes. I ran the following test on my machine:
+
+   - set defblksize to 512
+   - started bacula, labelled tape, ran job
+   - job completes with the following in log
+           SD termination status:  OK
+           Termination:            Backup OK
+   - restore attempts with blocksize set to 0 or 512 result in the familiar
+           "Volume data error! Wanted block-id BB02, got . Buffer discarded."
+
+
+   # tapeinfo -f /dev/sg0
+   Product Type: Tape Drive
+   Vendor ID: 'SONY    '
+   Product ID: 'TSL-11000       '
+   Revision: 'L100'
+   Attached Changer: Yes
+   SerialNumber: '0010000443'
+   MinBlock:1
+   MaxBlock:16777215
+   SCSI ID: 1
+   SCSI LUN: 0
+   Ready: yes
+   BufferedMode: yes
+   Medium Type: Not Loaded
+   Density Code: 0x26
+   BlockSize: 512
+   DataCompEnabled: no
+   DataCompCapable: yes
+   DataDeCompEnabled: yes
+   CompType: 0x20
+   DeCompType: 0x20
+   BOP: yes
+   Block Position: 0
+
+   # mt -f /dev/nst0 status
+   SCSI 2 tape drive:
+   File number=0, block number=132, partition=0.
+   Tape block size 512 bytes. Density code 0x26 (DDS-4 or QIC-4GB).
+   Soft error count since last status=0
+   General status bits on (1010000):
+    ONLINE IM_REP_EN
+
+Wish list:  
 - see lzma401.zip in others directory for new compression
   algorithm/library.
 - Minimal autochanger handling in Bacula and in btape.
@@ -189,6 +206,9 @@ For 1.37 Testing/Documentation:
 - Make ? do a help command (no return needed).
 - Implement restore directory.
 - Document streams and how to implement them.
+- Possibly implement "Ensure Full Backup = yes" looks for a failed full backup
+  and upgrades the current backup if one exists.
+- Check that barcode reading and update slots scan works.
 - Try not to re-backup a file if a new hard link is added.
 - Add feature to backup hard links only, but not the data.
 - Fix stream handling to be simpler.
@@ -196,6 +216,8 @@ For 1.37 Testing/Documentation:
 - Eliminate Restore "Run Restore Job" prompt by allowing new "run command
   to be issued"
 - Remove View FileSet button from Run a Job dialog.
+- Don't count higher level non-saved directories in Files expected
+  in restore report.
 - Handle prompt for restore job at end of Restore command.
 - Add display of total selected files to Restore window.
 - Add tree pane to left of window.
@@ -225,6 +247,8 @@ For 1.37 Testing/Documentation:
   fields.
 - Fix option 2 of restore -- list where file is backed up -- require Client,
   then list last 20 backups.
+- Add all pools in Dir conf to DB also update them to catch changed
+  LabelFormats and such.
 - Pass Director resource name as an option to the Console.
 - Add a "batch" mode to the Console (no unsolicited queries, ...).
 - Add a .list all files in the restore tree (probably also a list all files)
@@ -235,6 +259,7 @@ For 1.37 Testing/Documentation:
   did not exist.
 - Use SHA1 on authentication if possible.
 - See comtest-xxx.zip for Windows code to talk to USB.
+- Make btape accept Device Names in addition to Archive names.
 - Add Events and Perl scripting.
 - Add John's appended files:
    Appended = {     /files/server/logs/http/*log   }
@@ -249,7 +274,8 @@ For 1.37 Testing/Documentation:
    entirely upon the length.On a restore, the full and all incrementals
    since it will beapplied in sequence to restore the file.  
 - Add a regression test for dbcheck.  
-- Allow for optional cancelling of SD and FD in case DIR
+- Add disk seeking on restore.  - Allow
+   for optional cancelling of SD and FD in case DIR
   gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
 - Add "limit=n" for "list jobs"
 - Check new HAVE_WIN32 open bits.    
@@ -290,6 +316,66 @@ For 1.37 Testing/Documentation:
   in Job, Client, and Pool, with precedence such that Job overrides Client
   which in turn overrides Pool.
 
+- Spooling ideas taken from Volker Sauer's and other's emails:
+   > IMHO job spooling should be turned on
+   > 
+   > 1) by job
+   > 2) by schedule
+   > 3) by sd
+   > 
+   > where and 2) overrides 1) and 3) is independent.
+
+   Yes, this is the minimum that I think is necessary.
+
+   > 
+   > Reason(s):
+   > It should be switched by job, because the job that backs up the machine 
+   > with the bacula-sd on doesn't need spooling.
+   > It should be switched by schedule, because for full-backups I don't need 
+   > spooling, so I can switch it off (because the network faster then the 
+   > tapedrive) 
+
+   True, with the exception that if you have enough disk spool space,
+   and you want to run concurrent jobs, spooling can eliminate the block
+   interleaving restore inefficiencies.
+
+   > And you should be able to turn it of by sd for sd-machines with low disk 
+   > capacity or if you just don't need or want this feature.
+   > 
+   > There should be:
+   > - definitly the possibility for multipe spool direcories
+
+   Having multiple directories is no problem -- having different maximum
+   sizes creates specification problems.  At some point, I will probably
+   have a common SD pool of spool directories as well as a set of
+   private spool directories for each device.  The first implementation
+   will be a set of private spool directories for each device since
+   managing a global pool with a bunch of threads writing into the same
+   directory is *much* more complicated and prone to error.
+
+   > - the ability to spool parts of a backup (not the whole client)
+
+   This may change in the future, but for the moment, it will spool
+   either to a job high water mark, or until the directory is full
+   (reaches max spool size or I/O error).  It will then write to tape,
+   truncate the spool file, and begin spooling again.
+
+   > - spooling while writing to tape
+
+   Not within a job, but yes, if you run concurrent jobs -- each is a
+   different thread.  Within a job could be a feature, but *much* later.
+
+   > - parallel spooling (like parallel jobs/ concurrent jobs) of clients
+
+   Yes, this is one of my main motivations for doing it (aside from
+   eliminating tape "shoe shine" during incremental backups.
+
+   > - flushing a backup that only went to disk (like amflush in amanda)
+
+   This will be a future feature, since spooling is different from backing
+   up to disk. The future feature will be "migration" which will move a job
+   from one backup Volume to another.
+
 - New Storage specifications:
   - Want to write to multiple storage devices simultaneously
   - Want to write to multiple storage devices sequentially (in one job)
@@ -321,9 +407,10 @@ For 1.37 Testing/Documentation:
     is contained in only one device.
   In SD allow Device to have Multiple MediaTypes
 
+After 1.33:
 - Look at www.nu2.nu/pebuilder as a helper for full windows
   bare metal restore.
-Ideas from Jerry Scharf:
+Ideas from Jerry Scharf:
   First let's point out some big pluses that bacula has for this
         it's open source
         more importantly it's active. Thank you so much for that
@@ -347,6 +434,9 @@ For 1.37 Testing/Documentation:
    support for Oracle database ??
 ===
 - Look at adding SQL server and Exchange support for Windows. 
+- Restore: Enter Filename: 'C:/Documents and Settings/Comercial/My
+  Documents/MOP/formulário de registro BELAS ARTES.doc' causes Bacula to
+  crash.
 - Each DVD-RAM disk would be a volume, just like each tape is 
   a volume. It's a 4.7GB media with random access, but there's nothing about 
   it that I can see that makes it so different than a tape from  bacula's 
@@ -356,13 +446,20 @@ For 1.37 Testing/Documentation:
   be an invalid value which happens with BSR.
 - Create VolAddr for disk files in place of VolFile and VolBlock. This
   is needed to properly specify ranges.
+- Print bsmtp output to job report so that problems will be seen.
+- Pass the number of files to be restored to the FD for reporting 
 - Add progress of files/bytes to SD and FD.
+- Don't continue Restore if no files selected.
 - Print warning message if FileId > 4 billion
 - do a "messages" before the first prompt in Console
 - Add a date and time stamp at the beginning of every line in the 
   Job report (Volker Sauer).
 - Client does not show busy during Estimate command.
 - Implement Console mtx commands.
+- Add a default DB password to MySQL.  
+  GRANT all privileges ON bacula.* TO bacula@localhost IDENTIFIED BY 
+     'bacula_password';
+  FLUSH PRIVILEGES;
 - Implement a Mount Command and an Unmount Command where
   the users could specify a system command to be performed
   to do the mount, after which Bacula could attempt to
@@ -378,24 +475,63 @@ For 1.37 Testing/Documentation:
 - Implement dump/print label to UA
 - Spool to disk only when the tape is full, then when a tape is hung move
   it to tape.
+- Scratch Pool where the volumes can be re-assigned to any Pool.
 - bextract is sending everything to the log file ****FIXME****
+- Add Progress command that periodically reports the progress of
+  a job or all jobs.
+- Restrict characters permitted in a Resource name, and don't permit
+  duplicate names.
 - Allow multiple Storage specifications (or multiple names on
   a single Storage specification) in the Job record. Thus a job 
   can be backed up to a number of storage devices.
 - Implement some way for the File daemon to contact the Director 
   to start a job or pass its DHCP obtained IP number.
+- Implement multiple Consoles.
 - Implement a query tape prompt/replace feature for a console
+- From Johan?
+    Two jobs ready to go, first one blocked waiting for media
+    Cancel 2nd job ("waiting execution" one)
+    Cancel blocked job
+    boom - segfault*
 - Copy console @ code to gnome2-console
 - Make AES the only encryption algorithm see 
   http://csrc.nist.gov/CryptoToolkit/aes/).  It's
   an officially adopted standard, has survived peer
   review, and provides keys up to 256 bits.
+- Think about how space could be freed up on a tape -- perhaps this
+  is a Merge or Compact feature that is needed.
+- Modify FileSet, did not upgrade the current Increment job, but
+  waited for the next job to be upgraded.
 - Take a careful look at SetACL http://setacl.sourceforge.net     
+- Implement a where command for the tree telling where a file
+  is located.
 - Take a careful look at Level for the estimate command, maybe make
   it a command line option.
 - Add Volume name to "I cannot write on this volume because"
 - Make tree walk routines like cd, ls, ... more user friendly
   by handling spaces better.
+- Write your PID file and chown root:wheel before drop.
+- Make sure there is no symlink in a file before creating a
+  file (attack).
+- Look at mktemp or mkstemp(3).
+    mktemp and mkstemp create files with predictable names too.  That's
+    not the vulnerability.  The vulnerability is in creating files without
+    using the O_EXCL flag, which means "only create this file if it doesn't
+    exist, including if the file is a dangling symlink."
+
+    It is *NOT* enough to do the equivalent of
+
+      if doesn't exist $filename
+       then create $filename
+
+    because between the test and the create another process could have
+    gotten the CPU and created the file.  You must use atomic functions
+    (those that don't get interrupted by other processes) and O_EXCL is
+    the only way for this particular example.
+- Automatically create pools, but instead of looking for what
+  in in Job records, walk through the pool resources.
+- Check and double check tree code, why does it take so long?
+- Add device name to "Current Volume not acceptable because ..."
 - Make sure that Bacula rechecks the tape after the 20 min wait.
 - Set IO_NOWAIT on Bacula TCP/IP packets.
 - Try doing a raw partition backup and restore by mounting a
@@ -409,17 +545,76 @@ For 1.37 Testing/Documentation:
     By the way can bacula automatically "move" an empty/purged volume say 
     in the "short" pool to the "long" pool if this pool runs out of volume 
     space?
+- Eliminate orphaned jobs: dbcheck, normal pruning, delete job command.
+  Hm.  Well, there are the remaining orphaned job records:
+
+     |   105 | Llioness Save  | 0000-00-00 00:00:00 | B    | D     |        0 |             0 | f         |
+     |   110 | Llioness Save  | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
+     |   115 | Llioness Save  | 2003-09-10 02:22:03 | B    | I     |        0 |             0 | A         |
+     |   128 | Catalog Save   | 2003-09-11 03:53:32 | B    | I     |        0 |             0 | C         |
+     |   131 | Catalog Save   | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
+
+     As you can see, three of the five are failures.  I already deleted the
+     one restore and one other failure using the by-client option.  Deciding
+     what is an orphaned job is a tricky problem though, I agree.  All these
+     records have or had 0 files/ 0 bytes, except for the restore.  With no
+     files, of course, I don't know of the job ever actually becomes
+     associated with a Volume.
+
+     (I'm not sure if this is documented anywhere -- what are the meanings of
+     all the possible JobStatus codes?)
+
+     Looking at my database, it appears to me as though all the "orphaned"
+     jobs fit into one of two categories:
+
+     1)  The Job record has a StartTime but no EndTime, and the job is not
+     Â Â Â  currently running;
+     or
+     2)  The Job record has an EndTime, indicating that it completed, but
+     Â Â Â  it has no associated JobMedia record.
+
+
+     This does suggest an approach.  If failed jobs (or jobs that, for some
+     other reason, write no files) are associated with a volume via a
+     JobMedia record, then they should be purged when the associated volume
+     is purged.  I see two ways to handle jobs that are NOT associated with a
+     specific volume:
+
+     1)  purge them automatically whenever any volume is manually purged;
+     or
+     2)  add an option to the purge command to manually purge all jobs with
+     Â Â Â  no associated volume.
+
+     I think Restore jobs also fall into category 2 above ....  so one might
+     want to make that "The Job record has an EndTime,, but no associated
+     JobMedia record, and is not a Restore job."  
+- make "btape /tmp" work.
+- Make sure a rescheduled job is properly reported by status.
+- Walk through the Pool records rather than the Job records
+  in dird.c to create/update pools.
 - What to do about "list files job=xxx".
+- When job rescheduled, status gives is waiting for Client Rufus 
+  to connect to Storage File. Dir needs to inform SD that job
+  is rescheduled.
 - Make Dmsg look at global before calling subroutine.
+- Enable trace output at runtime for Win32
+- Available volumes for autochangers (see patrick@baanboard.com 3 Sep 03 
+  and 4 Sep) scan slots.
 - Get and test MySQL 4.0
+- Do a complete audit of all pthreads_mutex, cond, ... to ensure that
+  any that are dynamically initialized are destroyed when no longer used.
 - Look at how fuser works and /proc/PID/fd that is how Nic found the
   file descriptor leak in Bacula.
 - Implement WrapCounters in Counters.
+- Turn on SIGHUP in dird.c and test.
+- Use system dependent calls to get more precise info on tape errors.
 - Add heartbeat from FD to SD if hb interval expires.
+- Suppress read error on blank tape when doing a label.
 - Can we dynamically change FileSets?
 - If pool specified to label command and Label Format is specified,
   automatically generate the Volume name.
 - Why can't SQL do the filename sort for restore?
+- Look at libkse (man kse) for FreeBSD threading.
 - Look into Microsoft Volume Shadowcopy Service VSS for backing
   up system state components (Active Directory, System Volume, ...)
 - Add ExhautiveRestoreSearch
@@ -427,6 +622,7 @@ For 1.37 Testing/Documentation:
   data into the restore tree (i.e. do it one directory at a
   time as the user walks through the tree).
 - Possibly use the hash code if the user selects all for a restore command.
+- Orphaned Dir buffer at parse_conf.c:373 =>  store_dir
 - Fix "restore all" to bypass building the tree.
 - Prohibit backing up archive device (findlib/find_one.c:128)
 - Implement Release Device in the Job resource to unmount a drive.
@@ -434,28 +630,50 @@ For 1.37 Testing/Documentation:
   be sure this works with admin jobs so that the user can get
   prompted to insert the correct tape.  Possibly some way to say to
   run the job but don't save the files.
+- Implement FileOptions (see end of this document)
 - Make things like list where a file is saved case independent for
   Windows.
 - Implement migrate
+- Bacula needs to propagate SD errors.
+  > > cluster-dir: Start Backup JobId 252, Job=REUTERS.2003-08-11_15.04.12
+  > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Write error on device 
+       /dev/nst0. ERR=Input/output error.
+  > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Re-read of last block failed. 
+       Last block=5162 Current block=5164.
+  > > prod4-sd: End of medium on Volume "REU007" Bytes=16,303,521,933 
+
 - Use autochanger to handle multiple devices.
 - Add SuSE install doc to list.
 - Check and rechedk "Invalid block number"
+- Make bextract release the drive properly between tapes 
+  so that an autochanger can be made to work.
 - User wants to NOT backup up certain big files (email files).
 - Maybe remove multiple simultaneous devices code in SD.
 - On Windows with very long path names, it may be impossible to create 
   a file (and thus restore it) because the total length is too long.
   We must cd into the directory then create the file without the
   full path name.
+- lstat() is not going to work on Win32 for testing date.
 - Implement a Recycle command
 - Add client name to cram-md5 challenge so Director can immediately
   verify if it is the correct client.
+- Add JobLevel in FD status (but make sure it is defined).
 - Audit all UA commands to ensure that we always prompt where possible.
+- Check Jmsg in bnet, may not work, must dup bsock.
+- Suppress Job Name in Jmsg for console
+- Create Pools that are referenced in a Run statement at startup if possible.
+- Use runbeforejob to unload, then reload a volume previously used,
+  then the next job run gets an error reading the drive.
 - Make bootstrap filename unique.
 - Test a second language e.g. french.
 - Start working on Base jobs.
+- Make "make binary-release" work from any directory.
 - Implement UnsavedFiles DB record.
 - Implement argc/argv for daemon command line scanning using table driven
   stuff below.
+- Implement table driven single argc/argv scanner to pickup all arguments.
+  Much like xxx_conf.c scan table.
+  keyword, handler(store_routine), store_address, code, flags, default.
 - From Phil Stracchino:
   It would probably be a per-client option, and would be called
   something like, say, "Automatically purge obsoleted jobs".  What it
@@ -472,10 +690,16 @@ For 1.37 Testing/Documentation:
 - Currently in mount.c:236 the SD simply creates a Volume. It should have
   explicit permission to do so.  It should also mark the tape in error
   if there is an error.
+- Make sure all restore counters are working correctly in the FD.
 - SD Bytes Read is wrong.
+- Look at ALL higher level routines that call block.c to be sure
+  they don't expect something in errmsg.
 - Investigate doing RAW backup of Win32 partition.
+- Add thread specific data to hold the jcr -- send error messages from
+  low level routines by accessing it and using Jmsg().
 - Cancel waiting for Client connect in SD if FD goes away.
 
+- Examine Bare Metal restore problem (a FD crash exists somewhere ...).
 - Implement timeout in response() when it should come quickly.
 - Implement console @echo command.
 - Implement a Slot priority (loaded/not loaded).
@@ -483,6 +707,9 @@ For 1.37 Testing/Documentation:
 - Implement single pane restore (much like the Gftp panes).
 - Implement Automatic Mount even in operator wait.
 - Implement create "FileSet"?
+- Fix watchdog pthread crash on Win32 (this is pthread_kill() Cygwin bug)
+- Implement "scratch pool" where tapes are defined and can be
+  taken by any pool that needs them.
 - Implement restore "current system", but take all files without
   doing selection tree -- so that jobs without File records can
   be restored.
@@ -526,6 +753,8 @@ For 1.37 Testing/Documentation:
 - Figure out how to do a bare metal Windows restore
 - Possibly add email to Watchdog if drive is unmounted too
   long and a job is waiting on the drive.
+- Restore program that errs in SD due to no tape, reports
+  OK incorrectly in output.
 - After unmount, if restore job started, ask to mount.
 - Convert all %x substitution variables, which are hard to remember
   and read to %(variable-name).  Idea from TMDA.
@@ -995,8 +1224,167 @@ Block Position: 0
 ====
 
 
-=== Done
-- Add "Rerun failed levels = yes/no" to Job resource.
-- Fix CDROM make script to permit picking up already installed
-  static FD.
-- Add date/time to each Jmsg.
+=== Done in 1.34.3
+- To pass Include 1 or two letter commands
+  I Name           Include name - first record
+  B Name           Base name - repeat
+  R "xxx"          Regexp
+  W "xxx"          Wild Card
+  E zzz            Exclude expression (wild card)
+  P "plugin"       Plugin
+  D "reader"       Reader program
+  T "writer"       Writer program
+  O Options        In current commpressed format
+    (compression, signature, onefs, recurse, sparse,
+     replace, verify options, ...)
+  N                End option set
+  B BaseName       Start second option set any letter
+  ...
+  E
+  F Number         Number of filenames to follow
+  <file-name>
+  B Name
+  ...
+  N                End option set
+  F Number         Number of filenames to follow
+  <file-name>
+  ...
+- Add regression of btape "fill" 
+==== Done in 1.34.4
+- Implement "label slots=1,2... pool=yyy barcodes"
+- Mark a non-removable disk Volume in error rather than asking sys op to
+  mount it.
+- Implement Fixed storage LabelFormat test.
+- Add reporting in attr despooling.
+- Figure out how to use ssh or stunnel to protect Bacula communications.
+  Add Dan's work to manual See ssl.txt
+
+==== Done in 1.35.0
+- Implement fast tree insert (doubly linked list)
+- Disallow using Internal database
+- Feedback while the restore tree is being built.    
+- Add detection of Whitebox release in ./configure
+- Add InChanger to "list media"
+- Implement second cut of SIGHUP in Dir
+  (Implement resources on a single pointer)
+- Add regular expressions to FileSets (needs testing).
+- Test new despooling error recovery code when partition fills.
+- Sort Scheduled jobs status listing by start time.
+- Add priority to Scheduled jobs status listing.
+- Look at Win32 inc problem when new directory added files not saved???
+- Require resource names to be unique.
+- Make sure that all errors from libacl are printed.
+- Make FD run on Win95 if possible (not really possible).
+- Fix GROUP BYs in all SQL (done by Dan -- thanks)
+- Make entering multiple Storage names in Dir illegal.
+- Make btape release the drive during the "test" append.
+- Fix restore:
+   You have selected the following JobIds: 739,856,797
+   Building directory tree for JobId 739 ...
+   Building directory tree for JobId 856 ...
+   Building directory tree for JobId 797 ...3 
+   Jobs inserted into the tree.
+- Fix errno handling in win32 compat routines.
+- Add better error codes to run_program (10000+)
+- Revisit and revise Disaster Recovery (fix SCSI and RAID 
+  disk detection)
+- When passwords do not match, print message that points the
+  user to the doc.
+- Do tape alerts -- see tapealert.txt
+- Find memory leaks in address_conf.c
+- Network order of port and ip addresses.
+- SetIP in dird/fd_cmds.c is broken.
+- don't use inet_addr() it is deprecated.
+- Fix code in filed.c for init_bsock();
+- Fix code in console.c for init_bsock();
+- Solve the termcap.h problem on Solaris configure.
+- Make Verify jobs require exclusive use of Volume as Restore 
+  jobs do.
+- Fix restore ++++ that get intermingled with "Building directory tree"
+- Fix doc in dirdconf.html for @, where the file must
+  have not a list of files, but 
+   file = xxx
+   file = yyy
+- Test Win32 errno handling.
+- port 1.34.6-block.patch to 1.35
+- Look at Chris' patch for bscan bug.
+- Fix error handling in spooling both data and attribute.
+- Implement Ignore FileSet Change.
+- Doc new duration time input editing.
+- Bacula rescue CDROM implement isolinux
+- Make sure Qmsgs are dequeued by FD and SD.
+- Check if ACLs allocated at dird_conf.c:1214 are being properly
+  released.
+- Test/doc Tape Alerts
+- Doc dbcheck eliminate orphaned clients.
+- Doc Phil's new delete job jobid scanning code.
+- Document that console commands can be abbreviated.
+- Doc update AllFromVol
+- Doc -p option in stored
+- New IP address specification is used as follows:
+    [sdaddresses|diraddresses|fdaddresses] = { [[ip|ipv4|ipv6] = { 
+           [[addr|port] = [^ ]+[\n;]+] }] }
+
+  so it could look for example like this:
+     SDaddresses  = { ip = {
+            addr = 1.2.3.4; port = 1205; }
+        ipv4 = {
+            addr = 1.2.3.4; port = http; }
+        ipv6 = {
+            addr = 1.2.3.4;
+            port = 1205;
+        }
+        ip = {
+            addr = 1.2.3.4
+            port = 1205
+        }
+        ip = {
+            addr = 1.2.3.4
+        }
+        ip = {
+            addr = 201:220:222::2
+        }
+        ip = {
+            addr = bluedot.thun.net
+        }
+     }
+  as a consequence, you can now specify multiple IP addresses and
+  ports to be used. In the case of a server, it will listen on
+  all those that you specify. In the case of connecting to the server,
+  Bacula will attempt connecting to one at a time until it succeeds.
+  And, in a few other special cases, Bacula will use only the first
+  address specified.
+
+  The default port numbers are still the same and the services and hosts 
+  are also resolved by name. So now  you could use the real names for the 
+  port numbers.
+
+  An ip section will allow resolution to either an ipv4 or an ipv6 address.
+  An ipv4 section forces the resolution to be only ipv4, and an ipv6 section
+  forces the resolution to be only ipv6.
+- Fix silly restriction requiring Include { Options { xxx } } to be
+  on separate lines.
+- Restore c: with a prefix into /prefix/c/ to prevent c: and d:
+  files with the same name from overwritting each other.
+- Add "Multiple connections = yes/no" to catalog resource.
+- Add new DCR calling sequences everywhere in SD. This will permit 
+  simultaneous use of multiple devices by a single job.
+- Fix bscan so that it releases the drive when requesting a new tape.
+- List verify options for DiskToCatalog in doc.
+- Turn on transactions if multiple connections are on in DB.
+- Fix storage overrides in Run directives.
+- Look into failing Excludes in Win32
+- Make restore check if the file size restored is correct.
+- Backspace to beginning of line (conio) does not erase first char.
+- Fix possible bug in update volumefrompool (email 9/28 from
+  jesk@killall.org
+- Add relabel regression test.
+- Document a get out of jail procedure if everything breaks if 
+  you lost/broke the Catalog -- do the same for "I know my
+  file is there how do I get it back?".
+- Fix documentation for readline.
+- Add File indexes as suggested by Martin -- modify update
+  scripts to add them.
+- Modify postgresql update script to remove bigint FilenameId           
+  reference.
+- Kill daemons at levels in the teens rather than late.
diff --git a/bacula/patches/fix_postgresql_tables b/bacula/patches/fix_postgresql_tables
deleted file mode 100755 (executable)
index 2d69f89..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Shell script to fix PostgreSQL tables in version 8
-#
-echo " "
-echo "This script will fix a Bacula PostgreSQL database version 8"
-echo "Depending on the size of your database,"
-echo "this script may take several minutes to run."
-echo " "
-#
-# Set the following to the path to psql.
-bindir=****EDIT-ME to be the path to psql****
-
-if $bindir/psql $* -f - <<END-OF-DATA
-\c bacula
-
-begin;
-
-alter table media rename column endblock to endblock_old;
-alter table media add column endblock bigint;
-update media set endblock = endblock_old;
-alter table media alter column endblock set not null;
-alter table media drop column endblock_old;
-
-commit;
-
-vacuum;
-
-END-OF-DATA
-then
-   echo "Update of Bacula PostgreSQL tables succeeded."
-else
-   echo "Update of Bacula PostgreSQL tables failed."
-fi
-exit 0
diff --git a/bacula/platforms/gentoo/1.36.2-cdrecord-configure.patch b/bacula/platforms/gentoo/1.36.2-cdrecord-configure.patch
new file mode 100644 (file)
index 0000000..6fa8511
--- /dev/null
@@ -0,0 +1,19 @@
+diff -uNr bacula-1.36.2/configure bacula-1.36.2-fixed/configure
+--- bacula-1.36.2/configure    2005-02-25 04:46:49.000000000 -0500
++++ bacula-1.36.2-fixed/configure      2005-03-06 10:11:23.905848861 -0500
+@@ -7301,15 +7301,6 @@
+ # get scsibus,target,lun
+ # -------------------------------------------
+ CDSTL="3,0,0"
+-if test ! x$CDRECORD = x ; then
+-   CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD-RW | ${AWK} '{print $1}'`
+-   if test x${CDSTL} = x ; then
+-      CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD+RW | ${AWK} '{print $1}'`
+-   fi
+-   if test x${CDSTL} = x ; then
+-      CDSTL="3,0,0"
+-   fi
+-fi
index c8a62d44aa212b991a82b7ef57d30ba25ed308e3..b87c6248f4fd1a763de135a15eeabd33932ea209 100644 (file)
@@ -1,8 +1,37 @@
 # Copyright 2004 D. Scott Barninger
-# Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
+#
 # Modified from bacula-1.34.5.ebuild for 1.36.0 release
 # 24 Oct 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# added cdrom rescue for 1.36.1
+# init script now comes from source package not ${FILES} dir
+# 26 Nov 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# fix symlink creation in rescue package in post script
+# remove mask on x86 keyword
+# fix post script so it doesn't talk about server config for client-only build
+# bug #181 - unable to reproduce on 2.4 kernel system so add FEATURES="-sandbox"
+# 04 Dec 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# more  on bug #181 - another user has reported a sandbox violation trying to
+# write to /dev/sg0 - still can't reproduce this behavior
+# add an 'addpredict /dev/sg0'
+# 08 Dec 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# resolve bug #181 - problem is caused by configure calling cdrecord to scan
+# the scsi bus. patch configure to remove this. add logrotate script.
+# 06 Feb 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# fix documentation bug
+# 07 Feb 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# new USE keywords bacula-clientonly bacula-split
+# add new logwatch scripts
+# 06 Mar 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# 1.36.3 doc changes
+# 17 Apr 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
 
 DESCRIPTION="featureful client/server network backup suite"
 HOMEPAGE="http://www.bacula.org/"
@@ -10,66 +39,73 @@ SRC_URI="mirror://sourceforge/bacula/${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~x86 ~ppc ~sparc"
-IUSE="readline tcpd gnome mysql sqlite X static postgres wxwindows"
+KEYWORDS="x86 ~ppc ~sparc ~amd64"
+IUSE="readline tcpd gnome mysql sqlite X static postgres wxwindows bacula-clientonly bacula-split"
 
 inherit eutils
 
-#theres a local sqlite use flag. use it -OR- mysql, not both.
-#mysql is the reccomended choice ...
-#may need sys-libs/libtermcap-compat but try without first
+# there is a local sqlite use flag. use it -OR- mysql, not both.
+# mysql is the recommended choice ...
+# may need sys-libs/libtermcap-compat but try without first
 DEPEND=">=sys-libs/zlib-1.1.4
-       sys-apps/mtx
        readline? ( >=sys-libs/readline-4.1 )
        tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
        gnome? ( gnome-base/libgnome )
        gnome? ( app-admin/gnomesu )
-       sqlite? ( =dev-db/sqlite-2* )
-       mysql? ( >=dev-db/mysql-3.23 )
-       postgres? ( >=dev-db/postgresql-7.4.0 )
+       !bacula-clientonly? (
+               sqlite? ( =dev-db/sqlite-2* )
+               mysql? ( >=dev-db/mysql-3.23 )
+               postgres? ( >=dev-db/postgresql-7.4.0 )
+               sys-apps/mtx
+       )
        X? ( virtual/x11 )
        wxwindows? ( >=x11-libs/wxGTK-2.4.2 )
        virtual/mta
-       dev-libs/gmp"
+       dev-libs/gmp
+       app-text/tetex
+       dev-tex/latex2html"
 RDEPEND="${DEPEND}
-       sys-apps/mtx
-       app-arch/mt-st"
+       !bacula-clientonly? (
+               sys-apps/mtx
+               app-arch/mt-st
+       )"
 
 src_compile() {
 
-       # patch configure for scripts/bacula-tray-monitor.desktop
-       patch ${S}/configure ${FILESDIR}/${P}-configure.diff
+       # this resolves bug #181
+       epatch ${FILESDIR}/1.36.2-cdrecord-configure.patch
 
        local myconf=""
 
-       #sed -i -e "s:$bindir/mysql:$bindir/mysql -p:g" grant_mysql_privileges.in
-
-       #define this to skip building the other daemons ...
-       [ -n "$BUILD_CLIENT_ONLY" ] \
-               && myconf="${myconf} --enable-client-only"
-
        myconf="
                `use_enable readline`
                `use_enable gnome`
                `use_enable tcpd tcp-wrappers`
                `use_enable X x`"
 
-       [ -n "$BUILD_CLIENT_ONLY" ] \
-                && myconf="${myconf} --enable-client-only"
-
-       # mysql is the reccomended choice ...
-       if use mysql
-       then
-               myconf="${myconf} --with-mysql=/usr"
-       elif use postgres
+       # define this to skip building the other daemons ...
+       if use bacula-clientonly
        then
-               myconf="${myconf} --with-postgresql=/usr"
-       elif use sqlite
-       then
-               myconf="${myconf} --with-sqlite=/usr"
-       elif  use sqlite && use mysql
+               myconf="${myconf} --enable-client-only"
+       fi
+
+       # select database support
+       if ! use bacula-clientonly
        then
-               myconf="${myconf/--with-sqlite/}"
+               # mysql is the recomended choice ...
+               if use mysql
+               then
+                       myconf="${myconf} --with-mysql=/usr"
+               elif use postgres
+               then
+                       myconf="${myconf} --with-postgresql=/usr"
+               elif use sqlite
+               then
+                       myconf="${myconf} --with-sqlite=/usr"
+               elif  use sqlite && use mysql
+               then
+                       myconf="${myconf/--with-sqlite/}"
+               fi
        fi
 
        if use wxwindows
@@ -87,7 +123,6 @@ src_compile() {
        myconf="${myconf} --enable-tray-monitor"
        fi
 
-
        ./configure \
                --enable-smartalloc \
                --prefix=/usr \
@@ -108,10 +143,18 @@ src_compile() {
 
        emake || die "compile problem"
 
+       # for the rescue package regardless of use static
+       cd ${S}/src/filed
+       make static-bacula-fd
+       cd ${S}
+
+       # make the docs
+       cd ${S}/doc/latex
+       make
+       cd ${S}
+
        if use static
        then
-               cd ${S}/src/filed
-               make static-baula-fd
                cd ${S}/src/console
                make static-console
                cd ${S}/src/dird
@@ -152,7 +195,7 @@ src_install() {
                        cd ${S}/src/wx-console
                        cp static-wx-console ${D}/usr/sbin/wx-console
                fi
-               cd ${S}/src/storge
+               cd ${S}/src/stored
                cp static-bacula-sd ${D}/usr/sbin/bacula-sd
        fi
 
@@ -170,20 +213,45 @@ src_install() {
        chmod 644 ${D}/etc/bacula/tray-monitor.conf
        fi
 
-       # the database update scripts
-       mkdir -p ${D}/etc/bacula/updatedb
-       cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/
-       chmod 754 ${D}/etc/bacula/updatedb/*
+       if ! use bacula-clientonly
+       then
+               # the database update scripts
+               mkdir -p ${D}/etc/bacula/updatedb
+               cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/
+               chmod 754 ${D}/etc/bacula/updatedb/*
+
+               # the logrotate configuration
+               mkdir -p ${D}/etc/logrotate.d
+               cp ${S}/scripts/logrotate ${D}/etc/logrotate.d/bacula
+               chmod 644 ${D}/etc/logrotate.d/bacula
+
+               # the logwatch scripts
+               mkdir -p ${D}/etc/log.d/conf/logfiles
+               mkdir -p ${D}/etc/log.d/conf/services
+               mkdir -p ${D}/etc/log.d/scripts/services
+               cp ${S}/scripts/logwatch/bacula ${D}/etc/log.d/scripts/services/bacula
+               cp ${S}/scripts/logwatch/logfile.bacula.conf ${D}/etc/log.d/conf/logfiles/bacula.conf
+               cp ${S}/scripts/logwatch/services.bacula.conf ${D}/etc/log.d/conf/services/bacula.conf
+               chmod 755 ${D}/etc/log.d/scripts/services/bacula
+               chmod 644 ${D}/etc/log.d/conf/logfiles/bacula.conf
+               chmod 644 ${D}/etc/log.d/conf/services/bacula.conf
+
+       fi
+
+       # the cdrom rescue package
+       mkdir -p ${D}/etc/bacula/rescue/cdrom
+       cp -R ${S}/rescue/linux/cdrom/* ${D}/etc/bacula/rescue/cdrom/
+       mkdir ${D}/etc/bacula/rescue/cdrom/bin
+       cp ${S}/src/filed/static-bacula-fd ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd
+       chmod 754 ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd
 
        # documentation
-       for a in ${S}/{Changelog,README,ReleaseNotes,kernstodo,LICENSE,doc/bacula.pdf}
+       for a in ${S}/{ChangeLog,README,ReleaseNotes,kernstodo,LICENSE,doc/latex/bacula.pdf}
        do
                dodoc $a
        done
 
-       dohtml -r ${S}/doc/html-manual doc/home-page
-       chown -R root:root ${D}/usr/share/doc/${PF}
-       chmod -R 644 ${D}/usr/share/doc/${PF}/*
+       dohtml -r ${S}/doc/latex/bacula
        
        # clean up permissions left broken by install
        chmod o-r ${D}/etc/bacula/query.sql
@@ -191,8 +259,21 @@ src_install() {
        # remove the working dir so we can add it postinst with group
        rmdir ${D}/var/bacula
 
+       # init scripts
        exeinto /etc/init.d
-       newexe ${FILESDIR}/bacula-init bacula
+       if use bacula-clientonly
+       then
+               newexe ${S}/platforms/gentoo/bacula-fd bacula-fd
+       else
+               if use bacula-split
+               then
+                       newexe ${S}/platforms/gentoo/bacula-fd bacula-fd
+                       newexe ${S}/platforms/gentoo/bacula-sd bacula-sd
+                       newexe ${S}/platforms/gentoo/bacula-dir bacula-dir
+               else
+                       newexe ${S}/platforms/gentoo/bacula-init bacula
+               fi
+       fi
 }
 
 pkg_postinst() {
@@ -208,9 +289,23 @@ pkg_postinst() {
        # the working directory
        install -m0750 -o root -g bacula -d ${ROOT}/var/bacula
 
+       # link installed bacula-fd.conf into rescue directory
+       #ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bacula-fd.conf
+       # no longer necessary after 1.36.2
+
+       einfo
+       einfo "The CDRom rescue disk package has been installed into the"
+       einfo "/etc/bacula/rescue/cdrom/ directory. Please examine the manual"
+       einfo "for information on creating a rescue CD. CDR device detection"
+       einfo "during build has been disabled to prevent sandbox violations."
+       einfo "You need to examine /etc/bacula/rescue/cdrom/Makefile and adjust"
+       einfo "the device information for your CD recorder."
+       einfo
+
+       if ! use bacula-clientonly; then
        einfo
        einfo "Please note either/or nature of database USE flags for"
-       einfo "Bacula.  If mysql is set, it will be used, else postgresql"
+       einfo "Bacula.  If mysql is set, it will be used, else postgres"
        einfo "else finally SQLite.  If you wish to have multiple DBs on"
        einfo "one system, you may wish to unset auxillary DBs for this"
        einfo "build."
@@ -220,7 +315,7 @@ pkg_postinst() {
        then
        # test for an existing database
        # note: this ASSUMES no password has been set for bacula database
-       DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+       DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
                if [ -z "$DB_VER" ]; then
                einfo "This appears to be a new install and you plan to use mysql"
                einfo "for your catalog database. You should now create it by doing"
@@ -243,18 +338,18 @@ pkg_postinst() {
                fi
        fi
 
-       if use postgresql
+       if use postgres
        then
        # test for an existing database
        # note: this ASSUMES no password has been set for bacula database
-       DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+       DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
                if [ -z "$DB_VER" ]; then
                einfo "This appears to be a new install and you plan to use postgresql"
                einfo "for your catalog database. You should now create it by doing"
                einfo "these commands:"
-               einfo " sh /etc/bacula/grant_postgresql_privileges"
                einfo " sh /etc/bacula/create_postgresql_database"
                einfo " sh /etc/bacula/make_postgresql_tables"
+               einfo " sh /etc/bacula/grant_postgresql_privileges"
                elif [ "$DB_VER" -lt "8" ]; then
                elinfo "This release requires an upgrade to your bacula database"
                einfo "as the database format has changed.  Please read the"
@@ -274,7 +369,7 @@ pkg_postinst() {
        then
        # test for an existing database
        # note: this ASSUMES no password has been set for bacula database
-       DB_VER=`echo "select * from Version;" | sqlite /var/bacula/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | sqlite 2>/dev/null /var/bacula/bacula.db | tail -n 1`
                if [ -z "$DB_VER" ]; then
                einfo "This appears to be a new install and you plan to use sqlite"
                einfo "for your catalog database. You should now create it by doing"
@@ -288,7 +383,7 @@ pkg_postinst() {
                einfo "manual chapter for how to upgrade your database!!!"
                einfo
                einfo "Backup your database with the command:"
-               einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \"
+               einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \\"
                einfo "   /var/bacula/bacula_backup.sql.bz2"
                einfo
                einfo "Then update your database using the scripts found in"
@@ -297,13 +392,35 @@ pkg_postinst() {
                einfo "version to the current version."
                fi
        fi
+       fi
 
        einfo
-       einfo "Then setup your configuration files in /etc/bacula and"
+       einfo "Review your configuration files in /etc/bacula and"
        einfo "start the daemons:"
-       einfo " /etc/init.d/bacula start"
+       if use bacula-clientonly; then
+               einfo " /etc/init.d/bacula-fd start"
+       else
+               if use bacula-split; then
+               einfo " /etc/init.d/bacula-sd start"
+               einfo " /etc/init.d/bacula-dir start"
+               einfo " /etc/init.d/bacula-fd start"
+               einfo " or /etc/bacula/bacula will start all three."
+               else
+               einfo " /etc/init.d/bacula start"
+               fi
+       fi
        einfo
        einfo "You may also wish to:"
-       einfo " rc-update add bacula default"
+       if use bacula-clientonly; then
+               einfo " rc-update add bacula-fd default"
+       else
+               if use bacula-split; then
+                       einfo " rc-update add bacula-sd default"
+                       einfo " rc-update add bacula-dir default"
+                       einfo " rc-update add bacula-fd default"
+               else
+                       einfo " rc-update add bacula default"
+               fi
+       fi
        einfo
 }
index 3e9abd6082debf681035c420487c4e97f0efee7f..3374e8d0a78bece689c60ed759a394913cdda4b4 100644 (file)
@@ -1,3 +1,6 @@
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
 # Platform Build Configuration
 
 # basic defines for every build
 %{?build_rh8:%define rh8 1}
 %define rh9 0
 %{?build_rh9:%define rh9 1}
-# Fedora Core build
+# Fedora Core build
 %define fc1 0
 %{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
 # Whitebox Enterprise build
-# this should also work for RHEL
 %define wb3 0
 %{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
 # SuSE build
-# this is known to build on SuSE 8.2 and 9.0
 %define su9 0
 %{?build_su9:%define su9 1}
 # Mandrake build
@@ -35,7 +49,7 @@
 %{?build_mdk:%define mdk 1}
 
 # test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
 %{error: You must specify a platform. Please examine the spec file.}
 exit 1
 %endif
@@ -44,6 +58,10 @@ exit 1
 # set for database support desired or define the build_xxx on the command line
 %define mysql 0
 %{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
 %define sqlite 0
 %{?build_sqlite:%define sqlite 1}
 %define postgresql 0
@@ -55,6 +73,33 @@ exit 1
 exit 1
 %endif
 
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -68,9 +113,9 @@ Source3: Release_Notes-%{version}-%{release}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://www.bacula.org/
 Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
 %if %{rh7}
 BuildRequires: libtermcap-devel
@@ -81,6 +126,8 @@ BuildRequires: ORBit-devel
 BuildRequires: bonobo-devel
 BuildRequires: GConf-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 %if %{su9}
 BuildRequires: termcap
@@ -96,6 +143,8 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: gconf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
 %if %{mdk}
 BuildRequires: libtermcap-devel
@@ -111,8 +160,25 @@ BuildRequires: libGConf2-devel
 BuildRequires: libstdc++-static-devel
 BuildRequires: glibc-static-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 BuildRequires: libtermcap-devel
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui-devel >= 2.0
@@ -125,12 +191,18 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: GConf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
 BuildRequires: mysql-devel >= 3.23
 %endif
 
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 BuildRequires: rh-postgresql-devel >= 7
 %endif
@@ -168,6 +240,7 @@ Requires: readline, ncurses, libstdc++, zlib
 %if %{sqlite}
 Conflicts: sqlite, sqlite-tools
 %endif
+
 %if %{rh7}
 Requires: glibc >= 2.2
 Requires: libtermcap
@@ -180,18 +253,34 @@ Requires: termcap
 Requires: glibc >= 2.3
 Requires: libtermcap
 %endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-server >= 3.23
 %endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 Requires: rh-postgresql >= 7
 Requires: rh-postgresql-server >= 7
@@ -268,7 +357,7 @@ console program.
 
 Summary: Bacula - The Network Backup Solution
 Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
 
 %description rescue
 Bacula - It comes by night and sucks the vital essence from your computers.
@@ -282,7 +371,7 @@ features that make it easy to find and recover lost or damaged files.
 Bacula source code has been released under the GPL version 2 license.
 
 This package installs scripts for disaster recovery and builds rescue 
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
 to build a boot floppy disk.
 
@@ -290,14 +379,20 @@ You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
 bacula-client package for your platform installed and configured before 
 installing this package.
 
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
 directory (this is done when the package is first installed), 
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
 directory. To make the bacula rescue disk run
 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
 information for this system run ./getdiskinfo again.
 
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile.  To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
 %package updatedb
 
 Summary: Bacula - The Network Backup Solution
@@ -356,7 +451,19 @@ Requires: libbonoboui >= 2.0
 Requires: GConf2
 Requires: freetype2
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 Requires: gtk2 >= 2.0
 Requires: libgnomeui >= 2.0
 Requires: glibc >= 2.3
@@ -429,6 +536,15 @@ patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
 %endif
 
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -464,12 +580,19 @@ cd src/filed
 strip static-bacula-fd
 cd ../../
 
+cd doc/latex
+make
+cd ../../
+
 %install
  
 cwd=${PWD}
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
 mkdir -p $RPM_BUILD_ROOT/etc/init.d
 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
 %if %{rh7}
 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
@@ -508,14 +631,11 @@ make \
         mtx-install
 cd ${cwd}
 
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
 mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
 
 # fixme - make installs the mysql scripts for sqlite build
 %if %{sqlite}
@@ -562,7 +682,7 @@ cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.ap
 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 %endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
@@ -613,6 +733,14 @@ cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/floppy/tomsrtbt/
 # install the updatedb scripts
 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
 
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -650,19 +778,24 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -687,7 +820,7 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 %pre mysql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -714,7 +847,7 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
@@ -738,10 +871,10 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -779,19 +912,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %{sqlite_bindir}/libsqlite.a
 %{sqlite_bindir}/sqlite.h
@@ -820,7 +958,7 @@ fi
 %pre sqlite
 # test for bacula database older than version 7
 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade will update a bacula database from version 7 to 8."
                echo "You appear to be running database version $DB_VER. You must first update"
@@ -846,7 +984,7 @@ fi
 
 # test for an existing database
 if [ -s %{working_dir}/bacula.db ]; then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        # check to see if we need to upgrade a 1.34 or lower database
        if [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade requires a database update to version 8. You appear to"
@@ -875,10 +1013,10 @@ else
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -916,19 +1054,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -953,7 +1096,7 @@ fi
 %pre postgresql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -975,17 +1118,17 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
        echo "Hmm, doesn't look like you have an existing database."
-       echo "Granting privileges for PostgreSQL user bacula..."
-       /etc/bacula/grant_postgresql_privileges
        echo "Creating PostgreSQL bacula database..."
        /etc/bacula/create_postgresql_database
        echo "Creating bacula tables..."
        /etc/bacula/make_postgresql_tables
+       echo "Granting privileges for PostgreSQL user bacula..."
+       /etc/bacula/grant_postgresql_privileges
 
 # check to see if we need to upgrade a 1.34 or lower database
 elif [ "$DB_VER" -lt "8" ]; then
@@ -999,7 +1142,7 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
        echo "The group %{daemon_group} has been added to %{groupfile}."
@@ -1023,7 +1166,8 @@ fi
 /etc/bacula/bconsole
 /etc/init.d/bacula-fd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /etc/logrotate.d/bacula
 
 %config(noreplace) /etc/bacula/bacula-fd.conf
@@ -1048,7 +1192,7 @@ fi
 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -1065,8 +1209,8 @@ fi
 
 %post rescue
 # link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
 
 # run getdiskinfo
 echo "Creating rescue files for this system..."
@@ -1114,7 +1258,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 %if ! %{rh7} && ! %{rh8}
 /usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
 /usr/share/pixmaps/bacula-tray-monitor.xpm
 /usr/share/applications/bacula-tray-monitor.desktop
 %endif
@@ -1128,6 +1272,41 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 
 %changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is 
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
 - update depkgs to 29Oct04
 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
index 84cca2904ab5b82226e3ae897d94dd0576527ce7..ec9992f77366fa9c98316b743fe01c401dc699ec 100755 (executable)
@@ -31,14 +31,14 @@ case "$1" in
        if [ "${DIR_GROUP}" != '' ]; then
          OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
        fi
-       echo -n "Starting the Bacula Director: "
+       echo -n "Starting Bacula Director services: "
        daemon @sbindir@/bacula-dir $2 ${OPTIONS} -c @sysconfdir@/bacula-dir.conf
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-dir
        ;;
     stop)
-       echo -n "Stopping the Director daemon: "
+       echo -n "Stopping Bacula Director services: "
        killproc @sbindir@/bacula-dir
        RETVAL=$?
        echo
index dc7bf27177f032a5a9ff8bd4c40b34b930a24ff1..9e7200832495b66085d38eecf610cd997de7fbf8 100755 (executable)
@@ -31,14 +31,14 @@ case "$1" in
        if [ "${FD_GROUP}" != '' ]; then
          OPTIONS="${OPTIONS} -g ${FD_GROUP}"
        fi
-       echo -n "Starting the Bacula File daemon: "
+       echo -n "Starting Bacula File services: "
        daemon @sbindir@/bacula-fd $2 ${OPTIONS} -c @sysconfdir@/bacula-fd.conf
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
        ;;
     stop)
-       echo -n "Stopping the Bacula File daemon: "
+       echo -n "Stopping Bacula File services: "
        killproc @sbindir@/bacula-fd
        RETVAL=$?
        echo
index cf8d1af373f6987193d5f129f7e3b46744a0766f..3bfd6ed02123ebd2154a8a7d66c019c02333e99f 100755 (executable)
@@ -32,14 +32,14 @@ case "$1" in
          OPTIONS="${OPTIONS} -g ${SD_GROUP}"
        fi
                                                                                      
-       echo -n "Starting the Bacula Storage daemon: "
+       echo -n "Starting Bacula Storage services: "
        daemon @sbindir@/bacula-sd $2 ${OPTIONS} -c @sysconfdir@/bacula-sd.conf
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd
        ;;
     stop)
-       echo -n "Stopping the Bacula Storage daemon: "
+       echo -n "Stopping Bacula Storage services: "
        killproc @sbindir@/bacula-sd
        RETVAL=$?
        echo
index 3e9abd6082debf681035c420487c4e97f0efee7f..3374e8d0a78bece689c60ed759a394913cdda4b4 100644 (file)
@@ -1,3 +1,6 @@
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
 # Platform Build Configuration
 
 # basic defines for every build
 %{?build_rh8:%define rh8 1}
 %define rh9 0
 %{?build_rh9:%define rh9 1}
-# Fedora Core build
+# Fedora Core build
 %define fc1 0
 %{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
 # Whitebox Enterprise build
-# this should also work for RHEL
 %define wb3 0
 %{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
 # SuSE build
-# this is known to build on SuSE 8.2 and 9.0
 %define su9 0
 %{?build_su9:%define su9 1}
 # Mandrake build
@@ -35,7 +49,7 @@
 %{?build_mdk:%define mdk 1}
 
 # test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
 %{error: You must specify a platform. Please examine the spec file.}
 exit 1
 %endif
@@ -44,6 +58,10 @@ exit 1
 # set for database support desired or define the build_xxx on the command line
 %define mysql 0
 %{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
 %define sqlite 0
 %{?build_sqlite:%define sqlite 1}
 %define postgresql 0
@@ -55,6 +73,33 @@ exit 1
 exit 1
 %endif
 
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -68,9 +113,9 @@ Source3: Release_Notes-%{version}-%{release}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://www.bacula.org/
 Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
 %if %{rh7}
 BuildRequires: libtermcap-devel
@@ -81,6 +126,8 @@ BuildRequires: ORBit-devel
 BuildRequires: bonobo-devel
 BuildRequires: GConf-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 %if %{su9}
 BuildRequires: termcap
@@ -96,6 +143,8 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: gconf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
 %if %{mdk}
 BuildRequires: libtermcap-devel
@@ -111,8 +160,25 @@ BuildRequires: libGConf2-devel
 BuildRequires: libstdc++-static-devel
 BuildRequires: glibc-static-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 BuildRequires: libtermcap-devel
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui-devel >= 2.0
@@ -125,12 +191,18 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: GConf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
 BuildRequires: mysql-devel >= 3.23
 %endif
 
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 BuildRequires: rh-postgresql-devel >= 7
 %endif
@@ -168,6 +240,7 @@ Requires: readline, ncurses, libstdc++, zlib
 %if %{sqlite}
 Conflicts: sqlite, sqlite-tools
 %endif
+
 %if %{rh7}
 Requires: glibc >= 2.2
 Requires: libtermcap
@@ -180,18 +253,34 @@ Requires: termcap
 Requires: glibc >= 2.3
 Requires: libtermcap
 %endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-server >= 3.23
 %endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 Requires: rh-postgresql >= 7
 Requires: rh-postgresql-server >= 7
@@ -268,7 +357,7 @@ console program.
 
 Summary: Bacula - The Network Backup Solution
 Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
 
 %description rescue
 Bacula - It comes by night and sucks the vital essence from your computers.
@@ -282,7 +371,7 @@ features that make it easy to find and recover lost or damaged files.
 Bacula source code has been released under the GPL version 2 license.
 
 This package installs scripts for disaster recovery and builds rescue 
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
 to build a boot floppy disk.
 
@@ -290,14 +379,20 @@ You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
 bacula-client package for your platform installed and configured before 
 installing this package.
 
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
 directory (this is done when the package is first installed), 
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
 directory. To make the bacula rescue disk run
 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
 information for this system run ./getdiskinfo again.
 
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile.  To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
 %package updatedb
 
 Summary: Bacula - The Network Backup Solution
@@ -356,7 +451,19 @@ Requires: libbonoboui >= 2.0
 Requires: GConf2
 Requires: freetype2
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 Requires: gtk2 >= 2.0
 Requires: libgnomeui >= 2.0
 Requires: glibc >= 2.3
@@ -429,6 +536,15 @@ patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
 %endif
 
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -464,12 +580,19 @@ cd src/filed
 strip static-bacula-fd
 cd ../../
 
+cd doc/latex
+make
+cd ../../
+
 %install
  
 cwd=${PWD}
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
 mkdir -p $RPM_BUILD_ROOT/etc/init.d
 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
 %if %{rh7}
 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
@@ -508,14 +631,11 @@ make \
         mtx-install
 cd ${cwd}
 
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
 mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
 
 # fixme - make installs the mysql scripts for sqlite build
 %if %{sqlite}
@@ -562,7 +682,7 @@ cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.ap
 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 %endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
@@ -613,6 +733,14 @@ cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/floppy/tomsrtbt/
 # install the updatedb scripts
 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
 
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -650,19 +778,24 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -687,7 +820,7 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 %pre mysql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -714,7 +847,7 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
@@ -738,10 +871,10 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -779,19 +912,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %{sqlite_bindir}/libsqlite.a
 %{sqlite_bindir}/sqlite.h
@@ -820,7 +958,7 @@ fi
 %pre sqlite
 # test for bacula database older than version 7
 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade will update a bacula database from version 7 to 8."
                echo "You appear to be running database version $DB_VER. You must first update"
@@ -846,7 +984,7 @@ fi
 
 # test for an existing database
 if [ -s %{working_dir}/bacula.db ]; then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        # check to see if we need to upgrade a 1.34 or lower database
        if [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade requires a database update to version 8. You appear to"
@@ -875,10 +1013,10 @@ else
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -916,19 +1054,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -953,7 +1096,7 @@ fi
 %pre postgresql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -975,17 +1118,17 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
        echo "Hmm, doesn't look like you have an existing database."
-       echo "Granting privileges for PostgreSQL user bacula..."
-       /etc/bacula/grant_postgresql_privileges
        echo "Creating PostgreSQL bacula database..."
        /etc/bacula/create_postgresql_database
        echo "Creating bacula tables..."
        /etc/bacula/make_postgresql_tables
+       echo "Granting privileges for PostgreSQL user bacula..."
+       /etc/bacula/grant_postgresql_privileges
 
 # check to see if we need to upgrade a 1.34 or lower database
 elif [ "$DB_VER" -lt "8" ]; then
@@ -999,7 +1142,7 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
        echo "The group %{daemon_group} has been added to %{groupfile}."
@@ -1023,7 +1166,8 @@ fi
 /etc/bacula/bconsole
 /etc/init.d/bacula-fd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /etc/logrotate.d/bacula
 
 %config(noreplace) /etc/bacula/bacula-fd.conf
@@ -1048,7 +1192,7 @@ fi
 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -1065,8 +1209,8 @@ fi
 
 %post rescue
 # link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
 
 # run getdiskinfo
 echo "Creating rescue files for this system..."
@@ -1114,7 +1258,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 %if ! %{rh7} && ! %{rh8}
 /usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
 /usr/share/pixmaps/bacula-tray-monitor.xpm
 /usr/share/applications/bacula-tray-monitor.desktop
 %endif
@@ -1128,6 +1272,41 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 
 %changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is 
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
 - update depkgs to 29Oct04
 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
index 6a6225fb962cf75a6073c6e917c0ace486ef94cc..9e54418e7c8b6295c8da5612318bfbfcdc48ce4a 100644 (file)
@@ -17,10 +17,10 @@ install-autostart: install-autostart-fd install-autostart-sd install-autostart-d
 
        
 install-autostart-fd:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-fd; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-fd; then \
           /sbin/chkconfig --del bacula-fd; \
        fi
-       @$(INSTALL_PROGRAM) -m 744 bacula-fd $(DESTDIR)/etc/rc.d/init.d/bacula-fd
+       @$(INSTALL_PROGRAM) -m 744 bacula-fd $(DESTDIR)/etc/init.d/bacula-fd
        # set symlinks for script at startup and shutdown
        @if test x$(DESTDIR) = x ; then \
           /sbin/chkconfig --add bacula-fd; \
@@ -28,10 +28,10 @@ install-autostart-fd:
 
 
 install-autostart-sd:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-sd; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-sd; then \
            /sbin/chkconfig --del bacula-sd; \
        fi
-       @$(INSTALL_PROGRAM) -m 744 bacula-sd  $(DESTDIR)/etc/rc.d/init.d/bacula-sd
+       @$(INSTALL_PROGRAM) -m 744 bacula-sd  $(DESTDIR)/etc/init.d/bacula-sd
        # set symlinks for script at startup and shutdown
        @if test x$(DESTDIR) = x ; then \
           /sbin/chkconfig --add bacula-sd; \
@@ -39,10 +39,10 @@ install-autostart-sd:
 
 
 install-autostart-dir:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-dir; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-dir; then \
            /sbin/chkconfig --del bacula-dir; \
        fi
-       @$(INSTALL_PROGRAM) -m 744 bacula-dir  $(DESTDIR)/etc/rc.d/init.d/bacula-dir
+       @$(INSTALL_PROGRAM) -m 744 bacula-dir  $(DESTDIR)/etc/init.d/bacula-dir
        # set symlinks for script at startup and shutdown
        @if test x$(DESTDIR) = x ; then \
           /sbin/chkconfig --add bacula-dir; \
@@ -54,23 +54,23 @@ uninstall: uninstall-autostart
 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
 
 uninstall-autostart-fd:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-fd; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-fd; then \
            /sbin/chkconfig --del bacula-fd; \
        fi
-       @rm -f  $(DESTDIR)/etc/rc.d/init.d/bacula-fd
+       @rm -f  $(DESTDIR)/etc/init.d/bacula-fd
 
 
 uninstall-autostart-sd:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-sd; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-sd; then \
            /sbin/chkconfig --del bacula-sd; \
        fi
-       @rm -f  $(DESTDIR)/etc/rc.d/init.d/bacula-sd
+       @rm -f  $(DESTDIR)/etc/init.d/bacula-sd
 
 uninstall-autostart-dir:
-       @if test x$(DESTDIR) = x -a  -f /etc/rc.d/init.d/bacula-dir; then \
+       @if test x$(DESTDIR) = x -a  -f /etc/init.d/bacula-dir; then \
            /sbin/chkconfig --del bacula-dir; \
        fi
-       @rm -f  $(DESTDIR)/etc/rc.d/init.d/bacula-dir
+       @rm -f  $(DESTDIR)/etc/init.d/bacula-dir
 
 clean:
        @rm -f 1 2 3
@@ -83,4 +83,3 @@ distclean: clean
 devclean: clean
        @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
        @rm -f bacula-sd bacula-fd bacula-dir
-
index 3e9abd6082debf681035c420487c4e97f0efee7f..3374e8d0a78bece689c60ed759a394913cdda4b4 100644 (file)
@@ -1,3 +1,6 @@
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
 # Platform Build Configuration
 
 # basic defines for every build
 %{?build_rh8:%define rh8 1}
 %define rh9 0
 %{?build_rh9:%define rh9 1}
-# Fedora Core build
+# Fedora Core build
 %define fc1 0
 %{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
 # Whitebox Enterprise build
-# this should also work for RHEL
 %define wb3 0
 %{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
 # SuSE build
-# this is known to build on SuSE 8.2 and 9.0
 %define su9 0
 %{?build_su9:%define su9 1}
 # Mandrake build
@@ -35,7 +49,7 @@
 %{?build_mdk:%define mdk 1}
 
 # test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
 %{error: You must specify a platform. Please examine the spec file.}
 exit 1
 %endif
@@ -44,6 +58,10 @@ exit 1
 # set for database support desired or define the build_xxx on the command line
 %define mysql 0
 %{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
 %define sqlite 0
 %{?build_sqlite:%define sqlite 1}
 %define postgresql 0
@@ -55,6 +73,33 @@ exit 1
 exit 1
 %endif
 
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -68,9 +113,9 @@ Source3: Release_Notes-%{version}-%{release}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://www.bacula.org/
 Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
 %if %{rh7}
 BuildRequires: libtermcap-devel
@@ -81,6 +126,8 @@ BuildRequires: ORBit-devel
 BuildRequires: bonobo-devel
 BuildRequires: GConf-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 %if %{su9}
 BuildRequires: termcap
@@ -96,6 +143,8 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: gconf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
 %if %{mdk}
 BuildRequires: libtermcap-devel
@@ -111,8 +160,25 @@ BuildRequires: libGConf2-devel
 BuildRequires: libstdc++-static-devel
 BuildRequires: glibc-static-devel
 BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 BuildRequires: libtermcap-devel
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui-devel >= 2.0
@@ -125,12 +191,18 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: GConf2-devel
 BuildRequires: linc-devel
 BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
 %endif
 
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
 BuildRequires: mysql-devel >= 3.23
 %endif
 
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 BuildRequires: rh-postgresql-devel >= 7
 %endif
@@ -168,6 +240,7 @@ Requires: readline, ncurses, libstdc++, zlib
 %if %{sqlite}
 Conflicts: sqlite, sqlite-tools
 %endif
+
 %if %{rh7}
 Requires: glibc >= 2.2
 Requires: libtermcap
@@ -180,18 +253,34 @@ Requires: termcap
 Requires: glibc >= 2.3
 Requires: libtermcap
 %endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-server >= 3.23
 %endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
 Requires: mysql >= 3.23
 Requires: mysql-client >= 3.23
 %endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
 %if %{postgresql} && %{wb3}
 Requires: rh-postgresql >= 7
 Requires: rh-postgresql-server >= 7
@@ -268,7 +357,7 @@ console program.
 
 Summary: Bacula - The Network Backup Solution
 Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
 
 %description rescue
 Bacula - It comes by night and sucks the vital essence from your computers.
@@ -282,7 +371,7 @@ features that make it easy to find and recover lost or damaged files.
 Bacula source code has been released under the GPL version 2 license.
 
 This package installs scripts for disaster recovery and builds rescue 
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
 to build a boot floppy disk.
 
@@ -290,14 +379,20 @@ You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
 bacula-client package for your platform installed and configured before 
 installing this package.
 
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
 directory (this is done when the package is first installed), 
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
 directory. To make the bacula rescue disk run
 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
 information for this system run ./getdiskinfo again.
 
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile.  To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
 %package updatedb
 
 Summary: Bacula - The Network Backup Solution
@@ -356,7 +451,19 @@ Requires: libbonoboui >= 2.0
 Requires: GConf2
 Requires: freetype2
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
 Requires: gtk2 >= 2.0
 Requires: libgnomeui >= 2.0
 Requires: glibc >= 2.3
@@ -429,6 +536,15 @@ patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
 %endif
 
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
 %configure \
         --prefix=/usr \
         --sbindir=/usr/sbin \
@@ -464,12 +580,19 @@ cd src/filed
 strip static-bacula-fd
 cd ../../
 
+cd doc/latex
+make
+cd ../../
+
 %install
  
 cwd=${PWD}
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
 mkdir -p $RPM_BUILD_ROOT/etc/init.d
 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
 %if %{rh7}
 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
@@ -508,14 +631,11 @@ make \
         mtx-install
 cd ${cwd}
 
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
 mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
 
 # fixme - make installs the mysql scripts for sqlite build
 %if %{sqlite}
@@ -562,7 +682,7 @@ cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.ap
 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 %endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
@@ -613,6 +733,14 @@ cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/floppy/tomsrtbt/
 # install the updatedb scripts
 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
 
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -650,19 +778,24 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -687,7 +820,7 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 %pre mysql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -714,7 +847,7 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
@@ -738,10 +871,10 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -779,19 +912,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %{sqlite_bindir}/libsqlite.a
 %{sqlite_bindir}/sqlite.h
@@ -820,7 +958,7 @@ fi
 %pre sqlite
 # test for bacula database older than version 7
 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade will update a bacula database from version 7 to 8."
                echo "You appear to be running database version $DB_VER. You must first update"
@@ -846,7 +984,7 @@ fi
 
 # test for an existing database
 if [ -s %{working_dir}/bacula.db ]; then
-       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+       DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
        # check to see if we need to upgrade a 1.34 or lower database
        if [ "$DB_VER" -lt "7" ]; then
                echo "This bacula upgrade requires a database update to version 8. You appear to"
@@ -875,10 +1013,10 @@ else
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -916,19 +1054,24 @@ fi
 /etc/bacula/mtx-changer
 /etc/bacula/btraceback.dbx
 /etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
 /etc/init.d/bacula-dir
 /etc/init.d/bacula-fd
 /etc/init.d/bacula-sd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /usr/man/man1/*
 
 /etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
 %config(noreplace) /etc/bacula/bacula-dir.conf
 %config(noreplace) /etc/bacula/bacula-fd.conf
 %config(noreplace) /etc/bacula/bacula-sd.conf
 %config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
 /etc/bacula/query.sql
 %dir %{working_dir}
 
@@ -953,7 +1096,7 @@ fi
 %pre postgresql
 # test for bacula database older than version 7
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
        echo "This bacula upgrade will update a bacula database from version 7 to 8."
@@ -975,17 +1118,17 @@ fi
 
 # test for an existing database
 # note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
 
 # grant privileges and create tables if they do not exist
 if [ -z "$DB_VER" ]; then
        echo "Hmm, doesn't look like you have an existing database."
-       echo "Granting privileges for PostgreSQL user bacula..."
-       /etc/bacula/grant_postgresql_privileges
        echo "Creating PostgreSQL bacula database..."
        /etc/bacula/create_postgresql_database
        echo "Creating bacula tables..."
        /etc/bacula/make_postgresql_tables
+       echo "Granting privileges for PostgreSQL user bacula..."
+       /etc/bacula/grant_postgresql_privileges
 
 # check to see if we need to upgrade a 1.34 or lower database
 elif [ "$DB_VER" -lt "8" ]; then
@@ -999,7 +1142,7 @@ elif [ "$DB_VER" -lt "8" ]; then
 fi
 
 # create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
        echo "The group %{daemon_group} has been added to %{groupfile}."
@@ -1023,7 +1166,8 @@ fi
 /etc/bacula/bconsole
 /etc/init.d/bacula-fd
 
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
 /etc/logrotate.d/bacula
 
 %config(noreplace) /etc/bacula/bacula-fd.conf
@@ -1048,7 +1192,7 @@ fi
 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
 if [ -z $HAVE_BACULA ]; then
        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-       echo "The group %{daemon_group} has been added to %{groupfile}."
+       echo "The group %{daemon_group} has been added to %{group_file}."
        echo "See the manual chapter Running Bacula for details."
 fi
 
@@ -1065,8 +1209,8 @@ fi
 
 %post rescue
 # link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
 
 # run getdiskinfo
 echo "Creating rescue files for this system..."
@@ -1114,7 +1258,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 %if ! %{rh7} && ! %{rh8}
 /usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
 /usr/share/pixmaps/bacula-tray-monitor.xpm
 /usr/share/applications/bacula-tray-monitor.desktop
 %endif
@@ -1128,6 +1272,41 @@ echo "The database update scripts were installed to /etc/bacula/updatedb"
 
 
 %changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is 
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
 - update depkgs to 29Oct04
 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
index 38362e56b4409a2379ba9c8586ea8e9be15d6b2f..b0dbddcbfc66a28630227071733cdef9839a9bf7 100644 (file)
@@ -1,4 +1,3 @@
-bacula-tray-monitor.desktop
 bacula-tray-monior.desktop
 .xvpics
 logrotate
index 3554e5ed656d991e87b91e0ed100b3e59476f5b6..96975173839526ee952c9520aec0fe9a553f16df 100755 (executable)
 
 PSCMD="@PSCMD@"
 
+#
+# On Solaris, you may need to use nawk, or alternatively,
+#  add the GNU binaries to your path, such as /usr/xpg4/bin
+#
+AWK=@AWK@
+
 # All these are not *really* needed but it makes it
 #  easier to "steal" this code for the development 
 #  environment where they are different.
@@ -35,6 +41,8 @@ FD_GROUP=@fd_group@
 SD_USER=@sd_user@
 SD_GROUP=@sd_group@
 
+PIDOF=@PIDOF@  
+
 # A function to stop a program.
 killproc() {
     RC=0
@@ -120,8 +128,8 @@ pidofproc() {
     fi
 
     # Next try "pidof"
-   if [ -x /sbin/pidof ] ; then
-       pid=`/sbin/pidof $1`
+   if [ -x ${PIDOF} ] ; then
+       pid=`${PIDOF} $1`
    fi
    if [ "$pid" != "" ] ; then
        echo $pid
@@ -129,11 +137,12 @@ pidofproc() {
    fi
 
     # Finally try to extract it from ps
-    ${PSCMD} | grep $1 | awk '{ print $1 }' | tr '\n' ' '
+    ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' '
     return 0
 }
 
 status() {
+    pid=""
     # Test syntax.
     if [ $# = 0 ] ; then
        echo "Usage: status {program}"
@@ -144,14 +153,14 @@ status() {
     base=`basename $1`
 
    # First try "pidof"
-   if [ -x /sbin/pidof ] ; then
-       pid=`/sbin/pidof $1`
+   if [ -x ${PIDOF} ] ; then
+       pid=`${PIDOF} $1`
    fi
    if [ "$pid" != "" ] ; then
        echo "$base (pid $pid) is running..."
        return 0
    else
-       pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } 
+       pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 } 
             { if ((prog == $2) || (("(" prog ")") == $2) ||
                  (("[" prog "]") == $2) ||
                  ((prog ":") == $2)) { print $1 ; exit 0 } }' $1`
index 656e8b31efaddb8d3bed126d691e8a397ba5c3e1..36e9eca8e16d9ad4af7454c4e615d09ae50992b7 100755 (executable)
@@ -9,7 +9,7 @@
 #  $2 = main pid of running program to be traced back.
 #
 PNAME=`basename $1`
-if test `uname -s` = SunOs ; then
+if test `uname -s` = SunOS ; then
   gcore -o @working_dir@/${PNAME} $2
   dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \
    | @sbindir@/bsmtp -h @smtp_host@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
diff --git a/bacula/scripts/logwatch/Makefile.in b/bacula/scripts/logwatch/Makefile.in
new file mode 100644 (file)
index 0000000..564e051
--- /dev/null
@@ -0,0 +1,18 @@
+# Makefile to install logwatch script
+# 08 Jan 2005 D. Scott Barninger
+
+SYSCONFDIR=/etc/log.d
+INSTALL=@INSTALL@
+
+all:   install
+
+install:
+
+       $(INSTALL) -m 755 bacula $(DESTDIR)$(SYSCONFDIR)/scripts/services/bacula
+       $(INSTALL) -m 644 logfile.bacula.conf $(DESTDIR)$(SYSCONFDIR)/conf/logfiles/bacula.conf
+       $(INSTALL) -m 644 services.bacula.conf $(DESTDIR)$(SYSCONFDIR)/conf/services/bacula.conf
+
+uninstall:
+       rm -f $(DESTDIR)$(SYSCONFDIR)/scripts/services/bacula
+       rm -f $(DESTDIR)$(SYSCONFDIR)/conf/logfiles/bacula.conf
+       rm -f $(DESTDIR)$(SYSCONFDIR)/conf/services/bacula.conf
diff --git a/bacula/scripts/logwatch/bacula b/bacula/scripts/logwatch/bacula
new file mode 100755 (executable)
index 0000000..d567576
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/perl -w
+#
+# logwatch filter script for bacula log files
+#
+# Mon Jan 03 2005
+# D. Scott Barninger and Karl Cunningham
+#
+# Copyright 2005 Kern Sibbald
+# licensed under GPL-v2
+
+use strict;
+use POSIX qw(strftime);
+
+my (@JobName,$JobStatus,$ThisName,$ThisStatus,$ThisDate,$SearchDate);
+my ($Job,$JobId,$JobDate,$Debug,$DebugCounter,%data,$time);
+
+# set the logwatch search date we want
+$time = time;
+
+if ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'yesterday') {
+   $SearchDate = strftime("%Y-%m-%d", localtime($time-86400));
+}
+elsif ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'today') {
+   $SearchDate = strftime("%Y-%m-%d", localtime($time));
+}
+
+# set debug level
+$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
+
+if ( $Debug >= 5 ) {
+       print STDERR "\n\nDEBUG: Inside Bacula Filter \n\n";
+       $DebugCounter = 1;
+}
+
+while (<STDIN>) {
+       chomp;
+       if ( $Debug >= 5 ) {
+               print STDERR "DEBUG($DebugCounter): $_\n";
+               $DebugCounter++;
+       }
+
+       # Test the line for a new entry, which is a jobid record
+       if (/^\s*JobId:\s+(\d+)/) {
+               # A new entry.  Test, then save the previous stuff and 
+               #  set up to grab more.
+               if ($JobId and $Job and $JobStatus and $JobDate) {
+                       $data{$JobId} = { 
+                               "Job" => $Job, 
+                               "JobStatus" => $JobStatus,
+                               "JobDate" => $JobDate,
+                       };
+                       $Job = $JobStatus = $JobDate = "";
+               }
+               $JobId = $1;
+               next;
+       }
+       (/^\s*Job:\s*(.*)/) and $Job = $1; 
+       (/^\s*Termination:\s*(.*)/) and $JobStatus = $1;
+       (/^\s*Job:.*(\d{4}-\d{2}-\d{2})/) and $JobDate = $1;
+}
+
+# if we have data print it out, otherwise do nothing
+if (scalar(keys(%data))) {
+       print "\nJobs Run:\n";
+       foreach my $Id (sort {$a<=>$b} (keys(%data))) {
+               $ThisName = $data{$Id}{Job};
+               $ThisStatus = $data{$Id}{JobStatus};
+               $ThisDate = $data{$Id}{JobDate};
+               $ThisName =~ s/\s//g;
+               $ThisStatus =~ s/\s//g;
+               if ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'all') {
+                       $SearchDate = $ThisDate;
+               }
+               if ($ThisDate eq $SearchDate) {
+                       print "$ThisDate $Id $ThisName\n     $ThisStatus\n\n";
+               }
+       }
+}
+
+exit(0);
+
+
diff --git a/bacula/scripts/logwatch/logfile.bacula.conf.in b/bacula/scripts/logwatch/logfile.bacula.conf.in
new file mode 100644 (file)
index 0000000..3eaf0e2
--- /dev/null
@@ -0,0 +1,3 @@
+# What actual file?  Defaults to LogPath if not absolute path....
+LogFile = @working_dir@/log
+
diff --git a/bacula/scripts/logwatch/services.bacula.conf b/bacula/scripts/logwatch/services.bacula.conf
new file mode 100644 (file)
index 0000000..298a3f8
--- /dev/null
@@ -0,0 +1,5 @@
+Title = "bacula"
+
+# Which logfile group...
+LogFile = bacula
+
index db85a20c197e9a70a160353f9210e163f03c1ed2..f9e5a7a611fd66b592b2085df4929945c2900109 100644 (file)
@@ -5,7 +5,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -55,7 +55,7 @@
 #endif
 
 /* Allow printing of NULL pointers */
-#define NPRT(x) (x)?(x):"*None*" 
+#define NPRT(x) (x)?(x):"*None*"
 
 #ifdef ENABLE_NLS
 #include <libintl.h>
@@ -76,7 +76,7 @@
 #define MAXSTRING 500
 
 /* Maximum length to edit time/date */
-#define MAX_TIME_LENGTH 50  
+#define MAX_TIME_LENGTH 50
 
 /* Maximum Name length including EOS */
 #define MAX_NAME_LENGTH 128
 
 /* All tape operations MUST be a multiple of this */
 #define TAPE_BSIZE 1024
-#if !defined(DEV_BSIZE) && defined(BSIZE)
-#define DEV_BSIZE BSIZE
+
+#ifdef DEV_BSIZE 
+#define B_DEV_BSIZE DEV_BSIZE
+#endif
+
+#if !defined(B_DEV_BSIZE) & defined(BSIZE)
+#define B_DEV_BSIZE BSIZE
 #endif
 
-#ifndef DEV_BSIZE
-#define DEV_BSIZE 512
+#ifndef B_DEV_BSIZE
+#define B_DEV_BSIZE 512
 #endif
 
 /*
 #define STREAM_WIN32_GZIP_DATA   12    /* Gzipped Win32 BackupRead data */
 #define STREAM_MACOS_FORK_DATA   13    /* Mac resource fork */
 #define STREAM_HFSPLUS_ATTRIBUTES 14   /* Mac OS extra attributes */
-#define STREAM_UNIX_ATTRIBUTES_ACL 15 /* ACL attributes on UNIX */
+/*** FIXME ***/
+#define STREAM_UNIX_ATTRIBUTES_ACCESS_ACL 15 /* Standard ACL attributes on UNIX */
+#define STREAM_UNIX_ATTRIBUTES_ACL 15 /* Standard ACL attributes on UNIX */
+#define STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL 16 /* Default ACL attributes on UNIX */
+/*** FIXME ***/
+
 
-/* 
- *  File type (Bacula defined).           
+/*
+ *  File type (Bacula defined).
  *  NOTE!!! These are saved in the Attributes record on the tape, so
  *          do not change them. If need be, add to them.
  *
  *    additional optional fields in the attribute record.
  */
 #define FT_MASK       0xFFFF          /* Bits used by FT (type) */
-#define FT_LNKSAVED   1               /* hard link to file already saved */  
+#define FT_LNKSAVED   1               /* hard link to file already saved */
 #define FT_REGE       2               /* Regular file but empty */
 #define FT_REG        3               /* Regular file */
 #define FT_LNK        4               /* Soft Link */
  * that it can filter packets, but otherwise, it is not used
  * or saved */
 #define FT_DIRBEGIN  18               /* Directory at beginning (not saved) */
+#define FT_INVALIDFS 19               /* File system not allowed for */
 
 /* Definitions for upper part of type word (see above). */
 #define AR_DATA_STREAM (1<<16)        /* Data stream id present */
 #define MD5_SIG  1
 #define SHA1_SIG 2
 
+/*
+ * Tape label types -- stored in catalog
+ */
+#define B_BACULA_LABEL 0
+#define B_ANSI_LABEL   1
+#define B_IBM_LABEL    2
+
 /* Size of File Address stored in STREAM_SPARSE_DATA. Do NOT change! */
 #define SPARSE_FADDR_SIZE (sizeof(uint64_t))
 
@@ -373,7 +391,7 @@ void b_memset(const char *file, int line, void *mem, int val, size_t num);
 #define Pmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
 #define Pmsg14(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)
 
-       
+
 /* Daemon Error Messages that are delivered according to the message resource */
 #define Emsg0(typ, lvl, msg)             e_msg(__FILE__, __LINE__, typ, lvl, msg)
 #define Emsg1(typ, lvl, msg, a1)         e_msg(__FILE__, __LINE__, typ, lvl, msg, a1)
@@ -453,12 +471,24 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 #define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
 #endif
 
+/* =============================================================
+ *               OS Dependent defines
+  * =============================================================
+   */
+
+#ifndef HAVE_FSEEKO
+/* Bad news. This OS cannot handle 64 bit fseeks and ftells */
+#define fseeko fseek
+#define ftello ftell
+#endif
+
+
 #ifdef __alpha__
 #define OSF 1
 #endif
 
 #ifdef HAVE_SUN_OS
-   /* 
+   /*
     * On Solaris 2.5, threads are not timesliced by default, so we need to
     * explictly increase the conncurrency level.
     */
@@ -478,9 +508,6 @@ extern int thr_setconcurrency(int);
 #ifdef HAVE_DARWIN_OS
 /* Apparently someone forgot to wrap getdomainname as a C function */
 extern "C" int getdomainname(char *name, int len);
-
-/* Darwin lib fnmatch() doesn't work, so use our own */
-#undef HAVE_FNMATCH
 #endif
 
 #ifdef HAVE_CYGWIN
@@ -502,7 +529,7 @@ extern "C" int getdomainname(char *name, int len);
 extern "C" int fchdir(int filedes);
 extern "C" long gethostid(void);
 #endif
+
 /* This probably should be done on a machine by machine basic, but it works */
 #define ALIGN_SIZE (sizeof(double))
 #define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
@@ -515,7 +542,7 @@ extern "C" long gethostid(void);
 
 /*
  * Replace codes needed in both file routines and non-file routines
- * Job replace codes -- in "replace"   
+ * Job replace codes -- in "replace"
  */
 #define REPLACE_ALWAYS   'a'
 #define REPLACE_IFNEWER  'w'
@@ -530,7 +557,7 @@ extern "C" long gethostid(void);
 #endif
 #ifdef HAVE_NL_LANGINFO
 #include <langinfo.h>
-#else 
+#else
 #define nl_langinfo(x) ("ANSI_X3.4-1968")
 #endif
 
index 3c5fc9aaba11948c37296c9776ad0c45b2f8780a..6db7b19d75945034d4a25ae5c7e271bba5324901 100644 (file)
@@ -23,6 +23,7 @@ DROP TABLE IF EXISTS Counters;
 DROP TABLE IF EXISTS BaseFiles;
 DROP TABLE IF EXISTS UnsavedFiles;
 DROP TABLE IF EXISTS CDImages;
+DROP TABLE IF EXISTS Status;
 END-OF-DATA
 then
    echo "Deletion of Bacula MySQL tables succeeded."
index 3f292ea447f88460950f1f0e0e00552adaf861c0..2bbd71b2473dc0262a2977d8e04fbda845d45c04 100644 (file)
@@ -10,14 +10,14 @@ CREATE TABLE Filename (
   FilenameId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
   Name BLOB NOT NULL,
   PRIMARY KEY(FilenameId),
-  INDEX (Name(30))
+  INDEX (Name(255))
   );
 
 CREATE TABLE Path (
    PathId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    Path BLOB NOT NULL,
    PRIMARY KEY(PathId),
-   INDEX (Path(50))
+   INDEX (Path(255))
    );
 
 
@@ -32,7 +32,7 @@ CREATE TABLE File (
    LStat TINYBLOB NOT NULL,
    MD5 TINYBLOB NOT NULL,
    PRIMARY KEY(FileId),
-   INDEX (FilenameId, PathId)
+   INDEX (JobId, PathId, FilenameId)
    );
 
 #
@@ -43,7 +43,7 @@ CREATE TABLE File (
 #  INDEX (JobId),
 #  INDEX (PathId),
 #  INDEX (FilenameId),
-#  INDEX (JobId, PathId, FilenameId)
+#  INDEX (FilenameId, PathId)
 #
 
 CREATE TABLE Job (
index 48dfb254ef90937b664dae70214a962871239883..d2d73c998d378eaef1cc0bdbf0b6ce4fe0918425 100644 (file)
@@ -389,7 +389,8 @@ db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
 {
    if (mr->InChanger != 0 && mr->Slot != 0) {
       Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
-           "Slot=%d AND MediaId!=%u", mr->Slot, mr->MediaId);
+           "Slot=%d AND PoolId=%u AND MediaId!=%u", 
+           mr->Slot, mr->PoolId, mr->MediaId);
       Dmsg1(400, "%s\n", mdb->cmd);
       UPDATE_DB(jcr, mdb, mdb->cmd);
    }
index 889400b0a90313e0df48a0e33c574d4aed64f49c..94ffeaea1c820688f1e09a3c3536a67baa0c8407 100755 (executable)
@@ -1,12 +1,12 @@
-/*       
-      Generalized console input/output handler                    
+/*
+      Generalized console input/output handler
       A maintanable replacement for readline()
 
         Updated for Bacula, Kern Sibbald, December MMIII
 
       This code is in part derived from code that I wrote in
       1981, so some of it is a bit old and could use a cleanup.
-        
+
 */
 /*
    Copyright (C) 1981-2004 Kern Sibbald and John Walker
@@ -29,7 +29,7 @@
 
  */
 
-/* 
+/*
  * UTF-8
  *  If the top bit of a UTF-8 string is 0 (8 bits), then it
  *    is a normal ASCII character.
@@ -45,7 +45,7 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <string.h>
-#include <ctype.h> 
+#include <ctype.h>
 #else
 
 /* We are in Bacula */
@@ -59,6 +59,8 @@ extern "C" int tgetent(void *, const char *);
 extern "C" int tgetnum(const char *);
 extern "C" char *tgetstr (const char*, char**);
 extern "C" char *tgoto (const char *, int, int);
+#elif HAVE_HPUX_OS
+#include <term.h>
 #else
 #include <termcap.h>
 #endif
@@ -66,8 +68,13 @@ extern "C" char *tgoto (const char *, int, int);
 
 
 /* From termios library */
+#ifdef HAVE_HPUX_OS
+static char *BC;
+static char *UP;
+#else
 extern char *BC;
 extern char *UP;
+#endif
 
 /* Forward referenced functions */
 extern "C" {
@@ -243,10 +250,10 @@ void con_term();
 void trapctlc();
 int usrbrk();
 void clrbrk();
-    
+
 void con_init(FILE *input)
 {
-   atexit(con_term); 
+   atexit(con_term);
    rawmode(input);
    trapctlc();
 }
@@ -313,7 +320,7 @@ char *bstrncpy(char *dest, const char *src, int maxlen)
 static unsigned do_smap(unsigned c)
 {
     char str[MAX_STAB];
-    int len = 0; 
+    int len = 0;
     stab_t *tstab;
     int i, found;
     unsigned cm;
@@ -384,7 +391,7 @@ static void add_smap(char *str, int func)
 {
    stab_t *tstab;
    int len;
-  
+
    if (!str) {
       return;
    }
@@ -405,7 +412,7 @@ static void add_smap(char *str, int func)
    }
    tstab->next = stab[tstab->len-1];
    stab[tstab->len-1] = tstab;
-/* printf("Add_smap tstab=%x len=%d func=%d tstab->next=%x\n\r", tstab, len, 
+/* printf("Add_smap tstab=%x len=%d func=%d tstab->next=%x\n\r", tstab, len,
          func, tstab->next); */
 
 }
@@ -582,7 +589,7 @@ input_line(char *string, int length)
               curline[cp++] = c;    /* store character in line being built */
               t_char(c);      /* echo character to terminal */
               while (more--) {
-                 c= input_char();  
+                 c= input_char();
                  insert_hole(curline, sizeof(curline));
                  curline[cp++] = c;    /* store character in line being built */
                  t_char(c);      /* echo character to terminal */
@@ -670,7 +677,7 @@ forward(char *str, int str_len)
 }
 
 /* How many characters under the cursor */
-static int 
+static int
 char_count(int cptr, char *str)
 {
    int cnt = 1;
@@ -689,7 +696,7 @@ char_count(int cptr, char *str)
 
 /* Backup cursor keeping characters under it */
 static void
-backup(char *str) 
+backup(char *str)
 {
     if (cp == 0) {
        return;
@@ -703,7 +710,7 @@ backup(char *str)
 
 /* Delete the character under the cursor */
 static void
-delchr(int del, char *curline, int line_len) 
+delchr(int del, char *curline, int line_len)
 {
    int i, cnt;
 
@@ -906,7 +913,7 @@ t_clrline(int pos, int width)
     asclrl(pos, width);          /* clear to end of line */
 }
 
-/* Helper function to add string preceded by 
+/* Helper function to add string preceded by
  *  ESC to smap table */
 static void add_esc_smap(const char *str, int func)
 {
@@ -936,11 +943,11 @@ static void rawmode(FILE *input)
       exit(1);
    }
    old_term_params_set = true;
-   t = old_term_params;                        
+   t = old_term_params;
    t.c_cc[VMIN] = 1; /* satisfy read after 1 char */
    t.c_cc[VTIME] = 0;
-   t.c_iflag &= ~(BRKINT | IGNPAR | PARMRK | INPCK | 
-                 ISTRIP | ICRNL | IXON | IXOFF | INLCR | IGNCR);     
+   t.c_iflag &= ~(BRKINT | IGNPAR | PARMRK | INPCK |
+                 ISTRIP | ICRNL | IXON | IXOFF | INLCR | IGNCR);
    t.c_iflag |= IGNBRK;
    t.c_oflag |= ONLCR;
    t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON |
@@ -955,7 +962,7 @@ static void rawmode(FILE *input)
    signal(SIGHUP, SIG_IGN);
 // signal(SIGSTOP, SIG_IGN);
    signal(SIGINT, sigintcatcher);
-   signal(SIGWINCH, SIG_IGN);  
+   signal(SIGWINCH, SIG_IGN);
    signal(SIGQUIT, SIG_IGN);
    signal(SIGCHLD, SIG_IGN);
 // signal(SIGTSTP, SIG_IGN);
@@ -1054,9 +1061,9 @@ static unsigned t_getch(void)
    if (read(0, &c, 1) != 1) {
       c = 0;
    }
-   return (unsigned)c;  
+   return (unsigned)c;
 }
-    
+
 /* Send message to terminal - primitive routine */
 void
 t_sendl(const char *msg, int len)
@@ -1116,7 +1123,7 @@ void trapctlc()
 
 
 /* ASCLRL() -- Clear to end of line from current position */
-static void asclrl(int pos, int width) 
+static void asclrl(int pos, int width)
 {
    int i;
 
@@ -1134,7 +1141,7 @@ static void asclrl(int pos, int width)
    for (i=1; i<=width-pos+1; i++)    /* backspace to original position */
        t_char(0x8);
    return;
-  
+
 }
 
 
@@ -1143,10 +1150,10 @@ static void ascurs(int y, int x)
 {
    t_send((char *)tgoto(t_cm, x, y));
 }
-                                                                                       
+
 
 /* ASCLRS -- Clear whole screen */
-static void asclrs() 
+static void asclrs()
 {
    ascurs(0,0);
    t_send(t_cs);
index 73989938d30c6bd1d590a448e4e7d6bfbad39710..8bf17863fddfe593a5203ede959622668b60f0ab 100644 (file)
 #ifdef HAVE_CONIO
 #include "conio.h"
 #else
-#define con_init(x) 
+#define con_init(x)
 #define con_term()
 #define con_set_zed_keys();
 #define trapctlc()
 #define clrbrk()
-#define usrbrk() 0  
+#define usrbrk() 0
 #endif
 
 #ifdef HAVE_WIN32
@@ -47,7 +47,7 @@
 #define isatty(fd) (fd==0)
 DWORD  g_platform_id = VER_PLATFORM_WIN32_WINDOWS;
 #endif
+
 /* Exported variables */
 
 #ifdef HAVE_CYGWIN
@@ -77,7 +77,7 @@ extern "C" void got_sigtin(int sig);
 /* Static variables */
 static char *configfile = NULL;
 static BSOCK *UA_sock = NULL;
-static DIRRES *dir; 
+static DIRRES *dir;
 static FILE *output = stdout;
 static bool tee = false;                 /* output to output and stdout */
 static bool stop = false;
@@ -109,32 +109,32 @@ static void usage()
 "       -dnn        set debug level to nn\n"
 "       -s          no signals\n"
 "       -t          test - read configuration and exit\n"
-"       -?          print this message.\n"  
+"       -?          print this message.\n"
 "\n"), HOST_OS, DISTNAME, DISTVER);
 }
 
 
-extern "C" 
+extern "C"
 void got_sigstop(int sig)
 {
    stop = true;
 }
 
-extern "C" 
+extern "C"
 void got_sigcontinue(int sig)
 {
    stop = false;
 }
 
-extern "C" 
-void got_sigtout(int sig) 
+extern "C"
+void got_sigtout(int sig)
 {
 // printf("Got tout\n");
 }
 
-extern "C" 
+extern "C"
 void got_sigtin(int sig)
-{   
+{
 // printf("Got tin\n");
 }
 
@@ -148,7 +148,7 @@ static int zed_keyscmd(FILE *input, BSOCK *UA_sock)
 /*
  * These are the @command
  */
-struct cmdstruct { const char *key; int (*func)(FILE *input, BSOCK *UA_sock); const char *help; }; 
+struct cmdstruct { const char *key; int (*func)(FILE *input, BSOCK *UA_sock); const char *help; };
 static struct cmdstruct commands[] = {
  { N_("input"),      inputcmd,     _("input from file")},
  { N_("output"),     outputcmd,    _("output to file")},
@@ -199,14 +199,14 @@ static int do_a_command(FILE *input, BSOCK *UA_sock)
 }
 
 
-static void read_and_process_input(FILE *input, BSOCK *UA_sock) 
+static void read_and_process_input(FILE *input, BSOCK *UA_sock)
 {
    const char *prompt = "*";
    bool at_prompt = false;
    int tty_input = isatty(fileno(input));
    int stat;
 
-   for ( ;; ) { 
+   for ( ;; ) {
       if (at_prompt) {                /* don't prompt multiple times */
          prompt = "";
       } else {
@@ -342,7 +342,7 @@ int main(int argc, char *argv[])
         usage();
         con_term();
         exit(1);
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -382,8 +382,8 @@ int main(int argc, char *argv[])
    UnlockRes();
    if (ndir == 0) {
       con_term();
-      Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s\n\
-Without that I don't how to speak to the Director :-(\n"), configfile);
+      Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s\n"
+"Without that I don't how to speak to the Director :-(\n"), configfile);
    }
 
    if (test_config) {
@@ -429,9 +429,9 @@ try_again:
       dir = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
       UnlockRes();
    }
-      
+
    senditf(_("Connecting to Director %s:%d\n"), dir->address,dir->DIRport);
-   UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address, 
+   UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
                          NULL, dir->DIRport, 0);
    if (UA_sock == NULL) {
       terminate_console(0);
@@ -504,7 +504,7 @@ static void terminate_console(int sig)
 #include "history.h"
 
 
-int 
+int
 get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec)
 {
    char *line;
@@ -559,17 +559,17 @@ wait_for_data(int fd, int sec)
    }
 }
 
-/*     
- * Get next input command from terminal. 
+/*
+ * Get next input command from terminal.
  *
  *   Returns: 1 if got input
  *           0 if timeout
  *          -1 if EOF or error
  */
-int 
+int
 get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec)
 {
-   int len;  
+   int len;
    if (!stop) {
       if (output == stdout || tee) {
         sendit(prompt);
@@ -579,7 +579,7 @@ again:
    switch (wait_for_data(fileno(input), sec)) {
    case 0:
       return 0;                   /* timeout */
-   case -1: 
+   case -1:
       return -1;                  /* error */
    default:
       len = sizeof_pool_memory(sock->msg) - 1;
@@ -629,9 +629,9 @@ static int inputcmd(FILE *input, BSOCK *UA_sock)
    }
    fd = fopen(argk[1], "r");
    if (!fd) {
-      senditf(_("Cannot open file %s for input. ERR=%s\n"), 
+      senditf(_("Cannot open file %s for input. ERR=%s\n"),
         argk[1], strerror(errno));
-      return 1; 
+      return 1;
    }
    read_and_process_input(fd, UA_sock);
    fclose(fd);
@@ -675,9 +675,9 @@ static int do_outputcmd(FILE *input, BSOCK *UA_sock)
    }
    fd = fopen(argk[1], mode);
    if (!fd) {
-      senditf(_("Cannot open file %s for output. ERR=%s\n"), 
+      senditf(_("Cannot open file %s for output. ERR=%s\n"),
         argk[1], strerror(errno));
-      return 1; 
+      return 1;
    }
    output = fd;
    return 1;
@@ -726,10 +726,10 @@ void sendit(const char *buf)
 {
 #ifdef xHAVE_CONIO
     if (output == stdout || tee) {
-       char *p, *q;    
+       char *p, *q;
        /*
         * Here, we convert every \n into \r\n because the
-       *  terminal is in raw mode when we are using 
+       *  terminal is in raw mode when we are using
        *  conio.
        */
        for (p=q=buf; (p=strchr(q, '\n')); ) {
@@ -748,10 +748,11 @@ void sendit(const char *buf)
     }
 #else
     fputs(buf, output);
+    fflush(output);
     if (tee) {
        fputs(buf, stdout);
     }
-    if (output == stdout || tee) {
+    if (output != stdout || tee) {
        fflush(stdout);
     }
 #endif
index b26ae18c9480158732bd6968ec79400eabd989c8..f85636ef4ae15cc400470c7e4f4113188fdb0496 100644 (file)
@@ -40,11 +40,11 @@ static void admin_cleanup(JCR *jcr, int TermCode);
 
 /* External functions */
 
-/* 
+/*
  *  Returns:  0 on failure
  *           1 on success
  */
-int do_admin(JCR *jcr) 
+int do_admin(JCR *jcr)
 {
 
    jcr->jr.JobId = jcr->JobId;
@@ -76,9 +76,9 @@ static void admin_cleanup(JCR *jcr, int TermCode)
    set_jcr_job_status(jcr, TermCode);
 
    update_job_end_record(jcr);       /* update database */
-   
+
    if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) {
-      Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"), 
+      Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"),
         db_strerror(jcr->db));
       set_jcr_job_status(jcr, JS_ErrorTerminated);
    }
@@ -90,7 +90,7 @@ static void admin_cleanup(JCR *jcr, int TermCode)
       break;
    case JS_FatalError:
    case JS_ErrorTerminated:
-      term_msg = _("*** Admin Error ***"); 
+      term_msg = _("*** Admin Error ***");
       msg_type = M_ERROR;         /* Generate error message */
       break;
    case JS_Canceled:
@@ -104,12 +104,12 @@ static void admin_cleanup(JCR *jcr, int TermCode)
    bstrftime(sdt, sizeof(sdt), jcr->jr.StartTime);
    bstrftime(edt, sizeof(edt), jcr->jr.EndTime);
 
-   Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\
-  JobId:                  %d\n\
-  Job:                    %s\n\
-  Start time:             %s\n\
-  End time:               %s\n\
-  Termination:            %s\n\n"),
+   Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+"  JobId:                  %d\n"
+"  Job:                    %s\n"
+"  Start time:             %s\n"
+"  End time:               %s\n"
+"  Termination:            %s\n\n"),
        edt,
        jcr->jr.JobId,
        jcr->jr.Job,
@@ -118,4 +118,4 @@ static void admin_cleanup(JCR *jcr, int TermCode)
        term_msg);
 
    Dmsg0(100, "Leave admin_cleanup()\n");
-}   
+}
index b889e5e8b9ab50f923cde27e155bd118901b961a..4ad863a3eac2c5b89e540747427f311be4ff03c6 100644 (file)
@@ -85,8 +85,10 @@ bool authenticate_storage_daemon(JCR *jcr, STORE *store)
       stop_bsock_timer(tid);
       Dmsg0(50, _("Director and Storage daemon passwords or names not the same.\n"));
       Jmsg0(jcr, M_FATAL, 0,
-            _("Director and Storage daemon passwords or names not the same or\n"
-            "you have exceeded the Maximum Concurrent Jobs on the SD.\n"
+            _("Unable to authenticate with Storage daemon. Possible causes:\n"
+            "Passwords or names not the same or\n"
+            "Maximum Concurrent Jobs exceeded on the SD or\n"
+            "SD networking messed up (restart daemon).\n"
             "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       return 0;
    }
@@ -142,8 +144,10 @@ int authenticate_file_daemon(JCR *jcr)
       stop_bsock_timer(tid);
       Dmsg0(50, _("Director and File daemon passwords or names not the same.\n"));
       Jmsg(jcr, M_FATAL, 0,
-           _("Director and File daemon passwords or names not the same or\n"   
-            "you have exceeded the Maximum Concurrent Jobs on the FD.\n"
+            _("Unable to authenticate with File daemon. Possible causes:\n"
+            "Passwords or names not the same or\n"
+            "Maximum Concurrent Jobs exceeded on the FD or\n"
+            "FD networking messed up (restart daemon).\n"
             "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       return 0;
    }
index 9f74f27d37ad1e60f7665adab6198823cb2f6444..61642e1dcaedb3ca3c41d38249d66e0003cd1976 100644 (file)
@@ -372,6 +372,7 @@ void reload_config(int sig)
    JCR *jcr;
    int njobs = 0;                    /* number of running jobs */
    int table, rtable;
+   bool ok;      
 
    if (already_here) {
       abort();                       /* Oops, recursion -> die */
@@ -396,16 +397,17 @@ void reload_config(int sig)
    reload_table[table].res_table = save_config_resources();
    Dmsg1(100, "Saved old config in table %d\n", table);
 
-   parse_config(configfile);
+   ok = parse_config(configfile, 0);  /* no exit on error */
 
    Dmsg0(100, "Reloaded config file\n");
-   if (!check_resources()) {
+   if (!ok || !check_resources()) {
       rtable = find_free_reload_table_entry();   /* save new, bad table */
       if (rtable < 0) {
          Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
          Jmsg(NULL, M_ERROR_TERM, 0, _("Out of reload table entries. Giving up.\n"));
       } else {
          Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
+         Jmsg(NULL, M_ERROR, 0, _("Resetting previous configuration.\n"));
       }
       reload_table[rtable].res_table = save_config_resources();
       /* Now restore old resoure values */
@@ -465,8 +467,8 @@ static int check_resources()
    job = (JOB *)GetNextRes(R_JOB, NULL);
    director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
    if (!director) {
-      Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n\
-Without that I don't know who I am :-(\n"), configfile);
+      Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n"
+"Without that I don't know who I am :-(\n"), configfile);
       OK = false;
    } else {
       set_working_directory(director->working_directory);
index 37136a123a8548d300ea6e1ded30c5febe935603..f60431499a5eecc95395b20fcc8f576884af0bbe 100644 (file)
@@ -45,3 +45,4 @@ extern int SDConnectTimeout;
 
 /* From job.c */
 void dird_free_jcr(JCR *jcr);
+void dird_free_jcr_pointers(JCR *jcr);
index 33ed9bee98594d0630b776c45d714af6c15c011b..e72a9a892661f3d3762a3b16f21725fd59ee7c87 100644 (file)
@@ -8,21 +8,21 @@
  *   1. The generic lexical scanner in lib/lex.c and lib/lex.h
  *
  *   2. The generic config  scanner in lib/parse_config.c and 
- *     lib/parse_config.h.
- *     These files contain the parser code, some utility
- *     routines, and the common store routines (name, int,
- *     string).
+ *      lib/parse_config.h.
+ *      These files contain the parser code, some utility
+ *      routines, and the common store routines (name, int,
+ *      string).
  *
  *   3. The daemon specific file, which contains the Resource
- *     definitions as well as any specific store routines
- *     for the resource records.
+ *      definitions as well as any specific store routines
+ *      for the resource records.
  *
  *     Kern Sibbald, January MM
  *
  *     Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -83,7 +83,7 @@ int  res_all_size = sizeof(res_all);
 /* 
  *    Director Resource
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM dir_items[] = {
    {"name",        store_name,     ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0},
@@ -108,7 +108,7 @@ static RES_ITEM dir_items[] = {
 /* 
  *    Console Resource
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM con_items[] = {
    {"name",        store_name,     ITEM(res_con.hdr.name), 0, ITEM_REQUIRED, 0},
@@ -131,7 +131,7 @@ static RES_ITEM con_items[] = {
 /* 
  *    Client or File daemon resource
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 
 static RES_ITEM cli_items[] = {
@@ -153,7 +153,7 @@ static RES_ITEM cli_items[] = {
 
 /* Storage daemon resource
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM store_items[] = {
    {"name",        store_name,     ITEM(res_store.hdr.name),   0, ITEM_REQUIRED, 0},
@@ -176,7 +176,7 @@ static RES_ITEM store_items[] = {
 /* 
  *    Catalog Resource Directives
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM cat_items[] = {
    {"name",     store_name,     ITEM(res_cat.hdr.name),    0, ITEM_REQUIRED, 0},
@@ -190,6 +190,7 @@ static RES_ITEM cat_items[] = {
    {"user",     store_str,      ITEM(res_cat.db_user),     0, 0, 0},
    {"dbname",   store_str,      ITEM(res_cat.db_name),     0, ITEM_REQUIRED, 0},
    {"dbsocket", store_str,      ITEM(res_cat.db_socket),   0, 0, 0}, 
+   /* Turned off for the moment */
    {"multipleconnections", store_yesno, ITEM(res_cat.mult_db_connections), 0, 0, 0},
    {NULL, NULL, NULL, 0, 0, 0} 
 };
@@ -197,7 +198,7 @@ static RES_ITEM cat_items[] = {
 /* 
  *    Job Resource Directives
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 RES_ITEM job_items[] = {
    {"name",      store_name,    ITEM(res_job.hdr.name), 0, ITEM_REQUIRED, 0},
@@ -245,7 +246,7 @@ RES_ITEM job_items[] = {
 
 /* FileSet resource
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM fs_items[] = {
    {"name",        store_name, ITEM(res_fs.hdr.name), 0, ITEM_REQUIRED, 0},
@@ -253,13 +254,13 @@ static RES_ITEM fs_items[] = {
    {"include",     store_inc,  NULL,                  0, ITEM_NO_EQUALS, 0},
    {"exclude",     store_inc,  NULL,                  1, ITEM_NO_EQUALS, 0},
    {"ignorefilesetchanges", store_yesno, ITEM(res_fs.ignore_fs_changes), 1, ITEM_DEFAULT, 0},
-   {NULL,         NULL,       NULL,                  0, 0, 0} 
+   {NULL,          NULL,       NULL,                  0, 0, 0} 
 };
 
 /* Schedule -- see run_conf.c */
 /* Schedule
  *
- *   name         handler     value                 code flags    default_value
+ *   name          handler     value                 code flags    default_value
  */
 static RES_ITEM sch_items[] = {
    {"name",     store_name,  ITEM(res_sch.hdr.name), 0, ITEM_REQUIRED, 0},
@@ -270,7 +271,7 @@ static RES_ITEM sch_items[] = {
 
 /* Pool resource
  *
- *   name            handler     value                        code flags default_value
+ *   name             handler     value                        code flags default_value
  */
 static RES_ITEM pool_items[] = {
    {"name",            store_name,    ITEM(res_pool.hdr.name),      0, ITEM_REQUIRED, 0},
@@ -298,7 +299,7 @@ static RES_ITEM pool_items[] = {
 
 /* 
  * Counter Resource
- *   name            handler     value                        code flags default_value
+ *   name             handler     value                        code flags default_value
  */
 static RES_ITEM counter_items[] = {
    {"name",            store_name,    ITEM(res_counter.hdr.name),        0, ITEM_REQUIRED, 0},
@@ -321,7 +322,7 @@ extern RES_ITEM msgs_items[];
  *  NOTE!!! keep it in the same order as the R_codes
  *    or eliminate all resources[rindex].name
  *
- *  name            items        rcode        res_head
+ *  name             items        rcode        res_head
  */
 RES_TABLE resources[] = {
    {"director",      dir_items,   R_DIRECTOR},
@@ -336,13 +337,13 @@ RES_TABLE resources[] = {
    {"counter",       counter_items, R_COUNTER},
    {"console",       con_items,   R_CONSOLE},
    {"jobdefs",       job_items,   R_JOBDEFS},
-   {NULL,           NULL,        0}
+   {NULL,            NULL,        0}
 };
 
 
 /* Keywords (RHS) permitted in Job Level records   
  *
- *   level_name      level             job_type
+ *   level_name      level              job_type
  */
 struct s_jl joblevels[] = {
    {"Full",          L_FULL,            JT_BACKUP},
@@ -357,19 +358,19 @@ struct s_jl joblevels[] = {
    {"Data",          L_VERIFY_DATA,     JT_VERIFY},
    {" ",             L_NONE,            JT_ADMIN},
    {" ",             L_NONE,            JT_RESTORE},
-   {NULL,           0,                          0}
+   {NULL,            0,                          0}
 };
 
 /* Keywords (RHS) permitted in Job type records   
  *
- *   type_name      job_type
+ *   type_name       job_type
  */
 struct s_jt jobtypes[] = {
    {"backup",        JT_BACKUP},
    {"admin",         JT_ADMIN},
    {"verify",        JT_VERIFY},
    {"restore",       JT_RESTORE},
-   {NULL,           0}
+   {NULL,            0}
 };
 
 #ifdef old_deprecated_code
@@ -379,7 +380,7 @@ static struct s_kw BakVerFields[] = {
    {"client",        'C'},
    {"fileset",       'F'},
    {"level",         'L'}, 
-   {NULL,           0}
+   {NULL,            0}
 };
 
 /* Keywords (RHS) permitted in Restore records */
@@ -390,7 +391,7 @@ static struct s_kw RestoreFields[] = {
    {"where",         'W'},            /* root of restore */
    {"replace",       'R'},            /* replacement options */
    {"bootstrap",     'B'},            /* bootstrap file */
-   {NULL,             0}
+   {NULL,              0}
 };
 #endif
 
@@ -400,7 +401,7 @@ struct s_kw ReplaceOptions[] = {
    {"ifnewer",        REPLACE_IFNEWER},
    {"ifolder",        REPLACE_IFOLDER},
    {"never",          REPLACE_NEVER},
-   {NULL,              0}
+   {NULL,               0}
 };
 
 const char *level_to_str(int level)
@@ -412,8 +413,8 @@ const char *level_to_str(int level)
    bsnprintf(level_no, sizeof(level_no), "%d", level);    /* default if not found */
    for (i=0; joblevels[i].level_name; i++) {
       if (level == joblevels[i].level) {
-        str = joblevels[i].level_name;
-        break;
+         str = joblevels[i].level_name;
+         break;
       }
    }
    return str;
@@ -430,93 +431,93 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       sendit(sock, "No %s resource defined\n", res_to_str(type));
       return;
    }
-   if (type < 0) {                   /* no recursion */
+   if (type < 0) {                    /* no recursion */
       type = - type;
       recurse = false;
    }
    switch (type) {
    case R_DIRECTOR:
       sendit(sock, "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n", 
-        reshdr->name, res->res_dir.MaxConcurrentJobs, 
-        edit_uint64(res->res_dir.FDConnectTimeout, ed1),
-        edit_uint64(res->res_dir.SDConnectTimeout, ed2));
+         reshdr->name, res->res_dir.MaxConcurrentJobs, 
+         edit_uint64(res->res_dir.FDConnectTimeout, ed1),
+         edit_uint64(res->res_dir.SDConnectTimeout, ed2));
       if (res->res_dir.query_file) {
          sendit(sock, "   query_file=%s\n", res->res_dir.query_file);
       }
       if (res->res_dir.messages) {
          sendit(sock, "  --> ");
-        dump_resource(-R_MSGS, (RES *)res->res_dir.messages, sendit, sock);
+         dump_resource(-R_MSGS, (RES *)res->res_dir.messages, sendit, sock);
       }
       break;
    case R_CONSOLE:
       sendit(sock, "Console: name=%s SSL=%d\n", 
-        res->res_con.hdr.name, res->res_con.enable_ssl);
+         res->res_con.hdr.name, res->res_con.enable_ssl);
       break;
    case R_COUNTER:
       if (res->res_counter.WrapCounter) {
          sendit(sock, "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n",
-           res->res_counter.hdr.name, res->res_counter.MinValue, 
-           res->res_counter.MaxValue, res->res_counter.CurrentValue,
-           res->res_counter.WrapCounter->hdr.name);
+            res->res_counter.hdr.name, res->res_counter.MinValue, 
+            res->res_counter.MaxValue, res->res_counter.CurrentValue,
+            res->res_counter.WrapCounter->hdr.name);
       } else {
          sendit(sock, "Counter: name=%s min=%d max=%d\n",
-           res->res_counter.hdr.name, res->res_counter.MinValue, 
-           res->res_counter.MaxValue);
+            res->res_counter.hdr.name, res->res_counter.MinValue, 
+            res->res_counter.MaxValue);
       }
       if (res->res_counter.Catalog) {
          sendit(sock, "  --> ");
-        dump_resource(-R_CATALOG, (RES *)res->res_counter.Catalog, sendit, sock);
+         dump_resource(-R_CATALOG, (RES *)res->res_counter.Catalog, sendit, sock);
       }
       break;
 
    case R_CLIENT:
       sendit(sock, "Client: name=%s address=%s FDport=%d MaxJobs=%u\n",
-        res->res_client.hdr.name, res->res_client.address, res->res_client.FDport,
-        res->res_client.MaxConcurrentJobs);
+         res->res_client.hdr.name, res->res_client.address, res->res_client.FDport,
+         res->res_client.MaxConcurrentJobs);
       sendit(sock, "      JobRetention=%s FileRetention=%s AutoPrune=%d\n",
-        edit_utime(res->res_client.JobRetention, ed1, sizeof(ed1)),
-        edit_utime(res->res_client.FileRetention, ed2, sizeof(ed2)),
-        res->res_client.AutoPrune);
+         edit_utime(res->res_client.JobRetention, ed1, sizeof(ed1)),
+         edit_utime(res->res_client.FileRetention, ed2, sizeof(ed2)),
+         res->res_client.AutoPrune);
       if (res->res_client.catalog) {
          sendit(sock, "  --> ");
-        dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock);
+         dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock);
       }
       break;
    case R_STORAGE:
       sendit(sock, "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n\
       DeviceName=%s MediaType=%s\n",
-        res->res_store.hdr.name, res->res_store.address, res->res_store.SDport,
-        res->res_store.MaxConcurrentJobs,
-        res->res_store.dev_name, res->res_store.media_type);
+         res->res_store.hdr.name, res->res_store.address, res->res_store.SDport,
+         res->res_store.MaxConcurrentJobs,
+         res->res_store.dev_name, res->res_store.media_type);
       break;
    case R_CATALOG:
       sendit(sock, "Catalog: name=%s address=%s DBport=%d db_name=%s\n\
       db_user=%s\n",
-        res->res_cat.hdr.name, NPRT(res->res_cat.db_address),
-        res->res_cat.db_port, res->res_cat.db_name, NPRT(res->res_cat.db_user));
+         res->res_cat.hdr.name, NPRT(res->res_cat.db_address),
+         res->res_cat.db_port, res->res_cat.db_name, NPRT(res->res_cat.db_user));
       break;
    case R_JOB:
    case R_JOBDEFS:
       sendit(sock, "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n", 
          type == R_JOB ? "Job" : "JobDefs",
-        res->res_job.hdr.name, res->res_job.JobType, 
-        level_to_str(res->res_job.JobLevel), res->res_job.Priority,
-        res->res_job.MaxConcurrentJobs);
+         res->res_job.hdr.name, res->res_job.JobType, 
+         level_to_str(res->res_job.JobLevel), res->res_job.Priority,
+         res->res_job.MaxConcurrentJobs);
       sendit(sock, "     Resched=%d Times=%d Interval=%s Spool=%d\n",
-         res->res_job.RescheduleOnError, res->res_job.RescheduleTimes,
-         edit_uint64_with_commas(res->res_job.RescheduleInterval, ed1),
-         res->res_job.spool_data);
+          res->res_job.RescheduleOnError, res->res_job.RescheduleTimes,
+          edit_uint64_with_commas(res->res_job.RescheduleInterval, ed1),
+          res->res_job.spool_data);
       if (res->res_job.client) {
          sendit(sock, "  --> ");
-        dump_resource(-R_CLIENT, (RES *)res->res_job.client, sendit, sock);
+         dump_resource(-R_CLIENT, (RES *)res->res_job.client, sendit, sock);
       }
       if (res->res_job.fileset) {
          sendit(sock, "  --> ");
-        dump_resource(-R_FILESET, (RES *)res->res_job.fileset, sendit, sock);
+         dump_resource(-R_FILESET, (RES *)res->res_job.fileset, sendit, sock);
       }
       if (res->res_job.schedule) {
          sendit(sock, "  --> ");
-        dump_resource(-R_SCHEDULE, (RES *)res->res_job.schedule, sendit, sock);
+         dump_resource(-R_SCHEDULE, (RES *)res->res_job.schedule, sendit, sock);
       }
       if (res->res_job.RestoreWhere) {
          sendit(sock, "  --> Where=%s\n", NPRT(res->res_job.RestoreWhere));
@@ -538,33 +539,33 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       }
       if (res->res_job.storage[0]) {
          sendit(sock, "  --> ");
-        /* ***FIXME*** */
-//        dump_resource(-R_STORAGE, (RES *)res->res_job.storage, sendit, sock);
+         /* ***FIXME*** */
+//         dump_resource(-R_STORAGE, (RES *)res->res_job.storage, sendit, sock);
       }
       if (res->res_job.pool) {
          sendit(sock, "  --> ");
-        dump_resource(-R_POOL, (RES *)res->res_job.pool, sendit, sock);
+         dump_resource(-R_POOL, (RES *)res->res_job.pool, sendit, sock);
       }
       if (res->res_job.full_pool) {
          sendit(sock, "  --> ");
-        dump_resource(-R_POOL, (RES *)res->res_job.full_pool, sendit, sock);
+         dump_resource(-R_POOL, (RES *)res->res_job.full_pool, sendit, sock);
       }
       if (res->res_job.inc_pool) {
          sendit(sock, "  --> ");
-        dump_resource(-R_POOL, (RES *)res->res_job.inc_pool, sendit, sock);
+         dump_resource(-R_POOL, (RES *)res->res_job.inc_pool, sendit, sock);
       }
       if (res->res_job.dif_pool) {
          sendit(sock, "  --> ");
-        dump_resource(-R_POOL, (RES *)res->res_job.dif_pool, sendit, sock);
+         dump_resource(-R_POOL, (RES *)res->res_job.dif_pool, sendit, sock);
       }
       if (res->res_job.verify_job) {
          sendit(sock, "  --> ");
-        dump_resource(-type, (RES *)res->res_job.verify_job, sendit, sock);
+         dump_resource(-type, (RES *)res->res_job.verify_job, sendit, sock);
       }
       break;
       if (res->res_job.messages) {
          sendit(sock, "  --> ");
-        dump_resource(-R_MSGS, (RES *)res->res_job.messages, sendit, sock);
+         dump_resource(-R_MSGS, (RES *)res->res_job.messages, sendit, sock);
       }
       break;
    case R_FILESET:
@@ -572,151 +573,166 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       int i, j, k;
       sendit(sock, "FileSet: name=%s\n", res->res_fs.hdr.name);
       for (i=0; i<res->res_fs.num_includes; i++) {
-        INCEXE *incexe = res->res_fs.include_items[i];
-        for (j=0; j<incexe->num_opts; j++) {
-           FOPTS *fo = incexe->opts_list[j];
+         INCEXE *incexe = res->res_fs.include_items[i];
+         for (j=0; j<incexe->num_opts; j++) {
+            FOPTS *fo = incexe->opts_list[j];
             sendit(sock, "      O %s\n", fo->opts);
-           for (k=0; k<fo->regex.size(); k++) {
+            for (k=0; k<fo->regex.size(); k++) {
                sendit(sock, "      R %s\n", fo->regex.get(k));
-           }
-           for (k=0; k<fo->wild.size(); k++) {
+            }
+            for (k=0; k<fo->regexdir.size(); k++) {
+               sendit(sock, "      RD %s\n", fo->regexdir.get(k));
+            }
+            for (k=0; k<fo->regexfile.size(); k++) {
+               sendit(sock, "      RF %s\n", fo->regexfile.get(k));
+            }
+            for (k=0; k<fo->wild.size(); k++) {
                sendit(sock, "      W %s\n", fo->wild.get(k));
-           }
-           for (k=0; k<fo->base.size(); k++) {
+            }
+            for (k=0; k<fo->wilddir.size(); k++) {
+               sendit(sock, "      WD %s\n", fo->wilddir.get(k));
+            }
+            for (k=0; k<fo->wildfile.size(); k++) {
+               sendit(sock, "      WF %s\n", fo->wildfile.get(k));
+            }
+            for (k=0; k<fo->base.size(); k++) {
                sendit(sock, "      B %s\n", fo->base.get(k));
-           }
-           if (fo->reader) {
+            }
+            for (k=0; k<fo->fstype.size(); k++) {
+               sendit(sock, "      X %s\n", fo->fstype.get(k));
+            }
+            if (fo->reader) {
                sendit(sock, "      D %s\n", fo->reader);
-           }
-           if (fo->writer) {
+            }
+            if (fo->writer) {
                sendit(sock, "      T %s\n", fo->writer);
-           }
+            }
             sendit(sock, "      N\n");
-        }
-        for (j=0; j<incexe->name_list.size(); j++) {
+         }
+         for (j=0; j<incexe->name_list.size(); j++) {
             sendit(sock, "      I %s\n", incexe->name_list.get(j));
-        }
-        if (incexe->name_list.size()) {
+         }
+         if (incexe->name_list.size()) {
             sendit(sock, "      N\n");
-        }
+         }
       }
-        
+
       for (i=0; i<res->res_fs.num_excludes; i++) {
-        INCEXE *incexe = res->res_fs.exclude_items[i];
-        for (j=0; j<incexe->name_list.size(); j++) {
+         INCEXE *incexe = res->res_fs.exclude_items[i];
+         for (j=0; j<incexe->name_list.size(); j++) {
             sendit(sock, "      E %s\n", incexe->name_list.get(j));
-        }
-        if (incexe->name_list.size()) {
+         }
+         if (incexe->name_list.size()) {
             sendit(sock, "      N\n");
-        }
+         }
       }
       break;
    }
    case R_SCHEDULE:
       if (res->res_sch.run) {
-        int i;
-        RUN *run = res->res_sch.run;
-        char buf[1000], num[30];
+         int i;
+         RUN *run = res->res_sch.run;
+         char buf[1000], num[30];
          sendit(sock, "Schedule: name=%s\n", res->res_sch.hdr.name);
-        if (!run) {
-           break;
-        }
+         if (!run) {
+            break;
+         }
 next_run:
          sendit(sock, "  --> Run Level=%s\n", level_to_str(run->level));
          bstrncpy(buf, "      hour=", sizeof(buf));
-        for (i=0; i<24; i++) {
-           if (bit_is_set(i, run->hour)) {
+         for (i=0; i<24; i++) {
+            if (bit_is_set(i, run->hour)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          bstrncpy(buf, "      mday=", sizeof(buf));
-        for (i=0; i<31; i++) {
-           if (bit_is_set(i, run->mday)) {
+         for (i=0; i<31; i++) {
+            if (bit_is_set(i, run->mday)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          bstrncpy(buf, "      month=", sizeof(buf));
-        for (i=0; i<12; i++) {
-           if (bit_is_set(i, run->month)) {
+         for (i=0; i<12; i++) {
+            if (bit_is_set(i, run->month)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          bstrncpy(buf, "      wday=", sizeof(buf));
-        for (i=0; i<7; i++) {
-           if (bit_is_set(i, run->wday)) {
+         for (i=0; i<7; i++) {
+            if (bit_is_set(i, run->wday)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          bstrncpy(buf, "      wom=", sizeof(buf));
-        for (i=0; i<5; i++) {
-           if (bit_is_set(i, run->wom)) {
+         for (i=0; i<5; i++) {
+            if (bit_is_set(i, run->wom)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          bstrncpy(buf, "      woy=", sizeof(buf));
-        for (i=0; i<54; i++) {
-           if (bit_is_set(i, run->woy)) {
+         for (i=0; i<54; i++) {
+            if (bit_is_set(i, run->woy)) {
                bsnprintf(num, sizeof(num), "%d ", i);
-              bstrncat(buf, num, sizeof(buf));
-           }
-        }
+               bstrncat(buf, num, sizeof(buf));
+            }
+         }
          bstrncat(buf, "\n", sizeof(buf));
-        sendit(sock, buf);
+         sendit(sock, buf);
          sendit(sock, "      mins=%d\n", run->minute);
-        if (run->pool) {
+         if (run->pool) {
             sendit(sock, "     --> ");
-           dump_resource(-R_POOL, (RES *)run->pool, sendit, sock);
-        }
-        if (run->storage) {
+            dump_resource(-R_POOL, (RES *)run->pool, sendit, sock);
+         }
+         if (run->storage) {
             sendit(sock, "     --> ");
-           dump_resource(-R_STORAGE, (RES *)run->storage, sendit, sock);
-        }
-        if (run->msgs) {
+            dump_resource(-R_STORAGE, (RES *)run->storage, sendit, sock);
+         }
+         if (run->msgs) {
             sendit(sock, "     --> ");
-           dump_resource(-R_MSGS, (RES *)run->msgs, sendit, sock);
-        }
-        /* If another Run record is chained in, go print it */
-        if (run->next) {
-           run = run->next;
-           goto next_run;
-        }
+            dump_resource(-R_MSGS, (RES *)run->msgs, sendit, sock);
+         }
+         /* If another Run record is chained in, go print it */
+         if (run->next) {
+            run = run->next;
+            goto next_run;
+         }
       } else {
          sendit(sock, "Schedule: name=%s\n", res->res_sch.hdr.name);
       }
       break;
    case R_POOL:
       sendit(sock, "Pool: name=%s PoolType=%s\n", res->res_pool.hdr.name,
-             res->res_pool.pool_type);
+              res->res_pool.pool_type);
       sendit(sock, "      use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n",
-             res->res_pool.use_catalog, res->res_pool.use_volume_once,
-             res->res_pool.accept_any_volume, res->res_pool.catalog_files);
+              res->res_pool.use_catalog, res->res_pool.use_volume_once,
+              res->res_pool.accept_any_volume, res->res_pool.catalog_files);
       sendit(sock, "      max_vols=%d auto_prune=%d VolRetention=%s\n",
-             res->res_pool.max_volumes, res->res_pool.AutoPrune,
-             edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
+              res->res_pool.max_volumes, res->res_pool.AutoPrune,
+              edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
       sendit(sock, "      VolUse=%s recycle=%d LabelFormat=%s\n", 
-             edit_utime(res->res_pool.VolUseDuration, ed1, sizeof(ed1)),
-             res->res_pool.Recycle,
-             NPRT(res->res_pool.label_format));
+              edit_utime(res->res_pool.VolUseDuration, ed1, sizeof(ed1)),
+              res->res_pool.Recycle,
+              NPRT(res->res_pool.label_format));
       sendit(sock, "      CleaningPrefix=%s\n",
-             NPRT(res->res_pool.cleaning_prefix));
+              NPRT(res->res_pool.cleaning_prefix));
       sendit(sock, "      recyleOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n",
-             res->res_pool.purge_oldest_volume, 
-             res->res_pool.MaxVolJobs, res->res_pool.MaxVolFiles);
+              res->res_pool.purge_oldest_volume, 
+              res->res_pool.MaxVolJobs, res->res_pool.MaxVolFiles);
       break;
    case R_MSGS:
       sendit(sock, "Messages: name=%s\n", res->res_msgs.hdr.name);
@@ -743,13 +759,18 @@ static void free_incexe(INCEXE *incexe)
    for (int i=0; i<incexe->num_opts; i++) {
       FOPTS *fopt = incexe->opts_list[i];
       fopt->regex.destroy();
+      fopt->regexdir.destroy();
+      fopt->regexfile.destroy();
       fopt->wild.destroy();
+      fopt->wilddir.destroy();
+      fopt->wildfile.destroy();
       fopt->base.destroy();
+      fopt->fstype.destroy();
       if (fopt->reader) {
-        free(fopt->reader);
+         free(fopt->reader);
       }
       if (fopt->writer) {
-        free(fopt->writer);
+         free(fopt->writer);
       }
       free(fopt);
    }
@@ -769,7 +790,7 @@ static void free_incexe(INCEXE *incexe)
 void free_resource(RES *sres, int type)
 {
    int num;
-   RES *nres;                        /* next resource if linked */
+   RES *nres;                         /* next resource if linked */
    URES *res = (URES *)sres;
 
    if (res == NULL)
@@ -787,152 +808,152 @@ void free_resource(RES *sres, int type)
    switch (type) {
    case R_DIRECTOR:
       if (res->res_dir.working_directory) {
-        free(res->res_dir.working_directory);
+         free(res->res_dir.working_directory);
       }
       if (res->res_dir.pid_directory) {
-        free(res->res_dir.pid_directory);
+         free(res->res_dir.pid_directory);
       }
       if (res->res_dir.subsys_directory) {
-        free(res->res_dir.subsys_directory);
+         free(res->res_dir.subsys_directory);
       }
       if (res->res_dir.password) {
-        free(res->res_dir.password);
+         free(res->res_dir.password);
       }
       if (res->res_dir.query_file) {
-        free(res->res_dir.query_file);
+         free(res->res_dir.query_file);
       }
       if (res->res_dir.DIRaddrs) {
-        free_addresses(res->res_dir.DIRaddrs);
+         free_addresses(res->res_dir.DIRaddrs);
       }
       break;
    case R_COUNTER:
        break;
    case R_CONSOLE:
       if (res->res_con.password) {
-        free(res->res_con.password);
+         free(res->res_con.password);
       }
       for (int i=0; i<Num_ACL; i++) {
-        if (res->res_con.ACL_lists[i]) {
-           delete res->res_con.ACL_lists[i];
-           res->res_con.ACL_lists[i] = NULL;
-        }
+         if (res->res_con.ACL_lists[i]) {
+            delete res->res_con.ACL_lists[i];
+            res->res_con.ACL_lists[i] = NULL;
+         }
       }
       break;
    case R_CLIENT:
       if (res->res_client.address) {
-        free(res->res_client.address);
+         free(res->res_client.address);
       }
       if (res->res_client.password) {
-        free(res->res_client.password);
+         free(res->res_client.password);
       }
       break;
    case R_STORAGE:
       if (res->res_store.address) {
-        free(res->res_store.address);
+         free(res->res_store.address);
       }
       if (res->res_store.password) {
-        free(res->res_store.password);
+         free(res->res_store.password);
       }
       if (res->res_store.media_type) {
-        free(res->res_store.media_type);
+         free(res->res_store.media_type);
       }
       if (res->res_store.dev_name) {
-        free(res->res_store.dev_name);
+         free(res->res_store.dev_name);
       }
       break;
    case R_CATALOG:
       if (res->res_cat.db_address) {
-        free(res->res_cat.db_address);
+         free(res->res_cat.db_address);
       }
       if (res->res_cat.db_socket) {
-        free(res->res_cat.db_socket);
+         free(res->res_cat.db_socket);
       }
       if (res->res_cat.db_user) {
-        free(res->res_cat.db_user);
+         free(res->res_cat.db_user);
       }
       if (res->res_cat.db_name) {
-        free(res->res_cat.db_name);
+         free(res->res_cat.db_name);
       }
       if (res->res_cat.db_password) {
-        free(res->res_cat.db_password);
+         free(res->res_cat.db_password);
       }
       break;
    case R_FILESET:
       if ((num=res->res_fs.num_includes)) {
-        while (--num >= 0) {   
-           free_incexe(res->res_fs.include_items[num]);
-        }
-        free(res->res_fs.include_items);
+         while (--num >= 0) {   
+            free_incexe(res->res_fs.include_items[num]);
+         }
+         free(res->res_fs.include_items);
       }
       res->res_fs.num_includes = 0;
       if ((num=res->res_fs.num_excludes)) {
-        while (--num >= 0) {   
-           free_incexe(res->res_fs.exclude_items[num]);
-        }
-        free(res->res_fs.exclude_items);
+         while (--num >= 0) {   
+            free_incexe(res->res_fs.exclude_items[num]);
+         }
+         free(res->res_fs.exclude_items);
       }
       res->res_fs.num_excludes = 0;
       break;
    case R_POOL:
       if (res->res_pool.pool_type) {
-        free(res->res_pool.pool_type);
+         free(res->res_pool.pool_type);
       }
       if (res->res_pool.label_format) {
-        free(res->res_pool.label_format);
+         free(res->res_pool.label_format);
       }
       if (res->res_pool.cleaning_prefix) {
-        free(res->res_pool.cleaning_prefix);
+         free(res->res_pool.cleaning_prefix);
       }
       break;
    case R_SCHEDULE:
       if (res->res_sch.run) {
-        RUN *nrun, *next;
-        nrun = res->res_sch.run;
-        while (nrun) {
-           next = nrun->next;
-           free(nrun);
-           nrun = next;
-        }
+         RUN *nrun, *next;
+         nrun = res->res_sch.run;
+         while (nrun) {
+            next = nrun->next;
+            free(nrun);
+            nrun = next;
+         }
       }
       break;
    case R_JOB:
    case R_JOBDEFS:
       if (res->res_job.RestoreWhere) {
-        free(res->res_job.RestoreWhere);
+         free(res->res_job.RestoreWhere);
       }
       if (res->res_job.RestoreBootstrap) {
-        free(res->res_job.RestoreBootstrap);
+         free(res->res_job.RestoreBootstrap);
       }
       if (res->res_job.WriteBootstrap) {
-        free(res->res_job.WriteBootstrap);
+         free(res->res_job.WriteBootstrap);
       }
       if (res->res_job.RunBeforeJob) {
-        free(res->res_job.RunBeforeJob);
+         free(res->res_job.RunBeforeJob);
       }
       if (res->res_job.RunAfterJob) {
-        free(res->res_job.RunAfterJob);
+         free(res->res_job.RunAfterJob);
       }
       if (res->res_job.RunAfterFailedJob) {
-        free(res->res_job.RunAfterFailedJob);
+         free(res->res_job.RunAfterFailedJob);
       }
       if (res->res_job.ClientRunBeforeJob) {
-        free(res->res_job.ClientRunBeforeJob);
+         free(res->res_job.ClientRunBeforeJob);
       }
       if (res->res_job.ClientRunAfterJob) {
-        free(res->res_job.ClientRunAfterJob);
+         free(res->res_job.ClientRunAfterJob);
       }
       for (int i=0; i < MAX_STORE; i++) {
-        if (res->res_job.storage[i]) {
-           delete (alist *)res->res_job.storage[i];
-        }
+         if (res->res_job.storage[i]) {
+            delete (alist *)res->res_job.storage[i];
+         }
       }
       break;
    case R_MSGS:
       if (res->res_msgs.mail_cmd) {
-        free(res->res_msgs.mail_cmd);
+         free(res->res_msgs.mail_cmd);
       }
       if (res->res_msgs.operator_cmd) {
-        free(res->res_msgs.operator_cmd);
+         free(res->res_msgs.operator_cmd);
       }
       free_msgs_res((MSGS *)res);  /* free message resource */
       res = NULL;
@@ -968,16 +989,26 @@ void save_resource(int type, RES_ITEM *items, int pass)
        * Ensure that all required items are present
        */
       for (i=0; items[i].name; i++) {
-        if (items[i].flags & ITEM_REQUIRED) {
-              if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {  
-                  Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
-                   items[i].name, resources[rindex]);
-               }
-        }
-        /* If this triggers, take a look at lib/parse_conf.h */
-        if (i >= MAX_RES_ITEMS) {
+         if (items[i].flags & ITEM_REQUIRED) {
+           if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {  
+               Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+                    items[i].name, resources[rindex]);
+            }
+         }
+         /* If this triggers, take a look at lib/parse_conf.h */
+         if (i >= MAX_RES_ITEMS) {
             Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
-        }
+         }
+      }
+   } else if (type == R_JOB) {
+      /*
+       * Ensure that the name item is present
+       */
+      if (items[0].flags & ITEM_REQUIRED) {
+         if (!bit_is_set(0, res_all.res_dir.hdr.item_present)) {
+             Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+                   items[0].name, resources[rindex]);
+         }
       }
    }
 
@@ -996,76 +1027,76 @@ void save_resource(int type, RES_ITEM *items, int pass)
       case R_POOL:
       case R_MSGS:
       case R_FILESET:
-        break;
+         break;
 
       /* Resources containing another resource */
       case R_DIRECTOR:
-        if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) {
+         if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) {
             Emsg1(M_ERROR_TERM, 0, "Cannot find Director resource %s\n", res_all.res_dir.hdr.name);
-        }
-        res->res_dir.messages = res_all.res_dir.messages;
-        break;
+         }
+         res->res_dir.messages = res_all.res_dir.messages;
+         break;
       case R_JOB:
       case R_JOBDEFS:
-        if ((res = (URES *)GetResWithName(type, res_all.res_dir.hdr.name)) == NULL) {
+         if ((res = (URES *)GetResWithName(type, res_all.res_dir.hdr.name)) == NULL) {
             Emsg1(M_ERROR_TERM, 0, "Cannot find Job resource %s\n", 
-                 res_all.res_dir.hdr.name);
-        }
-        res->res_job.messages   = res_all.res_job.messages;
-        res->res_job.schedule   = res_all.res_job.schedule;
-        res->res_job.client     = res_all.res_job.client;
-        res->res_job.fileset    = res_all.res_job.fileset;
-        for (int i=0; i < MAX_STORE; i++) {
-           res->res_job.storage[i] = res_all.res_job.storage[i];
-        }
-        res->res_job.pool       = res_all.res_job.pool;
-        res->res_job.full_pool  = res_all.res_job.full_pool;
-        res->res_job.inc_pool   = res_all.res_job.inc_pool;
-        res->res_job.dif_pool   = res_all.res_job.dif_pool;
-        res->res_job.verify_job = res_all.res_job.verify_job;
-        res->res_job.jobdefs    = res_all.res_job.jobdefs;
-        break;
+                  res_all.res_dir.hdr.name);
+         }
+         res->res_job.messages   = res_all.res_job.messages;
+         res->res_job.schedule   = res_all.res_job.schedule;
+         res->res_job.client     = res_all.res_job.client;
+         res->res_job.fileset    = res_all.res_job.fileset;
+         for (int i=0; i < MAX_STORE; i++) {
+            res->res_job.storage[i] = res_all.res_job.storage[i];
+         }
+         res->res_job.pool       = res_all.res_job.pool;
+         res->res_job.full_pool  = res_all.res_job.full_pool;
+         res->res_job.inc_pool   = res_all.res_job.inc_pool;
+         res->res_job.dif_pool   = res_all.res_job.dif_pool;
+         res->res_job.verify_job = res_all.res_job.verify_job;
+         res->res_job.jobdefs    = res_all.res_job.jobdefs;
+         break;
       case R_COUNTER:
-        if ((res = (URES *)GetResWithName(R_COUNTER, res_all.res_counter.hdr.name)) == NULL) {
+         if ((res = (URES *)GetResWithName(R_COUNTER, res_all.res_counter.hdr.name)) == NULL) {
             Emsg1(M_ERROR_TERM, 0, "Cannot find Counter resource %s\n", res_all.res_counter.hdr.name);
-        }
-        res->res_counter.Catalog = res_all.res_counter.Catalog;
-        res->res_counter.WrapCounter = res_all.res_counter.WrapCounter;
-        break;
+         }
+         res->res_counter.Catalog = res_all.res_counter.Catalog;
+         res->res_counter.WrapCounter = res_all.res_counter.WrapCounter;
+         break;
 
       case R_CLIENT:
-        if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_client.hdr.name)) == NULL) {
+         if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_client.hdr.name)) == NULL) {
             Emsg1(M_ERROR_TERM, 0, "Cannot find Client resource %s\n", res_all.res_client.hdr.name);
-        }
-        res->res_client.catalog = res_all.res_client.catalog;
-        break;
+         }
+         res->res_client.catalog = res_all.res_client.catalog;
+         break;
       case R_SCHEDULE:
-        /*
-         * Schedule is a bit different in that it contains a RUN record
+         /*
+          * Schedule is a bit different in that it contains a RUN record
           * chain which isn't a "named" resource. This chain was linked
-         * in by run_conf.c during pass 2, so here we jam the pointer 
-         * into the Schedule resource.                         
-         */
-        if ((res = (URES *)GetResWithName(R_SCHEDULE, res_all.res_client.hdr.name)) == NULL) {
+          * in by run_conf.c during pass 2, so here we jam the pointer 
+          * into the Schedule resource.                         
+          */
+         if ((res = (URES *)GetResWithName(R_SCHEDULE, res_all.res_client.hdr.name)) == NULL) {
             Emsg1(M_ERROR_TERM, 0, "Cannot find Schedule resource %s\n", res_all.res_client.hdr.name);
-        }
-        res->res_sch.run = res_all.res_sch.run;
-        break;
+         }
+         res->res_sch.run = res_all.res_sch.run;
+         break;
       default:
          Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
-        error = 1;
-        break;
+         error = 1;
+         break;
       }
       /* Note, the resource name was already saved during pass 1,
        * so here, we can just release it.
        */
       if (res_all.res_dir.hdr.name) {
-        free(res_all.res_dir.hdr.name);
-        res_all.res_dir.hdr.name = NULL;
+         free(res_all.res_dir.hdr.name);
+         res_all.res_dir.hdr.name = NULL;
       }
       if (res_all.res_dir.hdr.desc) {
-        free(res_all.res_dir.hdr.desc);
-        res_all.res_dir.hdr.desc = NULL;
+         free(res_all.res_dir.hdr.desc);
+         res_all.res_dir.hdr.desc = NULL;
       }
       return;
    }
@@ -1119,22 +1150,22 @@ void save_resource(int type, RES_ITEM *items, int pass)
       res = (URES *)malloc(size);
       memcpy(res, &res_all, size);
       if (!res_head[rindex]) {
-        res_head[rindex] = (RES *)res; /* store first entry */
+         res_head[rindex] = (RES *)res; /* store first entry */
          Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
-              res->res_dir.hdr.name, rindex);
+               res->res_dir.hdr.name, rindex);
       } else {
-        RES *next;
-        /* Add new res to end of chain */
-        for (next=res_head[rindex]; next->next; next=next->next) {
-           if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
-              Emsg2(M_ERROR_TERM, 0,
+         RES *next;
+         /* Add new res to end of chain */
+         for (next=res_head[rindex]; next->next; next=next->next) {
+            if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
+               Emsg2(M_ERROR_TERM, 0,
                   _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
-                 resources[rindex].name, res->res_dir.hdr.name);
-           }
-        }
-        next->next = (RES *)res;
+                  resources[rindex].name, res->res_dir.hdr.name);
+            }
+         }
+         next->next = (RES *)res;
          Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
-              res->res_dir.hdr.name, rindex, pass);
+               res->res_dir.hdr.name, rindex, pass);
       }
    }
 }
@@ -1151,9 +1182,9 @@ void store_jobtype(LEX *lc, RES_ITEM *item, int index, int pass)
    /* Store the type both pass 1 and pass 2 */
    for (i=0; jobtypes[i].type_name; i++) {
       if (strcasecmp(lc->str, jobtypes[i].type_name) == 0) {
-        *(int *)(item->value) = jobtypes[i].job_type;
-        i = 0;
-        break;
+         *(int *)(item->value) = jobtypes[i].job_type;
+         i = 0;
+         break;
       }
    }
    if (i != 0) {
@@ -1175,9 +1206,9 @@ void store_level(LEX *lc, RES_ITEM *item, int index, int pass)
    /* Store the level pass 2 so that type is defined */
    for (i=0; joblevels[i].level_name; i++) {
       if (strcasecmp(lc->str, joblevels[i].level_name) == 0) {
-        *(int *)(item->value) = joblevels[i].level;
-        i = 0;
-        break;
+         *(int *)(item->value) = joblevels[i].level;
+         i = 0;
+         break;
       }
    }
    if (i != 0) {
@@ -1194,9 +1225,9 @@ void store_replace(LEX *lc, RES_ITEM *item, int index, int pass)
    /* Scan Replacement options */
    for (i=0; ReplaceOptions[i].name; i++) {
       if (strcasecmp(lc->str, ReplaceOptions[i].name) == 0) {
-        *(int *)(item->value) = ReplaceOptions[i].token;
-        i = 0;
-        break;
+         *(int *)(item->value) = ReplaceOptions[i].token;
+         i = 0;
+         break;
       }
    }
    if (i != 0) {
@@ -1217,16 +1248,16 @@ void store_acl(LEX *lc, RES_ITEM *item, int index, int pass)
    for (;;) {
       token = lex_get_token(lc, T_NAME);
       if (pass == 1) {
-        if (((alist **)item->value)[item->code] == NULL) {   
-           ((alist **)item->value)[item->code] = New(alist(10, owned_by_alist)); 
+         if (((alist **)item->value)[item->code] == NULL) {   
+            ((alist **)item->value)[item->code] = New(alist(10, owned_by_alist)); 
             Dmsg1(900, "Defined new ACL alist at %d\n", item->code);
-        }
-        ((alist **)item->value)[item->code]->append(bstrdup(lc->str));
+         }
+         ((alist **)item->value)[item->code]->append(bstrdup(lc->str));
          Dmsg2(900, "Appended to %d %s\n", item->code, lc->str);
       }
       token = lex_get_token(lc, T_ALL);
       if (token == T_COMMA) {
-        continue;                    /* get another ACL */
+         continue;                    /* get another ACL */
       }
       break;
    }
index d3344eb4c6f455e13c3348f70429e3e4ce7a94a8..24b056aa3545f80828fa88e8ec578b83e2e13eac 100644 (file)
@@ -243,14 +243,19 @@ struct JOB {
 };
 
 #undef  MAX_FOPTS
-#define MAX_FOPTS 30
+#define MAX_FOPTS 34
 
 /* File options structure */
 struct FOPTS {
    char opts[MAX_FOPTS];              /* options string */
    alist regex;                       /* regex string(s) */
+   alist regexdir;                    /* regex string(s) for directories */
+   alist regexfile;                   /* regex string(s) for files */
    alist wild;                        /* wild card strings */
+   alist wilddir;                     /* wild card strings for directories */
+   alist wildfile;                    /* wild card strings for files */
    alist base;                        /* list of base names */
+   alist fstype;                      /* file system type limitation */
    char *reader;                      /* reader program */
    char *writer;                      /* writer program */
 };
index 46131fc04bdd5d859ebb39637a35f8b6f1b93c9c..e4be6d4c3657cb237c58a68c5e2ed31b0de81ed9 100644 (file)
@@ -6,14 +6,14 @@
  *
  *    This routine is run as a separate thread.  There may be more
  *    work to be done to make it totally reentrant!!!!
- * 
+ *
  *  Utility functions for sending info to File Daemon.
  *   These functions are used by both backup and verify.
- *   
+ *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -59,14 +59,14 @@ static char OKRunAfter[]  = "2000 OK RunAfter\n";
 
 /* External functions */
 extern int debug_level;
-extern DIRRES *director; 
+extern DIRRES *director;
 extern int FDConnectTimeout;
 
 #define INC_LIST 0
 #define EXC_LIST 1
 
 /*
- * Open connection with File daemon. 
+ * Open connection with File daemon.
  * Try connecting every retry_interval (default 10 sec), and
  *   give up after max_retry_time (default 30 mins).
  */
@@ -78,7 +78,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
 
    if (!jcr->file_bsock) {
       fd = bnet_connect(jcr, retry_interval, max_retry_time,
-           _("File daemon"), jcr->client->address, 
+           _("File daemon"), jcr->client->address,
           NULL, jcr->client->FDport, verbose);
       if (fd == NULL) {
         set_jcr_job_status(jcr, JS_ErrorTerminated);
@@ -96,11 +96,11 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
       set_jcr_job_status(jcr, JS_ErrorTerminated);
       return 0;
    }
-       
+
    /*
     * Now send JobId and authorization key
     */
-   bnet_fsend(fd, jobcmd, jcr->JobId, jcr->Job, jcr->VolSessionId, 
+   bnet_fsend(fd, jobcmd, jcr->JobId, jcr->Job, jcr->VolSessionId,
       jcr->VolSessionTime, jcr->sd_auth_key);
    if (strcmp(jcr->sd_auth_key, "dummy") != 0) {
       memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key));
@@ -109,7 +109,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
    if (bget_dirmsg(fd) > 0) {
        Dmsg1(110, "<filed: %s", fd->msg);
        if (strncmp(fd->msg, OKjob, strlen(OKjob)) != 0) {
-          Jmsg(jcr, M_FATAL, 0, _("File daemon \"%s\" rejected Job command: %s\n"), 
+          Jmsg(jcr, M_FATAL, 0, _("File daemon \"%s\" rejected Job command: %s\n"),
             jcr->client->hdr.name, fd->msg);
          set_jcr_job_status(jcr, JS_ErrorTerminated);
          return 0;
@@ -137,15 +137,15 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
 
 /*
  * This subroutine edits the last job start time into a
- *   "since=date/time" buffer that is returned in the  
+ *   "since=date/time" buffer that is returned in the
  *   variable since.  This is used for display purposes in
- *   the job report.  The time in jcr->stime is later 
+ *   the job report.  The time in jcr->stime is later
  *   passed to tell the File daemon what to do.
  */
 void get_level_since_time(JCR *jcr, char *since, int since_len)
 {
    int JobLevel;
-   /* Lookup the last FULL backup job to get the time/date for a 
+   /* Lookup the last FULL backup job to get the time/date for a
     * differential or incremental save.
     */
    if (!jcr->stime) {
@@ -162,7 +162,7 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
         /* No job found, so upgrade this one to Full */
          Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db));
          Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found. Doing FULL backup.\n"));
-         bsnprintf(since, since_len, " (upgraded from %s)", 
+         bsnprintf(since, since_len, " (upgraded from %s)",
            level_to_str(jcr->JobLevel));
         jcr->JobLevel = jcr->jr.JobLevel = L_FULL;
       } else {
@@ -170,13 +170,13 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
            if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr, jcr->stime, JobLevel)) {
                Jmsg(jcr, M_INFO, 0, _("Prior failed job found. Upgrading to %s.\n"),
                  level_to_str(JobLevel));
-               bsnprintf(since, since_len, " (upgraded from %s)", 
+               bsnprintf(since, since_len, " (upgraded from %s)",
                  level_to_str(jcr->JobLevel));
               jcr->JobLevel = jcr->jr.JobLevel = JobLevel;
               jcr->jr.JobId = jcr->JobId;
               break;
            }
-        }       
+        }
          bstrncpy(since, ", since=", since_len);
         bstrncat(since, jcr->stime, since_len);
       }
@@ -188,15 +188,15 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
 
 
 /*
- * Send level command to FD. 
+ * Send level command to FD.
  * Used for backup jobs and estimate command.
  */
-int send_level_command(JCR *jcr) 
+int send_level_command(JCR *jcr)
 {
    BSOCK   *fd = jcr->file_bsock;
    utime_t stime;
    char ed1[50];
-   /* 
+   /*
     * Send Level command to File daemon
     */
    switch (jcr->JobLevel) {
@@ -218,7 +218,7 @@ int send_level_command(JCR *jcr)
       break;
    case L_SINCE:
    default:
-      Jmsg2(jcr, M_FATAL, 0, _("Unimplemented backup level %d %c\n"), 
+      Jmsg2(jcr, M_FATAL, 0, _("Unimplemented backup level %d %c\n"),
         jcr->JobLevel, jcr->JobLevel);
       return 0;
    }
@@ -377,7 +377,7 @@ static int send_fileset(JCR *jcr)
         num = fileset->num_includes;
       } else {
         num = fileset->num_excludes;
-      }  
+      }
       for (int i=0; i<num; i++) {
         BPIPE *bpipe;
         FILE *ffd;
@@ -393,19 +393,34 @@ static int send_fileset(JCR *jcr)
         } else {
            ie = fileset->exclude_items[i];
             bnet_fsend(fd, "E\n");
-        }       
+        }
         for (j=0; j<ie->num_opts; j++) {
            FOPTS *fo = ie->opts_list[j];
             bnet_fsend(fd, "O %s\n", fo->opts);
            for (k=0; k<fo->regex.size(); k++) {
                bnet_fsend(fd, "R %s\n", fo->regex.get(k));
            }
+           for (k=0; k<fo->regexdir.size(); k++) {
+               bnet_fsend(fd, "RD %s\n", fo->regexdir.get(k));
+           }
+           for (k=0; k<fo->regexfile.size(); k++) {
+               bnet_fsend(fd, "RF %s\n", fo->regexfile.get(k));
+           }
            for (k=0; k<fo->wild.size(); k++) {
                bnet_fsend(fd, "W %s\n", fo->wild.get(k));
            }
+           for (k=0; k<fo->wilddir.size(); k++) {
+               bnet_fsend(fd, "WD %s\n", fo->wilddir.get(k));
+           }
+           for (k=0; k<fo->wildfile.size(); k++) {
+               bnet_fsend(fd, "WF %s\n", fo->wildfile.get(k));
+           }
            for (k=0; k<fo->base.size(); k++) {
                bnet_fsend(fd, "B %s\n", fo->base.get(k));
            }
+           for (k=0; k<fo->fstype.size(); k++) {
+               bnet_fsend(fd, "X %s\n", fo->fstype.get(k));
+           }
            if (fo->reader) {
                bnet_fsend(fd, "D %s\n", fo->reader);
            }
@@ -518,7 +533,7 @@ int send_include_list(JCR *jcr)
 
 
 /*
- * Send exclude list to File daemon 
+ * Send exclude list to File daemon
  */
 int send_exclude_list(JCR *jcr)
 {
@@ -549,14 +564,14 @@ int send_bootstrap_file(JCR *jcr)
    bs = fopen(jcr->RestoreBootstrap, "r");
    if (!bs) {
       berrno be;
-      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), 
+      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
         jcr->RestoreBootstrap, be.strerror());
       set_jcr_job_status(jcr, JS_ErrorTerminated);
       return 0;
    }
    bnet_fsend(fd, bootstrap);
    while (fgets(buf, sizeof(buf), bs)) {
-      bnet_fsend(fd, "%s", buf);       
+      bnet_fsend(fd, "%s", buf);
    }
    bnet_sig(fd, BNET_EOD);
    fclose(bs);
@@ -599,7 +614,7 @@ int send_run_before_and_after_commands(JCR *jcr)
 }
 
 
-/* 
+/*
  * Read the attributes from the File daemon for
  * a Verify job and store them in the catalog.
  */
@@ -618,7 +633,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr)
    /* Pickup file attributes and signature */
    while (!fd->errors && (n = bget_dirmsg(fd)) > 0) {
 
-   /*****FIXME****** improve error handling to stop only on 
+   /*****FIXME****** improve error handling to stop only on
     * really fatal problems, or the number of errors is too
     * large.
     */
@@ -630,8 +645,8 @@ int get_attributes_and_put_in_catalog(JCR *jcr)
 
       jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen);
       if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Opts_SIG)) != 3) {
-         Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got %d\n\
-msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
+         Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got %d\n"
+"msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
         set_jcr_job_status(jcr, JS_ErrorTerminated);
         return 0;
       }
@@ -640,7 +655,7 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
       skip_spaces(&p);
       skip_nonspaces(&p);            /* skip Stream */
       skip_spaces(&p);
-      skip_nonspaces(&p);            /* skip Opts_SHA1 */   
+      skip_nonspaces(&p);            /* skip Opts_SHA1 */
       p++;                           /* skip space */
       fn = jcr->fname;
       while (*p != 0) {
@@ -680,7 +695,7 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
         }
         db_escape_string(SIG, Opts_SIG, strlen(Opts_SIG));
          Dmsg2(120, "SIGlen=%d SIG=%s\n", strlen(SIG), SIG);
-        if (!db_add_SIG_to_file_record(jcr, jcr->db, jcr->FileId, SIG, 
+        if (!db_add_SIG_to_file_record(jcr, jcr->db, jcr->FileId, SIG,
                   stream==STREAM_MD5_SIGNATURE?MD5_SIG:SHA1_SIG)) {
             Jmsg1(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
            set_jcr_job_status(jcr, JS_Error);
@@ -688,7 +703,7 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
       }
       jcr->jr.JobFiles = jcr->JobFiles = file_index;
       jcr->jr.LastIndex = file_index;
-   } 
+   }
    if (is_bnet_error(fd)) {
       Jmsg1(jcr, M_FATAL, 0, _("<filed: Network error getting attributes. ERR=%s\n"),
                        bnet_strerror(fd));
index 50546e75c57a74c2749c34089d9ac63d7702e302..05b07d2ef62835b384ff310d17592b1577e5332b 100644 (file)
@@ -21,7 +21,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -46,6 +46,8 @@
 /* Forward referenced functions */
 static char *find_msg_start(char *msg);
 
+static char Job_status[] = "Status Job=%127s JobStatus=%d\n";
+
 static char OK_msg[] = "1000 OK\n";
 
 /*
@@ -192,6 +194,15 @@ int bget_dirmsg(BSOCK *bs)
         free_jcr(jcr);
         continue;
       }
+      if (bs->msg[0] == 'S') {       /* Status change */
+       int JobStatus;
+       char Job[MAX_NAME_LENGTH];
+       if (sscanf(bs->msg, Job_status, &Job, &JobStatus) == 2) {
+          jcr->SDJobStatus = JobStatus; /* current status */
+          free_jcr(jcr);
+          continue;
+       }
+      }
       return n;
    }
 }
index c3a01f4ef3ade4cd22719dbb80e08bee90e6c5ae..51de57ba138b1651389b3fcf2387abf3b6d23695 100644 (file)
@@ -7,7 +7,7 @@
  *     Version $Id$
  */
 /*
-   Copyright (C) 2003-2004 Kern Sibbald and John Walker
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -39,6 +39,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass);
+static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_opts(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass);
 static void options_res(LEX *lc, RES_ITEM *item, int index, int pass);
@@ -59,14 +60,14 @@ extern int  res_all_size;
 /* We build the current new Include and Exclude items here */
 static INCEXE res_incexe;
 
-/* 
+/*
  * new Include/Exclude items
  *   name            handler     value    code flags default_value
  */
 static RES_ITEM newinc_items[] = {
    {"file",            store_fname,   NULL,     0, 0, 0},
    {"options",         options_res,   NULL,     0, 0, 0},
-   {NULL, NULL, NULL, 0, 0, 0} 
+   {NULL, NULL, NULL, 0, 0, 0}
 };
 
 /*
@@ -79,19 +80,27 @@ static RES_ITEM options_items[] = {
    {"onefs",           store_opts,    NULL,     0, 0, 0},
    {"recurse",         store_opts,    NULL,     0, 0, 0},
    {"sparse",          store_opts,    NULL,     0, 0, 0},
+   {"hardlinks",       store_opts,    NULL,     0, 0, 0},
    {"readfifo",        store_opts,    NULL,     0, 0, 0},
    {"replace",         store_opts,    NULL,     0, 0, 0},
    {"portable",        store_opts,    NULL,     0, 0, 0},
    {"mtimeonly",       store_opts,    NULL,     0, 0, 0},
    {"keepatime",       store_opts,    NULL,     0, 0, 0},
    {"regex",           store_regex,   NULL,     0, 0, 0},
+   {"regexdir",        store_regex,   NULL,     1, 0, 0},
+   {"regexfile",       store_regex,   NULL,     2, 0, 0},
    {"base",            store_base,    NULL,     0, 0, 0},
    {"wild",            store_wild,    NULL,     0, 0, 0},
+   {"wilddir",         store_wild,    NULL,     1, 0, 0},
+   {"wildfile",        store_wild,    NULL,     2, 0, 0},
    {"exclude",         store_opts,    NULL,     0, 0, 0},
    {"aclsupport",      store_opts,    NULL,     0, 0, 0},
    {"reader",          store_reader,  NULL,     0, 0, 0},
    {"writer",          store_writer,  NULL,     0, 0, 0},
-   {NULL, NULL, NULL, 0, 0, 0} 
+   {"ignorecase",      store_opts,    NULL,     0, 0, 0},
+   {"fstype",          store_fstype,  NULL,     0, 0, 0},
+   {"hfsplussupport",  store_opts,    NULL,     0, 0, 0},
+   {NULL, NULL, NULL, 0, 0, 0}
 };
 
 
@@ -106,13 +115,16 @@ enum {
    INC_KW_ONEFS,
    INC_KW_RECURSE,
    INC_KW_SPARSE,
+   INC_KW_HARDLINK,
    INC_KW_REPLACE,              /* restore options */
    INC_KW_READFIFO,             /* Causes fifo data to be read */
    INC_KW_PORTABLE,
    INC_KW_MTIMEONLY,
    INC_KW_KEEPATIME,
    INC_KW_EXCLUDE,
-   INC_KW_ACL
+   INC_KW_ACL,
+   INC_KW_IGNORECASE,
+   INC_KW_HFSPLUS
 };
 
 /*
@@ -127,6 +139,7 @@ static struct s_kw FS_option_kw[] = {
    {"onefs",       INC_KW_ONEFS},
    {"recurse",     INC_KW_RECURSE},
    {"sparse",      INC_KW_SPARSE},
+   {"hardlinks",   INC_KW_HARDLINK},
    {"replace",     INC_KW_REPLACE},
    {"readfifo",    INC_KW_READFIFO},
    {"portable",    INC_KW_PORTABLE},
@@ -134,6 +147,8 @@ static struct s_kw FS_option_kw[] = {
    {"keepatime",   INC_KW_KEEPATIME},
    {"exclude",     INC_KW_EXCLUDE},
    {"aclsupport",  INC_KW_ACL},
+   {"ignorecase",  INC_KW_IGNORECASE},
+   {"hfsplussupport", INC_KW_HFSPLUS},
    {NULL,         0}
 };
 
@@ -146,7 +161,7 @@ struct s_fs_opt {
 };
 
 /*
- * Options permitted for each keyword and resulting value.     
+ * Options permitted for each keyword and resulting value.
  * The output goes into opts, which are then transmitted to
  * the FD for application as options to the following list of
  * included files.
@@ -172,6 +187,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_RECURSE,       "h"},
    {"yes",      INC_KW_SPARSE,        "s"},
    {"no",       INC_KW_SPARSE,        "0"},
+   {"yes",      INC_KW_HARDLINK,      "0"},
+   {"no",       INC_KW_HARDLINK,      "H"},
    {"always",   INC_KW_REPLACE,       "a"},
    {"ifnewer",  INC_KW_REPLACE,       "w"},
    {"never",    INC_KW_REPLACE,       "n"},
@@ -187,13 +204,17 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_EXCLUDE,       "0"},
    {"yes",      INC_KW_ACL,           "A"},
    {"no",       INC_KW_ACL,           "0"},
+   {"yes",      INC_KW_IGNORECASE,    "i"},
+   {"no",       INC_KW_IGNORECASE,    "0"},
+   {"yes",      INC_KW_HFSPLUS,       "R"},   /* "R" for resource fork */
+   {"no",       INC_KW_HFSPLUS,       "0"},
    {NULL,      0,                      0}
 };
 
 
 
-/* 
- * Scan for right hand side of Include options (keyword=option) is 
+/*
+ * Scan for right hand side of Include options (keyword=option) is
  *    converted into one or two characters. Verifyopts=xxxx is Vxxxx:
  *    Whatever is found is concatenated to the opts string.
  * This code is also used inside an Options resource.
@@ -202,10 +223,12 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
 {
    int token, i;
    char option[3];
+   int lcopts = lc->options;
 
    option[0] = 0;                    /* default option = none */
    option[2] = 0;                    /* terminate options */
-   token = lex_get_token(lc, T_NAME);            /* expect at least one option */       
+   lc->options |= LOPT_STRING;       /* force string */
+   token = lex_get_token(lc, T_STRING);         /* expect at least one option */
    if (keyword == INC_KW_VERIFY) { /* special case */
       /* ***FIXME**** ensure these are in permitted set */
       bstrncat(opts, "V", optlen);         /* indicate Verify */
@@ -214,7 +237,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
       Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
 
    /*
-    * Standard keyword options for Include/Exclude 
+    * Standard keyword options for Include/Exclude
     */
    } else {
       for (i=0; FS_options[i].name; i++) {
@@ -233,6 +256,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
          Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
       }
    }
+   lc->options = lcopts;
 
    /* If option terminated by comma, eat it */
    if (lc->ch == ',') {
@@ -240,9 +264,9 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
    }
 }
 
-/* 
- * 
- * Store FileSet Include/Exclude info  
+/*
+ *
+ * Store FileSet Include/Exclude info
  *  NEW style includes are handled in store_newinc()
  */
 void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
@@ -258,11 +282,12 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
     *  new Include is followed immediately by open brace, whereas the
     *  old include has options following the Include.
     */
-   token = lex_get_token(lc, T_SKIP_EOL);           
+   token = lex_get_token(lc, T_SKIP_EOL);
    if (token == T_BOB) {
       store_newinc(lc, item, index, pass);
       return;
    }
+   scan_err0(lc, _("Old style Include/Exclude not supported\n"));
 
    /* What follows is scanning for the OLD style Include/Exclude */
 
@@ -275,7 +300,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
    /* Get include options */
    inc_opts[0] = 0;
    while ((token=lex_get_token(lc, T_SKIP_EOL)) != T_BOB) {
-        
+
       keyword = INC_KW_NONE;
       for (i=0; FS_option_kw[i].name; i++) {
         if (strcasecmp(lc->str, FS_option_kw[i].name) == 0) {
@@ -299,7 +324,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
    }
 
    if (!inc_opts[0]) {
-      strcat(inc_opts, "0");          /* set no options */
+      bstrncat(inc_opts, "0", sizeof(inc_opts));   /* set no options */
    }
    inc_opts_len = strlen(inc_opts);
 
@@ -360,11 +385,11 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
            break;
         default:
             scan_err1(lc, "Expected a filename, got: %s", lc->str);
-        }                                 
+        }
       }
       /* Note, MD5Final is done in backup.c */
    } else { /* pass 2 */
-      while (lex_get_token(lc, T_ALL) != T_EOB) 
+      while (lex_get_token(lc, T_ALL) != T_EOB)
         {}
    }
    scan_to_eol(lc);
@@ -374,7 +399,7 @@ void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
 
 
 /*
- * Store NEW style FileSet FInclude/FExclude info   
+ * Store NEW style FileSet FInclude/FExclude info
  *
  *  Note, when this routine is called, we are inside a FileSet
  *  resource.  We treat the Include/Execlude like a sort of
@@ -384,7 +409,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token, i;
    INCEXE *incexe;
-   bool options;  
+   bool options;
 
    if (!res_all.res_fs.have_MD5) {
       MD5Init(&res_all.res_fs.md5c);
@@ -453,8 +478,10 @@ static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass)
    int token, rc;
    regex_t preg;
    char prbuf[500];
+   char *type;
+   int newsize;
 
-   token = lex_get_token(lc, T_SKIP_EOL);           
+   token = lex_get_token(lc, T_SKIP_EOL);
    if (pass == 1) {
       /* Pickup regex string
        */
@@ -470,13 +497,25 @@ static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass)
            break;
         }
         regfree(&preg);
-        res_incexe.current_opts->regex.append(bstrdup(lc->str));
-         Dmsg3(900, "set regex %p size=%d %s\n", 
-           res_incexe.current_opts, res_incexe.current_opts->regex.size(),lc->str);
+        if (item->code == 1) {
+            type = "regexdir";
+           res_incexe.current_opts->regexdir.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->regexdir.size();
+        } else if (item->code == 2) {
+            type = "regexfile";
+           res_incexe.current_opts->regexfile.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->regexfile.size();
+        } else {
+            type = "regex";
+           res_incexe.current_opts->regex.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->regex.size();
+        }
+         Dmsg4(900, "set %s %p size=%d %s\n",
+           type, res_incexe.current_opts, newsize, lc->str);
         break;
       default:
          scan_err1(lc, _("Expected a regex string, got: %s\n"), lc->str);
-      }                                
+      }
    }
    scan_to_eol(lc);
 }
@@ -486,7 +525,7 @@ static void store_base(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token;
 
-   token = lex_get_token(lc, T_NAME);          
+   token = lex_get_token(lc, T_NAME);
    if (pass == 1) {
       /*
        * Pickup Base Job Name
@@ -501,12 +540,12 @@ static void store_reader(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token;
 
-   token = lex_get_token(lc, T_NAME);          
+   token = lex_get_token(lc, T_NAME);
    if (pass == 1) {
       /*
        * Pickup reader command
        */
-      res_incexe.current_opts->reader = bstrdup(lc->str); 
+      res_incexe.current_opts->reader = bstrdup(lc->str);
    }
    scan_to_eol(lc);
 }
@@ -516,7 +555,7 @@ static void store_writer(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token;
 
-   token = lex_get_token(lc, T_NAME);          
+   token = lex_get_token(lc, T_NAME);
    if (pass == 1) {
       /*
        * Pickup writer command
@@ -532,8 +571,10 @@ static void store_writer(LEX *lc, RES_ITEM *item, int index, int pass)
 static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token;
+   char *type;
+   int newsize;
 
-   token = lex_get_token(lc, T_SKIP_EOL);           
+   token = lex_get_token(lc, T_SKIP_EOL);
    if (pass == 1) {
       /*
        * Pickup Wild-card string
@@ -542,17 +583,51 @@ static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass)
       case T_IDENTIFIER:
       case T_UNQUOTED_STRING:
       case T_QUOTED_STRING:
-        res_incexe.current_opts->wild.append(bstrdup(lc->str));
-         Dmsg3(900, "set wild %p size=%d %s\n", 
-           res_incexe.current_opts, res_incexe.current_opts->wild.size(),lc->str);
+        if (item->code == 1) {
+            type = "wilddir";
+           res_incexe.current_opts->wilddir.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->wilddir.size();
+        } else if (item->code == 2) {
+            type = "wildfile";
+           res_incexe.current_opts->wildfile.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->wildfile.size();
+        } else {
+            type = "wild";
+           res_incexe.current_opts->wild.append(bstrdup(lc->str));
+           newsize = res_incexe.current_opts->wild.size();
+        }
+         Dmsg4(9, "set %s %p size=%d %s\n",
+           type, res_incexe.current_opts, newsize, lc->str);
         break;
       default:
          scan_err1(lc, _("Expected a wild-card string, got: %s\n"), lc->str);
-      }                                
+      }
    }
    scan_to_eol(lc);
 }
 
+/* Store fstype info */
+static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass)
+{
+   int token;
+
+   token = lex_get_token(lc, T_SKIP_EOL);
+   if (pass == 1) {
+      /* Pickup fstype string */
+      switch (token) {
+      case T_IDENTIFIER:
+      case T_UNQUOTED_STRING:
+      case T_QUOTED_STRING:
+        res_incexe.current_opts->fstype.append(bstrdup(lc->str));
+         Dmsg3(900, "set fstype %p size=%d %s\n",
+           res_incexe.current_opts, res_incexe.current_opts->fstype.size(), lc->str);
+        break;
+      default:
+         scan_err1(lc, _("Expected an fstype string, got: %s\n"), lc->str);
+      }
+   }
+   scan_to_eol(lc);
+}
 
 /*
  * Store Filename info. Note, for minor efficiency reasons, we
@@ -564,7 +639,7 @@ static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass)
    int token;
    INCEXE *incexe;
 
-   token = lex_get_token(lc, T_SKIP_EOL);           
+   token = lex_get_token(lc, T_SKIP_EOL);
    if (pass == 1) {
       /* Pickup Filename string
        */
@@ -584,11 +659,12 @@ static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass)
            break;
         default:
             scan_err1(lc, _("Expected a filename, got: %s"), lc->str);
-      }                                
+      }
    }
    scan_to_eol(lc);
 }
 
+
 /*
  * Come here when Options seen in Include/Exclude
  */
@@ -596,7 +672,7 @@ static void options_res(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token, i;
 
-   token = lex_get_token(lc, T_SKIP_EOL);           
+   token = lex_get_token(lc, T_SKIP_EOL);
    if (token != T_BOB) {
       scan_err1(lc, "Expecting open brace. Got %s", lc->str);
    }
@@ -604,7 +680,7 @@ static void options_res(LEX *lc, RES_ITEM *item, int index, int pass)
    if (pass == 1) {
       setup_current_opts();
    }
-        
+
    while ((token = lex_get_token(lc, T_ALL)) != T_EOF) {
       if (token == T_EOL) {
         continue;
@@ -672,8 +748,13 @@ static void setup_current_opts(void)
    FOPTS *fo = (FOPTS *)malloc(sizeof(FOPTS));
    memset(fo, 0, sizeof(FOPTS));
    fo->regex.init(1, true);
+   fo->regexdir.init(1, true);
+   fo->regexfile.init(1, true);
    fo->wild.init(1, true);
+   fo->wilddir.init(1, true);
+   fo->wildfile.init(1, true);
    fo->base.init(1, true);
+   fo->fstype.init(1, true);
    res_incexe.current_opts = fo;
    if (res_incexe.num_opts == 0) {
       res_incexe.opts_list = (FOPTS **)malloc(sizeof(FOPTS *));
index 676d1bcef7e1a77bbaaf62afd9ffefa57804ddc8..2d9bfc815076489994449786110fcd770f63702e 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -74,15 +74,15 @@ void init_job_server(int max_workers)
 
 void term_job_server()
 {
-   jobq_destroy(&job_queue);         /* ignore any errors */
+   jobq_destroy(&job_queue);          /* ignore any errors */
 }
 
 /*
  * Run a job -- typically called by the scheduler, but may also
- *             be called by the UA (Console program).
+ *              be called by the UA (Console program).
  *
  *  Returns: 0 on failure
- *          JobId on success
+ *           JobId on success
  *
  */
 JobId_t run_job(JCR *jcr)
@@ -107,12 +107,12 @@ JobId_t run_job(JCR *jcr)
     */
    Dmsg0(50, "Open database\n");
    jcr->db=db_init_database(jcr, jcr->catalog->db_name, jcr->catalog->db_user,
-                           jcr->catalog->db_password, jcr->catalog->db_address,
-                           jcr->catalog->db_port, jcr->catalog->db_socket,
-                           jcr->catalog->mult_db_connections);
+                            jcr->catalog->db_password, jcr->catalog->db_address,
+                            jcr->catalog->db_port, jcr->catalog->db_socket,
+                            jcr->catalog->mult_db_connections);
    if (!jcr->db || !db_open_database(jcr, jcr->db)) {
       Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\".\n"),
-                jcr->catalog->db_name);
+                 jcr->catalog->db_name);
       if (jcr->db) {
          Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
       }
@@ -157,7 +157,7 @@ bail_out:
 
 
 /* 
- * This is the engine called by jobq.c:jobq_add() when we were pulled               
+ * This is the engine called by jobq.c:jobq_add() when we were pulled                
  *  from the work queue.
  *  At this point, we are running in our own thread and all
  *    necessary resources are allocated -- see jobq.c
@@ -172,7 +172,7 @@ static void *job_thread(void *arg)
 
    for ( ;; ) {
       Dmsg0(200, "=====Start Job=========\n");
-      jcr->start_time = time(NULL);     /* set the real start time */
+      jcr->start_time = time(NULL);      /* set the real start time */
       jcr->jr.StartTime = jcr->start_time;
       set_jcr_job_status(jcr, JS_Running);
       if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
@@ -180,108 +180,108 @@ static void *job_thread(void *arg)
       }
 
       if (job_canceled(jcr)) {
-        update_job_end_record(jcr);
+         update_job_end_record(jcr);
       } else if (jcr->job->MaxStartDelay != 0 && jcr->job->MaxStartDelay <
-         (utime_t)(jcr->start_time - jcr->sched_time)) {
+          (utime_t)(jcr->start_time - jcr->sched_time)) {
          Jmsg(jcr, M_FATAL, 0, _("Job canceled because max start delay time exceeded.\n"));
-        set_jcr_job_status(jcr, JS_Canceled);
-        update_job_end_record(jcr);
+         set_jcr_job_status(jcr, JS_Canceled);
+         update_job_end_record(jcr);
       } else {
 
-        /* Run Job */
-        if (jcr->job->RunBeforeJob) {
-           POOLMEM *before = get_pool_memory(PM_FNAME);
-           int status;
-           BPIPE *bpipe;
-           char line[MAXSTRING];
-           
+         /* Run Job */
+         if (jcr->job->RunBeforeJob) {
+            POOLMEM *before = get_pool_memory(PM_FNAME);
+            int status;
+            BPIPE *bpipe;
+            char line[MAXSTRING];
+            
             before = edit_job_codes(jcr, before, jcr->job->RunBeforeJob, "");
             bpipe = open_bpipe(before, 0, "r");
-           free_pool_memory(before);
-           while (fgets(line, sizeof(line), bpipe->rfd)) {
+            free_pool_memory(before);
+            while (fgets(line, sizeof(line), bpipe->rfd)) {
                Jmsg(jcr, M_INFO, 0, _("RunBefore: %s"), line);
-           }
-           status = close_bpipe(bpipe);
-           if (status != 0) {
-              berrno be;
+            }
+            status = close_bpipe(bpipe);
+            if (status != 0) {
+               berrno be;
                Jmsg(jcr, M_FATAL, 0, _("RunBeforeJob error: ERR=%s\n"), be.strerror(status));
-              set_jcr_job_status(jcr, JS_FatalError);
-              update_job_end_record(jcr);
-              goto bail_out;
-           }
-        }
-        switch (jcr->JobType) {
-        case JT_BACKUP:
-           do_backup(jcr);
-           if (jcr->JobStatus == JS_Terminated) {
-              do_autoprune(jcr);
-           }
-           break;
-        case JT_VERIFY:
-           do_verify(jcr);
-           if (jcr->JobStatus == JS_Terminated) {
-              do_autoprune(jcr);
-           }
-           break;
-        case JT_RESTORE:
-           do_restore(jcr);
-           if (jcr->JobStatus == JS_Terminated) {
-              do_autoprune(jcr);
-           }
-           break;
-        case JT_ADMIN:
-           do_admin(jcr);
-           if (jcr->JobStatus == JS_Terminated) {
-              do_autoprune(jcr);
-           }
-           break;
-        case JT_MIGRATION:
-        case JT_COPY:
-        case JT_ARCHIVE:
-           do_mac(jcr);              /* migration, archive, copy */
-           if (jcr->JobStatus == JS_Terminated) {
-              do_autoprune(jcr);
-           }
-           break;
-        default:
+               set_jcr_job_status(jcr, JS_FatalError);
+               update_job_end_record(jcr);
+               goto bail_out;
+            }
+         }
+         switch (jcr->JobType) {
+         case JT_BACKUP:
+            do_backup(jcr);
+            if (jcr->JobStatus == JS_Terminated) {
+               do_autoprune(jcr);
+            }
+            break;
+         case JT_VERIFY:
+            do_verify(jcr);
+            if (jcr->JobStatus == JS_Terminated) {
+               do_autoprune(jcr);
+            }
+            break;
+         case JT_RESTORE:
+            do_restore(jcr);
+            if (jcr->JobStatus == JS_Terminated) {
+               do_autoprune(jcr);
+            }
+            break;
+         case JT_ADMIN:
+            do_admin(jcr);
+            if (jcr->JobStatus == JS_Terminated) {
+               do_autoprune(jcr);
+            }
+            break;
+         case JT_MIGRATION:
+         case JT_COPY:
+         case JT_ARCHIVE:
+            do_mac(jcr);              /* migration, archive, copy */
+            if (jcr->JobStatus == JS_Terminated) {
+               do_autoprune(jcr);
+            }
+            break;
+         default:
             Pmsg1(0, "Unimplemented job type: %d\n", jcr->JobType);
-           break;
-        }
-        if ((jcr->job->RunAfterJob && jcr->JobStatus == JS_Terminated) ||
-            (jcr->job->RunAfterFailedJob && jcr->JobStatus != JS_Terminated)) {
-           POOLMEM *after = get_pool_memory(PM_FNAME);
-           int status;
-           BPIPE *bpipe;
-           char line[MAXSTRING];
-           
-           if (jcr->JobStatus == JS_Terminated) {
+            break;
+         }
+         if ((jcr->job->RunAfterJob && jcr->JobStatus == JS_Terminated) ||
+             (jcr->job->RunAfterFailedJob && jcr->JobStatus != JS_Terminated)) {
+            POOLMEM *after = get_pool_memory(PM_FNAME);
+            int status;
+            BPIPE *bpipe;
+            char line[MAXSTRING];
+            
+            if (jcr->JobStatus == JS_Terminated) {
                after = edit_job_codes(jcr, after, jcr->job->RunAfterJob, "");
-           } else {
+            } else {
                after = edit_job_codes(jcr, after, jcr->job->RunAfterFailedJob, "");
-           }
+            }
             bpipe = open_bpipe(after, 0, "r");
-           free_pool_memory(after);
-           while (fgets(line, sizeof(line), bpipe->rfd)) {
+            free_pool_memory(after);
+            while (fgets(line, sizeof(line), bpipe->rfd)) {
                Jmsg(jcr, M_INFO, 0, _("RunAfter: %s"), line);
-           }
-           status = close_bpipe(bpipe);
-           /*
-            * Note, if we get an error here, do not mark the
-            *  job in error, simply report the error condition.   
-            */
-           if (status != 0) {
-              berrno be;
-              if (jcr->JobStatus == JS_Terminated) {
+            }
+            status = close_bpipe(bpipe);
+            /*
+             * Note, if we get an error here, do not mark the
+             *  job in error, simply report the error condition.   
+             */
+            if (status != 0) {
+               berrno be;
+               if (jcr->JobStatus == JS_Terminated) {
                   Jmsg(jcr, M_WARNING, 0, _("RunAfterJob error: ERR=%s\n"), be.strerror(status));
-              } else {
+               } else {
                   Jmsg(jcr, M_FATAL, 0, _("RunAfterFailedJob error: ERR=%s\n"), be.strerror(status));
-              }
-           }
-        }
-        /* Send off any queued messages */
-        if (jcr->msg_queue->size() > 0) {
-           dequeue_messages(jcr);
-        }
+               }
+            }
+         }
+         /* Send off any queued messages */
+         if (jcr->msg_queue->size() > 0) {
+            dequeue_messages(jcr);
+         }
       }
 bail_out:
       break;
@@ -295,10 +295,10 @@ bail_out:
 
 /*
  * Cancel a job -- typically called by the UA (Console program), but may also
- *             be called by the job watchdog.
+ *              be called by the job watchdog.
  * 
  *  Returns: 1 if cancel appears to be successful
- *          0 on failure. Message sent to ua->jcr.
+ *           0 on failure. Message sent to ua->jcr.
  */
 int cancel_job(UAContext *ua, JCR *jcr)
 {
@@ -314,51 +314,51 @@ int cancel_job(UAContext *ua, JCR *jcr)
    case JS_WaitStartTime:
       set_jcr_job_status(jcr, JS_Canceled);
       bsendmsg(ua, _("JobId %d, Job %s marked to be canceled.\n"),
-             jcr->JobId, jcr->Job);
+              jcr->JobId, jcr->Job);
       jobq_remove(&job_queue, jcr); /* attempt to remove it from queue */
       return 1;
-        
+         
    default:
       set_jcr_job_status(jcr, JS_Canceled);
 
       /* Cancel File daemon */
       if (jcr->file_bsock) {
-        ua->jcr->client = jcr->client;
-        if (!connect_to_file_daemon(ua->jcr, 10, FDConnectTimeout, 1)) {
+         ua->jcr->client = jcr->client;
+         if (!connect_to_file_daemon(ua->jcr, 10, FDConnectTimeout, 1)) {
             bsendmsg(ua, _("Failed to connect to File daemon.\n"));
-           return 0;
-        }
+            return 0;
+         }
          Dmsg0(200, "Connected to file daemon\n");
-        fd = ua->jcr->file_bsock;
+         fd = ua->jcr->file_bsock;
          bnet_fsend(fd, "cancel Job=%s\n", jcr->Job);
-        while (bnet_recv(fd) >= 0) {
+         while (bnet_recv(fd) >= 0) {
             bsendmsg(ua, "%s", fd->msg);
-        }
-        bnet_sig(fd, BNET_TERMINATE);
-        bnet_close(fd);
-        ua->jcr->file_bsock = NULL;
+         }
+         bnet_sig(fd, BNET_TERMINATE);
+         bnet_close(fd);
+         ua->jcr->file_bsock = NULL;
       }
 
       /* Cancel Storage daemon */
       if (jcr->store_bsock) {
-        if (!ua->jcr->storage[0]) {
-           copy_storage(ua->jcr, jcr);
-        } else {
-           ua->jcr->store = jcr->store;
-        }
-        if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) {
+         if (!ua->jcr->storage[0]) {
+            copy_storage(ua->jcr, jcr);
+         } else {
+            set_storage(ua->jcr, jcr->store);
+         }
+         if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) {
             bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
-           return 0;
-        }
+            return 0;
+         }
          Dmsg0(200, "Connected to storage daemon\n");
-        sd = ua->jcr->store_bsock;
+         sd = ua->jcr->store_bsock;
          bnet_fsend(sd, "cancel Job=%s\n", jcr->Job);
-        while (bnet_recv(sd) >= 0) {
+         while (bnet_recv(sd) >= 0) {
             bsendmsg(ua, "%s", sd->msg);
-        }
-        bnet_sig(sd, BNET_TERMINATE);
-        bnet_close(sd);
-        ua->jcr->store_bsock = NULL;
+         }
+         bnet_sig(sd, BNET_TERMINATE);
+         bnet_close(sd);
+         ua->jcr->store_bsock = NULL;
       }
    }
 
@@ -388,10 +388,10 @@ static void job_monitor_watchdog(watchdog_t *self)
 
       if (jcr->JobId == 0) {
          Dmsg2(400, "Skipping JCR %p (%s) with JobId 0\n",
-              jcr, jcr->Job);
-        /* Keep reference counts correct */
-        free_locked_jcr(jcr);
-        continue;
+               jcr, jcr->Job);
+         /* Keep reference counts correct */
+         free_locked_jcr(jcr);
+         continue;
       }
 
       /* check MaxWaitTime */
@@ -402,12 +402,12 @@ static void job_monitor_watchdog(watchdog_t *self)
 
       if (cancel) {
          Dmsg3(200, "Cancelling JCR %p jobid %d (%s)\n",
-              jcr, jcr->JobId, jcr->Job);
+               jcr, jcr->JobId, jcr->Job);
 
-        UAContext *ua = new_ua_context(jcr);
-        ua->jcr = control_jcr;
-        cancel_job(ua, jcr);
-        free_ua_context(ua);
+         UAContext *ua = new_ua_context(jcr);
+         ua->jcr = control_jcr;
+         cancel_job(ua, jcr);
+         free_ua_context(ua);
 
          Dmsg1(200, "Have cancelled JCR %p\n", jcr);
       }
@@ -431,12 +431,12 @@ static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr)
    }
    if ((watchdog_time - jcr->start_time) < jcr->job->MaxWaitTime) {
       Dmsg3(200, "Job %p (%s) with MaxWaitTime %d not expired\n",
-           jcr, jcr->Job, jcr->job->MaxWaitTime);
+            jcr, jcr->Job, jcr->job->MaxWaitTime);
       return false;
    }
    Dmsg3(200, "Job %d (%s): MaxWaitTime of %d seconds exceeded, "
          "checking status\n",
-        jcr->JobId, jcr->Job, jcr->job->MaxWaitTime);
+         jcr->JobId, jcr->Job, jcr->job->MaxWaitTime);
    switch (jcr->JobStatus) {
    case JS_Created:
    case JS_Blocked:
@@ -457,12 +457,12 @@ static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr)
       case JS_WaitMount:
       case JS_WaitMedia:
       case JS_WaitFD:
-        cancel = true;
+         cancel = true;
          Dmsg0(200, "JCR blocked in #2\n");
-        break;
+         break;
       default:
          Dmsg0(200, "JCR not blocked in #2\n");
-        break;
+         break;
       }
       break;
    case JS_Terminated:
@@ -473,7 +473,7 @@ static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr)
       break;
    default:
       Jmsg1(jcr, M_ERROR, 0, _("Unhandled job status code %d\n"),
-           jcr->JobStatus);
+            jcr->JobStatus);
    }
    Dmsg3(200, "MaxWaitTime result: %scancel JCR %p (%s)\n",
          cancel ? "" : "do not ", jcr, jcr->job);
@@ -494,7 +494,7 @@ static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr)
    }
    if ((watchdog_time - jcr->start_time) < jcr->job->MaxRunTime) {
       Dmsg3(200, "Job %p (%s) with MaxRunTime %d not expired\n",
-           jcr, jcr->Job, jcr->job->MaxRunTime);
+            jcr, jcr->Job, jcr->job->MaxRunTime);
       return false;
    }
 
@@ -521,7 +521,7 @@ static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr)
       break;
    default:
       Jmsg1(jcr, M_ERROR, 0, _("Unhandled job status code %d\n"),
-           jcr->JobStatus);
+            jcr->JobStatus);
    }
 
    Dmsg3(200, "MaxRunTime result: %scancel JCR %p (%s)\n",
@@ -549,13 +549,13 @@ bool get_or_create_client_record(JCR *jcr)
    pm_strcpy(jcr->client_name, jcr->client->hdr.name);
    if (!db_create_client_record(jcr, jcr->db, &cr)) {
       Jmsg(jcr, M_FATAL, 0, _("Could not create Client record. ERR=%s\n"), 
-        db_strerror(jcr->db));
+         db_strerror(jcr->db));
       return false;
    }
    jcr->jr.ClientId = cr.ClientId;
    if (cr.Uname[0]) {
       if (!jcr->client_uname) {
-        jcr->client_uname = get_pool_memory(PM_NAME);
+         jcr->client_uname = get_pool_memory(PM_NAME);
       }
       pm_strcpy(jcr->client_uname, cr.Uname);
    }
@@ -585,14 +585,14 @@ bool get_or_create_fileset_record(JCR *jcr, FILESET_DBR *fsr)
        !db_get_fileset_record(jcr, jcr->db, fsr)) {
       if (!db_create_fileset_record(jcr, jcr->db, fsr)) {
          Jmsg(jcr, M_ERROR, 0, _("Could not create FileSet \"%s\" record. ERR=%s\n"), 
-           fsr->FileSet, db_strerror(jcr->db));
-        return false;
+            fsr->FileSet, db_strerror(jcr->db));
+         return false;
       }   
    }
    jcr->jr.FileSetId = fsr->FileSetId;
    if (fsr->created) {
       Jmsg(jcr, M_INFO, 0, _("Created new FileSet record \"%s\" %s\n"), 
-        fsr->FileSet, fsr->cCreateTime);
+         fsr->FileSet, fsr->cCreateTime);
    }
    Dmsg2(119, "Created FileSet %s record %u\n", jcr->fileset->hdr.name, 
       jcr->jr.FileSetId);
@@ -603,7 +603,7 @@ void init_jcr_job_record(JCR *jcr)
 {
    jcr->jr.SchedTime = jcr->sched_time;
    jcr->jr.StartTime = jcr->start_time;
-   jcr->jr.EndTime = 0;              /* perhaps rescheduled, clear it */
+   jcr->jr.EndTime = 0;               /* perhaps rescheduled, clear it */
    jcr->jr.JobType = jcr->JobType;
    jcr->jr.JobLevel = jcr->JobLevel;
    jcr->jr.JobStatus = jcr->JobStatus;
@@ -627,7 +627,7 @@ void update_job_end_record(JCR *jcr)
    jcr->jr.VolSessionTime = jcr->VolSessionTime;
    if (!db_update_job_end_record(jcr, jcr->db, &jcr->jr)) {
       Jmsg(jcr, M_WARNING, 0, _("Error updating job record. %s"), 
-        db_strerror(jcr->db));
+         db_strerror(jcr->db));
    }
 }
 
@@ -652,21 +652,21 @@ void create_unique_job_name(JCR *jcr, const char *base_name)
    /* Guarantee unique start time -- maximum one per second, and
     * thus unique Job Name 
     */
-   P(mutex);                         /* lock creation of jobs */
+   P(mutex);                          /* lock creation of jobs */
    now = time(NULL);
    while (now == last_start_time) {
       bmicrosleep(0, 500000);
       now = time(NULL);
    }
    last_start_time = now;
-   V(mutex);                         /* allow creation of jobs */
+   V(mutex);                          /* allow creation of jobs */
    jcr->start_time = now;
    /* Form Unique JobName */
    localtime_r(&now, &tm);
    /* Use only characters that are permitted in Windows filenames */
    strftime(dt, sizeof(dt), "%Y-%m-%d_%H.%M.%S", &tm); 
    bstrncpy(name, base_name, sizeof(name));
-   name[sizeof(name)-22] = 0;         /* truncate if too long */
+   name[sizeof(name)-22] = 0;          /* truncate if too long */
    bsnprintf(jcr->Job, sizeof(jcr->Job), "%s.%s", name, dt); /* add date & time */
    /* Convert spaces into underscores */
    for (p=jcr->Job; *p; p++) {
@@ -676,15 +676,9 @@ void create_unique_job_name(JCR *jcr, const char *base_name)
    }
 }
 
-/*
- * Free the Job Control Record if no one is still using it.
- *  Called from main free_jcr() routine in src/lib/jcr.c so
- *  that we can do our Director specific cleanup of the jcr.
- */
-void dird_free_jcr(JCR *jcr)
+/* Called directly from job rescheduling */
+void dird_free_jcr_pointers(JCR *jcr)
 {
-   Dmsg0(200, "Start dird free_jcr\n");
-
    if (jcr->sd_auth_key) {
       free(jcr->sd_auth_key);
       jcr->sd_auth_key = NULL;
@@ -723,6 +717,27 @@ void dird_free_jcr(JCR *jcr)
    }
    if (jcr->term_wait_inited) {
       pthread_cond_destroy(&jcr->term_wait);
+      jcr->term_wait_inited = false;
+   }
+}
+
+/*
+ * Free the Job Control Record if no one is still using it.
+ *  Called from main free_jcr() routine in src/lib/jcr.c so
+ *  that we can do our Director specific cleanup of the jcr.
+ */
+void dird_free_jcr(JCR *jcr)
+{
+   Dmsg0(200, "Start dird free_jcr\n");
+
+   dird_free_jcr_pointers(jcr);
+
+   /* Delete lists setup to hold storage pointers */
+   for (int i=0; i<MAX_STORE; i++) {
+      if (jcr->storage[i]) {
+         delete jcr->storage[i];
+         jcr->storage[i] = NULL;
+      }
    }
    jcr->job_end_push.destroy();
    Dmsg0(200, "End dird free_jcr\n");
@@ -749,10 +764,20 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
       break;
    }
    jcr->JobPriority = job->Priority;
+   /* Copy storage definitions -- deleted in dir_free_jcr above */
    for (int i=0; i<MAX_STORE; i++) {
-      jcr->storage[i] = job->storage[i];
+      STORE *st;
+      if (job->storage[i]) {
+         if (jcr->storage[i]) {
+            delete jcr->storage[i];
+         }
+         jcr->storage[i] = New(alist(10, not_owned_by_alist));
+         foreach_alist(st, job->storage[i]) {
+            jcr->storage[i]->append(st);
+         }
+      }
    }
-   if (!jcr->store && jcr->storage[0]) {
+   if (jcr->storage[0]) {
       jcr->store = (STORE *)jcr->storage[0]->first();
    }
    jcr->client = job->client;
@@ -782,17 +807,17 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
    if (jcr->JobLevel == 0) {
       switch (jcr->JobType) {
       case JT_VERIFY:
-        jcr->JobLevel = L_VERIFY_CATALOG;
-        break;
+         jcr->JobLevel = L_VERIFY_CATALOG;
+         break;
       case JT_BACKUP:
-        jcr->JobLevel = L_INCREMENTAL;
-        break;
+         jcr->JobLevel = L_INCREMENTAL;
+         break;
       case JT_RESTORE:
       case JT_ADMIN:
-        jcr->JobLevel = L_NONE;
-        break;
+         jcr->JobLevel = L_NONE;
+         break;
       default:
-        break;
+         break;
       }
    }
 }
@@ -804,16 +829,26 @@ void copy_storage(JCR *new_jcr, JCR *old_jcr)
 {
    for (int i=0; i < MAX_STORE; i++) {
       if (old_jcr->storage[i]) {
-        STORE *st;
-        new_jcr->storage[i] = New(alist(10, not_owned_by_alist));
-        foreach_alist(st, old_jcr->storage[i]) {
-           new_jcr->storage[i]->append(st);
-        }
+         STORE *st;
+         new_jcr->storage[i] = New(alist(10, not_owned_by_alist));
+         foreach_alist(st, old_jcr->storage[i]) {
+            new_jcr->storage[i]->append(st);
+         }
+         if (old_jcr->storage[i]) {
+            delete old_jcr->storage[i];
+         }
       }
       if (old_jcr->store) {
-        new_jcr->store = old_jcr->store;
+         new_jcr->store = old_jcr->store;
       } else if (new_jcr->storage[0]) {
-        new_jcr->store = (STORE *)new_jcr->storage[0]->first();
+         new_jcr->store = (STORE *)new_jcr->storage[0]->first();
       }
    }
 }
+
+/* Set storage override */
+void set_storage(JCR *jcr, STORE *store)
+{
+   jcr->store = store;
+   jcr->storage[0]->prepend(store);
+}
index 12e2c434c190b562aceded4f769ae6d34d513f29..a83d4cd66938c795650bfeed38648d06eb5e8538 100755 (executable)
@@ -18,7 +18,7 @@
  *
  */
 /*
-   Copyright (C) 2003-2004 Kern Sibbald and John Walker
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -40,6 +40,7 @@
 #include "bacula.h"
 #include "dird.h"
 
+extern JCR *jobs;
 
 /* Forward referenced functions */
 extern "C" void *jobq_server(void *arg);
@@ -47,7 +48,9 @@ extern "C" void *sched_wait(void *arg);
 
 static int   start_server(jobq_t *jq);
 
-/*   
+
+
+/*
  * Initialize a job queue
  *
  *  Returns: 0 on success
@@ -57,9 +60,10 @@ int jobq_init(jobq_t *jq, int threads, void *(*engine)(void *arg))
 {
    int stat;
    jobq_item_t *item = NULL;
-                       
+
    if ((stat = pthread_attr_init(&jq->attr)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_attr_init: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_attr_init: ERR=%s\n", be.strerror(stat));
       return stat;
    }
    if ((stat = pthread_attr_setdetachstate(&jq->attr, PTHREAD_CREATE_DETACHED)) != 0) {
@@ -67,12 +71,14 @@ int jobq_init(jobq_t *jq, int threads, void *(*engine)(void *arg))
       return stat;
    }
    if ((stat = pthread_mutex_init(&jq->mutex, NULL)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_init: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_init: ERR=%s\n", be.strerror(stat));
       pthread_attr_destroy(&jq->attr);
       return stat;
    }
    if ((stat = pthread_cond_init(&jq->work, NULL)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_cond_init: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_cond_init: ERR=%s\n", be.strerror(stat));
       pthread_mutex_destroy(&jq->mutex);
       pthread_attr_destroy(&jq->attr);
       return stat;
@@ -82,7 +88,7 @@ int jobq_init(jobq_t *jq, int threads, void *(*engine)(void *arg))
    jq->num_workers = 0;              /* no threads yet */
    jq->idle_workers = 0;             /* no idle threads */
    jq->engine = engine;              /* routine to run */
-   jq->valid = JOBQ_VALID; 
+   jq->valid = JOBQ_VALID;
    /* Initialize the job queues */
    jq->waiting_jobs = New(dlist(item, &item->link));
    jq->running_jobs = New(dlist(item, &item->link));
@@ -100,46 +106,50 @@ int jobq_destroy(jobq_t *jq)
 {
    int stat, stat1, stat2;
 
-  if (jq->valid != JOBQ_VALID) {
-     return EINVAL;
-  }
-  if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-     Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
-     return stat;
-  }
-  jq->valid = 0;                     /* prevent any more operations */
-
-  /* 
-   * If any threads are active, wake them 
-   */
-  if (jq->num_workers > 0) {
-     jq->quit = true;
-     if (jq->idle_workers) {
-       if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
-           Jmsg1(NULL, M_ERROR, 0, "pthread_cond_broadcast: ERR=%s\n", strerror(stat));
-          pthread_mutex_unlock(&jq->mutex);
-          return stat;
-       }
-     }
-     while (jq->num_workers > 0) {
-       if ((stat = pthread_cond_wait(&jq->work, &jq->mutex)) != 0) {
-           Jmsg1(NULL, M_ERROR, 0, "pthread_cond_wait: ERR=%s\n", strerror(stat));
-          pthread_mutex_unlock(&jq->mutex);
-          return stat;
-       }
-     }
-  }
-  if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
-     Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
-     return stat;
-  }
-  stat = pthread_mutex_destroy(&jq->mutex);
-  stat1 = pthread_cond_destroy(&jq->work);
-  stat2 = pthread_attr_destroy(&jq->attr);
-  delete jq->waiting_jobs;
-  delete jq->running_jobs;
-  delete jq->ready_jobs;
-  return (stat != 0 ? stat : (stat1 != 0 ? stat1 : stat2));
+   if (jq->valid != JOBQ_VALID) {
+      return EINVAL;
+   }
+   if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+      return stat;
+   }
+   jq->valid = 0;                     /* prevent any more operations */
+
+   /* 
+    * If any threads are active, wake them 
+    */
+   if (jq->num_workers > 0) {
+      jq->quit = true;
+      if (jq->idle_workers) {
+        if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
+           berrno be;
+            Jmsg1(NULL, M_ERROR, 0, "pthread_cond_broadcast: ERR=%s\n", be.strerror(stat));
+           pthread_mutex_unlock(&jq->mutex);
+           return stat;
+        }
+      }
+      while (jq->num_workers > 0) {
+        if ((stat = pthread_cond_wait(&jq->work, &jq->mutex)) != 0) {
+           berrno be;
+            Jmsg1(NULL, M_ERROR, 0, "pthread_cond_wait: ERR=%s\n", be.strerror(stat));
+           pthread_mutex_unlock(&jq->mutex);
+           return stat;
+        }
+      }
+   }
+   if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
+      return stat;
+   }
+   stat  = pthread_mutex_destroy(&jq->mutex);
+   stat1 = pthread_cond_destroy(&jq->work);
+   stat2 = pthread_attr_destroy(&jq->attr);
+   delete jq->waiting_jobs;
+   delete jq->running_jobs;
+   delete jq->ready_jobs;
+   return (stat != 0 ? stat : (stat1 != 0 ? stat1 : stat2));
 }
 
 struct wait_pkt {
@@ -154,24 +164,24 @@ struct wait_pkt {
  *  most jobs are put into the job queue only when their
  *  scheduled time arives.
  */
-extern "C"  
+extern "C"
 void *sched_wait(void *arg)
 {
    JCR *jcr = ((wait_pkt *)arg)->jcr;
    jobq_t *jq = ((wait_pkt *)arg)->jq;
 
-   Dmsg0(300, "Enter sched_wait.\n");
+   Dmsg0(2300, "Enter sched_wait.\n");
    free(arg);
    time_t wtime = jcr->sched_time - time(NULL);
    set_jcr_job_status(jcr, JS_WaitStartTime);
    /* Wait until scheduled time arrives */
    if (wtime > 0) {
-      Jmsg(jcr, M_INFO, 0, _("Job %s waiting %d seconds for scheduled start time.\n"), 
+      Jmsg(jcr, M_INFO, 0, _("Job %s waiting %d seconds for scheduled start time.\n"),
         jcr->Job, wtime);
    }
-   /* Check every 30 seconds if canceled */ 
+   /* Check every 30 seconds if canceled */
    while (wtime > 0) {
-      Dmsg2(300, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, wtime);
+      Dmsg2(2300, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, wtime);
       if (wtime > 30) {
         wtime = 30;
       }
@@ -185,16 +195,16 @@ void *sched_wait(void *arg)
    jobq_add(jq, jcr);
    V(jcr->mutex);
    free_jcr(jcr);                    /* we are done with jcr */
-   Dmsg0(300, "Exit sched_wait\n");
+   Dmsg0(2300, "Exit sched_wait\n");
    return NULL;
 }
 
 /*
  *  Add a job to the queue
  *    jq is a queue that was created with jobq_init
- * 
+ *
  *  On entry jcr->mutex must be locked.
- *   
+ *
  */
 int jobq_add(jobq_t *jq, JCR *jcr)
 {
@@ -204,30 +214,32 @@ int jobq_add(jobq_t *jq, JCR *jcr)
    time_t wtime = jcr->sched_time - time(NULL);
    pthread_t id;
    wait_pkt *sched_pkt;
-    
-   Dmsg3(300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
+
+   Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
    if (jq->valid != JOBQ_VALID) {
       Jmsg0(jcr, M_ERROR, 0, "Jobq_add queue not initialized.\n");
       return EINVAL;
    }
 
    jcr->use_count++;                 /* mark jcr in use by us */
-   Dmsg3(300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
+   Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
    if (!job_canceled(jcr) && wtime > 0) {
       set_thread_concurrency(jq->max_workers + 2);
       sched_pkt = (wait_pkt *)malloc(sizeof(wait_pkt));
       sched_pkt->jcr = jcr;
       sched_pkt->jq = jq;
-      jcr->use_count--;           /* release our use of jcr */
+//    jcr->use_count--;           /* release our use of jcr */
       stat = pthread_create(&id, &jq->attr, sched_wait, (void *)sched_pkt);       
       if (stat != 0) {               /* thread not created */
-         Jmsg1(jcr, M_ERROR, 0, "pthread_thread_create: ERR=%s\n", strerror(stat));
+        berrno be;
+         Jmsg1(jcr, M_ERROR, 0, "pthread_thread_create: ERR=%s\n", be.strerror(stat));
       }
       return stat;
    }
 
    if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-      Jmsg1(jcr, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(jcr, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
       jcr->use_count--;              /* release jcr */
       return stat;
    }
@@ -241,15 +253,15 @@ int jobq_add(jobq_t *jq, JCR *jcr)
    if (job_canceled(jcr)) {
       /* Add job to ready queue so that it is canceled quickly */
       jq->ready_jobs->prepend(item);
-      Dmsg1(300, "Prepended job=%d to ready queue\n", jcr->JobId);
+      Dmsg1(2300, "Prepended job=%d to ready queue\n", jcr->JobId);
    } else {
       /* Add this job to the wait queue in priority sorted order */
       foreach_dlist(li, jq->waiting_jobs) {
-         Dmsg2(300, "waiting item jobid=%d priority=%d\n",
+         Dmsg2(2300, "waiting item jobid=%d priority=%d\n",
            li->jcr->JobId, li->jcr->JobPriority);
         if (li->jcr->JobPriority > jcr->JobPriority) {
            jq->waiting_jobs->insert_before(item, li);
-            Dmsg2(300, "insert_before jobid=%d before waiting job=%d\n", 
+            Dmsg2(2300, "insert_before jobid=%d before waiting job=%d\n",
               li->jcr->JobId, jcr->JobId);
            inserted = true;
            break;
@@ -258,7 +270,7 @@ int jobq_add(jobq_t *jq, JCR *jcr)
       /* If not jobs in wait queue, append it */
       if (!inserted) {
         jq->waiting_jobs->append(item);
-         Dmsg1(300, "Appended item jobid=%d to waiting queue\n", jcr->JobId);
+         Dmsg1(2300, "Appended item jobid=%d to waiting queue\n", jcr->JobId);
       }
    }
 
@@ -266,7 +278,7 @@ int jobq_add(jobq_t *jq, JCR *jcr)
    stat = start_server(jq);
 
    pthread_mutex_unlock(&jq->mutex);
-   Dmsg0(300, "Return jobq_add\n");
+   Dmsg0(2300, "Return jobq_add\n");
    return stat;
 }
 
@@ -284,14 +296,15 @@ int jobq_remove(jobq_t *jq, JCR *jcr)
    int stat;
    bool found = false;
    jobq_item_t *item;
-    
-   Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
+
+   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
    if (jq->valid != JOBQ_VALID) {
       return EINVAL;
    }
 
    if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
       return stat;
    }
 
@@ -303,19 +316,19 @@ int jobq_remove(jobq_t *jq, JCR *jcr)
    }
    if (!found) {
       pthread_mutex_unlock(&jq->mutex);
-      Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
+      Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
       return EINVAL;
    }
 
    /* Move item to be the first on the list */
    jq->waiting_jobs->remove(item);
    jq->ready_jobs->prepend(item);
-   Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);
-   
+   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);
+
    stat = start_server(jq);
 
    pthread_mutex_unlock(&jq->mutex);
-   Dmsg0(300, "Return jobq_remove\n");
+   Dmsg0(2300, "Return jobq_remove\n");
    return stat;
 }
 
@@ -330,17 +343,19 @@ static int start_server(jobq_t *jq)
 
    /* if any threads are idle, wake one */
    if (jq->idle_workers > 0) {
-      Dmsg0(300, "Signal worker to wake up\n");
+      Dmsg0(2300, "Signal worker to wake up\n");
       if ((stat = pthread_cond_signal(&jq->work)) != 0) {
-         Jmsg1(NULL, M_ERROR, 0, "pthread_cond_signal: ERR=%s\n", strerror(stat));
+        berrno be;
+         Jmsg1(NULL, M_ERROR, 0, "pthread_cond_signal: ERR=%s\n", be.strerror(stat));
         return stat;
       }
    } else if (jq->num_workers < jq->max_workers) {
-      Dmsg0(300, "Create worker thread\n");
+      Dmsg0(2300, "Create worker thread\n");
       /* No idle threads so create a new one */
       set_thread_concurrency(jq->max_workers + 1);
       if ((stat = pthread_create(&id, &jq->attr, jobq_server, (void *)jq)) != 0) {
-         Jmsg1(NULL, M_ERROR, 0, "pthread_create: ERR=%s\n", strerror(stat));
+        berrno be;
+         Jmsg1(NULL, M_ERROR, 0, "pthread_create: ERR=%s\n", be.strerror(stat));
         return stat;
       }
    }
@@ -348,12 +363,12 @@ static int start_server(jobq_t *jq)
 }
 
 
-/* 
+/*
  * This is the worker thread that serves the job queue.
- * When all the resources are acquired for the job, 
+ * When all the resources are acquired for the job,
  *  it will call the user's engine.
  */
-extern "C"  
+extern "C"
 void *jobq_server(void *arg)
 {
    struct timespec timeout;
@@ -363,9 +378,10 @@ void *jobq_server(void *arg)
    bool timedout = false;
    bool work = true;
 
-   Dmsg0(300, "Start jobq_server\n");
+   Dmsg0(2300, "Start jobq_server\n");
    if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
       return NULL;
    }
    jq->num_workers++;
@@ -374,7 +390,7 @@ void *jobq_server(void *arg)
       struct timeval tv;
       struct timezone tz;
 
-      Dmsg0(300, "Top of for loop\n");
+      Dmsg0(2300, "Top of for loop\n");
       if (!work && !jq->quit) {
         gettimeofday(&tv, &tz);
         timeout.tv_nsec = 0;
@@ -384,33 +400,33 @@ void *jobq_server(void *arg)
            /*
             * Wait 4 seconds, then if no more work, exit
             */
-            Dmsg0(300, "pthread_cond_timedwait()\n");
+            Dmsg0(2300, "pthread_cond_timedwait()\n");
            stat = pthread_cond_timedwait(&jq->work, &jq->mutex, &timeout);
            if (stat == ETIMEDOUT) {
-               Dmsg0(300, "timedwait timedout.\n");
+               Dmsg0(2300, "timedwait timedout.\n");
               timedout = true;
               break;
            } else if (stat != 0) {
                /* This shouldn't happen */
-               Dmsg0(300, "This shouldn't happen\n");
+               Dmsg0(2300, "This shouldn't happen\n");
               jq->num_workers--;
               pthread_mutex_unlock(&jq->mutex);
               return NULL;
            }
            break;
-        } 
+        }
       }
-      /* 
+      /*
        * If anything is in the ready queue, run it
        */
-      Dmsg0(300, "Checking ready queue.\n");
+      Dmsg0(2300, "Checking ready queue.\n");
       while (!jq->ready_jobs->empty() && !jq->quit) {
         JCR *jcr;
-        je = (jobq_item_t *)jq->ready_jobs->first(); 
+        je = (jobq_item_t *)jq->ready_jobs->first();
         jcr = je->jcr;
         jq->ready_jobs->remove(je);
         if (!jq->ready_jobs->empty()) {
-            Dmsg0(300, "ready queue not empty start server\n");
+            Dmsg0(2300, "ready queue not empty start server\n");
            if (start_server(jq) != 0) {
               jq->num_workers--;
               pthread_mutex_unlock(&jq->mutex);
@@ -418,40 +434,28 @@ void *jobq_server(void *arg)
            }
         }
         jq->running_jobs->append(je);
-         Dmsg1(300, "Took jobid=%d from ready and appended to run\n", jcr->JobId);
+         Dmsg1(2300, "Took jobid=%d from ready and appended to run\n", jcr->JobId);
 
         /* Release job queue lock */
-        if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
-            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
-           jq->num_workers--;
-           return NULL;
-        }
+        V(jq->mutex);
 
          /* Call user's routine here */
-         Dmsg1(300, "Calling user engine for jobid=%d\n", jcr->JobId);
+         Dmsg1(2300, "Calling user engine for jobid=%d\n", jcr->JobId);
         jq->engine(je->jcr);
 
-         Dmsg1(300, "Back from user engine jobid=%d.\n", jcr->JobId);
+         Dmsg1(2300, "Back from user engine jobid=%d.\n", jcr->JobId);
 
         /* Reacquire job queue lock */
-        if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
-           jq->num_workers--;
-           free(je);                 /* release job entry */
-           return NULL;
-        }
+        P(jq->mutex);
          Dmsg0(200, "Done lock mutex after running job. Release locks.\n");
         jq->running_jobs->remove(je);
-        /* 
+        /*
          * Release locks if acquired. Note, they will not have
          *  been acquired for jobs canceled before they were
          *  put into the ready queue.
          */
         if (jcr->acquired_resource_locks) {
            jcr->store->NumConcurrentJobs--;
-           if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
-              jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;  
-           }
            jcr->client->NumConcurrentJobs--;
            jcr->job->NumConcurrentJobs--;
         }
@@ -459,10 +463,10 @@ void *jobq_server(void *arg)
         /*
          * Reschedule the job if necessary and requested
          */
-        if (jcr->job->RescheduleOnError && 
+        if (jcr->job->RescheduleOnError &&
             jcr->JobStatus != JS_Terminated &&
-            jcr->JobStatus != JS_Canceled && 
-            jcr->job->RescheduleTimes > 0 && 
+            jcr->JobStatus != JS_Canceled &&
+            jcr->job->RescheduleTimes > 0 &&
             jcr->reschedule_count < jcr->job->RescheduleTimes) {
             char dt[50];
 
@@ -472,16 +476,16 @@ void *jobq_server(void *arg)
              */
            jcr->reschedule_count++;
            jcr->sched_time = time(NULL) + jcr->job->RescheduleInterval;
-            Dmsg2(300, "Rescheduled Job %s to re-run in %d seconds.\n", jcr->Job,
+            Dmsg2(2300, "Rescheduled Job %s to re-run in %d seconds.\n", jcr->Job,
               (int)jcr->job->RescheduleInterval);
            bstrftime(dt, sizeof(dt), time(NULL));
             Jmsg(jcr, M_INFO, 0, _("Rescheduled Job %s at %s to re-run in %d seconds.\n"),
               jcr->Job, dt, (int)jcr->job->RescheduleInterval);
-           dird_free_jcr(jcr);          /* partial cleanup old stuff */
+           dird_free_jcr_pointers(jcr);     /* partial cleanup old stuff */
            jcr->JobStatus = JS_WaitStartTime;
            jcr->SDJobStatus = 0;
            if (jcr->JobBytes == 0) {
-               Dmsg1(300, "Requeue job=%d\n", jcr->JobId);
+               Dmsg1(2300, "Requeue job=%d\n", jcr->JobId);
               jcr->JobStatus = JS_WaitStartTime;
               V(jq->mutex);
               jobq_add(jq, jcr);     /* queue the job to run again */
@@ -489,7 +493,7 @@ void *jobq_server(void *arg)
               free(je);              /* free the job entry */
               continue;              /* look for another job to run */
            }
-           /* 
+           /*
             * Something was actually backed up, so we cannot reuse
             *   the old JobId or there will be database record
             *   conflicts.  We now create a new job, copying the
@@ -502,19 +506,19 @@ void *jobq_server(void *arg)
            njcr->JobStatus = jcr->JobStatus;
            copy_storage(njcr, jcr);
            njcr->messages = jcr->messages;
-            Dmsg0(300, "Call to run new job\n");
+            Dmsg0(2300, "Call to run new job\n");
            V(jq->mutex);
             run_job(njcr);            /* This creates a "new" job */
             free_jcr(njcr);           /* release "new" jcr */
            P(jq->mutex);
-            Dmsg0(300, "Back from running new job.\n");
+            Dmsg0(2300, "Back from running new job.\n");
         }
         /* Clean up and release old jcr */
         if (jcr->db) {
            db_close_database(jcr, jcr->db);
            jcr->db = NULL;
         }
-         Dmsg2(300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count);
+         Dmsg2(2300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count);
         jcr->SDJobStatus = 0;
         V(jq->mutex);                /* release internal lock */
         free_jcr(jcr);
@@ -525,17 +529,17 @@ void *jobq_server(void *arg)
        * If any job in the wait queue can be run,
        *  move it to the ready queue
        */
-      Dmsg0(300, "Done check ready, now check wait queue.\n");
+      Dmsg0(2300, "Done check ready, now check wait queue.\n");
       while (!jq->waiting_jobs->empty() && !jq->quit) {
         int Priority;
-        je = (jobq_item_t *)jq->waiting_jobs->first(); 
+        je = (jobq_item_t *)jq->waiting_jobs->first();
         jobq_item_t *re = (jobq_item_t *)jq->running_jobs->first();
         if (re) {
            Priority = re->jcr->JobPriority;
-            Dmsg2(300, "JobId %d is running. Look for pri=%d\n", re->jcr->JobId, Priority);
+            Dmsg2(2300, "JobId %d is running. Look for pri=%d\n", re->jcr->JobId, Priority);
         } else {
            Priority = je->jcr->JobPriority;
-            Dmsg1(300, "No job running. Look for Job pri=%d\n", Priority);
+            Dmsg1(2300, "No job running. Look for Job pri=%d\n", Priority);
         }
         /*
          * Walk down the list of waiting jobs and attempt
@@ -544,8 +548,9 @@ void *jobq_server(void *arg)
         for ( ; je;  ) {
            /* je is current job item on the queue, jn is the next one */
            JCR *jcr = je->jcr;
+           bool skip_this_jcr = false;
            jobq_item_t *jn = (jobq_item_t *)jq->waiting_jobs->next(je);
-            Dmsg3(300, "Examining Job=%d JobPri=%d want Pri=%d\n",
+            Dmsg3(2300, "Examining Job=%d JobPri=%d want Pri=%d\n",
               jcr->JobId, jcr->JobPriority, Priority);
            /* Take only jobs of correct Priority */
            if (jcr->JobPriority != Priority) {
@@ -555,19 +560,45 @@ void *jobq_server(void *arg)
            if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
               /* Let only one Restore/verify job run at a time regardless of MaxConcurrentJobs */
               if (jcr->store->NumConcurrentJobs == 0) {
-                 jcr->store->NumConcurrentJobs++;
-                 jcr->saveMaxConcurrentJobs = jcr->store->MaxConcurrentJobs;
-                 jcr->store->MaxConcurrentJobs = 1;
+                 jcr->store->NumConcurrentJobs = 1;
               } else {
                  set_jcr_job_status(jcr, JS_WaitStoreRes);
-                 je = jn;
+                 je = jn;            /* point to next waiting job */
                  continue;
               }
+           /* We are not doing a Restore or Verify */
+           } else if (jcr->store->NumConcurrentJobs == 0 &&
+                      jcr->store->NumConcurrentJobs < jcr->store->MaxConcurrentJobs) {
+               /* Simple case, first job */
+               jcr->store->NumConcurrentJobs = 1;
            } else if (jcr->store->NumConcurrentJobs < jcr->store->MaxConcurrentJobs) {
-              jcr->store->NumConcurrentJobs++;
+              /*
+               * At this point, we already have at least one Job running
+               *  for this Storage daemon, so we must ensure that there
+               *  is no Volume conflict. In general, it should be OK, if
+               *  all Jobs pull from the same Pool, so we check the Pools.
+               */
+               JCR *njcr;
+               lock_jcr_chain();
+               for (njcr=jobs; njcr; njcr=njcr->next) {
+                  if (njcr->JobId == 0 || njcr == jcr) {
+                     continue;
+                  }
+                  if (njcr->store == jcr->store && njcr->pool != jcr->pool) {
+                     skip_this_jcr = true;
+                     break;
+                  }
+               }
+               unlock_jcr_chain();
+               if (!skip_this_jcr) {
+                  jcr->store->NumConcurrentJobs++;
+               }
            } else {
+              skip_this_jcr = true;
+           }
+           if (skip_this_jcr) {
               set_jcr_job_status(jcr, JS_WaitStoreRes);
-              je = jn;
+              je = jn;               /* point to next waiting job */
               continue;
            }
 
@@ -576,11 +607,8 @@ void *jobq_server(void *arg)
            } else {
               /* Back out previous locks */
               jcr->store->NumConcurrentJobs--;
-              if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
-                 jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;  
-              }
               set_jcr_job_status(jcr, JS_WaitClientRes);
-              je = jn;
+              je = jn;               /* point to next waiting job */
               continue;
            }
            if (jcr->job->NumConcurrentJobs < jcr->job->MaxConcurrentJobs) {
@@ -588,79 +616,79 @@ void *jobq_server(void *arg)
            } else {
               /* Back out previous locks */
               jcr->store->NumConcurrentJobs--;
-              if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
-                 jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;  
-              }
               jcr->client->NumConcurrentJobs--;
               set_jcr_job_status(jcr, JS_WaitJobRes);
-              je = jn;
+              je = jn;               /* Point to next waiting job */
               continue;
            }
            /* Got all locks, now remove it from wait queue and append it
-            *   to the ready queue  
+            *   to the ready queue
             */
            jcr->acquired_resource_locks = true;
            jq->waiting_jobs->remove(je);
            jq->ready_jobs->append(je);
-            Dmsg1(300, "moved JobId=%d from wait to ready queue\n", je->jcr->JobId);
-           je = jn;
+            Dmsg1(2300, "moved JobId=%d from wait to ready queue\n", je->jcr->JobId);
+           je = jn;                  /* Point to next waiting job */
         } /* end for loop */
         break;
       } /* end while loop */
-      Dmsg0(300, "Done checking wait queue.\n");
+      Dmsg0(2300, "Done checking wait queue.\n");
       /*
        * If no more ready work and we are asked to quit, then do it
        */
       if (jq->ready_jobs->empty() && jq->quit) {
         jq->num_workers--;
         if (jq->num_workers == 0) {
-            Dmsg0(300, "Wake up destroy routine\n");
+            Dmsg0(2300, "Wake up destroy routine\n");
            /* Wake up destroy routine if he is waiting */
            pthread_cond_broadcast(&jq->work);
         }
         break;
       }
-      Dmsg0(300, "Check for work request\n");
-      /* 
+      Dmsg0(2300, "Check for work request\n");
+      /*
        * If no more work requests, and we waited long enough, quit
        */
-      Dmsg2(300, "timedout=%d read empty=%d\n", timedout,
+      Dmsg2(2300, "timedout=%d read empty=%d\n", timedout,
         jq->ready_jobs->empty());
       if (jq->ready_jobs->empty() && timedout) {
-         Dmsg0(300, "break big loop\n");
+         Dmsg0(2300, "break big loop\n");
         jq->num_workers--;
         break;
       }
 
       work = !jq->ready_jobs->empty() || !jq->waiting_jobs->empty();
       if (work) {
-        /*          
+        /*
           * If a job is waiting on a Resource, don't consume all
          *   the CPU time looping looking for work, and even more
          *   important, release the lock so that a job that has
          *   terminated can give us the resource.
          */
         if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
-            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
+           berrno be;
+            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
            jq->num_workers--;
            return NULL;
         }
         bmicrosleep(2, 0);              /* pause for 2 seconds */
         if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
-            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+           berrno be;
+            Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
            jq->num_workers--;
            return NULL;
         }
         /* Recompute work as something may have changed in last 2 secs */
         work = !jq->ready_jobs->empty() || !jq->waiting_jobs->empty();
       }
-      Dmsg1(300, "Loop again. work=%d\n", work);
+      Dmsg1(2300, "Loop again. work=%d\n", work);
    } /* end of big for loop */
 
    Dmsg0(200, "unlock mutex\n");
    if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
-      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
+      berrno be;
+      Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
    }
-   Dmsg0(300, "End jobq_server\n");
+   Dmsg0(2300, "End jobq_server\n");
    return NULL;
 }
index 9733f0f6ebc411b20c4c5f4c6c5726cde8f7872a..4c20b96196c5bb16a5545a48bb253a10b53d243b 100644 (file)
@@ -16,7 +16,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -64,10 +64,13 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
                              int max_retry_time, int verbose)
 {
    BSOCK *sd;
-   STORE *store = jcr->store;
-   if (!store) {
-      jcr->store = store = (STORE *)jcr->storage[0]->first();
+   STORE *store;
+
+   if (!jcr->storage[0]) {
+      Jmsg(jcr, M_FATAL, 0, _("Attempt to contact the Storage daemon with no Storage resource.\n"));
+      return false;
    }
+   store = (STORE *)jcr->storage[0]->first();
 
    /*
     *  Open message channel with the Storage daemon   
@@ -94,13 +97,13 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
  */
 int start_storage_daemon_job(JCR *jcr)
 {
-   int status;
+   int status = 0;
    STORE *storage;
    BSOCK *sd;
    char auth_key[100];
    POOL_MEM device_name, pool_name, pool_type, media_type;
+   int i;
 
-   storage = jcr->store;
    sd = jcr->store_bsock;
    /*
     * Now send JobId and permissions, and get back the authorization key.
@@ -139,23 +142,29 @@ int start_storage_daemon_job(JCR *jcr)
    /*
     * Send use device = xxx media = yyy pool = zzz
     */
-   pm_strcpy(device_name, storage->dev_name);
-   pm_strcpy(media_type, storage->media_type);
-   pm_strcpy(pool_type, jcr->pool->pool_type);
-   pm_strcpy(pool_name, jcr->pool->hdr.name);
-   bash_spaces(device_name);
-   bash_spaces(media_type);
-   bash_spaces(pool_type);
-   bash_spaces(pool_name);
-   bnet_fsend(sd, use_device, device_name.c_str(), 
-             media_type.c_str(), pool_name.c_str(), pool_type.c_str());
-   Dmsg1(110, ">stored: %s", sd->msg);
-   status = response(jcr, sd, OK_device, "Use Device", NO_DISPLAY);
-   if (!status) {
-      pm_strcpy(pool_type, sd->msg); /* save message */
-      Jmsg(jcr, M_FATAL, 0, _("\n"
-         "     Storage daemon didn't accept Device \"%s\" because:\n     %s"),
-        device_name.c_str(), pool_type.c_str()/* sd->msg */);
+
+   for (i=0; i < MAX_STORE; i++) {
+      if (jcr->storage[i]) {
+        storage = (STORE *)jcr->storage[i]->first();
+        pm_strcpy(device_name, storage->dev_name);
+        pm_strcpy(media_type, storage->media_type);
+        pm_strcpy(pool_type, jcr->pool->pool_type);
+        pm_strcpy(pool_name, jcr->pool->hdr.name);
+        bash_spaces(device_name);
+        bash_spaces(media_type);
+        bash_spaces(pool_type);
+        bash_spaces(pool_name);
+        bnet_fsend(sd, use_device, device_name.c_str(), 
+                   media_type.c_str(), pool_name.c_str(), pool_type.c_str());
+         Dmsg1(110, ">stored: %s", sd->msg);
+         status = response(jcr, sd, OK_device, "Use Device", NO_DISPLAY);
+        if (!status) {
+           pm_strcpy(pool_type, sd->msg); /* save message */
+            Jmsg(jcr, M_FATAL, 0, _("\n"
+               "     Storage daemon didn't accept Device \"%s\" because:\n     %s"),
+              device_name.c_str(), pool_type.c_str()/* sd->msg */);
+        }
+      }
    }
    return status;
 }
index 711c97c99aa533cc2e913b366577f511c5501239..c0891d1b13b231c9e8a5cbd7beae086c6f3fedcc 100644 (file)
@@ -62,7 +62,7 @@ int variable_expansion(JCR *jcr, char *inp, POOLMEM **exp);
 
 /* fd_cmds.c */
 extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
-                                  int max_retry_time, int verbose);
+                                 int max_retry_time, int verbose);
 extern int send_include_list(JCR *jcr);
 extern int send_exclude_list(JCR *jcr);
 extern int send_bootstrap_file(JCR *jcr);
@@ -70,7 +70,7 @@ extern int send_level_command(JCR *jcr);
 extern int get_attributes_and_put_in_catalog(JCR *jcr);
 extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
 extern int put_file_into_catalog(JCR *jcr, long file_index, char *fname, 
-                          char *link, char *attr, int stream);
+                         char *link, char *attr, int stream);
 extern void get_level_since_time(JCR *jcr, char *since, int since_len);
 extern int send_run_before_and_after_commands(JCR *jcr);
 
@@ -91,13 +91,14 @@ extern JobId_t run_job(JCR *jcr);
 extern int cancel_job(UAContext *ua, JCR *jcr);
 extern void init_jcr_job_record(JCR *jcr);
 extern void copy_storage(JCR *new_jcr, JCR *old_jcr);
+extern void set_storage(JCR *jcr, STORE *store);
 
 /* mountreq.c */
 extern void mount_request(JCR *jcr, BSOCK *bs, char *buf);
 
 /* msgchan.c */
 extern bool connect_to_storage_daemon(JCR *jcr, int retry_interval,    
-                              int max_retry_time, int verbose);
+                             int max_retry_time, int verbose);
 extern int start_storage_daemon_job(JCR *jcr);
 extern int start_storage_daemon_message_thread(JCR *jcr);
 extern int bget_dirmsg(BSOCK *bs);
@@ -149,28 +150,28 @@ JCR *new_control_jcr(const char *base_name, int job_type);
 void free_ua_context(UAContext *ua);
 
 /* ua_select.c */
-STORE   *select_storage_resource(UAContext *ua);
-JOB     *select_job_resource(UAContext *ua);
-JOB     *select_restore_job_resource(UAContext *ua);
-CLIENT  *select_client_resource(UAContext *ua);
+STORE  *select_storage_resource(UAContext *ua);
+JOB    *select_job_resource(UAContext *ua);
+JOB    *select_restore_job_resource(UAContext *ua);
+CLIENT *select_client_resource(UAContext *ua);
 FILESET *select_fileset_resource(UAContext *ua);
-int     select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
-int     select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
-bool    select_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int     select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
-
-void    start_prompt(UAContext *ua, const char *msg);
-void    add_prompt(UAContext *ua, const char *prompt);
-int     do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
-CAT    *get_catalog_resource(UAContext *ua);           
+int    select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
+int    select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
+bool   select_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int    select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+
+void   start_prompt(UAContext *ua, const char *msg);
+void   add_prompt(UAContext *ua, const char *prompt);
+int    do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
+CAT    *get_catalog_resource(UAContext *ua);          
 STORE  *get_storage_resource(UAContext *ua, int use_default);
-int     get_media_type(UAContext *ua, char *MediaType, int max_media);
-bool    get_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int     get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+int    get_media_type(UAContext *ua, char *MediaType, int max_media);
+bool   get_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int    get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
 POOL   *get_pool_resource(UAContext *ua);
 POOL   *select_pool_resource(UAContext *ua);
 CLIENT *get_client_resource(UAContext *ua);
-int     get_job_dbr(UAContext *ua, JOB_DBR *jr);
+int    get_job_dbr(UAContext *ua, JOB_DBR *jr);
 
 int find_arg_keyword(UAContext *ua, const char **list);
 int find_arg(UAContext *ua, const char *keyword);
@@ -190,3 +191,6 @@ int prune_volume(UAContext *ua, MEDIA_DBR *mr);
 
 /* ua_purge.c */
 int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr);
+
+/* ua_run.c */
+extern int run_cmd(UAContext *ua, const char *cmd);
index e763d9d893beb8c8765a82a5e41b0c7ea4d21241..443cf8f8676afc1d39d8e75048ee81ebe5444956 100644 (file)
@@ -6,7 +6,7 @@ SELECT count(*) AS Jobs,sum(JobFiles) AS Files,
 SELECT max(JobId) AS Jobs,sum(JobFiles) AS Files,sum(JobBytes) As Bytes 
  FROM Job;
 # 2 
-:List where a File is saved regardless of the directory:
+:List up to 20 places where a File is saved regardless of the directory:
 *Enter Filename (no path):
 SELECT DISTINCT Job.JobId as JobId, Client.Name as Client,
   Path.Path,Filename.Name,StartTime,Level,JobFiles,JobBytes
index 84a39a9dc4ba4bcc48b75e4272f5e37071b0f157..bb6c7987f9e4eab4e1e0a3a80454f2d8e90908a1 100644 (file)
@@ -70,19 +70,21 @@ int find_recycled_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
 int recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
 {
    struct s_oldest_ctx oldest;
+   char ed1[50];
    POOLMEM *query = get_pool_memory(PM_EMSG);
    const char *select =
           "SELECT MediaId,LastWritten FROM Media "
-          "WHERE PoolId=%u AND Recycle=1 AND VolStatus='Purged' "
+          "WHERE PoolId=%s AND Recycle=1 AND VolStatus='Purged' "
           "AND MediaType='%s' %s"
           "ORDER BY LastWritten ASC,MediaId LIMIT 1";
 
    Dmsg0(100, "Enter recycle_oldest_purged_volume\n");
    oldest.MediaId = 0;
    if (InChanger) {
-      Mmsg(query, select, mr->PoolId, mr->MediaType, "AND InChanger=1 ");
+      Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType, 
+           "AND InChanger=1 ");
    } else {
-      Mmsg(query, select, mr->PoolId, mr->MediaType, "");
+      Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType, "");
    }
 
    if (!db_sql_query(jcr->db, query, oldest_handler, (void *)&oldest)) {
@@ -105,7 +107,7 @@ int recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
       Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
    }
    Dmsg0(100, "return 0  recycle_oldest_purged_volume end\n");
-   return 0;   
+   return 0;
 }
 
 /*
index f32a633179a2907b3addd7ad95e3ebb3c691a565..80182c26127b2b90bd5411f8c6ab83fcbe070454 100644 (file)
@@ -10,7 +10,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -157,7 +157,7 @@ JCR *wait_for_next_job(char *one_shot_job_to_run)
       jcr->dif_pool = run->dif_pool;  /* override dif pool */
    }
    if (run->storage) {
-      jcr->store = run->storage;      /* override storage */
+      set_storage(jcr, run->storage); /* override storage */
    }
    if (run->msgs) {
       jcr->messages = run->msgs;      /* override messages */
index f66472212045e44aac9355ba1fa7e58998cc1973..1de8b8bc3e28d94a14cf09b453fad4bf2b16d4cc 100644 (file)
@@ -147,7 +147,7 @@ const char *select_verify_del =
 const char *select_restore_del =
    "SELECT DISTINCT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE (Job.JobTdate<%s AND delCandidates.JobStatus!='T') OR "
+   "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
    "(Job.JobTDate>%s "
    "AND Job.ClientId=%u "   
    "AND Job.Type='R')";
@@ -158,7 +158,7 @@ const char *select_restore_del =
 const char *select_admin_del =
    "SELECT DISTINCT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE (Job.JobTdate<%s AND delCandidates.JobStatus!='T') OR "
+   "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
    "(Job.JobTDate>%s "
    "AND Job.ClientId=%u "   
    "AND Job.Type='D')";
index 82818f9a47a4e40d623615103e1d1e755f604f97..ac3b02dbea2a8d9e4624d2808b26662fe0e842ca 100644 (file)
@@ -48,6 +48,7 @@ struct UAContext {
    bool automount;                    /* if set, mount after label */
    bool quit;                         /* if set, quit */
    bool verbose;                      /* set for normal UA verbosity */
+   bool batch;                        /* set for non-interactive mode */
    uint32_t pint32_val;               /* positive integer */
    int32_t  int32_val;                /* positive/negative */
 };          
index cb184a0a88253506bc44f4be814e0bf602230afc..dcfc0e468a8d339c165bb1e634bd8c31f5123f47 100644 (file)
@@ -2,13 +2,13 @@
  *
  *   Bacula Director -- User Agent Access Control List (ACL) handling
  *
- *     Kern Sibbald, January MMIV  
+ *     Kern Sibbald, January MMIV
  *
  *   Version  $Id$
  */
 
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -30,8 +30,8 @@
 #include "bacula.h"
 #include "dird.h"
 
-/*  
- * Check if access is permitted to item in acl   
+/*
+ * Check if access is permitted to item in acl
  */
 bool acl_access_ok(UAContext *ua, int acl, char *item)
 {
@@ -39,12 +39,13 @@ bool acl_access_ok(UAContext *ua, int acl, char *item)
 }
 
 
+/* This version expects the length of the item which we must check. */
 bool acl_access_ok(UAContext *ua, int acl, char *item, int len)
 {
 
    /* If no console resource => default console and all is permitted */
    if (!ua->cons) {
-      Dmsg0(400, "Root cons access OK.\n");
+      Dmsg0(1400, "Root cons access OK.\n");
       return true;                   /* No cons resource -> root console OK for everything */
    }
 
@@ -60,8 +61,8 @@ bool acl_access_ok(UAContext *ua, int acl, char *item, int len)
 
    /* Search list for item */
    for (int i=0; i<list->size(); i++) {
-      if (strncasecmp(item, (char *)list->get(i), len) == 0) {
-         Dmsg3(400, "Found %s in %d %s\n", item, acl, (char *)list->get(i));
+      if (strcasecmp(item, (char *)list->get(i)) == 0) {
+         Dmsg3(1400, "ACL found %s in %d %s\n", item, acl, (char *)list->get(i));
         return true;
       }
    }
index 2090b43a99136c15c2f33c23f02ac1cd698b5757..9dc590185c339003a9d1186d3f171e0f380cf55a 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -52,7 +52,6 @@ extern int autodisplay_cmd(UAContext *ua, const char *cmd);
 extern int gui_cmd(UAContext *ua, const char *cmd);
 extern int sqlquerycmd(UAContext *ua, const char *cmd);
 extern int querycmd(UAContext *ua, const char *cmd);
-extern int run_cmd(UAContext *ua, const char *cmd);
 extern int retentioncmd(UAContext *ua, const char *cmd);
 extern int prunecmd(UAContext *ua, const char *cmd);
 extern int purgecmd(UAContext *ua, const char *cmd);
@@ -97,16 +96,16 @@ int quit_cmd(UAContext *ua, const char *cmd);
 struct cmdstruct { const char *key; int (*func)(UAContext *ua, const char *cmd); const char *help; }; 
 static struct cmdstruct commands[] = {
  { N_("add"),        add_cmd,         _("add media to a pool")},
- { N_("autodisplay"), autodisplay_cmd, _("autodisplay [on/off] -- console messages")},
- { N_("automount"),   automount_cmd,  _("automount [on/off] -- after label")},
- { N_("cancel"),     cancel_cmd,    _("cancel job=nnn -- cancel a job")},
+ { N_("autodisplay"), autodisplay_cmd, _("autodisplay [on|off] -- console messages")},
+ { N_("automount"),   automount_cmd,  _("automount [on|off] -- after label")},
+ { N_("cancel"),     cancel_cmd,    _("cancel <job=nnn> -- cancel a job")},
  { N_("create"),     create_cmd,    _("create DB Pool from resource")},  
  { N_("delete"),     delete_cmd,    _("delete [pool=<pool-name> | media volume=<volume-name>]")},    
  { N_("estimate"),   estimate_cmd,  _("performs FileSet estimate, listing gives full listing")},
  { N_("exit"),       quit_cmd,      _("exit = quit")},
- { N_("gui"),        gui_cmd,       _("gui [on/off] -- non-interactive gui mode")},
+ { N_("gui"),        gui_cmd,       _("gui [on|off] -- non-interactive gui mode")},
  { N_("help"),       help_cmd,      _("print this command")},
- { N_("list"),       list_cmd,      _("list [pools | jobs | jobtotals | media <pool> | files jobid=<nn>]; from catalog")},
+ { N_("list"),       list_cmd,      _("list [pools | jobs | jobtotals | media <pool=pool-name> | files <jobid=nn>]; from catalog")},
  { N_("label"),      label_cmd,     _("label a tape")},
  { N_("llist"),      llist_cmd,     _("full or long list like list command")},
  { N_("messages"),   messagescmd,   _("messages")},
@@ -1195,7 +1194,7 @@ static void do_storage_setdebug(UAContext *ua, STORE *store, int level, int trac
    BSOCK *sd;
    JCR *jcr = ua->jcr;
 
-   jcr->store = store;
+   set_storage(jcr, store);
    /* Try connecting for up to 15 seconds */
    bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d\n"), 
       store->hdr.name, store->address, store->SDport);
@@ -1254,8 +1253,10 @@ static void do_all_setdebug(UAContext *ua, int level, int trace_flag)
    /* Count Storage items */
    LockRes();
    store = NULL;
-   for (i=0; (store = (STORE *)GetNextRes(R_STORAGE, (RES *)store)); i++)
-      { }
+   i = 0;
+   foreach_res(store, R_STORAGE) {
+      i++;
+   }
    unique_store = (STORE **) malloc(i * sizeof(STORE));
    /* Find Unique Storage address/port */        
    store = (STORE *)GetNextRes(R_STORAGE, NULL);
@@ -1286,8 +1287,10 @@ static void do_all_setdebug(UAContext *ua, int level, int trace_flag)
    /* Count Client items */
    LockRes();
    client = NULL;
-   for (i=0; (client = (CLIENT *)GetNextRes(R_CLIENT, (RES *)client)); i++)
-      { }
+   i = 0;
+   foreach_res(client, R_CLIENT) {
+      i++;
+   }
    unique_client = (CLIENT **) malloc(i * sizeof(CLIENT));
    /* Find Unique Client address/port */        
    client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
@@ -1841,7 +1844,7 @@ static void do_mount_cmd(UAContext *ua, const char *command)
    Dmsg2(120, "Found storage, MediaType=%s DevName=%s\n",
       store->media_type, store->dev_name);
 
-   jcr->store = store;
+   set_storage(jcr, store);
    if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
       bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
       return;
index 588ac1acbd22f4128a437aa5ddcfcdd4fce22af5..bd260da887e85b469f3262bf0e29142ff6b5adf2 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -170,7 +170,7 @@ int update_slots(UAContext *ua)
    if (!store) {
       return 1;
    }
-   ua->jcr->store = store;
+   set_storage(ua->jcr, store);
 
    scan = find_arg(ua, _("scan")) >= 0;
 
@@ -296,7 +296,7 @@ static int do_label(UAContext *ua, const char *cmd, int relabel)
    if (!store) {
       return 1;
    }
-   ua->jcr->store = store;
+   set_storage(ua->jcr, store);
 
    if (!relabel && find_arg_keyword(ua, barcode_keyword) >= 0) {
       label_from_barcodes(ua);
index 5cf84260a3c6ab18166627271b7e0851460b8c89..8c22b602043e585261322462b60e4c86f6399aa9 100644 (file)
@@ -32,7 +32,7 @@
 
 extern DIRRES *director;
 
-static POOLMEM *substitute_prompts(UAContext *ua, 
+static POOLMEM *substitute_prompts(UAContext *ua,
                       POOLMEM *query, char **prompt, int nprompt);
 
 /*
@@ -57,7 +57,7 @@ int querycmd(UAContext *ua, const char *cmd)
    char *prompt[9];
    int nprompt = 0;;
    char *query_file = director->query_file;
-   
+
    if (!open_db(ua)) {
       goto bail_out;
    }
@@ -113,7 +113,7 @@ int querycmd(UAContext *ua, const char *cmd)
            prompt[nprompt++] = bstrdup(line+1);
            continue;
         }
-      }  
+      }
       if (*query != 0) {
          pm_strcat(query, " ");
       }
@@ -155,7 +155,7 @@ bail_out:
    return 1;
 }
 
-static POOLMEM *substitute_prompts(UAContext *ua, 
+static POOLMEM *substitute_prompts(UAContext *ua,
                       POOLMEM *query, char **prompt, int nprompt)
 {
    char *p, *q, *o;
@@ -255,9 +255,9 @@ int sqlquerycmd(UAContext *ua, const char *cmd)
    }
    *query = 0;
 
-   bsendmsg(ua, _("Entering SQL query mode.\n\
-Terminate each query with a semicolon.\n\
-Terminate query mode with a blank line.\n"));
+   bsendmsg(ua, _("Entering SQL query mode.\n"
+"Terminate each query with a semicolon.\n"
+"Terminate query mode with a blank line.\n"));
    msg = "Enter SQL query: ";
    while (get_cmd(ua, msg)) {
       len = strlen(ua->cmd);
@@ -267,9 +267,9 @@ Terminate query mode with a blank line.\n"));
       }
       query = check_pool_memory_size(query, len + 1);
       if (*query != 0) {
-         strcat(query, " ");
+         pm_strcat(query, " ");
       }
-      strcat(query, ua->cmd);
+      pm_strcat(query, ua->cmd);
       if (ua->cmd[len-1] == ';') {
         ua->cmd[len-1] = 0;          /* zap ; */
         /* Submit query */
@@ -282,5 +282,5 @@ Terminate query mode with a blank line.\n"));
    }
    free_pool_memory(query);
    bsendmsg(ua, _("End query mode.\n"));
-   return 1; 
+   return 1;
 }
index 9f06fd33f735614ffacddd67a893dee11cb0241a..d4ca3b1b2a9fb0572da50ec8462ad90a0520b6cc 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 /*
-   Copyright (C) 2002-2004 Kern Sibbald and John Walker
+   Copyright (C) 2002-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -38,7 +38,6 @@
 
 
 /* Imported functions */
-extern int run_cmd(UAContext *ua, const char *cmd);
 extern void print_bsr(UAContext *ua, RBSR *bsr);
 
 /* Imported variables */
@@ -155,7 +154,7 @@ int restore_cmd(UAContext *ua, const char *cmd)
       goto bail_out;
    }
 
-   /* 
+   /*
     * Request user to select JobIds or files by various different methods
     *  last 20 jobs, where File saved, most recent backup, ...
     *  In the end, a list of files are pumped into
@@ -206,13 +205,13 @@ int restore_cmd(UAContext *ua, const char *cmd)
 
    /* Build run command */
    if (rx.where) {
-      Mmsg(ua->cmd, 
+      Mmsg(ua->cmd,
           "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\""
           " where=\"%s\" files=%d catalog=\"%s\"",
           job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"",
          working_directory, rx.where, rx.selected_files, ua->catalog->hdr.name);
    } else {
-      Mmsg(ua->cmd, 
+      Mmsg(ua->cmd,
           "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\""
           " files=%d catalog=\"%s\"",
           job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"",
@@ -233,7 +232,7 @@ bail_out:
 
 }
 
-static void free_rx(RESTORE_CTX *rx) 
+static void free_rx(RESTORE_CTX *rx)
 {
    free_bsr(rx->bsr);
    rx->bsr = NULL;
@@ -277,7 +276,7 @@ static int get_client_name(UAContext *ua, RESTORE_CTX *rx)
 }
 
 /*
- * The first step in the restore process is for the user to 
+ * The first step in the restore process is for the user to
  *  select a list of JobIds from which he will subsequently
  *  select which files are to be restored.
  */
@@ -290,11 +289,11 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
    JOB_DBR jr;
    bool done = false;
    int i, j;
-   const char *list[] = { 
+   const char *list[] = {
       "List last 20 Jobs run",
       "List Jobs where a given File is saved",
       "Enter list of comma separated JobIds to select",
-      "Enter SQL list command", 
+      "Enter SQL list command",
       "Select the most recent backup for a client",
       "Select backup for a client before a specified time",
       "Enter a list of files to restore",
@@ -393,7 +392,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       case 6:                        /* all specified */
         rx->all = true;
         break;
-      /*     
+      /*
        * All keywords 7 or greater are ignored or handled by a select prompt
        */
       default:
@@ -403,7 +402,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
    if (rx->name_list.num_ids) {
       return 2;                      /* filename list made */
    }
-       
+
    if (!done) {
       bsendmsg(ua, _("\nFirst you select one or more JobIds that contain files\n"
                   "to be restored. You will be presented several methods\n"
@@ -482,7 +481,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
         if (!get_client_name(ua, rx)) {
            return 0;
         }
-         bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"      
+         bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
                         "containg a list of file names with paths, and terminate\n"
                         "them with a blank line.\n"));
         for ( ;; ) {
@@ -507,7 +506,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
         if (!get_client_name(ua, rx)) {
            return 0;
         }
-         bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"      
+         bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
                         "containg a list of file names with paths, and terminate\n"
                         "them with a blank line.\n"));
         for ( ;; ) {
@@ -526,7 +525,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
         }
         return 2;
 
-      
+
       case 8:                        /* Cancel or quit */
         return 0;
       }
@@ -536,7 +535,7 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       bsendmsg(ua, _("No Jobs selected.\n"));
       return 0;
    }
-   bsendmsg(ua, _("You have selected the following JobId%s: %s\n"), 
+   bsendmsg(ua, _("You have selected the following JobId%s: %s\n"),
       strchr(rx->JobIds,',')?"s":"",rx->JobIds);
 
    memset(&jr, 0, sizeof(JOB_DBR));
@@ -556,21 +555,21 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       }
       jr.JobId = JobId;
       if (!db_get_job_record(ua->jcr, ua->db, &jr)) {
-         bsendmsg(ua, _("Unable to get Job record for JobId=%u: ERR=%s\n"), 
+         bsendmsg(ua, _("Unable to get Job record for JobId=%u: ERR=%s\n"),
            JobId, db_strerror(ua->db));
         return 0;
       }
       if (!acl_access_ok(ua, Job_ACL, jr.Name)) {
-         bsendmsg(ua, _("No authorization. Job \"%s\" not selected.\n"), 
+         bsendmsg(ua, _("No authorization. Job \"%s\" not selected.\n"),
            jr.Name);
-        continue; 
+        continue;
       }
       rx->TotalFiles += jr.JobFiles;
    }
    return 1;
 }
 
-/* 
+/*
  * Get date from user
  */
 static int get_date(UAContext *ua, char *date, int date_len)
@@ -585,13 +584,13 @@ static int get_date(UAContext *ua, char *date, int date_len)
         break;
       }
       bsendmsg(ua, _("Improper date format.\n"));
-   }             
+   }
    bstrncpy(date, ua->cmd, date_len);
    return 1;
 }
 
 /*
- * Insert a single file, or read a list of files from a file 
+ * Insert a single file, or read a list of files from a file
  */
 static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date)
 {
@@ -599,13 +598,14 @@ static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date)
    char file[5000];
    char *p = ua->cmd;
    int line = 0;
-  
+
    switch (*p) {
    case '<':
       p++;
       if ((ffd = fopen(p, "r")) == NULL) {
+        berrno be;
          bsendmsg(ua, _("Cannot open file %s: ERR=%s\n"),
-           p, strerror(errno));
+           p, be.strerror());
         break;
       }
       while (fgets(file, sizeof(file), ffd)) {
@@ -627,7 +627,7 @@ static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date)
  *   lookup the most recent backup in the catalog to get the JobId
  *   and FileIndex, then insert them into the findex list.
  */
-static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file, 
+static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
                                        char *date)
 {
    strip_trailing_junk(file);
@@ -635,13 +635,13 @@ static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *fi
    if (*rx->JobIds == 0) {
       Mmsg(rx->query, uar_jobid_fileindex, date, rx->path, rx->fname, rx->ClientName);
    } else {
-      Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date, 
+      Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date,
           rx->path, rx->fname, rx->ClientName);
    }
    rx->found = false;
    /* Find and insert jobid and File Index */
    if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
-      bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), 
+      bsendmsg(ua, _("Query failed: %s. ERR=%s\n"),
         rx->query, db_strerror(ua->db));
    }
    if (!rx->found) {
@@ -664,7 +664,7 @@ static void split_path_and_filename(RESTORE_CTX *rx, char *name)
 {
    char *p, *f;
 
-   /* Find path without the filename.  
+   /* Find path without the filename.
     * I.e. everything after the last / is a "filename".
     * OK, maybe it is a directory name, but we treat it like
     * a filename. If we don't find a / then the whole name
@@ -682,7 +682,7 @@ static void split_path_and_filename(RESTORE_CTX *rx, char *name)
    }
 
    /* If filename doesn't exist (i.e. root directory), we
-    * simply create a blank name consisting of a single 
+    * simply create a blank name consisting of a single
     * space. This makes handling zero length filenames
     * easier.
     */
@@ -696,7 +696,7 @@ static void split_path_and_filename(RESTORE_CTX *rx, char *name)
       rx->fnl = 0;
    }
 
-   rx->pnl = f - name;   
+   rx->pnl = f - name;
    if (rx->pnl > 0) {
       rx->path = check_pool_memory_size(rx->path, rx->pnl+1);
       memcpy(rx->path, name, rx->pnl);
@@ -717,7 +717,7 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
    bool OK = true;
 
    memset(&tree, 0, sizeof(TREE_CTX));
-   /* 
+   /*
     * Build the directory tree containing JobIds user selected
     */
    tree.root = new_tree(rx->TotalFiles);
@@ -745,7 +745,7 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
    }
    for (p=rx->JobIds; get_next_jobid_from_list(&p, &JobId) > 0; ) {
 
-      if (JobId == last_JobId) {            
+      if (JobId == last_JobId) {
         continue;                    /* eliminate duplicate JobIds */
       }
       last_JobId = JobId;
@@ -767,7 +767,7 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
       }
    }
    char ec1[50];
-   bsendmsg(ua, "\n%d Job%s, %s files inserted into the tree%s.\n", 
+   bsendmsg(ua, "\n%d Job%s, %s files inserted into the tree%s.\n",
       items, items==1?"":"s", edit_uint64_with_commas(tree.FileCount, ec1),
       tree.all?" and marked for extraction":"");
 
@@ -780,7 +780,7 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
    }
 
    /*
-    * Walk down through the tree finding all files marked to be 
+    * Walk down through the tree finding all files marked to be
     *  extracted making a bootstrap file.
     */
    if (OK) {
@@ -835,14 +835,14 @@ static int select_backups_before_date(UAContext *ua, RESTORE_CTX *rx, char *date
    bstrncpy(rx->ClientName, cr.Name, sizeof(rx->ClientName));
 
    /*
-    * Get FileSet 
+    * Get FileSet
     */
    memset(&fsr, 0, sizeof(fsr));
-   i = find_arg_with_value(ua, "FileSet"); 
+   i = find_arg_with_value(ua, "FileSet");
    if (i >= 0) {
       bstrncpy(fsr.FileSet, ua->argv[i], sizeof(fsr.FileSet));
       if (!db_get_fileset_record(ua->jcr, ua->db, &fsr)) {
-         bsendmsg(ua, _("Error getting FileSet \"%s\": ERR=%s\n"), fsr.FileSet, 
+         bsendmsg(ua, _("Error getting FileSet \"%s\": ERR=%s\n"), fsr.FileSet,
            db_strerror(ua->db));
         i = -1;
       }
@@ -853,7 +853,7 @@ static int select_backups_before_date(UAContext *ua, RESTORE_CTX *rx, char *date
       if (!db_sql_query(ua->db, rx->query, fileset_handler, (void *)ua)) {
          bsendmsg(ua, "%s\n", db_strerror(ua->db));
       }
-      if (do_prompt(ua, _("FileSet"), _("Select FileSet resource"), 
+      if (do_prompt(ua, _("FileSet"), _("Select FileSet resource"),
                 fileset_name, sizeof(fileset_name)) < 0) {
         goto bail_out;
       }
@@ -938,11 +938,11 @@ static int select_backups_before_date(UAContext *ua, RESTORE_CTX *rx, char *date
       /* Display a list of Jobs selected for this restore */
       db_list_sql_query(ua->jcr, ua->db, uar_list_temp, prtit, ua, 1, HORZ_LIST);
    } else {
-      bsendmsg(ua, _("No jobs found.\n")); 
+      bsendmsg(ua, _("No jobs found.\n"));
    }
 
    stat = 1;
+
 bail_out:
    db_sql_query(ua->db, uar_del_temp, NULL, NULL);
    db_sql_query(ua->db, uar_del_temp1, NULL, NULL);
@@ -969,14 +969,14 @@ static int get_next_jobid_from_list(char **p, uint32_t *JobId)
       return 0;
    }
    *p = q;
-   *JobId = strtoul(jobid, NULL, 10);
+   *JobId = str_to_int64(jobid);
    return 1;
 }
 
 static int count_handler(void *ctx, int num_fields, char **row)
 {
    RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
-   rx->JobId = atoi(row[0]);
+   rx->JobId = str_to_int64(row[0]);
    rx->found = true;
    return 0;
 }
@@ -987,8 +987,8 @@ static int count_handler(void *ctx, int num_fields, char **row)
 static int jobid_fileindex_handler(void *ctx, int num_fields, char **row)
 {
    RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
-   rx->JobId = atoi(row[0]);
-   add_findex(rx->bsr, rx->JobId, atoi(row[1]));
+   rx->JobId = str_to_int64(row[0]);
+   add_findex(rx->bsr, rx->JobId, str_to_int64(row[1]));
    rx->found = true;
    return 0;
 }
@@ -1000,7 +1000,7 @@ static int jobid_handler(void *ctx, int num_fields, char **row)
 {
    RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
 
-   if (strcmp(rx->last_jobid, row[0]) == 0) {          
+   if (strcmp(rx->last_jobid, row[0]) == 0) {
       return 0;                      /* duplicate id */
    }
    bstrncpy(rx->last_jobid, row[0], sizeof(rx->last_jobid));
@@ -1019,7 +1019,7 @@ static int last_full_handler(void *ctx, int num_fields, char **row)
 {
    RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
 
-   rx->JobTDate = str_to_int64(row[1]); 
+   rx->JobTDate = str_to_int64(row[1]);
    return 0;
 }
 
@@ -1045,7 +1045,7 @@ static int unique_name_list_handler(void *ctx, int num_fields, char **row)
 {
    NAME_LIST *name = (NAME_LIST *)ctx;
 
-   if (name->num_ids == MAX_ID_LIST_LEN) {  
+   if (name->num_ids == MAX_ID_LIST_LEN) {
       return 1;
    }
    if (name->num_ids == name->max_ids) {
@@ -1072,7 +1072,7 @@ static int unique_name_list_handler(void *ctx, int num_fields, char **row)
  * Print names in the list
  */
 static void print_name_list(UAContext *ua, NAME_LIST *name_list)
-{ 
+{
    for (int i=0; i < name_list->num_ids; i++) {
       bsendmsg(ua, "%s\n", name_list->name[i]);
    }
@@ -1083,7 +1083,7 @@ static void print_name_list(UAContext *ua, NAME_LIST *name_list)
  * Free names in the list
  */
 static void free_name_list(NAME_LIST *name_list)
-{ 
+{
    for (int i=0; i < name_list->num_ids; i++) {
       free(name_list->name[i]);
    }
@@ -1116,7 +1116,7 @@ static void get_storage_from_mediatype(UAContext *ua, NAME_LIST *name_list, REST
       return;
    }
    /*
-    * We have a single MediaType, look it up in our Storage resource 
+    * We have a single MediaType, look it up in our Storage resource
     */
    LockRes();
    foreach_res(store, R_STORAGE) {
@@ -1132,7 +1132,7 @@ static void get_storage_from_mediatype(UAContext *ua, NAME_LIST *name_list, REST
    if (rx->store) {
       /* Check if an explicit storage resource is given */
       store = NULL;
-      int i = find_arg_with_value(ua, "storage");        
+      int i = find_arg_with_value(ua, "storage");
       if (i > 0) {
         store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
         if (store && !acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
@@ -1154,6 +1154,6 @@ static void get_storage_from_mediatype(UAContext *ua, NAME_LIST *name_list, REST
       bsendmsg(ua, _("\nWarning. Unable to find Storage resource for\n"
          "MediaType \"%s\", needed by the Jobs you selected.\n"
          "You will be allowed to select a Storage device later.\n"),
-        name_list->name[0]); 
+        name_list->name[0]);
    }
 }
index 52aeff5a5549abf96a1c07fc4465ecbe1555fba3..25b81bddafc745f16c2376342420d7cfc43aa624 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2001-2004 Kern Sibbald and John Walker
+   Copyright (C) 2001-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -42,6 +42,12 @@ extern struct s_kw ReplaceOptions[];
  * For Restore Jobs
  *     run <job-name> jobid=nn
  *
+ *  Returns: 0 on error
+ *          JobId if OK
+ *
+ *  Returns: 0 on error
+ *          JobId if OK
+ *
  */
 int run_cmd(UAContext *ua, const char *cmd)
 {
@@ -101,7 +107,7 @@ int run_cmd(UAContext *ua, const char *cmd)
    catalog_name = NULL;
 
    for (i=1; i<ua->argc; i++) {
-      Dmsg2(200, "Doing arg %d = %s\n", i, ua->argk[i]);
+      Dmsg2(800, "Doing arg %d = %s\n", i, ua->argk[i]);
       kw_ok = false;
       /* Keep looking until we find a good keyword */
       for (j=0; !kw_ok && kw[j]; j++) {
@@ -111,12 +117,12 @@ int run_cmd(UAContext *ua, const char *cmd)
                bsendmsg(ua, _("Value missing for keyword %s\n"), ua->argk[i]);
               return 1;
            }
-            Dmsg1(200, "Got keyword=%s\n", kw[j]);
+            Dmsg1(800, "Got keyword=%s\n", kw[j]);
            switch (j) {
            case 0: /* job */
               if (job_name) {
                   bsendmsg(ua, _("Job name specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               job_name = ua->argv[i];
               kw_ok = true;
@@ -124,7 +130,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 1: /* JobId */
               if (jid) {
                   bsendmsg(ua, _("JobId specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               jid = ua->argv[i];
               kw_ok = true;
@@ -133,7 +139,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 3: /* fd */
               if (client_name) {
                   bsendmsg(ua, _("Client specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               client_name = ua->argv[i];
               kw_ok = true;
@@ -141,7 +147,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 4: /* fileset */
               if (fileset_name) {
                   bsendmsg(ua, _("FileSet specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               fileset_name = ua->argv[i];
               kw_ok = true;
@@ -149,7 +155,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 5: /* level */
               if (level_name) {
                   bsendmsg(ua, _("Level specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               level_name = ua->argv[i];
               kw_ok = true;
@@ -158,7 +164,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 7: /* sd */
               if (store_name) {
                   bsendmsg(ua, _("Storage specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               store_name = ua->argv[i];
               kw_ok = true;
@@ -166,7 +172,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 8: /* pool */
               if (pool_name) {
                   bsendmsg(ua, _("Pool specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               pool_name = ua->argv[i];
               kw_ok = true;
@@ -174,7 +180,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 9: /* where */
               if (where) {
                   bsendmsg(ua, _("Where specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               where = ua->argv[i];
               kw_ok = true;
@@ -182,7 +188,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 10: /* bootstrap */
               if (bootstrap) {
                   bsendmsg(ua, _("Bootstrap specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               bootstrap = ua->argv[i];
               kw_ok = true;
@@ -190,7 +196,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 11: /* replace */
               if (replace) {
                   bsendmsg(ua, _("Replace specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               replace = ua->argv[i];
               kw_ok = true;
@@ -198,7 +204,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 12: /* When */
               if (when) {
                   bsendmsg(ua, _("When specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               when = ua->argv[i];
               kw_ok = true;
@@ -206,7 +212,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 13:  /* Priority */
               if (Priority) {
                   bsendmsg(ua, _("Priority specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               Priority = atoi(ua->argv[i]);
               if (Priority <= 0) {
@@ -221,7 +227,7 @@ int run_cmd(UAContext *ua, const char *cmd)
            case 15: /* Verify Job */
               if (verify_job_name) {
                   bsendmsg(ua, _("Verify Job specified twice.\n"));
-                 return 1;
+                 return 0;
               }
               verify_job_name = ua->argv[i];
               kw_ok = true;
@@ -255,21 +261,22 @@ int run_cmd(UAContext *ua, const char *cmd)
             Dmsg1(200, "Set jobname=%s\n", job_name);
         } else {
             bsendmsg(ua, _("Invalid keyword: %s\n"), ua->argk[i]);
-           return 1;
+           return 0;
         }
       }
    } /* end argc loop */
             
-   Dmsg0(200, "Done scan.\n");
+   Dmsg0(800, "Done scan.\n");
 
    CAT *catalog = NULL;
    if (catalog_name != NULL) {
        catalog = (CAT *)GetResWithName(R_CATALOG, catalog_name);
        if (catalog == NULL) {
             bsendmsg(ua, _("Catalog \"%s\" not found\n"), catalog_name);
-          return 1;
+          return 0;
        }
    }
+   Dmsg1(200, "Using catalog=%s\n", catalog_name);
 
    if (job_name) {
       /* Find Job */
@@ -287,11 +294,11 @@ int run_cmd(UAContext *ua, const char *cmd)
       job = select_job_resource(ua);
    }
    if (!job) {
-      return 1;
+      return 0;
    } else if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) {
       bsendmsg(ua, _("No authorization. Job \"%s\".\n"),
         job->hdr.name);
-      return 1;
+      return 0;
    }
 
    if (store_name) {
@@ -310,8 +317,9 @@ int run_cmd(UAContext *ua, const char *cmd)
    } else if (!acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
       bsendmsg(ua, _("No authorization. Storage \"%s\".\n"),
               store->hdr.name);
-      return 1;
+      return 0;
    }
+   Dmsg1(200, "Using storage=%s\n", store->hdr.name);
 
    if (pool_name) {
       pool = (POOL *)GetResWithName(R_POOL, pool_name);
@@ -325,12 +333,13 @@ int run_cmd(UAContext *ua, const char *cmd)
       pool = job->pool;            /* use default */
    }
    if (!pool) {
-      return 1;
-   } else if (!acl_access_ok(ua, Pool_ACL, store->hdr.name)) {
+      return 0;
+   } else if (!acl_access_ok(ua, Pool_ACL, pool->hdr.name)) {
       bsendmsg(ua, _("No authorization. Pool \"%s\".\n"),
               pool->hdr.name);
-      return 1;
+      return 0;
    }
+   Dmsg1(200, "Using pool\n", pool->hdr.name);
 
    if (client_name) {
       client = (CLIENT *)GetResWithName(R_CLIENT, client_name);
@@ -344,12 +353,13 @@ int run_cmd(UAContext *ua, const char *cmd)
       client = job->client;          /* use default */
    }
    if (!client) {
-      return 1;
-   } else if (!acl_access_ok(ua, Client_ACL, store->hdr.name)) {
+      return 0;
+   } else if (!acl_access_ok(ua, Client_ACL, client->hdr.name)) {
       bsendmsg(ua, _("No authorization. Client \"%s\".\n"),
               client->hdr.name);
-      return 1;
+      return 0;
    }
+   Dmsg1(200, "Using client=%s\n", client->hdr.name);
 
    if (fileset_name) {
       fileset = (FILESET *)GetResWithName(R_FILESET, fileset_name);
@@ -361,11 +371,11 @@ int run_cmd(UAContext *ua, const char *cmd)
       fileset = job->fileset;          /* use default */
    }
    if (!fileset) {
-      return 1;
-   } else if (!acl_access_ok(ua, FileSet_ACL, store->hdr.name)) {
+      return 0;
+   } else if (!acl_access_ok(ua, FileSet_ACL, fileset->hdr.name)) {
       bsendmsg(ua, _("No authorization. FileSet \"%s\".\n"),
               fileset->hdr.name);
-      return 1;
+      return 0;
    }
 
    if (verify_job_name) {
@@ -386,7 +396,7 @@ int run_cmd(UAContext *ua, const char *cmd)
    set_jcr_defaults(jcr, job);
 
    jcr->verify_job = verify_job;
-   jcr->store = store;
+   set_storage(jcr, store);
    jcr->client = client;
    jcr->fileset = fileset;
    jcr->pool = pool;
@@ -460,7 +470,7 @@ try_again:
    }
 
    /* Run without prompting? */
-   if (find_arg(ua, _("yes")) > 0) {
+   if (ua->batch || find_arg(ua, _("yes")) > 0) {
       goto start_job;
    }
 
@@ -701,7 +711,7 @@ Priority:    %d\n"),
         /* Storage */
         store = select_storage_resource(ua);
         if (store) {
-           jcr->store = store;
+           set_storage(jcr, store);
            goto try_again;
         }
         break;
@@ -847,7 +857,7 @@ start_job:
       } else {
          bsendmsg(ua, _("Job started. JobId=%u\n"), JobId);
       }
-      return 1;
+      return JobId;
    }
 
 bail_out:
index afd32d6b6c1a6de38e47eb9118a5c659f2b672a5..4b70ba82a8aedba89f211d56636d93156d3c4e27 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -30,8 +30,6 @@
 #include "bacula.h"
 #include "dird.h"
 
-/* Imported subroutines */
-
 /* Imported variables */
 extern int r_first;
 extern int r_last;
@@ -39,17 +37,9 @@ extern struct s_res resources[];
 extern int console_msg_pending;
 extern char my_name[];
 
-/* Static variables */
-
-/* Exported variables */
-int quit_cmd_thread = 0;
-
-/* Imported functions */
 
 /* Forward referenced functions */
-
 extern "C" void *connect_thread(void *arg);
-
 static void *handle_UA_client_request(void *arg);
 
 
@@ -74,19 +64,18 @@ void start_UA_server(dlist *addrs)
 
    if ((status=pthread_create(&thid, NULL, connect_thread, (void *)myaddrs)) != 0) {
       berrno be;
-      be.set_errno(status);
-      Emsg1(M_ABORT, 0, _("Cannot create UA thread: %s\n"), be.strerror());
+      Emsg1(M_ABORT, 0, _("Cannot create UA thread: %s\n"), be.strerror(status));
    }
    started = TRUE;
    return;
 }
 
-extern "C" 
+extern "C"
 void *connect_thread(void *arg)
 {
    pthread_detach(pthread_self());
 
-   /*  ****FIXME**** put # 10 (timeout) on config parameter */
+   /* Permit 10 console connections */
    bnet_thread_server((dlist*)arg, 10, &ua_workq, handle_UA_client_request);
    return NULL;
 }
@@ -99,6 +88,15 @@ JCR *new_control_jcr(const char *base_name, int job_type)
 {
    JCR *jcr;
    jcr = new_jcr(sizeof(JCR), dird_free_jcr);
+   /*
+    * The job and defaults are not really used, but
+    *  we set them up to ensure that everything is correctly
+    *  initialized.
+    */
+   LockRes();
+   jcr->job = (JOB *)GetNextRes(R_JOB, NULL);
+   set_jcr_defaults(jcr, jcr->job);
+   UnlockRes();
    jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */
    create_unique_job_name(jcr, base_name);
    jcr->sched_time = jcr->start_time;
@@ -106,25 +104,11 @@ JCR *new_control_jcr(const char *base_name, int job_type)
    jcr->JobLevel = L_NONE;
    jcr->JobStatus = JS_Running;
    jcr->JobId = 0;
-   /*
-    * None of these are really defined for control JCRs, so we
-    * simply take the first of each one. This ensures that there
-    * will be no null pointer references.
-    */
-   LockRes();
-   jcr->job = (JOB *)GetNextRes(R_JOB, NULL);
-   jcr->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
-   jcr->client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
-   jcr->pool = (POOL *)GetNextRes(R_POOL, NULL);
-   jcr->catalog = (CAT *)GetNextRes(R_CATALOG, NULL);
-   jcr->store = (STORE *)GetNextRes(R_STORAGE, NULL);
-   jcr->fileset = (FILESET *)GetNextRes(R_FILESET, NULL);
-   UnlockRes();
    return jcr;
 }
 
 /*
- * Handle Director User Agent commands  
+ * Handle Director User Agent commands
  *
  */
 static void *handle_UA_client_request(void *arg)
@@ -132,14 +116,13 @@ static void *handle_UA_client_request(void *arg)
    int stat;
    UAContext *ua;
    JCR *jcr;
-   BSOCK *UA_sock = (BSOCK *)arg;
 
    pthread_detach(pthread_self());
 
    jcr = new_control_jcr("*Console*", JT_CONSOLE);
 
    ua = new_ua_context(jcr);
-   ua->UA_sock = UA_sock;
+   ua->UA_sock = (BSOCK *)arg;
 
    bnet_recv(ua->UA_sock);         /* Get first message */
    if (!authenticate_user_agent(ua)) {
@@ -158,7 +141,7 @@ static void *handle_UA_client_request(void *arg)
         }
         if (!ua->quit) {
            if (ua->auto_display_messages) {
-               strcpy(ua->cmd, "messages");
+               pm_strcpy(ua->cmd, "messages");
               qmessagescmd(ua, ua->cmd);
               ua->user_notified_msg_pending = FALSE;
            } else if (!ua->user_notified_msg_pending && console_msg_pending) {
@@ -184,7 +167,7 @@ getout:
 
 /*
  * Create a UAContext for a Job that is running so that
- *   it can the User Agent routines and    
+ *   it can the User Agent routines and
  *   to ensure that the Job gets the proper output.
  *   This is a sort of mini-kludge, and should be
  *   unified at some point.
@@ -218,18 +201,18 @@ void free_ua_context(UAContext *ua)
 
    if (ua->UA_sock) {
       bnet_close(ua->UA_sock);
+      ua->UA_sock = NULL;
    }
    free(ua);
 }
 
 
 /*
- * Called from main Bacula thread 
+ * Called from main Bacula thread
  */
 void term_ua_server()
 {
    if (!started) {
       return;
    }
-   quit_cmd_thread = TRUE;
 }
index d7ef5b6416ac8f9d7224d37da667517e34d35856..a176995ba24174fd3653eec21f63dad69916d9b2 100644 (file)
@@ -282,7 +282,7 @@ static void do_storage_status(UAContext *ua, STORE *store)
 {
    BSOCK *sd;
 
-   ua->jcr->store = store;
+   set_storage(ua->jcr, store);
    /* Try connecting for up to 15 seconds */
    bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d\n"), 
       store->hdr.name, store->address, store->SDport);
@@ -665,6 +665,19 @@ static void list_terminated_jobs(UAContext *ua)
       char JobName[MAX_NAME_LENGTH];
       const char *termstat;
 
+      bstrncpy(JobName, je->Job, sizeof(JobName));
+      /* There are three periods after the Job name */
+      char *p;
+      for (int i=0; i<3; i++) {
+         if ((p=strrchr(JobName, '.')) != NULL) {
+           *p = 0;
+        }
+      }
+
+      if (!acl_access_ok(ua, Job_ACL, JobName)) {
+        continue;
+      }
+
       bstrftime_nc(dt, sizeof(dt), je->end_time);
       switch (je->JobType) {
       case JT_ADMIN:
@@ -697,14 +710,6 @@ static void list_terminated_jobs(UAContext *ua)
          termstat = "Other";
         break;
       }
-      bstrncpy(JobName, je->Job, sizeof(JobName));
-      /* There are three periods after the Job name */
-      char *p;
-      for (int i=0; i<3; i++) {
-         if ((p=strrchr(JobName, '.')) != NULL) {
-           *p = 0;
-        }
-      }
       bsendmsg(ua, _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"), 
         je->JobId,
         level, 
index 517ccf767de24f101c88a127e9cabedd09211dc9..5023002e54d08bc16ba43c6cb2a47e728740aac8 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /*
-   Copyright (C) 2002-2004 Kern Sibbald and John Walker
+   Copyright (C) 2002-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
 #include "bacula.h"
 #include "dird.h"
+#ifdef HAVE_FNMATCH
 #include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
 #include "findlib/find.h"
 
 
@@ -54,25 +58,25 @@ static int quitcmd(UAContext *ua, TREE_CTX *tree);
 static int donecmd(UAContext *ua, TREE_CTX *tree);
 
 
-struct cmdstruct { const char *key; int (*func)(UAContext *ua, TREE_CTX *tree); const char *help; }; 
+struct cmdstruct { const char *key; int (*func)(UAContext *ua, TREE_CTX *tree); const char *help; };
 static struct cmdstruct commands[] = {
  { N_("cd"),         cdcmd,        _("change current directory")},
  { N_("count"),      countcmd,     _("count marked files in and below the cd")},
- { N_("dir"),        dircmd,       _("list current directory")},    
+ { N_("dir"),        dircmd,       _("list current directory")},
  { N_("done"),       donecmd,      _("leave file selection mode")},
  { N_("estimate"),   estimatecmd,  _("estimate restore size")},
  { N_("exit"),       donecmd,      _("exit = done")},
  { N_("find"),       findcmd,      _("find files -- wildcards allowed")},
  { N_("help"),       helpcmd,      _("print help")},
- { N_("ls"),         lscmd,        _("list current directory -- wildcards allowed")},    
- { N_("lsmark"),     lsmarkcmd,    _("list the marked files in and below the cd")},    
+ { N_("ls"),         lscmd,        _("list current directory -- wildcards allowed")},
+ { N_("lsmark"),     lsmarkcmd,    _("list the marked files in and below the cd")},
  { N_("mark"),       markcmd,      _("mark dir/file to be restored -- recursively in dirs")},
  { N_("markdir"),    markdircmd,   _("mark directory name to be restored (no files)")},
  { N_("pwd"),        pwdcmd,       _("print current working directory")},
  { N_("unmark"),     unmarkcmd,    _("unmark dir/file to be restored -- recursively in dir")},
  { N_("unmarkdir"),  unmarkdircmd, _("unmark directory name only -- no recursion")},
  { N_("quit"),       quitcmd,      _("quit")},
- { N_("?"),          helpcmd,      _("print help")},    
+ { N_("?"),          helpcmd,      _("print help")},
             };
 #define comsize (sizeof(commands)/sizeof(struct cmdstruct))
 
@@ -90,7 +94,7 @@ bool user_select_files_from_tree(TREE_CTX *tree)
    UAContext *ua = new_ua_context(tree->ua->jcr);
    ua->UA_sock = tree->ua->UA_sock;   /* patch in UA socket */
 
-   bsendmsg(tree->ua, _( 
+   bsendmsg(tree->ua, _(
       "\nYou are now entering file selection mode where you add (mark) and\n"
       "remove (unmark) files to be restored. No files are initially added, unless\n"
       "you used the \"all\" keyword on the command line.\n"
@@ -102,7 +106,7 @@ bool user_select_files_from_tree(TREE_CTX *tree)
    tree->node = (TREE_NODE *)tree->root;
    tree_getpath(tree->node, cwd, sizeof(cwd));
    bsendmsg(tree->ua, _("cwd is: %s\n"), cwd);
-   for ( ;; ) {       
+   for ( ;; ) {
       int found, len, i;
       if (!get_cmd(ua, "$ ")) {
         break;
@@ -215,7 +219,7 @@ int insert_tree_handler(void *ctx, int num_fields, char **row)
 
 /*
  * Set extract to value passed. We recursively walk
- *  down the tree setting all children if the 
+ *  down the tree setting all children if the
  *  node is a directory.
  */
 static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extract)
@@ -283,7 +287,7 @@ static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extr
 }
 
 /*
- * Recursively mark the current directory to be restored as 
+ * Recursively mark the current directory to be restored as
  *  well as all directories and files below it.
  */
 static int markcmd(UAContext *ua, TREE_CTX *tree)
@@ -306,7 +310,7 @@ static int markcmd(UAContext *ua, TREE_CTX *tree)
    if (count == 0) {
       bsendmsg(ua, _("No files marked.\n"));
    } else {
-      bsendmsg(ua, _("%s file%s marked.\n"),        
+      bsendmsg(ua, _("%s file%s marked.\n"),
                edit_uint64_with_commas(count, ec1), count==0?"":"s");
    }
    return 1;
@@ -335,7 +339,7 @@ static int markdircmd(UAContext *ua, TREE_CTX *tree)
    if (count == 0) {
       bsendmsg(ua, _("No directories marked.\n"));
    } else {
-      bsendmsg(ua, _("%s director%s marked.\n"), 
+      bsendmsg(ua, _("%s director%s marked.\n"),
                edit_uint64_with_commas(count, ec1), count==1?"y":"ies");
    }
    return 1;
@@ -356,8 +360,8 @@ static int countcmd(UAContext *ua, TREE_CTX *tree)
         }
       }
    }
-   bsendmsg(ua, "%s total files/dirs. %s marked to be restored.\n", 
-           edit_uint64_with_commas(total, ec1), 
+   bsendmsg(ua, "%s total files/dirs. %s marked to be restored.\n",
+           edit_uint64_with_commas(total, ec1),
            edit_uint64_with_commas(num_extract, ec2));
    return 1;
 }
@@ -370,7 +374,7 @@ static int findcmd(UAContext *ua, TREE_CTX *tree)
       bsendmsg(ua, _("No file specification given.\n"));
       return 0;
    }
-   
+
    for (int i=1; i < ua->argc; i++) {
       for (TREE_NODE *node=first_tree_node(tree->root); node; node=next_tree_node(node)) {
         if (fnmatch(ua->argk[i], node->fname, 0) == 0) {
@@ -396,7 +400,7 @@ static int lscmd(UAContext *ua, TREE_CTX *tree)
 {
    TREE_NODE *node;
 
-   if (!tree_node_has_child(tree->node)) {     
+   if (!tree_node_has_child(tree->node)) {
       return 1;
    }
    foreach_child(node, tree->node) {
@@ -418,10 +422,10 @@ static int lscmd(UAContext *ua, TREE_CTX *tree)
 /*
  * Ls command that lists only the marked files
  */
-static void rlsmark(UAContext *ua, TREE_NODE *tnode) 
+static void rlsmark(UAContext *ua, TREE_NODE *tnode)
 {
    TREE_NODE *node;
-   if (!tree_node_has_child(tnode)) {    
+   if (!tree_node_has_child(tnode)) {
       return;
    }
    foreach_child(node, tnode) {
@@ -494,7 +498,7 @@ static int dircmd(UAContext *ua, TREE_CTX *tree)
    char buf[1100];
    char cwd[1100], *pcwd;
 
-   if (!tree_node_has_child(tree->node)) {     
+   if (!tree_node_has_child(tree->node)) {
       bsendmsg(ua, "Node %s has no children.\n", tree->node->fname);
       return 1;
    }
@@ -576,14 +580,14 @@ static int estimatecmd(UAContext *ua, TREE_CTX *tree)
         }
       }
    }
-   bsendmsg(ua, "%d total files; %d marked to be restored; %s bytes.\n", 
+   bsendmsg(ua, "%d total files; %d marked to be restored; %s bytes.\n",
            total, num_extract, edit_uint64_with_commas(total_bytes, ec1));
    return 1;
 }
 
 
 
-static int helpcmd(UAContext *ua, TREE_CTX *tree) 
+static int helpcmd(UAContext *ua, TREE_CTX *tree)
 {
    unsigned int i;
 
@@ -601,7 +605,7 @@ static int helpcmd(UAContext *ua, TREE_CTX *tree)
  *   we assume it is a Win32 absolute cd rather than relative and
  *   try a second time with /x: ...  Win32 kludge.
  */
-static int cdcmd(UAContext *ua, TREE_CTX *tree) 
+static int cdcmd(UAContext *ua, TREE_CTX *tree)
 {
    TREE_NODE *node;
    char cwd[2000];
@@ -630,7 +634,7 @@ static int cdcmd(UAContext *ua, TREE_CTX *tree)
    return 1;
 }
 
-static int pwdcmd(UAContext *ua, TREE_CTX *tree) 
+static int pwdcmd(UAContext *ua, TREE_CTX *tree)
 {
    char cwd[2000];
    tree_getpath(tree->node, cwd, sizeof(cwd));
@@ -644,7 +648,7 @@ static int unmarkcmd(UAContext *ua, TREE_CTX *tree)
    TREE_NODE *node;
    int count = 0;
 
-   if (ua->argc < 2 || !tree_node_has_child(tree->node)) {     
+   if (ua->argc < 2 || !tree_node_has_child(tree->node)) {
       bsendmsg(ua, _("No files unmarked.\n"));
       return 1;
    }
@@ -693,12 +697,12 @@ static int unmarkdircmd(UAContext *ua, TREE_CTX *tree)
 }
 
 
-static int donecmd(UAContext *ua, TREE_CTX *tree) 
+static int donecmd(UAContext *ua, TREE_CTX *tree)
 {
    return 0;
 }
 
-static int quitcmd(UAContext *ua, TREE_CTX *tree) 
+static int quitcmd(UAContext *ua, TREE_CTX *tree)
 {
    ua->quit = true;
    return 0;
index 5e02da421978f64f169cfc70a61d736f3debdd44..858264f459eb44d924bd0c68be8257de6eea6e76 100644 (file)
@@ -64,16 +64,14 @@ static int missing_handler(void *ctx, int num_fields, char **row);
  */
 bool do_verify(JCR *jcr) 
 {
+   JOB_DBR jr;
    const char *level, *Name;
    BSOCK   *fd;
-   JOB_DBR jr, verify_jr;
    JobId_t verify_jobid = 0;
    int stat;
 
-   memset(&verify_jr, 0, sizeof(verify_jr));
-   if (!jcr->verify_jr) {
-      jcr->verify_jr = &verify_jr;
-   }
+   memset(&jcr->verify_jr, 0, sizeof(jcr->verify_jr));
+
    if (!get_or_create_client_record(jcr)) {
       goto bail_out;
    }
@@ -134,19 +132,19 @@ bool do_verify(JCR *jcr)
    if (jcr->JobLevel == L_VERIFY_CATALOG || 
        jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
        jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG) {
-      verify_jr.JobId = verify_jobid;
-      if (!db_get_job_record(jcr, jcr->db, &verify_jr)) {
+      jcr->verify_jr.JobId = verify_jobid;
+      if (!db_get_job_record(jcr, jcr->db, &jcr->verify_jr)) {
          Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"), 
              db_strerror(jcr->db));
         goto bail_out;
       }
-      if (verify_jr.JobStatus != 'T') {
+      if (jcr->verify_jr.JobStatus != 'T') {
          Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"),
-           verify_jobid, verify_jr.JobStatus);
+           verify_jobid, jcr->verify_jr.JobStatus);
         goto bail_out;
       }
       Jmsg(jcr, M_INFO, 0, _("Verifying against JobId=%d Job=%s\n"),
-        verify_jr.JobId, verify_jr.Job); 
+        jcr->verify_jr.JobId, jcr->verify_jr.Job); 
    }
 
    /* 
@@ -158,12 +156,12 @@ bool do_verify(JCR *jcr)
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
       RBSR *bsr = new_bsr();
       UAContext *ua;
-      bsr->JobId = verify_jr.JobId;
+      bsr->JobId = jcr->verify_jr.JobId;
       ua = new_ua_context(jcr);
       complete_bsr(ua, bsr);
       bsr->fi = new_findex();
       bsr->fi->findex = 1;
-      bsr->fi->findex2 = verify_jr.JobFiles;
+      bsr->fi->findex2 = jcr->verify_jr.JobFiles;
       jcr->ExpectedFiles = write_bsr_file(ua, bsr);
       if (jcr->ExpectedFiles == 0) {
         free_ua_context(ua);
@@ -207,7 +205,7 @@ bool do_verify(JCR *jcr)
    if (jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG && jcr->verify_job) {
       jcr->fileset = jcr->verify_job->fileset;
    }
-   Dmsg2(100, "ClientId=%u JobLevel=%c\n", verify_jr.ClientId, jcr->JobLevel);
+   Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->verify_jr.ClientId, jcr->JobLevel);
 
    /*
     * OK, now connect to the File daemon
@@ -440,7 +438,7 @@ static void verify_cleanup(JCR *jcr, int TermCode)
         jcr->fileset->hdr.name,
         level_to_str(jcr->JobLevel),
         jcr->client->hdr.name,
-        jcr->verify_jr->JobId,
+        jcr->verify_jr.JobId,
         Name,
         sdt,
         edt,
@@ -471,7 +469,7 @@ static void verify_cleanup(JCR *jcr, int TermCode)
         jcr->fileset->hdr.name,
         level_to_str(jcr->JobLevel),
         jcr->client->hdr.name,
-        jcr->verify_jr->JobId,
+        jcr->verify_jr.JobId,
         Name,
         sdt,
         edt,
@@ -572,7 +570,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
          */
         fdbr.FileId = 0;
         if (!db_get_file_attributes_record(jcr, jcr->db, jcr->fname, 
-             jcr->verify_jr, &fdbr)) {
+             &jcr->verify_jr, &fdbr)) {
             Jmsg(jcr, M_INFO, 0, _("New file: %s\n"), jcr->fname);
             Dmsg1(020, _("File not in catalog: %s\n"), jcr->fname);
            stat = JS_Differences;
index 88fed3b615927de6c26ca0949c3f9e4d0313eaf1..b543be4b15d49f834bc9dc0e321d9479517a19af 100644 (file)
 
 static int save_file(FF_PKT *ff_pkt, void *pkt);
 
+/*** FIXME ***/
+#ifdef HAVE_ACL
+static int read_send_acl(JCR *jcr, BSOCK *sd, int acltype, int stream);
+#endif
+
 /* 
  * Find all the requested files and send them
  * to the Storage daemon. 
@@ -501,76 +506,25 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr)
    }
    
 #ifdef HAVE_ACL
-   /* ACL stream */
-   if (ff_pkt->flags & FO_ACL) {
-      char *acl_text;
-      /* Read ACLs for files, dirs and links */
-      if (ff_pkt->type == FT_DIREND) {
-        /* Directory: Try for default ACL*/
-        acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_DEFAULT);
-        if (!myAcl) {
-            Dmsg1(200, "No default ACL defined for directory: %s!\n", ff_pkt->fname);
-           /* If there is no default ACL get standard ACL */
-           myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
-           if (!myAcl) {
-               Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of directory: %s!\n", ff_pkt->fname);
-           }
-        }
-         acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
-        /* Free memory */
-        acl_free(myAcl);
+   /*** FIXME ***/
+   if (ff_pkt->flags & FO_ACL) {   
+      /* Storing of ACLs for Links is not needed, because: ACL of link == ACL of original */
+      if(ff_pkt->type != FT_LNK) {
+         /* Read access ACLs for files, dirs and links */
+         if (!read_send_acl(jcr, sd, ACL_TYPE_ACCESS, STREAM_UNIX_ATTRIBUTES_ACCESS_ACL)) {
+            return 0;
+         }
+         /* Directories can have also default ACLs*/
+         if (ff_pkt->type == FT_DIREND) {
+            if (!read_send_acl(jcr, sd, ACL_TYPE_DEFAULT, STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL)) {
+               return 0;
+            }
+         }
       } else {
-        /* Files or links */
-        acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
-        if (!myAcl) {
-            Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of file: %s!\n", ff_pkt->fname);
-           acl_free(myAcl);
-        }
-         acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
-        acl_free(myAcl);
-      }
-      
-      /* If there is an ACL, send it to the Storage daemon */
-      if (acl_text) {
-        sd = jcr->store_bsock;
-        pm_strcpy(&jcr->last_fname, ff_pkt->fname);
-      
-        /*
-        * Send ACL header
-        *
-        */
-         if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES_ACL)) {
-           berrno be;
-            Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
-                 bnet_strerror(sd));
-           return 0;
-        }
-      
-        /* Send the buffer to the storage deamon */
-        msgsave = sd->msg;
-        sd->msg = acl_text;
-        sd->msglen = strlen(acl_text) + 1;
-        if (!bnet_send(sd)) {
-           berrno be;
-           sd->msg = msgsave;
-           sd->msglen = 0;
-           bclose(&ff_pkt->bfd);
-            Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
-                 bnet_strerror(sd));
-        } else {
-           jcr->JobBytes += sd->msglen;
-           sd->msg = msgsave;
-           bclose(&ff_pkt->bfd);
-           if (!bnet_sig(sd, BNET_EOD)) {
-              berrno be;
-               Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
-                    bnet_strerror(sd));
-           } else {
-               Dmsg1(200, "ACL of file: %s successfully backed up!\n", ff_pkt->fname);
-           }
-        }  
+         Dmsg1(200, "No need to store ACLs from Links!\n", jcr->last_fname);
       }
    }
+   
 #endif
 
    /* Terminate any MD5 signature and send it to Storage daemon and the Director */
@@ -597,3 +551,74 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr)
    }
    return 1;
 }
+
+#ifdef HAVE_ACL
+/*
+* Read and send an ACL for the last encountered file.
+*/
+int read_send_acl(JCR *jcr, BSOCK *sd, int acltype, int stream)
+{
+   POOLMEM *msgsave;
+   char *acl_text = NULL;
+   acl_t acl;
+
+   /* Read access ACLs for files, dirs and links */
+   acl = acl_get_file(jcr->last_fname, acltype);
+   if (!acl) {
+      Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of %s!\n", jcr->last_fname);
+      return 0;
+   }
+   
+   acl_text = acl_to_any_text(acl, NULL, ',', TEXT_ABBREVIATE);
+   
+   /* Check if ACL is valid */
+   if ((acl_valid(acl) != 0) && (acltype != ACL_TYPE_DEFAULT)) {
+      Jmsg1(jcr, M_WARNING, 0, "Failure in the ACL of %s! FD is not able to back it up!\n", jcr->last_fname);
+      Dmsg1(200, "ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+      Dmsg1(200, "ACL value=%s\n", acl_text);
+   } else if (acl_valid(acl) == 0) {
+      Dmsg1(200, "ACL of file/dir: %s is valid!\n", jcr->last_fname);
+      Dmsg1(200, "ACL value=%s\n", acl_text);
+   } else {
+      Dmsg1(200, "Directory: %s has no Default ACL, there is nothing to do from here!\n", jcr->last_fname);
+      acl_free(acl);
+      return 0;
+   }
+   acl_free(acl);
+   
+   if (acl_text == NULL) {
+   /* ***FIXME*** Can this happen? */
+      Jmsg1(jcr, M_WARNING, 0, "Error decoding ACL of %s!\n", jcr->last_fname);
+      return 0;
+   }
+
+   if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream)) {
+      berrno be;
+      Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+      return 0;
+   }
+
+   /* Send the buffer to the storage deamon */
+   msgsave = sd->msg;
+   sd->msg = acl_text;
+   sd->msglen = strlen(acl_text) + 1;
+   if (!bnet_send(sd)) {
+      berrno be;
+      sd->msg = msgsave;
+      sd->msglen = 0;
+      Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+      return 0;
+   }
+
+   jcr->JobBytes += sd->msglen;
+   sd->msg = msgsave;
+   if (!bnet_sig(sd, BNET_EOD)) {
+   berrno be;
+   Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+   return 0;
+   }
+
+   Dmsg1(200, "ACL of file: %s successfully backed up!\n", jcr->last_fname);
+   return 1;
+   }
+#endif
index bee59417eadb08a03ce44ec0e9109cc443bae540..56ff5e736ccdcba724cf57d066bde2f23569ad21 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Bacula File Daemon estimate.c                  
+ *  Bacula File Daemon estimate.c
  *   Make and estimate of the number of files and size to be saved.
  *
  *    Kern Sibbald, September MMI
@@ -32,7 +32,7 @@
 
 static int tally_file(FF_PKT *ff_pkt, void *pkt);
 
-/* 
+/*
  * Find all the requested files and count them.
  */
 int make_estimate(JCR *jcr)
@@ -45,9 +45,9 @@ int make_estimate(JCR *jcr)
    stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr);
 
    return stat;
-}         
+}
 
-/* 
+/*
  * Called here by find() for each file included.
  *
  */
@@ -64,6 +64,9 @@ static int tally_file(FF_PKT *ff_pkt, void *ijcr)
    case FT_REGE:
    case FT_REG:
    case FT_LNK:
+   case FT_NORECURSE:
+   case FT_NOFSCHG:
+   case FT_INVALIDFS:
    case FT_DIREND:
    case FT_SPEC:
    case FT_RAW:
@@ -76,16 +79,23 @@ static int tally_file(FF_PKT *ff_pkt, void *ijcr)
    case FT_DIRNOCHG:
    case FT_NOCHG:
    case FT_ISARCH:
-   case FT_NORECURSE:
-   case FT_NOFSCHG:
    case FT_NOOPEN:
    default:
       return 1;
    }
 
-   if (ff_pkt->type != FT_LNKSAVED && S_ISREG(ff_pkt->statp.st_mode) && 
-        ff_pkt->statp.st_size > 0) {
-      jcr->JobBytes += ff_pkt->statp.st_size;
+   if (ff_pkt->type != FT_LNKSAVED && S_ISREG(ff_pkt->statp.st_mode)) {
+      if (ff_pkt->statp.st_size > 0) {
+        jcr->JobBytes += ff_pkt->statp.st_size;
+      }
+#ifdef HAVE_DARWIN_OS
+      if (ff_pkt->flags & FO_HFSPLUS) {
+        if (ff_pkt->hfsinfo.rsrclength > 0) {
+           jcr->JobBytes += ff_pkt->hfsinfo.rsrclength;
+        }
+        jcr->JobBytes += 32;    /* Finder info */
+      }
+#endif
    }
    jcr->num_files_examined++;
    jcr->JobFiles++;                 /* increment number of files seen */
index 7e0b61effc1087cbe83549948c0bd5d951009314..37a1d3547cecf098e8de2b5de7e829efffca6aba 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -62,10 +62,10 @@ static pthread_t server_tid;
 
 static void usage()
 {
-   fprintf(stderr, _(
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker\n"
+   Pmsg0(-1, _(
+"Copyright (C) 2000-2005 Kern Sibbald\n"
 "\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bacula-fd [-f -s] [-c config_file] [-d debug_level]\n"  
+"Usage: bacula-fd [-f -s] [-c config_file] [-d debug_level]\n"
 "        -c <file>   use <file> as configuration file\n"
 "        -dnn        set debug level to nn\n"
 "        -f          run in foreground (for debugging)\n"
@@ -76,14 +76,14 @@ static void usage()
 "        -u          userid\n"
 "        -v          verbose user messages\n"
 "        -?          print this message.\n"
-"\n"));         
+"\n"));
    exit(1);
 }
 
 
-/********************************************************************* 
+/*********************************************************************
  *
- *  Main Bacula Unix Client Program                       
+ *  Main Bacula Unix Client Program
  *
  */
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
@@ -116,7 +116,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0) {
-           debug_level = 1; 
+           debug_level = 1;
         }
         break;
 
@@ -151,7 +151,7 @@ int main (int argc, char *argv[])
       default:
         usage();
 
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -160,7 +160,7 @@ int main (int argc, char *argv[])
       if (configfile != NULL)
         free(configfile);
       configfile = bstrdup(*argv);
-      argc--; 
+      argc--;
       argv++;
    }
    if (argc) {
@@ -193,8 +193,8 @@ int main (int argc, char *argv[])
    me = (CLIENT *)GetNextRes(R_CLIENT, NULL);
    UnlockRes();
    if (!me) {
-      Emsg1(M_ABORT, 0, _("No File daemon resource defined in %s\n\
-Without that I don't know who I am :-(\n"), configfile);
+      Emsg1(M_ABORT, 0, _("No File daemon resource defined in %s\n"
+"Without that I don't know who I am :-(\n"), configfile);
    } else {
       my_name_is(0, NULL, me->hdr.name);
       if (!me->messages) {
@@ -239,7 +239,7 @@ Without that I don't know who I am :-(\n"), configfile);
    server_tid = pthread_self();
 
    if (inetd_request) {
-      /* Socket is on fd 0 */         
+      /* Socket is on fd 0 */
       struct sockaddr client_addr;
       int port = -1;
       socklen_t client_addr_len = sizeof(client_addr);
@@ -271,7 +271,7 @@ void terminate_filed(int sig)
       free(configfile);
    }
    if (debug_level > 5) {
-      print_memory_pool_stats(); 
+      print_memory_pool_stats();
    }
    free_config_resources();
    term_msg();
index 9733e0b53713a488662d2da5b678b861d6a5630b..418c0e1f91756cdf4941828b481ebd593702ce01 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -31,7 +31,7 @@
 
 extern char my_name[];
 extern CLIENT *me;                   /* our client resource */
-                       
+
 /* Imported functions */
 extern int status_cmd(JCR *jcr);
 extern int qstatus_cmd(JCR *jcr);
@@ -58,7 +58,7 @@ static int open_sd_read_session(JCR *jcr);
 static int send_bootstrap_file(JCR *jcr);
 static int runbefore_cmd(JCR *jcr);
 static int runafter_cmd(JCR *jcr);
-static int run_cmd(JCR *jcr, char *cmd, const char *name);
+static bool run_cmd(JCR *jcr, char *cmd, const char *name);
 static void set_options(findFOPTS *fo, const char *opts);
 
 
@@ -70,8 +70,8 @@ struct s_cmds {
    int monitoraccess; /* specify if monitors have access to this function */
 };
 
-/*  
- * The following are the recognized commands from the Director. 
+/*
+ * The following are the recognized commands from the Director.
  */
 static struct s_cmds cmds[] = {
    {"backup",       backup_cmd,    0},
@@ -146,7 +146,7 @@ static char read_open[]    = "read open session = %s %ld %ld %ld %ld %ld %ld\n";
 static char read_data[]    = "read data %d\n";
 static char read_close[]   = "read close session %d\n";
 
-/* 
+/*
  * Accept requests from a Director
  *
  * NOTE! We are running as a separate thread
@@ -165,7 +165,7 @@ static char read_close[]   = "read close session %d\n";
  */
 void *handle_client_request(void *dirp)
 {
-   int i; 
+   int i;
    bool found, quit;
    JCR *jcr;
    BSOCK *dir = (BSOCK *)dirp;
@@ -208,7 +208,7 @@ void *handle_client_request(void *dirp)
            }
             Dmsg1(100, "Executing %s command.\n", cmds[i].cmd);
            if (!cmds[i].func(jcr)) {         /* do command */
-              quit = true;         /* error or fully terminated,       get out */
+              quit = true;         /* error or fully terminated, get out */
                Dmsg0(20, "Quit command loop due to command error or Job done.\n");
            }
            break;
@@ -248,8 +248,13 @@ void *handle_client_request(void *dirp)
               regfree((regex_t *)fo->regex.get(k));
            }
            fo->regex.destroy();
+           fo->regexdir.destroy();
+           fo->regexfile.destroy();
            fo->wild.destroy();
+           fo->wilddir.destroy();
+           fo->wildfile.destroy();
            fo->base.destroy();
+           fo->fstype.destroy();
            if (fo->reader) {
               free(fo->reader);
            }
@@ -268,8 +273,13 @@ void *handle_client_request(void *dirp)
         for (j=0; j<incexe->opts_list.size(); j++) {
            findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
            fo->regex.destroy();
+           fo->regexdir.destroy();
+           fo->regexfile.destroy();
            fo->wild.destroy();
+           fo->wilddir.destroy();
+           fo->wildfile.destroy();
            fo->base.destroy();
+           fo->fstype.destroy();
         }
         incexe->opts_list.destroy();
         incexe->name_list.destroy();
@@ -286,7 +296,7 @@ void *handle_client_request(void *dirp)
 }
 
 /*
- * Hello from Director he must identify himself and provide his 
+ * Hello from Director he must identify himself and provide his
  *  password.
  */
 static int hello_cmd(JCR *jcr)
@@ -317,7 +327,7 @@ static int cancel_cmd(JCR *jcr)
            P(cjcr->mutex);
            cjcr->store_bsock->timed_out = 1;
            cjcr->store_bsock->terminated = 1;
-/* 
+/*
  * #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
  */
 #if !defined(HAVE_CYGWIN)
@@ -350,7 +360,7 @@ static int setdebug_cmd(JCR *jcr)
    if (sscanf(dir->msg, "setdebug=%d trace=%d", &level, &trace_flag) != 2 || level < 0) {
       pm_strcpy(jcr->errmsg, dir->msg);
       bnet_fsend(dir, "2991 Bad setdebug command: %s\n", jcr->errmsg);
-      return 0;   
+      return 0;
    }
    debug_level = level;
    set_trace(trace_flag);
@@ -370,7 +380,7 @@ static int estimate_cmd(JCR *jcr)
       return 0;
    }
    make_estimate(jcr);
-   bnet_fsend(dir, OKest, jcr->num_files_examined, 
+   bnet_fsend(dir, OKest, jcr->num_files_examined,
       edit_uint64_with_commas(jcr->JobBytes, ed2));
    bnet_sig(dir, BNET_EOD);
    return 1;
@@ -385,7 +395,7 @@ static int job_cmd(JCR *jcr)
    POOLMEM *sd_auth_key;
 
    sd_auth_key = get_memory(dir->msglen);
-   if (sscanf(dir->msg, jobcmd,  &jcr->JobId, jcr->Job,  
+   if (sscanf(dir->msg, jobcmd,  &jcr->JobId, jcr->Job,
              &jcr->VolSessionId, &jcr->VolSessionTime,
              sd_auth_key) != 5) {
       pm_strcpy(jcr->errmsg, dir->msg);
@@ -402,7 +412,7 @@ static int job_cmd(JCR *jcr)
 
 static int runbefore_cmd(JCR *jcr)
 {
-   int stat;
+   bool ok;
    BSOCK *dir = jcr->dir_bsock;
    POOLMEM *cmd = get_memory(dir->msglen+1);
 
@@ -417,9 +427,9 @@ static int runbefore_cmd(JCR *jcr)
    unbash_spaces(cmd);
 
    /* Run the command now */
-   stat = run_cmd(jcr, cmd, "ClientRunBeforeJob");
+   ok = run_cmd(jcr, cmd, "ClientRunBeforeJob");
    free_memory(cmd);
-   if (stat) {
+   if (ok) {
       bnet_fsend(dir, OKRunBefore);
       return 1;
    } else {
@@ -451,32 +461,37 @@ static int runafter_cmd(JCR *jcr)
    return bnet_fsend(dir, OKRunAfter);
 }
 
-static int run_cmd(JCR *jcr, char *cmd, const char *name)
+static bool run_cmd(JCR *jcr, char *cmd, const char *name)
 {
    POOLMEM *ecmd = get_pool_memory(PM_FNAME);
    int status;
    BPIPE *bpipe;
    char line[MAXSTRING];
-   
+
    ecmd = edit_job_codes(jcr, ecmd, cmd, "");
    bpipe = open_bpipe(ecmd, 0, "r");
    free_pool_memory(ecmd);
    if (bpipe == NULL) {
-      Jmsg(jcr, M_FATAL, 0, _("%s could not execute\n"), name);
-      set_jcr_job_status(jcr, JS_FatalError);
-      return 0;
+      berrno be;
+      Jmsg(jcr, M_FATAL, 0, _("%s could not execute. ERR=%s\n"), name,
+        be.strerror());
+      return false;
    }
    while (fgets(line, sizeof(line), bpipe->rfd)) {
-      Jmsg(jcr, M_INFO, 0, _("%s: %s"), name, line);
+      int len = strlen(line);
+      if (len > 0 && line[len-1] == '\n') {
+        line[len-1] = 0;
+      }
+      Jmsg(jcr, M_INFO, 0, _("%s: %s\n"), name, line);
    }
    status = close_bpipe(bpipe);
    if (status != 0) {
-      Jmsg(jcr, M_FATAL, 0, _("%s returned non-zero status=%d\n"), name,
-        status);
-      set_jcr_job_status(jcr, JS_FatalError);
-      return 0;
+      berrno be;
+      Jmsg(jcr, M_FATAL, 0, _("%s returned non-zero status=%d. ERR=%s\n"), name,
+        status, be.strerror(status));
+      return false;
    }
-   return 1;
+   return true;
 }
 
 
@@ -518,8 +533,8 @@ static void add_fname_to_list(JCR *jcr, char *fname, int list)
       /* Copy File options */
       if (list == INC_LIST) {
         *q = 0;                      /* terminate options */
-        strcpy(buf, fname);
-         strcat(buf, " ");
+        bstrncpy(buf, fname, sizeof(buf));
+         bstrncat(buf, " ", sizeof(buf));
         optlen = strlen(buf);
       } else {
         optlen = 0;
@@ -549,8 +564,8 @@ static void add_fname_to_list(JCR *jcr, char *fname, int list)
       /* Copy File options */
       if (list == INC_LIST) {
         *q = 0;                      /* terminate options */
-        strcpy(buf, fname);
-         strcat(buf, " ");
+        bstrncpy(buf, fname, sizeof(buf));
+         bstrncat(buf, " ", sizeof(buf));
         optlen = strlen(buf);
       } else {
         optlen = 0;
@@ -575,8 +590,8 @@ static void add_fname_to_list(JCR *jcr, char *fname, int list)
    }
 }
 
-/* 
- * 
+/*
+ *
  * Get list of files/directories to include from Director
  *
  */
@@ -594,12 +609,12 @@ static int include_cmd(JCR *jcr)
    return bnet_fsend(dir, OKinc);
 }
 
-static bool init_fileset(JCR *jcr) 
+static bool init_fileset(JCR *jcr)
 {
    FF_PKT *ff;
    findFILESET *fileset;
 
-   if (!jcr->ff) {     
+   if (!jcr->ff) {
       return false;
    }
    ff = (FF_PKT *)jcr->ff;
@@ -625,8 +640,13 @@ static findFOPTS *start_options(FF_PKT *ff)
       findFOPTS *fo = (findFOPTS *)malloc(sizeof(findFOPTS));
       memset(fo, 0, sizeof(findFOPTS));
       fo->regex.init(1, true);
+      fo->regexdir.init(1, true);
+      fo->regexfile.init(1, true);
       fo->wild.init(1, true);
+      fo->wilddir.init(1, true);
+      fo->wildfile.init(1, true);
       fo->base.init(1, true);
+      fo->fstype.init(1, true);
       incexe->current_opts = fo;
       incexe->opts_list.append(fo);
    }
@@ -671,6 +691,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese
       }
       break;
    case '<':
+      Dmsg0(100, "Doing < include on client.\n");
       p++;                     /* skip over < */
       if ((ffd = fopen(p, "r")) == NULL) {
         berrno be;
@@ -680,6 +701,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese
       }
       while (fgets(buf, sizeof(buf), ffd)) {
         strip_trailing_junk(buf);
+         Dmsg1(100, "%s\n", buf);
         fileset->incexe->name_list.append(bstrdup(buf));
       }
       fclose(ffd);
@@ -690,7 +712,7 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese
    }
 }
 
-   
+
 static void add_fileset(JCR *jcr, const char *item)
 {
    FF_PKT *ff = (FF_PKT *)jcr->ff;
@@ -698,15 +720,35 @@ static void add_fileset(JCR *jcr, const char *item)
    int state = fileset->state;
    findFOPTS *current_opts;
 
+   /* Get code, optional subcode, and position item past the dividing space */
    Dmsg1(100, "%s\n", item);
    int code = item[0];
-   if (item[1] == ' ') {              /* If string follows */
-      item += 2;                     /* point to string */
+   if (code != '\0') {
+      ++item;
+   }
+   int subcode = ' ';               /* A space is always a valid subcode */
+   if (item[0] != '\0' && item[0] != ' ') {
+      subcode = item[0];
+      ++item;
+   }
+   if (*item == ' ') {
+      ++item;
    }
 
+   /* Skip all lines we receive after an error */
    if (state == state_error) {
       return;
    }
+
+   /*
+    * The switch tests the code for validity.
+    * The subcode is always good if it is a space, otherwise we must confirm.
+    * We set state to state_error first assuming the subcode is invalid,
+    * requiring state to be set in cases below that handle subcodes.
+    */
+   if (subcode != ' ') {
+      state = state_error;
+   }
    switch (code) {
    case 'I':
       /* New include */
@@ -738,7 +780,11 @@ static void add_fileset(JCR *jcr, const char *item)
       int rc;
       char prbuf[500];
       preg = (regex_t *)malloc(sizeof(regex_t));
-      rc = regcomp(preg, item, REG_EXTENDED);
+      if (current_opts->flags & FO_IGNORECASE) {
+        rc = regcomp(preg, item, REG_EXTENDED|REG_ICASE);
+      } else {
+        rc = regcomp(preg, item, REG_EXTENDED);
+      }
       if (rc != 0) {
         regerror(rc, preg, prbuf, sizeof(prbuf));
         regfree(preg);
@@ -747,20 +793,41 @@ static void add_fileset(JCR *jcr, const char *item)
         state = state_error;
         break;
       }
-      current_opts->regex.append(preg);
       state = state_options;
+      if (subcode == ' ') {
+        current_opts->regex.append(preg);
+      } else if (subcode == 'D') {
+        current_opts->regexdir.append(preg);
+      } else if (subcode == 'F') {
+        current_opts->regexfile.append(preg);
+      } else {
+        state = state_error;
+      }
       break;
    case 'B':
       current_opts = start_options(ff);
       current_opts->base.append(bstrdup(item));
       state = state_options;
       break;
+   case 'X':
+      current_opts = start_options(ff);
+      current_opts->fstype.append(bstrdup(item));
+      state = state_options;
+      break;
    case 'W':
       current_opts = start_options(ff);
-      current_opts->wild.append(bstrdup(item));
       state = state_options;
+      if (subcode == ' ') {
+        current_opts->wild.append(bstrdup(item));
+      } else if (subcode == 'D') {
+        current_opts->wilddir.append(bstrdup(item));
+      } else if (subcode == 'F') {
+        current_opts->wildfile.append(bstrdup(item));
+      } else {
+        state = state_error;
+      }
       break;
-   case 'O':   
+   case 'O':
       current_opts = start_options(ff);
       set_options(current_opts, item);
       state = state_options;
@@ -797,12 +864,27 @@ static bool term_fileset(JCR *jcr)
         for (k=0; k<fo->regex.size(); k++) {
             Dmsg1(400, "R %s\n", (char *)fo->regex.get(k));
         }
+        for (k=0; k<fo->regexdir.size(); k++) {
+            Dmsg1(400, "RD %s\n", (char *)fo->regexdir.get(k));
+        }
+        for (k=0; k<fo->regexfile.size(); k++) {
+            Dmsg1(400, "RF %s\n", (char *)fo->regexfile.get(k));
+        }
         for (k=0; k<fo->wild.size(); k++) {
             Dmsg1(400, "W %s\n", (char *)fo->wild.get(k));
         }
+        for (k=0; k<fo->wilddir.size(); k++) {
+            Dmsg1(400, "WD %s\n", (char *)fo->wilddir.get(k));
+        }
+        for (k=0; k<fo->wildfile.size(); k++) {
+            Dmsg1(400, "WF %s\n", (char *)fo->wildfile.get(k));
+        }
         for (k=0; k<fo->base.size(); k++) {
             Dmsg1(400, "B %s\n", (char *)fo->base.get(k));
         }
+        for (k=0; k<fo->fstype.size(); k++) {
+            Dmsg1(400, "X %s\n", (char *)fo->fstype.get(k));
+        }
         if (fo->reader) {
             Dmsg1(400, "D %s\n", fo->reader);
         }
@@ -822,12 +904,27 @@ static bool term_fileset(JCR *jcr)
         for (k=0; k<fo->regex.size(); k++) {
             Dmsg1(400, "R %s\n", (char *)fo->regex.get(k));
         }
+        for (k=0; k<fo->regexdir.size(); k++) {
+            Dmsg1(400, "RD %s\n", (char *)fo->regexdir.get(k));
+        }
+        for (k=0; k<fo->regexfile.size(); k++) {
+            Dmsg1(400, "RF %s\n", (char *)fo->regexfile.get(k));
+        }
         for (k=0; k<fo->wild.size(); k++) {
             Dmsg1(400, "W %s\n", (char *)fo->wild.get(k));
         }
+        for (k=0; k<fo->wilddir.size(); k++) {
+            Dmsg1(400, "WD %s\n", (char *)fo->wilddir.get(k));
+        }
+        for (k=0; k<fo->wildfile.size(); k++) {
+            Dmsg1(400, "WF %s\n", (char *)fo->wildfile.get(k));
+        }
         for (k=0; k<fo->base.size(); k++) {
             Dmsg1(400, "B %s\n", (char *)fo->base.get(k));
         }
+        for (k=0; k<fo->fstype.size(); k++) {
+            Dmsg1(400, "X %s\n", (char *)fo->fstype.get(k));
+        }
       }
       for (j=0; j<incexe->name_list.size(); j++) {
          Dmsg1(400, "F %s\n", (char *)incexe->name_list.get(j));
@@ -861,6 +958,12 @@ static void set_options(findFOPTS *fo, const char *opts)
       case 'h':                 /* no recursion */
         fo->flags |= FO_NO_RECURSION;
         break;
+      case 'H':                 /* no hard link handling */
+        fo->flags |= FO_NO_HARDLINK;
+        break;
+      case 'i':
+        fo->flags |= FO_IGNORECASE;
+        break;
       case 'M':                 /* MD5 */
         fo->flags |= FO_MD5;
         break;
@@ -870,6 +973,8 @@ static void set_options(findFOPTS *fo, const char *opts)
       case 'p':                 /* use portable data format */
         fo->flags |= FO_PORTABLE;
         break;
+      case 'R':                 /* Resource forks and Finder Info */
+        fo->flags |= FO_HFSPLUS;
       case 'r':                 /* read fifo */
         fo->flags |= FO_READFIFO;
         break;
@@ -911,11 +1016,11 @@ static void set_options(findFOPTS *fo, const char *opts)
         break;
       }
    }
-} 
+}
 
 
 /*
- * Director is passing his Fileset   
+ * Director is passing his Fileset
  */
 static int fileset_cmd(JCR *jcr)
 {
@@ -972,7 +1077,7 @@ static int bootstrap_cmd(JCR *jcr)
    bs = fopen(fname, "a+");           /* create file */
    if (!bs) {
       berrno be;
-      /* 
+      /*
        * Suck up what he is sending to us so that he will then
        *   read our error message.
        */
@@ -1005,8 +1110,6 @@ static int level_cmd(JCR *jcr)
 {
    BSOCK *dir = jcr->dir_bsock;
    POOLMEM *level, *buf = NULL;
-   struct tm tm;
-   time_t mtime;
    int mtime_only;
 
    level = get_memory(dir->msglen+1);
@@ -1017,29 +1120,17 @@ static int level_cmd(JCR *jcr)
    /* Base backup requested? */
    if (strcmp(level, "base") == 0) {
       jcr->JobLevel = L_BASE;
-   /* Full backup requested? */ 
+   /* Full backup requested? */
    } else if (strcmp(level, "full") == 0) {
       jcr->JobLevel = L_FULL;
-   /* 
-    * Backup requested since <date> <time>
-    *  This form is also used for incremental and differential
-    *  This code is deprecated.  See since_utime for new code.
-    */
-   } else if (strcmp(level, "since") == 0) {
-      jcr->JobLevel = L_SINCE;
-      if (sscanf(dir->msg, "level = since %d-%d-%d %d:%d:%d mtime_only=%d", 
-                &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
-                &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &mtime_only) != 7) {
-        goto bail_out;
-      }
-      tm.tm_year -= 1900;
-      tm.tm_mon  -= 1;
-      tm.tm_wday = tm.tm_yday = 0;             
-      tm.tm_isdst = -1;
-      mtime = mktime(&tm);
-      Dmsg2(100, "Got since time: %s mtime_only=%d\n", ctime(&mtime), mtime_only);
-      jcr->incremental = 1;          /* set incremental or decremental backup */
-      jcr->mtime = mtime;            /* set since time */
+   } else if (strcmp(level, "differential") == 0) {
+      jcr->JobLevel = L_DIFFERENTIAL;
+      free_memory(level);
+      return 1;
+   } else if (strcmp(level, "incremental") == 0) {
+      jcr->JobLevel = L_INCREMENTAL;
+      free_memory(level);
+      return 1;   
    /*
     * We get his UTC since time, then sync the clocks and correct it
     *  to agree with our clock.
@@ -1048,15 +1139,17 @@ static int level_cmd(JCR *jcr)
       buf = get_memory(dir->msglen+1);
       utime_t since_time, adj;
       btime_t his_time, bt_start, rt=0, bt_adj=0;
-      jcr->JobLevel = L_SINCE;
-      if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d", 
-                buf, &mtime_only) != 2) { 
+      if (jcr->JobLevel == L_NONE) {
+        jcr->JobLevel = L_SINCE;     /* if no other job level set, do it now */
+      }
+      if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d",
+                buf, &mtime_only) != 2) {
         goto bail_out;
       }
       since_time = str_to_uint64(buf); /* this is the since time */
       char ed1[50], ed2[50];
-      /* 
-       * Sync clocks by polling him for the time. We take       
+      /*
+       * Sync clocks by polling him for the time. We take
        *   10 samples of his time throwing out the first two.
        */
       for (int i=0; i<10; i++) {
@@ -1082,7 +1175,7 @@ static int level_cmd(JCR *jcr)
       adj = btime_to_utime(bt_adj);
       since_time += adj;             /* adjust for clock difference */
       if (adj != 0) {
-         Jmsg(jcr, M_INFO, 0, _("Since time adjusted by %d seconds.\n"), adj);
+         Jmsg(jcr, M_INFO, 0, _("DIR and FD clocks differ by %d seconds, FD automatically adjusting.\n"), adj);
       }
       bnet_sig(dir, BNET_EOD);
 
@@ -1120,7 +1213,7 @@ static int session_cmd(JCR *jcr)
    Dmsg1(100, "SessionCmd: %s", dir->msg);
    if (sscanf(dir->msg, sessioncmd, jcr->VolumeName,
              &jcr->VolSessionId, &jcr->VolSessionTime,
-             &jcr->StartFile, &jcr->EndFile, 
+             &jcr->StartFile, &jcr->EndFile,
              &jcr->StartBlock, &jcr->EndBlock) != 7) {
       pm_strcpy(jcr->errmsg, dir->msg);
       Jmsg(jcr, M_FATAL, 0, "Bad session command: %s", jcr->errmsg);
@@ -1150,7 +1243,7 @@ static int storage_cmd(JCR *jcr)
    Dmsg3(110, "Open storage: %s:%d ssl=%d\n", jcr->stored_addr, stored_port, enable_ssl);
    /* Open command communications with Storage daemon */
    /* Try to connect for 1 hour at 10 second intervals */
-   sd = bnet_connect(jcr, 10, (int)me->SDConnectTimeout, _("Storage daemon"), 
+   sd = bnet_connect(jcr, 10, (int)me->SDConnectTimeout, _("Storage daemon"),
                     jcr->stored_addr, NULL, stored_port, 1);
    if (sd == NULL) {
       Jmsg(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
@@ -1175,11 +1268,11 @@ static int storage_cmd(JCR *jcr)
 }
 
 
-/*  
+/*
  * Do a backup. For now, we handle only Full and Incremental.
  */
 static int backup_cmd(JCR *jcr)
-{ 
+{
    BSOCK *dir = jcr->dir_bsock;
    BSOCK *sd = jcr->store_bsock;
    int ok = 0;
@@ -1198,12 +1291,12 @@ static int backup_cmd(JCR *jcr)
    bnet_fsend(dir, OKbackup);
    Dmsg1(110, "bfiled>dird: %s", dir->msg);
 
-   /* 
+   /*
     * Send Append Open Session to Storage daemon
     */
    bnet_fsend(sd, append_open);
    Dmsg1(110, ">stored: %s", sd->msg);
-   /* 
+   /*
     * Expect to receive back the Ticket number
     */
    if (bget_msg(sd) >= 0) {
@@ -1218,20 +1311,20 @@ static int backup_cmd(JCR *jcr)
       goto cleanup;
    }
 
-   /* 
+   /*
     * Send Append data command to Storage daemon
     */
    bnet_fsend(sd, append_data, jcr->Ticket);
    Dmsg1(110, ">stored: %s", sd->msg);
 
-   /* 
-    * Expect to get OK data 
+   /*
+    * Expect to get OK data
     */
    Dmsg1(110, "<stored: %s", sd->msg);
    if (!response(jcr, sd, OK_data, "Append Data")) {
       goto cleanup;
    }
-      
+
    /*
     * Send Files to Storage daemon
     */
@@ -1246,15 +1339,15 @@ static int backup_cmd(JCR *jcr)
         bnet_suppress_error_messages(sd, 1);
         goto cleanup;                /* bail out now */
       }
-      /* 
+      /*
        * Expect to get response to append_data from Storage daemon
        */
       if (!response(jcr, sd, OK_append, "Append Data")) {
         set_jcr_job_status(jcr, JS_ErrorTerminated);
         goto cleanup;
       }
-     
-      /* 
+
+      /*
        * Send Append End Data to Storage daemon
        */
       bnet_fsend(sd, append_end, jcr->Ticket);
@@ -1285,20 +1378,20 @@ static int backup_cmd(JCR *jcr)
    }
 
 cleanup:
-   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, 
-      edit_uint64(jcr->ReadBytes, ed1), 
-      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);   
+   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+      edit_uint64(jcr->ReadBytes, ed1),
+      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
    Dmsg1(110, "End FD msg: %s\n", dir->msg);
 
    return 0;                         /* return and stop command loop */
 }
 
-/*  
+/*
  * Do a Verify for Director
  *
  */
 static int verify_cmd(JCR *jcr)
-{ 
+{
    BSOCK *dir = jcr->dir_bsock;
    BSOCK *sd  = jcr->store_bsock;
    char level[100], ed1[50], ed2[50];
@@ -1306,7 +1399,7 @@ static int verify_cmd(JCR *jcr)
    jcr->JobType = JT_VERIFY;
    if (sscanf(dir->msg, verifycmd, level) != 1) {
       bnet_fsend(dir, "2994 Bad verify command: %s\n", dir->msg);
-      return 0;   
+      return 0;
    }
    if (strcasecmp(level, "init") == 0) {
       jcr->JobLevel = L_VERIFY_INIT;
@@ -1318,9 +1411,9 @@ static int verify_cmd(JCR *jcr)
       jcr->JobLevel = L_VERIFY_DATA;
    } else if (strcasecmp(level, "disk_to_catalog") == 0) {
       jcr->JobLevel = L_VERIFY_DISK_TO_CATALOG;
-   } else {   
+   } else {
       bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
-      return 0;   
+      return 0;
    }
 
    bnet_fsend(dir, OKverify);
@@ -1338,7 +1431,7 @@ static int verify_cmd(JCR *jcr)
       start_dir_heartbeat(jcr);
       do_verify_volume(jcr);
       stop_dir_heartbeat(jcr);
-      /* 
+      /*
        * Send Close session command to Storage daemon
        */
       bnet_fsend(sd, read_close, jcr->Ticket);
@@ -1356,27 +1449,27 @@ static int verify_cmd(JCR *jcr)
       break;
    default:
       bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
-      return 0; 
+      return 0;
    }
 
    bnet_sig(dir, BNET_EOD);
 
    /* Send termination status back to Dir */
-   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, 
-      edit_uint64(jcr->ReadBytes, ed1), 
-      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);   
+   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+      edit_uint64(jcr->ReadBytes, ed1),
+      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
 
    /* Inform Director that we are done */
    bnet_sig(dir, BNET_TERMINATE);
    return 0;                         /* return and terminate command loop */
 }
 
-/*  
+/*
  * Do a Restore for Director
  *
  */
 static int restore_cmd(JCR *jcr)
-{ 
+{
    BSOCK *dir = jcr->dir_bsock;
    BSOCK *sd = jcr->store_bsock;
    POOLMEM *where;
@@ -1404,7 +1497,7 @@ static int restore_cmd(JCR *jcr)
    if (where[0] == '/' && where[1] == 0) {
       where[0] = 0;
    }
-      
+
    Dmsg2(150, "Got replace %c, where=%s\n", replace, where);
    unbash_spaces(where);
    jcr->where = bstrdup(where);
@@ -1425,19 +1518,19 @@ static int restore_cmd(JCR *jcr)
 
    set_jcr_job_status(jcr, JS_Running);
 
-   /* 
+   /*
     * Do restore of files and data
     */
    start_dir_heartbeat(jcr);
    do_restore(jcr);
    stop_dir_heartbeat(jcr);
-   
+
    set_jcr_job_status(jcr, JS_Terminated);
    if (jcr->JobStatus != JS_Terminated) {
       bnet_suppress_error_messages(sd, 1);
    }
 
-   /* 
+   /*
     * Send Close session command to Storage daemon
     */
    bnet_fsend(sd, read_close, jcr->Ticket);
@@ -1454,9 +1547,9 @@ bail_out:
       set_jcr_job_status(jcr, JS_ErrorTerminated);
    }
    /* Send termination status back to Dir */
-   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, 
-      edit_uint64(jcr->ReadBytes, ed1), 
-      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);   
+   bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+      edit_uint64(jcr->ReadBytes, ed1),
+      edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
 
    /* Inform Director that we are done */
    bnet_sig(dir, BNET_TERMINATE);
@@ -1476,15 +1569,15 @@ static int open_sd_read_session(JCR *jcr)
    Dmsg4(120, "VolSessId=%ld VolsessT=%ld SF=%ld EF=%ld\n",
       jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile);
    Dmsg2(120, "JobId=%d vol=%s\n", jcr->JobId, "DummyVolume");
-   /* 
+   /*
     * Open Read Session with Storage daemon
     */
    bnet_fsend(sd, read_open, jcr->VolumeName,
-      jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile, 
+      jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile,
       jcr->StartBlock, jcr->EndBlock);
    Dmsg1(110, ">stored: %s", sd->msg);
 
-   /* 
+   /*
     * Get ticket number
     */
    if (bget_msg(sd) >= 0) {
@@ -1503,13 +1596,13 @@ static int open_sd_read_session(JCR *jcr)
       return 0;
    }
 
-   /* 
+   /*
     * Start read of data with Storage daemon
     */
    bnet_fsend(sd, read_data, jcr->Ticket);
    Dmsg1(110, ">stored: %s", sd->msg);
 
-   /* 
+   /*
     * Get OK data
     */
    if (!response(jcr, sd, OK_data, "Read Data")) {
@@ -1518,11 +1611,11 @@ static int open_sd_read_session(JCR *jcr)
    return 1;
 }
 
-/* 
+/*
  * Destroy the Job Control Record and associated
  * resources (sockets).
  */
-static void filed_free_jcr(JCR *jcr) 
+static void filed_free_jcr(JCR *jcr)
 {
    if (jcr->store_bsock) {
       bnet_close(jcr->store_bsock);
@@ -1539,7 +1632,7 @@ static void filed_free_jcr(JCR *jcr)
       free_pool_memory(jcr->RunAfterJob);
    }
 
-      
+
    return;
 }
 
@@ -1560,7 +1653,7 @@ int response(JCR *jcr, BSOCK *sd, char *resp, const char *cmd)
       if (strcmp(sd->msg, resp) == 0) {
         return 1;
       }
-   } 
+   }
    if (job_canceled(jcr)) {
       return 0;                      /* if canceled avoid useless error messages */
    }
@@ -1589,16 +1682,16 @@ static int send_bootstrap_file(JCR *jcr)
    bs = fopen(jcr->RestoreBootstrap, "r");
    if (!bs) {
       berrno be;
-      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), 
+      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
         jcr->RestoreBootstrap, be.strerror());
       set_jcr_job_status(jcr, JS_ErrorTerminated);
       goto bail_out;
    }
-   sd->msglen = pm_strcpy(sd->msg, bootstrap); 
+   sd->msglen = pm_strcpy(sd->msg, bootstrap);
    bnet_send(sd);
    while (fgets(buf, sizeof(buf), bs)) {
       sd->msglen = Mmsg(sd->msg, "%s", buf);
-      bnet_send(sd);      
+      bnet_send(sd);
    }
    bnet_sig(sd, BNET_EOD);
    fclose(bs);
index 3ad0006cf8922ed92d8234d001e2e85897c62fff..94274595603b5cf9096b59669f52ffcfe7770feb 100644 (file)
@@ -322,32 +322,47 @@ void do_restore(JCR *jcr)
 #endif
         break;
 
-      case STREAM_UNIX_ATTRIBUTES_ACL:  
+      case STREAM_UNIX_ATTRIBUTES_ACCESS_ACL:   
 #ifdef HAVE_ACL
         /* Recover ACL from stream and check it */
         acl = acl_from_text(sd->msg);
         if (acl_valid(acl) != 0) {
-            Jmsg1(jcr, M_WARNING, 0, "Failure in the ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
-           acl_free(acl);
-        }
-        
-        /* Try to restore ACL */
-        if (attr->type == FT_DIREND) {
-           /* Directory */
-           if (acl_set_file(jcr->last_fname, ACL_TYPE_DEFAULT, acl) != 0 &&
-               acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
-               Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore ACL of directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
-           }
-        /* File or Link */
+            Jmsg1(jcr, M_WARNING, 0, "Failure in the Access ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
+            Dmsg1(200, "Acc. ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+            Dmsg1(200, "Acc. ACL value=%s\n", acl);
         } else if (acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
-            Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore ACL of file: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
-        }
+            Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore Access ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+            Dmsg1(200, "Error! Can't restore Access ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+            Dmsg1(200, "Acc. ACL value=%s\n", acl);
+        } else {
+            Dmsg1(200, "Access ACL of file/directory: %s successfully restored!", jcr->last_fname);
+         }
         acl_free(acl);
-         Dmsg1(200, "ACL of file: %s successfully restored!", jcr->last_fname);
-        break;
+         break;
 #else 
         non_support_acl++;
         break;                       /* unconfigured, ignore */
+#endif
+
+      case STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL:
+#ifdef HAVE_ACL
+         acl = acl_from_text(sd->msg);
+         if (acl_valid(acl) != 0) {
+            Jmsg1(jcr, M_WARNING, 0, "Failure in the Default ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
+            Dmsg1(200, "Def. ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+            Dmsg1(200, "Def. ACL value=%s\n", acl);
+         } else if (acl_set_file(jcr->last_fname, ACL_TYPE_DEFAULT, acl) != 0) {
+            Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore Default ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+            Dmsg1(200, "Error! Can't restore Default ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+            Dmsg1(200, "Def. ACL value=%s\n", acl);
+         } else {
+            Dmsg1(200, "Default ACL of file/directory: %s successfully restored!", jcr->last_fname);
+         }
+         acl_free(acl);
+         break;
+#else
+      non_support_acl++;
+      break;
 #endif  
         
       case STREAM_MD5_SIGNATURE:
index 57bcfaf5536b1c1bd8be235d6c041516f0e79870..23940b0920a905a5e43ad1fc20f80533bd6dcac7 100644 (file)
@@ -36,9 +36,9 @@ static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
 /* Forward referenced functions */
 
 
-/* 
+/*
  * Verify attributes of the requested files on the Volume
- * 
+ *
  */
 void do_verify_volume(JCR *jcr)
 {
@@ -50,7 +50,7 @@ void do_verify_volume(JCR *jcr)
    uint32_t VolSessionId, VolSessionTime, file_index;
    uint32_t record_file_index;
    int type, stat;
-   
+
    sd = jcr->store_bsock;
    if (!sd) {
       Jmsg(jcr, M_FATAL, 0, _("Storage command not issued before Verify.\n"));
@@ -78,12 +78,12 @@ void do_verify_volume(JCR *jcr)
    fname = get_pool_memory(PM_FNAME);
    lname = get_pool_memory(PM_FNAME);
 
-   /* 
+   /*
     * Get a record from the Storage daemon
     */
    while (bget_msg(sd) >= 0 && !job_canceled(jcr)) {
       /*
-       * First we expect a Stream Record Header 
+       * First we expect a Stream Record Header
        */
       if (sscanf(sd->msg, rec_header, &VolSessionId, &VolSessionTime, &file_index,
          &stream, &size) != 5) {
@@ -92,7 +92,7 @@ void do_verify_volume(JCR *jcr)
       }
       Dmsg2(30, "Got hdr: FilInx=%d Stream=%d.\n", file_index, stream);
 
-      /* 
+      /*
        * Now we expect the Stream Data
        */
       if (bget_msg(sd) < 0) {
@@ -123,7 +123,7 @@ void do_verify_volume(JCR *jcr)
         *fname = 0;
         *lname = 0;
 
-        /*              
+        /*
          * An Attributes record consists of:
          *    File_index
          *    Type   (FT_types)
@@ -150,7 +150,7 @@ void do_verify_volume(JCR *jcr)
          while (*ap++ != ' ')         /* skip type */
            ;
         /* Save filename and position to attributes */
-        fp = fname;     
+        fp = fname;
         while (*ap != 0) {
            *fp++  = *ap++;           /* copy filename to fname */
         }
@@ -163,17 +163,17 @@ void do_verify_volume(JCR *jcr)
            while (*lp++ != 0) {
               ;
            }
-            strcat(lname, lp);        /* "save" link name */
+            pm_strcat(lname, lp);        /* "save" link name */
         } else {
            *lname = 0;
         }
         P(jcr->mutex);
         jcr->JobFiles++;
         jcr->num_files_examined++;
-        pm_strcpy(&jcr->last_fname, fname); /* last file examined */
+        pm_strcpy(jcr->last_fname, fname); /* last file examined */
         V(jcr->mutex);
 
-        /* 
+        /*
          * Send file attributes to Director
          *   File_index
          *   Stream
@@ -188,11 +188,11 @@ void do_verify_volume(JCR *jcr)
          Dmsg2(200, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, fname);
         if (type == FT_LNK || type == FT_LNKSAVED) {
             stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles,
-                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, 
+                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
                          0, ap, 0, lname, 0);
         } else {
             stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles,
-                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, 
+                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
                          0, ap, 0, 0);
         }
          Dmsg2(200, "bfiled>bdird: attribs len=%d: msg=%s\n", dir->msglen, dir->msg);
@@ -221,12 +221,12 @@ void do_verify_volume(JCR *jcr)
            jcr->JobFiles);
          Dmsg2(20, "bfiled>bdird: MD5 len=%d: msg=%s\n", dir->msglen, dir->msg);
         break;
-  
+
       case STREAM_SHA1_SIGNATURE:
         char SHA1buf[30];
         bin_to_base64(SHA1buf, (char *)sd->msg, 20); /* encode 20 bytes */
          Dmsg2(400, "send inx=%d SHA1=%s\n", jcr->JobFiles, SHA1buf);
-         bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_SIGNATURE, 
+         bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_SIGNATURE,
            SHA1buf, jcr->JobFiles);
          Dmsg2(20, "bfiled>bdird: SHA1 len=%d: msg=%s\n", dir->msglen, dir->msg);
         break;
@@ -251,4 +251,4 @@ ok_out:
    free_pool_memory(lname);
    Dmsg2(050, "End Verify-Vol. Files=%d Bytes=%" lld "\n", jcr->JobFiles,
       jcr->JobBytes);
-}         
+}
index 7d2c71b5d1fd7e0aaaf4db815c7efae209e56884..2bbdacc573ad6b9cf3ba4177be6642844bf0329b 100644 (file)
@@ -21,9 +21,9 @@ dummy:
 
 #
 LIBSRCS = find.c match.c find_one.c attibs.c create_file.c \
-         bfile.c enable_priv.c makepath.c save-cwd.c winapi.c
+         bfile.c enable_priv.c fstype.c makepath.c save-cwd.c winapi.c
 LIBOBJS = find.o match.o find_one.o attribs.o create_file.o \
-         bfile.o enable_priv.o makepath.o save-cwd.o winapi.o
+         bfile.o enable_priv.o fstype.o makepath.o save-cwd.o winapi.o
 
 .SUFFIXES:     .c .o
 .PHONY:
index 0a64a564dc18525a0419df3de263dd1fca892b4d..d9ad53d36a3b3ad3225c7b5e0dfb2408af33b022 100644 (file)
@@ -271,6 +271,12 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
         if ((bopen(bfd, attr->ofname, O_WRONLY|O_BINARY, 0)) < 0) {
            berrno be;
            be.set_errno(bfd->berrno);
+#ifdef HAVE_WIN32
+           /* Check for trying to create a drive, if so, skip */
+            if (attr->ofname[1] == ':' && attr->ofname[2] == '/' && attr->ofname[3] == 0) {
+              return CF_SKIP;
+           }
+#endif
             Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), 
                  attr->ofname, be.strerror());
            return CF_ERROR;
index c8a510f6d8c6f3c9ae2103969b755f91b65f163c..13bf2c47a4b76fa58c78841ad232acaa1ab1eca1 100644 (file)
@@ -6,9 +6,11 @@
  *    routines for the new syntax Options resource.
  *
  *  Kern E. Sibbald, MM
+ *
+ *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -49,12 +51,12 @@ static const int fnmode = 0;
 #endif
 
 
-/* 
+/*
  * Initialize the find files "global" variables
  */
 FF_PKT *init_find_files()
 {
-  FF_PKT *ff;   
+  FF_PKT *ff;
 
   ff = (FF_PKT *)bmalloc(sizeof(FF_PKT));
   memset(ff, 0, sizeof(FF_PKT));
@@ -80,7 +82,7 @@ FF_PKT *init_find_files()
   return ff;
 }
 
-/* 
+/*
  * Set find_files options. For the moment, we only
  * provide for full/incremental saves, and setting
  * of save_time. For additional options, see above
@@ -95,12 +97,12 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time)
 }
 
 
-/* 
+/*
  * Find all specified files (determined by calls to name_add()
  * This routine calls the (handle_file) subroutine with all
  * sorts of good information for the final disposition of
  * the file.
- * 
+ *
  * Call this subroutine with a callback subroutine as the first
  * argument and a packet as the second argument, this packet
  * will be passed back to the callback subroutine as the last
@@ -112,7 +114,7 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time)
  *
  */
 int
-find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) 
+find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt)
 {
    ff->callback = callback;
 
@@ -134,10 +136,11 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void
            findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
            ff->flags |= fo->flags;
            ff->GZIP_level = fo->GZIP_level;
-           bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts)); 
+           ff->fstypes = fo->fstype;
+           bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
         }
         for (j=0; j<incexe->name_list.size(); j++) {
-            Dmsg1(400, "F %s\n", (char *)incexe->name_list.get(j));
+            Dmsg1(100, "F %s\n", (char *)incexe->name_list.get(j));
            char *fname = (char *)incexe->name_list.get(j);
            if (find_one_file(jcr, ff, our_callback, his_pkt, fname, (dev_t)-1, 1) == 0) {
               return 0;                  /* error return */
@@ -150,8 +153,8 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void
       /* This is the old deprecated way */
       while (!job_canceled(jcr) && (inc = get_next_included_file(ff, inc))) {
         /* Copy options for this file */
-        bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts)); 
-         Dmsg1(50, "find_files: file=%s\n", inc->fname);
+        bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
+         Dmsg1(100, "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) ==0) {
               return 0;                  /* error return */
@@ -165,6 +168,7 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void
 static bool accept_file(FF_PKT *ff)
 {
    int i, j, k;
+   int ic;
    findFILESET *fileset = ff->fileset;
    findINCEXE *incexe = fileset->incexe;
 
@@ -174,15 +178,65 @@ static bool accept_file(FF_PKT *ff)
       ff->GZIP_level = fo->GZIP_level;
       ff->reader = fo->reader;
       ff->writer = fo->writer;
+      ff->fstypes = fo->fstype;
+      ic = (ff->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
+      if (S_ISDIR(ff->statp.st_mode)) {
+        for (k=0; k<fo->wilddir.size(); k++) {
+           if (fnmatch((char *)fo->wilddir.get(k), ff->fname, fnmode|ic) == 0) {
+              if (ff->flags & FO_EXCLUDE) {
+                  Dmsg2(100, "Exclude wilddir: %s file=%s\n", (char *)fo->wilddir.get(k),
+                    ff->fname);
+                 return false;       /* reject file */
+              }
+              return true;           /* accept file */
+           }
+        }
+      } else {
+        for (k=0; k<fo->wildfile.size(); k++) {
+           if (fnmatch((char *)fo->wildfile.get(k), ff->fname, fnmode|ic) == 0) {
+              if (ff->flags & FO_EXCLUDE) {
+                  Dmsg2(100, "Exclude wildfile: %s file=%s\n", (char *)fo->wildfile.get(k),
+                    ff->fname);
+                 return false;       /* reject file */
+              }
+              return true;           /* accept file */
+           }
+        }
+      }
       for (k=0; k<fo->wild.size(); k++) {
-        if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
+        if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
            if (ff->flags & FO_EXCLUDE) {
+               Dmsg2(100, "Exclude wild: %s file=%s\n", (char *)fo->wild.get(k),
+                 ff->fname);
               return false;          /* reject file */
            }
            return true;              /* accept file */
         }
       }
 #ifndef WIN32
+      if (S_ISDIR(ff->statp.st_mode)) {
+        for (k=0; k<fo->regexdir.size(); k++) {
+           const int nmatch = 30;
+           regmatch_t pmatch[nmatch];
+           if (regexec((regex_t *)fo->regexdir.get(k), ff->fname, nmatch, pmatch,  0) == 0) {
+              if (ff->flags & FO_EXCLUDE) {
+                 return false;       /* reject file */
+              }
+              return true;           /* accept file */
+           }
+        }
+      } else {
+        for (k=0; k<fo->regexfile.size(); k++) {
+           const int nmatch = 30;
+           regmatch_t pmatch[nmatch];
+           if (regexec((regex_t *)fo->regexfile.get(k), ff->fname, nmatch, pmatch,  0) == 0) {
+              if (ff->flags & FO_EXCLUDE) {
+                 return false;       /* reject file */
+              }
+              return true;           /* accept file */
+           }
+        }
+      }
       for (k=0; k<fo->regex.size(); k++) {
         const int nmatch = 30;
         regmatch_t pmatch[nmatch];
@@ -200,16 +254,19 @@ static bool accept_file(FF_PKT *ff)
       findINCEXE *incexe = (findINCEXE *)fileset->exclude_list.get(i);
       for (j=0; j<incexe->opts_list.size(); j++) {
         findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
+        ic = (fo->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
         for (k=0; k<fo->wild.size(); k++) {
-           if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
-               Dmsg1(400, "Reject wild1: %s\n", ff->fname);
+           if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
+               Dmsg1(100, "Reject wild1: %s\n", ff->fname);
               return false;          /* reject file */
            }
         }
       }
+      ic = (incexe->current_opts != NULL && incexe->current_opts->flags & FO_IGNORECASE)
+            ? FNM_CASEFOLD : 0;
       for (j=0; j<incexe->name_list.size(); j++) {
-        if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode) == 0) {
-            Dmsg1(400, "Reject wild2: %s\n", ff->fname);
+        if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode|ic) == 0) {
+            Dmsg1(100, "Reject wild2: %s\n", ff->fname);
            return false;          /* reject file */
         }
       }
@@ -220,7 +277,7 @@ static bool accept_file(FF_PKT *ff)
 /*
  * The code comes here for each file examined.
  * We filter the files, then call the user's callback if
- *    the file is included. 
+ *    the file is included.
  */
 static int our_callback(FF_PKT *ff, void *hpkt)
 {
@@ -232,6 +289,7 @@ static int our_callback(FF_PKT *ff, void *hpkt)
    case FT_ISARCH:
    case FT_NORECURSE:
    case FT_NOFSCHG:
+   case FT_INVALIDFS:
    case FT_NOOPEN:
 //    return ff->callback(ff, hpkt);
 
@@ -262,7 +320,7 @@ static int our_callback(FF_PKT *ff, void *hpkt)
 
 /*
  * Terminate find_files() and release
- * all allocated memory   
+ * all allocated memory
  */
 int
 term_find_files(FF_PKT *ff)
index dcd438f7bd5988280a554967b3bf2511f5205704..cf35bd589a8f576d7cbf54dcd51457bcdad44338 100755 (executable)
@@ -1,10 +1,10 @@
 /*
  * File types as returned by find_files()
  *
- *     Kern Sibbald MIM
+ *     Kern Sibbald MMI
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2001-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -46,11 +46,7 @@ struct utimbuf {
 
 #define MODE_RALL (S_IRUSR|S_IRGRP|S_IROTH)
 
-#ifdef HAVE_FNMATCH
-#include <fnmatch.h>
-#else
 #include "lib/fnmatch.h"
-#endif
 
 #ifdef HAVE_REGEX_H
 #include <regex.h>
@@ -63,42 +59,45 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 #endif
 
 
-/* 
+/*
  * Status codes returned by create_file()
  */
 enum {
-   CF_SKIP = 1,                       /* skip file (not newer or something) */
-   CF_ERROR,                          /* error creating file */
-   CF_EXTRACT,                        /* file created, data to extract */
-   CF_CREATED                         /* file created, no data to extract */
+   CF_SKIP = 1,                      /* skip file (not newer or something) */
+   CF_ERROR,                         /* error creating file */
+   CF_EXTRACT,                       /* file created, data to extract */
+   CF_CREATED                        /* file created, no data to extract */
 };
 
 
 /* Options saved int "options" of the include/exclude lists.
- * They are directly jammed ito  "flag" of ff packet 
+ * They are directly jammed ito  "flag" of ff packet
  */
-#define FO_MD5          (1<<1)        /* Do MD5 checksum */
-#define FO_GZIP         (1<<2)        /* Do Zlib compression */
-#define FO_NO_RECURSION (1<<3)        /* no recursion in directories */
-#define FO_MULTIFS      (1<<4)        /* multiple file systems */
-#define FO_SPARSE       (1<<5)        /* do sparse file checking */
-#define FO_IF_NEWER     (1<<6)        /* replace if newer */
-#define FO_NOREPLACE    (1<<7)        /* never replace */
-#define FO_READFIFO     (1<<8)        /* read data from fifo */
-#define FO_SHA1         (1<<9)        /* Do SHA1 checksum */
-#define FO_PORTABLE     (1<<10)       /* Use portable data format -- no BackupWrite */
-#define FO_MTIMEONLY    (1<<11)       /* Use mtime rather than mtime & ctime */
-#define FO_KEEPATIME    (1<<12)       /* Reset access time */
-#define FO_EXCLUDE      (1<<13)       /* Exclude file */
-#define FO_ACL          (1<<14)       /* Backup ACLs */
+#define FO_MD5         (1<<1)        /* Do MD5 checksum */
+#define FO_GZIP        (1<<2)        /* Do Zlib compression */
+#define FO_NO_RECURSION (1<<3)       /* no recursion in directories */
+#define FO_MULTIFS     (1<<4)        /* multiple file systems */
+#define FO_SPARSE      (1<<5)        /* do sparse file checking */
+#define FO_IF_NEWER    (1<<6)        /* replace if newer */
+#define FO_NOREPLACE   (1<<7)        /* never replace */
+#define FO_READFIFO    (1<<8)        /* read data from fifo */
+#define FO_SHA1        (1<<9)        /* Do SHA1 checksum */
+#define FO_PORTABLE    (1<<10)       /* Use portable data format -- no BackupWrite */
+#define FO_MTIMEONLY   (1<<11)       /* Use mtime rather than mtime & ctime */
+#define FO_KEEPATIME   (1<<12)       /* Reset access time */
+#define FO_EXCLUDE     (1<<13)       /* Exclude file */
+#define FO_ACL         (1<<14)       /* Backup ACLs */
+#define FO_NO_HARDLINK  (1<<15)       /* don't handle hard links */
+#define FO_IGNORECASE  (1<<16)       /* Ignore file name case */
+#define FO_HFSPLUS     (1<<17)       /* Resource forks and Finder Info */
 
 struct s_included_file {
    struct s_included_file *next;
-   uint32_t options;                  /* backup options */
-   int level;                         /* compression level */
-   int len;                           /* length of fname */
-   int pattern;                       /* set if wild card pattern */
-   char VerifyOpts[20];               /* Options for verify */
+   uint32_t options;                 /* backup options */
+   int level;                        /* compression level */
+   int len;                          /* length of fname */
+   int pattern;                      /* set if wild card pattern */
+   char VerifyOpts[20];              /* Options for verify */
    char fname[1];
 };
 
@@ -113,7 +112,7 @@ struct s_excluded_file {
  *  of the structure are passed by the Director to the
  *  File daemon and recompiled back into this structure
  */
-#undef  MAX_FOPTS 
+#undef MAX_FOPTS
 #define MAX_FOPTS 30
 
 enum {
@@ -125,55 +124,67 @@ enum {
 
 /* File options structure */
 struct findFOPTS {
-   uint32_t flags;                    /* options in bits */
-   int GZIP_level;                    /* GZIP level */
-   char VerifyOpts[MAX_FOPTS];        /* verify options */
-   alist regex;                       /* regex string(s) */
-   alist wild;                        /* wild card strings */
-   alist base;                        /* list of base names */
-   char *reader;                      /* reader program */
-   char *writer;                      /* writer program */
+   uint32_t flags;                   /* options in bits */
+   int GZIP_level;                   /* GZIP level */
+   char VerifyOpts[MAX_FOPTS];       /* verify options */
+   alist regex;                      /* regex string(s) */
+   alist regexdir;                   /* regex string(s) for directories */
+   alist regexfile;                  /* regex string(s) for files */
+   alist wild;                       /* wild card strings */
+   alist wilddir;                    /* wild card strings for directories */
+   alist wildfile;                   /* wild card strings for files */
+   alist base;                       /* list of base names */
+   alist fstype;                     /* file system type limitation */
+   char *reader;                     /* reader program */
+   char *writer;                     /* writer program */
 };
 
 
 /* This is either an include item or an exclude item */
 struct findINCEXE {
-   findFOPTS *current_opts;           /* points to current options structure */
-   alist opts_list;                   /* options list */
-   alist name_list;                   /* filename list -- holds char * */
+   findFOPTS *current_opts;          /* points to current options structure */
+   alist opts_list;                  /* options list */
+   alist name_list;                  /* filename list -- holds char * */
 };
 
-/* 
+/*
  *   FileSet Resource
  *
  */
 struct findFILESET {
    int state;
-   findINCEXE *incexe;                /* current item */
+   findINCEXE *incexe;               /* current item */
    alist include_list;
    alist exclude_list;
 };
 
+#ifdef HAVE_DARWIN_OS
+struct HFSPLUS_INFO {
+   unsigned long length;             /* Mandatory field */
+   char fndrinfo[32];                /* Finder Info */
+   off_t rsrclength;                 /* Size of resource fork */
+};
+#endif
 
 /*
  * Definition of the find_files packet passed as the
  * first argument to the find_files callback subroutine.
  */
 struct FF_PKT {
-   char *fname;                       /* filename */
-   char *link;                        /* link if file linked */
-   POOLMEM *sys_fname;                /* system filename */
-   struct stat statp;                 /* stat packet */
-   int32_t FileIndex;                 /* FileIndex of this file */
-   int32_t LinkFI;                    /* FileIndex of main hard linked file */
-   struct f_link *linked;             /* Set if this file is hard linked */
-   int type;                          /* FT_ type from above */
-   int ff_errno;                      /* errno */
-   BFILE bfd;                         /* Bacula file descriptor */
-   time_t save_time;                  /* start of incremental time */
-   bool dereference;                  /* follow links (not implemented) */
-   bool null_output_device;           /* using null output device */
-   bool incremental;                  /* incremental save */
+   char *fname;                      /* filename */
+   char *link;                       /* link if file linked */
+   POOLMEM *sys_fname;               /* system filename */
+   struct stat statp;                /* stat packet */
+   int32_t FileIndex;                /* FileIndex of this file */
+   int32_t LinkFI;                   /* FileIndex of main hard linked file */
+   struct f_link *linked;            /* Set if this file is hard linked */
+   int type;                         /* FT_ type from above */
+   int ff_errno;                     /* errno */
+   BFILE bfd;                        /* Bacula file descriptor */
+   time_t save_time;                 /* start of incremental time */
+   bool dereference;                 /* follow links (not implemented) */
+   bool null_output_device;          /* using null output device */
+   bool incremental;                 /* incremental save */
    char VerifyOpts[20];
    struct s_included_file *included_files_list;
    struct s_excluded_file *excluded_files_list;
@@ -181,14 +192,22 @@ struct FF_PKT {
    findFILESET *fileset;
    int (*callback)(FF_PKT *, void *); /* User's callback */
 
-   /* Values set by accept_file while processing Options */  
-   uint32_t flags;                    /* backup options */
-   int GZIP_level;                    /* compression level */
-   char *reader;                      /* reader program */
-   char *writer;                      /* writer program */
+   /* Values set by accept_file while processing Options */
+   uint32_t flags;                   /* backup options */
+   int GZIP_level;                   /* compression level */
+   char *reader;                     /* reader program */
+   char *writer;                     /* writer program */
+   alist fstypes;                    /* allowed file system types */
 
    /* List of all hard linked files found */
-   struct f_link *linklist;           /* hard linked files */
+   struct f_link *linklist;          /* hard linked files */
+
+   /* Darwin specific things. So as not to clutter every bclose()
+    * with an #ifdef, we always include rsrc_bfd */
+   BFILE rsrc_bfd;                   /* fd for resource forks */
+#ifdef HAVE_DARWIN_OS
+   struct HFSPLUS_INFO hfsinfo;       /* Finder Info and resource fork size */
+#endif
 };
 
 
index 15ff905d191ae55cbf099b3cb868cd5ae044f203..d3516d37fe3984eb2abf4f2f2d5d7d04d936ac10 100755 (executable)
@@ -1,5 +1,5 @@
-/* 
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+/*
+   Copyright (C) 2000-20054 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
    Thanks to the TAR programmers.
 
+     Version $Id$
+
  */
 
 #include "bacula.h"
 #include "find.h"
+#ifdef HAVE_DARWIN_OS
+#include <sys/attr.h>
+#endif
 
 extern int32_t name_max;             /* filename max length */
 extern int32_t path_max;             /* path name max length */
 
 /*
- * Structure for keeping track of hard linked files, we   
+ * Structure for keeping track of hard linked files, we
  *   keep an entry for each hardlinked file that we save,
  *   which is the first one found. For all the other files that
  *   are linked to this one, we save only the directory
@@ -56,19 +61,48 @@ static void free_dir_ff_pkt(FF_PKT *dir_ff_pkt)
 }
 
 /*
- * Find a single file.                       
+ * Check to see if we allow the file system type of a file or directory.
+ * If we do not have a list of file system types, we accept anything.
+ */
+static int accept_fstype(FF_PKT *ff, void *dummy) {
+   int i;
+   char fs[1000];
+   bool accept = true;
+
+   if (ff->fstypes.size()) {
+      accept = false;
+      if (!fstype(ff->fname, fs, sizeof(fs))) {
+         Dmsg1(50, "Cannot determine file system type for \"%s\"\n", ff->fname);
+      } else {
+        for (i = 0; i < ff->fstypes.size(); ++i) {
+           if (strcmp(fs, (char *)ff->fstypes.get(i)) == 0) {
+               Dmsg2(100, "Accepting fstype %s for \"%s\"\n", fs, ff->fname);
+              accept = true;
+              break;
+           }
+            Dmsg3(200, "fstype %s for \"%s\" does not match %s\n", fs,
+                 ff->fname, ff->fstypes.get(i));
+        }
+      }
+   }
+   return accept;
+}
+
+/*
+ * Find a single file.
  * handle_file is the callback for handling the file.
  * p is the filename
- * parent_device is the device we are currently on 
- * top_level is 1 when not recursing or 0 when 
- *  decending into a directory.
+ * parent_device is the device we are currently on
+ * top_level is 1 when not recursing or 0 when
+ *  descending into a directory.
  */
 int
-find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), 
+find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
               void *pkt, char *fname, dev_t parent_device, int top_level)
 {
    struct utimbuf restore_times;
    int rtn_stat;
+   int len;
 
    ff_pkt->fname = ff_pkt->link = fname;
 
@@ -87,8 +121,19 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
    restore_times.actime = ff_pkt->statp.st_atime;
    restore_times.modtime = ff_pkt->statp.st_mtime;
 
+   /*
+    * We check for allowed fstypes at top_level and fstype change (below).
+    */
+   if (top_level && !accept_fstype(ff_pkt, NULL)) {
+      ff_pkt->type = FT_INVALIDFS;
+      if (ff_pkt->flags & FO_KEEPATIME) {
+        utime(fname, &restore_times);
+      }
+      Jmsg1(jcr, M_ERROR, 0, _("Top level directory \"%s\" has an unlisted fstype\n"), fname);
+      return 1;      /* Just ignore this error - or the whole backup is cancelled */
+   }
 
-   /* 
+   /*
     * If this is an Incremental backup, see if file was modified
     * since our last "save_time", presumably the last Full save
     * or Incremental.
@@ -97,7 +142,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
       Dmsg1(300, "Non-directory incremental: %s\n", ff_pkt->fname);
       /* Not a directory */
       if (ff_pkt->statp.st_mtime < ff_pkt->save_time
-         && ((ff_pkt->flags & FO_MTIMEONLY) || 
+         && ((ff_pkt->flags & FO_MTIMEONLY) ||
              ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
         /* Incremental option, file not changed */
         ff_pkt->type = FT_NOCHG;
@@ -105,6 +150,23 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
       }
    }
 
+#ifdef HAVE_DARWIN_OS
+   if (S_ISREG(ff_pkt->statp.st_mode) && ff_pkt->flags & FO_HFSPLUS) {
+       /* TODO: initialise attrList once elsewhere? */
+       struct attrlist attrList;
+       memset(&attrList, 0, sizeof(attrList));
+       attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
+       attrList.commonattr = ATTR_CMN_FNDRINFO;
+       attrList.fileattr = ATTR_FILE_RSRCLENGTH;
+       if (getattrlist(fname, &attrList, &ff_pkt->hfsinfo,
+               sizeof(ff_pkt->hfsinfo), 0) != 0) {
+         ff_pkt->type = FT_NOSTAT;
+         ff_pkt->ff_errno = errno;
+         return handle_file(ff_pkt, pkt);
+       }
+   }
+#endif
+
 /* ***FIXME*** implement this */
 #if xxxxxxx
    /* See if we are trying to dump the archive.  */
@@ -114,14 +176,15 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
    }
 #endif
    ff_pkt->LinkFI = 0;
-   /* 
+   /*
     * Handle hard linked files
     *
     * Maintain a list of hard linked files already backed up. This
-    *  allows us to ensure that the data of each file gets backed 
+    *  allows us to ensure that the data of each file gets backed
     *  up only once.
     */
-   if (ff_pkt->statp.st_nlink > 1
+   if (!(ff_pkt->flags & FO_NO_HARDLINK)
+       && ff_pkt->statp.st_nlink > 1
        && (S_ISREG(ff_pkt->statp.st_mode)
           || S_ISCHR(ff_pkt->statp.st_mode)
           || S_ISBLK(ff_pkt->statp.st_mode)
@@ -132,7 +195,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
 
       /* Search link list of hard linked files */
       for (lp = ff_pkt->linklist; lp; lp = lp->next)
-        if (lp->ino == (ino_t)ff_pkt->statp.st_ino && 
+        if (lp->ino == (ino_t)ff_pkt->statp.st_ino &&
             lp->dev == (dev_t)ff_pkt->statp.st_dev) {
              /* If we have already backed up the hard linked file don't do it again */
             if (strcmp(lp->name, fname) == 0) {
@@ -147,10 +210,11 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
         }
 
       /* File not previously dumped. Chain it into our list. */
-      lp = (struct f_link *)bmalloc(sizeof(struct f_link) + strlen(fname) +1);
+      len = strlen(fname) + 1;
+      lp = (struct f_link *)bmalloc(sizeof(struct f_link) + len);
       lp->ino = ff_pkt->statp.st_ino;
       lp->dev = ff_pkt->statp.st_dev;
-      strcpy(lp->name, fname);
+      bstrncpy(lp->name, fname, len);
       lp->next = ff_pkt->linklist;
       ff_pkt->linklist = lp;
       ff_pkt->linked = lp;           /* mark saved link */
@@ -185,7 +249,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
 
       size = readlink(fname, buffer, path_max + name_max + 101);
       if (size < 0) {
-        /* Could not follow link */                             
+        /* Could not follow link */
         ff_pkt->type = FT_NOFOLLOW;
         ff_pkt->ff_errno = errno;
         rtn_stat = handle_file(ff_pkt, pkt);
@@ -208,11 +272,12 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
       struct dirent *entry, *result;
       char *link;
       int link_len;
-      int len;  
+      int len;
       int status;
       dev_t our_device = ff_pkt->statp.st_dev;
+      bool recurse = true;
 
-      /*  
+      /*
        * If we are using Win32 (non-portable) backup API, don't check
        *  access as everything is more complicated, and
        *  in principle, we should be able to access everything.
@@ -250,9 +315,9 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
       } else {
         ff_pkt->type = FT_DIRBEGIN;
       }
-      /* 
+      /*
        * Note, we return the directory to the calling program (handle_file)
-       * when we first see the directory (FT_DIRBEGIN. 
+       * when we first see the directory (FT_DIRBEGIN.
        * This allows the program to apply matches and make a
        * choice whether or not to accept it.  If it is accepted, we
        * do not immediately save it, but do so only after everything
@@ -286,43 +351,45 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
       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" */
 
-      /* 
-       * Do not decend into subdirectories (recurse) if the
+      /*
+       * Do not descend into subdirectories (recurse) if the
        * user has turned it off for this directory.
+       *
+       * If we are crossing file systems, we are either not allowed
+       * to cross, or we may be restricted by a list of permitted
+       * file systems.
        */
       if (ff_pkt->flags & FO_NO_RECURSION) {
-        /* No recursion into this directory */
         ff_pkt->type = FT_NORECURSE;
-        rtn_stat = handle_file(ff_pkt, pkt);
-        if (ff_pkt->linked) {
-           ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
+        recurse = false;
+      } else if (!top_level && parent_device != ff_pkt->statp.st_dev) {
+        if(!(ff_pkt->flags & FO_MULTIFS)) {
+           ff_pkt->type = FT_NOFSCHG;
+           recurse = false;
+        } else if (!accept_fstype(ff_pkt, NULL)) {
+           ff_pkt->type = FT_INVALIDFS;
+           recurse = false;
         }
-        free(link);
-        free_dir_ff_pkt(dir_ff_pkt);
-        return rtn_stat;
       }
-
-      /* 
-       * See if we are crossing file systems, and
-       * avoid doing so if the user only wants to dump one file system.
-       */
-      if (!top_level && !(ff_pkt->flags & FO_MULTIFS) &&
-          parent_device != ff_pkt->statp.st_dev) {
-        /* returning here means we do not handle this directory */
-        ff_pkt->type = FT_NOFSCHG;
+      if (!recurse) {
         rtn_stat = handle_file(ff_pkt, pkt);
         if (ff_pkt->linked) {
            ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
         }
         free(link);
         free_dir_ff_pkt(dir_ff_pkt);
+         ff_pkt->link = ff_pkt->fname;     /* reset "link" */
+        if (ff_pkt->flags & FO_KEEPATIME) {
+           utime(fname, &restore_times);
+        }
         return rtn_stat;
       }
-      /* 
-       * Decend into or "recurse" into the directory to read
+
+      ff_pkt->link = ff_pkt->fname;     /* reset "link" */
+
+      /*
+       * Descend into or "recurse" into the directory to read
        *   all the files in it.
        */
       errno = 0;
@@ -438,7 +505,7 @@ int term_find_one(FF_PKT *ff)
 {
    struct f_link *lp, *lc;
    int count = 0;
-  
+
    /* Free up list of hard linked files */
    for (lp = ff->linklist; lp;) {
       lc = lp;
diff --git a/bacula/src/findlib/fstype.c b/bacula/src/findlib/fstype.c
new file mode 100644 (file)
index 0000000..deb02b7
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ *  Implement routines to determine file system types.
+ *
+ *   Written by Preben 'Peppe' Guldberg, December MMIV
+ *
+ *   Version $Id$
+ */
+
+/*
+   Copyright (C) 2005 Kern Sibbald
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.
+
+ */
+
+#ifndef TEST_PROGRAM
+
+#include "bacula.h"
+#include "find.h"
+
+#else /* Set up for testing a stand alone program */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define SUPPORTEDOSES \
+   "HAVE_DARWIN_OS\n" \
+   "HAVE_FREEBSD_OS\n" \
+   "HAVE_HPUX_OS\n" \
+   "HAVE_IRIX_OS\n" \
+   "HAVE_LINUX_OS\n" \
+   "HAVE_NETBSD_OS\n" \
+   "HAVE_OPENBSD_OS\n" \
+   "HAVE_SUN_OS\n"
+#define bool              int
+#define false             0
+#define true              1
+#define bstrncpy          strncpy
+#define Dmsg0(n,s)        fprintf(stderr, s)
+#define Dmsg1(n,s,a1)     fprintf(stderr, s, a1)
+#define Dmsg2(n,s,a1,a2)   fprintf(stderr, s, a1, a2)
+#endif
+
+/*
+ * These functions should be implemented for each OS
+ *
+ *      bool fstype(const char *fname, char *fs, int fslen);
+ */
+#if defined(HAVE_DARWIN_OS) \
+   || defined(HAVE_FREEBSD_OS ) \
+   || defined(HAVE_OPENBSD_OS)
+
+#include <sys/param.h>
+#include <sys/mount.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   struct statfs st;
+   if (statfs(fname, &st) == 0) {
+      bstrncpy(fs, st.f_fstypename, fslen);
+      return true;
+   }
+   Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+   return false;
+}
+#elif defined(HAVE_NETBSD_OS)
+#include <sys/param.h>
+#include <sys/mount.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   struct statvfs st;
+   if (statvfs(fname, &st) == 0) {
+      bstrncpy(fs, st.f_fstypename, fslen);
+      return true;
+   }
+   Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+   return false;
+}
+#elif defined(HAVE_HPUX_OS) \
+   || defined(HAVE_IRIX_OS)
+
+#include <sys/types.h>
+#include <sys/statvfs.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   struct statvfs st;
+   if (statvfs(fname, &st) == 0) {
+      bstrncpy(fs, st.f_basetype, fslen);
+      return true;
+   }
+   Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+   return false;
+}
+
+#elif defined(HAVE_LINUX_OS)
+
+#include <sys/vfs.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   struct statfs st;
+   if (statfs(fname, &st) == 0) {
+      /*
+       * Values nicked from statfs(2), testing and
+       *
+       *    $ grep -r SUPER_MAGIC /usr/include/linux
+       *
+       * Entries are sorted on ("fsname")
+       */
+      switch (st.f_type) {
+
+      /* Known good values */
+      case 0xef53:         bstrncpy(fs, "ext2", fslen); return true;          /* EXT2_SUPER_MAGIC */
+   /* case 0xef53:        ext2 and ext3 are the same */                      /* EXT3_SUPER_MAGIC */
+      case 0x3153464a:     bstrncpy(fs, "jfs", fslen); return true;           /* JFS_SUPER_MAGIC */
+      case 0x5346544e:     bstrncpy(fs, "ntfs", fslen); return true;          /* NTFS_SB_MAGIC */
+      case 0x9fa0:         bstrncpy(fs, "proc", fslen); return true;          /* PROC_SUPER_MAGIC */
+      case 0x52654973:     bstrncpy(fs, "reiserfs", fslen); return true;      /* REISERFS_SUPER_MAGIC */
+      case 0x58465342:     bstrncpy(fs, "xfs", fslen); return true;           /* XFS_SB_MAGIC */
+      case 0x9fa2:         bstrncpy(fs, "usbdevfs", fslen); return true;      /* USBDEVICE_SUPER_MAGIC */
+      case 0x62656572:     bstrncpy(fs, "sysfs", fslen); return true;         /* SYSFS_MAGIC */
+      case 0x517B:         bstrncpy(fs, "smbfs", fslen); return true;         /* SMB_SUPER_MAGIC */
+      case 0x9660:         bstrncpy(fs, "iso9660", fslen); return true;       /* ISOFS_SUPER_MAGIC */
+
+#if 0      /* These need confirmation */
+      case 0xadf5:         bstrncpy(fs, "adfs", fslen); return true;          /* ADFS_SUPER_MAGIC */
+      case 0xadff:         bstrncpy(fs, "affs", fslen); return true;          /* AFFS_SUPER_MAGIC */
+      case 0x6B414653:     bstrncpy(fs, "afs", fslen); return true;           /* AFS_FS_MAGIC */
+      case 0x0187:         bstrncpy(fs, "autofs", fslen); return true;        /* AUTOFS_SUPER_MAGIC */
+      case 0x62646576:     bstrncpy(fs, "bdev", fslen); return true;          /* ??? */
+      case 0x42465331:     bstrncpy(fs, "befs", fslen); return true;          /* BEFS_SUPER_MAGIC */
+      case 0x1BADFACE:     bstrncpy(fs, "bfs", fslen); return true;           /* BFS_MAGIC */
+      case 0x42494e4d:     bstrncpy(fs, "binfmt_misc", fslen); return true;   /* ??? */
+      case (('C'<<8)|'N'): bstrncpy(fs, "capifs", fslen); return true;        /* CAPIFS_SUPER_MAGIC */
+      case 0xFF534D42:     bstrncpy(fs, "cifs", fslen); return true;          /* CIFS_MAGIC_NUMBER */
+      case 0x73757245:     bstrncpy(fs, "coda", fslen); return true;          /* CODA_SUPER_MAGIC */
+      case 0x012ff7b7:     bstrncpy(fs, "coherent", fslen); return true;      /* COH_SUPER_MAGIC */
+      case 0x28cd3d45:     bstrncpy(fs, "cramfs", fslen); return true;        /* CRAMFS_MAGIC */
+      case 0x1373:         bstrncpy(fs, "devfs", fslen); return true;         /* DEVFS_SUPER_MAGIC */
+      case 0x1cd1:         bstrncpy(fs, "devpts", fslen); return true;        /* ??? */
+      case 0x414A53:       bstrncpy(fs, "efs", fslen); return true;           /* EFS_SUPER_MAGIC */
+      case 0x03111965:     bstrncpy(fs, "eventpollfs", fslen); return true;   /* EVENTPOLLFS_MAGIC */
+      case 0x137d:         bstrncpy(fs, "ext", fslen); return true;           /* EXT_SUPER_MAGIC */
+      case 0xef51:         bstrncpy(fs, "ext2", fslen); return true;          /* EXT2_OLD_SUPER_MAGIC */
+      case 0xBAD1DEA:      bstrncpy(fs, "futexfs", fslen); return true;       /* ??? */
+      case 0xaee71ee7:     bstrncpy(fs, "gadgetfs", fslen); return true;      /* GADGETFS_MAGIC */
+      case 0x00c0ffee:     bstrncpy(fs, "hostfs", fslen); return true;        /* HOSTFS_SUPER_MAGIC */
+      case 0xf995e849:     bstrncpy(fs, "hpfs", fslen); return true;          /* HPFS_SUPER_MAGIC */
+      case 0xb00000ee:     bstrncpy(fs, "hppfs", fslen); return true;         /* HPPFS_SUPER_MAGIC */
+      case 0x958458f6:     bstrncpy(fs, "hugetlbfs", fslen); return true;     /* HUGETLBFS_MAGIC */
+      case 0x12061983:     bstrncpy(fs, "hwgfs", fslen); return true;         /* HWGFS_MAGIC */
+      case 0x66726f67:     bstrncpy(fs, "ibmasmfs", fslen); return true;      /* IBMASMFS_MAGIC */
+      case 0x9660:         bstrncpy(fs, "isofs", fslen); return true;         /* ISOFS_SUPER_MAGIC */
+      case 0x07c0:         bstrncpy(fs, "jffs", fslen); return true;          /* JFFS_MAGIC_SB_BITMASK */
+      case 0x72b6:         bstrncpy(fs, "jffs2", fslen); return true;         /* JFFS2_SUPER_MAGIC */
+      case 0x2468:         bstrncpy(fs, "minix", fslen); return true;         /* MINIX2_SUPER_MAGIC */
+      case 0x2478:         bstrncpy(fs, "minix", fslen); return true;         /* MINIX2_SUPER_MAGIC2 */
+      case 0x137f:         bstrncpy(fs, "minix", fslen); return true;         /* MINIX_SUPER_MAGIC */
+      case 0x138f:         bstrncpy(fs, "minix", fslen); return true;         /* MINIX_SUPER_MAGIC2 */
+      case 0x19800202:     bstrncpy(fs, "mqueue", fslen); return true;        /* MQUEUE_MAGIC */
+      case 0x4d44:         bstrncpy(fs, "msdos", fslen); return true;         /* MSDOS_SUPER_MAGIC */
+      case 0x564c:         bstrncpy(fs, "ncpfs", fslen); return true;         /* NCP_SUPER_MAGIC */
+      case 0x6969:         bstrncpy(fs, "nfs", fslen); return true;           /* NFS_SUPER_MAGIC */
+      case 0x9fa1:         bstrncpy(fs, "openpromfs", fslen); return true;    /* OPENPROM_SUPER_MAGIC */
+      case 0x6f70726f:     bstrncpy(fs, "oprofilefs", fslen); return true;    /* OPROFILEFS_MAGIC */
+      case 0xa0b4d889:     bstrncpy(fs, "pfmfs", fslen); return true;         /* PFMFS_MAGIC */
+      case 0x50495045:     bstrncpy(fs, "pipfs", fslen); return true;         /* PIPEFS_MAGIC */
+      case 0x002f:         bstrncpy(fs, "qnx4", fslen); return true;          /* QNX4_SUPER_MAGIC */
+      case 0x858458f6:     bstrncpy(fs, "ramfs", fslen); return true;         /* RAMFS_MAGIC */
+      case 0x7275:         bstrncpy(fs, "romfs", fslen); return true;         /* ROMFS_MAGIC */
+      case 0x858458f6:     bstrncpy(fs, "rootfs", fslen); return true;        /* RAMFS_MAGIC */
+      case 0x67596969:     bstrncpy(fs, "rpc_pipefs", fslen); return true;    /* RPCAUTH_GSSMAGIC */
+      case 0x534F434B:     bstrncpy(fs, "sockfs", fslen); return true;        /* SOCKFS_MAGIC */
+      case 0x012ff7b6:     bstrncpy(fs, "sysv2", fslen); return true;         /* SYSV2_SUPER_MAGIC */
+      case 0x012ff7b5:     bstrncpy(fs, "sysv4", fslen); return true;         /* SYSV4_SUPER_MAGIC */
+      case 0x858458f6:     bstrncpy(fs, "tmpfs", fslen); return true;         /* RAMFS_MAGIC */
+      case 0x01021994:     bstrncpy(fs, "tmpfs", fslen); return true;         /* TMPFS_MAGIC */
+      case 0x15013346:     bstrncpy(fs, "udf", fslen); return true;           /* UDF_SUPER_MAGIC */
+      case 0x00011954:     bstrncpy(fs, "ufs", fslen); return true;           /* UFS_MAGIC */
+      case 0xa501FCF5:     bstrncpy(fs, "vxfs", fslen); return true;          /* VXFS_SUPER_MAGIC */
+      case 0x012ff7b4:     bstrncpy(fs, "xenix", fslen); return true;         /* XENIX_SUPER_MAGIC */
+      case 0x012fd16d:     bstrncpy(fs, "xiafs", fslen); return true;         /* _XIAFS_SUPER_MAGIC */
+#endif
+
+      default:
+         Dmsg2(10, "Unknown file system type \"0x%x\" for \"%s\".\n", st.f_type,
+              fname);
+        return false;
+      }
+   }
+   Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+   return false;
+}
+
+#elif defined(HAVE_SUN_OS)
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   struct stat st;
+   if (lstat(fname, &st) == 0) {
+      bstrncpy(fs, st.st_fstype, fslen);
+      return true;
+   }
+   Dmsg1(50, "lstat() failed for \"%s\"\n", fname);
+   return false;
+}
+
+#else   /* No recognised OS */
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   Dmsg0(10, "!!! fstype() not implemented for this OS. !!!\n");
+
+#ifdef TEST_PROGRAM
+   Dmsg1(10, "Please define one of the following when compiling:\n\n%s\n",
+        SUPPORTEDOSES);
+   exit(EXIT_FAILURE);
+#endif
+
+   return false;
+}
+#endif
+
+#ifdef TEST_PROGRAM
+int main(int argc, char **argv)
+{
+   char *p;
+   char fs[1000];
+   int status = 0;
+
+   if (argc < 2) {
+      p = (argc < 1) ? "fstype" : argv[0];
+      printf("usage:\t%s path ...\n"
+            "\t%s prints the file system type and pathname of the paths.\n",
+           p, p);
+      return EXIT_FAILURE;
+   }
+   while (*++argv) {
+      if (!fstype(*argv, fs, sizeof(fs))) {
+        status = EXIT_FAILURE;
+      } else {
+         printf("%s\t%s\n", fs, *argv);
+      }
+   }
+   return status;
+}
+#endif
index a1b811418daf8ba1c644b7ad5f11c15e72b47553..b83653f8f98db1a4131ca85661b0ab3d9c8aa48c 100644 (file)
@@ -3,14 +3,14 @@
  *   filename/pathname patterns.
  *
  *  Note, this file is used for the old style include and
- *   excludes, so is deprecated. The new style code is 
+ *   excludes, so is deprecated. The new style code is
  *   found in find.c
  *
  *   Kern E. Sibbald, December MMI
  *
  */
 /*
-   Copyright (C) 2001-2004 Kern Sibbald and John Walker
+   Copyright (C) 2001-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -52,7 +52,7 @@ static const int fnmode = 0;
 #define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
 
 extern const int win32_client;
-       
+
 /*
  * Initialize structures for filename matching
  */
@@ -61,7 +61,7 @@ void init_include_exclude_files(FF_PKT *ff)
 }
 
 /*
- * Done doing filename matching, release all 
+ * Done doing filename matching, release all
  *  resources used.
  */
 void term_include_exclude_files(FF_PKT *ff)
@@ -74,19 +74,21 @@ void term_include_exclude_files(FF_PKT *ff)
       free(inc);
       inc = next_inc;
    }
+   ff->included_files_list = NULL;
 
    for (exc=ff->excluded_files_list; exc; ) {
       next_exc = exc->next;
       free(exc);
       exc = next_exc;
    }
+   ff->excluded_files_list = NULL;
 
    for (exc=ff->excluded_paths_list; exc; ) {
       next_exc = exc->next;
       free(exc);
       exc = next_exc;
    }
-   
+   ff->excluded_paths_list = NULL;
 }
 
 /*
@@ -103,7 +105,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
 
    inc =(struct s_included_file *)bmalloc(sizeof(struct s_included_file) + len + 1);
    inc->options = 0;
-   inc->VerifyOpts[0] = 'V'; 
+   inc->VerifyOpts[0] = 'V';
    inc->VerifyOpts[1] = ':';
    inc->VerifyOpts[2] = 0;
 
@@ -177,7 +179,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
       rp = fname;
    }
 
-   strcpy(inc->fname, rp);               
+   strcpy(inc->fname, rp);
    p = inc->fname;
    len = strlen(p);
    /* Zap trailing slashes.  */
@@ -214,7 +216,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
       for (next=ff->included_files_list; next->next; next=next->next)
         { }
       next->next = inc;
-   }  
+   }
    Dmsg1(50, "add_fname_to_include fname=%s\n", inc->fname);
 }
 
@@ -238,13 +240,13 @@ void add_fname_to_exclude_list(FF_PKT *ff, const char *fname)
    } else {
       list = &ff->excluded_files_list;
    }
-  
+
    len = strlen(fname);
 
    exc = (struct s_excluded_file *)bmalloc(sizeof(struct s_excluded_file) + len + 1);
    exc->next = *list;
    exc->len = len;
-   strcpy(exc->fname, fname);                
+   strcpy(exc->fname, fname);
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
    /* Convert any \'s into /'s */
    for (char *p=exc->fname; *p; p++) {
@@ -264,7 +266,7 @@ struct s_included_file *get_next_included_file(FF_PKT *ff, struct s_included_fil
 {
    struct s_included_file *inc;
 
-   if (ainc == NULL) { 
+   if (ainc == NULL) {
       inc = ff->included_files_list;
    } else {
       inc = ainc->next;
@@ -295,7 +297,7 @@ int file_is_included(FF_PKT *ff, const char *file)
            return 1;
         }
         continue;
-      }                            
+      }
       /*
        * No wild cards. We accept a match to the
        *  end of any component.
@@ -305,7 +307,7 @@ int file_is_included(FF_PKT *ff, const char *file)
       if (inc->len == len && strcmp(inc->fname, file) == 0) {
         return 1;
       }
-      if (inc->len < len && file[inc->len] == '/' && 
+      if (inc->len < len && file[inc->len] == '/' &&
          strncmp(inc->fname, file, inc->len) == 0) {
         return 1;
       }
@@ -348,7 +350,7 @@ int file_is_excluded(FF_PKT *ff, const char *file)
 {
    const char *p;
 
-   /* 
+   /*
     *  ***NB*** this removes the drive from the exclude
     *  rule.  Why?????
     */
@@ -365,7 +367,7 @@ int file_is_excluded(FF_PKT *ff, const char *file)
       /* Match from the beginning of a component only */
       if ((p == file || (*p != '/' && *(p-1) == '/'))
           && file_in_excluded_list(ff->excluded_files_list, p)) {
-        return 1;   
+        return 1;
       }
    }
    return 0;
index 58566d9cfd18898975190df4f6477c6faaa899fa..16867ba6a3c51a191e3d9b3a9cabcf1d6e6fc3e6 100644 (file)
@@ -4,7 +4,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -46,11 +46,11 @@ void  add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname);
 void  add_fname_to_exclude_list(FF_PKT *ff, const char *fname);
 int   file_is_excluded(FF_PKT *ff, const char *file);
 int   file_is_included(FF_PKT *ff, const char *file);
-struct s_included_file *get_next_included_file(FF_PKT *ff, 
+struct s_included_file *get_next_included_file(FF_PKT *ff,
                           struct s_included_file *inc);
 
 /* From find_one.c */
-int   find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), 
+int   find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt),
               void *pkt, char *p, dev_t parent_device, int top_level);
 int   term_find_one(FF_PKT *ff);
 
@@ -64,4 +64,7 @@ int make_path(JCR *jcr, const char *argpath, int mode,
           int parent_mode, uid_t owner, gid_t group,
           int preserve_existing, char *verbose_fmt_string);
 
+/* from fstype.c */
+bool fstype(const char *fname, char *fs, int fslen);
+
 /* from bfile.c -- see bfile.h */
index c4c6fa80974ae7e3a119c2cdb90f6614bf7ffcd0..d3feea0ecff5c4c12894fe380903d4d352d1cdd4 100644 (file)
@@ -3,7 +3,7 @@
  *   Bacula GNOME Console interface to the Director
  *
  *     Kern Sibbald, March MMII
- *     
+ *
  *     Version $Id$
  */
 
@@ -34,7 +34,7 @@
 /* Imported functions */
 int authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
 void select_restore_setup();
-       
+
 /* Exported variables */
 GtkWidget *console;   /* application window */
 GtkWidget *text1;           /* text window */
@@ -72,7 +72,7 @@ static void set_scroll_bar_to_end(void);
 
 /* Static variables */
 static char *configfile = NULL;
-static DIRRES *dir; 
+static DIRRES *dir;
 static int ndir;
 static bool director_reader_running = false;
 static bool at_prompt = false;
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
 
    struct sigaction sigignore;
    sigignore.sa_flags = 0;
-   sigignore.sa_handler = SIG_IGN;      
+   sigignore.sa_handler = SIG_IGN;
    sigfillset(&sigignore.sa_mask);
    sigaction(SIGPIPE, &sigignore, NULL);
 
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
       case '?':
       default:
         usage();
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -183,8 +183,8 @@ int main(int argc, char *argv[])
    }
    UnlockRes();
    if (ndir == 0) {
-      Emsg1(M_ERROR_TERM, 0, _("No director resource defined in %s\n\
-Without that I don't how to speak to the Director :-(\n"), configfile);
+      Emsg1(M_ERROR_TERM, 0, _("No director resource defined in %s\n"
+"Without that I don't how to speak to the Director :-(\n"), configfile);
    }
 
 
@@ -217,24 +217,24 @@ Without that I don't how to speak to the Director :-(\n"), configfile);
    LockRes();
    foreach_res(con_font, R_CONSOLE_FONT) {
        if (!con_font->fontface) {
-          Dmsg1(400, "No fontface for %s\n", con_font->hdr.name);
+         Dmsg1(400, "No fontface for %s\n", con_font->hdr.name);
          continue;
        }
        text_font = gdk_font_load(con_font->fontface);
        if (text_font == NULL) {
-           Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n",
+          Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n",
                  con_font->hdr.name, con_font->fontface);
        } else {
-           Dmsg2(400, "ConsoleFont \"%s\" (%s) loaded.\n",
+          Dmsg2(400, "ConsoleFont \"%s\" (%s) loaded.\n",
                  con_font->hdr.name, con_font->fontface);
           break;
-       }          
+       }
    }
    UnlockRes();
 
    if (text_font == NULL) {
        Dmsg1(400, "Attempting to load fallback font %s\n",
-              "-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
+             "-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
        text_font = gdk_font_load("-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
    }
    font_desc = pango_font_description_from_string("LucidaTypewriter 9");
@@ -310,7 +310,7 @@ static GList *get_list(char *cmd)
       options = g_list_append(options, msg);
    }
    return options;
-   
+
 }
 
 static GList *get_and_fill_combo(GtkWidget *dialog, const char *combo_name, const char *cm)
@@ -363,7 +363,7 @@ int connect_to_director(gpointer data)
       combo = lookup_widget(dir_dialog, "combo1");
       dir_select = lookup_widget(dir_dialog, "dirselect");
       if (dirs) {
-        gtk_combo_set_popdown_strings(GTK_COMBO(combo), dirs);   
+        gtk_combo_set_popdown_strings(GTK_COMBO(combo), dirs);
       }
       gtk_widget_show(dir_dialog);
       gtk_main();
@@ -392,19 +392,19 @@ int connect_to_director(gpointer data)
    }
 
    memset(&jcr, 0, sizeof(jcr));
-   
+
    set_statusf(_(" Connecting to Director %s:%d"), dir->address,dir->DIRport);
    set_textf(_("Connecting to Director %s:%d\n\n"), dir->address,dir->DIRport);
 
    while (gtk_events_pending()) {     /* fully paint screen */
       gtk_main_iteration();
    }
-   UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address, 
+   UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
                          NULL, dir->DIRport, 0);
    if (UA_sock == NULL) {
       return 0;
    }
-   
+
    jcr.dir_bsock = UA_sock;
    LockRes();
    /* If cons==NULL, default console will be used */
@@ -481,7 +481,7 @@ void read_director(gpointer data, gint fd, GdkInputCondition condition)
    stat = bnet_recv(UA_sock);
    if (stat >= 0) {
       if (at_prompt) {
-         set_text("\n", 1);
+        set_text("\n", 1);
         at_prompt = false;
       }
       set_text(UA_sock->msg, UA_sock->msglen);
@@ -611,7 +611,7 @@ void set_statusf(const char *fmt, ...)
    ready = false;
 }
 
-void set_status_ready()    
+void set_status_ready()
 {
    gtk_label_set_text(GTK_LABEL(status1), " Ready");
    ready = true;
@@ -637,6 +637,6 @@ static void set_scroll_bar_to_end(void)
    gtk_text_iter_set_offset(&iter, buf_len);
    gtk_text_buffer_place_cursor(textbuf, &iter);
    gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(text1),
-              gtk_text_buffer_get_mark(textbuf, "insert"), 
+             gtk_text_buffer_get_mark(textbuf, "insert"),
              0, TRUE, 0.0, 1.0);
 }
index 80c52f4e55f6f33026ae74843972f08aa8c7fc35..7b3f911fc43de44a4bac08c50e938c98d8dcaaa3 100644 (file)
@@ -174,7 +174,7 @@ struct JCR {
    POOLMEM *fname;                    /* name to put into catalog */
    POOLMEM *stime;                    /* start time for incremental/differential */
    JOB_DBR jr;                        /* Job DB record for current job */
-   JOB_DBR *verify_jr;                /* Pointer to target job */
+   JOB_DBR verify_jr;                 /* Pointer to target job */
    uint32_t RestoreJobId;             /* Id specified by UA */
    POOLMEM *client_uname;             /* client uname */ 
    int replace;                       /* Replace option */
@@ -243,6 +243,7 @@ struct JCR {
 
    /* Parmaters for Open Read Session */
    BSR *bsr;                          /* Bootstrap record -- has everything */
+   bool mount_next_volume;            /* set to cause next volume mount */
    uint32_t read_VolSessionId;
    uint32_t read_VolSessionTime;
    uint32_t read_StartFile;
index a1fe35a10cf7001f624ec2334532efd1a33627fd..81fe37a800b05f8042f268d6e81f90269b240d81 100644 (file)
 
 
 #include "bacula.h"
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
 
 static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultport, int family,
                const char *hostname_str, const char *port_str, char **errstr);
@@ -36,7 +42,7 @@ IPADDR::IPADDR(const IPADDR &src) : type(src.type)
 {
   memcpy(&saddrbuf, &src.saddrbuf, sizeof(saddrbuf));
   saddr  = &saddrbuf.dontuse;
-  saddr4 = &saddrbuf.dontuse4; 
+  saddr4 = &saddrbuf.dontuse4;
 #ifdef HAVE_IPV6
   saddr6 = &saddrbuf.dontuse6;
 #endif
@@ -54,7 +60,7 @@ IPADDR::IPADDR(int af) : type(R_EMPTY)
   }
 #endif
   saddr  = &saddrbuf.dontuse;
-  saddr4 = &saddrbuf.dontuse4; 
+  saddr4 = &saddrbuf.dontuse4;
 #ifdef HAVE_IPV6
   saddr6 = &saddrbuf.dontuse6;
 #endif
@@ -74,8 +80,8 @@ IPADDR::IPADDR(int af) : type(R_EMPTY)
   saddr->sa_len = sizeof(sockaddr_in);
 #endif
 #endif
-   set_addr_any(); 
-} 
+   set_addr_any();
+}
 
 void IPADDR::set_type(i_type o)
 {
@@ -116,7 +122,7 @@ void IPADDR::set_port_net(unsigned short port)
 int IPADDR::get_family() const
 {
     return saddr->sa_family;
-}      
+}
 
 struct sockaddr *IPADDR::get_sockaddr()
 {
@@ -141,7 +147,7 @@ void IPADDR::copy_addr(IPADDR *src)
       saddr6->sin6_addr = src->saddr6->sin6_addr;
    }
 #endif
-} 
+}
 
 void IPADDR::set_addr_any()
 {
@@ -156,7 +162,7 @@ void IPADDR::set_addr_any()
 }
 
 void IPADDR::set_addr4(struct in_addr *ip4)
-{ 
+{
    if (saddr->sa_family != AF_INET) {
       Emsg1(M_ERROR_TERM, 0, _("It was tried to assign a ipv6 address to a ipv4(%d)\n"), saddr->sa_family);
    }
@@ -165,7 +171,7 @@ void IPADDR::set_addr4(struct in_addr *ip4)
 
 #ifdef HAVE_IPV6
 void IPADDR::set_addr6(struct in6_addr *ip6)
-{ 
+{
    if (saddr->sa_family != AF_INET6) {
       Emsg1(M_ERROR_TERM, 0, _("It was tried to assign a ipv4 address to a ipv6(%d)\n"), saddr->sa_family);
    }
@@ -176,17 +182,21 @@ void IPADDR::set_addr6(struct in6_addr *ip6)
 const char *IPADDR::get_address(char *outputbuf, int outlen)
 {
    outputbuf[0] = '\0';
-#if defined(HAVE_INET_NTOP) && defined(HAVE_IPV6)
+#ifdef HAVE_INET_NTOP
+# ifdef HAVE_IPV6
    inet_ntop(saddr->sa_family, saddr->sa_family == AF_INET ?
              (void*)&(saddr4->sin_addr) : (void*)&(saddr6->sin6_addr),
              outputbuf, outlen);
+# else
+   inet_ntop(saddr->sa_family, (void*)&(saddr4->sin_addr), outputbuf, outlen);
+# endif
 #else
    bstrncpy(outputbuf, inet_ntoa(saddr4->sin_addr), outlen);
 #endif
    return outputbuf;
 }
 
-const char *IPADDR::build_address_str(char *buf, int blen) 
+const char *IPADDR::build_address_str(char *buf, int blen)
 {
    char tmp[1024];
    bsnprintf(buf, blen, "host[%s:%s:%hu] ",
@@ -195,9 +205,9 @@ const char *IPADDR::build_address_str(char *buf, int blen)
    return buf;
 }
 
-const char *build_addresses_str(dlist *addrs, char *buf, int blen) 
+const char *build_addresses_str(dlist *addrs, char *buf, int blen)
 {
-   if (addrs->size() == 0) {
+   if (!addrs || addrs->size() == 0) {
       bstrncpy(buf, "", blen);
       return buf;
    }
@@ -221,12 +231,20 @@ const char *get_first_address(dlist * addrs, char *outputbuf, int outlen)
 
 int get_first_port_net_order(dlist * addrs)
 {
-   return ((IPADDR *)(addrs->first()))->get_port_net_order();                            
+   if (!addrs) {
+      return 0;
+   } else {
+      return ((IPADDR *)(addrs->first()))->get_port_net_order();
+   }
 }
 
 int get_first_port_host_order(dlist * addrs)
 {
-   return ((IPADDR *)(addrs->first()))->get_port_host_order();                           
+   if (!addrs) {
+      return 0;
+   } else {
+      return ((IPADDR *)(addrs->first()))->get_port_host_order();
+   }
 }
 
 void init_default_addresses(dlist **out, int port)
@@ -307,7 +325,7 @@ static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultp
       if (addrs->size()) {
         addr = (IPADDR *)addrs->first();
       } else {
-        addr = New(IPADDR(family)); 
+        addr = New(IPADDR(family));
         addr->set_type(type);
         addr->set_port_net(defaultport);
         addr->set_addr_any();
@@ -325,13 +343,13 @@ static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultp
         /* for duplicates */
         foreach_dlist(jaddr, addrs) {
            if (iaddr->get_sockaddr_len() == jaddr->get_sockaddr_len() &&
-           !memcmp(iaddr->get_sockaddr(), jaddr->get_sockaddr(), 
+           !memcmp(iaddr->get_sockaddr(), jaddr->get_sockaddr(),
                    iaddr->get_sockaddr_len()))
                {
               goto skip;          /* no price */
            }
         }
-        clone = New(IPADDR(*iaddr)); 
+        clone = New(IPADDR(*iaddr));
         clone->set_type(type);
         clone->set_port_net(port);
         addrs->append(clone);
@@ -347,27 +365,27 @@ static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultp
  *   my tests
  *   positiv
  *   = { ip = { addr = 1.2.3.4; port = 1205; } ipv4 = { addr = 1.2.3.4; port = http; } }
- *   = { ip = { 
- *        addr = 1.2.3.4; port = 1205; } 
- *     ipv4 = { 
- *        addr = 1.2.3.4; port = http; } 
- *     ipv6 = { 
- *      addr = 1.2.3.4; 
+ *   = { ip = {
+ *        addr = 1.2.3.4; port = 1205; }
+ *     ipv4 = {
+ *        addr = 1.2.3.4; port = http; }
+ *     ipv6 = {
+ *      addr = 1.2.3.4;
  *      port = 1205;
- *     } 
+ *     }
  *     ip = {
  *      addr = 1.2.3.4
  *      port = 1205
- *     } 
+ *     }
  *     ip = {
  *      addr = 1.2.3.4
- *     } 
+ *     }
  *     ip = {
  *      addr = 2001:220:222::2
- *     } 
+ *     }
  *     ip = {
  *      addr = bluedot.thun.net
- (     } 
+ (     }
  *   }
  *   negativ
  *   = { ip = { } }
@@ -473,7 +491,7 @@ void store_addresses(LEX * lc, RES_ITEM * item, int index, int pass)
       }
 
       char *errstr;
-      if (pass == 1 && !add_address((dlist **)(item->value), IPADDR::R_MULTIPLE, 
+      if (pass == 1 && !add_address((dlist **)(item->value), IPADDR::R_MULTIPLE,
               htons(item->default_value), family, hostname_str, port_str, &errstr)) {
            scan_err3(lc, _("Can't add hostname(%s) and port(%s) to addrlist (%s)"),
                   hostname_str, port_str, errstr);
@@ -538,17 +556,48 @@ int sockaddr_get_port_net_order(const struct sockaddr *client_addr)
    return -1;
 }
 
-int  sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
+int sockaddr_get_port(const struct sockaddr *client_addr)
+{
+   if (client_addr->sa_family == AF_INET) {
+      return ntohs(((struct sockaddr_in *)client_addr)->sin_port);
+   }
+#ifdef HAVE_IPV6
+   else {
+      return ntohs(((struct sockaddr_in6 *)client_addr)->sin6_port);
+   }
+#endif
+   return -1;
+}
+
+
+char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
 {
 #ifdef HAVE_INET_NTOP
    /* MA Bug 5 the problem was that i mixed up sockaddr and in_addr */
    inet_ntop(sa->sa_family,
+# ifdef HAVE_IPV6
             sa->sa_family == AF_INET ? 
                 (void*)&(((struct sockaddr_in*)sa)->sin_addr) :
                 (void*)&(((struct sockaddr_in6*)sa)->sin6_addr),
+# else
+                (void*)&(((struct sockaddr_in*)sa)->sin_addr),
+# endif /* HAVE_IPV6 */
             buf, len);
 #else
    bstrncpy(buf, inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), len);
 #endif
-   return 1;
+   return buf;
+}
+
+#ifdef HAVE_OLD_SOCKOPT
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+   struct in_addr inaddr;
+
+   if((inaddr.s_addr = inet_addr(cp)) != INADDR_NONE) {
+      inp->s_addr = inaddr.s_addr;
+      return 1;
+   }
+   return 0;
 }
+#endif
index 9f618da1c554160e323f0e76f0fd05ad03824e06..6145a3fb4f7a3f455ce5511c8eaac36c9b6746a9 100644 (file)
@@ -34,7 +34,7 @@ class IPADDR : public SMARTALLOC {
    IPADDR(int af);
    IPADDR(const IPADDR & src);
  private:
-   IPADDR() {  /* block this construction */ } 
+   IPADDR() {  /* block this construction */ }
    i_type type;
    union {
       struct sockaddr dontuse;
@@ -87,4 +87,11 @@ extern int get_first_port_host_order(dlist * addrs);
 extern const char *build_addresses_str(dlist *addrs, char *buf, int blen);
 
 extern int sockaddr_get_port_net_order(const struct sockaddr *sa);
-extern int sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+extern int sockaddr_get_port(const struct sockaddr *sa);
+extern char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+#ifdef WIN32
+#undef HAVE_OLD_SOCKOPT
+#endif
+#ifdef HAVE_OLD_SOCKOPT
+extern int inet_aton(const char *cp, struct in_addr *inp);
+#endif
index dc01ccf9f7a588a1786b6bb6e75f9141cfb8d5db..53275832b164a0c15dc5f54505d9050bebeff7a2 100644 (file)
@@ -1,8 +1,8 @@
 /*
- *  Bacula array list routines    
+ *  Bacula array list routines
  *
  *    alist is a simple malloc'ed array of pointers.  For the moment,
- *      it simply malloc's a bigger array controlled by num_grow.         
+ *      it simply malloc's a bigger array controlled by num_grow.
  *     Default is to realloc the pointer array for each new member.
  *
  *   Kern Sibbald, June MMIII
@@ -33,7 +33,7 @@
 #include "bacula.h"
 
 /*
- * Private grow list function. Used to insure that 
+ * Private grow list function. Used to insure that
  *   at least one more "slot" is available.
  */
 void alist::grow_list()
@@ -65,7 +65,7 @@ void *alist::last()
    if (num_items == 0) {
       return NULL;
    } else {
-      cur_item = num_items;    
+      cur_item = num_items;
       return items[num_items-1];
    }
 }
@@ -89,7 +89,7 @@ void *alist::prev()
 }
 
 /*
- * prepend an item to the list
+ * prepend an item to the list -- i.e. add to beginning
  */
 void alist::prepend(void *item) {
    grow_list();
@@ -171,13 +171,13 @@ int main()
    fileset->mylist.init();
 
    printf("Manual allocation/destruction of list:\n");
-   
+
    for (int i=0; i<20; i++) {
       sprintf(buf, "This is item %d", i);
       fileset->mylist.append(bstrdup(buf));
-   } 
+   }
    for (int i=0; i< fileset->mylist.size(); i++) {
-      printf("Item %d = %s\n", i, (char *)fileset->mylist[i]);  
+      printf("Item %d = %s\n", i, (char *)fileset->mylist[i]);
    }
    fileset->mylist.destroy();
    free(fileset);
@@ -188,9 +188,9 @@ int main()
    for (int i=0; i<20; i++) {
       sprintf(buf, "This is item %d", i);
       mlist->append(bstrdup(buf));
-   } 
+   }
    for (int i=0; i< mlist->size(); i++) {
-      printf("Item %d = %s\n", i, (char *)mlist->get(i));  
+      printf("Item %d = %s\n", i, (char *)mlist->get(i));
    }
 
    delete mlist;
index 2e43d564dd29bc9bfa7076b38d1e238fa7b6b498..f02be3d5c0c8998a63044e695c888754ece94a7b 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /*
-   Copyright (C) 2003-2004 Kern Sibbald and John Walker
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -24,7 +24,7 @@
 
  */
 
-/* 
+/*
  * There is a lot of extra casting here to work around the fact
  * that some compilers (Sun and Visual C++) do not accept
  * (void *) as an lvalue on the left side of an equal.
@@ -32,7 +32,9 @@
  * Loop var through each member of list
  */
 #define foreach_alist(var, list) \
-    for((*((void **)&(var))=(void*)((list)->first())); (var); (*((void **)&(var))=(void*)((list)->next())))
+    for((*((void **)&(var))=(void*)((list)->first())); \
+         (var); \
+         (*((void **)&(var))=(void*)((list)->next())))
 
 #ifdef the_easy_way
 #define foreach_alist(var, list) \
@@ -46,7 +48,7 @@ enum {
   not_owned_by_alist = false
 };
 
-/* 
+/*
  * Array list -- much like a simplified STL vector
  *   array of pointers to inserted items
  */
@@ -86,10 +88,11 @@ inline void * alist::operator [](int index) const {
 
 inline bool alist::empty() const
 {
-   return num_items == 0;
+   /* Check for null pointer */
+   return this ? num_items == 0 : true;
 }
 
-/*                            
+/*
  * This allows us to do explicit initialization,
  *   allowing us to mix C++ classes inside malloc'ed
  *   C structures. Define before called in constructor.
@@ -111,17 +114,22 @@ inline alist::alist(int num, bool own) {
 inline alist::~alist() {
    destroy();
 }
-   
+
 
 
 /* Current size of list */
-inline int alist::size() const 
+inline int alist::size() const
 {
-   return num_items;
+   /*
+    * Check for null pointer, which allows test
+    *  on size to succeed even if nothing put in
+    *  alist.
+    */
+   return this ? num_items : 0;
 }
 
 /* How much to grow by each time */
-inline void alist::grow(int num) 
+inline void alist::grow(int num)
 {
    num_grow = num;
 }
index 54df1e66aae8aae3510de1c08044b95317de31f4..10657394f1f49933569feadca9aff843d0d2eb49 100644 (file)
@@ -3,13 +3,13 @@
  *
  *  by Kern Sibbald
  *
- * Adapted and enhanced for Bacula, originally written 
+ * Adapted and enhanced for Bacula, originally written
  * for inclusion in the Apcupsd package
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -53,6 +53,7 @@ extern time_t watchdog_time;
 #define socketClose(fd)          close(fd)
 #endif
 
+static pthread_mutex_t ip_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 /*
  * Read a nbytes from the network.
@@ -138,12 +139,12 @@ static int32_t write_nbytes(BSOCK * bsock, char *ptr, int32_t nbytes)
    return nbytes - nleft;
 }
 
-/* 
+/*
  * Receive a message from the other end. Each message consists of
  * two packets. The first is a header that contains the size
  * of the data that follows in the second packet.
  * Returns number of bytes read (may return zero)
- * Returns -1 on signal (BNET_SIGNAL) 
+ * Returns -1 on signal (BNET_SIGNAL)
  * Returns -2 on hard end of file (BNET_HARDEOF)
  * Returns -3 on error (BNET_ERROR)
  *
@@ -151,7 +152,7 @@ static int32_t write_nbytes(BSOCK * bsock, char *ptr, int32_t nbytes)
  *    four return types:
  *    1. Normal data
  *    2. Signal including end of data stream
- *    3. Hard end of file                
+ *    3. Hard end of file
  *    4. Error
  *  Using is_bnet_stop() and is_bnet_error() you can figure this all out.
  */
@@ -258,7 +259,7 @@ int32_t bnet_recv(BSOCK * bsock)
 
 
 /*
- * Return 1 if there are errors on this bsock or it is closed, 
+ * Return 1 if there are errors on this bsock or it is closed,
  *   i.e. stop communicating on this line.
  */
 bool is_bnet_stop(BSOCK * bsock)
@@ -267,10 +268,11 @@ bool is_bnet_stop(BSOCK * bsock)
 }
 
 /*
- * Return number of errors on socket 
+ * Return number of errors on socket
  */
 int is_bnet_error(BSOCK * bsock)
 {
+   errno = bsock->b_errno;
    return bsock->errors;
 }
 
@@ -368,7 +370,7 @@ bool bnet_send(BSOCK * bsock)
       if (rc < 0) {
         if (!bsock->suppress_error_msgs && !bsock->timed_out) {
            Qmsg4(bsock->jcr, M_ERROR, 0,
-                  _("Write error sending to %s:%s:%d: ERR=%s\n"), bsock->who,
+                  _("Write error sending len to %s:%s:%d: ERR=%s\n"), bsock->who,
                  bsock->host, bsock->port, bnet_strerror(bsock));
         }
       } else {
@@ -398,8 +400,9 @@ bool bnet_send(BSOCK * bsock)
       }
       if (rc < 0) {
         if (!bsock->suppress_error_msgs) {
-           Qmsg4(bsock->jcr, M_ERROR, 0,
-                  _("Write error sending to %s:%s:%d: ERR=%s\n"), bsock->who,
+           Qmsg5(bsock->jcr, M_ERROR, 0,
+                  _("Write error sending %d bytes to %s:%s:%d: ERR=%s\n"), 
+                 bsock->msglen, bsock->who,
                  bsock->host, bsock->port, bnet_strerror(bsock));
         }
       } else {
@@ -413,7 +416,7 @@ bool bnet_send(BSOCK * bsock)
 }
 
 /*
- * Establish an SSL connection -- server side        
+ * Establish an SSL connection -- server side
  *  Codes that ssl_need and ssl_has can take
  *    BNET_SSL_NONE     I cannot do ssl
  *    BNET_SSL_OK       I can do ssl, but it is not required on my end
@@ -427,7 +430,7 @@ int bnet_ssl_server(BSOCK * bsock, char *password, int ssl_need, int ssl_has)
 }
 
 /*
- * Establish an SSL connection -- client side  
+ * Establish an SSL connection -- client side
  */
 int bnet_ssl_client(BSOCK * bsock, char *password, int ssl_need)
 {
@@ -549,7 +552,6 @@ static const char *gethost_strerror()
 }
 
 
-static pthread_mutex_t ip_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 
 static IPADDR *add_any(int family)
@@ -656,7 +658,7 @@ dlist *bnet_host2ipaddrs(const char *host, int family, const char **errstr)
    return addr_list;
 }
 
-/*     
+/*
  * Open a TCP connection to the UPS network server
  * Returns NULL
  * Returns BSOCK * pointer on success
@@ -673,7 +675,7 @@ static BSOCK *bnet_open(JCR * jcr, const char *name, char *host, char *service,
    const char *errstr;
    int save_errno = 0;
 
-   /* 
+   /*
     * Fill in the structure serv_addr with the address of
     * the server that we want to connect with.
     */
@@ -691,15 +693,15 @@ static BSOCK *bnet_open(JCR * jcr, const char *name, char *host, char *service,
       ipaddr->set_port_net(htons(port));
       char allbuf[256 * 10];
       char curbuf[256];
-      Dmsg2(100, "Current %sAll %s\n", 
-                  ipaddr->build_address_str(curbuf, sizeof(curbuf)), 
+      Dmsg2(100, "Current %sAll %s\n",
+                  ipaddr->build_address_str(curbuf, sizeof(curbuf)),
                   build_addresses_str(addr_list, allbuf, sizeof(allbuf)));
       /* Open a TCP socket */
       if ((sockfd = socket(ipaddr->get_family(), SOCK_STREAM, 0)) < 0) {
         berrno be;
         save_errno = errno;
         *fatal = 1;
-         Pmsg3(000, "Socket open error. proto=%d port=%d. ERR=%s\n", 
+         Pmsg3(000, "Socket open error. proto=%d port=%d. ERR=%s\n",
            ipaddr->get_family(), ipaddr->get_port_host_order(), be.strerror());
         continue;
       }
@@ -763,8 +765,8 @@ BSOCK *bnet_connect(JCR * jcr, int retry_interval, int max_retry_time,
       if (i < 0) {
         i = 60 * 5;               /* complain again in 5 minutes */
         if (verbose)
-            Qmsg4(jcr, M_WARNING, 0, "Could not connect to %s on %s:%d. ERR=%s\n\
-Retrying ...\n", name, host, port, be.strerror());
+            Qmsg4(jcr, M_WARNING, 0, "Could not connect to %s on %s:%d. ERR=%s\n"
+"Retrying ...\n", name, host, port, be.strerror());
       }
       bmicrosleep(retry_interval, 0);
       max_retry_time -= retry_interval;
@@ -823,7 +825,7 @@ bool bnet_fsend(BSOCK * bs, const char *fmt, ...)
    return bnet_send(bs);
 }
 
-/* 
+/*
  * Set the network buffer size, suggested size is in size.
  *  Actual size obtained is returned in bs->msglen
  *
@@ -851,7 +853,7 @@ bool bnet_set_buffer_size(BSOCK * bs, uint32_t size, int rw)
       return false;
    }
    if (rw & BNET_SETBUF_READ) {
-      while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET, 
+      while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
              SO_RCVBUF, (sockopt_val_t) & dbuf_size, sizeof(dbuf_size)) < 0)) {
         berrno be;
          Qmsg1(bs->jcr, M_ERROR, 0, _("sockopt error: %s\n"), be.strerror());
@@ -875,7 +877,7 @@ bool bnet_set_buffer_size(BSOCK * bs, uint32_t size, int rw)
    }
    start_size = dbuf_size;
    if (rw & BNET_SETBUF_WRITE) {
-      while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET, 
+      while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
              SO_SNDBUF, (sockopt_val_t) & dbuf_size, sizeof(dbuf_size)) < 0)) {
         berrno be;
          Qmsg1(bs->jcr, M_ERROR, 0, _("sockopt error: %s\n"), be.strerror());
@@ -898,7 +900,7 @@ bool bnet_set_buffer_size(BSOCK * bs, uint32_t size, int rw)
 }
 
 /*
- * Send a network "signal" to the other end 
+ * Send a network "signal" to the other end
  *  This consists of sending a negative packet length
  *
  *  Returns: false on failure
@@ -935,13 +937,13 @@ const char *bnet_sig_to_ascii(BSOCK * bs)
    case BNET_PROMPT:
       return "BNET_PROMPT";
    default:
-      sprintf(buf, "Unknown sig %d", bs->msglen);
+      sprintf(buf, "Unknown sig %d", (int)bs->msglen);
       return buf;
    }
 }
 
 
-/* Initialize internal socket structure.  
+/* Initialize internal socket structure.
  *  This probably should be done in net_open
  */
 BSOCK *init_bsock(JCR * jcr, int sockfd, const char *who, const char *host, int port,
@@ -959,7 +961,7 @@ BSOCK *init_bsock(JCR * jcr, int sockfd, const char *who, const char *host, int
    bsock->port = port;
    memcpy(&bsock->client_addr, client_addr, sizeof(bsock->client_addr));
    /*
-    * ****FIXME**** reduce this to a few hours once   
+    * ****FIXME**** reduce this to a few hours once
     *  heartbeats are implemented
     */
    bsock->timeout = 60 * 60 * 6 * 24;  /* 6 days timeout */
index 8d8cfbb15e3e04768a04403675f183738f60a28a..c2cad7deaa5afa8fdce7fd2fe2588f7cfcc700db 100644 (file)
@@ -17,7 +17,7 @@
    MA 02111-1307, USA.
 
  */
- /* 
+ /*
   * Originally written by Kern Sibbald for inclusion in apcupsd,
   *  but heavily modified for Bacula
   *
@@ -25,7 +25,6 @@
   */
 
 #include "bacula.h"
-#undef DEV_BSIZE
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <stdlib.h>
@@ -57,8 +56,8 @@ void bnet_stop_thread_server(pthread_t tid)
    }
 }
 
-/* 
-       Become Threaded Network Server 
+/*
+       Become Threaded Network Server
     This function is able to handle multiple server ips in
     ipv4 and ipv6 style. The Addresse are give in a comma
     seperated string in bind_addr
@@ -93,7 +92,7 @@ bnet_thread_server(dlist *addrs, int max_clients, workq_t *client_wq,
       fd_ptr = (s_sockfd *)alloca(sizeof(s_sockfd));
       fd_ptr->port = p->get_port_net_order();
       /*
-       * Open a TCP socket  
+       * Open a TCP socket
        */
       for (tlog= 60; (fd_ptr->fd=socket(p->get_family(), SOCK_STREAM, 0)) < 0; tlog -= 10) {
         if (tlog <= 0) {
@@ -101,13 +100,13 @@ bnet_thread_server(dlist *addrs, int max_clients, workq_t *client_wq,
            char curbuf[256];
             Emsg3(M_ABORT, 0, _("Cannot open stream socket. ERR=%s. Current %s All %s\n"),
                       be.strerror(),
-                      p->build_address_str(curbuf, sizeof(curbuf)), 
+                      p->build_address_str(curbuf, sizeof(curbuf)),
                       build_addresses_str(addrs, allbuf, sizeof(allbuf)));
         }
         bmicrosleep(10, 0);
       }
       /*
-       * Reuse old sockets 
+       * Reuse old sockets
        */
       if (setsockopt(fd_ptr->fd, SOL_SOCKET, SO_REUSEADDR, (sockopt_val_t)&turnon,
           sizeof(turnon)) < 0) {
@@ -140,7 +139,7 @@ bnet_thread_server(dlist *addrs, int max_clients, workq_t *client_wq,
       be.set_errno(stat);
       Emsg1(M_ABORT, 0, _("Could not init client queue: ERR=%s\n"), be.strerror());
    }
-   /* 
+   /*
     * Wait for a connection from the client process.
     */
    for (; !quit;) {
@@ -182,20 +181,10 @@ bnet_thread_server(dlist *addrs, int max_clients, workq_t *client_wq,
            fromhost(&request);
            if (!hosts_access(&request)) {
               V(mutex);
-#ifndef HAVE_INET_NTOP
               Jmsg2(NULL, M_SECURITY, 0,
                      _("Connection from %s:%d refused by hosts.access\n"),
-                    inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr),
-                    ntohs(((sockaddr_in *)&cli_addr)->sin_port));
-#else
-              Jmsg2(NULL, M_SECURITY, 0,
-                     _("Connection from %s:%d refused by hosts.access\n"),
-                    inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6,
-                              &clilen, buf, clilen),
-                    ntohs(clilen == sizeof(sockaddr_in) ? 
-                          ((sockaddr_in *)&cli_addr)->sin_port :
-                           ((sockaddr_in6 *)&cli_addr)->sin6_port));
-#endif
+                    sockaddr_to_ascii(&cli_addr, buf, sizeof(buf)),
+                    sockaddr_get_port(&cli_addr));
               close(newsockfd);
               continue;
            }
@@ -214,14 +203,9 @@ bnet_thread_server(dlist *addrs, int max_clients, workq_t *client_wq,
 
            /* see who client is. i.e. who connected to us. */
            P(mutex);
-#ifdef HAVE_INET_NTOP
-           inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6, &clilen,
-                     buf, sizeof(buf));
-#else
-           bstrncpy(buf, inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr), sizeof(buf));      /* NOT thread safe, use mutex */
-#endif
+           sockaddr_to_ascii(&cli_addr, buf, sizeof(buf));
            V(mutex);
-           BSOCK *bs; 
+           BSOCK *bs;
             bs = init_bsock(NULL, newsockfd, "client", buf, fd_ptr->port, &cli_addr);
            if (bs == NULL) {
                Jmsg0(NULL, M_ABORT, 0, _("Could not create client BSOCK.\n"));
@@ -261,7 +245,7 @@ BSOCK *bnet_bind(int port)
    int turnon = 1;
 
    /*
-    * Open a TCP socket  
+    * Open a TCP socket
     */
    for (tlog = 0; (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0; tlog -= 10) {
       if (errno == EINTR || errno == EAGAIN) {
@@ -275,14 +259,14 @@ BSOCK *bnet_bind(int port)
    }
 
    /*
-    * Reuse old sockets 
+    * Reuse old sockets
     */
    if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (sockopt_val_t)&turnon, sizeof(turnon)) < 0) {
       Emsg1(M_WARNING, 0, _("Cannot set SO_REUSEADDR on socket: %s\n"),
            strerror(errno));
    }
 
-   /* 
+   /*
     * Bind our local address so that the client can send to us.
     */
    bzero((char *)&serv_addr, sizeof(serv_addr));
@@ -309,7 +293,7 @@ BSOCK *bnet_bind(int port)
 }
 
 /*
- * Accept a single connection 
+ * Accept a single connection
  */
 BSOCK *bnet_accept(BSOCK * bsock, char *who)
 {
@@ -324,14 +308,14 @@ BSOCK *bnet_accept(BSOCK * bsock, char *who)
    struct request_info request;
 #endif
 
-   /* 
+   /*
     * Wait for a connection from the client process.
     */
    FD_ZERO(&sockset);
    FD_SET((unsigned)bsock->fd, &sockset);
 
    for (;;) {
-      /* 
+      /*
        * Wait for a connection from a client process.
        */
       ready = sockset;
index 93238b26e28e258249d313a06eda2de08b1eb528..4778b84aad62cbb50e69b9ac5f0975947e5d3eb2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *   bpipe.c bi-directional pipe
- * 
+ *
  *    Kern Sibbald, November MMII
  *
  *   Version $Id$
@@ -29,7 +29,7 @@
 #include "bacula.h"
 #include "jcr.h"
 
-int execvp_errors[] = {EACCES, ENOEXEC, EFAULT, EINTR, E2BIG, 
+int execvp_errors[] = {EACCES, ENOEXEC, EFAULT, EINTR, E2BIG,
                     ENAMETOOLONG, ENOMEM, ETXTBSY, ENOENT};
 int num_execvp_errors = (int)(sizeof(execvp_errors)/sizeof(int));
 
@@ -41,7 +41,7 @@ static void build_argc_argv(char *cmd, int *bargc, char *bargv[], int max_arg);
  * Run an external program. Optionally wait a specified number
  *   of seconds. Program killed if wait exceeded. We open
  *   a bi-directional pipe so that the user can read from and
- *   write to the program. 
+ *   write to the program.
  */
 BPIPE *open_bpipe(char *prog, int wait, const char *mode)
 {
@@ -161,16 +161,16 @@ int close_wpipe(BPIPE *bpipe)
    return stat;
 }
 
-/* 
- * Close both pipes and free resources  
+/*
+ * Close both pipes and free resources
  *
  *  Returns: 0 on success
  *          berrno on failure
  */
-int close_bpipe(BPIPE *bpipe) 
+int close_bpipe(BPIPE *bpipe)
 {
    int chldstatus = 0;
-   int stat = 0;    
+   int stat = 0;
    int wait_option;
    int remaining_wait;
    pid_t wpid = 0;
@@ -195,17 +195,17 @@ int close_bpipe(BPIPE *bpipe)
 
    /* wait for worker child to exit */
    for ( ;; ) {
-      Dmsg2(200, "Wait for %d opt=%d\n", bpipe->worker_pid, wait_option);
+      Dmsg2(800, "Wait for %d opt=%d\n", bpipe->worker_pid, wait_option);
       do {
         wpid = waitpid(bpipe->worker_pid, &chldstatus, wait_option);
       } while (wpid == -1 && (errno == EINTR || errno == EAGAIN));
       if (wpid == bpipe->worker_pid || wpid == -1) {
         stat = errno;
-         Dmsg3(200, "Got break wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+         Dmsg3(800, "Got break wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
             wpid==-1?strerror(errno):"none");
         break;
       }
-      Dmsg3(200, "Got wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+      Dmsg3(800, "Got wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
             wpid==-1?strerror(errno):"none");
       if (remaining_wait > 0) {
         bmicrosleep(1, 0);           /* wait one second */
@@ -220,21 +220,21 @@ int close_bpipe(BPIPE *bpipe)
       if (WIFEXITED(chldstatus)) {    /* process exit()ed */
         stat = WEXITSTATUS(chldstatus);
         if (stat != 0) {
-            Dmsg1(200, "Non-zero status %d returned from child.\n", stat);
+            Dmsg1(800, "Non-zero status %d returned from child.\n", stat);
            stat |= b_errno_exit;        /* exit status returned */
         }
-         Dmsg1(200, "child status=%d\n", stat & ~b_errno_exit);
+         Dmsg1(800, "child status=%d\n", stat & ~b_errno_exit);
       } else if (WIFSIGNALED(chldstatus)) {  /* process died */
         stat = WTERMSIG(chldstatus);
-         Dmsg1(200, "Child died from signale %d\n", stat);
+         Dmsg1(800, "Child died from signale %d\n", stat);
         stat |= b_errno_signal;      /* exit signal returned */
       }
-   }      
+   }
    if (bpipe->timer_id) {
       stop_child_timer(bpipe->timer_id);
    }
    free(bpipe);
-   Dmsg1(200, "returning stat = %d\n", stat);
+   Dmsg1(800, "returning stat = %d\n", stat);
    return stat;
 }
 
@@ -244,7 +244,7 @@ int close_bpipe(BPIPE *bpipe)
  *   of seconds. Program killed if wait exceeded. Optionally
  *   return the output from the program (normally a single line).
  *
- * Contrary to my normal calling conventions, this program 
+ * Contrary to my normal calling conventions, this program
  *
  *  Returns: 0 on success
  *          non-zero on error == berrno status
@@ -262,7 +262,7 @@ int run_program(char *prog, int wait, POOLMEM *results)
    }
    if (results) {
       results[0] = 0;
-      fgets(results, sizeof_pool_memory(results), bpipe->rfd);       
+      fgets(results, sizeof_pool_memory(results), bpipe->rfd);
       if (feof(bpipe->rfd)) {
         stat1 = 0;
       } else {
@@ -282,13 +282,72 @@ int run_program(char *prog, int wait, POOLMEM *results)
    return stat1;
 }
 
+/*
+ * Run an external program. Optionally wait a specified number
+ *   of seconds. Program killed if wait exceeded (it is done by the 
+ *   watchdog, as fgets is a blocking function).
+ *   Return the full output from the program (not only the first line).
+ *
+ * Contrary to my normal calling conventions, this program
+ *
+ *  Returns: 0 on success
+ *          non-zero on error == berrno status
+ *
+ */
+int run_program_full_output(char *prog, int wait, POOLMEM *results)
+{
+   BPIPE *bpipe;
+   int stat1, stat2;
+   char *mode;
+   POOLMEM* tmp;
+
+   if (results == NULL) {
+      return run_program(prog, wait, NULL);
+   }
+   
+   tmp = get_pool_memory(PM_MESSAGE);
+   
+   mode = (char *)"r";
+   bpipe = open_bpipe(prog, wait, mode);
+   if (!bpipe) {
+      return ENOENT;
+   }
+   
+   results[0] = 0;
+
+   while (1) {
+      fgets(tmp, sizeof_pool_memory(tmp), bpipe->rfd);
+      Dmsg1(800, "Run program fgets=%s", tmp);
+      pm_strcat(results, tmp);
+      if (feof(bpipe->rfd)) {
+        stat1 = 0;
+         Dmsg1(100, "Run program fgets stat=%d\n", stat1);
+        break;
+      } else {
+        stat1 = ferror(bpipe->rfd);
+      }
+      if (stat1 < 0) {
+         Dmsg2(100, "Run program fgets stat=%d ERR=%s\n", stat1, strerror(errno));
+        break;
+      } else if (stat1 != 0) {
+         Dmsg1(100, "Run program fgets stat=%d\n", stat1);
+      }
+   }
+   
+   stat2 = close_bpipe(bpipe);
+   stat1 = stat2 != 0 ? stat2 : stat1;
+   
+   Dmsg1(100, "Run program returning %d\n", stat);
+   free_pool_memory(tmp);
+   return stat1;
+}
 
 /*
  * Build argc and argv from a string
  */
 static void build_argc_argv(char *cmd, int *bargc, char *bargv[], int max_argv)
 {
-   int i;      
+   int i;
    char *p, *q, quote;
    int argc = 0;
 
index b0d6cb240cc0b035f70cc88ca5946c367db61943..ba14452c0e0ae7c2fbe4bd5cf1e176470dd014a2 100644 (file)
@@ -1,14 +1,14 @@
 /*
  * Miscellaneous Bacula memory and thread safe routines
  *   Generally, these are interfaces to system or standard
- *   library routines. 
- * 
+ *   library routines.
+ *
  *  Bacula utility functions are in util.c
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 #include <grp.h>
 #endif
 
+static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
+
+/*
+ * This routine will sleep (sec, microsec).  Note, however, that if a
+ *   signal occurs, it will return early.  It is up to the caller
+ *   to recall this routine if he/she REALLY wants to sleep the
+ *   requested time.
+ */
+int bmicrosleep(time_t sec, long usec)
+{
+   struct timespec timeout;
+   struct timeval tv;
+   struct timezone tz;
+   int stat;
+
+   timeout.tv_sec = sec;
+   timeout.tv_nsec = usec * 1000;
+
+#ifdef HAVE_NANOSLEEP
+   stat = nanosleep(&timeout, NULL);
+   if (!(stat < 0 && errno == ENOSYS)) {
+      return stat;
+   }
+   /* If we reach here it is because nanosleep is not supported by the OS */
+#endif
+
+   /* Do it the old way */
+   gettimeofday(&tv, &tz);
+   timeout.tv_nsec += tv.tv_usec * 1000;
+   timeout.tv_sec += tv.tv_sec;
+   while (timeout.tv_nsec >= 1000000000) {
+      timeout.tv_nsec -= 1000000000;
+      timeout.tv_sec++;
+   }
+
+   Dmsg2(200, "pthread_cond_timedwait sec=%d usec=%d\n", sec, usec);
+   /* Note, this unlocks mutex during the sleep */
+   P(timer_mutex);
+   stat = pthread_cond_timedwait(&timer, &timer_mutex, &timeout);
+   if (stat != 0) {
+      berrno be;
+      Dmsg2(200, "pthread_cond_timedwait stat=%d ERR=%s\n", stat,
+        be.strerror(stat));
+   }
+   V(timer_mutex);
+   return stat;
+}
+
 /*
  * Guarantee that the string is properly terminated */
 char *bstrncpy(char *dest, const char *src, int maxlen)
@@ -126,7 +175,7 @@ void *bcalloc (size_t size1, size_t size2)
 /*
  * Implement snprintf
  */
-int bsnprintf(char *str, int32_t size, const char *fmt,  ...) 
+int bsnprintf(char *str, int32_t size, const char *fmt,  ...)
 {
    va_list   arg_ptr;
    int len;
@@ -150,15 +199,16 @@ int bvsnprintf(char *str, int32_t size, const char  *format, va_list ap)
 
 #else
 
-   int len;
+   int len, buflen;
    char *buf;
-   buf = get_memory(BIG_BUF);
+   buflen = size > BIG_BUF ? size : BIG_BUF;
+   buf = get_memory(buflen);
    len = vsprintf(buf, format, ap);
-   if (len >= BIG_BUF) {
+   if (len >= buflen) {
       Emsg0(M_ABORT, 0, _("Buffer overflow.\n"));
    }
-   memcpy(str, buf, size);
-   str[size-1] = 0;
+   memcpy(str, buf, len);
+   str[len] = 0;               /* len excludes the null */
    free_memory(buf);
    return len;
 #endif
@@ -170,7 +220,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *tm)
 {
     static pthread_mutex_t mutex;
     static bool first = true;
-    struct tm *ltm, 
+    struct tm *ltm,
 
     if (first) {
        pthread_mutex_init(&mutex, NULL);
@@ -262,7 +312,7 @@ void _p(char *file, int line, pthread_mutex_t *m)
       } else {
          e_msg(file, line, M_ERROR, 0, _("Possible mutex deadlock resolved.\n"));
       }
-        
+
    }
 }
 
@@ -314,7 +364,7 @@ void create_pid_file(char *dir, const char *progname, int port)
    if (stat(fname, &statp) == 0) {
       /* File exists, see what we have */
       *pidbuf = 0;
-      if ((pidfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0 || 
+      if ((pidfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0 ||
           read(pidfd, &pidbuf, sizeof(pidbuf)) < 0 ||
            sscanf(pidbuf, "%d", &oldpid) != 1) {
          Emsg2(M_ERROR_TERM, 0, _("Cannot open pid file. %s ERR=%s\n"), fname, strerror(errno));
@@ -368,7 +418,7 @@ struct s_state_hdr {
    uint64_t reserved[20];
 };
 
-static struct s_state_hdr state_hdr = { 
+static struct s_state_hdr state_hdr = {
    "Bacula State\n",
    3,
    0
@@ -389,17 +439,17 @@ void read_state_file(char *dir, const char *progname, int port)
    /* If file exists, see what we have */
 // Dmsg1(10, "O_BINARY=%d\n", O_BINARY);
    if ((sfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0) {
-      Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n", 
+      Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n",
                    sfd, sizeof(hdr), strerror(errno));
           goto bail_out;
    }
    if ((stat=read(sfd, &hdr, hdr_size)) != hdr_size) {
-      Dmsg4(010, "Could not read state file. sfd=%d stat=%d size=%d: ERR=%s\n", 
+      Dmsg4(010, "Could not read state file. sfd=%d stat=%d size=%d: ERR=%s\n",
                    sfd, (int)stat, hdr_size, strerror(errno));
       goto bail_out;
    }
    if (hdr.version != state_hdr.version) {
-      Dmsg2(010, "Bad hdr version. Wanted %d got %d\n", 
+      Dmsg2(010, "Bad hdr version. Wanted %d got %d\n",
         state_hdr.version, hdr.version);
    }
    hdr.id[13] = 0;
@@ -437,12 +487,12 @@ void write_state_file(char *dir, const char *progname, int port)
    }
 // Dmsg1(010, "Wrote header of %d bytes\n", sizeof(state_hdr));
    state_hdr.last_jobs_addr = sizeof(state_hdr);
-   state_hdr.reserved[0] = write_last_jobs_list(sfd, state_hdr.last_jobs_addr);   
+   state_hdr.reserved[0] = write_last_jobs_list(sfd, state_hdr.last_jobs_addr);
 // Dmsg1(010, "write last job end = %d\n", (int)state_hdr.reserved[0]);
    if (lseek(sfd, 0, SEEK_SET) < 0) {
       Dmsg1(000, "lseek error: ERR=%s\n", strerror(errno));
       goto bail_out;
-   }  
+   }
    if (write(sfd, &state_hdr, sizeof(state_hdr)) != sizeof(state_hdr)) {
       Pmsg1(000, "Write final hdr error: ERR=%s\n", strerror(errno));
    }
@@ -489,64 +539,16 @@ void drop(char *uid, char *gid)
       }
    }
 #endif
-         
-}
-
-static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
-
-/*
- * This routine will sleep (sec, microsec).  Note, however, that if a 
- *   signal occurs, it will return early.  It is up to the caller
- *   to recall this routine if he/she REALLY wants to sleep the
- *   requested time.
- */
-int bmicrosleep(time_t sec, long usec)
-{
-   struct timespec timeout;
-   struct timeval tv;
-   struct timezone tz;
-   int stat;
-
-   timeout.tv_sec = sec;
-   timeout.tv_nsec = usec * 1000;
-
-#ifdef HAVE_NANOSLEEP
-   stat = nanosleep(&timeout, NULL);
-   if (!(stat < 0 && errno == ENOSYS)) {
-      return stat;                  
-   }
-   /* If we reach here it is because nanosleep is not supported by the OS */
-#endif
 
-   /* Do it the old way */
-   gettimeofday(&tv, &tz);
-   timeout.tv_nsec += tv.tv_usec * 1000;
-   timeout.tv_sec += tv.tv_sec;
-   while (timeout.tv_nsec >= 1000000000) {
-      timeout.tv_nsec -= 1000000000;
-      timeout.tv_sec++;
-   }
-
-   Dmsg2(200, "pthread_cond_timedwait sec=%d usec=%d\n", sec, usec);
-   /* Note, this unlocks mutex during the sleep */
-   P(timer_mutex);
-   stat = pthread_cond_timedwait(&timer, &timer_mutex, &timeout);
-   if (stat != 0) {
-      berrno be;
-      Dmsg2(200, "pthread_cond_timedwait stat=%d ERR=%s\n", stat,
-        be.strerror(stat));
-   }
-   V(timer_mutex);
-   return stat;
 }
 
+
 /* BSDI does not have this.  This is a *poor* simulation */
 #ifndef HAVE_STRTOLL
 long long int
 strtoll(const char *ptr, char **endptr, int base)
 {
-   return (long long int)strtod(ptr, endptr);  
+   return (long long int)strtod(ptr, endptr);
 }
 #endif
 
@@ -558,7 +560,7 @@ strtoll(const char *ptr, char **endptr, int base)
 char *bfgets(char *s, int size, FILE *fd)
 {
    char *p = s;
-   int ch;      
+   int ch;
    *p = 0;
    for (int i=0; i < size-1; i++) {
       do {
@@ -584,7 +586,7 @@ char *bfgets(char *s, int size, FILE *fd)
            ungetc(ch, fd); /* Push next character back to fd */
         }
         break;
-      }      
+      }
       if (ch == '\n') {
         break;
       }
index fd87b12cd0a9c5392e773ff21b557c10cc73b6fb..cd0545a61cde4b323ec5d95df5b09654a8662659 100644 (file)
@@ -9,9 +9,9 @@
  *   in the UNIX Environment"
  *
  * Initialize a daemon process completely detaching us from
- * any terminal processes. 
+ * any terminal processes.
  *
- */ 
+ */
 
 /*
    Copyright (C) 2000-2004 Kern Sibbald and John Walker
@@ -37,7 +37,7 @@
 #include "bacula.h"
 extern int debug_level;
 
-void 
+void
 daemon_start()
 {
 #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
@@ -53,13 +53,13 @@ daemon_start()
     *  Become a daemon.
     */
 
-   Dmsg0(200, "Enter daemon_start\n");
+   Dmsg0(900, "Enter daemon_start\n");
    if ( (cpid = fork() ) < 0)
       Emsg1(M_ABORT, 0, "Cannot fork to become daemon: %s\n", strerror(errno));
    else if (cpid > 0)
       exit(0);             /* parent exits */
    /* Child continues */
-      
+
    setsid();
 
    /* In the PRODUCTION system, we close ALL
@@ -79,7 +79,7 @@ daemon_start()
    chdir("/");
 #endif
 
-   /* 
+   /*
     * Avoid creating files 666 but don't override any
     * more restrictive mask set by the user.
     */
@@ -106,5 +106,5 @@ daemon_start()
    }
 
 #endif /* HAVE_CYGWIN */
-   Dmsg0(200, "Exit daemon_start\n");
+   Dmsg0(900, "Exit daemon_start\n");
 }
index d988f46dbcf18dffb4948a04f7a1cfeb60532a03..526af060f8557c3d2e3265a15e3e974b0c15955e 100644 (file)
@@ -1,13 +1,13 @@
 /*
- *   edit.c  edit string to ascii, and ascii to internal 
- * 
+ *   edit.c  edit string to ascii, and ascii to internal
+ *
  *    Kern Sibbald, December MMII
  *
  *   Version $Id$
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -30,7 +30,7 @@
 #include <math.h>
 
 /* We assume ASCII input and don't worry about overflow */
-uint64_t str_to_uint64(char *str) 
+uint64_t str_to_uint64(char *str)
 {
    register char *p = str;
    register uint64_t value = 0;
@@ -51,7 +51,7 @@ uint64_t str_to_uint64(char *str)
    return value;
 }
 
-int64_t str_to_int64(char *str) 
+int64_t str_to_int64(char *str)
 {
    register char *p = str;
    register int64_t value;
@@ -84,7 +84,7 @@ int64_t str_to_int64(char *str)
  */
 char *edit_uint64_with_commas(uint64_t val, char *buf)
 {
-   /*  
+   /*
     * Replacement for sprintf(buf, "%" llu, val)
     */
    char mbuf[50];
@@ -109,24 +109,53 @@ char *edit_uint64_with_commas(uint64_t val, char *buf)
  */
 char *edit_uint64(uint64_t val, char *buf)
 {
-   /*  
+   /*
+    * Replacement for sprintf(buf, "%" llu, val)
+    */
+   char mbuf[50];
+   mbuf[sizeof(mbuf)-1] = 0;
+   int i = sizeof(mbuf)-2;                /* edit backward */
+   if (val == 0) {
+      mbuf[i--] = '0';
+   } else {
+      while (val != 0) {
+         mbuf[i--] = "0123456789"[val%10];
+        val /= 10;
+      }
+   }
+   strcpy(buf, &mbuf[i+1]);
+   return buf;
+}
+
+char *edit_int64(int64_t val, char *buf)
+{
+   /*
     * Replacement for sprintf(buf, "%" llu, val)
     */
    char mbuf[50];
+   bool negative = false;
    mbuf[sizeof(mbuf)-1] = 0;
    int i = sizeof(mbuf)-2;                /* edit backward */
    if (val == 0) {
       mbuf[i--] = '0';
    } else {
+      if (val < 0) {
+        negative = true;
+        val = -val;
+      }
       while (val != 0) {
          mbuf[i--] = "0123456789"[val%10];
         val /= 10;
       }
    }
+   if (negative) {
+      mbuf[i--] = '-';
+   }
    strcpy(buf, &mbuf[i+1]);
    return buf;
 }
 
+
 /*
  * Given a string "str", separate the integer part into
  *   str, and the modifier into mod.
@@ -134,7 +163,7 @@ char *edit_uint64(uint64_t val, char *buf)
 static bool get_modifier(char *str, char *num, int num_len, char *mod, int mod_len)
 {
    int i, len, num_begin, num_end, mod_begin, mod_end;
-        
+
    /*
     * Look for modifier by walking back looking for the first
     *  space or digit.
@@ -202,12 +231,12 @@ int duration_to_utime(char *str, utime_t *value)
    char num_str[50];
    /*
     * The "n" = mins and months appears before minutes so that m maps
-    *   to months. These "kludges" make it compatible with pre 1.31 
+    *   to months. These "kludges" make it compatible with pre 1.31
     *  Baculas.
     */
-   static const char *mod[] = {"n", "seconds", "months", "minutes", 
+   static const char *mod[] = {"n", "seconds", "months", "minutes",
                   "hours", "days", "weeks",   "quarters",   "years", NULL};
-   static const int32_t mult[] = {60,  1, 60*60*24*30, 60, 
+   static const int32_t mult[] = {60,  1, 60*60*24*30, 60,
                  60*60, 60*60*24, 60*60*24*7, 60*60*24*91, 60*60*24*365};
 
    while (*str) {
@@ -260,7 +289,7 @@ char *edit_utime(utime_t val, char *buf, int buf_len)
         bstrncat(buf, mybuf, buf_len);
       }
    }
-   if (val == 0 && strlen(buf) == 0) {    
+   if (val == 0 && strlen(buf) == 0) {
       bstrncat(buf, "0 secs", buf_len);
    } else if (val != 0) {
       bsnprintf(mybuf, sizeof(mybuf), "%d sec%s", (uint32_t)val, val>1?"s":"");
@@ -340,7 +369,7 @@ bool is_a_number(const char *n)
 }
 
 /*
- * Check if the specified string is an integer  
+ * Check if the specified string is an integer
  */
 bool is_an_integer(const char *n)
 {
@@ -355,7 +384,7 @@ bool is_an_integer(const char *n)
 /*
  * Check if Bacula Resoure Name is valid
  */
-/* 
+/*
  * Check if the Volume name has legal characters
  * If ua is non-NULL send the message
  */
@@ -396,7 +425,7 @@ bool is_name_valid(char *name, POOLMEM **msg)
 
 /*
  * Add commas to a string, which is presumably
- * a number.  
+ * a number.
  */
 char *add_commas(char *val, char *buf)
 {
@@ -420,7 +449,7 @@ char *add_commas(char *val, char *buf)
          *q-- = *p--;
       }
       *q-- = ',';
-   }   
+   }
    return buf;
 }
 
index 71dd0e1dd52ecedc254143722cf6e11636845c22..7b11a9a196474fdcc496a6416ef680db57b91210 100644 (file)
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "bacula.h"
-#ifndef HAVE_FNMATCH
-
-/* Enable GNU extensions in fnmatch.h. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE   1
-#endif
-
 #include "fnmatch.h"
 
 
@@ -235,5 +227,3 @@ fnmatch (const char *pattern, const char *string, int flags)
 }
 
 #endif /* _LIBC or not __GNU_LIBRARY__.  */
-
-#endif /* !HAVE_FNMATCH */
index af1dcf523bfa2af40f009bb01ec04366f6e20c8c..07a5d44ffed4b8bb5e46eb8edb62c5cbe4b97d57 100644 (file)
@@ -15,11 +15,11 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
 
-#ifndef        _FNMATCH_H
+#ifndef _FNMATCH_H
 
-#define        _FNMATCH_H      1
+#define _FNMATCH_H     1
 
 #ifdef __cplusplus
 extern "C" {
@@ -27,10 +27,10 @@ extern "C" {
 
 #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
 #undef __P
-#define        __P(protos)     protos
+#define __P(protos)    protos
 #else /* Not C++ or ANSI C.  */
 #undef __P
-#define        __P(protos)     ()
+#define __P(protos)    ()
 /* We can get away without defining `const' here only because in this file
    it is used only inside the prototype for `fnmatch', which is elided in
    non-ANSI C where `const' is problematical.  */
@@ -44,18 +44,18 @@ extern "C" {
 #undef FNM_PERIOD
 
 /* Bits set in the FLAGS argument to `fnmatch'.  */
-#define        FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
-#define        FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
-#define        FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
-
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
-#define        FNM_FILE_NAME   FNM_PATHNAME /* Preferred GNU name.  */
-#define        FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
-#define        FNM_CASEFOLD    (1 << 4) /* Compare without regard to case.  */
-#endif
+#define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
+#define FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
+#define FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
+
+/* #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) */
+#define FNM_FILE_NAME  FNM_PATHNAME /* Preferred GNU name.  */
+#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
+#define FNM_CASEFOLD   (1 << 4) /* Compare without regard to case.  */
+/* #endif -- kes 12Jan05 */
 
 /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
-#define        FNM_NOMATCH     1
+#define FNM_NOMATCH    1
 
 /* Match STRING against the filename pattern PATTERN,
    returning zero if it matches, FNM_NOMATCH if not.  */
index 3769c8bec8b484306c7a117a488683b6de9e3a19..0af1101356b1de5077fea0dca615e9162268c021 100644 (file)
@@ -8,22 +8,22 @@
  *    the randomness. In this program, the hash table can grow when
  *    it gets too full, so the table size here is a binary number. The
  *    hashing is provided using an idea from Tcl where the initial
- *    hash code is then "randomized" using a simple calculation from
+ *    hash code is "randomized" using a simple calculation from
  *    a random number generator that multiplies by a big number
  *    (I multiply by a prime number, while Tcl did not)
- *    then shifts the results down and does the binary division
+ *    then shifts the result down and does the binary division
  *    by masking.  Increasing the size of the hash table is simple.
  *    Just create a new larger table, walk the old table and
  *    re-hash insert each entry into the new table.
  *
- *               
+ *
  *   Kern Sibbald, July MMIII
  *
  *   Version $Id$
  *
  */
 /*
-   Copyright (C) 2003-2004 Kern Sibbald and John Walker
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -90,37 +90,34 @@ void htable::init(void *item, void *link, int tsize)
    walk_index = 0;
 }
 
-#ifdef xxx
-void * htable::operator new(size_t)
-{
-   return malloc(sizeof(htable));
-}
-
-void htable::operator delete(void *tbl) 
-{
-   ((htable *)tbl)->destroy();
-   free(tbl);
-}
-#endif
-
 uint32_t htable::size()
 {
    return num_items;
 }
 
-void htable::stats() 
+/*
+ * Take each hash link and walk down the chain of items
+ *  that hash there counting them (i.e. the hits), 
+ *  then report that number.
+ *  Obiously, the more hits in a chain, the more time
+ *  it takes to reference them. Empty chains are not so
+ *  hot either -- as it means unused or wasted space.
+ */
+#define MAX_COUNT 20
+void htable::stats()
 {
-   int count[10];
+   int hits[MAX_COUNT];
    int max = 0;
    int i, j;
    hlink *p;
-   printf("\n\nNumItems=%d\nBuckets=%d\n", num_items, buckets);
-   for (i=0; i<10; i++) {
-      count[i] = 0;
+   printf("\n\nNumItems=%d\nTotal buckets=%d\n", num_items, buckets);
+   printf("Hits/bucket: buckets\n");
+   for (i=0; i < MAX_COUNT; i++) {
+      hits[i] = 0;
    }
    for (i=0; i<(int)buckets; i++) {
       p = table[i];
-      j = 0;    
+      j = 0;
       while (p) {
         p = (hlink *)(p->next);
         j++;
@@ -128,14 +125,14 @@ void htable::stats()
       if (j > max) {
         max = j;
       }
-      if (j < 10) {
-        count[j]++;
+      if (j < MAX_COUNT) {
+        hits[j]++;
       }
    }
-   for (i=0; i<10; i++) {
-      printf("%2d: %d\n",i, count[i]);
+   for (i=0; i < MAX_COUNT; i++) {
+      printf("%2d:           %d\n",i, hits[i]);
    }
-   printf("max = %d\n", max);
+   printf("max hits in a bucket = %d\n", max);
 }
 
 void htable::grow_table()
@@ -155,7 +152,7 @@ void htable::grow_table()
    big->walk_index = 0;
    /* Insert all the items in the new hash table */
    Dmsg1(100, "Before copy num_items=%d\n", num_items);
-   /* 
+   /*
     * We walk through the old smaller tree getting items,
     * but since we are overwriting the colision links, we must
     * explicitly save the item->next pointer and walk each
@@ -169,7 +166,7 @@ void htable::grow_table()
       if (ni) {
         item = (void *)((char *)ni-loffset);
       } else {
-        walkptr = NULL;       
+        walkptr = NULL;
         item = next();
       }
    }
@@ -238,10 +235,10 @@ void *htable::next()
       }
    }
    if (walkptr) {
-      Dmsg2(100, "next: rtn 0x%x walk_index=%d\n", 
+      Dmsg2(100, "next: rtn 0x%x walk_index=%d\n",
         (unsigned)(((char *)walkptr)-loffset), walk_index);
       return ((char *)walkptr)-loffset;
-   } 
+   }
    Dmsg0(100, "next: return NULL\n");
    return NULL;
 }
@@ -261,7 +258,7 @@ void *htable::first()
    if (walkptr) {
       Dmsg1(100, "Leave first walkptr=0x%x\n", (unsigned)walkptr);
       return ((char *)walkptr)-loffset;
-   } 
+   }
    Dmsg0(100, "Leave first walkptr=NULL\n");
    return NULL;
 }
@@ -300,10 +297,10 @@ int main()
    MYJCR *save_jcr = NULL, *item;
    MYJCR *jcr = NULL;
    int count = 0;
-    
+
    jcrtbl = (htable *)malloc(sizeof(htable));
    jcrtbl->init(jcr, &jcr->link, NITEMS);
-    
+
    Dmsg1(000, "Inserting %d items\n", NITEMS);
    for (int i=0; i<NITEMS; i++) {
       sprintf(mkey, "This is htable item %d", i);
index f4c0cc97353dcbcb1be8ab7dcdbb9ce1c0209d85..cb18c8fd30adb396496e31bcb2ad2356a86ad1f8 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -23,7 +23,7 @@
  */
 
 /* ========================================================================
- * 
+ *
  *   Hash table class -- htable
  *
  */
@@ -32,9 +32,9 @@
  * Loop var through each member of table
  */
 #define foreach_htable(var, tbl) \
-        for(((void *)(var))=(tbl)->first(); \
+        for((*((void **)&(var))=(void *)((tbl)->first())); \
             (var); \
-            ((void *)(var))=(tbl)->next())
+            (*((void **)&(var))=(void *)((tbl)->next())))
 
 struct hlink {
    void *next;                        /* next hash item */
index ebbfd79275ca27c067bf9f48356b9b7c0b46e42e..6b95c321678d74bd7066873198f1d4f763c11320 100755 (executable)
@@ -9,7 +9,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -43,7 +43,7 @@ int num_jobs_run;
 dlist *last_jobs = NULL;
 const int max_last_jobs = 10;
 
-static JCR *jobs = NULL;             /* pointer to JCR chain */
+JCR *jobs = NULL;                    /* pointer to JCR chain */
 static brwlock_t lock;               /* lock for last jobs and JCR chain */
 
 void init_last_jobs_list()
@@ -53,7 +53,7 @@ void init_last_jobs_list()
    if (!last_jobs) {
       last_jobs = New(dlist(job_entry, &job_entry->link));
       if ((errstat=rwl_init(&lock)) != 0) {
-         Emsg1(M_ABORT, 0, _("Unable to initialize jcr_chain lock. ERR=%s\n"), 
+         Emsg1(M_ABORT, 0, _("Unable to initialize jcr_chain lock. ERR=%s\n"),
               strerror(errstat));
       }
    }
@@ -64,9 +64,9 @@ void term_last_jobs_list()
 {
    if (last_jobs) {
       while (!last_jobs->empty()) {
-        void *je = last_jobs->first(); 
+        void *je = last_jobs->first();
         last_jobs->remove(je);
-        free(je);     
+        free(je);
       }
       delete last_jobs;
       last_jobs = NULL;
@@ -140,16 +140,16 @@ uint64_t write_last_jobs_list(int fd, uint64_t addr)
       stat = 0;
    }
    return stat;
-      
+
 }
 
-void lock_last_jobs_list() 
+void lock_last_jobs_list()
 {
    /* Use jcr chain mutex */
    lock_jcr_chain();
 }
 
-void unlock_last_jobs_list() 
+void unlock_last_jobs_list()
 {
    /* Use jcr chain mutex */
    unlock_jcr_chain();
@@ -188,7 +188,7 @@ JCR *new_jcr(int size, JCR_free_HANDLER *daemon_free_jcr)
    MQUEUE_ITEM *item = NULL;
    struct sigaction sigtimer;
 
-   Dmsg0(400, "Enter new_jcr\n");
+   Dmsg0(3400, "Enter new_jcr\n");
    jcr = (JCR *)malloc(size);
    memset(jcr, 0, size);
    jcr->my_thread_id = pthread_self();
@@ -234,7 +234,7 @@ JCR *new_jcr(int size, JCR_free_HANDLER *daemon_free_jcr)
  */
 static void remove_jcr(JCR *jcr)
 {
-   Dmsg0(400, "Enter remove_jcr\n");
+   Dmsg0(3400, "Enter remove_jcr\n");
    if (!jcr) {
       Emsg0(M_ABORT, 0, "NULL jcr.\n");
    }
@@ -246,12 +246,12 @@ static void remove_jcr(JCR *jcr)
    if (jcr->next) {
       jcr->next->prev = jcr->prev;
    }
-   Dmsg0(400, "Leave remove_jcr\n");
+   Dmsg0(3400, "Leave remove_jcr\n");
 }
 
 /*
  * Free stuff common to all JCRs.  N.B. Be careful to include only
- *  generic stuff in the common part of the jcr. 
+ *  generic stuff in the common part of the jcr.
  */
 static void free_common_jcr(JCR *jcr)
 {
@@ -336,20 +336,20 @@ static void free_common_jcr(JCR *jcr)
    free(jcr);
 }
 
-/* 
+/*
  * Global routine to free a jcr
  */
 #ifdef DEBUG
 void b_free_jcr(const char *file, int line, JCR *jcr)
 {
-   Dmsg3(400, "Enter free_jcr 0x%x from %s:%d\n", jcr, file, line);
+   Dmsg3(3400, "Enter free_jcr 0x%x from %s:%d\n", jcr, file, line);
 
 #else
 
 void free_jcr(JCR *jcr)
 {
 
-   Dmsg1(400, "Enter free_jcr 0x%x\n", jcr);
+   Dmsg1(3400, "Enter free_jcr 0x%x\n", jcr);
 
 #endif
 
@@ -360,10 +360,10 @@ void free_jcr(JCR *jcr)
       Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"),
         jcr->use_count, jcr->JobId);
    }
-   Dmsg3(400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
+   Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
    if (jcr->use_count > 0) {         /* if in use */
       unlock_jcr_chain();
-      Dmsg2(400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+      Dmsg2(3400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
       return;
    }
    remove_jcr(jcr);                  /* remove Jcr from chain */
@@ -371,24 +371,24 @@ void free_jcr(JCR *jcr)
 
    job_end_pop(jcr);                 /* pop and call hooked routines */
 
-   Dmsg1(400, "End job=%d\n", jcr->JobId);
+   Dmsg1(3400, "End job=%d\n", jcr->JobId);
    if (jcr->daemon_free_jcr) {
       jcr->daemon_free_jcr(jcr);      /* call daemon free routine */
    }
    free_common_jcr(jcr);
    close_msg(NULL);                  /* flush any daemon messages */
-   Dmsg0(400, "Exit free_jcr\n");
+   Dmsg0(3400, "Exit free_jcr\n");
 }
 
 
-/* 
+/*
  * Global routine to free a jcr
  *  JCR chain is already locked
  */
 void free_locked_jcr(JCR *jcr)
 {
    jcr->use_count--;                 /* decrement use count */
-   Dmsg2(400, "Dec free_locked_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+   Dmsg2(3400, "Dec free_locked_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
    if (jcr->use_count > 0) {         /* if in use */
       return;
    }
@@ -400,13 +400,13 @@ void free_locked_jcr(JCR *jcr)
 
 
 /*
- * Given a JobId, find the JCR     
+ * Given a JobId, find the JCR
  *   Returns: jcr on success
  *           NULL on failure
  */
 JCR *get_jcr_by_id(uint32_t JobId)
 {
-   JCR *jcr;      
+   JCR *jcr;
 
    lock_jcr_chain();                   /* lock chain */
    for (jcr = jobs; jcr; jcr=jcr->next) {
@@ -414,41 +414,41 @@ JCR *get_jcr_by_id(uint32_t JobId)
         P(jcr->mutex);
         jcr->use_count++;
         V(jcr->mutex);
-         Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+         Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
         break;
       }
    }
    unlock_jcr_chain();
-   return jcr; 
+   return jcr;
 }
 
 /*
- * Given a SessionId and SessionTime, find the JCR     
+ * Given a SessionId and SessionTime, find the JCR
  *   Returns: jcr on success
  *           NULL on failure
  */
 JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
 {
-   JCR *jcr;      
+   JCR *jcr;
 
    lock_jcr_chain();
    for (jcr = jobs; jcr; jcr=jcr->next) {
-      if (jcr->VolSessionId == SessionId && 
+      if (jcr->VolSessionId == SessionId &&
          jcr->VolSessionTime == SessionTime) {
         P(jcr->mutex);
         jcr->use_count++;
         V(jcr->mutex);
-         Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+         Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
         break;
       }
    }
    unlock_jcr_chain();
-   return jcr; 
+   return jcr;
 }
 
 
 /*
- * Given a Job, find the JCR     
+ * Given a Job, find the JCR
  *  compares on the number of characters in Job
  *  thus allowing partial matches.
  *   Returns: jcr on success
@@ -456,7 +456,7 @@ JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
  */
 JCR *get_jcr_by_partial_name(char *Job)
 {
-   JCR *jcr;      
+   JCR *jcr;
    int len;
 
    if (!Job) {
@@ -469,24 +469,24 @@ JCR *get_jcr_by_partial_name(char *Job)
         P(jcr->mutex);
         jcr->use_count++;
         V(jcr->mutex);
-         Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+         Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
         break;
       }
    }
    unlock_jcr_chain();
-   return jcr; 
+   return jcr;
 }
 
 
 /*
- * Given a Job, find the JCR     
+ * Given a Job, find the JCR
  *  requires an exact match of names.
  *   Returns: jcr on success
  *           NULL on failure
  */
 JCR *get_jcr_by_full_name(char *Job)
 {
-   JCR *jcr;      
+   JCR *jcr;
 
    if (!Job) {
       return NULL;
@@ -497,12 +497,12 @@ JCR *get_jcr_by_full_name(char *Job)
         P(jcr->mutex);
         jcr->use_count++;
         V(jcr->mutex);
-         Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+         Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
         break;
       }
    }
    unlock_jcr_chain();
-   return jcr; 
+   return jcr;
 }
 
 void set_jcr_job_status(JCR *jcr, int JobStatus)
@@ -527,7 +527,7 @@ void set_jcr_job_status(JCR *jcr, int JobStatus)
 static int lock_count = 0;
 #endif
 
-/* 
+/*
  * Lock the chain
  */
 #ifdef TRACE_JCR_CHAIN
@@ -537,8 +537,8 @@ void lock_jcr_chain()
 #endif
 {
    int errstat;
-#ifdef TRACE_JCR_CHAIN 
-   Dmsg3(400, "Lock jcr chain %d from %s:%d\n", ++lock_count,
+#ifdef TRACE_JCR_CHAIN
+   Dmsg3(3400, "Lock jcr chain %d from %s:%d\n", ++lock_count,
       fname, line);
 #endif
    if ((errstat=rwl_writelock(&lock)) != 0) {
@@ -557,8 +557,8 @@ void unlock_jcr_chain()
 #endif
 {
    int errstat;
-#ifdef TRACE_JCR_CHAIN 
-   Dmsg3(400, "Unlock jcr chain %d from %s:%d\n", lock_count--,
+#ifdef TRACE_JCR_CHAIN
+   Dmsg3(3400, "Unlock jcr chain %d from %s:%d\n", lock_count--,
       fname, line);
 #endif
    if ((errstat=rwl_writeunlock(&lock)) != 0) {
@@ -581,7 +581,7 @@ JCR *get_next_jcr(JCR *prev_jcr)
       P(jcr->mutex);
       jcr->use_count++;
       V(jcr->mutex);
-      Dmsg2(400, "Inc get_next_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+      Dmsg2(3400, "Inc get_next_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
    }
    return jcr;
 }
@@ -606,9 +606,9 @@ static void jcr_timeout_check(watchdog_t *self)
    BSOCK *fd;
    time_t timer_start;
 
-   Dmsg0(400, "Start JCR timeout checks\n");
+   Dmsg0(3400, "Start JCR timeout checks\n");
 
-   /* Walk through all JCRs checking if any one is 
+   /* Walk through all JCRs checking if any one is
     * blocked for more than specified max time.
     */
    lock_jcr_chain();
@@ -657,7 +657,7 @@ static void jcr_timeout_check(watchdog_t *self)
    }
    unlock_jcr_chain();
 
-   Dmsg0(400, "Finished JCR timeout checks\n");
+   Dmsg0(3400, "Finished JCR timeout checks\n");
 }
 
 /*
index b3445d7f4ed20cce60c715c68e1474b0c10b7de8..c73016e138854b5052698daa83a16d9f0a84e7f3 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -43,8 +43,8 @@ void scan_to_eol(LEX *lc)
    Dmsg0(2000, "start scan to eof\n");
    while ((token = lex_get_token(lc, T_ALL)) != T_EOL) {
       if (token == T_EOB) {
-        lex_unget_char(lc);
-        return;
+         lex_unget_char(lc);
+         return;
       }
    }
 }
@@ -61,9 +61,9 @@ int scan_to_next_not_eol(LEX * lc)
    return token;
 }
 
-   
+
 /*
- * Format a scanner error message 
+ * Format a scanner error message
  */
 static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
 {
@@ -74,15 +74,15 @@ static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
    va_start(arg_ptr, msg);
    bvsnprintf(buf, sizeof(buf), msg, arg_ptr);
    va_end(arg_ptr);
-     
+
    if (lc->line_no > lc->begin_line_no) {
-      bsnprintf(more, sizeof(more), 
+      bsnprintf(more, sizeof(more),
                 _("Problem probably begins at line %d.\n"), lc->begin_line_no);
    } else {
       more[0] = 0;
    }
-   e_msg(file, line, M_ERROR_TERM, 0, _("Config error: %s\n\
-            : line %d, col %d of file %s\n%s\n%s"),
+   e_msg(file, line, M_ERROR_TERM, 0, _("Config error: %s\n"
+"            : line %d, col %d of file %s\n%s\n%s"),
       buf, lc->line_no, lc->col_no, lc->fname, lc->line, more);
 }
 
@@ -115,7 +115,7 @@ LEX *lex_close_file(LEX *lf)
    return lf;
 }
 
-/*     
+/*
  * Open a new configuration file. We push the
  * state of the current file (lf) so that we
  * can do includes.  This is a bit of a hammer.
@@ -126,29 +126,29 @@ LEX *lex_close_file(LEX *lf)
  * the next field.
  *
  */
-LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error) 
-             
+LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error)
+
 {
    LEX *nf;
    FILE *fd;
    char *fname = bstrdup(filename);
 
-   
+
    if ((fd = fopen(fname, "r")) == NULL) {
       berrno be;
-      Emsg2(M_ERROR_TERM, 0, _("Cannot open config file %s: %s\n"), 
-           fname, be.strerror());
+      Emsg2(M_ERROR_TERM, 0, _("Cannot open config file %s: %s\n"),
+            fname, be.strerror());
       return NULL; /* Never reached if exit_on_error == 1 */
    }
    Dmsg1(2000, "Open config file: %s\n", fname);
    nf = (LEX *)malloc(sizeof(LEX));
-   if (lf) {    
+   if (lf) {
       memcpy(nf, lf, sizeof(LEX));
       memset(lf, 0, sizeof(LEX));
-      lf->next = nf;                 /* if have lf, push it behind new one */
+      lf->next = nf;                  /* if have lf, push it behind new one */
       lf->options = nf->options;      /* preserve user options */
    } else {
-      lf = nf;                       /* start new packet */
+      lf = nf;                        /* start new packet */
       memset(lf, 0, sizeof(LEX));
    }
    lf->fd = fd;
@@ -164,7 +164,7 @@ LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error)
    return lf;
 }
 
-/*    
+/*
  * Get the next character from the input.
  *  Returns the character or
  *    L_EOF if end of file
@@ -177,11 +177,11 @@ int lex_get_char(LEX *lf)
    }
    if (lf->ch == L_EOL) {
       if (bfgets(lf->line, MAXSTRING, lf->fd) == NULL) {
-        lf->ch = L_EOF;
-        if (lf->next) {
-           lex_close_file(lf);
-        }
-        return lf->ch;
+         lf->ch = L_EOF;
+         if (lf->next) {
+            lex_close_file(lf);
+         }
+         return lf->ch;
       }
       lf->line_no++;
       lf->col_no = 0;
@@ -198,7 +198,7 @@ int lex_get_char(LEX *lf)
 
 void lex_unget_char(LEX *lf)
 {
-   lf->col_no--;      
+   lf->col_no--;
    if (lf->ch == L_EOL)
       lf->ch = 0;
 }
@@ -211,8 +211,8 @@ static void add_str(LEX *lf, int ch)
 {
    if (lf->str_len >= MAXSTRING-3) {
       Emsg3(M_ERROR_TERM, 0, _(
-           _("Config token too long, file: %s, line %d, begins at line %d\n")), 
-            lf->fname, lf->line_no, lf->begin_line_no);
+           _("Config token too long, file: %s, line %d, begins at line %d\n")),
+             lf->fname, lf->line_no, lf->begin_line_no);
    }
    lf->str[lf->str_len++] = ch;
    lf->str[lf->str_len] = 0;
@@ -221,7 +221,7 @@ static void add_str(LEX *lf, int ch)
 /*
  * Begin the string
  */
-static void begin_str(LEX *lf, int ch) 
+static void begin_str(LEX *lf, int ch)
 {
    lf->str_len = 0;
    lf->str[0] = 0;
@@ -284,14 +284,14 @@ static uint32_t scan_pint(LEX *lf, char *str)
       val = str_to_int64(str);
       if (errno != 0 || val < 0) {
          scan_err1(lf, _("expected a postive integer number, got: %s"), str);
-        /* NOT REACHED */
+         /* NOT REACHED */
       }
    }
    return (uint32_t)val;
 }
 
-/*       
- * 
+/*
+ *
  * Get the next token from the input
  *
  */
@@ -308,199 +308,204 @@ lex_get_token(LEX *lf, int expect)
       switch (lf->state) {
       case lex_none:
          Dmsg2(2000, "Lex state lex_none ch=%d,%x\n", ch, ch);
-        if (B_ISSPACE(ch))  
-           break;
-        if (B_ISALPHA(ch)) {
-           if (lf->options & LOPT_NO_IDENT)
-              lf->state = lex_string;
-           else
-              lf->state = lex_identifier;
-           begin_str(lf, ch);
-           break;
-        }
-        if (B_ISDIGIT(ch)) {
-           lf->state = lex_number;
-           begin_str(lf, ch);
-           break;
-        }
+         if (B_ISSPACE(ch))
+            break;
+         if (B_ISALPHA(ch)) {
+            if (lf->options & LOPT_NO_IDENT || lf->options & LOPT_STRING) {
+               lf->state = lex_string;
+            } else {
+               lf->state = lex_identifier;
+            }
+            begin_str(lf, ch);
+            break;
+         }
+         if (B_ISDIGIT(ch)) {
+            if (lf->options & LOPT_STRING) {
+               lf->state = lex_string;
+            } else {
+               lf->state = lex_number;
+            }
+            begin_str(lf, ch);
+            break;
+         }
          Dmsg0(2000, "Enter lex_none switch\n");
-        switch (ch) {
-        case L_EOF:
-           token = T_EOF;
+         switch (ch) {
+         case L_EOF:
+            token = T_EOF;
             Dmsg0(2000, "got L_EOF set token=T_EOF\n");
-           break;
+            break;
          case '#':
-           lf->state = lex_comment;
-           break;
+            lf->state = lex_comment;
+            break;
          case '{':
-           token = T_BOB;
-           begin_str(lf, ch);
-           break;
+            token = T_BOB;
+            begin_str(lf, ch);
+            break;
          case '}':
-           token = T_EOB;
-           begin_str(lf, ch);
-           break;
+            token = T_EOB;
+            begin_str(lf, ch);
+            break;
          case '"':
-           lf->state = lex_quoted_string;
-           begin_str(lf, 0);
-           break;
-         case '=': 
-           token = T_EQUALS;
-           begin_str(lf, ch);
-           break;
+            lf->state = lex_quoted_string;
+            begin_str(lf, 0);
+            break;
+         case '=':
+            token = T_EQUALS;
+            begin_str(lf, ch);
+            break;
          case ',':
-           token = T_COMMA;
-           begin_str(lf, ch);
-           break;
+            token = T_COMMA;
+            begin_str(lf, ch);
+            break;
          case ';':
-           if (expect != T_SKIP_EOL) {
-              token = T_EOL;      /* treat ; like EOL */
-           }
-           break;
-        case L_EOL:
+            if (expect != T_SKIP_EOL) {
+               token = T_EOL;      /* treat ; like EOL */
+            }
+            break;
+         case L_EOL:
             Dmsg0(2000, "got L_EOL set token=T_EOL\n");
-           if (expect != T_SKIP_EOL) {
-              token = T_EOL;
-           }
-           break;
+            if (expect != T_SKIP_EOL) {
+               token = T_EOL;
+            }
+            break;
          case '@':
-           lf->state = lex_include;
-           begin_str(lf, 0);
-           break;
-        default:
-           lf->state = lex_string;
-           begin_str(lf, ch);
-           break;
-        }
-        break;
+            lf->state = lex_include;
+            begin_str(lf, 0);
+            break;
+         default:
+            lf->state = lex_string;
+            begin_str(lf, ch);
+            break;
+         }
+         break;
       case lex_comment:
          Dmsg1(2000, "Lex state lex_comment ch=%x\n", ch);
-        if (ch == L_EOL) {
-           lf->state = lex_none;
-           if (expect != T_SKIP_EOL) {
-              token = T_EOL;
-           }
-        } else if (ch == L_EOF) {
-           token = T_ERROR;
-        }
-        break;
+         if (ch == L_EOL) {
+            lf->state = lex_none;
+            if (expect != T_SKIP_EOL) {
+               token = T_EOL;
+            }
+         } else if (ch == L_EOF) {
+            token = T_ERROR;
+         }
+         break;
       case lex_number:
          Dmsg2(2000, "Lex state lex_number ch=%x %c\n", ch, ch);
-        if (ch == L_EOF) {
-           token = T_ERROR;
-           break;
-        }
-        /* Might want to allow trailing specifications here */
-        if (B_ISDIGIT(ch)) {
-           add_str(lf, ch);
-           break;
-        }
-
-        /* A valid number can be terminated by the following */
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
+         /* Might want to allow trailing specifications here */
+         if (B_ISDIGIT(ch)) {
+            add_str(lf, ch);
+            break;
+         }
+
+         /* A valid number can be terminated by the following */
          if (B_ISSPACE(ch) || ch == L_EOL || ch == ',' || ch == ';') {
-           token = T_NUMBER;
-           lf->state = lex_none;
-        } else {
-           lf->state = lex_string;
-        }
-        lex_unget_char(lf);
-        break;
+            token = T_NUMBER;
+            lf->state = lex_none;
+         } else {
+            lf->state = lex_string;
+         }
+         lex_unget_char(lf);
+         break;
       case lex_ip_addr:
-        if (ch == L_EOF) {
-           token = T_ERROR;
-           break;
-        }
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
          Dmsg1(2000, "Lex state lex_ip_addr ch=%x\n", ch);
-        break;
+         break;
       case lex_string:
          Dmsg1(2000, "Lex state lex_string ch=%x\n", ch);
-        if (ch == L_EOF) {
-           token = T_ERROR;
-           break;
-        }
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
          if (ch == '\n' || ch == L_EOL || ch == '=' || ch == '}' || ch == '{' ||
              ch == '\r' || ch == ';' || ch == ',' || ch == '#' || (B_ISSPACE(ch)) ) {
-           lex_unget_char(lf);    
-           token = T_UNQUOTED_STRING;
-           lf->state = lex_none;
-           break;
-        } 
-        add_str(lf, ch);
-        break;
+            lex_unget_char(lf);
+            token = T_UNQUOTED_STRING;
+            lf->state = lex_none;
+            break;
+         }
+         add_str(lf, ch);
+         break;
       case lex_identifier:
          Dmsg2(2000, "Lex state lex_identifier ch=%x %c\n", ch, ch);
-        if (B_ISALPHA(ch)) {
-           add_str(lf, ch);
-           break;
-        } else if (B_ISSPACE(ch)) {
-           break;
+         if (B_ISALPHA(ch)) {
+            add_str(lf, ch);
+            break;
+         } else if (B_ISSPACE(ch)) {
+            break;
          } else if (ch == '\n' || ch == L_EOL || ch == '=' || ch == '}' || ch == '{' ||
                     ch == '\r' || ch == ';' || ch == ','   || ch == '"' || ch == '#') {
-           lex_unget_char(lf);    
-           token = T_IDENTIFIER;
-           lf->state = lex_none;
-           break;
-        } else if (ch == L_EOF) {
-           token = T_ERROR;
-           lf->state = lex_none;
-           begin_str(lf, ch);
-           break;
-        }
-        /* Some non-alpha character => string */
-        lf->state = lex_string;
-        add_str(lf, ch);
-        break;
+            lex_unget_char(lf);
+            token = T_IDENTIFIER;
+            lf->state = lex_none;
+            break;
+         } else if (ch == L_EOF) {
+            token = T_ERROR;
+            lf->state = lex_none;
+            begin_str(lf, ch);
+            break;
+         }
+         /* Some non-alpha character => string */
+         lf->state = lex_string;
+         add_str(lf, ch);
+         break;
       case lex_quoted_string:
          Dmsg2(2000, "Lex state lex_quoted_string ch=%x %c\n", ch, ch);
-        if (ch == L_EOF) {
-           token = T_ERROR;
-           break;
-        }
-        if (ch == L_EOL) {
-           esc_next = false;
-           break;
-        }
-        if (esc_next) {
-           add_str(lf, ch);
-           esc_next = false;
-           break;
-        }
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
+         if (ch == L_EOL) {
+            esc_next = false;
+            break;
+         }
+         if (esc_next) {
+            add_str(lf, ch);
+            esc_next = false;
+            break;
+         }
          if (ch == '\\') {
-           esc_next = true;
-           break;
-        }
+            esc_next = true;
+            break;
+         }
          if (ch == '"') {
-           token = T_QUOTED_STRING;
-           lf->state = lex_none;
-           break;
-        }
-        add_str(lf, ch);
-        break;
-      case lex_include:           /* scanning a filename */
-        if (ch == L_EOF) {
-           token = T_ERROR;
-           break;
-        }
+            token = T_QUOTED_STRING;
+            lf->state = lex_none;
+            break;
+         }
+         add_str(lf, ch);
+         break;
+      case lex_include:            /* scanning a filename */
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
          if (B_ISSPACE(ch) || ch == '\n' || ch == L_EOL || ch == '}' || ch == '{' ||
              ch == ';' || ch == ','   || ch == '"' || ch == '#') {
-           lf->state = lex_none;
-           lf = lex_open_file(lf, lf->str, NULL);
+            lf->state = lex_none;
+            lf = lex_open_file(lf, lf->str, NULL);
        if (lf == NULL) {
-        return T_ERROR;
+         return T_ERROR;
        }
-           break;
-        }
-        add_str(lf, ch);
-        break;
+            break;
+         }
+         add_str(lf, ch);
+         break;
       }
       Dmsg4(2000, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state),
-       lex_tok_to_str(token), ch);
+        lex_tok_to_str(token), ch);
    }
    Dmsg2(2000, "lex returning: line %d token: %s\n", lf->line_no, lex_tok_to_str(token));
    lf->token = token;
 
-   /* 
-    * Here is where we check to see if the user has set certain 
+   /*
+    * Here is where we check to see if the user has set certain
     *  expectations (e.g. 32 bit integer). If so, we do type checking
     *  and possible additional scanning (e.g. for range).
     */
@@ -513,87 +518,87 @@ lex_get_token(LEX *lf, int expect)
 
    case T_PINT32_RANGE:
       if (token == T_NUMBER) {
-        lf->pint32_val = scan_pint(lf, lf->str);
-        lf->pint32_val2 = lf->pint32_val;
-        token = T_PINT32;
+         lf->pint32_val = scan_pint(lf, lf->str);
+         lf->pint32_val2 = lf->pint32_val;
+         token = T_PINT32;
       } else {
          char *p = strchr(lf->str, '-');
-        if (!p) {
-            scan_err2(lf, _("expected an integer or a range, got %s: %s"), 
-              lex_tok_to_str(token), lf->str);
-           token = T_ERROR;
-           break;
-        }
-        *p++ = 0;                       /* terminate first half of range */
-        lf->pint32_val  = scan_pint(lf, lf->str);
-        lf->pint32_val2 = scan_pint(lf, p);
-        token = T_PINT32_RANGE;
+         if (!p) {
+            scan_err2(lf, _("expected an integer or a range, got %s: %s"),
+               lex_tok_to_str(token), lf->str);
+            token = T_ERROR;
+            break;
+         }
+         *p++ = 0;                       /* terminate first half of range */
+         lf->pint32_val  = scan_pint(lf, lf->str);
+         lf->pint32_val2 = scan_pint(lf, p);
+         token = T_PINT32_RANGE;
       }
       break;
 
    case T_INT32:
       if (token != T_NUMBER || !is_a_number(lf->str)) {
          scan_err2(lf, _("expected an integer number, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
-        break;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
+         break;
       }
       errno = 0;
       lf->int32_val = (int32_t)str_to_int64(lf->str);
       if (errno != 0) {
          scan_err2(lf, _("expected an integer number, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
       } else {
-        token = T_INT32;
+         token = T_INT32;
       }
       break;
 
    case T_INT64:
-      Dmsg2(2000, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL)); 
+      Dmsg2(2000, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL));
       if (token != T_NUMBER || !is_a_number(lf->str)) {
          scan_err2(lf, _("expected an integer number, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
-        break;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
+         break;
       }
       errno = 0;
       lf->int64_val = str_to_int64(lf->str);
       if (errno != 0) {
          scan_err2(lf, _("expected an integer number, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
       } else {
-        token = T_INT64;
+         token = T_INT64;
       }
       break;
 
    case T_NAME:
       if (token != T_IDENTIFIER && token != T_UNQUOTED_STRING && token != T_QUOTED_STRING) {
          scan_err2(lf, _("expected a name, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
       } else if (lf->str_len > MAX_RES_NAME_LENGTH) {
-         scan_err3(lf, _("name %s length %d too long, max is %d\n"), lf->str, 
-           lf->str_len, MAX_RES_NAME_LENGTH);
-        token = T_ERROR;
+         scan_err3(lf, _("name %s length %d too long, max is %d\n"), lf->str,
+            lf->str_len, MAX_RES_NAME_LENGTH);
+         token = T_ERROR;
       }
       break;
 
    case T_STRING:
       if (token != T_IDENTIFIER && token != T_UNQUOTED_STRING && token != T_QUOTED_STRING) {
          scan_err2(lf, _("expected a string, got %s: %s"),
-              lex_tok_to_str(token), lf->str);
-        token = T_ERROR;
+               lex_tok_to_str(token), lf->str);
+         token = T_ERROR;
       } else {
-        token = T_STRING;
+         token = T_STRING;
       }
       break;
 
 
    default:
-      break;                         /* no expectation given */
+      break;                          /* no expectation given */
    }
-   lf->token = token;                /* set possible new token */
+   lf->token = token;                 /* set possible new token */
    return token;
 }
index 49274ed93a0e01065700da2595f57b54aa936ca0..68113338fe7c6f3debcb5aae667bc9e0a96db190 100644 (file)
@@ -1,15 +1,15 @@
 /*
- *   lex.h  
+ *   lex.h
  *
  *    Lexical scanning of configuration files, used by parsers.
  *
- *   Kern Sibbald, MM  
+ *   Kern Sibbald, MM
  *
  *   Version $Id$
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -36,7 +36,7 @@
 #define L_EOL                         (-2)
 
 /* Internal tokens */
-#define T_NONE                        100                              
+#define T_NONE                        100
 
 /* Tokens returned by get_token() */
 #define T_EOF                         101
@@ -53,7 +53,7 @@
 #define T_ERROR                       200
 /*
  * The following will be returned only if
- * the appropriate expect flag has been set   
+ * the appropriate expect flag has been set
  */
 #define T_SKIP_EOL                    113  /* scan through EOLs */
 #define T_PINT32                      114  /* positive integer */
@@ -79,6 +79,7 @@ enum lex_state {
 
 /* Lex scan options */
 #define LOPT_NO_IDENT            0x1  /* No Identifiers -- use string */
+#define LOPT_STRING              0x2  /* Force scan for string */
 
 /* Lexical context */
 typedef struct s_lex_context {
index 0a2624243c2afc1c804cd7b87cf39426f1b1a80d..a62b6c50c6481f0d1ebe4fd3754fccd0a9656b9b 100644 (file)
@@ -1,10 +1,10 @@
 /*
- *  Bacula memory pool routines. 
+ *  Bacula memory pool routines.
  *
  *  The idea behind these routines is that there will be
  *  pools of memory that are pre-allocated for quick
  *  access. The pools will have a fixed memory size on allocation
- *  but if need be, the size can be increased. This is 
+ *  but if need be, the size can be increased. This is
  *  particularly useful for filename
  *  buffers where 256 bytes should be sufficient in 99.99%
  *  of the cases, but when it isn't we want to be able to
  *  there is enough memory, simply call the check_pool_memory_size()
  *  with the desired size and it will adjust only if necessary.
  *
- *           Kern E. Sibbald
+ *          Kern E. Sibbald
  *
  *   Version $Id$
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 #include "bacula.h"
 
 struct s_pool_ctl {
-   int32_t size;                      /* default size */
-   int32_t max_allocated;             /* max allocated */
-   int32_t max_used;                  /* max buffers used */
-   int32_t in_use;                    /* number in use */
-   struct abufhead *free_buf;         /* pointer to free buffers */
+   int32_t size;                     /* default size */
+   int32_t max_allocated;            /* max allocated */
+   int32_t max_used;                 /* max buffers used */
+   int32_t in_use;                   /* number in use */
+   struct abufhead *free_buf;        /* pointer to free buffers */
 };
 
 /* Bacula Name length plus extra */
@@ -59,30 +59,30 @@ struct s_pool_ctl {
  * Define default Pool buffer sizes
  */
 static struct s_pool_ctl pool_ctl[] = {
-   {  256,  256, 0, 0, NULL },        /* PM_NOPOOL no pooling */
-   {  NLEN, NLEN,0, 0, NULL },        /* PM_NAME Bacula name */
-   {  256,  256, 0, 0, NULL },        /* PM_FNAME filename buffers */
-   {  512,  512, 0, 0, NULL },        /* PM_MESSAGE message buffer */
-   { 1024, 1024, 0, 0, NULL }         /* PM_EMSG error message buffer */
+   {  256,  256, 0, 0, NULL },       /* PM_NOPOOL no pooling */
+   {  NLEN, NLEN,0, 0, NULL },       /* PM_NAME Bacula name */
+   {  256,  256, 0, 0, NULL },       /* PM_FNAME filename buffers */
+   {  512,  512, 0, 0, NULL },       /* PM_MESSAGE message buffer */
+   { 1024, 1024, 0, 0, NULL }        /* PM_EMSG error message buffer */
 };
 #else
 
 /* This is used ONLY when stress testing the code */
 static struct s_pool_ctl pool_ctl[] = {
-   {   20,   20, 0, 0, NULL },        /* PM_NOPOOL no pooling */
-   {  NLEN, NLEN,0, 0, NULL },        /* PM_NAME Bacula name */
-   {   20,   20, 0, 0, NULL },        /* PM_FNAME filename buffers */
-   {   20,   20, 0, 0, NULL },        /* PM_MESSAGE message buffer */
-   {   20,   20, 0, 0, NULL }         /* PM_EMSG error message buffer */
+   {   20,   20, 0, 0, NULL },       /* PM_NOPOOL no pooling */
+   {  NLEN, NLEN,0, 0, NULL },       /* PM_NAME Bacula name */
+   {   20,   20, 0, 0, NULL },       /* PM_FNAME filename buffers */
+   {   20,   20, 0, 0, NULL },       /* PM_MESSAGE message buffer */
+   {   20,   20, 0, 0, NULL }        /* PM_EMSG error message buffer */
 };
 #endif
 
 
 /*  Memory allocation control structures and storage.  */
 struct abufhead {
-   int32_t ablen;                     /* Buffer length in bytes */
-   int32_t pool;                      /* pool */
-   struct abufhead *next;             /* pointer to next free buffer */
+   int32_t ablen;                    /* Buffer length in bytes */
+   int32_t pool;                     /* pool */
+   struct abufhead *next;            /* pointer to next free buffer */
 };
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -105,14 +105,14 @@ POOLMEM *sm_get_pool_memory(const char *fname, int lineno, int pool)
       pool_ctl[pool].free_buf = buf->next;
       pool_ctl[pool].in_use++;
       if (pool_ctl[pool].in_use > pool_ctl[pool].max_used) {
-         pool_ctl[pool].max_used = pool_ctl[pool].in_use;
+        pool_ctl[pool].max_used = pool_ctl[pool].in_use;
       }
       V(mutex);
-      Dmsg3(300, "sm_get_pool_memory reuse %x to %s:%d\n", buf, fname, lineno);
+      Dmsg3(800, "sm_get_pool_memory reuse %x to %s:%d\n", buf, fname, lineno);
       sm_new_owner(fname, lineno, (char *)buf);
       return (POOLMEM *)((char *)buf+HEAD_SIZE);
    }
-      
+
    if ((buf = (struct abufhead *)sm_malloc(fname, lineno, pool_ctl[pool].size+HEAD_SIZE)) == NULL) {
       V(mutex);
       Emsg1(M_ABORT, 0, "Out of memory requesting %d bytes\n", pool_ctl[pool].size);
@@ -124,7 +124,7 @@ POOLMEM *sm_get_pool_memory(const char *fname, int lineno, int pool)
       pool_ctl[pool].max_used = pool_ctl[pool].in_use;
    }
    V(mutex);
-   Dmsg3(300, "sm_get_pool_memory give %x to %s:%d\n", buf, fname, lineno);
+   Dmsg3(800, "sm_get_pool_memory give %x to %s:%d\n", buf, fname, lineno);
    return (POOLMEM *)((char *)buf+HEAD_SIZE);
 }
 
@@ -202,30 +202,30 @@ void sm_free_pool_memory(const char *fname, int lineno, POOLMEM *obuf)
    pool = buf->pool;
    pool_ctl[pool].in_use--;
    if (pool == 0) {
-      free((char *)buf);              /* free nonpooled memory */
-   } else {                           /* otherwise link it to the free pool chain */
+      free((char *)buf);             /* free nonpooled memory */
+   } else {                          /* otherwise link it to the free pool chain */
 #ifdef DEBUG
       struct abufhead *next;
       /* Don't let him free the same buffer twice */
       for (next=pool_ctl[pool].free_buf; next; next=next->next) {
-         if (next == buf) {
-            Dmsg4(300, "bad free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
-            V(mutex);                 /* unblock the pool */
-            ASSERT(next != buf);      /* attempt to free twice */
-         }
+        if (next == buf) {
+            Dmsg4(800, "bad free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
+           V(mutex);                 /* unblock the pool */
+           ASSERT(next != buf);      /* attempt to free twice */
+        }
       }
 #endif
       buf->next = pool_ctl[pool].free_buf;
       pool_ctl[pool].free_buf = buf;
    }
-   Dmsg4(300, "free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
+   Dmsg4(800, "free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
    V(mutex);
 }
 
 
 #else
 
-/* =========  NO SMARTALLOC  =========================================  */
+/* =========  NO SMARTALLOC  ========================================= */
 
 POOLMEM *get_pool_memory(int pool)
 {
@@ -238,7 +238,7 @@ POOLMEM *get_pool_memory(int pool)
       V(mutex);
       return (POOLMEM *)((char *)buf+HEAD_SIZE);
    }
-      
+
    if ((buf=malloc(pool_ctl[pool].size+HEAD_SIZE)) == NULL) {
       V(mutex);
       Emsg1(M_ABORT, 0, "Out of memory requesting %d bytes\n", pool_ctl[pool].size);
@@ -332,22 +332,22 @@ void free_pool_memory(POOLMEM *obuf)
    pool = buf->pool;
    pool_ctl[pool].in_use--;
    if (pool == 0) {
-      free((char *)buf);              /* free nonpooled memory */
-   } else {                           /* otherwise link it to the free pool chain */
+      free((char *)buf);             /* free nonpooled memory */
+   } else {                          /* otherwise link it to the free pool chain */
 #ifdef DEBUG
       struct abufhead *next;
       /* Don't let him free the same buffer twice */
       for (next=pool_ctl[pool].free_buf; next; next=next->next) {
-         if (next == buf) {
-            V(mutex);
-            ASSERT(next != buf);  /* attempt to free twice */
-         }
+        if (next == buf) {
+           V(mutex);
+           ASSERT(next != buf);  /* attempt to free twice */
+        }
       }
 #endif
       buf->next = pool_ctl[pool].free_buf;
       pool_ctl[pool].free_buf = buf;
    }
-   Dmsg2(300, "free_pool_memory %x pool=%d\n", buf, pool);
+   Dmsg2(800, "free_pool_memory %x pool=%d\n", buf, pool);
    V(mutex);
 }
 
@@ -368,9 +368,9 @@ void close_memory_pool()
    for (int i=1; i<=PM_MAX; i++) {
       buf = pool_ctl[i].free_buf;
       while (buf) {
-         next = buf->next;
-         free((char *)buf);
-         buf = next;
+        next = buf->next;
+        free((char *)buf);
+        buf = next;
       }
       pool_ctl[i].free_buf = NULL;
    }
@@ -390,21 +390,21 @@ static const char *pool_name(int pool)
    sprintf(buf, "%-6d", pool);
    return buf;
 }
-   
-/* Print staticstics on memory pool usage   
- */ 
+
+/* Print staticstics on memory pool usage
+ */
 void print_memory_pool_stats()
 {
    Dmsg0(-1, "Pool   Maxsize  Maxused  Inuse\n");
    for (int i=0; i<=PM_MAX; i++)
       Dmsg4(-1, "%5s  %7d  %7d  %5d\n", pool_name(i), pool_ctl[i].max_allocated,
-         pool_ctl[i].max_used, pool_ctl[i].in_use);
+        pool_ctl[i].max_used, pool_ctl[i].in_use);
 
    Dmsg0(-1, "\n");
 }
 
 #else
-void print_memory_pool_stats() {} 
+void print_memory_pool_stats() {}
 #endif /* DEBUG */
 
 
@@ -487,7 +487,7 @@ int pm_strcpy(POOLMEM *&pm, POOL_MEM &str)
 
 
 int pm_strcpy(POOL_MEM &pm, const char *str)
-{  
+{
    int len = strlen(str) + 1;
    pm.check_size(len);
    memcpy(pm.c_str(), str, len);
@@ -543,7 +543,7 @@ int POOL_MEM::strcat(const char *str)
 
 
 int POOL_MEM::strcpy(const char *str)
-{  
+{
    int len = strlen(str) + 1;
    check_size(len);
    memcpy(mem, str, len);
index 0edf834f3a28dd3ae1be4b5ff80a6de06e712f0b..d86280278cfbd0f9cdefb03eb5bea9f62fe6e23f 100755 (executable)
@@ -1,7 +1,7 @@
 /*
  * Bacula message handling routines
  *
- *   Kern Sibbald, April 2000 
+ *   Kern Sibbald, April 2000
  *
  *   Version $Id$
  *
@@ -39,7 +39,7 @@
 
 #define FULL_LOCATION 1              /* set for file:line in Debug messages */
 
-/* 
+/*
  *  This is where we define "Globals" because all the
  *    daemons include this file.
  */
@@ -61,7 +61,7 @@ char catalog_db[] = "PostgreSQL";
 #else
 #ifdef HAVE_MYSQL
 char catalog_db[] = "MySQL";
-#else 
+#else
 #ifdef HAVE_SQLITE
 char catalog_db[] = "SQLite";
 #else
@@ -94,7 +94,7 @@ static MSGS *daemon_msgs;            /* global messages */
 /* Define if e_msg must exit when M_ERROR_TERM is received */
 static int exit_on_error = 1;
 
-/* 
+/*
  * Set daemon name. Also, find canonical execution
  *  path.  Note, exepath has spare room for tacking on
  *  the exename so that we can reconstruct the full name.
@@ -156,11 +156,11 @@ void my_name_is(int argc, char *argv[], const char *name)
    }
 }
 
-/* 
+/*
  * Initialize message handler for a daemon or a Job
  *   We make a copy of the MSGS resource passed, so it belows
  *   to the job or daemon and thus can be modified.
- * 
+ *
  *   NULL for jcr -> initialize global messages for daemon
  *   non-NULL    -> initialize jcr using Message resource
  */
@@ -273,12 +273,12 @@ void init_console_msg(const char *wd)
    }
    if (rwl_init(&con_lock) != 0) {
       berrno be;
-      Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"), 
+      Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"),
         be.strerror());
    }
 }
 
-/* 
+/*
  * Called only during parsing of the config file.
  *
  * Add a message destination. I.e. associate a message type with
@@ -289,15 +289,15 @@ void init_console_msg(const char *wd)
  */
 void add_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where, char *mail_cmd)
 {
-   DEST *d; 
+   DEST *d;
    /*
     * First search the existing chain and see if we
     * can simply add this msg_type to an existing entry.
     */
    for (d=msg->dest_chain; d; d=d->next) {
       if (dest_code == d->dest_code && ((where == NULL && d->where == NULL) ||
-                    (strcmp(where, d->where) == 0))) {  
-         Dmsg4(200, "Add to existing d=%x msgtype=%d destcode=%d where=%s\n", 
+                    (strcmp(where, d->where) == 0))) {
+         Dmsg4(850, "Add to existing d=%x msgtype=%d destcode=%d where=%s\n",
             d, msg_type, dest_code, NPRT(where));
         set_bit(msg_type, d->msg_types);
         set_bit(msg_type, msg->send_msg);  /* set msg_type bit in our local */
@@ -317,29 +317,29 @@ void add_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where, char *mai
    if (mail_cmd) {
       d->mail_cmd = bstrdup(mail_cmd);
    }
-   Dmsg5(200, "add new d=%x msgtype=%d destcode=%d where=%s mailcmd=%s\n", 
+   Dmsg5(850, "add new d=%x msgtype=%d destcode=%d where=%s mailcmd=%s\n",
          d, msg_type, dest_code, NPRT(where), NPRT(d->mail_cmd));
    msg->dest_chain = d;
 }
 
-/* 
+/*
  * Called only during parsing of the config file.
  *
- * Remove a message destination   
+ * Remove a message destination
  */
 void rem_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where)
 {
    DEST *d;
 
    for (d=msg->dest_chain; d; d=d->next) {
-      Dmsg2(200, "Remove_msg_dest d=%x where=%s\n", d, NPRT(d->where));
+      Dmsg2(850, "Remove_msg_dest d=%x where=%s\n", d, NPRT(d->where));
       if (bit_is_set(msg_type, d->msg_types) && (dest_code == d->dest_code) &&
          ((where == NULL && d->where == NULL) ||
-                    (strcmp(where, d->where) == 0))) {  
-         Dmsg3(200, "Found for remove d=%x msgtype=%d destcode=%d\n", 
+                    (strcmp(where, d->where) == 0))) {
+         Dmsg3(850, "Found for remove d=%x msgtype=%d destcode=%d\n",
               d, msg_type, dest_code);
         clear_bit(msg_type, d->msg_types);
-         Dmsg0(200, "Return rem_msg_dest\n");
+         Dmsg0(850, "Return rem_msg_dest\n");
         return;
       }
    }
@@ -358,7 +358,7 @@ static void make_unique_mail_filename(JCR *jcr, POOLMEM *&name, DEST *d)
       Mmsg(name, "%s/%s.mail.%s.%d", working_directory, my_name,
                 my_name, (int)(long)d);
    }
-   Dmsg1(200, "mailname=%s\n", name);
+   Dmsg1(850, "mailname=%s\n", name);
 }
 
 /*
@@ -367,7 +367,7 @@ static void make_unique_mail_filename(JCR *jcr, POOLMEM *&name, DEST *d)
 static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
 {
    BPIPE *bpipe;
-       
+
    if (d->mail_cmd) {
       cmd = edit_job_codes(jcr, cmd, d->mail_cmd, d->where);
    } else {
@@ -377,7 +377,7 @@ static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
 
    if (!(bpipe = open_bpipe(cmd, 120, "rw"))) {
       berrno be;
-      Jmsg(jcr, M_ERROR, 0, "open mail pipe %s failed: ERR=%s\n", 
+      Jmsg(jcr, M_ERROR, 0, "open mail pipe %s failed: ERR=%s\n",
         cmd, be.strerror());
    }
 
@@ -385,11 +385,11 @@ static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
    if (!d->mail_cmd) {
        fprintf(bpipe->wfd, "Subject: Bacula Message\r\n\r\n");
    }
-   
+
    return bpipe;
 }
 
-/* 
+/*
  * Close the messages for this Messages resource, which means to close
  *  any open files, and dispatch any pending email messages.
  */
@@ -400,8 +400,8 @@ void close_msg(JCR *jcr)
    BPIPE *bpipe;
    POOLMEM *cmd, *line;
    int len, stat;
-   
-   Dmsg1(350, "Close_msg jcr=0x%x\n", jcr);
+
+   Dmsg1(850, "Close_msg jcr=0x%x\n", jcr);
 
    if (jcr == NULL) {               /* NULL -> global chain */
       msgs = daemon_msgs;
@@ -413,7 +413,7 @@ void close_msg(JCR *jcr)
    if (msgs == NULL) {
       return;
    }
-   Dmsg1(350, "===Begin close msg resource at 0x%x\n", msgs);
+   Dmsg1(850, "===Begin close msg resource at 0x%x\n", msgs);
    cmd = get_pool_memory(PM_MESSAGE);
    for (d=msgs->dest_chain; d; ) {
       if (d->fd) {
@@ -426,7 +426,7 @@ void close_msg(JCR *jcr)
            break;
         case MD_MAIL:
         case MD_MAIL_ON_ERROR:
-            Dmsg0(350, "Got MD_MAIL or MD_MAIL_ON_ERROR\n");
+            Dmsg0(850, "Got MD_MAIL or MD_MAIL_ON_ERROR\n");
            if (!d->fd) {
               break;
            }
@@ -434,12 +434,12 @@ void close_msg(JCR *jcr)
                jcr->JobStatus == JS_Terminated) {
               goto rem_temp_file;
            }
-           
+
            if (!(bpipe=open_mail_pipe(jcr, cmd, d))) {
                Pmsg0(000, "open mail pipe failed.\n");
               goto rem_temp_file;
            }
-            Dmsg0(350, "Opened mail pipe\n");
+            Dmsg0(850, "Opened mail pipe\n");
            len = d->max_len+10;
            line = get_memory(len);
            rewind(d->fd);
@@ -467,7 +467,7 @@ void close_msg(JCR *jcr)
            if (stat != 0 && msgs != daemon_msgs) {
               berrno be;
               be.set_errno(stat);
-               Dmsg1(350, "Calling emsg. CMD=%s\n", cmd);
+               Dmsg1(850, "Calling emsg. CMD=%s\n", cmd);
                Jmsg2(jcr, M_ERROR, 0, _("Mail program terminated in error.\n"
                                         "CMD=%s\n"
                                         "ERR=%s\n"), cmd, be.strerror());
@@ -479,7 +479,7 @@ rem_temp_file:
            unlink(d->mail_filename);
            free_pool_memory(d->mail_filename);
            d->mail_filename = NULL;
-            Dmsg0(350, "end mail or mail on error\n");
+            Dmsg0(850, "end mail or mail on error\n");
            break;
         default:
            break;
@@ -489,18 +489,18 @@ rem_temp_file:
       d = d->next;                   /* point to next buffer */
    }
    free_pool_memory(cmd);
-   Dmsg0(350, "Done walking message chain.\n");
+   Dmsg0(850, "Done walking message chain.\n");
    if (jcr) {
       free_msgs_res(msgs);
       msgs = NULL;
    } else {
       V(mutex);
    }
-   Dmsg0(350, "===End close msg resource\n");
+   Dmsg0(850, "===End close msg resource\n");
 }
 
 /*
- * Free memory associated with Messages resource  
+ * Free memory associated with Messages resource
  */
 void free_msgs_res(MSGS *msgs)
 {
@@ -523,16 +523,16 @@ void free_msgs_res(MSGS *msgs)
 }
 
 
-/* 
- * Terminate the message handler for good. 
+/*
+ * Terminate the message handler for good.
  * Release the global destination chain.
- * 
+ *
  * Also, clean up a few other items (cons, exepath). Note,
  *   these really should be done elsewhere.
  */
 void term_msg()
 {
-   Dmsg0(300, "Enter term_msg\n");
+   Dmsg0(850, "Enter term_msg\n");
    close_msg(NULL);                  /* close global chain */
    free_msgs_res(daemon_msgs);       /* free the resources */
    daemon_msgs = NULL;
@@ -563,14 +563,14 @@ void term_msg()
  */
 void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
 {
-    DEST *d;   
+    DEST *d;
     char dt[MAX_TIME_LENGTH];
     POOLMEM *mcmd;
     int len, dtlen;
     MSGS *msgs;
     BPIPE *bpipe;
 
-    Dmsg2(800, "Enter dispatch_msg type=%d msg=%s\n", type, msg);
+    Dmsg2(850, "Enter dispatch_msg type=%d msg=%s\n", type, msg);
 
     /*
      * Most messages are prefixed by a date and time. If mtime is
@@ -580,7 +580,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
      */
     if (mtime == 0) {
        mtime = time(NULL);
-    } 
+    }
     if (mtime == 1) {
        *dt = 0;
        dtlen = 0;
@@ -611,7 +611,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
     msgs = NULL;
     if (jcr) {
        msgs = jcr->jcr_msgs;
-    } 
+    }
     if (msgs == NULL) {
        msgs = daemon_msgs;
     }
@@ -619,10 +619,10 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
        if (bit_is_set(type, d->msg_types)) {
          switch (d->dest_code) {
             case MD_CONSOLE:
-                Dmsg1(800, "CONSOLE for following msg: %s", msg);
+                Dmsg1(850, "CONSOLE for following msg: %s", msg);
                if (!con_fd) {
                    con_fd = fopen(con_fname, "a+");
-                   Dmsg0(800, "Console file not open.\n");
+                   Dmsg0(850, "Console file not open.\n");
                }
                if (con_fd) {
                   Pw(con_lock);      /* get write lock on console message file */
@@ -645,14 +645,14 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                }
                break;
             case MD_SYSLOG:
-                Dmsg1(800, "SYSLOG for collowing msg: %s\n", msg);
+                Dmsg1(850, "SYSLOG for collowing msg: %s\n", msg);
                /*
-                * We really should do an openlog() here.  
+                * We really should do an openlog() here.
                 */
                 syslog(LOG_DAEMON|LOG_ERR, "%s", msg);
                break;
             case MD_OPERATOR:
-                Dmsg1(800, "OPERATOR for following msg: %s\n", msg);
+                Dmsg1(850, "OPERATOR for following msg: %s\n", msg);
                mcmd = get_pool_memory(PM_MESSAGE);
                if ((bpipe=open_mail_pipe(jcr, mcmd, d))) {
                   int stat;
@@ -672,7 +672,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                break;
             case MD_MAIL:
             case MD_MAIL_ON_ERROR:
-                Dmsg1(800, "MAIL for following msg: %s", msg);
+                Dmsg1(850, "MAIL for following msg: %s", msg);
                if (!d->fd) {
                   POOLMEM *name = get_pool_memory(PM_MESSAGE);
                   make_unique_mail_filename(jcr, name, d);
@@ -680,7 +680,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                   if (!d->fd) {
                      berrno be;
                      d->fd = stdout;
-                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name, 
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name,
                            be.strerror());
                      d->fd = NULL;
                      free_pool_memory(name);
@@ -696,13 +696,13 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                fputs(msg, d->fd);
                break;
             case MD_FILE:
-                Dmsg1(800, "FILE for following msg: %s", msg);
+                Dmsg1(850, "FILE for following msg: %s", msg);
                if (!d->fd) {
                    d->fd = fopen(d->where, "w+");
                   if (!d->fd) {
                      berrno be;
                      d->fd = stdout;
-                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, 
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
                            be.strerror());
                      d->fd = NULL;
                      break;
@@ -712,13 +712,13 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                fputs(msg, d->fd);
                break;
             case MD_APPEND:
-                Dmsg1(800, "APPEND for following msg: %s", msg);
+                Dmsg1(850, "APPEND for following msg: %s", msg);
                if (!d->fd) {
                    d->fd = fopen(d->where, "a");
                   if (!d->fd) {
                      berrno be;
                      d->fd = stdout;
-                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, 
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
                            be.strerror());
                      d->fd = NULL;
                      break;
@@ -728,21 +728,21 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
                fputs(msg, d->fd);
                break;
             case MD_DIRECTOR:
-                Dmsg1(800, "DIRECTOR for following msg: %s", msg);
+                Dmsg1(850, "DIRECTOR for following msg: %s", msg);
                if (jcr && jcr->dir_bsock && !jcr->dir_bsock->errors) {
-                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s", 
+                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s",
                      jcr->Job, type, mtime, msg);
                }
                break;
             case MD_STDOUT:
-                Dmsg1(800, "STDOUT for following msg: %s", msg);
+                Dmsg1(850, "STDOUT for following msg: %s", msg);
                if (type != M_ABORT && type != M_ERROR_TERM) { /* already printed */
                   fputs(dt, stdout);
                   fputs(msg, stdout);
                }
                break;
             case MD_STDERR:
-                Dmsg1(800, "STDERR for following msg: %s", msg);
+                Dmsg1(850, "STDERR for following msg: %s", msg);
                fputs(dt, stderr);
                fputs(msg, stderr);
                break;
@@ -760,11 +760,11 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
  *  is less than or equal the debug_level. File and line numbers
  *  are included for more detail if desired, but not currently
  *  printed.
- *  
+ *
  *  If the level is negative, the details of file and line number
  *  are not printed.
  */
-void 
+void
 d_msg(const char *file, int line, int level, const char *fmt,...)
 {
     char      buf[5000];
@@ -796,7 +796,7 @@ d_msg(const char *file, int line, int level, const char *fmt,...)
        bvsnprintf(buf+len, sizeof(buf)-len, (char *)fmt, arg_ptr);
        va_end(arg_ptr);
 
-       /* 
+       /*
         * Used the "trace on" command in the console to turn on
         *  output to the trace file.  "trace off" will close the file.
        */
@@ -816,7 +816,7 @@ d_msg(const char *file, int line, int level, const char *fmt,...)
 }
 
 /*
- * Set trace flag on/off. If argument is negative, there is no change 
+ * Set trace flag on/off. If argument is negative, there is no change
  */
 void set_trace(int trace_flag)
 {
@@ -843,11 +843,11 @@ bool get_trace(void)
 /*********************************************************************
  *
  *  This subroutine prints a message regardless of the debug level
- *  
+ *
  *  If the level is negative, the details of file and line number
  *  are not printed.
  */
-void 
+void
 p_msg(const char *file, int line, int level, const char *fmt,...)
 {
     char      buf[5000];
@@ -876,11 +876,11 @@ p_msg(const char *file, int line, int level, const char *fmt,...)
  *  is less than or equal the debug_level. File and line numbers
  *  are included for more detail if desired, but not currently
  *  printed.
- *  
+ *
  *  If the level is negative, the details of file and line number
  *  are not printed.
  */
-void 
+void
 t_msg(const char *file, int line, int level, const char *fmt,...)
 {
     char      buf[5000];
@@ -898,7 +898,7 @@ t_msg(const char *file, int line, int level, const char *fmt,...)
           bsnprintf(buf, sizeof(buf), "%s/bacula.trace", working_directory);
           trace_fd = fopen(buf, "a+");
        }
-    
+
 #ifdef FULL_LOCATION
        if (details) {
           len = bsnprintf(buf, sizeof(buf), "%s: %s:%d ", my_name, file, line);
@@ -925,28 +925,28 @@ t_msg(const char *file, int line, int level, const char *fmt,...)
  * print an error message
  *
  */
-void 
+void
 e_msg(const char *file, int line, int type, int level, const char *fmt,...)
 {
     char     buf[5000];
     va_list   arg_ptr;
     int len;
 
-    /* 
-     * Check if we have a message destination defined. 
-     * We always report M_ABORT and M_ERROR_TERM 
+    /*
+     * Check if we have a message destination defined.
+     * We always report M_ABORT and M_ERROR_TERM
      */
-    if (!daemon_msgs || ((type != M_ABORT && type != M_ERROR_TERM) && 
+    if (!daemon_msgs || ((type != M_ABORT && type != M_ERROR_TERM) &&
                         !bit_is_set(type, daemon_msgs->send_msg))) {
        return;                       /* no destination */
     }
     switch (type) {
     case M_ABORT:
-       len = bsnprintf(buf, sizeof(buf), "%s: ABORTING due to ERROR in %s:%d\n", 
+       len = bsnprintf(buf, sizeof(buf), "%s: ABORTING due to ERROR in %s:%d\n",
               my_name, file, line);
        break;
     case M_ERROR_TERM:
-       len = bsnprintf(buf, sizeof(buf), "%s: ERROR TERMINATION at %s:%d\n", 
+       len = bsnprintf(buf, sizeof(buf), "%s: ERROR TERMINATION at %s:%d\n",
               my_name, file, line);
        break;
     case M_FATAL:
@@ -992,7 +992,7 @@ e_msg(const char *file, int line, int type, int level, const char *fmt,...)
  * Generate a Job message
  *
  */
-void 
+void
 Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
 {
     char     rbuf[5000];
@@ -1001,17 +1001,17 @@ Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
     MSGS *msgs;
     const char *job;
 
-    
-    Dmsg1(800, "Enter Jmsg type=%d\n", type);
+
+    Dmsg1(850, "Enter Jmsg type=%d\n", type);
 
     /* Special case for the console, which has a dir_bsock and JobId==0,
      * in that case, we send the message directly back to the
-     * dir_bsock.  
+     * dir_bsock.
      */
     if (jcr && jcr->JobId == 0 && jcr->dir_bsock) {
        BSOCK *dir = jcr->dir_bsock;
        va_start(arg_ptr, fmt);
-       dir->msglen = bvsnprintf(dir->msg, sizeof_pool_memory(dir->msg), 
+       dir->msglen = bvsnprintf(dir->msg, sizeof_pool_memory(dir->msg),
                                fmt, arg_ptr);
        va_end(arg_ptr);
        bnet_send(jcr->dir_bsock);
@@ -1023,7 +1023,7 @@ Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
     if (jcr) {
        msgs = jcr->jcr_msgs;
        job = jcr->Job;
-    } 
+    }
     if (!msgs) {
        msgs = daemon_msgs;           /* if no jcr, we use daemon handler */
     }
@@ -1031,9 +1031,9 @@ Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
        job = "";                      /* Set null job name if none */
     }
 
-    /* 
-     * Check if we have a message destination defined. 
-     * We always report M_ABORT and M_ERROR_TERM 
+    /*
+     * Check if we have a message destination defined.
+     * We always report M_ABORT and M_ERROR_TERM
      */
     if (msgs && (type != M_ABORT && type != M_ERROR_TERM) &&
         !bit_is_set(type, msgs->send_msg)) {
@@ -1098,7 +1098,7 @@ void j_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const c
    i = Mmsg(pool_buf, "%s:%d ", file, line);
 
    for (;;) {
-      maxlen = sizeof_pool_memory(pool_buf) - i - 1; 
+      maxlen = sizeof_pool_memory(pool_buf) - i - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1116,7 +1116,7 @@ void j_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const c
 
 /*
  * Edit a message into a Pool memory buffer, with file:lineno
- */                                                 
+ */
 int m_msg(const char *file, int line, POOLMEM **pool_buf, const char *fmt, ...)
 {
    va_list   arg_ptr;
@@ -1125,7 +1125,7 @@ int m_msg(const char *file, int line, POOLMEM **pool_buf, const char *fmt, ...)
    i = sprintf(*pool_buf, "%s:%d ", file, line);
 
    for (;;) {
-      maxlen = sizeof_pool_memory(*pool_buf) - i - 1; 
+      maxlen = sizeof_pool_memory(*pool_buf) - i - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(*pool_buf+i, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1146,7 +1146,7 @@ int m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
    i = sprintf(pool_buf, "%s:%d ", file, line);
 
    for (;;) {
-      maxlen = sizeof_pool_memory(pool_buf) - i - 1; 
+      maxlen = sizeof_pool_memory(pool_buf) - i - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1170,7 +1170,7 @@ int Mmsg(POOLMEM **pool_buf, const char *fmt, ...)
    int len, maxlen;
 
    for (;;) {
-      maxlen = sizeof_pool_memory(*pool_buf) - 1; 
+      maxlen = sizeof_pool_memory(*pool_buf) - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(*pool_buf, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1189,7 +1189,7 @@ int Mmsg(POOLMEM *&pool_buf, const char *fmt, ...)
    int len, maxlen;
 
    for (;;) {
-      maxlen = sizeof_pool_memory(pool_buf) - 1; 
+      maxlen = sizeof_pool_memory(pool_buf) - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1208,7 +1208,7 @@ int Mmsg(POOL_MEM &pool_buf, const char *fmt, ...)
    int len, maxlen;
 
    for (;;) {
-      maxlen = pool_buf.max_size() - 1; 
+      maxlen = pool_buf.max_size() - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf.c_str(), maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1227,7 +1227,7 @@ static pthread_mutex_t msg_queue_mutex = PTHREAD_MUTEX_INITIALIZER;
 /*
  * We queue messages rather than print them directly. This
  *  is generally used in low level routines (msg handler, bnet)
- *  to prevent recursion (i.e. if you are in the middle of 
+ *  to prevent recursion (i.e. if you are in the middle of
  *  sending a message, it is a bit messy to recursively call
  *  yourself when the bnet packet is not reentrant).
  */
@@ -1241,7 +1241,7 @@ void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
    pool_buf = get_pool_memory(PM_EMSG);
 
    for (;;) {
-      maxlen = sizeof_pool_memory(pool_buf) - 1; 
+      maxlen = sizeof_pool_memory(pool_buf) - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1254,7 +1254,7 @@ void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
    item = (MQUEUE_ITEM *)malloc(sizeof(MQUEUE_ITEM) + strlen(pool_buf) + 1);
    item->type = type;
    item->mtime = time(NULL);
-   strcpy(item->msg, pool_buf);  
+   strcpy(item->msg, pool_buf);
    /* If no jcr or dequeuing send to daemon to avoid recursion */
    if (!jcr || jcr->dequeuing) {
       /* jcr==NULL => daemon message, safe to send now */
@@ -1271,7 +1271,7 @@ void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
 }
 
 /*
- * Dequeue messages 
+ * Dequeue messages
  */
 void dequeue_messages(JCR *jcr)
 {
@@ -1285,7 +1285,7 @@ void dequeue_messages(JCR *jcr)
    jcr->msg_queue->destroy();
    jcr->dequeuing = false;
    V(msg_queue_mutex);
-}                                                
+}
 
 
 /*
@@ -1302,7 +1302,7 @@ void q_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const c
    i = Mmsg(pool_buf, "%s:%d ", file, line);
 
    for (;;) {
-      maxlen = sizeof_pool_memory(pool_buf) - i - 1; 
+      maxlen = sizeof_pool_memory(pool_buf) - i - 1;
       va_start(arg_ptr, fmt);
       len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
       va_end(arg_ptr);
@@ -1317,7 +1317,7 @@ void q_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const c
    free_memory(pool_buf);
 }
 
-/* 
+/*
  * Define if e_msg must exit when M_ERROR_TERM is received
  */
 void set_exit_on_error(int value) {
index bb055f22230ca46bcec00382e0ecb01d16de768c..f73f1a395e0910d2d3281e7d2e88f680a0bb8059 100644 (file)
@@ -4,7 +4,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -73,10 +73,10 @@ bool       bnet_sig              (BSOCK *bs, int sig);
 int        bnet_ssl_server       (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
 int        bnet_ssl_client       (BSOCK *bsock, char *password, int ssl_need);
 BSOCK *    bnet_connect            (JCR *jcr, int retry_interval,
-               int max_retry_time, const char *name, char *host, char *service, 
+               int max_retry_time, const char *name, char *host, char *service,
                int port, int verbose);
 void       bnet_close            (BSOCK *bsock);
-BSOCK *    init_bsock            (JCR *jcr, int sockfd, const char *who, const char *ip, 
+BSOCK *    init_bsock            (JCR *jcr, int sockfd, const char *who, const char *ip,
                                   int port, struct sockaddr *client_addr);
 BSOCK *    dup_bsock             (BSOCK *bsock);
 void       term_bsock            (BSOCK *bsock);
@@ -117,6 +117,7 @@ int64_t          str_to_int64(char *str);
 char *           edit_uint64_with_commas   (uint64_t val, char *buf);
 char *           add_commas              (char *val, char *buf);
 char *           edit_uint64             (uint64_t val, char *buf);
+char *           edit_int64              (int64_t val, char *buf);
 int              duration_to_utime       (char *str, utime_t *value);
 int              size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
 char             *edit_utime             (utime_t val, char *buf, int buf_len);
@@ -159,7 +160,7 @@ void       set_trace             (int trace_flag);
 void       set_exit_on_error     (int value);
 
 /* bnet_server.c */
-void       bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq, 
+void       bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq,
                    void *handle_client_request(void *bsock));
 void       bnet_stop_thread_server(pthread_t tid);
 void             bnet_server             (int port, void handle_client_request(BSOCK *bsock));
@@ -173,6 +174,11 @@ void free_getuser_cache();
 char *getgroup (gid_t gid);
 void free_getgroup_cache();
 
+/* python.c */
+typedef int (EVENT_HANDLER)(JCR *jcr, const char *event);
+void init_python_interpreter(const char *progname, const char *scripts);
+void term_python_interpreter();
+extern EVENT_HANDLER *generate_event;
 
 /* signal.c */
 void             init_signals             (void terminate(int sig));
@@ -185,9 +191,9 @@ bool             skip_spaces             (char **msg);
 bool             skip_nonspaces          (char **msg);
 int              fstrsch                 (const char *a, const char *b);
 char            *next_arg(char **s);
-int              parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, 
+int              parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
                         char **argk, char **argv, int max_args);
-void            split_path_and_filename(const char *fname, POOLMEM **path, 
+void            split_path_and_filename(const char *fname, POOLMEM **path,
                         int *pnl, POOLMEM **file, int *fnl);
 int             bsscanf(const char *buf, const char *fmt, ...);
 
@@ -204,6 +210,7 @@ char *           encode_mode             (mode_t mode, char *buf);
 int              do_shell_expansion      (char *name, int name_len);
 void             jobstatus_to_ascii      (int JobStatus, char *msg, int maxlen);
 int              run_program             (char *prog, int wait, POOLMEM *results);
+int              run_program_full_output (char *prog, int wait, POOLMEM *results);
 const char *     job_type_to_str         (int type);
 const char *     job_status_to_str       (int stat);
 const char *     job_level_to_str        (int level);
index ef338a9a1bbee88ee07bc313232cfee4960b4d33..1e54ec95afdbe2bea6b1a0ece21a104b08abe061 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *   scan.c -- scanning routines for Bacula
- * 
+ *
  *    Kern Sibbald, MM separated from util.c MMIII
  *
  *   Version $Id$
@@ -55,9 +55,9 @@ void strip_trailing_slashes(char *dir)
 
 /*
  * Skip spaces
- *  Returns: 0 on failure (EOF)            
+ *  Returns: 0 on failure (EOF)
  *          1 on success
- *          new address in passed parameter 
+ *          new address in passed parameter
  */
 bool skip_spaces(char **msg)
 {
@@ -74,9 +74,9 @@ bool skip_spaces(char **msg)
 
 /*
  * Skip nonspaces
- *  Returns: 0 on failure (EOF)            
+ *  Returns: 0 on failure (EOF)
  *          1 on success
- *          new address in passed parameter 
+ *          new address in passed parameter
  */
 bool skip_nonspaces(char **msg)
 {
@@ -122,7 +122,7 @@ fstrsch(const char *a, const char *b)       /* folded case search */
 }
 
 
-/* 
+/*
  * Return next argument from command line.  Note, this
  * routine is destructive.
  */
@@ -134,8 +134,8 @@ char *next_arg(char **s)
    /* skip past spaces to next arg */
    for (p=*s; *p && B_ISSPACE(*p); ) {
       p++;
-   }   
-   Dmsg1(400, "Next arg=%s\n", p);
+   }
+   Dmsg1(900, "Next arg=%s\n", p);
    for (n = q = p; *p ; ) {
       if (*p == '\\') {
         p++;
@@ -164,15 +164,15 @@ char *next_arg(char **s)
    }
    *q = 0;
    *s = p;
-   Dmsg2(400, "End arg=%s next=%s\n", n, p);
+   Dmsg2(900, "End arg=%s next=%s\n", n, p);
    return n;
-}   
+}
 
 /*
  * This routine parses the input command line.
  * It makes a copy in args, then builds an
  *  argc, argv like list where
- *    
+ *
  *  argc = count of arguments
  *  argk[i] = argument keyword (part preceding =)
  *  argv[i] = argument value (part after =)
@@ -185,11 +185,11 @@ char *next_arg(char **s)
  *  argk[1] = arg2
  *  argv[1] = abc
  *  argk[2] = arg3
- *  argv[2] = 
+ *  argv[2] =
  */
 
-int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, 
-              char **argk, char **argv, int max_args) 
+int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
+              char **argk, char **argv, int max_args)
 {
    char *p, *q, *n;
 
@@ -199,7 +199,7 @@ int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
    *argc = 0;
    /* Pick up all arguments */
    while (*argc < max_args) {
-      n = next_arg(&p);   
+      n = next_arg(&p);
       if (*n) {
         argk[*argc] = n;
         argv[(*argc)++] = NULL;
@@ -250,7 +250,7 @@ void split_path_and_filename(const char *fname, POOLMEM **path, int *pnl,
    int len = slen = strlen(fname);
 
    /*
-    * Find path without the filename.  
+    * Find path without the filename.
     * I.e. everything after the last / is a "filename".
     * OK, maybe it is a directory name, but we treat it like
     * a filename. If we don't find a / then the whole name
@@ -292,7 +292,7 @@ void split_path_and_filename(const char *fname, POOLMEM **path, int *pnl,
 }
 
 /*
- * Extremely simple sscanf. Handles only %(u,d,ld,lu,lld,llu,c,nns) 
+ * Extremely simple sscanf. Handles only %(u,d,ld,lu,lld,llu,c,nns)
  */
 const int BIG = 1000;
 int bsscanf(const char *buf, const char *fmt, ...)
@@ -420,7 +420,7 @@ int main(int argc, char *argv[])
    int cnt;
    char *helloreq= "Hello *UserAgent* calling\n";
    char *hello = "Hello %127s calling\n";
-   char *catreq = 
+   char *catreq =
 "CatReq Job=NightlySave.2004-06-11_19.11.32 CreateJobMedia FirstIndex=1 LastIndex=114 StartFile=0 EndFile=0 StartBlock=208 EndBlock=2903248";
 static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia "
   "FirstIndex=%u LastIndex=%u StartFile=%u EndFile=%u "
@@ -454,7 +454,7 @@ struct VOLUME_CAT_INFO {
    uint64_t VolWriteTime;            /* time spent writing this Volume */
    char VolCatStatus[20];            /* Volume status */
    char VolCatName[MAX_NAME_LENGTH];  /* Desired volume to mount */
-};               
+};
    struct VOLUME_CAT_INFO vol;
 
 #ifdef xxx
index 32f9d0afabfcec6d95b068c836477e819c469531..a7c634b55b68e6302f57a77022e1a3dda6ad7018 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *   util.c  miscellaneous utility subroutines for Bacula
- * 
+ *
  *    Kern Sibbald, MM
  *
  *   Version $Id$
@@ -75,7 +75,7 @@ void lcase(char *str)
    }
 }
 
-/* Convert spaces to non-space character. 
+/* Convert spaces to non-space character.
  * This makes scanf of fields containing spaces easier.
  */
 void
@@ -88,7 +88,7 @@ bash_spaces(char *str)
    }
 }
 
-/* Convert spaces to non-space character. 
+/* Convert spaces to non-space character.
  * This makes scanf of fields containing spaces easier.
  */
 void
@@ -109,7 +109,7 @@ unbash_spaces(char *str)
 {
    while (*str) {
      if (*str == 0x1)
-        *str = ' ';
+       *str = ' ';
      str++;
    }
 }
@@ -121,7 +121,7 @@ unbash_spaces(POOL_MEM &pm)
    char *str = pm.c_str();
    while (*str) {
      if (*str == 0x1)
-        *str = ' ';
+       *str = ' ';
      str++;
    }
 }
@@ -240,7 +240,7 @@ void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen)
       if (JobStatus == 0) {
         buf[0] = 0;
       } else {
-         bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
+        bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
       }
       jobstat = buf;
       break;
@@ -251,7 +251,7 @@ void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen)
 /*
  * Convert Job Termination Status into a string
  */
-const char *job_status_to_str(int stat) 
+const char *job_status_to_str(int stat)
 {
    const char *str;
 
@@ -283,7 +283,7 @@ const char *job_status_to_str(int stat)
 /*
  * Convert Job Type into a string
  */
-const char *job_type_to_str(int type) 
+const char *job_type_to_str(int type)
 {
    const char *str;
 
@@ -310,7 +310,7 @@ const char *job_type_to_str(int type)
 /*
  * Convert Job Level into a string
  */
-const char *job_level_to_str(int level) 
+const char *job_level_to_str(int level)
 {
    const char *str;
 
@@ -361,25 +361,25 @@ const char *job_level_to_str(int level)
 
 char *encode_mode(mode_t mode, char *buf)
 {
-  char *cp = buf;  
+  char *cp = buf;
 
   *cp++ = S_ISDIR(mode) ? 'd' : S_ISBLK(mode)  ? 'b' : S_ISCHR(mode)  ? 'c' :
-          S_ISLNK(mode) ? 'l' : S_ISFIFO(mode) ? 'f' : S_ISSOCK(mode) ? 's' : '-';
+         S_ISLNK(mode) ? 'l' : S_ISFIFO(mode) ? 'f' : S_ISSOCK(mode) ? 's' : '-';
   *cp++ = mode & S_IRUSR ? 'r' : '-';
   *cp++ = mode & S_IWUSR ? 'w' : '-';
   *cp++ = (mode & S_ISUID
-               ? (mode & S_IXUSR ? 's' : 'S')
-               : (mode & S_IXUSR ? 'x' : '-'));
+              ? (mode & S_IXUSR ? 's' : 'S')
+              : (mode & S_IXUSR ? 'x' : '-'));
   *cp++ = mode & S_IRGRP ? 'r' : '-';
   *cp++ = mode & S_IWGRP ? 'w' : '-';
   *cp++ = (mode & S_ISGID
-               ? (mode & S_IXGRP ? 's' : 'S')
-               : (mode & S_IXGRP ? 'x' : '-'));
+              ? (mode & S_IXGRP ? 's' : 'S')
+              : (mode & S_IXGRP ? 'x' : '-'));
   *cp++ = mode & S_IROTH ? 'r' : '-';
   *cp++ = mode & S_IWOTH ? 'w' : '-';
   *cp++ = (mode & S_ISVTX
-               ? (mode & S_IXOTH ? 't' : 'T')
-               : (mode & S_IXOTH ? 'x' : '-'));
+              ? (mode & S_IXOTH ? 't' : 'T')
+              : (mode & S_IXOTH ? 'x' : '-'));
   *cp = '\0';
   return cp;
 }
@@ -407,7 +407,7 @@ int do_shell_expansion(char *name, int name_len)
       cmd =  get_pool_memory(PM_FNAME);
       /* look for shell */
       if ((shellcmd = getenv("SHELL")) == NULL) {
-         shellcmd = "/bin/sh";
+        shellcmd = "/bin/sh";
       }
       pm_strcpy(&cmd, shellcmd);
       pm_strcat(&cmd, " -c \"echo ");
@@ -419,7 +419,7 @@ int do_shell_expansion(char *name, int name_len)
         fgets(line, sizeof(line), bpipe->rfd);
         strip_trailing_junk(line);
         stat = close_bpipe(bpipe);
-         Dmsg2(400, "stat=%d got: %s\n", stat, line);
+        Dmsg2(400, "stat=%d got: %s\n", stat, line);
       } else {
         stat = 1;                    /* error */
       }
@@ -454,7 +454,7 @@ void make_session_key(char *key, char *seed, int mode)
      /* The following creates a seed for the session key generator
        based on a collection of volatile and environment-specific
        information unlikely to be vulnerable (as a whole) to an
-        exhaustive search attack.  If one of these items isn't
+       exhaustive search attack.  If one of these items isn't
        available on your machine, replace it with something
        equivalent or, if you like, just delete it. */
 
@@ -492,7 +492,7 @@ void make_session_key(char *key, char *seed, int mode)
           key[k++] = Rad16(rb & 0xF);
 #undef Rad16
           if (j & 1) {
-              key[k++] = '-';
+             key[k++] = '-';
           }
        }
        key[--k] = 0;
@@ -522,10 +522,10 @@ void make_session_key(char *key, char *seed, int mode)
  *
  *  omsg = edited output message
  *  imsg = input string containing edit codes (%x)
- *  to = recepients list 
+ *  to = recepients list
  *
  */
-POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)   
+POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
 {
    char *p, *q;
    const char *str;
@@ -538,88 +538,85 @@ POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
    for (p=imsg; *p; p++) {
       if (*p == '%') {
         switch (*++p) {
-         case '%':
-            str = "%";
+        case '%':
+           str = "%";
            break;
-         case 'c':
+        case 'c':
            if (jcr) {
               str = jcr->client_name;
            } else {
-               str = "*none*";
-           }
-           if (!str) {
-               str = "";
+              str = "*none*";
            }
            break;
-         case 'd':
-            str = my_name;            /* Director's name */
+        case 'd':
+           str = my_name;            /* Director's name */
            break;
-         case 'e':
+        case 'e':
            if (jcr) {
-              str = job_status_to_str(jcr->JobStatus); 
-           } else { 
-               str = "*none*";
+              str = job_status_to_str(jcr->JobStatus);
+           } else {
+              str = "*none*";
            }
            break;
-         case 'i':
+        case 'i':
            if (jcr) {
-               bsnprintf(add, sizeof(add), "%d", jcr->JobId);
+              bsnprintf(add, sizeof(add), "%d", jcr->JobId);
               str = add;
            } else {
-               str = "*none*";
+              str = "*none*";
            }
            break;
-         case 'j':                    /* Job name */
+        case 'j':                    /* Job name */
            if (jcr) {
               str = jcr->Job;
            } else {
-               str = "*none*";
+              str = "*none*";
            }
            break;
-         case 'l':
+        case 'l':
            if (jcr) {
               str = job_level_to_str(jcr->JobLevel);
            } else {
-               str = "*none*";
+              str = "*none*";
            }
            break;
-         case 'n':
+        case 'n':
             if (jcr) {
                bstrncpy(name, jcr->Job, sizeof(name));
                /* There are three periods after the Job name */
                for (i=0; i<3; i++) {
-                   if ((q=strrchr(name, '.')) != NULL) {
+                  if ((q=strrchr(name, '.')) != NULL) {
                       *q = 0;
                   }
                }
                str = name;
             } else {
-                str = "*none*";
+               str = "*none*";
             }
             break;
-         case 'r':
+        case 'r':
            str = to;
            break;
-         case 't':
+        case 't':
            if (jcr) {
               str = job_type_to_str(jcr->JobType);
            } else {
-               str = "*none*";
+              str = "*none*";
            }
            break;
-         case 'v':
+        case 'v':
            if (jcr) {
               if (jcr->VolumeName && jcr->VolumeName[0]) {
                  str = jcr->VolumeName;
               } else {
-                  str = "";
+                 str = "";
               }
            } else {
-               str = "*none*";
+              str = "*none*";
            }
            break;
         default:
-            add[0] = '%';
+           add[0] = '%';
            add[1] = *p;
            add[2] = 0;
            str = add;
@@ -639,7 +636,7 @@ POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
 
 void set_working_directory(char *wd)
 {
-   struct stat stat_buf; 
+   struct stat stat_buf;
 
    if (wd == NULL) {
       Emsg0(M_ERROR_TERM, 0, _("Working directory not defined. Cannot continue.\n"));
index e33bb1ca219b5fffd6eb94fa6351039713a2e194..a08e51ed55244f2854d3a52541b0610c11a3377c 100755 (executable)
@@ -53,7 +53,7 @@ static pthread_t wd_tid;
 static dlist *wd_queue;
 static dlist *wd_inactive;
 
-/*   
+/*
  * Start watchdog thread
  *
  *  Returns: 0 on success
@@ -68,11 +68,11 @@ int start_watchdog(void)
    if (wd_is_init) {
       return 0;
    }
-   Dmsg0(400, "Initialising NicB-hacked watchdog thread\n");
+   Dmsg0(800, "Initialising NicB-hacked watchdog thread\n");
    watchdog_time = time(NULL);
 
    if ((errstat=rwl_init(&lock)) != 0) {
-      Emsg1(M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"), 
+      Emsg1(M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"),
            strerror(errstat));
    }
    wd_queue = New(dlist(dummy, &dummy->link));
@@ -105,7 +105,7 @@ static void ping_watchdog()
 int stop_watchdog(void)
 {
    int stat;
-   watchdog_t *p;    
+   watchdog_t *p;
 
    if (!wd_is_init) {
       return 0;
@@ -180,7 +180,7 @@ bool register_watchdog(watchdog_t *wd)
    wd_lock();
    wd->next_fire = watchdog_time + wd->interval;
    wd_queue->append(wd);
-   Dmsg3(400, "Registered watchdog %p, interval %d%s\n",
+   Dmsg3(800, "Registered watchdog %p, interval %d%s\n",
          wd, wd->interval, wd->one_shot ? " one shot" : "");
    wd_unlock();
    ping_watchdog();
@@ -201,7 +201,7 @@ bool unregister_watchdog(watchdog_t *wd)
    foreach_dlist(p, wd_queue) {
       if (wd == p) {
         wd_queue->remove(wd);
-         Dmsg1(400, "Unregistered watchdog %p\n", wd);
+         Dmsg1(800, "Unregistered watchdog %p\n", wd);
         ok = true;
         goto get_out;
       }
@@ -210,13 +210,13 @@ bool unregister_watchdog(watchdog_t *wd)
    foreach_dlist(p, wd_inactive) {
       if (wd == p) {
         wd_inactive->remove(wd);
-         Dmsg1(400, "Unregistered inactive watchdog %p\n", wd);
+         Dmsg1(800, "Unregistered inactive watchdog %p\n", wd);
         ok = true;
         goto get_out;
       }
    }
 
-   Dmsg1(400, "Failed to unregister watchdog %p\n", wd);
+   Dmsg1(800, "Failed to unregister watchdog %p\n", wd);
 
 get_out:
    wd_unlock();
@@ -231,12 +231,12 @@ extern "C" void *watchdog_thread(void *arg)
    struct timezone tz;
    time_t next_time;
 
-   Dmsg0(400, "NicB-reworked watchdog thread entered\n");
+   Dmsg0(800, "NicB-reworked watchdog thread entered\n");
 
    while (!quit) {
-      watchdog_t *p;   
+      watchdog_t *p;
 
-      /* 
+      /*
        * We lock the jcr chain here because a good number of the
        *   callback routines lock the jcr chain. We need to lock
        *   it here *before* the watchdog lock because the SD message
@@ -264,7 +264,7 @@ walk_list:
            } else {
               p->next_fire = watchdog_time + p->interval;
            }
-        } 
+        }
         if (p->next_fire < next_time) {
            next_time = p->next_fire;
         }
@@ -272,8 +272,8 @@ walk_list:
       wd_unlock();
       unlock_jcr_chain();
 
-      /*                  
-       * Wait sleep time or until someone wakes us 
+      /*
+       * Wait sleep time or until someone wakes us
        */
       gettimeofday(&tv, &tz);
       timeout.tv_nsec = tv.tv_usec * 1000;
@@ -290,7 +290,7 @@ walk_list:
       V(timer_mutex);
    }
 
-   Dmsg0(400, "NicB-reworked watchdog thread exited\n");
+   Dmsg0(800, "NicB-reworked watchdog thread exited\n");
    return NULL;
 }
 
@@ -306,7 +306,7 @@ static void wd_lock()
       Emsg1(M_ABORT, 0, "rwl_writelock failure. ERR=%s\n",
           strerror(errstat));
    }
-}    
+}
 
 /*
  * Unlock the watchdog. This can be called multiple times by the
@@ -320,4 +320,4 @@ static void wd_unlock()
       Emsg1(M_ABORT, 0, "rwl_writeunlock failure. ERR=%s\n",
           strerror(errstat));
    }
-}    
+}
index efc41bbe8b141c408d212a8a1d4d293bbdece434..91f812bc5fd0176588c399dbbc7c07319e7929e2 100755 (executable)
@@ -52,7 +52,7 @@
 /* Forward referenced functions */
 extern "C" void *workq_server(void *arg);
 
-/*   
+/*
  * Initialize a work queue
  *
  *  Returns: 0 on success
@@ -61,7 +61,7 @@ extern "C" void *workq_server(void *arg);
 int workq_init(workq_t *wq, int threads, void *(*engine)(void *arg))
 {
    int stat;
-                       
+
    if ((stat = pthread_attr_init(&wq->attr)) != 0) {
       return stat;
    }
@@ -84,7 +84,7 @@ int workq_init(workq_t *wq, int threads, void *(*engine)(void *arg))
    wq->num_workers = 0;              /* no threads yet */
    wq->idle_workers = 0;             /* no idle threads */
    wq->engine = engine;              /* routine to run */
-   wq->valid = WORKQ_VALID; 
+   wq->valid = WORKQ_VALID;
    return 0;
 }
 
@@ -106,8 +106,8 @@ int workq_destroy(workq_t *wq)
   }
   wq->valid = 0;                     /* prevent any more operations */
 
-  /* 
-   * If any threads are active, wake them 
+  /*
+   * If any threads are active, wake them
    */
   if (wq->num_workers > 0) {
      wq->quit = 1;
@@ -137,7 +137,7 @@ int workq_destroy(workq_t *wq)
 /*
  *  Add work to a queue
  *    wq is a queue that was created with workq_init
- *    element is a user unique item that will be passed to the 
+ *    element is a user unique item that will be passed to the
  *       processing routine
  *    work_item will get internal work queue item -- if it is not NULL
  *    priority if non-zero will cause the item to be placed on the
@@ -148,8 +148,8 @@ int workq_add(workq_t *wq, void *element, workq_ele_t **work_item, int priority)
    int stat;
    workq_ele_t *item;
    pthread_t id;
-    
-   Dmsg0(400, "workq_add\n");
+
+   Dmsg0(1400, "workq_add\n");
    if (wq->valid != WORKQ_VALID) {
       return EINVAL;
    }
@@ -164,7 +164,7 @@ int workq_add(workq_t *wq, void *element, workq_ele_t **work_item, int priority)
       return stat;
    }
 
-   Dmsg0(400, "add item to queue\n");
+   Dmsg0(1400, "add item to queue\n");
    if (priority) {
       /* Add to head of queue */
       if (wq->first == NULL) {
@@ -186,13 +186,13 @@ int workq_add(workq_t *wq, void *element, workq_ele_t **work_item, int priority)
 
    /* if any threads are idle, wake one */
    if (wq->idle_workers > 0) {
-      Dmsg0(400, "Signal worker\n");
+      Dmsg0(1400, "Signal worker\n");
       if ((stat = pthread_cond_signal(&wq->work)) != 0) {
         pthread_mutex_unlock(&wq->mutex);
         return stat;
       }
    } else if (wq->num_workers < wq->max_workers) {
-      Dmsg0(400, "Create worker thread\n");
+      Dmsg0(1400, "Create worker thread\n");
       /* No idle threads so create a new one */
       set_thread_concurrency(wq->max_workers + 1);
       if ((stat = pthread_create(&id, &wq->attr, workq_server, (void *)wq)) != 0) {
@@ -202,7 +202,7 @@ int workq_add(workq_t *wq, void *element, workq_ele_t **work_item, int priority)
       wq->num_workers++;
    }
    pthread_mutex_unlock(&wq->mutex);
-   Dmsg0(400, "Return workq_add\n");
+   Dmsg0(1400, "Return workq_add\n");
    /* Return work_item if requested */
    if (work_item) {
       *work_item = item;
@@ -224,8 +224,8 @@ int workq_remove(workq_t *wq, workq_ele_t *work_item)
    int stat, found = 0;
    pthread_t id;
    workq_ele_t *item, *prev;
-    
-   Dmsg0(400, "workq_remove\n");
+
+   Dmsg0(1400, "workq_remove\n");
    if (wq->valid != WORKQ_VALID) {
       return EINVAL;
    }
@@ -244,10 +244,10 @@ int workq_remove(workq_t *wq, workq_ele_t *work_item)
    if (!found) {
       return EINVAL;
    }
-   
+
    /* Move item to be first on list */
    if (wq->first != work_item) {
-      prev->next = work_item->next;   
+      prev->next = work_item->next;
       if (wq->last == work_item) {
         wq->last = prev;
       }
@@ -257,13 +257,13 @@ int workq_remove(workq_t *wq, workq_ele_t *work_item)
 
    /* if any threads are idle, wake one */
    if (wq->idle_workers > 0) {
-      Dmsg0(400, "Signal worker\n");
+      Dmsg0(1400, "Signal worker\n");
       if ((stat = pthread_cond_signal(&wq->work)) != 0) {
         pthread_mutex_unlock(&wq->mutex);
         return stat;
       }
    } else {
-      Dmsg0(400, "Create worker thread\n");
+      Dmsg0(1400, "Create worker thread\n");
       /* No idle threads so create a new one */
       set_thread_concurrency(wq->max_workers + 1);
       if ((stat = pthread_create(&id, &wq->attr, workq_server, (void *)wq)) != 0) {
@@ -273,12 +273,12 @@ int workq_remove(workq_t *wq, workq_ele_t *work_item)
       wq->num_workers++;
    }
    pthread_mutex_unlock(&wq->mutex);
-   Dmsg0(400, "Return workq_remove\n");
+   Dmsg0(1400, "Return workq_remove\n");
    return stat;
 }
 
 
-/* 
+/*
  * This is the worker thread that serves the work queue.
  * In due course, it will call the user's engine.
  */
@@ -290,7 +290,7 @@ void *workq_server(void *arg)
    workq_ele_t *we;
    int stat, timedout;
 
-   Dmsg0(400, "Start workq_server\n");
+   Dmsg0(1400, "Start workq_server\n");
    if ((stat = pthread_mutex_lock(&wq->mutex)) != 0) {
       return NULL;
    }
@@ -299,9 +299,9 @@ void *workq_server(void *arg)
       struct timeval tv;
       struct timezone tz;
 
-      Dmsg0(400, "Top of for loop\n");
+      Dmsg0(1400, "Top of for loop\n");
       timedout = 0;
-      Dmsg0(400, "gettimeofday()\n");
+      Dmsg0(1400, "gettimeofday()\n");
       gettimeofday(&tv, &tz);
       timeout.tv_nsec = 0;
       timeout.tv_sec = tv.tv_sec + 2;
@@ -310,7 +310,7 @@ void *workq_server(void *arg)
         /*
          * Wait 2 seconds, then if no more work, exit
          */
-         Dmsg0(400, "pthread_cond_timedwait()\n");
+         Dmsg0(1400, "pthread_cond_timedwait()\n");
 #ifdef xxxxxxxxxxxxxxxx_was_HAVE_CYGWIN
         /* CYGWIN dies with a page fault the second
          * time that pthread_cond_timedwait() is called
@@ -321,18 +321,18 @@ void *workq_server(void *arg)
 #else
         stat = pthread_cond_timedwait(&wq->work, &wq->mutex, &timeout);
 #endif
-         Dmsg1(400, "timedwait=%d\n", stat);
+         Dmsg1(1400, "timedwait=%d\n", stat);
         if (stat == ETIMEDOUT) {
            timedout = 1;
            break;
         } else if (stat != 0) {
             /* This shouldn't happen */
-            Dmsg0(400, "This shouldn't happen\n");
+            Dmsg0(1400, "This shouldn't happen\n");
            wq->num_workers--;
            pthread_mutex_unlock(&wq->mutex);
            return NULL;
         }
-      } 
+      }
       we = wq->first;
       if (we != NULL) {
         wq->first = we->next;
@@ -343,15 +343,15 @@ void *workq_server(void *arg)
            return NULL;
         }
          /* Call user's routine here */
-         Dmsg0(400, "Calling user engine.\n");
+         Dmsg0(1400, "Calling user engine.\n");
         wq->engine(we->data);
-         Dmsg0(400, "Back from user engine.\n");
+         Dmsg0(1400, "Back from user engine.\n");
         free(we);                    /* release work entry */
-         Dmsg0(400, "relock mutex\n"); 
+         Dmsg0(1400, "relock mutex\n");
         if ((stat = pthread_mutex_lock(&wq->mutex)) != 0) {
            return NULL;
         }
-         Dmsg0(400, "Done lock mutex\n");
+         Dmsg0(1400, "Done lock mutex\n");
       }
       /*
        * If no more work request, and we are asked to quit, then do it
@@ -359,31 +359,31 @@ void *workq_server(void *arg)
       if (wq->first == NULL && wq->quit) {
         wq->num_workers--;
         if (wq->num_workers == 0) {
-            Dmsg0(400, "Wake up destroy routine\n");
+            Dmsg0(1400, "Wake up destroy routine\n");
            /* Wake up destroy routine if he is waiting */
            pthread_cond_broadcast(&wq->work);
         }
-         Dmsg0(400, "Unlock mutex\n");
+         Dmsg0(1400, "Unlock mutex\n");
         pthread_mutex_unlock(&wq->mutex);
-         Dmsg0(400, "Return from workq_server\n");
+         Dmsg0(1400, "Return from workq_server\n");
         return NULL;
       }
-      Dmsg0(400, "Check for work request\n");
-      /* 
+      Dmsg0(1400, "Check for work request\n");
+      /*
        * If no more work requests, and we waited long enough, quit
        */
-      Dmsg1(400, "wq->first==NULL = %d\n", wq->first==NULL);
-      Dmsg1(400, "timedout=%d\n", timedout);
+      Dmsg1(1400, "wq->first==NULL = %d\n", wq->first==NULL);
+      Dmsg1(1400, "timedout=%d\n", timedout);
       if (wq->first == NULL && timedout) {
-         Dmsg0(400, "break big loop\n");
+         Dmsg0(1400, "break big loop\n");
         wq->num_workers--;
         break;
       }
-      Dmsg0(400, "Loop again\n");
+      Dmsg0(1400, "Loop again\n");
    } /* end of big for loop */
 
-   Dmsg0(400, "unlock mutex\n");
+   Dmsg0(1400, "unlock mutex\n");
    pthread_mutex_unlock(&wq->mutex);
-   Dmsg0(400, "End workq_server\n");
+   Dmsg0(1400, "End workq_server\n");
    return NULL;
 }
index ab909549d46ff3f708c233e46641190dde8ec0d0..671fb8bee278826bbfb315a8f1c8ef821a5c8803 100644 (file)
@@ -42,6 +42,9 @@ DCR *new_dcr(JCR *jcr, DEVICE *dev)
    }
    dcr->jcr = jcr;
    dcr->dev = dev;
+   if (dev) {
+      dcr->device = dev->device;
+   }
    dcr->block = new_block(dev);
    dcr->rec = new_record();
    dcr->spool_fd = -1;
@@ -386,8 +389,8 @@ bool release_device(JCR *jcr)
    DEVICE *dev = dcr->dev;   
    lock_device(dev);
    Dmsg1(100, "release_device device is %s\n", dev_is_tape(dev)?"tape":"disk");
-   if (dev_state(dev, ST_READ)) {
-      dev->state &= ~ST_READ;        /* clear read bit */
+   if (dev->can_read()) {
+      dev->clear_read();             /* clear read bit */
       if (!dev_is_tape(dev) || !dev_cap(dev, CAP_ALWAYSOPEN)) {
         offline_or_rewind_dev(dev);
         close_dev(dev);
@@ -397,7 +400,7 @@ bool release_device(JCR *jcr)
    } else if (dev->num_writers > 0) {
       dev->num_writers--;
       Dmsg1(100, "There are %d writers in release_device\n", dev->num_writers);
-      if (dev_state(dev, ST_LABEL)) {
+      if (dev->is_labeled()) {
          Dmsg0(100, "dir_create_jobmedia_record. Release\n");
         if (!dir_create_jobmedia_record(dcr)) {
             Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
index ca19abed6123e91b6f1129bd6c1258d034831c33..9c40f80aa3730086d30c53d32f43be29099fe7c2 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -40,7 +40,7 @@ static char Create_job_media[] = "CatReq Job=%s CreateJobMedia"
    " FirstIndex=%u LastIndex=%u StartFile=%u EndFile=%u" 
    " StartBlock=%u EndBlock=%u\n";
 static char FileAttributes[] = "UpdCat Job=%s FileAttributes ";
-static char Job_status[]     = "3012 Job %s jobstatus %d\n";
+static char Job_status[]     = "Status Job=%s JobStatus=%d\n";
 
 
 /* Responses received from the Director */
index b053dcb93f2a89f22fcf33b591b760b93252ad59..6754738888fa1cd91deea9528ff9f1b83226d7bf 100644 (file)
@@ -4,7 +4,7 @@
  *   Kern Sibbald, October 2000
  *
  *   Version $Id$
- * 
+ *
  */
 /*
    Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
@@ -25,7 +25,7 @@
    MA 02111-1307, USA.
 
  */
-  
+
 #include "bacula.h"
 #include "stored.h"
 
@@ -33,7 +33,7 @@ static char Dir_sorry[] = "3999 No go\n";
 static char OK_hello[]  = "3000 OK Hello\n";
 
 
-/********************************************************************* 
+/*********************************************************************
  *
  *
  */
@@ -50,9 +50,9 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
       return 0;
    }
    if (bs->msglen < 25 || bs->msglen > 200) {
-      Dmsg2(50, _("Bad Hello command from Director at %s. Len=%d.\n"), 
+      Dmsg2(50, _("Bad Hello command from Director at %s. Len=%d.\n"),
            bs->who, bs->msglen);
-      Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s. Len=%d.\n"), 
+      Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s. Len=%d.\n"),
            bs->who, bs->msglen);
       return 0;
    }
@@ -61,25 +61,25 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
 
    if (sscanf(bs->msg, "Hello Director %127s calling\n", dirname) != 1) {
       bs->msg[100] = 0;
-      Dmsg2(50, _("Bad Hello command from Director at %s: %s\n"), 
+      Dmsg2(50, _("Bad Hello command from Director at %s: %s\n"),
            bs->who, bs->msg);
-      Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s: %s\n"), 
+      Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s: %s\n"),
            bs->who, bs->msg);
       return 0;
    }
    director = NULL;
    unbash_spaces(dirname);
    LockRes();
-   while ((director=(DIRRES *)GetNextRes(rcode, (RES *)director))) {
+   foreach_res(director, rcode) {
       if (strcmp(director->hdr.name, dirname) == 0)
         break;
    }
    UnlockRes();
    if (!director) {
-      Dmsg2(50, _("Connection from unknown Director %s at %s rejected.\n"), 
+      Dmsg2(50, _("Connection from unknown Director %s at %s rejected.\n"),
            dirname, bs->who);
-      Emsg2(M_FATAL, 0, _("Connection from unknown Director %s at %s rejected.\n"   
-       "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"), 
+      Emsg2(M_FATAL, 0, _("Connection from unknown Director %s at %s rejected.\n"
+       "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"),
            dirname, bs->who);
       free_pool_memory(dirname);
       return 0;
@@ -91,14 +91,14 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
    if (auth) {
       get_auth = cram_md5_get_auth(bs, director->password, ssl_need);
       if (!get_auth) {
-         Dmsg1(50, "cram_get_auth failed with %s\n", bs->who);
+        Dmsg1(50, "cram_get_auth failed with %s\n", bs->who);
       }
    } else {
       Dmsg1(50, "cram_auth failed with %s\n", bs->who);
    }
    if (!auth || !get_auth) {
       stop_bsock_timer(tid);
-      Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"   
+      Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"
        "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       free_pool_memory(dirname);
       return 0;
@@ -112,7 +112,7 @@ static int authenticate(int rcode, BSOCK *bs, JCR* jcr)
 /*
  * Inititiate the message channel with the Director.
  * He has made a connection to our server.
- * 
+ *
  * Basic tasks done here:
  *   Assume the Hello message is already in the input
  *     buffer. We then authenticate him.
@@ -147,7 +147,7 @@ int authenticate_filed(JCR *jcr)
    if (auth) {
        get_auth = cram_md5_get_auth(fd, jcr->sd_auth_key, ssl_need);
        if (!get_auth) {
-          Dmsg1(50, "cram-get-auth failed with %s\n", fd->who);
+         Dmsg1(50, "cram-get-auth failed with %s\n", fd->who);
        }
    } else {
       Dmsg1(50, "cram-auth failed with %s\n", fd->who);
index fb67da69ae724324b30a3474c2b9b3ef6c1e6100..90e91e42d3c78db86ee213bf04b3d9fb67fd1b25 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -70,7 +70,7 @@ bool forge_on = false;
 static void usage()
 {
    fprintf(stderr,
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
 "\nVersion: " VERSION " (" BDATE ")\n\n"
 "Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
 "       -b <file>       specify a bootstrap file\n"
@@ -88,10 +88,10 @@ static void usage()
 
 int main (int argc, char *argv[])
 {
-   int ch;   
+   int ch;
    FILE *fd;
    char line[1000];
-   int got_inc = FALSE;
+   bool got_inc = false;
 
    working_directory = "/tmp";
    my_name_is(argc, argv, "bextract");
@@ -118,7 +118,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0)
-           debug_level = 1; 
+           debug_level = 1;
         break;
 
       case 'e':                    /* exclude list */
@@ -149,7 +149,7 @@ int main (int argc, char *argv[])
            add_fname_to_include_list(ff, 0, line);
         }
         fclose(fd);
-        got_inc = TRUE;
+        got_inc = true;
         break;
 
       case 'p':
@@ -236,7 +236,7 @@ static void do_extract(char *devname)
 
    read_records(dcr, record_cb, mount_next_read_volume);
    /* If output file is still open, it was the last one in the
-    * archive since we just hit an end of file, so close the file. 
+    * archive since we just hit an end of file, so close the file.
     */
    if (is_bopen(&bfd)) {
       set_attributes(jcr, attr, &bfd);
@@ -266,7 +266,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
    switch (rec->Stream) {
    case STREAM_UNIX_ATTRIBUTES:
-   case STREAM_UNIX_ATTRIBUTES_EX:  
+   case STREAM_UNIX_ATTRIBUTES_EX:
 
       /* If extracting, it was from previous stream, so
        * close the output file.
@@ -287,7 +287,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
          Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
            rec->FileIndex, attr->file_index);
       }
-        
+
       if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
 
         attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
@@ -304,7 +304,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         build_attr_output_fnames(jcr, attr);
 
         extract = false;
-        stat = create_file(jcr, attr, &bfd, REPLACE_ALWAYS);   
+        stat = create_file(jcr, attr, &bfd, REPLACE_ALWAYS);
         switch (stat) {
         case CF_ERROR:
         case CF_SKIP:
@@ -321,14 +321,14 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
            num_files++;
            fileAddr = 0;
            break;
-        }  
+        }
       }
       break;
 
    /* Data stream and extracting */
    case STREAM_FILE_DATA:
    case STREAM_SPARSE_DATA:
-   case STREAM_WIN32_DATA:  
+   case STREAM_WIN32_DATA:
 
       if (extract) {
         if (rec->Stream == STREAM_SPARSE_DATA) {
@@ -342,7 +342,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
               fileAddr = faddr;
               if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
                  berrno be;
-                  Emsg2(M_ERROR_TERM, 0, _("Seek error on %s: %s\n"), 
+                  Emsg2(M_ERROR_TERM, 0, _("Seek error on %s: %s\n"),
                     attr->ofname, be.strerror());
               }
            }
@@ -354,7 +354,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
          Dmsg2(8, "Write %u bytes, total=%u\n", wsize, total);
         if ((uint32_t)bwrite(&bfd, wbuf, wsize) != wsize) {
            berrno be;
-            Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"), 
+            Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"),
               attr->ofname, be.strerror());
         }
         fileAddr += wsize;
@@ -363,8 +363,8 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
    /* GZIP data stream */
    case STREAM_GZIP_DATA:
-   case STREAM_SPARSE_GZIP_DATA: 
-   case STREAM_WIN32_GZIP_DATA:  
+   case STREAM_SPARSE_GZIP_DATA:
+   case STREAM_WIN32_GZIP_DATA:
 #ifdef HAVE_LIBZ
       if (extract) {
         uLong compress_len;
@@ -382,7 +382,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
               fileAddr = faddr;
               if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
                  berrno be;
-                  Emsg3(M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"), 
+                  Emsg3(M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
                     edit_uint64(fileAddr, ec1), attr->ofname, be.strerror());
                  extract = false;
                  return true;
@@ -393,7 +393,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
            wsize = rec->data_len;
         }
         compress_len = compress_buf_size;
-        if ((stat=uncompress((Bytef *)compress_buf, &compress_len, 
+        if ((stat=uncompress((Bytef *)compress_buf, &compress_len,
               (const Bytef *)wbuf, (uLong)wsize) != Z_OK)) {
             Emsg1(M_ERROR, 0, _("Uncompression error. ERR=%d\n"), stat);
            extract = false;
@@ -404,7 +404,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         if ((uLongf)bwrite(&bfd, compress_buf, (size_t)compress_len) != compress_len) {
            berrno be;
             Pmsg0(0, "===Write error===\n");
-            Emsg2(M_ERROR, 0, _("Write error on %s: %s\n"), 
+            Emsg2(M_ERROR, 0, _("Write error on %s: %s\n"),
               attr->ofname, be.strerror());
            extract = false;
            return true;
@@ -444,10 +444,10 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         set_attributes(jcr, attr, &bfd);
         extract = false;
       }
-      Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"), 
+      Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"),
         rec->Stream);
       break;
-      
+
    } /* end switch */
    return true;
 }
@@ -467,6 +467,6 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    DEVICE *dev = dcr->dev;
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
       dcr->VolumeName, dev_name(dev));
-   getchar();  
+   getchar();
    return true;
 }
index 6a35c81fd2120ebbaaa21ceefafe62a4122cb989..d230fedf7a86705e0fab2cb1bcac00e5d965e21b 100644 (file)
@@ -63,7 +63,7 @@
  *  Note, when written, it is serialized.
 
    uint32_t CheckSum;
-   uint32_t block_len; 
+   uint32_t block_len;
    uint32_t BlockNumber;
    char     Id[BLKHDR_ID_LENGTH];
 
@@ -73,6 +73,8 @@
    uint32_t VolSessionTime;
  */
 
+class DEVICE;                         /* for forward reference */
+
 /*
  * DEV_BLOCK for reading and writing blocks.
  * This is the basic unit that is written to the device, and
@@ -84,7 +86,7 @@
  */
 struct DEV_BLOCK {
    DEV_BLOCK *next;                   /* pointer to next one */
-   void *dev;                         /* pointer to device (DEVICE not defined yet) */
+   DEVICE *dev;                       /* pointer to device */
    /* binbuf is the number of bytes remaining in the buffer.
     *   For writes, it is bytes not yet written.
     *   For reads, it is remaining bytes not yet read.
index df7e674867fe181d13454777efc4484eaf4fc54b..071125983367177e4dd6f0866f3ad23acb4e64b3 100644 (file)
@@ -5,7 +5,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -65,9 +65,9 @@ static BSR *bsr = NULL;
 static void usage()
 {
    fprintf(stderr,
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
 "\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bls [-d debug_level] <physical-device-name>\n"
+"Usage: bls [options] <device-name>\n"
 "       -b <file>       specify a bootstrap file\n"
 "       -c <file>       specify a config file\n"
 "       -d <level>      specify debug level\n"
@@ -117,7 +117,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0)
-           debug_level = 1; 
+           debug_level = 1;
         break;
 
       case 'e':                    /* exclude list */
@@ -201,7 +201,7 @@ int main (int argc, char *argv[])
       if (bsrName) {
         bsr = parse_bsr(NULL, bsrName);
       }
-      jcr = setup_jcr("bls", argv[i], bsr, VolumeName, 1); /* acquire for read */ 
+      jcr = setup_jcr("bls", argv[i], bsr, VolumeName, 1); /* acquire for read */
       if (!jcr) {
         exit(1);
       }
@@ -216,11 +216,11 @@ int main (int argc, char *argv[])
       attr = new_attr();
       /*
        * Assume that we have already read the volume label.
-       * If on second or subsequent volume, adjust buffer pointer 
+       * If on second or subsequent volume, adjust buffer pointer
        */
       if (dev->VolHdr.PrevVolName[0] != 0) { /* second volume */
-         Pmsg1(0, "\n\
-Warning, this Volume is a continuation of Volume %s\n",
+         Pmsg1(0, "\n"
+"Warning, this Volume is a continuation of Volume %s\n",
                dev->VolHdr.PrevVolName);
       }
 
@@ -254,16 +254,12 @@ static void do_close(JCR *jcr)
 /* List just block information */
 static void do_blocks(char *infname)
 {
-   if (verbose) {
-      dump_volume_label(dev);
-      rec = new_record();
-   }
    for ( ;; ) {
       if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) {
-         Dmsg1(100, "!read_block(): ERR=%s\n", strerror_dev(dev));
-        if (dev->state & ST_EOT) {
+         Dmsg1(100, "!read_block(): ERR=%s\n", dev->strerror());
+        if (dev->at_eot()) {
            if (!mount_next_read_volume(dcr)) {
-               Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"), 
+               Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"),
                  dev->file, dev_name(dev), dcr->VolumeName);
               break;
            }
@@ -275,9 +271,8 @@ static void do_blocks(char *infname)
            get_session_record(dev, record, &sessrec);
            free_record(record);
             Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), dcr->VolumeName);
-           
-        } else if (dev->state & ST_EOF) {
-            Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"), 
+        } else if (dev->at_eof()) {
+            Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
               dev->file, dev_name(dev), dcr->VolumeName);
             Dmsg0(20, "read_record got eof. try again\n");
            continue;
@@ -356,14 +351,9 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       return true;
    }
    /* File Attributes stream */
-   if (rec->Stream == STREAM_UNIX_ATTRIBUTES || 
+   if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
        rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
 
-      if (verbose > 1) {
-         const char *rtype = "Attributes";
-         Pmsg5(-1, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
-              rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
-      }
       if (!unpack_attributes_record(jcr, rec->Stream, rec->data, attr)) {
         if (!forge_on) {
             Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
@@ -381,6 +371,10 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       build_attr_output_fnames(jcr, attr);
 
       if (file_is_included(&ff, attr->fname) && !file_is_excluded(&ff, attr->fname)) {
+        if (verbose) {
+            Pmsg5(-1, "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n",
+                 rec->FileIndex, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+        }
         print_ls_output(jcr, attr);
         num_files++;
       }
@@ -395,7 +389,7 @@ static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sess
    memset(sessrec, 0, sizeof(sessrec));
    switch (rec->FileIndex) {
    case PRE_LABEL:
-      rtype = "Fresh Volume Label";   
+      rtype = "Fresh Volume Label";
       break;
    case VOL_LABEL:
       rtype = "Volume Label";
@@ -439,6 +433,6 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    DEVICE *dev = dcr->dev;
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
       dcr->VolumeName, dev_name(dev));
-   getchar();  
+   getchar();
    return true;
 }
index 3a78a0ed2307c3a19a3f03bdeec1a92b913826c3..5c95a3d69b6bf9967e9d215f1ffafaf242e19e4a 100644 (file)
 /* Forward referenced functions */
 static void do_scan(void);
 static bool record_cb(DCR *dcr, DEV_RECORD *rec);
-static int  create_file_attributes_record(B_DB *db, JCR *mjcr, 
+static int  create_file_attributes_record(B_DB *db, JCR *mjcr,
                               char *fname, char *lname, int type,
                               char *ap, DEV_RECORD *rec);
 static int  create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl);
 static bool update_media_record(B_DB *db, MEDIA_DBR *mr);
 static int  create_pool_record(B_DB *db, POOL_DBR *pr);
 static JCR *create_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *label, DEV_RECORD *rec);
-static int  update_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *elabel, 
+static int  update_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *elabel,
                              DEV_RECORD *rec);
 static int  create_client_record(B_DB *db, CLIENT_DBR *cr);
 static int  create_fileset_record(B_DB *db, FILESET_DBR *fsr);
@@ -156,7 +156,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0)
-           debug_level = 1; 
+           debug_level = 1;
         break;
 
       case 'h':
@@ -207,7 +207,7 @@ int main (int argc, char *argv[])
       default:
         usage();
 
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -226,12 +226,12 @@ int main (int argc, char *argv[])
    me = (STORES *)GetNextRes(R_STORAGE, NULL);
    if (!me) {
       UnlockRes();
-      Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"), 
+      Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
         configfile);
    }
    UnlockRes();
    /* Check if -w option given, otherwise use resource for working directory */
-   if (wd) { 
+   if (wd) {
       working_directory = wd;
    } else if (!me->working_directory) {
       Emsg1(M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
@@ -251,7 +251,7 @@ int main (int argc, char *argv[])
    }
 
    bjcr = setup_jcr("bscan", argv[0], bsr, VolumeName, 1); /* read device */
-   if (!bjcr) { 
+   if (!bjcr) {
       exit(1);
    }
    dev = bjcr->dcr->dev;
@@ -262,7 +262,7 @@ int main (int argc, char *argv[])
       Pmsg1(000, _("Current Volume Size = %" llu "\n"), currentVolumeSize);
    }
 
-   if ((db=db_init_database(NULL, db_name, db_user, db_password, 
+   if ((db=db_init_database(NULL, db_name, db_user, db_password,
        db_host, 0, NULL, 0)) == NULL) {
       Emsg0(M_ERROR_TERM, 0, _("Could not init Bacula database\n"));
    }
@@ -283,8 +283,8 @@ int main (int argc, char *argv[])
    term_dev(dev);
    return 0;
 }
-  
-/*  
+
+/*
  * We are at the end of reading a tape. Now, we simulate handling
  *   the end of writing a tape by wiffling through the attached
  *   jcrs creating jobmedia records.
@@ -300,7 +300,7 @@ static bool bscan_mount_next_read_volume(DCR *dcr)
         continue;
       }
       if (verbose) {
-         Pmsg1(000, _("Create JobMedia for Job %s\n"), mjcr->Job);
+        Pmsg1(000, _("Create JobMedia for Job %s\n"), mjcr->Job);
       }
       if (dev->state & ST_TAPE) {
         mdcr->EndBlock = dev->EndBlock;
@@ -310,10 +310,10 @@ static bool bscan_mount_next_read_volume(DCR *dcr)
         mdcr->EndFile = (uint32_t)(dev->file_addr >> 32);
       }
       if (!create_jobmedia_record(db, mjcr)) {
-         Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
+        Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
            dev->VolCatInfo.VolCatName, mjcr->Job);
       }
-   }  
+   }
    /* Now let common read routine get up next tape. Note,
     * we call mount_next... with bscan's jcr because that is where we
     * have the Volume list, but we get attached.
@@ -329,7 +329,7 @@ static bool bscan_mount_next_read_volume(DCR *dcr)
    return stat;
 }
 
-static void do_scan()            
+static void do_scan()
 {
    attr = new_attr();
 
@@ -364,20 +364,20 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       if (showProgress) {
         int64_t pct = (mr.VolBytes * 100) / currentVolumeSize;
         if (pct != last_pct) {
-            fprintf(stdout, "done: %" lld "\n", pct);
+           fprintf(stdout, "done: %" lld "\n", pct);
            fflush(stdout);
            last_pct = pct;
         }
       }
    }
-   
+
    if (list_records) {
       Pmsg5(000, _("Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n"),
-           rec->VolSessionId, rec->VolSessionTime, rec->FileIndex, 
+           rec->VolSessionId, rec->VolSessionTime, rec->FileIndex,
            rec->Stream, rec->data_len);
    }
-   /* 
-    * Check for Start or End of Session Record 
+   /*
+    * Check for Start or End of Session Record
     *
     */
    if (rec->FileIndex < 0) {
@@ -388,7 +388,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       }
       switch (rec->FileIndex) {
       case PRE_LABEL:
-         Pmsg0(000, _("Volume is prelabeled. This tape cannot be scanned.\n"));
+        Pmsg0(000, _("Volume is prelabeled. This tape cannot be scanned.\n"));
         return false;
         break;
 
@@ -400,21 +400,21 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         num_pools++;
         if (db_get_pool_record(bjcr, db, &pr)) {
            if (verbose) {
-               Pmsg1(000, _("Pool record for %s found in DB.\n"), pr.Name);
+              Pmsg1(000, _("Pool record for %s found in DB.\n"), pr.Name);
            }
         } else {
            if (!update_db) {
-               Pmsg1(000, _("VOL_LABEL: Pool record not found for Pool: %s\n"),
+              Pmsg1(000, _("VOL_LABEL: Pool record not found for Pool: %s\n"),
                  pr.Name);
            }
            create_pool_record(db, &pr);
         }
         if (strcmp(pr.PoolType, dev->VolHdr.PoolType) != 0) {
-            Pmsg2(000, _("VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n"),
+           Pmsg2(000, _("VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n"),
               pr.PoolType, dev->VolHdr.PoolType);
            return true;
         } else if (verbose) {
-            Pmsg1(000, _("Pool type \"%s\" is OK.\n"), pr.PoolType);
+           Pmsg1(000, _("Pool type \"%s\" is OK.\n"), pr.PoolType);
         }
 
         /* Check Media Info */
@@ -424,25 +424,25 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         num_media++;
         if (db_get_media_record(bjcr, db, &mr)) {
            if (verbose) {
-               Pmsg1(000, _("Media record for %s found in DB.\n"), mr.VolumeName);
+              Pmsg1(000, _("Media record for %s found in DB.\n"), mr.VolumeName);
            }
            /* Clear out some volume statistics that will be updated */
            mr.VolJobs = mr.VolFiles = mr.VolBlocks = 0;
            mr.VolBytes = rec->data_len + 20;
         } else {
            if (!update_db) {
-               Pmsg1(000, _("VOL_LABEL: Media record not found for Volume: %s\n"),
+              Pmsg1(000, _("VOL_LABEL: Media record not found for Volume: %s\n"),
                  mr.VolumeName);
            }
            bstrncpy(mr.MediaType, dev->VolHdr.MediaType, sizeof(mr.MediaType));
            create_media_record(db, &mr, &dev->VolHdr);
         }
         if (strcmp(mr.MediaType, dev->VolHdr.MediaType) != 0) {
-            Pmsg2(000, _("VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n"),
+           Pmsg2(000, _("VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n"),
               mr.MediaType, dev->VolHdr.MediaType);
            return true;              /* ignore error */
         } else if (verbose) {
-            Pmsg1(000, _("Media type \"%s\" is OK.\n"), mr.MediaType);
+           Pmsg1(000, _("Media type \"%s\" is OK.\n"), mr.MediaType);
         }
         /* Reset some JCR variables */
         foreach_dlist(dcr, dev->attached_dcrs) {
@@ -451,14 +451,14 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
            dcr->StartFile = dcr->EndFile = 0;
         }
 
-         Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName);
+        Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName);
         break;
 
       case SOS_LABEL:
         mr.VolJobs++;
         num_jobs++;
         if (ignored_msgs > 0) {
-            Pmsg1(000, _("%d \"errors\" ignored before first Start of Session record.\n"), 
+           Pmsg1(000, _("%d \"errors\" ignored before first Start of Session record.\n"),
                  ignored_msgs);
            ignored_msgs = 0;
         }
@@ -467,14 +467,14 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         bstrncpy(jr.Job, label.Job, sizeof(jr.Job));
         if (db_get_job_record(bjcr, db, &jr)) {
            /* Job record already exists in DB */
-            update_db = false;  /* don't change db in create_job_record */
+           update_db = false;  /* don't change db in create_job_record */
            if (verbose) {
-               Pmsg1(000, _("SOS_LABEL: Found Job record for JobId: %d\n"), jr.JobId);
+              Pmsg1(000, _("SOS_LABEL: Found Job record for JobId: %d\n"), jr.JobId);
            }
         } else {
            /* Must create a Job record in DB */
            if (!update_db) {
-               Pmsg1(000, _("SOS_LABEL: Job record not found for JobId: %d\n"),
+              Pmsg1(000, _("SOS_LABEL: Job record not found for JobId: %d\n"),
                  jr.JobId);
            }
         }
@@ -483,7 +483,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
            create_client_record(db, &cr);
            jr.ClientId = cr.ClientId;
 
-         /* process label, if Job record exists don't update db */
+        /* process label, if Job record exists don't update db */
         mjcr = create_job_record(db, &jr, &label, rec);
         dcr = mjcr->dcr;
         update_db = save_update_db;
@@ -493,8 +493,8 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         if (dev->state & ST_TAPE) {
            /*
             * Note, we have already advanced past current block,
-            *  so the correct number is block_num - 1 
-            */ 
+            *  so the correct number is block_num - 1
+            */
            dcr->StartBlock = dev->block_num - 1;
            dcr->StartFile = dev->file;
         } else {
@@ -512,19 +512,19 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         bstrncpy(dcr->pool_name, label.PoolName, sizeof(dcr->pool_name));
 
         if (rec->VolSessionId != jr.VolSessionId) {
-            Pmsg3(000, _("SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n"),
+           Pmsg3(000, _("SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n"),
               jr.JobId,
               jr.VolSessionId, rec->VolSessionId);
            return true;              /* ignore error */
         }
         if (rec->VolSessionTime != jr.VolSessionTime) {
-            Pmsg3(000, _("SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n"),
+           Pmsg3(000, _("SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n"),
               jr.JobId,
               jr.VolSessionTime, rec->VolSessionTime);
            return true;              /* ignore error */
         }
         if (jr.PoolId != pr.PoolId) {
-            Pmsg3(000, _("SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n"),
+           Pmsg3(000, _("SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n"),
               jr.JobId,
               jr.PoolId, pr.PoolId);
            return true;              /* ignore error */
@@ -542,7 +542,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
         mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
         if (!mjcr) {
-            Pmsg2(000, _("Could not find SessId=%d SessTime=%d for EOS record.\n"),
+           Pmsg2(000, _("Could not find SessId=%d SessTime=%d for EOS record.\n"),
                  rec->VolSessionId, rec->VolSessionTime);
            break;
         }
@@ -564,7 +564,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         break;
 
       case EOT_LABEL:             /* end of all tapes */
-        /* 
+        /*
          * Wiffle through all jobs still open and close
          *   them.
          */
@@ -585,7 +585,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
               jr.JobTDate = (utime_t)mjcr->start_time;
               jr.ClientId = mjcr->ClientId;
               if (!db_update_job_end_record(bjcr, db, &jr)) {
-                  Pmsg1(0, _("Could not update job record. ERR=%s\n"), db_strerror(db));
+                 Pmsg1(0, _("Could not update job record. ERR=%s\n"), db_strerror(db));
               }
               mjcr->dcr = NULL;
               free_jcr(mjcr);
@@ -596,7 +596,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
         mr.VolBytes += mr.VolBlocks * WRITE_BLKHDR_LENGTH; /* approx. */
         mr.VolMounts++;
         update_media_record(db, &mr);
-         Pmsg3(0, _("End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n"), mr.VolFiles,
+        Pmsg3(0, _("End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n"), mr.VolFiles,
                    mr.VolBlocks, edit_uint64_with_commas(mr.VolBytes, ec1));
         break;
       default:
@@ -608,7 +608,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
    mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
    if (!mjcr) {
       if (mr.VolJobs > 0) {
-         Pmsg2(000, _("Could not find Job for SessId=%d SessTime=%d record.\n"),
+        Pmsg2(000, _("Could not find Job for SessId=%d SessTime=%d record.\n"),
                      rec->VolSessionId, rec->VolSessionTime);
       } else {
         ignored_msgs++;
@@ -622,18 +622,18 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
    /* File Attributes stream */
    switch (rec->Stream) {
-   case STREAM_UNIX_ATTRIBUTES:   
-   case STREAM_UNIX_ATTRIBUTES_EX:  
+   case STREAM_UNIX_ATTRIBUTES:
+   case STREAM_UNIX_ATTRIBUTES_EX:
 
       if (!unpack_attributes_record(bjcr, rec->Stream, rec->data, attr)) {
-         Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
+        Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
       }
 
       if (attr->file_index != rec->FileIndex) {
-         Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
+        Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
            rec->FileIndex, attr->file_index);
       }
-       
+
       if (verbose > 1) {
         decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
         build_attr_output_fnames(bjcr, attr);
@@ -644,13 +644,13 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       num_files++;
       if (verbose && (num_files & 0x7FFF) == 0) {
         char ed1[30], ed2[30], ed3[30], ed4[30];
-         Pmsg4(000, _("%s file records. At file:blk=%s:%s bytes=%s\n"),
+        Pmsg4(000, _("%s file records. At file:blk=%s:%s bytes=%s\n"),
                     edit_uint64_with_commas(num_files, ed1),
                     edit_uint64_with_commas(rec->File, ed2),
                     edit_uint64_with_commas(rec->Block, ed3),
                     edit_uint64_with_commas(mr.VolBytes, ed4));
-      } 
-      create_file_attributes_record(db, mjcr, attr->fname, attr->lname, 
+      }
+      create_file_attributes_record(db, mjcr, attr->fname, attr->lname,
            attr->type, attr->attr, rec);
       free_jcr(mjcr);
       break;
@@ -663,7 +663,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       if (rec->Stream == STREAM_SPARSE_DATA) {
         mjcr->JobBytes -= sizeof(uint64_t);
       }
-        
+
       free_jcr(mjcr);                /* done using JCR */
       break;
 
@@ -687,7 +687,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       char MD5buf[50];
       bin_to_base64(MD5buf, (char *)rec->data, 16); /* encode 16 bytes */
       if (verbose > 1) {
-         Pmsg1(000, _("Got MD5 record: %s\n"), MD5buf);
+        Pmsg1(000, _("Got MD5 record: %s\n"), MD5buf);
       }
       update_SIG_record(db, MD5buf, rec, MD5_SIG);
       break;
@@ -696,7 +696,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       char SIGbuf[50];
       bin_to_base64(SIGbuf, (char *)rec->data, 20); /* encode 20 bytes */
       if (verbose > 1) {
-         Pmsg1(000, _("Got SHA1 record: %s\n"), SIGbuf);
+        Pmsg1(000, _("Got SHA1 record: %s\n"), SIGbuf);
       }
       update_SIG_record(db, SIGbuf, rec, SHA1_SIG);
       break;
@@ -704,13 +704,13 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
    case STREAM_PROGRAM_NAMES:
       if (verbose) {
-         Pmsg1(000, _("Got Prog Names Stream: %s\n"), rec->data);
+        Pmsg1(000, _("Got Prog Names Stream: %s\n"), rec->data);
       }
       break;
 
    case STREAM_PROGRAM_DATA:
       if (verbose > 1) {
-         Pmsg0(000, _("Got Prog Data Stream record.\n"));
+        Pmsg0(000, _("Got Prog Data Stream record.\n"));
       }
       break;
    default:
@@ -780,7 +780,7 @@ static int create_file_attributes_record(B_DB *db, JCR *mjcr,
    mjcr->FileId = ar.FileId;
 
    if (verbose > 1) {
-      Pmsg1(000, _("Created File record: %s\n"), fname);   
+      Pmsg1(000, _("Created File record: %s\n"), fname);
    }
    return 1;
 }
@@ -875,7 +875,7 @@ static int create_pool_record(B_DB *db, POOL_DBR *pr)
 
 
 /*
- * Called from SOS to create a client for the current Job 
+ * Called from SOS to create a client for the current Job
  */
 static int create_client_record(B_DB *db, CLIENT_DBR *cr)
 {
@@ -904,16 +904,16 @@ static int create_fileset_record(B_DB *db, FILESET_DBR *fsr)
    }
    if (db_get_fileset_record(bjcr, db, fsr)) {
       if (verbose) {
-         Pmsg1(000, _("Fileset \"%s\" already exists.\n"), fsr->FileSet);
+        Pmsg1(000, _("Fileset \"%s\" already exists.\n"), fsr->FileSet);
       }
    } else {
       if (!db_create_fileset_record(bjcr, db, fsr)) {
-         Pmsg2(0, _("Could not create FileSet record \"%s\". ERR=%s\n"), 
+        Pmsg2(0, _("Could not create FileSet record \"%s\". ERR=%s\n"),
            fsr->FileSet, db_strerror(db));
         return 0;
       }
       if (verbose) {
-         Pmsg1(000, _("Created FileSet record \"%s\"\n"), fsr->FileSet);
+        Pmsg1(000, _("Created FileSet record \"%s\"\n"), fsr->FileSet);
       }
    }
    return 1;
@@ -924,7 +924,7 @@ static int create_fileset_record(B_DB *db, FILESET_DBR *fsr)
  *  the Job record and to update it when the Job actually
  *  begins running.
  */
-static JCR *create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label, 
+static JCR *create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label,
                             DEV_RECORD *rec)
 {
    JCR *mjcr;
@@ -969,14 +969,14 @@ static JCR *create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label,
       Pmsg1(0, _("Could not update job start record. ERR=%s\n"), db_strerror(db));
       return mjcr;
    }
-   Pmsg2(000, _("Created new JobId=%u record for original JobId=%u\n"), jr->JobId, 
+   Pmsg2(000, _("Created new JobId=%u record for original JobId=%u\n"), jr->JobId,
         label->JobId);
    mjcr->JobId = jr->JobId;          /* set new JobId */
    return mjcr;
 }
 
-/* 
- * Simulate the database call that updates the Job 
+/*
+ * Simulate the database call that updates the Job
  *  at Job termination time.
  */
 static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
@@ -1017,7 +1017,7 @@ static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
       free_jcr(mjcr);
       return 1;
    }
-   
+
    if (!db_update_job_end_record(bjcr, db, jr)) {
       Pmsg2(0, _("Could not update JobId=%u record. ERR=%s\n"), jr->JobId,  db_strerror(db));
       free_jcr(mjcr);
@@ -1035,36 +1035,36 @@ static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
 
       switch (mjcr->JobStatus) {
       case JS_Terminated:
-         term_msg = _("Backup OK");
+        term_msg = _("Backup OK");
         break;
       case JS_FatalError:
       case JS_ErrorTerminated:
-         term_msg = _("*** Backup Error ***");
+        term_msg = _("*** Backup Error ***");
         break;
       case JS_Canceled:
-         term_msg = _("Backup Canceled");
+        term_msg = _("Backup Canceled");
         break;
       default:
         term_msg = term_code;
-         sprintf(term_code, _("Job Termination code: %d"), mjcr->JobStatus);
+        sprintf(term_code, _("Job Termination code: %d"), mjcr->JobStatus);
         break;
       }
       bstrftime(sdt, sizeof(sdt), mjcr->start_time);
       bstrftime(edt, sizeof(edt), mjcr->end_time);
-      Pmsg14(000,  _("%s\n\
-JobId:                  %d\n\
-Job:                    %s\n\
-FileSet:                %s\n\
-Backup Level:           %s\n\
-Client:                 %s\n\
-Start time:             %s\n\
-End time:               %s\n\
-Files Written:          %s\n\
-Bytes Written:          %s\n\
-Volume Session Id:      %d\n\
-Volume Session Time:    %d\n\
-Last Volume Bytes:      %s\n\
-Termination:            %s\n\n"),
+      Pmsg14(000,  _("%s\n"
+"JobId:                  %d\n"
+"Job:                    %s\n"
+"FileSet:                %s\n"
+"Backup Level:           %s\n"
+"Client:                 %s\n"
+"Start time:             %s\n"
+"End time:               %s\n"
+"Files Written:          %s\n"
+"Bytes Written:          %s\n"
+"Volume Session Id:      %d\n"
+"Volume Session Time:    %d\n"
+"Last Volume Bytes:      %s\n"
+"Termination:            %s\n\n"),
        edt,
        mjcr->JobId,
        mjcr->Job,
@@ -1117,13 +1117,13 @@ static int create_jobmedia_record(B_DB *db, JCR *mjcr)
       return 0;
    }
    if (verbose) {
-      Pmsg2(000, _("Created JobMedia record JobId %d, MediaId %d\n"), 
+      Pmsg2(000, _("Created JobMedia record JobId %d, MediaId %d\n"),
                jmr.JobId, jmr.MediaId);
    }
    return 1;
 }
 
-/* 
+/*
  * Simulate the database call that updates the MD5/SHA1 record
  */
 static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type)
@@ -1133,7 +1133,7 @@ static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type)
    mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
    if (!mjcr) {
       if (mr.VolJobs > 0) {
-         Pmsg2(000, _("Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n"),
+        Pmsg2(000, _("Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n"),
                      rec->VolSessionId, rec->VolSessionTime);
       } else {
         ignored_msgs++;
@@ -1145,7 +1145,7 @@ static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type)
       free_jcr(mjcr);
       return 1;
    }
-   
+
    if (!db_add_SIG_to_file_record(bjcr, db, mjcr->FileId, SIGbuf, type)) {
       Pmsg1(0, _("Could not add MD5/SHA1 to File record. ERR=%s\n"), db_strerror(db));
       free_jcr(mjcr);
@@ -1159,7 +1159,7 @@ static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type)
 }
 
 
-/* 
+/*
  * Create a JCR as if we are really starting the job
  */
 static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId)
@@ -1206,6 +1206,6 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    force_close_dev(dev);
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
         dcr->VolumeName, dev_name(dev));
-   getchar();  
+   getchar();
    return true;
 }
index c44643baf1d0b2083158452e40428d4047b59fcc..9d18ea0b903c7f47f004baad8ebc4012ab85935a 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
 /*
  * List of Volume names to be read by Storage daemon.
- *  Formed by Storage daemon from BSR  
+ *  Formed by Storage daemon from BSR
  */
 struct VOL_LIST {
    VOL_LIST *next;
    char VolumeName[MAX_NAME_LENGTH];
-   int Slot; 
+   char MediaType[MAX_NAME_LENGTH];
+   int Slot;
    uint32_t start_file;
 };
 
@@ -54,12 +55,13 @@ struct VOL_LIST {
 struct BSR_VOLUME {
    BSR_VOLUME *next;
    char VolumeName[MAX_NAME_LENGTH];
-};           
+   char MediaType[MAX_NAME_LENGTH];
+};
 
 struct BSR_CLIENT {
    BSR_CLIENT *next;
    char ClientName[MAX_NAME_LENGTH];
-};           
+};
 
 struct BSR_SESSID {
    BSR_SESSID *next;
@@ -71,7 +73,7 @@ struct BSR_SESSTIME {
    BSR_SESSTIME *next;
    uint32_t sesstime;
    bool done;                         /* local done */
-};             
+};
 
 struct BSR_VOLFILE {
    BSR_VOLFILE *next;
@@ -85,7 +87,7 @@ struct BSR_VOLBLOCK {
    uint32_t sblock;                   /* start block */
    uint32_t eblock;                   /* end block */
    bool done;                         /* local done */
-};             
+};
 
 
 struct BSR_FINDEX {
@@ -93,23 +95,23 @@ struct BSR_FINDEX {
    int32_t findex;                    /* start file index */
    int32_t findex2;                   /* end file index */
    bool done;                         /* local done */
-};           
+};
 
 struct BSR_JOBID {
    BSR_JOBID *next;
    uint32_t JobId;
    uint32_t JobId2;
-};          
+};
 
 struct BSR_JOBTYPE {
    BSR_JOBTYPE *next;
    uint32_t JobType;
-};            
+};
 
 struct BSR_JOBLEVEL {
    BSR_JOBLEVEL *next;
    uint32_t JobLevel;
-};             
+};
 
 struct BSR_JOB {
    BSR_JOB *next;
@@ -120,7 +122,7 @@ struct BSR_JOB {
 struct BSR_STREAM {
    BSR_STREAM *next;
    int32_t stream;                    /* stream desired */
-};           
+};
 
 struct BSR {
    BSR          *next;                /* pointer to next one */
index f1578f87466ee85fc70a6602eff76b9425aadef6..99ddfa7a91c0ccdf759551489dfdd17ead874fc0 100644 (file)
@@ -149,9 +149,9 @@ int main(int margc, char *margv[])
    char buf[1000];
 
    /* Sanity checks */
-   if (TAPE_BSIZE % DEV_BSIZE != 0 || TAPE_BSIZE / DEV_BSIZE == 0) {
+   if (TAPE_BSIZE % B_DEV_BSIZE != 0 || TAPE_BSIZE / B_DEV_BSIZE == 0) {
       Emsg2(M_ABORT, 0, "Tape block size (%d) not multiple of system size (%d)\n",
-        TAPE_BSIZE, DEV_BSIZE);
+        TAPE_BSIZE, B_DEV_BSIZE);
    }
    if (TAPE_BSIZE != (1 << (ffs(TAPE_BSIZE)-1))) {
       Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
index ac75f9732c6302805766c557005c42eba0e0df61..bf24555d208b1c3402081c36e8a54e3b73ee36d9 100644 (file)
@@ -2,18 +2,18 @@
  *
  *   dev.c  -- low level operations on device (storage device)
  *
- *             Kern Sibbald, MM 
+ *              Kern Sibbald, MM 
  *
  *     NOTE!!!! None of these routines are reentrant. You must
- *       use lock_device() and unlock_device() at a higher level,
- *       or use the xxx_device() equivalents.  By moving the
- *       thread synchronization to a higher level, we permit
+ *        use lock_device() and unlock_device() at a higher level,
+ *        or use the xxx_device() equivalents.  By moving the
+ *        thread synchronization to a higher level, we permit
  *        the higher level routines to "seize" the device and 
- *       to carry out operations without worrying about who
- *       set what lock (i.e. race conditions).
+ *        to carry out operations without worrying about who
+ *        set what lock (i.e. race conditions).
  *
  *     Note, this is the device dependent code, and my have
- *          to be modified for each system, but is meant to
+ *           to be modified for each system, but is meant to
  *           be as "generic" as possible.
  * 
  *     The purpose of this code is to develop a SIMPLE Storage
@@ -106,10 +106,10 @@ init_dev(DEVICE *dev, DEVRES *device)
    if (stat(device->device_name, &statp) < 0) {
       berrno be;
       if (dev) {
-        dev->dev_errno = errno;
+         dev->dev_errno = errno;
       } 
       Emsg2(M_FATAL, 0, "Unable to stat device %s : %s\n", device->device_name, 
-           be.strerror());
+            be.strerror());
       return NULL;
    }
    tape = false;
@@ -122,10 +122,10 @@ init_dev(DEVICE *dev, DEVRES *device)
       fifo = true;
    } else {
       if (dev) {
-        dev->dev_errno = ENODEV;
+         dev->dev_errno = ENODEV;
       }
       Emsg2(M_FATAL, 0, _("%s is an unknown device type. Must be tape or directory. st_mode=%x\n"),
-        device->device_name, statp.st_mode);
+         device->device_name, statp.st_mode);
       return NULL;
    }
    if (!dev) {
@@ -168,14 +168,14 @@ init_dev(DEVICE *dev, DEVRES *device)
 
    if (dev->max_block_size > 1000000) {
       Emsg3(M_ERROR, 0, _("Block size %u on device %s is too large, using default %u\n"), 
-        dev->max_block_size, dev->dev_name, DEFAULT_BLOCK_SIZE);
+         dev->max_block_size, dev->dev_name, DEFAULT_BLOCK_SIZE);
       dev->max_block_size = 0;
    }
    if (dev->max_block_size % TAPE_BSIZE != 0) {
       Emsg2(M_WARNING, 0, _("Max block size %u not multiple of device %s block size.\n"),
-        dev->max_block_size, dev->dev_name);
+         dev->max_block_size, dev->dev_name);
    }   
-        
+         
    dev->errmsg = get_pool_memory(PM_EMSG);
    *dev->errmsg = 0;
 
@@ -239,11 +239,11 @@ open_dev(DEVICE *dev, char *VolName, int mode)
        *  starts and snatches up the device.
        */
       if (VolName && strcmp(dev->VolCatInfo.VolCatName, VolName) != 0) {
-        return -1;
+         return -1;
       }
       dev->use_count++;
       Mmsg2(&dev->errmsg, _("WARNING!!!! device %s opened %d times!!!\n"), 
-           dev->dev_name, dev->use_count);
+            dev->dev_name, dev->use_count);
       Emsg1(M_WARNING, 0, "%s", dev->errmsg);
       return dev->fd;
    }
@@ -252,60 +252,60 @@ open_dev(DEVICE *dev, char *VolName, int mode)
    }
 
    Dmsg3(29, "open_dev: tape=%d dev_name=%s vol=%s\n", dev_is_tape(dev), 
-        dev->dev_name, dev->VolCatInfo.VolCatName);
+         dev->dev_name, dev->VolCatInfo.VolCatName);
    dev->state &= ~(ST_LABEL|ST_APPEND|ST_READ|ST_EOT|ST_WEOT|ST_EOF);
    dev->file_size = 0;
    if (dev->state & (ST_TAPE|ST_FIFO)) {
       int timeout;
       Dmsg0(29, "open_dev: device is tape\n");
       if (mode == OPEN_READ_WRITE) {
-        dev->mode = O_RDWR | O_BINARY;
+         dev->mode = O_RDWR | O_BINARY;
       } else if (mode == OPEN_READ_ONLY) {
-        dev->mode = O_RDONLY | O_BINARY;
+         dev->mode = O_RDONLY | O_BINARY;
       } else if (mode == OPEN_WRITE_ONLY) {
-        dev->mode = O_WRONLY | O_BINARY;
+         dev->mode = O_WRONLY | O_BINARY;
       } else {
          Emsg0(M_ABORT, 0, _("Illegal mode given to open_dev.\n")); 
       }
       timeout = dev->max_open_wait;
       errno = 0;
       if (dev->state & ST_FIFO && timeout) {
-        /* Set open timer */
-        dev->tid = start_thread_timer(pthread_self(), timeout);
+         /* Set open timer */
+         dev->tid = start_thread_timer(pthread_self(), timeout);
       }
       /* If busy retry each second for max_open_wait seconds */
       while ((dev->fd = open(dev->dev_name, dev->mode, MODE_RW)) < 0) {
-        berrno be;
-        if (errno == EINTR || errno == EAGAIN) {
-           continue;
-        }
-        if (errno == EBUSY && timeout-- > 0) {
+         berrno be;
+         if (errno == EINTR || errno == EAGAIN) {
+            continue;
+         }
+         if (errno == EBUSY && timeout-- > 0) {
             Dmsg2(100, "Device %s busy. ERR=%s\n", dev->dev_name, be.strerror());
-           bmicrosleep(1, 0);
-           continue;
-        }
-        dev->dev_errno = errno;
+            bmicrosleep(1, 0);
+            continue;
+         }
+         dev->dev_errno = errno;
          Mmsg2(&dev->errmsg, _("stored: unable to open device %s: ERR=%s\n"), 
-              dev->dev_name, be.strerror());
-        /* Stop any open timer we set */
-        if (dev->tid) {
-           stop_thread_timer(dev->tid);
-           dev->tid = 0;
-        }
-        Emsg0(M_FATAL, 0, dev->errmsg);
-        break;
+               dev->dev_name, be.strerror());
+         /* Stop any open timer we set */
+         if (dev->tid) {
+            stop_thread_timer(dev->tid);
+            dev->tid = 0;
+         }
+         Emsg0(M_FATAL, 0, dev->errmsg);
+         break;
       }
       if (dev->fd >= 0) {
-        dev->dev_errno = 0;
-        dev->state |= ST_OPENED;
-        dev->use_count = 1;
-        update_pos_dev(dev);             /* update position */
-        set_os_device_parameters(dev);      /* do system dependent stuff */
+         dev->dev_errno = 0;
+         dev->state |= ST_OPENED;
+         dev->use_count = 1;
+         update_pos_dev(dev);             /* update position */
+         set_os_device_parameters(dev);      /* do system dependent stuff */
       }
       /* Stop any open() timer we started */
       if (dev->tid) {
-        stop_thread_timer(dev->tid);
-        dev->tid = 0;
+         stop_thread_timer(dev->tid);
+         dev->tid = 0;
       }
       Dmsg1(29, "open_dev: tape %d opened\n", dev->fd);
    } else {
@@ -314,8 +314,8 @@ open_dev(DEVICE *dev, char *VolName, int mode)
        */
       if (VolName == NULL || *VolName == 0) {
          Mmsg(dev->errmsg, _("Could not open file device %s. No Volume name given.\n"),
-           dev->dev_name);
-        return -1;
+            dev->dev_name);
+         return -1;
       }
       archive_name = get_pool_memory(PM_FNAME);
       pm_strcpy(archive_name, dev->dev_name);
@@ -325,25 +325,25 @@ open_dev(DEVICE *dev, char *VolName, int mode)
       pm_strcat(archive_name, VolName);
       Dmsg1(29, "open_dev: device is disk %s\n", archive_name);
       if (mode == OPEN_READ_WRITE) {
-        dev->mode = O_CREAT | O_RDWR | O_BINARY;
+         dev->mode = O_CREAT | O_RDWR | O_BINARY;
       } else if (mode == OPEN_READ_ONLY) {
-        dev->mode = O_RDONLY | O_BINARY;
+         dev->mode = O_RDONLY | O_BINARY;
       } else if (mode == OPEN_WRITE_ONLY) {
-        dev->mode = O_WRONLY | O_BINARY;
+         dev->mode = O_WRONLY | O_BINARY;
       } else {
          Emsg0(M_ABORT, 0, _("Illegal mode given to open_dev.\n")); 
       }
       /* If creating file, give 0640 permissions */
       if ((dev->fd = open(archive_name, dev->mode, 0640)) < 0) {
-        berrno be;
-        dev->dev_errno = errno;
+         berrno be;
+         dev->dev_errno = errno;
          Mmsg2(&dev->errmsg, _("Could not open: %s, ERR=%s\n"), archive_name, be.strerror());
-        Emsg0(M_FATAL, 0, dev->errmsg);
+         Emsg0(M_FATAL, 0, dev->errmsg);
       } else {
-        dev->dev_errno = 0;
-        dev->state |= ST_OPENED;
-        dev->use_count = 1;
-        update_pos_dev(dev);                /* update position */
+         dev->dev_errno = 0;
+         dev->state |= ST_OPENED;
+         dev->use_count = 1;
+         update_pos_dev(dev);                /* update position */
       }
       Dmsg1(29, "open_dev: disk fd=%d opened\n", dev->fd);
       free_pool_memory(archive_name);
@@ -364,7 +364,7 @@ bool _rewind_dev(char *file, int line, DEVICE *dev)
 /*
  * Rewind the device.
  *  Returns: true  on success
- *          false on failure
+ *           false on failure
  */
 bool rewind_dev(DEVICE *dev)
 {
@@ -375,7 +375,7 @@ bool rewind_dev(DEVICE *dev)
    if (dev->fd < 0) {
       dev->dev_errno = EBADF;
       Mmsg1(&dev->errmsg, _("Bad call to rewind_dev. Device %s not open\n"),
-           dev->dev_name);
+            dev->dev_name);
       Emsg0(M_ABORT, 0, dev->errmsg);
       return false;
    }
@@ -391,30 +391,30 @@ bool rewind_dev(DEVICE *dev)
        * retrying every 5 seconds.
        */
       for (i=dev->max_rewind_wait; ; i -= 5) {
-        if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-           berrno be;
-           clrerror_dev(dev, MTREW);
-           if (i == dev->max_rewind_wait) {
+         if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
+            berrno be;
+            clrerror_dev(dev, MTREW);
+            if (i == dev->max_rewind_wait) {
                Dmsg1(200, "Rewind error, %s. retrying ...\n", be.strerror());
-           }
-           if (dev->dev_errno == EIO && i > 0) {
+            }
+            if (dev->dev_errno == EIO && i > 0) {
                Dmsg0(200, "Sleeping 5 seconds.\n");
-              bmicrosleep(5, 0);
-              continue;
-           }
+               bmicrosleep(5, 0);
+               continue;
+            }
             Mmsg2(&dev->errmsg, _("Rewind error on %s. ERR=%s.\n"),
-              dev->dev_name, be.strerror());
-           return false;
-        }
-        break;
+               dev->dev_name, be.strerror());
+            return false;
+         }
+         break;
       }
    } else if (dev->state & ST_FILE) {
       if (lseek(dev->fd, (off_t)0, SEEK_SET) < 0) {
-        berrno be;
-        dev->dev_errno = errno;
+         berrno be;
+         dev->dev_errno = errno;
          Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        return false;
+            dev->dev_name, be.strerror());
+         return false;
       }
    }
    return true;
@@ -423,7 +423,7 @@ bool rewind_dev(DEVICE *dev)
 /* 
  * Position device to end of medium (end of data)
  *  Returns: 1 on succes
- *          0 on error
+ *           0 on error
  */
 int 
 eod_dev(DEVICE *dev)
@@ -448,14 +448,14 @@ eod_dev(DEVICE *dev)
       pos = lseek(dev->fd, (off_t)0, SEEK_END);
 //    Dmsg1(100, "====== Seek to %lld\n", pos);
       if (pos >= 0) {
-        update_pos_dev(dev);
-        dev->state |= ST_EOT;
-        return 1;
+         update_pos_dev(dev);
+         dev->state |= ST_EOT;
+         return 1;
       }
       dev->dev_errno = errno;
       berrno be;
       Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
-            dev->dev_name, be.strerror());
+             dev->dev_name, be.strerror());
       return 0;
    }
 #ifdef MTEOM
@@ -464,9 +464,9 @@ eod_dev(DEVICE *dev)
       struct mtget mt_stat;
       Dmsg0(100,"Using FAST FSF for EOM\n");
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno <= 0) {
-       if (!rewind_dev(dev)) {
-         return 0;
-       }
+        if (!rewind_dev(dev)) {
+          return 0;
+        }
       }
       mt_com.mt_op = MTFSF;
       /*
@@ -475,7 +475,7 @@ eod_dev(DEVICE *dev)
        */
       mt_com.mt_count = INT16_MAX;    /* use big positive number */
       if (mt_com.mt_count < 0) {
-        mt_com.mt_count = INT16_MAX; /* brain damaged system */
+         mt_com.mt_count = INT16_MAX; /* brain damaged system */
       }
    }
 
@@ -486,21 +486,21 @@ eod_dev(DEVICE *dev)
    }
    if (dev_cap(dev, CAP_FASTFSF) || dev_cap(dev, CAP_EOM)) {
       if ((stat=ioctl(dev->fd, MTIOCTOP, (char *)&mt_com)) < 0) {
-        berrno be;
-        clrerror_dev(dev, mt_com.mt_op);
+         berrno be;
+         clrerror_dev(dev, mt_com.mt_op);
          Dmsg1(50, "ioctl error: %s\n", be.strerror());
-        update_pos_dev(dev);
+         update_pos_dev(dev);
          Mmsg2(&dev->errmsg, _("ioctl MTEOM error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        return 0;
+            dev->dev_name, be.strerror());
+         return 0;
       }
 
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
-        berrno be;
-        clrerror_dev(dev, -1);
+         berrno be;
+         clrerror_dev(dev, -1);
          Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        return 0;
+            dev->dev_name, be.strerror());
+         return 0;
       }
       Dmsg2(100, "EOD file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno);
       dev->file = mt_stat.mt_fileno;
@@ -513,7 +513,7 @@ eod_dev(DEVICE *dev)
    {
 #endif
       if (!rewind_dev(dev)) {
-        return 0;
+         return 0;
       }
       /* 
        * Move file by file to the end of the tape
@@ -521,27 +521,27 @@ eod_dev(DEVICE *dev)
       int file_num;
       for (file_num=dev->file; !(dev->state & ST_EOT); file_num++) {
          Dmsg0(200, "eod_dev: doing fsf 1\n");
-        if (!fsf_dev(dev, 1)) {
+         if (!fsf_dev(dev, 1)) {
             Dmsg0(200, "fsf_dev error.\n");
-           return 0;
-        }
-        /*
-         * Avoid infinite loop. ***FIXME*** possibly add code
-         *   to set EOD or to turn off CAP_FASTFSF if on.
-         */
-        if (file_num == (int)dev->file) {
-           struct mtget mt_stat;
+            return 0;
+         }
+         /*
+          * Avoid infinite loop. ***FIXME*** possibly add code
+          *   to set EOD or to turn off CAP_FASTFSF if on.
+          */
+         if (file_num == (int)dev->file) {
+            struct mtget mt_stat;
             Dmsg1(100, "fsf_dev did not advance from file %d\n", file_num);
 #ifndef HAVE_OPENBSD_OS
-           if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && 
-                     mt_stat.mt_fileno >= 0) {
+            if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && 
+                      mt_stat.mt_fileno >= 0) {
                Dmsg2(100, "Adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno);
-              dev->file = mt_stat.mt_fileno;
-           }
+               dev->file = mt_stat.mt_fileno;
+            }
 #endif
-           stat = 0;
-           break;                    /* we are not progressing, bail out */
-        }
+            stat = 0;
+            break;                    /* we are not progressing, bail out */
+         }
       }
    }
    /*
@@ -556,12 +556,12 @@ eod_dev(DEVICE *dev)
       /* If BSF worked and fileno is known (not -1), set file */
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno >= 0) {
          Dmsg2(100, "BSFATEOF adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno);
-        dev->file = mt_stat.mt_fileno;
+         dev->file = mt_stat.mt_fileno;
       } else {
-        dev->file++;                 /* wing it -- not correct on all OSes */
+         dev->file++;                 /* wing it -- not correct on all OSes */
       }
    } else {
-      update_pos_dev(dev);                  /* update position */
+      update_pos_dev(dev);                   /* update position */
       stat = 1;
    }
    Dmsg1(200, "EOD dev->file=%d\n", dev->file);
@@ -572,7 +572,7 @@ eod_dev(DEVICE *dev)
  * Set the position of the device -- only for files
  *   For other devices, there is no generic way to do it.
  *  Returns: true  on succes
- *          false on error
+ *           false on error
  */
 bool update_pos_dev(DEVICE *dev)
 {
@@ -592,14 +592,14 @@ bool update_pos_dev(DEVICE *dev)
       dev->file_addr = 0;
       pos = lseek(dev->fd, (off_t)0, SEEK_CUR);
       if (pos < 0) {
-        berrno be;
-        dev->dev_errno = errno;
+         berrno be;
+         dev->dev_errno = errno;
          Pmsg1(000, "Seek error: ERR=%s\n", be.strerror());
          Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        ok = false;
+            dev->dev_name, be.strerror());
+         ok = false;
       } else {
-        dev->file_addr = pos;
+         dev->file_addr = pos;
       }
    }
    return ok;
@@ -633,49 +633,49 @@ uint32_t status_dev(DEVICE *dev)
       Dmsg0(-20," Bacula status:");
       Dmsg2(-20," file=%d block=%d\n", dev->file, dev->block_num);
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
-        berrno be;
-        dev->dev_errno = errno;
+         berrno be;
+         dev->dev_errno = errno;
          Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        return 0;
+            dev->dev_name, be.strerror());
+         return 0;
       }
       Dmsg0(-20, " Device status:");
 
 #if defined(HAVE_LINUX_OS)
       if (GMT_EOF(mt_stat.mt_gstat)) {
-        stat |= BMT_EOF;
+         stat |= BMT_EOF;
          Dmsg0(-20, " EOF");
       }
       if (GMT_BOT(mt_stat.mt_gstat)) {
-        stat |= BMT_BOT;
+         stat |= BMT_BOT;
          Dmsg0(-20, " BOT");
       }
       if (GMT_EOT(mt_stat.mt_gstat)) {
-        stat |= BMT_EOT;
+         stat |= BMT_EOT;
          Dmsg0(-20, " EOT");
       }
       if (GMT_SM(mt_stat.mt_gstat)) {
-        stat |= BMT_SM;
+         stat |= BMT_SM;
          Dmsg0(-20, " SM");
       }
       if (GMT_EOD(mt_stat.mt_gstat)) {
-        stat |= BMT_EOD;
+         stat |= BMT_EOD;
          Dmsg0(-20, " EOD");
       }
       if (GMT_WR_PROT(mt_stat.mt_gstat)) {
-        stat |= BMT_WR_PROT;
+         stat |= BMT_WR_PROT;
          Dmsg0(-20, " WR_PROT");
       }
       if (GMT_ONLINE(mt_stat.mt_gstat)) {
-        stat |= BMT_ONLINE;
+         stat |= BMT_ONLINE;
          Dmsg0(-20, " ONLINE");
       }
       if (GMT_DR_OPEN(mt_stat.mt_gstat)) {
-        stat |= BMT_DR_OPEN;
+         stat |= BMT_DR_OPEN;
          Dmsg0(-20, " DR_OPEN");       
       }
       if (GMT_IM_REP_EN(mt_stat.mt_gstat)) {
-        stat |= BMT_IM_REP_EN;
+         stat |= BMT_IM_REP_EN;
          Dmsg0(-20, " IM_REP_EN");
       }
 #endif /* !SunOS && !OSF */
@@ -690,7 +690,7 @@ uint32_t status_dev(DEVICE *dev)
 /*
  * Load medium in device
  *  Returns: true  on success
- *          false on failure
+ *           false on failure
  */
 bool load_dev(DEVICE *dev)
 {
@@ -710,9 +710,9 @@ bool load_dev(DEVICE *dev)
 #ifndef MTLOAD
    Dmsg0(200, "stored: MTLOAD command not available\n");
    berrno be;
-   dev->dev_errno = ENOTTY;          /* function not available */
+   dev->dev_errno = ENOTTY;           /* function not available */
    Mmsg2(&dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+         dev->dev_name, be.strerror());
    return false;
 #else
 
@@ -725,7 +725,7 @@ bool load_dev(DEVICE *dev)
       berrno be;
       dev->dev_errno = errno;
       Mmsg2(&dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+         dev->dev_name, be.strerror());
       return false;
    }
    return true;
@@ -735,7 +735,7 @@ bool load_dev(DEVICE *dev)
 /*
  * Rewind device and put it offline
  *  Returns: true  on success
- *          false on failure
+ *           false on failure
  */
 bool offline_dev(DEVICE *dev)
 {
@@ -766,7 +766,7 @@ bool offline_dev(DEVICE *dev)
       berrno be;
       dev->dev_errno = errno;
       Mmsg2(&dev->errmsg, _("ioctl MTOFFL error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+         dev->dev_name, be.strerror());
       return false;
    }
    Dmsg1(100, "Offlined device %s\n", dev->dev_name);
@@ -781,7 +781,7 @@ bool offline_or_rewind_dev(DEVICE *dev)
    if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
       return offline_dev(dev);
    } else {
-   /*           
+   /*            
     * Note, this rewind probably should not be here (it wasn't
     *  in prior versions of Bacula), but on FreeBSD, this is
     *  needed in the case the tape was "frozen" due to an error
@@ -794,9 +794,9 @@ bool offline_or_rewind_dev(DEVICE *dev)
 }
 
 /* 
- * Foward space a file 
+ * Foward space a file  
  *   Returns: true  on success
- *           false on failure
+ *            false on failure
  */
 bool
 fsf_dev(DEVICE *dev, int num)
@@ -838,18 +838,18 @@ fsf_dev(DEVICE *dev, int num)
       mt_com.mt_count = num;
       stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
       if (stat < 0 || ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
-        berrno be;
-        dev->state |= ST_EOT;
+         berrno be;
+         dev->state |= ST_EOT;
          Dmsg0(200, "Set ST_EOT\n");
-        clrerror_dev(dev, MTFSF);
+         clrerror_dev(dev, MTFSF);
          Mmsg2(dev->errmsg, _("ioctl MTFSF error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
+            dev->dev_name, be.strerror());
          Dmsg1(200, "%s", dev->errmsg);
-        return false;
+         return false;
       }
       Dmsg2(200, "fsf file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno);
       dev->file = mt_stat.mt_fileno;
-      dev->state |= ST_EOF;    /* just read EOF */
+      dev->state |= ST_EOF;     /* just read EOF */
       dev->file_addr = 0;
       dev->file_size = 0;
       return true;
@@ -866,66 +866,66 @@ fsf_dev(DEVICE *dev, int num)
       int rbuf_len;
       Dmsg0(200, "FSF has cap_fsf\n");
       if (dev->max_block_size == 0) {
-        rbuf_len = DEFAULT_BLOCK_SIZE;
+         rbuf_len = DEFAULT_BLOCK_SIZE;
       } else {
-        rbuf_len = dev->max_block_size;
+         rbuf_len = dev->max_block_size;
       }
       rbuf = get_memory(rbuf_len);
       mt_com.mt_op = MTFSF;
       mt_com.mt_count = 1;
       while (num-- && !(dev->state & ST_EOT)) {
          Dmsg0(100, "Doing read before fsf\n");
-        if ((stat = read(dev->fd, (char *)rbuf, rbuf_len)) < 0) {
-           if (errno == ENOMEM) {     /* tape record exceeds buf len */
-              stat = rbuf_len;        /* This is OK */
-           } else {
-              berrno be;
-              dev->state |= ST_EOT;
-              clrerror_dev(dev, -1);
+         if ((stat = read(dev->fd, (char *)rbuf, rbuf_len)) < 0) {
+            if (errno == ENOMEM) {     /* tape record exceeds buf len */
+               stat = rbuf_len;        /* This is OK */
+            } else {
+               berrno be;
+               dev->state |= ST_EOT;
+               clrerror_dev(dev, -1);
                Dmsg2(100, "Set ST_EOT read errno=%d. ERR=%s\n", dev->dev_errno,
-                 be.strerror());
+                  be.strerror());
                Mmsg2(dev->errmsg, _("read error on %s. ERR=%s.\n"),
-                 dev->dev_name, be.strerror());
+                  dev->dev_name, be.strerror());
                Dmsg1(100, "%s", dev->errmsg);
-              break;
-           }
-        }
-        if (stat == 0) {                /* EOF */
-           update_pos_dev(dev);
+               break;
+            }
+         }
+         if (stat == 0) {                /* EOF */
+            update_pos_dev(dev);
             Dmsg1(100, "End of File mark from read. File=%d\n", dev->file+1);
-           /* Two reads of zero means end of tape */
-           if (dev->state & ST_EOF) {
-              dev->state |= ST_EOT;
+            /* Two reads of zero means end of tape */
+            if (dev->state & ST_EOF) {
+               dev->state |= ST_EOT;
                Dmsg0(100, "Set ST_EOT\n");
-              break;
-           } else {
-              dev->state |= ST_EOF;
-              dev->file++;
-              dev->file_addr = 0;
-              dev->file_size = 0;
-              continue;
-           }
-        } else {                        /* Got data */
-           dev->state &= ~(ST_EOF|ST_EOT);
-        }
+               break;
+            } else {
+               dev->state |= ST_EOF;
+               dev->file++;
+               dev->file_addr = 0;
+               dev->file_size = 0;
+               continue;
+            }
+         } else {                        /* Got data */
+            dev->state &= ~(ST_EOF|ST_EOT);
+         }
 
          Dmsg0(100, "Doing MTFSF\n");
-        stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
-        if (stat < 0) {                 /* error => EOT */
-           berrno be;
-           dev->state |= ST_EOT;
+         stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
+         if (stat < 0) {                 /* error => EOT */
+            berrno be;
+            dev->state |= ST_EOT;
             Dmsg0(100, "Set ST_EOT\n");
-           clrerror_dev(dev, MTFSF);
+            clrerror_dev(dev, MTFSF);
             Mmsg2(&dev->errmsg, _("ioctl MTFSF error on %s. ERR=%s.\n"),
-              dev->dev_name, be.strerror());
+               dev->dev_name, be.strerror());
             Dmsg0(100, "Got < 0 for MTFSF\n");
             Dmsg1(100, "%s", dev->errmsg);
-        } else {
-           dev->state |= ST_EOF;     /* just read EOF */
-           dev->file++;
-           dev->file_addr = 0;
-           dev->file_size = 0;
-        }   
+         } else {
+            dev->state |= ST_EOF;     /* just read EOF */
+            dev->file++;
+            dev->file_addr = 0;
+            dev->file_size = 0;
+         }   
       }
       free_memory(rbuf);
    
@@ -935,14 +935,14 @@ fsf_dev(DEVICE *dev, int num)
    } else {
       Dmsg0(200, "Doing FSR for FSF\n");
       while (num-- && !(dev->state & ST_EOT)) {
-        fsr_dev(dev, INT32_MAX);    /* returns -1 on EOF or EOT */
+         fsr_dev(dev, INT32_MAX);    /* returns -1 on EOF or EOT */
       }
       if (dev->state & ST_EOT) {
-        dev->dev_errno = 0;
+         dev->dev_errno = 0;
          Mmsg1(dev->errmsg, _("Device %s at End of Tape.\n"), dev->dev_name);
-        stat = -1;
+         stat = -1;
       } else {
-        stat = 0;
+         stat = 0;
       }
    }
    update_pos_dev(dev);
@@ -958,7 +958,7 @@ fsf_dev(DEVICE *dev, int num)
 /* 
  * Backward space a file  
  *  Returns: false on failure
- *          true  on success
+ *           true  on success
  */
 bool
 bsf_dev(DEVICE *dev, int num)
@@ -975,7 +975,7 @@ bsf_dev(DEVICE *dev, int num)
 
    if (!(dev_state(dev, ST_TAPE))) {
       Mmsg1(dev->errmsg, _("Device %s cannot BSF because it is not a tape.\n"),
-        dev->dev_name);
+         dev->dev_name);
       return false;
    }
    Dmsg0(29, "bsf_dev\n");
@@ -990,7 +990,7 @@ bsf_dev(DEVICE *dev, int num)
       berrno be;
       clrerror_dev(dev, MTBSF);
       Mmsg2(dev->errmsg, _("ioctl MTBSF error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+         dev->dev_name, be.strerror());
    }
    update_pos_dev(dev);
    return stat == 0;
@@ -1000,7 +1000,7 @@ bsf_dev(DEVICE *dev, int num)
 /* 
  * Foward space a record
  *  Returns: false on failure
- *          true  on success
+ *           true  on success
  */
 bool
 fsr_dev(DEVICE *dev, int num)
@@ -1038,24 +1038,24 @@ fsr_dev(DEVICE *dev, int num)
 #ifndef HAVE_OPENBSD_OS
       if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno >= 0) {
          Dmsg4(100, "Adjust from %d:%d to %d:%d\n", dev->file, 
-           dev->block_num, mt_stat.mt_fileno, mt_stat.mt_blkno);
-        dev->file = mt_stat.mt_fileno;
-        dev->block_num = mt_stat.mt_blkno;
+            dev->block_num, mt_stat.mt_fileno, mt_stat.mt_blkno);
+         dev->file = mt_stat.mt_fileno;
+         dev->block_num = mt_stat.mt_blkno;
       } else
 #endif
       {
-        if (dev->state & ST_EOF) {
-           dev->state |= ST_EOT;
-        } else {
-           dev->state |= ST_EOF;           /* assume EOF */
-           dev->file++;
-           dev->block_num = 0;
-           dev->file_addr = 0;
-           dev->file_size = 0;
-        }
+         if (dev->state & ST_EOF) {
+            dev->state |= ST_EOT;
+         } else {
+            dev->state |= ST_EOF;           /* assume EOF */
+            dev->file++;
+            dev->block_num = 0;
+            dev->file_addr = 0;
+            dev->file_size = 0;
+         }
       }
-      Mmsg2(dev->errmsg, _("ioctl MTFSR error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+      Mmsg3(dev->errmsg, _("ioctl MTFSR %d error on %s. ERR=%s.\n"),
+         num, dev->dev_name, be.strerror());
    }
    update_pos_dev(dev);
    return stat == 0;
@@ -1064,7 +1064,7 @@ fsr_dev(DEVICE *dev, int num)
 /* 
  * Backward space a record
  *   Returns:  false on failure
- *            true  on success
+ *             true  on success
  */
 bool
 bsr_dev(DEVICE *dev, int num)
@@ -1098,7 +1098,7 @@ bsr_dev(DEVICE *dev, int num)
       berrno be;
       clrerror_dev(dev, MTBSR);
       Mmsg2(dev->errmsg, _("ioctl MTBSR error on %s. ERR=%s.\n"),
-        dev->dev_name, be.strerror());
+         dev->dev_name, be.strerror());
    }
    update_pos_dev(dev);
    return stat == 0;
@@ -1107,7 +1107,7 @@ bsr_dev(DEVICE *dev, int num)
 /* 
  * Reposition the device to file, block
  * Returns: false on failure
- *         true  on success
+ *          true  on success
  */
 bool
 reposition_dev(DEVICE *dev, uint32_t file, uint32_t block)
@@ -1123,11 +1123,11 @@ reposition_dev(DEVICE *dev, uint32_t file, uint32_t block)
       off_t pos = (((off_t)file)<<32) + block;
       Dmsg1(100, "===== lseek to %d\n", (int)pos);
       if (lseek(dev->fd, pos, SEEK_SET) == (off_t)-1) {
-        berrno be;
-        dev->dev_errno = errno;
+         berrno be;
+         dev->dev_errno = errno;
          Mmsg2(dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
-        return false;
+            dev->dev_name, be.strerror());
+         return false;
       }
       dev->file = file;
       dev->block_num = block;
@@ -1139,14 +1139,14 @@ reposition_dev(DEVICE *dev, uint32_t file, uint32_t block)
    if (file < dev->file) {
       Dmsg0(100, "Rewind_dev\n");
       if (!rewind_dev(dev)) {
-        return false;
+         return false;
       }
    }
    if (file > dev->file) {
       Dmsg1(100, "fsf %d\n", file-dev->file);
       if (!fsf_dev(dev, file-dev->file)) {
          Dmsg1(100, "fsf failed! ERR=%s\n", strerror_dev(dev));
-        return false;
+         return false;
       }
       Dmsg2(100, "wanted_file=%d at_file=%d\n", file, dev->file);
    }
@@ -1171,7 +1171,7 @@ reposition_dev(DEVICE *dev, uint32_t file, uint32_t block)
 /*
  * Write an end of file on the device
  *   Returns: 0 on success
- *           non-zero on failure
+ *            non-zero on failure
  */
 int 
 weof_dev(DEVICE *dev, int num)
@@ -1187,9 +1187,15 @@ weof_dev(DEVICE *dev, int num)
    }
    dev->file_size = 0;
 
-   if (!(dev_state(dev, ST_TAPE))) {
+   if (!dev->is_tape()) {
       return 0;
    }
+   if (!dev->can_append()) {
+      Mmsg0(dev->errmsg, _("Attempt to WEOF on non-appendable Volume\n"));
+      Emsg0(M_FATAL, 0, dev->errmsg);
+      return -1;
+   }
+
    dev->state &= ~(ST_EOT | ST_EOF);  /* remove EOF/EOT flags */
    Dmsg0(29, "weof_dev\n");
    mt_com.mt_op = MTWEOF;
@@ -1204,7 +1210,7 @@ weof_dev(DEVICE *dev, int num)
       clrerror_dev(dev, MTWEOF);
       if (stat == -1) {
          Mmsg2(dev->errmsg, _("ioctl MTWEOF error on %s. ERR=%s.\n"),
-           dev->dev_name, be.strerror());
+            dev->dev_name, be.strerror());
        }
    }
    return stat;
@@ -1233,7 +1239,7 @@ clrerror_dev(DEVICE *dev, int func)
    const char *msg = NULL;
    struct mtget mt_stat;
 
-   dev->dev_errno = errno;        /* save errno */
+   dev->dev_errno = errno;         /* save errno */
    if (errno == EIO) {
       dev->VolCatInfo.VolCatErrors++;
    }
@@ -1245,45 +1251,45 @@ clrerror_dev(DEVICE *dev, int func)
       switch (func) {
       case -1:
          Emsg0(M_ABORT, 0, "Got ENOTTY on read/write!\n");
-        break;
+         break;
       case MTWEOF:
          msg = "WTWEOF";
-        dev->capabilities &= ~CAP_EOF; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_EOF; /* turn off feature */
+         break;
 #ifdef MTEOM
       case MTEOM:
          msg = "WTEOM";
-        dev->capabilities &= ~CAP_EOM; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_EOM; /* turn off feature */
+         break;
 #endif 
       case MTFSF:
          msg = "MTFSF";
-        dev->capabilities &= ~CAP_FSF; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_FSF; /* turn off feature */
+         break;
       case MTBSF:
          msg = "MTBSF";
-        dev->capabilities &= ~CAP_BSF; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_BSF; /* turn off feature */
+         break;
       case MTFSR:
          msg = "MTFSR";
-        dev->capabilities &= ~CAP_FSR; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_FSR; /* turn off feature */
+         break;
       case MTBSR:
          msg = "MTBSR";
-        dev->capabilities &= ~CAP_BSR; /* turn off feature */
-        break;
+         dev->capabilities &= ~CAP_BSR; /* turn off feature */
+         break;
       default:
          msg = "Unknown";
-        break;
+         break;
       }
       if (msg != NULL) {
-        dev->dev_errno = ENOSYS;
+         dev->dev_errno = ENOSYS;
          Mmsg1(&dev->errmsg, _("This device does not support %s.\n"), msg);
-        Emsg0(M_ERROR, 0, dev->errmsg);
+         Emsg0(M_ERROR, 0, dev->errmsg);
       }
    }
    /* On some systems such as NetBSD, this clears all errors */
-   ioctl(dev->fd, MTIOCGET, (char *)&mt_stat);     
+   ioctl(dev->fd, MTIOCGET, (char *)&mt_stat);      
 
 /* Found on Linux */
 #ifdef MTIOCLRERR
@@ -1369,7 +1375,7 @@ close_dev(DEVICE *dev)
    } else if (dev->use_count > 0) {
       dev->use_count--;
    }
-          
+           
 #ifdef FULL_DEBUG
    ASSERT(dev->use_count >= 0);
 #endif
@@ -1424,7 +1430,7 @@ bool
 dev_can_write(DEVICE *dev)
 {
    if ((dev->state & ST_OPENED) &&  (dev->state & ST_APPEND) &&
-       (dev->state & ST_LABEL) && !(dev->state & ST_WEOT)) {
+       (dev->state & ST_LABEL)  && !(dev->state & ST_WEOT)) {
       return true;
    } else {
       return false;
@@ -1499,7 +1505,7 @@ void init_dev_wait_timers(DEVICE *dev)
    /* ******FIXME******* put these on config variables */
    dev->min_wait = 60 * 60;
    dev->max_wait = 24 * 60 * 60;
-   dev->max_num_wait = 9;             /* 5 waits =~ 1 day, then 1 day at a time */
+   dev->max_num_wait = 9;              /* 5 waits =~ 1 day, then 1 day at a time */
    dev->wait_sec = dev->min_wait;
    dev->rem_wait_sec = dev->wait_sec;
    dev->num_wait = 0;
@@ -1509,11 +1515,11 @@ void init_dev_wait_timers(DEVICE *dev)
 
 /*
  * Returns: true if time doubled
- *         false if max time expired
+ *          false if max time expired
  */
 bool double_dev_wait_time(DEVICE *dev)
 {
-   dev->wait_sec *= 2;              /* double wait time */
+   dev->wait_sec *= 2;               /* double wait time */
    if (dev->wait_sec > dev->max_wait) {   /* but not longer than maxtime */
       dev->wait_sec = dev->max_wait;
    }
@@ -1534,18 +1540,18 @@ void set_os_device_parameters(DEVICE *dev)
       mt_com.mt_op = MTSETBLK;
       mt_com.mt_count = 0;
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTSETBLK);
+         clrerror_dev(dev, MTSETBLK);
       }
       mt_com.mt_op = MTSETDRVBUFFER;
       mt_com.mt_count = MT_ST_CLEARBOOLEANS;
       if (!dev_cap(dev, CAP_TWOEOF)) {
-        mt_com.mt_count |= MT_ST_TWO_FM;
+         mt_com.mt_count |= MT_ST_TWO_FM;
       }
       if (dev_cap(dev, CAP_EOM)) {
-        mt_com.mt_count |= MT_ST_FAST_MTEOM;
+         mt_com.mt_count |= MT_ST_FAST_MTEOM;
       }
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTSETBLK);
+         clrerror_dev(dev, MTSETBLK);
       }
    }
    return;
@@ -1558,13 +1564,13 @@ void set_os_device_parameters(DEVICE *dev)
       mt_com.mt_op = MTSETBSIZ;
       mt_com.mt_count = 0;
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTSETBSIZ);
+         clrerror_dev(dev, MTSETBSIZ);
       }
       /* Get notified at logical end of tape */
       mt_com.mt_op = MTEWARN;
       mt_com.mt_count = 1;
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTEWARN);
+         clrerror_dev(dev, MTEWARN);
       }
    }
    return;
@@ -1577,7 +1583,7 @@ void set_os_device_parameters(DEVICE *dev)
       mt_com.mt_op = MTSETBSIZ;
       mt_com.mt_count = 0;
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTSETBSIZ);
+         clrerror_dev(dev, MTSETBSIZ);
       }
    }
    return;
@@ -1590,7 +1596,7 @@ void set_os_device_parameters(DEVICE *dev)
       mt_com.mt_op = MTSRSZ;
       mt_com.mt_count = 0;
       if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
-        clrerror_dev(dev, MTSRSZ);
+         clrerror_dev(dev, MTSRSZ);
       }
    }
    return;
index adb7674af9be0eb03a0d7a1b3a39f9d329f463a5..6d9cd89330e1382ef86e4d2bf4c065ce0093c863 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -35,7 +35,7 @@
 
 /* #define NEW_LOCK 1 */
 
-#define new_lock_device(dev)             _new_lock_device(__FILE__, __LINE__, (dev)) 
+#define new_lock_device(dev)             _new_lock_device(__FILE__, __LINE__, (dev))
 #define new_lock_device_state(dev,state) _new_lock_device(__FILE__, __LINE__, (dev), (state))
 #define new_unlock_device(dev)           _new_unlock_device(__FILE__, __LINE__, (dev))
 
@@ -50,7 +50,7 @@
 enum {
    OPEN_READ_WRITE = 0,
    OPEN_READ_ONLY,
-   OPEN_WRITE_ONLY   
+   OPEN_WRITE_ONLY
 };
 
 /* Generic status bits returned from status_dev() */
@@ -90,25 +90,29 @@ enum {
 #define CAP_TWOEOF         (1<<17)    /* Write two eofs for EOM */
 #define CAP_CLOSEONPOLL    (1<<18)    /* Close device on polling */
 #define CAP_POSITIONBLOCKS (1<<19)    /* Use block positioning */
+#define CAP_MTIOCGET       (1<<20)    /* Basic support for fileno and blkno */
+#define CAP_REQMOUNT       (1<<21)    /* Require mount to read files back (typically: DVD) */
 
 /* Test state */
 #define dev_state(dev, st_state) ((dev)->state & (st_state))
 
 /* Device state bits */
 #define ST_OPENED          (1<<0)     /* set when device opened */
-#define ST_TAPE            (1<<1)     /* is a tape device */  
+#define ST_TAPE            (1<<1)     /* is a tape device */
 #define ST_FILE            (1<<2)     /* is a file device */
 #define ST_FIFO            (1<<3)     /* is a fifo device */
-#define ST_PROG            (1<<4)     /* is a program device */
-#define ST_LABEL           (1<<5)     /* label found */
-#define ST_MALLOC          (1<<6)     /* dev packet malloc'ed in init_dev() */
-#define ST_APPEND          (1<<7)     /* ready for Bacula append */
-#define ST_READ            (1<<8)     /* ready for Bacula read */
-#define ST_EOT             (1<<9)     /* at end of tape */
-#define ST_WEOT            (1<<10)    /* Got EOT on write */
-#define ST_EOF             (1<<11)    /* Read EOF i.e. zero bytes */
-#define ST_NEXTVOL         (1<<12)    /* Start writing on next volume */
-#define ST_SHORT           (1<<13)    /* Short block read */
+#define ST_DVD             (1<<4)     /* is a DVD device */  
+#define ST_PROG            (1<<5)     /* is a program device */
+#define ST_LABEL           (1<<6)     /* label found */
+#define ST_MALLOC          (1<<7)     /* dev packet malloc'ed in init_dev() */
+#define ST_APPEND          (1<<8)     /* ready for Bacula append */
+#define ST_READ            (1<<9)     /* ready for Bacula read */
+#define ST_EOT             (1<<10)    /* at end of tape */
+#define ST_WEOT            (1<<11)    /* Got EOT on write */
+#define ST_EOF             (1<<12)    /* Read EOF i.e. zero bytes */
+#define ST_NEXTVOL         (1<<13)    /* Start writing on next volume */
+#define ST_SHORT           (1<<14)    /* Short block read */
+#define ST_MOUNTED         (1<<15)    /* the device is mounted to the mount point */
 
 /* dev_blocked states (mutually exclusive) */
 enum {
@@ -116,7 +120,7 @@ enum {
    BST_UNMOUNTED,                     /* User unmounted device */
    BST_WAITING_FOR_SYSOP,             /* Waiting for operator to mount tape */
    BST_DOING_ACQUIRE,                 /* Opening/validating/moving tape */
-   BST_WRITING_LABEL,                  /* Labeling a tape */  
+   BST_WRITING_LABEL,                  /* Labeling a tape */
    BST_UNMOUNTED_WAITING_FOR_SYSOP,    /* Closed by user during mount request */
    BST_MOUNT                           /* Mount request */
 };
@@ -128,6 +132,7 @@ struct VOLUME_CAT_INFO {
    uint32_t VolCatFiles;              /* Number of files */
    uint32_t VolCatBlocks;             /* Number of blocks */
    uint64_t VolCatBytes;              /* Number of bytes written */
+   uint32_t VolCatParts;              /* Number of parts written */
    uint32_t VolCatMounts;             /* Number of mounts this volume */
    uint32_t VolCatErrors;             /* Number of errors this volume */
    uint32_t VolCatWrites;             /* Number of writes this volume */
@@ -136,6 +141,7 @@ struct VOLUME_CAT_INFO {
    uint32_t VolCatRecycles;           /* Number of recycles this volume */
    uint32_t EndFile;                  /* Last file number */
    uint32_t EndBlock;                 /* Last block number */
+   int32_t  LabelType;                /* Bacula/ANSI/IBM */
    int32_t  Slot;                     /* Slot in changer */
    bool     InChanger;                /* Set if vol in current magazine */
    uint32_t VolCatMaxJobs;            /* Maximum Jobs to write to volume */
@@ -146,7 +152,7 @@ struct VOLUME_CAT_INFO {
    uint64_t VolWriteTime;             /* time spent writing this Volume */
    char VolCatStatus[20];             /* Volume status */
    char VolCatName[MAX_NAME_LENGTH];  /* Desired volume to mount */
-};                
+};
 
 
 typedef struct s_steal_lock {
@@ -159,14 +165,13 @@ struct DEVRES;                        /* Device resource defined in stored_conf.
 
 /*
  * Device structure definition. There is one of these for
- *  each physical device. Everything here is "global" to 
+ *  each physical device. Everything here is "global" to
  *  that device and effects all jobs using the device.
  */
-struct DEVICE {
+class DEVICE {
 public:
-   DEVICE *next;                      /* pointer to next open device */
-   DEVICE *prev;                      /* pointer to prev open device */
-   JCR *attached_jcrs;                /* attached JCR list */
+   DEVICE *next;
+   DEVICE *prev;
    dlist *attached_dcrs;              /* attached DCR list */
    pthread_mutex_t mutex;             /* access control */
    pthread_mutex_t spool_mutex;       /* mutex for updating spool_size */
@@ -177,6 +182,7 @@ public:
    int dev_prev_blocked;              /* previous blocked state */
    int num_waiting;                   /* number of threads waiting */
    int num_writers;                   /* number of writing threads */
+   int reserved_device;               /* number of device reservations */
 
    /* New access control in process of being implemented */
    brwlock_t lock;                    /* New mutual exclusion lock */
@@ -187,6 +193,7 @@ public:
    int state;                         /* state mask */
    int dev_errno;                     /* Our own errno */
    int mode;                          /* read/write modes */
+   int openmode;                      /* parameter passed to open_dev (useful to reopen the device) */
    uint32_t drive_index;              /* Autochanger drive index */
    POOLMEM *dev_name;                 /* device name */
    char *errmsg;                      /* nicely edited error message */
@@ -202,17 +209,29 @@ public:
    uint64_t max_file_size;            /* max file size to put in one file on volume */
    uint64_t volume_capacity;          /* advisory capacity */
    uint64_t max_spool_size;           /* maximum spool file size */
-   uint64_t spool_size;               /* curren spool size */
+   uint64_t spool_size;               /* current spool size */
    uint32_t max_rewind_wait;          /* max secs to allow for rewind */
    uint32_t max_open_wait;            /* max secs to allow for open */
    uint32_t max_open_vols;            /* max simultaneous open volumes */
+   
+   uint64_t max_part_size;            /* max part size */
+   uint64_t part_size;                /* current part size */
+   uint32_t part;                     /* current part number */
+   uint64_t part_start;               /* current part start address (relative to the whole volume) */
+   uint32_t num_parts;                /* number of parts (total) */
+   uint64_t free_space;               /* current free space on medium (without the current part) */
+   int free_space_errno;              /* indicates:
+                                       * - free_space_errno == 0: ignore free_space.
+                                       * - free_space_errno < 0: an error occured. 
+                                       * - free_space_errno > 0: free_space is valid. */
+   
    utime_t  vol_poll_interval;        /* interval between polling Vol mount */
    DEVRES *device;                    /* pointer to Device Resource */
    btimer_t *tid;                     /* timer id */
 
    VOLUME_CAT_INFO VolCatInfo;        /* Volume Catalog Information */
    VOLUME_LABEL VolHdr;               /* Actual volume label */
-   
+
    /* Device wait times ***FIXME*** look at durations */
    char BadVolName[MAX_NAME_LENGTH];  /* Last wrong Volume mounted */
    bool poll;                         /* set to poll Volume */
@@ -222,19 +241,62 @@ public:
    int wait_sec;
    int rem_wait_sec;
    int num_wait;
+
+   int is_tape() const;
+   int is_file() const;
+   int is_fifo() const;
+   int is_dvd() const;
+   int is_open() const;
+   int is_labeled() const;
+   int is_busy() const;               /* either reading or writing */
+   int at_eof() const;
+   int at_eom() const;
+   int at_eot() const;
+   int can_append() const;
+   int can_read() const;
+   const char *strerror() const;
+   const char *archive_name() const;
+   void set_eof();
+   void set_eot();
+   void set_append();
+   void set_read();
+   void clear_append();
+   void clear_read();
 };
 
+/* Note, these return int not bool! */
+inline int DEVICE::is_tape() const { return state & ST_TAPE; }
+inline int DEVICE::is_file() const { return state & ST_FILE; }
+inline int DEVICE::is_fifo() const { return state & ST_FIFO; }
+inline int DEVICE::is_dvd()  const { return state & ST_DVD; }
+inline int DEVICE::is_open() const { return state & ST_OPENED; }
+inline int DEVICE::is_labeled() const { return state & ST_LABEL; }
+inline int DEVICE::is_busy() const { return state & ST_READ || num_writers; }
+inline int DEVICE::at_eof() const { return state & ST_EOF; }
+inline int DEVICE::at_eot() const { return state & ST_EOT; }
+inline int DEVICE::can_append() const { return state & ST_APPEND; }
+inline int DEVICE::can_read() const { return state & ST_READ; }
+inline void DEVICE::set_append() { state |= ST_APPEND; }
+inline void DEVICE::set_read() { state |= ST_READ; }
+inline void DEVICE::clear_append() { state &= ~ST_APPEND; }
+inline void DEVICE::clear_read() { state &= ~ST_READ; }
+inline const char *DEVICE::strerror() const { return errmsg; }
+inline const char *DEVICE::archive_name() const { return dev_name; }
+
 /*
- * Device Context (or Control) Record.  
- *  There is one of these records for each Job that is using    
+ * Device Context (or Control) Record.
+ *  There is one of these records for each Job that is using
  *  the device. Items in this record are "local" to the Job and
- *  do not affect other Jobs.
+ *  do not affect other Jobs. Note, a job can have multiple
+ *  DCRs open, each pointing to a different device. 
  */
 class DCR {
 public:
    dlink dev_link;                    /* link to attach to dev */
    JCR *jcr;                          /* pointer to JCR */
    DEVICE *dev;                       /* pointer to device */
+   DEVRES *device;                    /* pointer to device resource */
    DEV_BLOCK *block;                  /* pointer to block */
    DEV_RECORD *rec;                   /* pointer to record */
    int spool_fd;                      /* fd if spooling */
@@ -244,6 +306,7 @@ public:
    bool NewVol;                       /* set if new Volume mounted */
    bool WroteVol;                     /* set if Volume written */
    bool NewFile;                      /* set when EOF written */
+   bool reserved_device;              /* set if reserve done */
    uint32_t VolFirstIndex;            /* First file index this Volume */
    uint32_t VolLastIndex;             /* Last file index this Volume */
    uint32_t FileIndex;                /* Current File Index */
index fd13c595968b1e32af2bd49c7ea312c9115a2951..e0e21b25d5e78d0cf871cccc9b13d80adc5917b0 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -47,7 +47,8 @@ static char use_device[] = "use device=%127s media_type=%127s pool_name=%127s po
 /* Responses sent to Director daemon */
 static char OKjob[]     = "3000 OK Job SDid=%u SDtime=%u Authorization=%s\n";
 static char OK_device[] = "3000 OK use device\n";
-static char NO_device[] = "3914 Device \"%s\" not in SD Device resources.\n";
+static char NO_device[] = "3924 Device \"%s\" not in SD Device resources.\n";
+static char NOT_open[]  = "3925 Device \"%s\" could not be opened or does not exist.\n";
 static char BAD_use[]   = "3913 Bad use command: %s\n";
 static char BAD_job[]   = "3915 Bad Job command: %s\n";
 
@@ -258,12 +259,20 @@ static bool use_device_cmd(JCR *jcr)
       foreach_res(device, R_DEVICE) {
         /* Find resource, and make sure we were able to open it */
         if (fnmatch(dev_name.c_str(), device->hdr.name, 0) == 0 && 
-            device->dev && strcmp(device->media_type, media_type.c_str()) == 0) {
+            strcmp(device->media_type, media_type.c_str()) == 0) {
            const int name_len = MAX_NAME_LENGTH;
            DCR *dcr;
            UnlockRes();
+           if (!device->dev) {
+               Jmsg(jcr, M_FATAL, 0, _("\n"
+                  "     Archive \"%s\" requested by DIR could not be opened or does not exist.\n"),
+                   dev_name.c_str());
+              bnet_fsend(dir, NOT_open, dev_name.c_str());
+              return false;
+           }  
            dcr = new_dcr(jcr, device->dev);
            if (!dcr) {
+               bnet_fsend(dir, _("3926 Could not get dcr for device: %s\n"), dev_name.c_str());
               return false;
            }
             Dmsg1(120, "Found device %s\n", device->hdr.name);
index 89da956f0b7d76444c2561b380d3c7292b2cfb93..d25dc016b82772ab929987f0ff618083d135a9b2 100755 (executable)
@@ -1,7 +1,7 @@
-/*     
+/*
  *   Match Bootstrap Records (used for restores) against
  *     Volume Records
- *  
+ *
  *     Kern Sibbald, June MMII
  *
  *   Version $Id$
 
 #include "bacula.h"
 #include "stored.h"
+#ifdef HAVE_FNMATCH
 #include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
 
 /* Forward references */
 static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done);
@@ -61,7 +65,7 @@ void position_bsr_block(BSR *bsr, DEV_BLOCK *block)
 
 /*********************************************************************
  *
- *  Do fast block rejection based on bootstrap records. 
+ *  Do fast block rejection based on bootstrap records.
  *    use_fast_rejection will be set if we have VolSessionId and VolSessTime
  *    in each record. When BlockVer is >= 2, we have those in the block header
  *    so can do fast rejection.
@@ -138,7 +142,7 @@ int match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LABEL *se
    if (bsr) {
       bsr->reposition = false;
       stat = match_all(bsr, rec, volrec, sessrec, true);
-      /* 
+      /*
        * Note, bsr->reposition is set by match_all when
        *  a bsr is done. We turn it off if a match was
        *  found or if we cannot use positioning
@@ -161,7 +165,7 @@ BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev)
    BSR *bsr;
    BSR *found_bsr = NULL;
 
-   if (!root_bsr || !root_bsr->use_positioning || 
+   if (!root_bsr || !root_bsr->use_positioning ||
        !root_bsr->reposition || !dev_is_tape(dev)) {
       Dmsg2(100, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
       return NULL;
@@ -237,12 +241,12 @@ static BSR *find_smallest_volfile(BSR *found_bsr, BSR *bsr)
    return return_bsr;
 }
 
-/* 
+/*
  * Called to tell the matcher that the end of
  *   the current file has been reached.
  *  The bsr argument is not used, but is included
  *    for consistency with the other match calls.
- * 
+ *
  * Returns: true if we should reposition
  *       : false otherwise.
  */
@@ -265,13 +269,13 @@ bool match_set_eof(BSR *bsr, DEV_RECORD *rec)
    return false;
 }
 
-/* 
+/*
  * Match all the components of current record
  *   returns  1 on match
  *   returns  0 no match
  *   returns -1 no additional matches possible
  */
-static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, 
+static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
                     SESSION_LABEL *sessrec, bool done)
 {
    if (bsr->done) {
@@ -324,7 +328,7 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
     */
    if (!match_jobid(bsr, bsr->JobId, sessrec, 1)) {
       goto no_match;
-       
+
    }
    if (!match_job(bsr, bsr->job, sessrec, 1)) {
       goto no_match;
@@ -353,7 +357,7 @@ no_match:
    return 0;
 }
 
-static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done) 
+static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done)
 {
    if (!volume) {
       return 0;                      /* Volume must match */
@@ -463,7 +467,7 @@ static int match_volfile(BSR *bsr, BSR_VOLFILE *volfile, DEV_RECORD *rec, bool d
    if (volfile->done && done) {
       bsr->done = true;
       bsr->root->reposition = true;
-      Dmsg2(100, "bsr done from volfile rec=%d volefile=%d\n", 
+      Dmsg2(100, "bsr done from volfile rec=%d volefile=%d\n",
         rec->File, volfile->efile);
    }
    return 0;
index 4ff019b30c51ef272ebfef784fd06f822c736c10..a1fbc6ba0751d9aadeef403cccec3262554ee807 100755 (executable)
@@ -1,13 +1,13 @@
-/*     
- *   Parse a Bootstrap Records (used for restores) 
- *  
+/*
+ *   Parse a Bootstrap Records (used for restores)
+ *
  *     Kern Sibbald, June MMII
  *
  *   Version $Id$
  */
 
 /*
-   Copyright (C) 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -32,6 +32,7 @@
 typedef BSR * (ITEM_HANDLER)(LEX *lc, BSR *bsr);
 
 static BSR *store_vol(LEX *lc, BSR *bsr);
+static BSR *store_mediatype(LEX *lc, BSR *bsr);
 static BSR *store_client(LEX *lc, BSR *bsr);
 static BSR *store_job(LEX *lc, BSR *bsr);
 static BSR *store_jobid(LEX *lc, BSR *bsr);
@@ -60,6 +61,7 @@ struct kw_items {
  */
 struct kw_items items[] = {
    {"volume", store_vol},
+   {"mediatype", store_mediatype},
    {"client", store_client},
    {"job", store_job},
    {"jobid", store_jobid},
@@ -79,7 +81,7 @@ struct kw_items items[] = {
 
 };
 
-/* 
+/*
  * Create a BSR record
  */
 static BSR *new_bsr()
@@ -90,7 +92,7 @@ static BSR *new_bsr()
 }
 
 /*
- * Format a scanner error message 
+ * Format a scanner error message
  */
 static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
 {
@@ -101,14 +103,14 @@ static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
    va_start(arg_ptr, msg);
    bvsnprintf(buf, sizeof(buf), msg, arg_ptr);
    va_end(arg_ptr);
-     
+
    if (jcr) {
-      Jmsg(jcr, M_FATAL, 0, _("Bootstrap file error: %s\n\
-            : Line %d, col %d of file %s\n%s\n"),
+      Jmsg(jcr, M_FATAL, 0, _("Bootstrap file error: %s\n"
+"            : Line %d, col %d of file %s\n%s\n"),
         buf, lc->line_no, lc->col_no, lc->fname, lc->line);
    } else {
-      e_msg(file, line, M_FATAL, 0, _("Bootstrap file error: %s\n\
-            : Line %d, col %d of file %s\n%s\n"),
+      e_msg(file, line, M_FATAL, 0, _("Bootstrap file error: %s\n"
+"            : Line %d, col %d of file %s\n%s\n"),
         buf, lc->line_no, lc->col_no, lc->fname, lc->line);
    }
 }
@@ -125,7 +127,7 @@ BSR *parse_bsr(JCR *jcr, char *fname)
    int token, i;
    BSR *root_bsr = new_bsr();
    BSR *bsr = root_bsr;
-     
+
    Dmsg1(200, "Enter parse_bsf %s\n", fname);
    lc = lex_open_file(lc, fname, s_err);
    lc->caller_ctx = (void *)jcr;
@@ -213,7 +215,7 @@ static BSR *store_vol(LEX *lc, BSR *bsr)
    int token;
    BSR_VOLUME *volume;
    char *p, *n;
-    
+
    token = lex_get_token(lc, T_STRING);
    if (token == T_ERROR) {
       return NULL;
@@ -222,7 +224,7 @@ static BSR *store_vol(LEX *lc, BSR *bsr)
       bsr->next = new_bsr();
       bsr = bsr->next;
    }
-   /* This may actually be more than one volume separated by a |  
+   /* This may actually be more than one volume separated by a |
     * If so, separate them.
     */
    for (p=lc->str; p && *p; ) {
@@ -238,7 +240,7 @@ static BSR *store_vol(LEX *lc, BSR *bsr)
         bsr->volume = volume;
       } else {
         BSR_VOLUME *bc = bsr->volume;
-        for ( ;bc->next; bc=bc->next)  
+        for ( ;bc->next; bc=bc->next)
            { }
         bc->next = volume;
       }
@@ -247,11 +249,33 @@ static BSR *store_vol(LEX *lc, BSR *bsr)
    return bsr;
 }
 
+/* Shove the MediaType in each Volume in the current bsr */
+static BSR *store_mediatype(LEX *lc, BSR *bsr)
+{
+   int token;
+
+   token = lex_get_token(lc, T_STRING);
+   if (token == T_ERROR) {
+      return NULL;
+   }
+   if (!bsr->volume) {
+      Emsg1(M_ERROR,0, _("MediaType %s in bsr at inappropriate place.\n"),
+        lc->str);
+      return bsr;
+   }
+   BSR_VOLUME *bv;
+   for (bv=bsr->volume; bv; bv=bv->next) {
+      bstrncpy(bv->MediaType, lc->str, sizeof(bv->MediaType));
+   }
+   return bsr;
+}
+
+
 static BSR *store_client(LEX *lc, BSR *bsr)
 {
    int token;
    BSR_CLIENT *client;
-    
+
    for (;;) {
       token = lex_get_token(lc, T_NAME);
       if (token == T_ERROR) {
@@ -265,7 +289,7 @@ static BSR *store_client(LEX *lc, BSR *bsr)
         bsr->client = client;
       } else {
         BSR_CLIENT *bc = bsr->client;
-        for ( ;bc->next; bc=bc->next)  
+        for ( ;bc->next; bc=bc->next)
            { }
         bc->next = client;
       }
@@ -281,7 +305,7 @@ static BSR *store_job(LEX *lc, BSR *bsr)
 {
    int token;
    BSR_JOB *job;
-    
+
    for (;;) {
       token = lex_get_token(lc, T_NAME);
       if (token == T_ERROR) {
@@ -407,7 +431,7 @@ static BSR *store_joblevel(LEX *lc, BSR *bsr)
 
 
 /*
- * Routine to handle Volume start/end file   
+ * Routine to handle Volume start/end file
  */
 static BSR *store_volfile(LEX *lc, BSR *bsr)
 {
@@ -443,7 +467,7 @@ static BSR *store_volfile(LEX *lc, BSR *bsr)
 
 
 /*
- * Routine to handle Volume start/end Block  
+ * Routine to handle Volume start/end Block
  */
 static BSR *store_volblock(LEX *lc, BSR *bsr)
 {
@@ -762,7 +786,7 @@ void free_bsr(BSR *bsr)
 }
 
 /*****************************************************************
- * Routines for handling volumes     
+ * Routines for handling volumes
  */
 VOL_LIST *new_vol()
 {
@@ -772,7 +796,7 @@ VOL_LIST *new_vol()
    return vol;
 }
 
-/* 
+/*
  * Add current volume to end of list, only if the Volume
  * is not already in the list.
  *
@@ -827,7 +851,7 @@ void create_vol_list(JCR *jcr)
    char *p, *n;
    VOL_LIST *vol;
 
-   /* 
+   /*
     * Build a list of volumes to be processed
     */
    jcr->NumVolumes = 0;
@@ -852,10 +876,12 @@ void create_vol_list(JCR *jcr)
         for (bsrvol = bsr->volume; bsrvol; bsrvol=bsrvol->next) {
            vol = new_vol();
            bstrncpy(vol->VolumeName, bsrvol->VolumeName, sizeof(vol->VolumeName));
+           bstrncpy(vol->MediaType,  bsrvol->MediaType,  sizeof(vol->MediaType));
            vol->start_file = sfile;
            if (add_vol(jcr, vol)) {
               jcr->NumVolumes++;
-               Dmsg1(400, "Added volume %s\n", vol->VolumeName);
+               Dmsg2(400, "Added volume=%s mediatype=%s\n", vol->VolumeName,
+                 vol->MediaType);
            } else {
                Dmsg1(400, "Duplicate volume %s\n", vol->VolumeName);
               free((char *)vol);
@@ -864,7 +890,7 @@ void create_vol_list(JCR *jcr)
         }
       }
    } else {
-      /* This is the old way -- deprecated */ 
+      /* This is the old way -- deprecated */
       for (p = jcr->dcr->VolumeName; p && *p; ) {
          n = strchr(p, '|');             /* volume name separator */
         if (n) {
@@ -872,6 +898,7 @@ void create_vol_list(JCR *jcr)
         }
         vol = new_vol();
         bstrncpy(vol->VolumeName, p, sizeof(vol->VolumeName));
+        bstrncpy(vol->MediaType, jcr->dcr->media_type, sizeof(vol->MediaType));
         if (add_vol(jcr, vol)) {
            jcr->NumVolumes++;
         } else {
index 827d9e44aa71d5c3722874503d71c7806b5bbda5..8ac2051b1460e08a6ffb9cb36c1ccc3174be2b2a 100644 (file)
@@ -5,13 +5,16 @@
  *    archive. It uses a callback to pass you each record in turn,
  *    as well as a callback for mounting the next tape.  It takes
  *    care of reading blocks, applying the bsr, ...
+ *    Note, this routine is really the heart of the restore routines,
+ *    and we are *really* bit pushing here so be careful about making
+ *    any modifications.
  *
  *    Kern E. Sibbald, August MMII
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -57,6 +60,7 @@ bool read_records(DCR *dcr,
 
    recs = New(dlist(rec, &rec->link));
    position_to_first_file(jcr, dev);
+   jcr->mount_next_volume = false;
 
    for ( ; ok && !done; ) {
       if (job_canceled(jcr)) {
@@ -64,14 +68,13 @@ bool read_records(DCR *dcr,
         break;
       }
       if (!read_block_from_device(dcr, CHECK_BLOCK_NUMBERS)) {
-        if (dev_state(dev, ST_EOT)) {
+        if (dev->at_eot()) {
            DEV_RECORD *trec = new_record();
-
-            Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n", 
+            Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
                 dev->file, dev_name(dev), dcr->VolumeName);
            if (!mount_cb(dcr)) {
                Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
-              ok = false;
+              ok = false;            /* Stop everything */
               /*
                * Create EOT Label so that Media record may
                *  be properly updated because this is the last
@@ -81,8 +84,13 @@ bool read_records(DCR *dcr,
               trec->File = dev->file;
               ok = record_cb(dcr, trec);
               free_record(trec);
+              if (jcr->mount_next_volume) {
+                 jcr->mount_next_volume = false;
+                 dev->state &= ~ST_EOT;
+              }
               break;
            }
+           jcr->mount_next_volume = false;
            /*
             * We just have a new tape up, now read the label (first record)
             *  and pass it off to the callback routine, then continue
@@ -97,12 +105,12 @@ bool read_records(DCR *dcr,
            /* After reading label, we must read first data block */
            continue;
 
-        } else if (dev_state(dev, ST_EOF)) {
+        } else if (dev->at_eof()) {
            if (verbose) {
-               Jmsg(jcr, M_INFO, 0, "Got EOF at file %u  on device %s, Volume \"%s\"\n", 
+               Jmsg(jcr, M_INFO, 0, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
                  dev->file, dev_name(dev), dcr->VolumeName);
            }
-            Dmsg3(200, "Got EOF at file %u  on device %s, Volume \"%s\"\n", 
+            Dmsg3(200, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
                  dev->file, dev_name(dev), dcr->VolumeName);
            continue;
         } else if (dev_state(dev, ST_SHORT)) {
@@ -113,10 +121,10 @@ bool read_records(DCR *dcr,
            display_tape_error_status(jcr, dev);
            if (forge_on || jcr->ignore_label_errors) {
               fsr_dev(dev, 1);       /* try skipping bad record */
-               Dmsg0(000, "Did fsr\n");
+               Pmsg0(000, "Did fsr\n");
               continue;              /* try to continue */
            }
-           ok = false;
+           ok = false;               /* stop everything */
            break;
         }
       }
@@ -133,7 +141,7 @@ bool read_records(DCR *dcr,
 
       /*
        * Get a new record for each Job as defined by
-       *   VolSessionId and VolSessionTime 
+       *   VolSessionId and VolSessionTime
        */
       bool found = false;
       foreach_dlist(rec, recs) {
@@ -148,26 +156,19 @@ bool read_records(DCR *dcr,
         recs->prepend(rec);
          Dmsg2(300, "New record for SI=%d ST=%d\n",
             block->VolSessionId, block->VolSessionTime);
-      } else {
-#ifdef xxx
-        if (rec->Block != 0 && (rec->Block+1) != block->BlockNumber) {
-            Jmsg(jcr, M_ERROR, 0, _("Invalid block number. Expected %u, got %u\n"),
-                rec->Block+1, block->BlockNumber);
-        }
-#endif 
       }
-      Dmsg3(300, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
+      Dmsg3(300, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec),
            block->BlockNumber, rec->remainder);
       record = 0;
       rec->state = 0;
       Dmsg1(300, "Block empty %d\n", is_block_empty(rec));
       for (rec->state=0; !is_block_empty(rec); ) {
         if (!read_record_from_block(block, rec)) {
-            Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec), 
+            Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
                  block->BlockNumber, rec->remainder);
            break;
         }
-         Dmsg5(300, "read-OK. state=%s blk=%d rem=%d file:block=%d:%d\n", 
+         Dmsg5(300, "read-OK. state=%s blk=%d rem=%d file:block=%d:%d\n",
                 rec_state_to_str(rec), block->BlockNumber, rec->remainder,
                 dev->file, dev->block_num);
         /*
@@ -186,7 +187,7 @@ bool read_records(DCR *dcr,
            break;                         /* yes, get out */
         }
 
-        /* Some sort of label? */ 
+        /* Some sort of label? */
         if (rec->FileIndex < 0) {
            handle_session_record(dev, rec, &sessrec);
            ok = record_cb(dcr, rec);
@@ -199,7 +200,7 @@ bool read_records(DCR *dcr,
            continue;
         } /* end if label record */
 
-        /* 
+        /*
          * Apply BSR filter
          */
         if (jcr->bsr) {
@@ -209,7 +210,7 @@ bool read_records(DCR *dcr,
                Dmsg2(300, "All done=(file:block) %d:%d\n", dev->file, dev->block_num);
               break;
            } else if (stat == 0) {  /* no match */
-               Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %d:%d\n", 
+               Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %d:%d\n",
                  rec->remainder, rec->FileIndex, dev->file, dev->block_num);
               rec->remainder = 0;
               rec->state &= ~REC_PARTIAL_RECORD;
@@ -266,10 +267,14 @@ static int try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev)
       Dmsg2(300, "Current postion (file:block) %d:%d\n",
         dev->file, dev->block_num);
       jcr->bsr->mount_next_volume = false;
-      dev->state |= ST_EOT;
+      if (!dev->at_eot()) {
+        /* Set EOT flag to force mount of next Volume */
+        jcr->mount_next_volume = true;
+        dev->state |= ST_EOT;
+      }
       rec->Block = 0;
       return 1;
-   }    
+   }
    if (bsr) {
       if (verbose) {
          Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %d:%d to %d:%d\n",
@@ -292,16 +297,16 @@ static BSR *position_to_first_file(JCR *jcr, DEVICE *dev)
 {
    BSR *bsr = NULL;
    /*
-    * Now find and position to first file and block 
+    * Now find and position to first file and block
     *  on this tape.
     */
    if (jcr->bsr) {
       jcr->bsr->reposition = true;    /* force repositioning */
       bsr = find_next_bsr(jcr->bsr, dev);
       if (bsr && (bsr->volfile->sfile != 0 || bsr->volblock->sblock != 0)) {
-         Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"), 
+         Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"),
            bsr->volfile->sfile, bsr->volblock->sblock);
-         Dmsg2(300, "Forward spacing to file:block %u:%u.\n", 
+         Dmsg2(300, "Forward spacing to file:block %u:%u.\n",
            bsr->volfile->sfile, bsr->volblock->sblock);
         reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
       }
@@ -314,11 +319,11 @@ static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *s
 {
    const char *rtype;
    char buf[100];
-   
+
    memset(sessrec, 0, sizeof(sessrec));
    switch (rec->FileIndex) {
    case PRE_LABEL:
-      rtype = "Fresh Volume Label";   
+      rtype = "Fresh Volume Label";
       break;
    case VOL_LABEL:
       rtype = "Volume Label";
@@ -346,7 +351,7 @@ static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *s
 #ifdef DEBUG
 static char *rec_state_to_str(DEV_RECORD *rec)
 {
-   static char buf[200]; 
+   static char buf[200];
    buf[0] = 0;
    if (rec->state & REC_NO_HEADER) {
       bstrncat(buf, "Nohdr,", sizeof(buf));
index 616b068abda2fdfc6f4eb088510c91cdc864eb47..6b3d23dc1207e6a9d46c53c350ba064e4e9564f9 100644 (file)
@@ -69,7 +69,7 @@ const char *FI_to_ascii(int fi)
 }
 
 
-/* 
+/*
  * Convert a Stream ID into a printable
  * ASCII string.  Not reentrant.
 
@@ -85,7 +85,7 @@ const char *stream_to_ascii(int stream, int fi)
     static char buf[20];
     if (fi < 0) {
        sprintf(buf, "%d", stream);
-       return buf;     
+       return buf;
     }
     switch (stream) {
     case STREAM_UNIX_ATTRIBUTES:
@@ -112,6 +112,10 @@ const char *stream_to_ascii(int stream, int fi)
        return "PROG-NAMES";
     case STREAM_PROGRAM_DATA:
        return "PROG-DATA";
+    case STREAM_MACOS_FORK_DATA:
+       return "MACOS-RSRC";
+    case STREAM_HFSPLUS_ATTRIBUTES:
+       return "HFSPLUS-ATTR";
     case -STREAM_UNIX_ATTRIBUTES:
        return "contUATTR";
     case -STREAM_FILE_DATA:
@@ -136,13 +140,17 @@ const char *stream_to_ascii(int stream, int fi)
        return "contPROG-NAMES";
     case -STREAM_PROGRAM_DATA:
        return "contPROG-DATA";
+    case -STREAM_MACOS_FORK_DATA:
+       return "contMACOS-RSRC";
+    case -STREAM_HFSPLUS_ATTRIBUTES:
+       return "contHFSPLUS-ATTR";
     default:
        sprintf(buf, "%d", stream);
-       return buf;     
+       return buf;
     }
 }
 
-/* 
+/*
  * Return a new record entity
  */
 DEV_RECORD *new_record(void)
@@ -165,10 +173,10 @@ void empty_record(DEV_RECORD *rec)
 }
 
 /*
- * Free the record entity 
+ * Free the record entity
  *
  */
-void free_record(DEV_RECORD *rec) 
+void free_record(DEV_RECORD *rec)
 {
    Dmsg0(350, "Enter free_record.\n");
    if (rec->data) {
@@ -177,7 +185,7 @@ void free_record(DEV_RECORD *rec)
    Dmsg0(350, "Data buf is freed.\n");
    free_pool_memory((POOLMEM *)rec);
    Dmsg0(350, "Leave free_record.\n");
-} 
+}
 
 
 /*
@@ -204,9 +212,9 @@ bool write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec)
    ASSERT(block->binbuf == (uint32_t) (block->bufp - block->buf));
    ASSERT(block->buf_len >= block->binbuf);
 
-   Dmsg6(890, "write_record_to_block() FI=%s SessId=%d Strm=%s len=%d\n\
-rem=%d remainder=%d\n",
-      FI_to_ascii(rec->FileIndex), rec->VolSessionId, 
+   Dmsg6(890, "write_record_to_block() FI=%s SessId=%d Strm=%s len=%d\n"
+"rem=%d remainder=%d\n",
+      FI_to_ascii(rec->FileIndex), rec->VolSessionId,
       stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len,
       remlen, rec->remainder);
 
@@ -246,15 +254,15 @@ rem=%d remainder=%d\n",
         return false;
       }
    } else {
-      /* 
+      /*
        * We are here to write unwritten bytes from a previous
-       * time. Presumably we have a new buffer (possibly 
-       * containing a volume label), so the new header 
+       * time. Presumably we have a new buffer (possibly
+       * containing a volume label), so the new header
        * should be able to fit in the block -- otherwise we have
        * an error.  Note, we have to continue splitting the
        * data record if it is longer than the block.
-       * 
-       * First, write the header, then write as much as 
+       *
+       * First, write the header, then write as much as
        * possible of the data record.
        *
        * Every time we write a header and it is a continuation
@@ -299,7 +307,7 @@ rem=%d remainder=%d\n",
 
    /*
     * Now deal with data record.
-    * Part of it may have already been transferred, and we 
+    * Part of it may have already been transferred, and we
     * may not have enough room to transfer the whole this time.
     */
    if (rec->remainder > 0) {
@@ -310,14 +318,14 @@ rem=%d remainder=%d\n",
         block->bufp += rec->remainder;
         block->binbuf += rec->remainder;
       } else {
-        memcpy(block->bufp, rec->data+rec->data_len-rec->remainder, 
+        memcpy(block->bufp, rec->data+rec->data_len-rec->remainder,
                remlen);
 #ifdef xxxxxSMCHECK
         if (!sm_check_rtn(__FILE__, __LINE__, False)) {
            /* We damaged a buffer */
-            Dmsg6(0, "Damaged block FI=%s SessId=%d Strm=%s len=%d\n\
-rem=%d remainder=%d\n",
-              FI_to_ascii(rec->FileIndex), rec->VolSessionId, 
+            Dmsg6(0, "Damaged block FI=%s SessId=%d Strm=%s len=%d\n"
+"rem=%d remainder=%d\n",
+              FI_to_ascii(rec->FileIndex), rec->VolSessionId,
               stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len,
               remlen, rec->remainder);
             Dmsg5(0, "Damaged block: bufp=%x binbuf=%d buf_len=%d rem=%d moved=%d\n",
@@ -344,7 +352,7 @@ rem=%d remainder=%d\n",
 /*
  * Test if we can write whole record to the block
  *
- *  Returns: false on failure 
+ *  Returns: false on failure
  *          true  on success (all bytes can be written)
  */
 bool can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec)
@@ -373,7 +381,7 @@ bool can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec)
  * Read a Record from the block
  *  Returns: false if nothing read or if the continuation record does not match.
  *                In both of these cases, a block read must be done.
- *          true  if at least the record header was read, this 
+ *          true  if at least the record header was read, this
  *                routine may have to be called again with a new
  *                block if the entire record was not read.
  */
@@ -392,14 +400,14 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
    rec->Block = block->BlockNumber;
    rec->File = ((DEVICE *)block->dev)->file;
 
-   /* Clear state flags */      
+   /* Clear state flags */
    rec->state = 0;
-   if (((DEVICE *)block->dev)->state & ST_TAPE) {
+   if (block->dev->is_tape()) {
       rec->state |= REC_ISTAPE;
    }
 
 
-   /* 
+   /*
     * Get the header. There is always a full header,
     * otherwise we find it in the next block.
     */
@@ -411,7 +419,7 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
       rhl = RECHDR2_LENGTH;
    }
    if (remlen >= rhl) {
-      Dmsg4(450, "Enter read_record_block: remlen=%d data_len=%d rem=%d blkver=%d\n", 
+      Dmsg4(450, "Enter read_record_block: remlen=%d data_len=%d rem=%d blkver=%d\n",
            remlen, rec->data_len, rec->remainder, block->BlockVer);
 
       unser_begin(block->bufp, WRITE_RECHDR_LENGTH);
@@ -433,7 +441,7 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
       /* If we are looking for more (remainder!=0), we reject anything
        *  where the VolSessionId and VolSessionTime don't agree
        */
-      if (rec->remainder && (rec->VolSessionId != VolSessionId || 
+      if (rec->remainder && (rec->VolSessionId != VolSessionId ||
                             rec->VolSessionTime != VolSessionTime)) {
         rec->state |= REC_NO_MATCH;
          Dmsg0(450, "remainder and VolSession doesn't match\n");
@@ -444,7 +452,7 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
        * of a previous partially written record.
        */
       if (Stream < 0) {              /* continuation record? */
-         Dmsg1(500, "Got negative Stream => continuation. remainder=%d\n", 
+         Dmsg1(500, "Got negative Stream => continuation. remainder=%d\n",
            rec->remainder);
         rec->state |= REC_CONTINUATION;
          if (!rec->remainder) {       /* if we didn't read previously */
@@ -470,25 +478,19 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
 
       Dmsg6(450, "rd_rec_blk() got FI=%s SessId=%d Strm=%s len=%u\n"
                  "remlen=%d data_len=%d\n",
-        FI_to_ascii(rec->FileIndex), rec->VolSessionId, 
-        stream_to_ascii(rec->Stream, rec->FileIndex), data_bytes, remlen, 
+        FI_to_ascii(rec->FileIndex), rec->VolSessionId,
+        stream_to_ascii(rec->Stream, rec->FileIndex), data_bytes, remlen,
         rec->data_len);
    } else {
-      /*    
-       * No more records in this block because the number   
-       * of remaining bytes are less than a record header 
+      /*
+       * No more records in this block because the number
+       * of remaining bytes are less than a record header
        * length, so return empty handed, but indicate that
        * he must read again. By returning, we allow the
        * higher level routine to fetch the next block and
        * then reread.
        */
       Dmsg0(450, "read_record_block: nothing\n");
-#ifdef xxx
-      if (!rec->remainder) {
-        rec->remainder = 1;          /* set to expect continuation */
-        rec->data_len = 0;           /* no data transferred */
-      }
-#endif
       rec->state |= (REC_NO_HEADER | REC_BLOCK_EMPTY);
       empty_block(block);                     /* mark block empty */
       return false;
@@ -497,10 +499,10 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
    ASSERT(data_bytes < MAX_BLOCK_LENGTH);      /* temp sanity check */
 
    rec->data = check_pool_memory_size(rec->data, rec->data_len+data_bytes);
-   
+
    /*
     * At this point, we have read the header, now we
-    * must transfer as much of the data record as 
+    * must transfer as much of the data record as
     * possible taking into account: 1. A partial
     * data record may have previously been transferred,
     * 2. The current block may not contain the whole data
@@ -525,7 +527,7 @@ bool read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec)
    }
    rec->remainder = 0;
    Dmsg4(450, "Rtn full rd_rec_blk FI=%s SessId=%d Strm=%s len=%d\n",
-      FI_to_ascii(rec->FileIndex), rec->VolSessionId, 
+      FI_to_ascii(rec->FileIndex), rec->VolSessionId,
       stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len);
    return true;                      /* transferred full record */
 }
index ffe17ae8933cb8a3f4c25fa7c2246e27d1056a59..df3eb9668eb009246b921673a4cb958379ec534b 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  Spooling code 
+ *  Spooling code
  *
- *     Kern Sibbald, March 2004
+ *      Kern Sibbald, March 2004
  *
  *  Version $Id$
  */
 /*
-   Copyright (C) 2004-2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -40,25 +40,25 @@ static bool write_spool_header(DCR *dcr);
 static bool write_spool_data(DCR *dcr);
 
 struct spool_stats_t {
-   uint32_t data_jobs;               /* current jobs spooling data */
-   uint32_t attr_jobs;               
-   uint32_t total_data_jobs;         /* total jobs to have spooled data */
+   uint32_t data_jobs;                /* current jobs spooling data */
+   uint32_t attr_jobs;
+   uint32_t total_data_jobs;          /* total jobs to have spooled data */
    uint32_t total_attr_jobs;
-   int64_t max_data_size;            /* max data size */
+   int64_t max_data_size;             /* max data size */
    int64_t max_attr_size;
-   int64_t data_size;                /* current data size (all jobs running) */
+   int64_t data_size;                 /* current data size (all jobs running) */
    int64_t attr_size;
 };
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 spool_stats_t spool_stats;
 
-/* 
+/*
  * Header for data spool record */
 struct spool_hdr {
-   int32_t  FirstIndex;              /* FirstIndex for buffer */
-   int32_t  LastIndex;               /* LastIndex for buffer */
-   uint32_t len;                     /* length of next buffer */
+   int32_t  FirstIndex;               /* FirstIndex for buffer */
+   int32_t  LastIndex;                /* LastIndex for buffer */
+   uint32_t len;                      /* length of next buffer */
 };
 
 enum {
@@ -72,15 +72,15 @@ void list_spool_stats(BSOCK *bs)
    char ed1[30], ed2[30];
    if (spool_stats.data_jobs || spool_stats.max_data_size) {
       bnet_fsend(bs, "Data spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes/job.\n",
-        spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
-        spool_stats.total_data_jobs, 
-        edit_uint64_with_commas(spool_stats.max_data_size, ed2));
+         spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
+         spool_stats.total_data_jobs,
+         edit_uint64_with_commas(spool_stats.max_data_size, ed2));
    }
    if (spool_stats.attr_jobs || spool_stats.max_attr_size) {
       bnet_fsend(bs, "Attr spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes.\n",
-        spool_stats.attr_jobs, edit_uint64_with_commas(spool_stats.attr_size, ed1), 
-        spool_stats.total_attr_jobs, 
-        edit_uint64_with_commas(spool_stats.max_attr_size, ed2));
+         spool_stats.attr_jobs, edit_uint64_with_commas(spool_stats.attr_size, ed1),
+         spool_stats.total_attr_jobs,
+         edit_uint64_with_commas(spool_stats.max_attr_size, ed2));
    }
 }
 
@@ -92,11 +92,11 @@ bool begin_data_spool(JCR *jcr)
       jcr->dcr->spool_data = true;
       stat = open_data_spool_file(jcr);
       if (stat) {
-        jcr->dcr->spooling = true;
+         jcr->dcr->spooling = true;
          Jmsg(jcr, M_INFO, 0, _("Spooling data ...\n"));
-        P(mutex);
-        spool_stats.data_jobs++;
-        V(mutex);
+         P(mutex);
+         spool_stats.data_jobs++;
+         V(mutex);
       }
    }
    return stat;
@@ -120,8 +120,8 @@ bool commit_data_spool(JCR *jcr)
       stat = despool_data(jcr->dcr, true /*commit*/);
       if (!stat) {
          Pmsg1(000, "Bad return from despool WroteVol=%d\n", jcr->dcr->WroteVol);
-        close_data_spool_file(jcr);
-        return false;
+         close_data_spool_file(jcr);
+         return false;
       }
       return close_data_spool_file(jcr);
    }
@@ -130,13 +130,14 @@ bool commit_data_spool(JCR *jcr)
 
 static void make_unique_data_spool_filename(JCR *jcr, POOLMEM **name)
 {
-   const char *dir;  
+   const char *dir;
    if (jcr->dcr->dev->device->spool_directory) {
       dir = jcr->dcr->dev->device->spool_directory;
    } else {
       dir = working_directory;
    }
-   Mmsg(name, "%s/%s.data.spool.%s.%s", dir, my_name, jcr->Job, jcr->device->hdr.name);
+   Mmsg(name, "%s/%s.data.spool.%s.%s", dir, my_name, jcr->Job, 
+        jcr->dcr->device->hdr.name);
 }
 
 
@@ -152,7 +153,7 @@ static bool open_data_spool_file(JCR *jcr)
    } else {
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("Open data spool file %s failed: ERR=%s\n"), name,
-          be.strerror());
+           be.strerror());
       free_pool_memory(name);
       return false;
    }
@@ -188,7 +189,7 @@ static bool close_data_spool_file(JCR *jcr)
 
 static const char *spool_name = "*spool*";
 
-static bool despool_data(DCR *dcr, bool commit) 
+static bool despool_data(DCR *dcr, bool commit)
 {
    DEVICE *rdev;
    DCR *rdcr;
@@ -201,14 +202,14 @@ static bool despool_data(DCR *dcr, bool commit)
    Dmsg0(100, "Despooling data\n");
    Jmsg(jcr, M_INFO, 0, _("%s spooled data to Volume. Despooling %s bytes ...\n"),
         commit?"Committing":"Writing",
-       edit_uint64_with_commas(jcr->dcr->dev->spool_size, ec1));
+        edit_uint64_with_commas(jcr->dcr->spool_size, ec1));
    dcr->spooling = false;
    lock_device(dcr->dev);
-   dcr->dev_locked = true; 
+   dcr->dev_locked = true;
 
-   /* 
+   /*
     * This is really quite kludgy and should be fixed some time.
-    * We create a dev structure to read from the spool file 
+    * We create a dev structure to read from the spool file
     * in rdev and rdcr.
     */
    rdev = (DEVICE *)malloc(sizeof(DEVICE));
@@ -221,36 +222,36 @@ static bool despool_data(DCR *dcr, bool commit)
    rdev->min_block_size = dcr->dev->min_block_size;
    rdev->device = dcr->dev->device;
    rdcr = new_dcr(NULL, rdev);
-   rdcr->spool_fd = dcr->spool_fd; 
-   rdcr->jcr = jcr;                  /* set a valid jcr */
-   block = dcr->block;               /* save block */
-   dcr->block = rdcr->block;         /* make read and write block the same */
+   rdcr->spool_fd = dcr->spool_fd;
+   rdcr->jcr = jcr;                   /* set a valid jcr */
+   block = dcr->block;                /* save block */
+   dcr->block = rdcr->block;          /* make read and write block the same */
 
    Dmsg1(800, "read/write block size = %d\n", block->buf_len);
    lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
 
    for ( ; ok; ) {
       if (job_canceled(jcr)) {
-        ok = false;
-        break;
+         ok = false;
+         break;
       }
       stat = read_block_from_spool_file(rdcr);
       if (stat == RB_EOT) {
-        break;
+         break;
       } else if (stat == RB_ERROR) {
-        ok = false;
-        break;
+         ok = false;
+         break;
       }
       ok = write_block_to_device(dcr);
       Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, block->LastIndex);
    }
-   dcr->block = block;               /* reset block */
+   dcr->block = block;                /* reset block */
 
    lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
    if (ftruncate(rdcr->spool_fd, 0) != 0) {
       berrno be;
-      Jmsg(dcr->jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"), 
-        be.strerror());
+      Jmsg(dcr->jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+         be.strerror());
       Pmsg1(000, "Bad return from ftruncate. ERR=%s\n", be.strerror());
       ok = false;
    }
@@ -264,7 +265,7 @@ static bool despool_data(DCR *dcr, bool commit)
    V(mutex);
    P(dcr->dev->spool_mutex);
    dcr->dev->spool_size -= dcr->spool_size;
-   dcr->spool_size = 0;              /* zap size in input dcr */
+   dcr->spool_size = 0;               /* zap size in input dcr */
    V(dcr->dev->spool_mutex);
    free_memory(rdev->dev_name);
    free_pool_memory(rdev->errmsg);
@@ -274,16 +275,16 @@ static bool despool_data(DCR *dcr, bool commit)
    free(rdev);
    unlock_device(dcr->dev);
    dcr->dev_locked = false;
-   dcr->spooling = true;          /* turn on spooling again */
+   dcr->spooling = true;           /* turn on spooling again */
    return ok;
 }
 
 /*
  * Read a block from the spool file
- * 
+ *
  *  Returns RB_OK on success
- *         RB_EOT when file done
- *         RB_ERROR on error
+ *          RB_EOT when file done
+ *          RB_ERROR on error
  */
 static int read_block_from_spool_file(DCR *dcr)
 {
@@ -299,9 +300,9 @@ static int read_block_from_spool_file(DCR *dcr)
       return RB_EOT;
    } else if (stat != (ssize_t)rlen) {
       if (stat == -1) {
-        berrno be;
-         Jmsg(dcr->jcr, M_FATAL, 0, _("Spool header read error. ERR=%s\n"), 
-             be.strerror());
+         berrno be;
+         Jmsg(dcr->jcr, M_FATAL, 0, _("Spool header read error. ERR=%s\n"),
+              be.strerror());
       } else {
          Pmsg2(000, "Spool read error. Wanted %u bytes, got %u\n", rlen, stat);
          Jmsg2(dcr->jcr, M_FATAL, 0, _("Spool header read error. Wanted %u bytes, got %u\n"), rlen, stat);
@@ -335,16 +336,16 @@ static int read_block_from_spool_file(DCR *dcr)
  * Write a block to the spool file
  *
  *  Returns: true on success or EOT
- *          false on hard error
+ *           false on hard error
  */
 bool write_block_to_spool_file(DCR *dcr)
 {
-   uint32_t wlen, hlen;              /* length to write */
+   uint32_t wlen, hlen;               /* length to write */
    bool despool = false;
    DEV_BLOCK *block = dcr->block;
 
    ASSERT(block->binbuf == ((uint32_t) (block->bufp - block->buf)));
-   if (block->binbuf <= WRITE_BLKHDR_LENGTH) { /* Does block have data in it? */
+   if (block->binbuf <= WRITE_BLKHDR_LENGTH) {  /* Does block have data in it? */
       return true;
    }
 
@@ -365,19 +366,19 @@ bool write_block_to_spool_file(DCR *dcr)
    }
    V(mutex);
    if (despool) {
-#ifdef xDEBUG 
+#ifdef xDEBUG
       char ec1[30], ec2[30], ec3[30], ec4[30];
       Dmsg4(100, "Despool in write_block_to_spool_file max_size=%s size=%s "
-            "max_job_size=%s job_size=%s\n", 
-           edit_uint64_with_commas(dcr->max_spool_size, ec1),
-           edit_uint64_with_commas(dcr->spool_size, ec2),
-           edit_uint64_with_commas(dcr->dev->max_spool_size, ec3),
-           edit_uint64_with_commas(dcr->dev->spool_size, ec4));
+            "max_job_size=%s job_size=%s\n",
+            edit_uint64_with_commas(dcr->max_spool_size, ec1),
+            edit_uint64_with_commas(dcr->spool_size, ec2),
+            edit_uint64_with_commas(dcr->dev->max_spool_size, ec3),
+            edit_uint64_with_commas(dcr->dev->spool_size, ec4));
 #endif
       Jmsg(dcr->jcr, M_INFO, 0, _("User specified spool size reached.\n"));
       if (!despool_data(dcr, false)) {
          Pmsg0(000, "Bad return from despool in write_block.\n");
-        return false;
+         return false;
       }
       /* Despooling cleared these variables so reset them */
       P(dcr->dev->spool_mutex);
@@ -385,7 +386,7 @@ bool write_block_to_spool_file(DCR *dcr)
       dcr->dev->spool_size += hlen + wlen;
       V(dcr->dev->spool_mutex);
       Jmsg(dcr->jcr, M_INFO, 0, _("Spooling data again ...\n"));
-   }  
+   }
 
 
    if (!write_spool_header(dcr)) {
@@ -402,7 +403,7 @@ bool write_block_to_spool_file(DCR *dcr)
 
 static bool write_spool_header(DCR *dcr)
 {
-   spool_hdr hdr;   
+   spool_hdr hdr;
    ssize_t stat;
    DEV_BLOCK *block = dcr->block;
 
@@ -414,25 +415,25 @@ static bool write_spool_header(DCR *dcr)
    for (int retry=0; retry<=1; retry++) {
       stat = write(dcr->spool_fd, (char*)&hdr, sizeof(hdr));
       if (stat == -1) {
-        berrno be;
-         Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing header to spool file. ERR=%s\n"), 
-             be.strerror());
+         berrno be;
+         Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing header to spool file. ERR=%s\n"),
+              be.strerror());
       }
       if (stat != (ssize_t)sizeof(hdr)) {
-        /* If we wrote something, truncate it, then despool */
-        if (stat != -1) {
-           if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR) - stat) != 0) {
-              berrno be;
-               Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"), 
-                 be.strerror());
-              return false;
-           }
-        }
-        if (!despool_data(dcr, false)) {
+         /* If we wrote something, truncate it, then despool */
+         if (stat != -1) {
+            if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR) - stat) != 0) {
+               berrno be;
+               Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+                  be.strerror());
+               return false;
+            }
+         }
+         if (!despool_data(dcr, false)) {
             Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
-           return false;
-        }
-        continue;                    /* try again */
+            return false;
+         }
+         continue;                    /* try again */
       }
       return true;
    }
@@ -449,31 +450,31 @@ static bool write_spool_data(DCR *dcr)
    for (int retry=0; retry<=1; retry++) {
       stat = write(dcr->spool_fd, block->buf, (size_t)block->binbuf);
       if (stat == -1) {
-        berrno be;
+         berrno be;
          Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing data to spool file. ERR=%s\n"),
-             be.strerror());
+              be.strerror());
       }
       if (stat != (ssize_t)block->binbuf) {
-        /* 
-         * If we wrote something, truncate it and the header, then despool
-         */
-        if (stat != -1) {
-           if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR)
-                     - stat - sizeof(spool_hdr)) != 0) {
-              berrno be;
-               Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"), 
-                 be.strerror());
-              return false;
-           }
-        }
-        if (!despool_data(dcr, false)) {
+         /*
+          * If we wrote something, truncate it and the header, then despool
+          */
+         if (stat != -1) {
+            if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR)
+                      - stat - sizeof(spool_hdr)) != 0) {
+               berrno be;
+               Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+                  be.strerror());
+               return false;
+            }
+         }
+         if (!despool_data(dcr, false)) {
             Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
-           return false;
-        }
-        if (!write_spool_header(dcr)) {
-           return false;
-        }
-        continue;                    /* try again */
+            return false;
+         }
+         if (!write_spool_header(dcr)) {
+            return false;
+         }
+         continue;                    /* try again */
       }
       return true;
    }
@@ -488,7 +489,7 @@ bool are_attributes_spooled(JCR *jcr)
    return jcr->spool_attributes && jcr->dir_bsock->spool_fd;
 }
 
-/* 
+/*
  * Create spool file for attributes.
  *  This is done by "attaching" to the bsock, and when
  *  it is called, the output is written to a file.
@@ -516,9 +517,9 @@ static void update_attr_spool_size(ssize_t size)
    P(mutex);
    if (size > 0) {
      if ((spool_stats.attr_size - size) > 0) {
-       spool_stats.attr_size -= size;
+        spool_stats.attr_size -= size;
      } else {
-       spool_stats.attr_size = 0;
+        spool_stats.attr_size = 0;
      }
    }
    V(mutex);
@@ -526,30 +527,39 @@ static void update_attr_spool_size(ssize_t size)
 
 bool commit_attribute_spool(JCR *jcr)
 {
-   ssize_t size;
+   off_t size;
    char ec1[30];
 
    if (are_attributes_spooled(jcr)) {
-      if (fseek(jcr->dir_bsock->spool_fd, 0, SEEK_END) != 0) {
-        berrno be;
+      if (fseeko(jcr->dir_bsock->spool_fd, 0, SEEK_END) != 0) {
+         berrno be;
          Jmsg(jcr, M_FATAL, 0, _("Fseek on attributes file failed: ERR=%s\n"),
-             be.strerror());
+              be.strerror());
+         goto bail_out;
+      }
+      size = ftello(jcr->dir_bsock->spool_fd);
+      if (size < 0) {
+         berrno be;
+         Jmsg(jcr, M_FATAL, 0, _("Ftell on attributes file failed: ERR=%s\n"),
+              be.strerror());
+         goto bail_out;
       }
-      size = ftell(jcr->dir_bsock->spool_fd);
       P(mutex);
-      if (size > 0) {
-       if (spool_stats.attr_size + size > spool_stats.max_attr_size) {
-          spool_stats.max_attr_size = spool_stats.attr_size + size;
-       } 
+      if (spool_stats.attr_size + size > spool_stats.max_attr_size) {
+          spool_stats.max_attr_size = spool_stats.attr_size + size;
       }
       spool_stats.attr_size += size;
       V(mutex);
       Jmsg(jcr, M_INFO, 0, _("Sending spooled attrs to the Director. Despooling %s bytes ...\n"),
-           edit_uint64_with_commas(size, ec1));
+            edit_uint64_with_commas(size, ec1));
       bnet_despool_to_bsock(jcr->dir_bsock, update_attr_spool_size, size);
       return close_attr_spool_file(jcr, jcr->dir_bsock);
    }
    return true;
+
+bail_out:
+   close_attr_spool_file(jcr, jcr->dir_bsock);
+   return false;
 }
 
 static void make_unique_spool_filename(JCR *jcr, POOLMEM **name, int fd)
@@ -568,7 +578,7 @@ bool open_attr_spool_file(JCR *jcr, BSOCK *bs)
    if (!bs->spool_fd) {
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("fopen attr spool file %s failed: ERR=%s\n"), name,
-          be.strerror());
+           be.strerror());
       free_pool_memory(name);
       return false;
    }
@@ -582,7 +592,7 @@ bool open_attr_spool_file(JCR *jcr, BSOCK *bs)
 bool close_attr_spool_file(JCR *jcr, BSOCK *bs)
 {
    POOLMEM *name;
-    
+
    if (!bs->spool_fd) {
       return true;
    }
index cf73279d1901ee22c498ff137bc71b6279b64302..d09b93cf650da26fe6c845955d1e384f692c7437 100644 (file)
@@ -4,10 +4,10 @@
  *     Kern Sibbald, May MMIII
  *
  *   Version $Id$
- *  
+ *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -97,58 +97,58 @@ bool status_cmd(JCR *jcr)
    bnet_fsend(user, _("\nDevice status:\n"));
    LockRes();
    foreach_res(device, R_DEVICE) {
-      for (dev=device->dev; dev; dev=dev->next) {
-        if (dev_state(dev, ST_OPENED)) {
-           if (dev_state(dev, ST_LABEL)) {
-               bnet_fsend(user, _("Device \"%s\" is mounted with Volume \"%s\"\n"), 
-                 dev_name(dev), dev->VolHdr.VolName);
-           } else {
-               bnet_fsend(user, _("Device \"%s\" open but no Bacula volume is mounted.\n"), dev_name(dev));
+      dev = device->dev;
+      if (dev && dev->is_open()) {
+        if (dev->is_labeled()) {
+            bnet_fsend(user, _("Device \"%s\" is mounted with Volume \"%s\"\n"),
+              dev_name(dev), dev->VolHdr.VolName);
+        } else {
+            bnet_fsend(user, _("Device \"%s\" open but no Bacula volume is mounted.\n"), dev_name(dev));
+        }
+        send_blocked_status(jcr, dev);
+        if (dev_state(dev, ST_APPEND)) {
+           bpb = dev->VolCatInfo.VolCatBlocks;
+           if (bpb <= 0) {
+              bpb = 1;
            }
-           send_blocked_status(jcr, dev);
-           if (dev_state(dev, ST_APPEND)) {
-              bpb = dev->VolCatInfo.VolCatBlocks;
-              if (bpb <= 0) {
-                 bpb = 1;
-              }
-              bpb = dev->VolCatInfo.VolCatBytes / bpb;
-               bnet_fsend(user, _("    Total Bytes=%s Blocks=%s Bytes/block=%s\n"),
-                 edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, b1),
-                 edit_uint64_with_commas(dev->VolCatInfo.VolCatBlocks, b2), 
-                 edit_uint64_with_commas(bpb, b3));
-           } else {  /* reading */
-              bpb = dev->VolCatInfo.VolCatReads;
-              if (bpb <= 0) {
-                 bpb = 1;
-              }
-              if (dev->VolCatInfo.VolCatRBytes > 0) {
-                 bpb = dev->VolCatInfo.VolCatRBytes / bpb;
-              } else {
-                 bpb = 0;
-              }
-               bnet_fsend(user, _("    Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n"),
-                 edit_uint64_with_commas(dev->VolCatInfo.VolCatRBytes, b1),
-                 edit_uint64_with_commas(dev->VolCatInfo.VolCatReads, b2), 
-                 edit_uint64_with_commas(bpb, b3));
+           bpb = dev->VolCatInfo.VolCatBytes / bpb;
+            bnet_fsend(user, _("    Total Bytes=%s Blocks=%s Bytes/block=%s\n"),
+              edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, b1),
+              edit_uint64_with_commas(dev->VolCatInfo.VolCatBlocks, b2),
+              edit_uint64_with_commas(bpb, b3));
+        } else {  /* reading */
+           bpb = dev->VolCatInfo.VolCatReads;
+           if (bpb <= 0) {
+              bpb = 1;
            }
-            bnet_fsend(user, _("    Positioned at File=%s Block=%s\n"), 
-              edit_uint64_with_commas(dev->file, b1),
-              edit_uint64_with_commas(dev->block_num, b2));
-
-        } else {
-            bnet_fsend(user, _("Device \"%s\" is not open.\n"), dev_name(dev));
-           send_blocked_status(jcr, dev);
+           if (dev->VolCatInfo.VolCatRBytes > 0) {
+              bpb = dev->VolCatInfo.VolCatRBytes / bpb;
+           } else {
+              bpb = 0;
+           }
+            bnet_fsend(user, _("    Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n"),
+              edit_uint64_with_commas(dev->VolCatInfo.VolCatRBytes, b1),
+              edit_uint64_with_commas(dev->VolCatInfo.VolCatReads, b2),
+              edit_uint64_with_commas(bpb, b3));
         }
+         bnet_fsend(user, _("    Positioned at File=%s Block=%s\n"),
+           edit_uint64_with_commas(dev->file, b1),
+           edit_uint64_with_commas(dev->block_num, b2));
+
+      } else {
+         bnet_fsend(user, _("Archive \"%s\" is not open or does not exist.\n"), device->hdr.name);
+        send_blocked_status(jcr, dev);
       }
    }
    UnlockRes();
 
-
-#ifdef xfull_status
-   bnet_fsend(user, "\n\n");
-   dump_resource(R_DEVICE, resources[R_DEVICE-r_first].res_head, sendit, user);
-#endif
+#ifdef xxx
+   if (debug_level > 0) {
+      bnet_fsend(user, "====\n\n");
+      dump_resource(R_DEVICE, resources[R_DEVICE-r_first].res_head, sendit, user);
+   }
    bnet_fsend(user, "====\n\n");
+#endif
 
    list_spool_stats(user);
 
@@ -156,11 +156,14 @@ bool status_cmd(JCR *jcr)
    return true;
 }
 
-static void send_blocked_status(JCR *jcr, DEVICE *dev) 
+static void send_blocked_status(JCR *jcr, DEVICE *dev)
 {
    BSOCK *user = jcr->dir_bsock;
    DCR *dcr = jcr->dcr;
 
+   if (!dev) {
+      return;
+   }
    switch (dev->dev_blocked) {
    case BST_UNMOUNTED:
       bnet_fsend(user, _("    Device is BLOCKED. User unmounted.\n"));
@@ -202,21 +205,23 @@ static void send_blocked_status(JCR *jcr, DEVICE *dev)
       bnet_fsend(user, "\n");
 
       bnet_fsend(user, _("Device status:\n"));
-      bnet_fsend(user, "%sOPENED ", dev->state & ST_OPENED ? "" : "!");
-      bnet_fsend(user, "%sTAPE ", dev->state & ST_TAPE ? "" : "!");
-      bnet_fsend(user, "%sLABEL ", dev->state & ST_LABEL ? "" : "!");
+      bnet_fsend(user, "%sOPENED ", dev->is_open() ? "" : "!");
+      bnet_fsend(user, "%sTAPE ", dev->is_tape() ? "" : "!");
+      bnet_fsend(user, "%sLABEL ", dev->is_labeled() ? "" : "!");
       bnet_fsend(user, "%sMALLOC ", dev->state & ST_MALLOC ? "" : "!");
-      bnet_fsend(user, "%sAPPEND ", dev->state & ST_APPEND ? "" : "!");
-      bnet_fsend(user, "%sREAD ", dev->state & ST_READ ? "" : "!");
-      bnet_fsend(user, "%sEOT ", dev->state & ST_EOT ? "" : "!");
+      bnet_fsend(user, "%sAPPEND ", dev->can_append() ? "" : "!");
+      bnet_fsend(user, "%sREAD ", dev->can_read() ? "" : "!");
+      bnet_fsend(user, "%sEOT ", dev->at_eot() ? "" : "!");
       bnet_fsend(user, "%sWEOT ", dev->state & ST_WEOT ? "" : "!");
-      bnet_fsend(user, "%sEOF ", dev->state & ST_EOF ? "" : "!");
+      bnet_fsend(user, "%sEOF ", dev->at_eof() ? "" : "!");
       bnet_fsend(user, "%sNEXTVOL ", dev->state & ST_NEXTVOL ? "" : "!");
       bnet_fsend(user, "%sSHORT ", dev->state & ST_SHORT ? "" : "!");
+      bnet_fsend(user, "%sMOUNTED ", dev->state & ST_MOUNTED ? "" : "!");
       bnet_fsend(user, "\n");
 
       bnet_fsend(user, _("Device parameters:\n"));
-      bnet_fsend(user, "Device name: %s\n", dev->dev_name);
+      bnet_fsend(user, "Archive name: %s Device name: %s\n", dev->dev_name,
+        dev->device->hdr.name);
       bnet_fsend(user, "File=%u block=%u\n", dev->file, dev->block_num);
       bnet_fsend(user, "Min block=%u Max block=%u\n", dev->min_block_size, dev->max_block_size);
    }
@@ -230,7 +235,7 @@ static void list_running_jobs(BSOCK *user)
    JCR *jcr;
    char JobName[MAX_NAME_LENGTH];
    char b1[30], b2[30], b3[30];
-   
+
    bnet_fsend(user, _("\nRunning Jobs:\n"));
    lock_jcr_chain();
    foreach_jcr(jcr) {
@@ -238,7 +243,7 @@ static void list_running_jobs(BSOCK *user)
          bnet_fsend(user, _("%s Job %s waiting for Client connection.\n"),
            job_type_to_str(jcr->JobType), jcr->Job);
       }
-      if (jcr->device) {
+      if (jcr->dcr && jcr->dcr->device) {
         bstrncpy(JobName, jcr->Job, sizeof(JobName));
         /* There are three periods after the Job name */
         char *p;
@@ -247,26 +252,26 @@ static void list_running_jobs(BSOCK *user)
               *p = 0;
            }
         }
-         bnet_fsend(user, _("%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n"), 
+         bnet_fsend(user, _("%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n"),
                   job_level_to_str(jcr->JobLevel),
                   job_type_to_str(jcr->JobType),
                   JobName,
                   jcr->JobId,
-                   jcr->dcr?jcr->dcr->VolumeName:"*none*",
-                   jcr->device?jcr->device->device_name:"none");
+                  jcr->dcr->VolumeName,
+                  jcr->dcr->device->device_name);
         sec = time(NULL) - jcr->run_time;
         if (sec <= 0) {
            sec = 1;
         }
         bps = jcr->JobBytes / sec;
-         bnet_fsend(user, _("    Files=%s Bytes=%s Bytes/sec=%s\n"), 
+         bnet_fsend(user, _("    Files=%s Bytes=%s Bytes/sec=%s\n"),
            edit_uint64_with_commas(jcr->JobFiles, b1),
            edit_uint64_with_commas(jcr->JobBytes, b2),
            edit_uint64_with_commas(bps, b3));
         found = true;
 #ifdef DEBUG
         if (jcr->file_bsock) {
-            bnet_fsend(user, "    FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n", 
+            bnet_fsend(user, "    FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n",
               edit_uint64_with_commas(jcr->file_bsock->read_seqno, b1),
               jcr->file_bsock->in_msg_no, jcr->file_bsock->out_msg_no,
               jcr->file_bsock->fd);
@@ -292,16 +297,16 @@ static void list_terminated_jobs(void *arg)
    const char *msg;
 
    if (last_jobs->size() == 0) {
-      msg = _("No Terminated Jobs.\n"); 
+      msg = _("No Terminated Jobs.\n");
       sendit(msg, strlen(msg), arg);
       return;
    }
    lock_last_jobs_list();
-   msg =  _("\nTerminated Jobs:\n"); 
+   msg =  _("\nTerminated Jobs:\n");
    sendit(msg, strlen(msg), arg);
    msg =  _(" JobId  Level   Files          Bytes Status   Finished        Name \n");
    sendit(msg, strlen(msg), arg);
-   msg = _("======================================================================\n"); 
+   msg = _("======================================================================\n");
    sendit(msg, strlen(msg), arg);
    foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
@@ -348,11 +353,11 @@ static void list_terminated_jobs(void *arg)
            *p = 0;
         }
       }
-      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"), 
+      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"),
         je->JobId,
-        level, 
+        level,
         edit_uint64_with_commas(je->JobFiles, b1),
-        edit_uint64_with_commas(je->JobBytes, b2), 
+        edit_uint64_with_commas(je->JobBytes, b2),
         termstat,
         dt, JobName);
       sendit(buf, strlen(buf), arg);
@@ -364,7 +369,7 @@ static void list_terminated_jobs(void *arg)
 /*
  * Convert Job Level into a string
  */
-static const char *level_to_str(int level) 
+static const char *level_to_str(int level)
 {
    const char *str;
 
@@ -409,7 +414,7 @@ static const char *level_to_str(int level)
 }
 
 /*
- * Send to Director 
+ * Send to Director
  */
 static void sendit(const char *msg, int len, void *arg)
 {
@@ -438,7 +443,7 @@ bool qstatus_cmd(JCR *jcr)
       return false;
    }
    unbash_spaces(time);
-   
+
    if (strcmp(time.c_str(), "current") == 0) {
       bnet_fsend(dir, OKqstatus, time.c_str());
       lock_jcr_chain();
index 27fe7618cc511962ab615a6482da027c0a61e4ed..bccdcf0ebf61fb61045c0182fb6c32063aa2d96a 100644 (file)
@@ -4,13 +4,13 @@
  * It accepts a number of simple commands from the File daemon
  * and acts on them. When a request to append data is made,
  * it opens a data channel and accepts data from the
- * File daemon. 
+ * File daemon.
  *
  *   Version $Id$
- * 
+ *
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -65,7 +65,7 @@ static workq_t dird_workq;          /* queue for processing connections */
 static void usage()
 {
    fprintf(stderr, _(
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
 "\nVersion: " VERSION " (" BDATE ")\n\n"
 "Usage: stored [options] [-c config_file] [config_file]\n"
 "        -c <file>   use <file> as configuration file\n"
@@ -82,14 +82,14 @@ static void usage()
    exit(1);
 }
 
-/********************************************************************* 
+/*********************************************************************
  *
  *  Main Bacula Unix Storage Daemon
  *
  */
 int main (int argc, char *argv[])
 {
-   int ch;   
+   int ch;
    int no_signals = FALSE;
    int test_config = FALSE;
    pthread_t thid;
@@ -103,9 +103,9 @@ int main (int argc, char *argv[])
    daemon_start_time = time(NULL);
 
    /* Sanity checks */
-   if (TAPE_BSIZE % DEV_BSIZE != 0 || TAPE_BSIZE / DEV_BSIZE == 0) {
+   if (TAPE_BSIZE % B_DEV_BSIZE != 0 || TAPE_BSIZE / B_DEV_BSIZE == 0) {
       Emsg2(M_ABORT, 0, "Tape block size (%d) not multiple of system size (%d)\n",
-        TAPE_BSIZE, DEV_BSIZE);
+        TAPE_BSIZE, B_DEV_BSIZE);
    }
    if (TAPE_BSIZE != (1 << (ffs(TAPE_BSIZE)-1))) {
       Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
@@ -123,7 +123,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0) {
-           debug_level = 1; 
+           debug_level = 1;
         }
         break;
 
@@ -159,7 +159,7 @@ int main (int argc, char *argv[])
       default:
         usage();
         break;
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -169,7 +169,7 @@ int main (int argc, char *argv[])
         free(configfile);
       }
       configfile = bstrdup(*argv);
-      argc--; 
+      argc--;
       argv++;
    }
    if (argc)
@@ -179,7 +179,6 @@ int main (int argc, char *argv[])
       init_signals(terminate_stored);
    }
 
-
    if (configfile == NULL) {
       configfile = bstrdup(CONFIG_FILE);
    }
@@ -206,7 +205,7 @@ int main (int argc, char *argv[])
     */
    VolSessionTime = (long)daemon_start_time;
    if (VolSessionTime == 0) { /* paranoid */
-      Emsg0(M_ABORT, 0, _("Volume Session Time is ZERO!\n"));
+      Jmsg0(NULL, M_ABORT, 0, _("Volume Session Time is ZERO!\n"));
    }
 
    /* Make sure on Solaris we can run concurrent, watch dog + servers + misc */
@@ -223,12 +222,12 @@ int main (int argc, char *argv[])
 
    init_jcr_subsystem();             /* start JCR watchdogs etc. */
 
-   /* 
+   /*
     * Sleep a bit to give device thread a chance to lock the resource
     * chain before we start the server.
     */
    bmicrosleep(1, 0);
-                                
+
    /* Single server used for Director and File daemon */
    bnet_thread_server(me->sdaddrs, me->max_concurrent_jobs * 2 + 1,
                      &dird_workq, handle_connection_request);
@@ -254,7 +253,7 @@ static void check_config()
    me = (STORES *)GetNextRes(R_STORAGE, NULL);
    if (!me) {
       UnlockRes();
-      Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
+      Jmsg1(NULL, M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
         configfile);
    }
 
@@ -262,23 +261,23 @@ static void check_config()
 
    if (GetNextRes(R_STORAGE, (RES *)me) != NULL) {
       UnlockRes();
-      Emsg1(M_ERROR_TERM, 0, _("Only one Storage resource permitted in %s\n"), 
+      Jmsg1(NULL, M_ERROR_TERM, 0, _("Only one Storage resource permitted in %s\n"),
         configfile);
    }
    if (GetNextRes(R_DIRECTOR, NULL) == NULL) {
       UnlockRes();
-      Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s. Cannot continue.\n"),
+      Jmsg1(NULL, M_ERROR_TERM, 0, _("No Director resource defined in %s. Cannot continue.\n"),
         configfile);
    }
    if (GetNextRes(R_DEVICE, NULL) == NULL){
       UnlockRes();
-      Emsg1(M_ERROR_TERM, 0, _("No Device resource defined in %s. Cannot continue.\n"),
+      Jmsg1(NULL, M_ERROR_TERM, 0, _("No Device resource defined in %s. Cannot continue.\n"),
           configfile);
    }
    if (!me->messages) {
       me->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
       if (!me->messages) {
-         Emsg1(M_ERROR_TERM, 0, _("No Messages resource defined in %s. Cannot continue.\n"),
+         Jmsg1(NULL, M_ERROR_TERM, 0, _("No Messages resource defined in %s. Cannot continue.\n"),
            configfile);
       }
    }
@@ -288,16 +287,16 @@ static void check_config()
    UnlockRes();
 
    if (!me->working_directory) {
-      Emsg1(M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
+      Jmsg1(NULL, M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
         configfile);
    }
-   
+
    set_working_directory(me->working_directory);
 }
 
 /*
- * We are started as a separate thread.  The
- *  resources are alread locked.
+ * Here we attempt to init and open each device. This is done
+ *  once at startup in a separate thread.
  */
 extern "C"
 void *device_allocation(void *arg)
@@ -312,17 +311,17 @@ void *device_allocation(void *arg)
       device->dev = init_dev(NULL, device);
       Dmsg1(10, "SD init done %s\n", device->device_name);
       if (!device->dev) {
-         Emsg1(M_ERROR, 0, _("Could not initialize %s\n"), device->device_name);
+         Jmsg1(NULL, M_ERROR, 0, _("Could not initialize %s\n"), device->device_name);
         continue;
       }
 
       if (device->cap_bits & CAP_ALWAYSOPEN) {
          Dmsg1(20, "calling first_open_device %s\n", device->device_name);
         if (!first_open_device(device->dev)) {
-            Emsg1(M_ERROR, 0, _("Could not open device %s\n"), device->device_name);
+            Jmsg1(NULL, M_ERROR, 0, _("Could not open device %s\n"), device->device_name);
         }
       }
-      if (device->cap_bits & CAP_AUTOMOUNT && device->dev && 
+      if (device->cap_bits & CAP_AUTOMOUNT && device->dev &&
          device->dev->state & ST_OPENED) {
         JCR *jcr;
         DCR *dcr;
@@ -333,19 +332,18 @@ void *device_allocation(void *arg)
         if (errstat != 0) {
             Jmsg1(jcr, M_ABORT, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat));
         }
-        jcr->device = device;
         dcr = new_dcr(jcr, device->dev);
         switch (read_dev_volume_label(dcr)) {
-           case VOL_OK:
-              memcpy(&dcr->dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dcr->dev->VolCatInfo));
-              break;
-           default:
-               Emsg1(M_WARNING, 0, _("Could not mount device %s\n"), device->device_name);
-              break;
+        case VOL_OK:
+           memcpy(&dcr->dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dcr->dev->VolCatInfo));
+           break;
+        default:
+            Jmsg1(NULL, M_WARNING, 0, _("Could not mount device %s\n"), device->device_name);
+           break;
         }
         free_jcr(jcr);
       }
-   } 
+   }
    UnlockRes();
    return NULL;
 }
@@ -378,13 +376,14 @@ void terminate_stored(int sig)
            continue;                 /* ignore console */
         }
         set_jcr_job_status(jcr, JS_Canceled);
-        fd = jcr->file_bsock;  
+        fd = jcr->file_bsock;
         if (fd) {
            fd->timed_out = true;
             Dmsg1(100, "term_stored killing JobId=%d\n", jcr->JobId);
            pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
-           if (jcr->device && jcr->device->dev && jcr->device->dev->dev_blocked) {
-              pthread_cond_signal(&jcr->device->dev->wait_next_vol);
+           /* ***FIXME*** wiffle through all dcrs */
+           if (jcr->dcr && jcr->dcr->dev && jcr->dcr->dev->dev_blocked) {
+              pthread_cond_signal(&jcr->dcr->dev->wait_next_vol);
            }
            bmicrosleep(0, 50000);
          }
@@ -403,7 +402,7 @@ void terminate_stored(int sig)
       if (device->dev) {
         term_dev(device->dev);
       }
-   } 
+   }
    UnlockRes();
 
    if (configfile)
index 2933237cc0e21b73f1a47052dd47f86883002032..cfd68b0e834861c74f075df13766fdf171991e83 100644 (file)
@@ -4,7 +4,7 @@
  *  Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -47,7 +47,7 @@
 #include "jcr.h"
 #include "protos.h"
 #ifdef HAVE_LIBZ
-#include <zlib.h>                     /* compression headers */
+#include <zlib.h>                    /* compression headers */
 #else
 #define uLongf uint32_t
 #endif
 #else
 #include "lib/fnmatch.h"
 #endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#define NAMELEN(dirent) (strlen((dirent)->d_name))
+#endif
+#ifndef HAVE_READDIR_R
+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
+#endif
 
 extern STORES *me;                    /* "Global" daemon resource */
-extern bool forge_on;                 /* proceed inspite of I/O errors */
+extern bool forge_on;                /* proceed inspite of I/O errors */
 
 #ifdef debug_tracing
 extern int _rewind_dev(char *file, int line, DEVICE *dev);
index 8a8de08288f6630e1a2e8c84d2f659de92921cd3..48d714b92cf5fcfbafe18a4496a33e58de9951e5 100644 (file)
@@ -165,19 +165,23 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       break;
    case R_STORAGE:
       sendit(sock, "Storage: name=%s SDaddr=%s SDport=%d SDDport=%d HB=%s\n",
-          res->res_store.hdr.name, 
-          NPRT(get_first_address(res->res_store.sdaddrs, buf, sizeof(buf))),
-          get_first_port_host_order(res->res_store.sdaddrs), 
-          get_first_port_host_order(res->res_store.sddaddrs),
-          edit_utime(res->res_store.heartbeat_interval, buf, sizeof(buf)));
-         foreach_dlist(p, res->res_store.sdaddrs) {
-                sendit(sock, "        SDaddr=%s SDport=%d\n", 
-                            p->get_address(buf, sizeof(buf)), p->get_port_host_order());
-         }
-         foreach_dlist(p, res->res_store.sddaddrs) {
-                sendit(sock, "        SDDaddr=%s SDDport=%d\n", 
-                            p->get_address(buf, sizeof(buf)), p->get_port_host_order());
-         }
+            res->res_store.hdr.name, 
+            NPRT(get_first_address(res->res_store.sdaddrs, buf, sizeof(buf))),
+            get_first_port_host_order(res->res_store.sdaddrs), 
+            get_first_port_host_order(res->res_store.sddaddrs),
+            edit_utime(res->res_store.heartbeat_interval, buf, sizeof(buf)));
+      if (res->res_store.sdaddrs) {
+        foreach_dlist(p, res->res_store.sdaddrs) {
+            sendit(sock, "        SDaddr=%s SDport=%d\n", 
+                  p->get_address(buf, sizeof(buf)), p->get_port_host_order());
+        }
+      }
+      if (res->res_store.sddaddrs) {
+        foreach_dlist(p, res->res_store.sddaddrs) {
+            sendit(sock, "        SDDaddr=%s SDDport=%d\n", 
+                  p->get_address(buf, sizeof(buf)), p->get_port_host_order());
+        }
+      }
       break;
    case R_DEVICE:
       sendit(sock, "Device: name=%s MediaType=%s Device=%s\n",
index 64dffb6b6c42717669049d52f8034344b930fc03..f19a0d41cdc62be3be0e30704f432872a227ee4e 100644 (file)
@@ -38,7 +38,7 @@ DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
 .c.o:
        $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
 #-------------------------------------------------------------------------
-all: Makefile bsmtp dbcheck testfind testls 
+all: Makefile bsmtp dbcheck fstype testfind testls 
        @echo "==== Make of tools is good ===="
        @echo " "
 
@@ -48,6 +48,9 @@ bsmtp:        bsmtp.o ../lib/libbac.a
 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
        $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) 
 
+fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
+       $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS) 
+
 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
        $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
          $(DLIB) -lfind -lbac -lm $(LIBS) 
@@ -62,7 +65,7 @@ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
 
 clean:
        @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
-       @$(RMF) testfind dbcheck testls
+       @$(RMF) testfind dbcheck testls fstype
 
 realclean: clean
        @$(RMF) tags
index 3dba7d8f5f9325bc9c6ae6f1b516a4c36aabe0c0..b6a74617f67b60852866c03194362d3cc0e6b89b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *
  *  Program to check a Bacula database for consistency and to
- *   make repairs 
+ *   make repairs
  *
  *   Kern E. Sibbald, August 2002
  *
@@ -129,7 +129,7 @@ int main (int argc, char *argv[])
       case 'd':                    /* debug level */
         debug_level = atoi(optarg);
         if (debug_level <= 0)
-           debug_level = 1; 
+           debug_level = 1;
         break;
 
       case 'f':                    /* fix inconsistencies */
@@ -143,7 +143,7 @@ int main (int argc, char *argv[])
       case '?':
       default:
         usage();
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -152,12 +152,12 @@ int main (int argc, char *argv[])
       CAT *catalog = NULL;
       int found = 0;
       if (argc > 0) {
-         Pmsg0(0, _("Warning skipping the additional parameters for working directory/dbname/user/password/host.\n"));
+        Pmsg0(0, _("Warning skipping the additional parameters for working directory/dbname/user/password/host.\n"));
       }
       parse_config(configfile);
       LockRes();
       foreach_res(catalog, R_CATALOG) {
-        if (catalogname && !strcmp(catalog->hdr.name, catalogname)) { 
+        if (catalogname && !strcmp(catalog->hdr.name, catalogname)) {
            ++found;
            break;
         } else if (!catalogname) { // stop on first if no catalogname is given
@@ -168,9 +168,9 @@ int main (int argc, char *argv[])
       UnlockRes();
       if (!found) {
         if (catalogname) {
-            Pmsg2(0, "Error can not find the Catalog name[%s] in the given config file [%s]\n", catalogname, configfile);
+           Pmsg2(0, "Error can not find the Catalog name[%s] in the given config file [%s]\n", catalogname, configfile);
         } else {
-            Pmsg1(0, "Error there is no Catalog section in the given config file [%s]\n", configfile);
+           Pmsg1(0, "Error there is no Catalog section in the given config file [%s]\n", configfile);
         }
         exit(1);
       } else {
@@ -179,7 +179,7 @@ int main (int argc, char *argv[])
         director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
         UnlockRes();
         if (!director) {
-            Pmsg0(0, "Error no Director resource defined.\n");
+           Pmsg0(0, "Error no Director resource defined.\n");
            exit(1);
         }
         set_working_directory(director->working_directory);
@@ -193,12 +193,12 @@ int main (int argc, char *argv[])
       }
    } else {
       if (argc > 5) {
-         Pmsg0(0, _("Wrong number of arguments.\n"));
+        Pmsg0(0, _("Wrong number of arguments.\n"));
         usage();
       }
 
       if (argc < 1) {
-         Pmsg0(0, _("Working directory not supplied.\n"));
+        Pmsg0(0, _("Working directory not supplied.\n"));
         usage();
       }
 
@@ -263,50 +263,50 @@ static void do_interactive_mode()
    bool quit = false;
    const char *cmd;
 
-   printf("Hello, this is the database check/correct program.\n\
-Modify database is %s. Verbose is %s.\n\
-Please select the fuction you want to perform.\n",
-          fix?"On":"Off", verbose?"On":"Off");
+   printf("Hello, this is the database check/correct program.\n"
+"Modify database is %s. Verbose is %s.\n"
+"Please select the fuction you want to perform.\n",
+         fix?"On":"Off", verbose?"On":"Off");
 
    while (!quit) {
       if (fix) {
-         printf(_("\n\
-     1) Toggle modify database flag\n\
-     2) Toggle verbose flag\n\
-     3) Repair bad Filename records\n\
-     4) Repair bad Path records\n\
-     5) Eliminate duplicate Filename records\n\
-     6) Eliminate duplicate Path records\n\
-     7) Eliminate orphaned Jobmedia records\n\
-     8) Eliminate orphaned File records\n\
-     9) Eliminate orphaned Path records\n\
-    10) Eliminate orphaned Filename records\n\
-    11) Eliminate orphaned FileSet records\n\
-    12) Eliminate orphaned Client records\n\
-    13) Eliminate orphaned Job records\n\
-    14) Eliminate all Admin records\n\
-    15) Eliminate all Restore records\n\
-    16) All (3-15)\n\
-    17) Quit\n"));
+        printf(_("\n"
+"     1) Toggle modify database flag\n"
+"     2) Toggle verbose flag\n"
+"     3) Repair bad Filename records\n"
+"     4) Repair bad Path records\n"
+"     5) Eliminate duplicate Filename records\n"
+"     6) Eliminate duplicate Path records\n"
+"     7) Eliminate orphaned Jobmedia records\n"
+"     8) Eliminate orphaned File records\n"
+"     9) Eliminate orphaned Path records\n"
+"    10) Eliminate orphaned Filename records\n"
+"    11) Eliminate orphaned FileSet records\n"
+"    12) Eliminate orphaned Client records\n"
+"    13) Eliminate orphaned Job records\n"
+"    14) Eliminate all Admin records\n"
+"    15) Eliminate all Restore records\n"
+"    16) All (3-15)\n"
+"    17) Quit\n"));
        } else {
-         printf(_("\n\
-     1) Toggle modify database flag\n\
-     2) Toggle verbose flag\n\
-     3) Check for bad Filename records\n\
-     4) Check for bad Path records\n\
-     5) Check for duplicate Filename records\n\
-     6) Check for duplicate Path records\n\
-     7) Check for orphaned Jobmedia records\n\
-     8) Check for orphaned File records\n\
-     9) Check for orphaned Path records\n\
-    10) Check for orphaned Filename records\n\
-    11) Check for orphaned FileSet records\n\
-    12) Check for orphaned Client records\n\
-    13) Check for orphaned Job records\n\
-    14) Check for all Admin records\n\
-    15) Check for all Restore records\n\
-    16) All (3-15)\n\
-    17) Quit\n"));
+        printf(_("\n"
+"     1) Toggle modify database flag\n"
+"     2) Toggle verbose flag\n"
+"     3) Check for bad Filename records\n"
+"     4) Check for bad Path records\n"
+"     5) Check for duplicate Filename records\n"
+"     6) Check for duplicate Path records\n"
+"     7) Check for orphaned Jobmedia records\n"
+"     8) Check for orphaned File records\n"
+"     9) Check for orphaned Path records\n"
+"    10) Check for orphaned Filename records\n"
+"    11) Check for orphaned FileSet records\n"
+"    12) Check for orphaned Client records\n"
+"    13) Check for orphaned Job records\n"
+"    14) Check for all Admin records\n"
+"    15) Check for all Restore records\n"
+"    16) All (3-15)\n"
+"    17) Quit\n"));
        }
 
       cmd = get_cmd(_("Select function number: "));
@@ -315,11 +315,11 @@ Please select the fuction you want to perform.\n",
         switch (item) {
         case 1:
            fix = !fix;
-            printf(_("Database will %sbe modified.\n"), fix?"":_("NOT "));
+           printf(_("Database will %sbe modified.\n"), fix?"":_("NOT "));
            break;
         case 2:
            verbose = verbose?0:1;
-            printf(_("Verbose is %s\n"), verbose?_("On"):_("Off"));
+           printf(_("Verbose is %s\n"), verbose?_("On"):_("Off"));
            break;
         case 3:
            repair_bad_filenames();
@@ -402,7 +402,7 @@ static int get_name_handler(void *ctx, int num_fields, char **row)
 
 static int print_job_handler(void *ctx, int num_fields, char **row)
 {
-   printf(_("JobId=%s Name=\"%s\" StartTime=%s\n"), 
+   printf(_("JobId=%s Name=\"%s\" StartTime=%s\n"),
              NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
    return 0;
 }
@@ -410,33 +410,33 @@ static int print_job_handler(void *ctx, int num_fields, char **row)
 
 static int print_jobmedia_handler(void *ctx, int num_fields, char **row)
 {
-   printf(_("Orphaned JobMediaId=%s JobId=%s Volume=\"%s\"\n"), 
+   printf(_("Orphaned JobMediaId=%s JobId=%s Volume=\"%s\"\n"),
              NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
    return 0;
 }
 
 static int print_file_handler(void *ctx, int num_fields, char **row)
 {
-   printf(_("Orphaned FileId=%s JobId=%s Volume=\"%s\"\n"), 
+   printf(_("Orphaned FileId=%s JobId=%s Volume=\"%s\"\n"),
              NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
    return 0;
 }
 
 static int print_fileset_handler(void *ctx, int num_fields, char **row)
 {
-   printf(_("Orphaned FileSetId=%s FileSet=\"%s\" MD5=%s\n"), 
+   printf(_("Orphaned FileSetId=%s FileSet=\"%s\" MD5=%s\n"),
              NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
    return 0;
 }
 
 static int print_client_handler(void *ctx, int num_fields, char **row)
 {
-   printf(_("Orphaned ClientId=%s Name=\"%s\"\n"), 
+   printf(_("Orphaned ClientId=%s Name=\"%s\"\n"),
              NPRT(row[0]), NPRT(row[1]));
    return 0;
 }
 
-  
+
 /*
  * Called here with each id to be added to the list
  */
@@ -444,7 +444,7 @@ static int id_list_handler(void *ctx, int num_fields, char **row)
 {
    ID_LIST *lst = (ID_LIST *)ctx;
 
-   if (lst->num_ids == MAX_ID_LIST_LEN) {  
+   if (lst->num_ids == MAX_ID_LIST_LEN) {
       return 1;
    }
    if (lst->num_ids == lst->max_ids) {
@@ -477,14 +477,14 @@ static int make_id_list(const char *query, ID_LIST *id_list)
 }
 
 /*
- * Delete all entries in the list 
+ * Delete all entries in the list
  */
 static int delete_id_list(const char *query, ID_LIST *id_list)
-{ 
+{
    for (int i=0; i < id_list->num_ids; i++) {
       bsnprintf(buf, sizeof(buf), query, id_list->Id[i]);
       if (verbose) {
-         printf("Deleting: %s\n", buf);
+        printf("Deleting: %s\n", buf);
       }
       db_sql_query(db, buf, NULL, NULL);
    }
@@ -498,7 +498,7 @@ static int name_list_handler(void *ctx, int num_fields, char **row)
 {
    NAME_LIST *name = (NAME_LIST *)ctx;
 
-   if (name->num_ids == MAX_ID_LIST_LEN) {  
+   if (name->num_ids == MAX_ID_LIST_LEN) {
       return 1;
    }
    if (name->num_ids == name->max_ids) {
@@ -535,7 +535,7 @@ static int make_name_list(const char *query, NAME_LIST *name_list)
  * Print names in the list
  */
 static void print_name_list(NAME_LIST *name_list)
-{ 
+{
    for (int i=0; i < name_list->num_ids; i++) {
       printf("%s\n", name_list->name[i]);
    }
@@ -546,7 +546,7 @@ static void print_name_list(NAME_LIST *name_list)
  * Free names in the list
  */
 static void free_name_list(NAME_LIST *name_list)
-{ 
+{
    for (int i=0; i < name_list->num_ids; i++) {
       free(name_list->name[i]);
    }
@@ -559,10 +559,10 @@ static void eliminate_duplicate_filenames()
    char esc_name[5000];
 
    printf("Checking for duplicate Filename entries.\n");
-   
+
    /* Make list of duplicated names */
    query = "SELECT Name, count(Name) as Count FROM Filename GROUP BY  Name "
-           "HAVING count(Name) > 1";
+          "HAVING count(Name) > 1";
 
    if (!make_name_list(query, &name_list)) {
       exit(1);
@@ -576,28 +576,28 @@ static void eliminate_duplicate_filenames()
       for (int i=0; i<name_list.num_ids; i++) {
         /* Get all the Ids of each name */
         db_escape_string(esc_name, name_list.name[i], strlen(name_list.name[i]));
-         bsnprintf(buf, sizeof(buf), "SELECT FilenameId FROM Filename WHERE Name='%s'", esc_name);
+        bsnprintf(buf, sizeof(buf), "SELECT FilenameId FROM Filename WHERE Name='%s'", esc_name);
         if (verbose > 1) {
-            printf("%s\n", buf);
+           printf("%s\n", buf);
         }
         if (!make_id_list(buf, &id_list)) {
            exit(1);
         }
         if (verbose) {
-            printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
+           printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
         }
         /* Force all records to use the first id then delete the other ids */
         for (int j=1; j<id_list.num_ids; j++) {
-            bsnprintf(buf, sizeof(buf), "UPDATE File SET FilenameId=%u WHERE FilenameId=%u", 
+           bsnprintf(buf, sizeof(buf), "UPDATE File SET FilenameId=%u WHERE FilenameId=%u",
               id_list.Id[0], id_list.Id[j]);
            if (verbose > 1) {
-               printf("%s\n", buf);
+              printf("%s\n", buf);
            }
            db_sql_query(db, buf, NULL, NULL);
-            bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%u", 
+           bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%u",
               id_list.Id[j]);
            if (verbose > 2) {
-               printf("%s\n", buf);
+              printf("%s\n", buf);
            }
            db_sql_query(db, buf, NULL, NULL);
         }
@@ -612,11 +612,11 @@ static void eliminate_duplicate_paths()
    char esc_name[5000];
 
    printf(_("Checking for duplicate Path entries.\n"));
-   
+
    /* Make list of duplicated names */
 
    query = "SELECT Path, count(Path) as Count FROM Path "
-           "GROUP BY Path HAVING count(Path) > 1";
+          "GROUP BY Path HAVING count(Path) > 1";
 
    if (!make_name_list(query, &name_list)) {
       exit(1);
@@ -630,28 +630,28 @@ static void eliminate_duplicate_paths()
       for (int i=0; i<name_list.num_ids; i++) {
         /* Get all the Ids of each name */
         db_escape_string(esc_name, name_list.name[i], strlen(name_list.name[i]));
-         bsnprintf(buf, sizeof(buf), "SELECT PathId FROM Path WHERE Path='%s'", esc_name);
+        bsnprintf(buf, sizeof(buf), "SELECT PathId FROM Path WHERE Path='%s'", esc_name);
         if (verbose > 1) {
-            printf("%s\n", buf);
+           printf("%s\n", buf);
         }
         if (!make_id_list(buf, &id_list)) {
            exit(1);
         }
         if (verbose) {
-            printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
+           printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
         }
         /* Force all records to use the first id then delete the other ids */
         for (int j=1; j<id_list.num_ids; j++) {
-            bsnprintf(buf, sizeof(buf), "UPDATE File SET PathId=%u WHERE PathId=%u", 
+           bsnprintf(buf, sizeof(buf), "UPDATE File SET PathId=%u WHERE PathId=%u",
               id_list.Id[0], id_list.Id[j]);
            if (verbose > 1) {
-               printf("%s\n", buf);
+              printf("%s\n", buf);
            }
            db_sql_query(db, buf, NULL, NULL);
-            bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%u", 
+           bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%u",
               id_list.Id[j]);
            if (verbose > 2) {
-               printf("%s\n", buf);
+              printf("%s\n", buf);
            }
            db_sql_query(db, buf, NULL, NULL);
         }
@@ -666,23 +666,23 @@ static void eliminate_orphaned_jobmedia_records()
 
    printf("Checking for orphaned JobMedia entries.\n");
    query = "SELECT JobMedia.JobMediaId,Job.JobId FROM JobMedia "
-           "LEFT OUTER JOIN Job ON (JobMedia.JobId=Job.JobId) "
-           "WHERE Job.JobId IS NULL";
+          "LEFT OUTER JOIN Job ON (JobMedia.JobId=Job.JobId) "
+          "WHERE Job.JobId IS NULL";
    if (!make_id_list(query, &id_list)) {
       exit(1);
    }
    printf("Found %d orphaned JobMedia records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-        bsnprintf(buf, sizeof(buf),  
+        bsnprintf(buf, sizeof(buf),
 "SELECT JobMedia.JobMediaId,JobMedia.JobId,Media.VolumeName FROM JobMedia,Media "
 "WHERE JobMedia.JobMediaId=%u AND Media.MediaId=JobMedia.MediaId", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_jobmedia_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned JobMedia records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM JobMedia WHERE JobMediaId=%u", &id_list);
@@ -695,8 +695,8 @@ static void eliminate_orphaned_file_records()
 
    printf("Checking for orphaned File entries. This may take some time!\n");
    query = "SELECT File.FileId,Job.JobId FROM File "
-           "LEFT OUTER JOIN Job ON (File.JobId=Job.JobId) "
-           "WHERE Job.JobId IS NULL";
+          "LEFT OUTER JOIN Job ON (File.JobId=Job.JobId) "
+          "WHERE Job.JobId IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -710,11 +710,11 @@ static void eliminate_orphaned_file_records()
 "SELECT File.FileId,File.JobId,Filename.Name FROM File,Filename "
 "WHERE File.FileId=%u AND File.FilenameId=Filename.FilenameId", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_file_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-      
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned File records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM File WHERE FileId=%u", &id_list);
@@ -727,8 +727,8 @@ static void eliminate_orphaned_path_records()
 
    printf("Checking for orphaned Path entries. This may take some time!\n");
    query = "SELECT DISTINCT Path.PathId,File.PathId FROM Path "
-           "LEFT OUTER JOIN File ON (Path.PathId=File.PathId) "
-           "WHERE File.PathId IS NULL";
+          "LEFT OUTER JOIN File ON (Path.PathId=File.PathId) "
+          "WHERE File.PathId IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -738,11 +738,11 @@ static void eliminate_orphaned_path_records()
    printf("Found %d orphaned Path records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
         db_sql_query(db, buf, print_name_handler, NULL);
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned Path records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Path WHERE PathId=%u", &id_list);
@@ -755,8 +755,8 @@ static void eliminate_orphaned_filename_records()
 
    printf("Checking for orphaned Filename entries. This may take some time!\n");
    query = "SELECT Filename.FilenameId,File.FilenameId FROM Filename "
-           "LEFT OUTER JOIN File ON (Filename.FilenameId=File.FilenameId) "
-           "WHERE File.FilenameId IS NULL";
+          "LEFT OUTER JOIN File ON (Filename.FilenameId=File.FilenameId) "
+          "WHERE File.FilenameId IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -766,11 +766,11 @@ static void eliminate_orphaned_filename_records()
    printf("Found %d orphaned Filename records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
         db_sql_query(db, buf, print_name_handler, NULL);
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned Filename records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Filename WHERE FilenameId=%u", &id_list);
@@ -783,8 +783,8 @@ static void eliminate_orphaned_fileset_records()
 
    printf("Checking for orphaned FileSet entries. This takes some time!\n");
    query = "SELECT FileSet.FileSetId,Job.FileSetId FROM FileSet "
-           "LEFT OUTER JOIN Job ON (FileSet.FileSetId=Job.FileSetId) "
-           "WHERE Job.FileSetId IS NULL";
+          "LEFT OUTER JOIN Job ON (FileSet.FileSetId=Job.FileSetId) "
+          "WHERE Job.FileSetId IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -794,14 +794,14 @@ static void eliminate_orphaned_fileset_records()
    printf("Found %d orphaned FileSet records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT FileSetId,FileSet,MD5 FROM FileSet "
-                      "WHERE FileSetId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT FileSetId,FileSet,MD5 FROM FileSet "
+                     "WHERE FileSetId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_fileset_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned FileSet records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM FileSet WHERE FileSetId=%u", &id_list);
@@ -821,8 +821,8 @@ static void eliminate_orphaned_client_records()
     *  i.e. Job.Client is NULL
     */
    query = "SELECT Client.ClientId,Client.Name FROM Client "
-           "LEFT OUTER JOIN Job ON (Client.ClientId=Job.ClientId) "
-           "WHERE Job.ClientId IS NULL";
+          "LEFT OUTER JOIN Job ON (Client.ClientId=Job.ClientId) "
+          "WHERE Job.ClientId IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -832,14 +832,14 @@ static void eliminate_orphaned_client_records()
    printf("Found %d orphaned Client records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT ClientId,Name FROM Client "
-                      "WHERE ClientId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT ClientId,Name FROM Client "
+                     "WHERE ClientId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_client_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned Client records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Client WHERE ClientId=%u", &id_list);
@@ -859,8 +859,8 @@ static void eliminate_orphaned_job_records()
     *  i.e. Client.Name is NULL
     */
    query = "SELECT Job.JobId,Job.Name FROM Job "
-           "LEFT OUTER JOIN Client ON (Job.ClientId=Client.ClientId) "
-           "WHERE Client.Name IS NULL";
+          "LEFT OUTER JOIN Client ON (Job.ClientId=Client.ClientId) "
+          "WHERE Client.Name IS NULL";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -870,14 +870,14 @@ static void eliminate_orphaned_job_records()
    printf("Found %d orphaned Job records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
-                      "WHERE JobId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+                     "WHERE JobId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_job_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d orphaned Job records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
@@ -891,7 +891,7 @@ static void eliminate_admin_records()
 
    printf("Checking for Admin Job entries.\n");
    query = "SELECT Job.JobId FROM Job "
-           "WHERE Job.Type='D'";
+          "WHERE Job.Type='D'";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -901,14 +901,14 @@ static void eliminate_admin_records()
    printf("Found %d Admin Job records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
-                      "WHERE JobId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+                     "WHERE JobId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_job_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d Admin Job records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
@@ -921,7 +921,7 @@ static void eliminate_restore_records()
 
    printf("Checking for Restore Job entries.\n");
    query = "SELECT Job.JobId FROM Job "
-           "WHERE Job.Type='R'";
+          "WHERE Job.Type='R'";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -931,14 +931,14 @@ static void eliminate_restore_records()
    printf("Found %d Restore Job records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (int i=0; i < id_list.num_ids; i++) {
-         bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
-                      "WHERE JobId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+                     "WHERE JobId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_job_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-   
+
    if (fix && id_list.num_ids > 0) {
       printf("Deleting %d Restore Job records.\n", id_list.num_ids);
       delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
@@ -955,7 +955,7 @@ static void repair_bad_filenames()
 
    printf("Checking for Filenames with a trailing slash\n");
    query = "SELECT FilenameId,Name from Filename "
-           "WHERE Name LIKE '%/'";
+          "WHERE Name LIKE '%/'";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -965,41 +965,41 @@ static void repair_bad_filenames()
    printf("Found %d bad Filename records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (i=0; i < id_list.num_ids; i++) {
-        bsnprintf(buf, sizeof(buf), 
-            "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf),
+           "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_name_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-      
+
    if (fix && id_list.num_ids > 0) {
       POOLMEM *name = get_pool_memory(PM_FNAME);
       char esc_name[5000];
       printf("Reparing %d bad Filename records.\n", id_list.num_ids);
       for (i=0; i < id_list.num_ids; i++) {
         int len;
-        bsnprintf(buf, sizeof(buf), 
-            "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf),
+           "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, get_name_handler, name)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
         /* Strip trailing slash(es) */
-         for (len=strlen(name); len > 0 && name[len-1]=='/'; len--)
+        for (len=strlen(name); len > 0 && name[len-1]=='/'; len--)
            {  }
         if (len == 0) {
            len = 1;
-            esc_name[0] = ' ';
+           esc_name[0] = ' ';
            esc_name[1] = 0;
         } else {
            name[len-1] = 0;
            db_escape_string(esc_name, name, len);
         }
-        bsnprintf(buf, sizeof(buf), 
-            "UPDATE Filename SET Name='%s' WHERE FilenameId=%u", 
+        bsnprintf(buf, sizeof(buf),
+           "UPDATE Filename SET Name='%s' WHERE FilenameId=%u",
            esc_name, id_list.Id[i]);
         if (verbose > 1) {
-            printf("%s\n", buf);
+           printf("%s\n", buf);
         }
         db_sql_query(db, buf, NULL, NULL);
       }
@@ -1013,7 +1013,7 @@ static void repair_bad_paths()
 
    printf("Checking for Paths without a trailing slash\n");
    query = "SELECT PathId,Path from Path "
-           "WHERE Path NOT LIKE '%/'";
+          "WHERE Path NOT LIKE '%/'";
    if (verbose > 1) {
       printf("%s\n", query);
    }
@@ -1023,36 +1023,36 @@ static void repair_bad_paths()
    printf("Found %d bad Path records.\n", id_list.num_ids);
    if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
       for (i=0; i < id_list.num_ids; i++) {
-        bsnprintf(buf, sizeof(buf), 
-            "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf),
+           "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, print_name_handler, NULL)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
       }
    }
-      
+
    if (fix && id_list.num_ids > 0) {
       POOLMEM *name = get_pool_memory(PM_FNAME);
       char esc_name[5000];
       printf("Reparing %d bad Filename records.\n", id_list.num_ids);
       for (i=0; i < id_list.num_ids; i++) {
         int len;
-        bsnprintf(buf, sizeof(buf), 
-            "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+        bsnprintf(buf, sizeof(buf),
+           "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
         if (!db_sql_query(db, buf, get_name_handler, name)) {
-            printf("%s\n", db_strerror(db));
+           printf("%s\n", db_strerror(db));
         }
         /* Strip trailing blanks */
-         for (len=strlen(name); len > 0 && name[len-1]==' '; len--) {
+        for (len=strlen(name); len > 0 && name[len-1]==' '; len--) {
            name[len-1] = 0;
         }
         /* Add trailing slash */
-         len = pm_strcat(&name, "/");
+        len = pm_strcat(&name, "/");
         db_escape_string(esc_name, name, len);
-         bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%u", 
+        bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%u",
            esc_name, id_list.Id[i]);
         if (verbose > 1) {
-            printf("%s\n", buf);
+           printf("%s\n", buf);
         }
         db_sql_query(db, buf, NULL, NULL);
       }
@@ -1079,7 +1079,7 @@ static char *get_cmd(const char *prompt)
 
 static int yes_no(const char *prompt)
 {
-   char *cmd;  
+   char *cmd;
    cmd = get_cmd(prompt);
    return strcasecmp(cmd, "yes") == 0;
 }
diff --git a/bacula/src/tools/fstype.c b/bacula/src/tools/fstype.c
new file mode 100644 (file)
index 0000000..4003d62
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Program for determining file system type
+ *
+ *   Written by Preben 'Peppe' Guldberg, December MMIV
+ *
+ *   Version $Id$
+ *
+ */
+
+/*
+   Copyright (C) 2004 Kern Sibbald
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.
+
+ */
+
+#include "bacula.h"
+#include "findlib/find.h"
+
+static void usage()
+{
+   fprintf(stderr, _(
+"\n"
+"Usage: fstype [-d debug_level] path ...\n"
+"\n"
+"       Print the file system type a given file/directory is on.\n"
+"       The following options are supported:\n"
+"\n"
+"       -v     print both path and file system type.\n"
+"       -?     print this message.\n"
+"\n"));
+
+   exit(1);
+}
+
+
+int
+main (int argc, char *const *argv)
+{
+   char fs[1000];
+   int verbose = 0;
+   int status = 0;
+   int ch, i;
+
+   while ((ch = getopt(argc, argv, "v?")) != -1) {
+      switch (ch) {
+         case 'v':
+           verbose = 1;
+           break;
+         case '?':
+        default:
+           usage();
+
+      }
+   }
+   argc -= optind;
+   argv += optind;
+
+   if (argc < 1) {
+      usage();
+   }
+
+   for (i = 0; i < argc; --argc, ++argv) {
+      if (fstype(*argv, fs, sizeof(fs))) {
+        if (verbose) {
+            printf("%s: %s\n", *argv, fs);
+        } else {
+           puts(fs);
+        }
+      } else {
+         fprintf(stderr, "%s: unknown\n", *argv);
+        status = 1;
+      }
+   }
+
+   exit(status);
+}
index 61e64a271780ab1a24c60f92bde3fdaa581a1f9e..e72fb045ab2a3dd64493fb63612dc5e7acb33dde 100644 (file)
@@ -1,4 +1,4 @@
-/*  
+/*
  * Test program for find files
  */
 
@@ -82,30 +82,30 @@ main (int argc, char *const *argv)
 
    while ((ch = getopt(argc, argv, "ad:e:i:?")) != -1) {
       switch (ch) {
-         case 'a':                    /* print extended attributes *debug* */
+        case 'a':                    /* print extended attributes *debug* */
            attrs = 1;
            break;
 
-         case 'd':                    /* set debug level */
+        case 'd':                    /* set debug level */
            debug_level = atoi(optarg);
            if (debug_level <= 0) {
-              debug_level = 1; 
+              debug_level = 1;
            }
            break;
 
-         case 'e':                    /* exclude patterns */
+        case 'e':                    /* exclude patterns */
            exc = optarg;
            break;
 
-         case 'i':                    /* include patterns */
+        case 'i':                    /* include patterns */
            inc = optarg;
            break;
 
-         case '?':
+        case '?':
         default:
            usage();
 
-      }  
+      }
    }
    argc -= optind;
    argv += optind;
@@ -115,22 +115,22 @@ main (int argc, char *const *argv)
    ff = init_find_files();
    if (argc == 0 && !inc) {
       add_fname_to_include_list(ff, 0, "/"); /* default to / */
-   } else {   
+   } else {
       for (i=0; i < argc; i++) {
-         if (strcmp(argv[i], "-") == 0) {
+        if (strcmp(argv[i], "-") == 0) {
             while (fgets(name, sizeof(name)-1, stdin)) {
                strip_trailing_junk(name);
-               add_fname_to_include_list(ff, 0, name); 
+               add_fname_to_include_list(ff, 0, name);
              }
              continue;
         }
-        add_fname_to_include_list(ff, 0, argv[i]); 
+        add_fname_to_include_list(ff, 0, argv[i]);
       }
    }
    if (inc) {
       fd = fopen(inc, "r");
       if (!fd) {
-         printf("Could not open include file: %s\n", inc);
+        printf("Could not open include file: %s\n", inc);
         exit(1);
       }
       while (fgets(name, sizeof(name)-1, fd)) {
@@ -143,7 +143,7 @@ main (int argc, char *const *argv)
    if (exc) {
       fd = fopen(exc, "r");
       if (!fd) {
-         printf("Could not open exclude file: %s\n", exc);
+        printf("Could not open exclude file: %s\n", exc);
         exit(1);
       }
       while (fgets(name, sizeof(name)-1, fd)) {
@@ -154,17 +154,17 @@ main (int argc, char *const *argv)
    }
    find_files(jcr, ff, print_file, NULL);
    hard_links = term_find_files(ff);
-  
-   printf(_("\
-Total files    : %d\n\
-Max file length: %d\n\
-Max path length: %d\n\
-Files truncated: %d\n\
-Paths truncated: %d\n\
-Hard links     : %d\n"),
+
+   printf(_(""
+"Total files    : %d\n"
+"Max file length: %d\n"
+"Max path length: %d\n"
+"Files truncated: %d\n"
+"Paths truncated: %d\n"
+"Hard links     : %d\n"),
      num_files, max_file_len, max_path_len,
      trunc_fname, trunc_path, hard_links);
-  
+
   free_jcr(jcr);
   close_memory_pool();
   sm_dump(false);
@@ -177,50 +177,60 @@ static int print_file(FF_PKT *ff, void *pkt)
    switch (ff->type) {
    case FT_LNKSAVED:
       if (debug_level == 1) {
-         printf("%s\n", ff->fname);
+        printf("%s\n", ff->fname);
       } else if (debug_level > 1) {
-         printf("Lnka: %s -> %s\n", ff->fname, ff->link);
+        printf("Lnka: %s -> %s\n", ff->fname, ff->link);
       }
       break;
    case FT_REGE:
       if (debug_level == 1) {
-         printf("%s\n", ff->fname);
+        printf("%s\n", ff->fname);
       } else if (debug_level > 1) {
-         printf("Empty: %s\n", ff->fname);
+        printf("Empty: %s\n", ff->fname);
       }
       count_files(ff);
-      break; 
+      break;
    case FT_REG:
       if (debug_level == 1) {
-         printf("%s\n", ff->fname);
+        printf("%s\n", ff->fname);
       } else if (debug_level > 1) {
-         printf("Reg: %s\n", ff->fname);
+        printf("Reg: %s\n", ff->fname);
       }
       count_files(ff);
       break;
    case FT_LNK:
       if (debug_level == 1) {
-         printf("%s\n", ff->fname);
+        printf("%s\n", ff->fname);
       } else if (debug_level > 1) {
-         printf("Lnk: %s -> %s\n", ff->fname, ff->link);
+        printf("Lnk: %s -> %s\n", ff->fname, ff->link);
       }
       count_files(ff);
       break;
    case FT_DIRBEGIN:
       return 1;
+   case FT_NORECURSE:
+   case FT_NOFSCHG:
+   case FT_INVALIDFS:
    case FT_DIREND:
-      if (debug_level == 1) {
-         printf("%s\n", ff->fname);
-      } else if (debug_level > 1) {
-         printf("Dir: %s\n", ff->fname);
+      if (debug_level) {
+        char errmsg[100] = "";
+        if (ff->type == FT_NORECURSE) {
+           bstrncpy(errmsg, "\t[will not descend: recursion turned off]", sizeof(errmsg));
+        } else if (ff->type == FT_NOFSCHG) {
+           bstrncpy(errmsg, "\t[will not descend: file system change not allowed]", sizeof(errmsg));
+        } else if (ff->type == FT_INVALIDFS) {
+           bstrncpy(errmsg, "\t[will not descend: disallowed file system]", sizeof(errmsg));
+        }
+        printf("%s%s%s\n", (debug_level > 1 ? "Dir: " : ""), ff->fname, errmsg);
       }
+      ff->type = FT_DIREND;
       count_files(ff);
       break;
    case FT_SPEC:
       if (debug_level == 1) {
-         printf("%s\n", ff->fname);
+        printf("%s\n", ff->fname);
       } else if (debug_level > 1) {
-         printf("Spec: %s\n", ff->fname);
+        printf("Spec: %s\n", ff->fname);
       }
       count_files(ff);
       break;
@@ -239,12 +249,6 @@ static int print_file(FF_PKT *ff, void *pkt)
    case FT_ISARCH:
       printf(_("Err: Attempt to backup archive. Not saved. %s\n"), ff->fname);
       break;
-   case FT_NORECURSE:
-      printf(_("Recursion turned off. Directory not entered. %s\n"), ff->fname);
-      break;
-   case FT_NOFSCHG:
-      printf(_("Skip: File system change prohibited. Directory not entered. %s\n"), ff->fname);
-      break;
    case FT_NOOPEN:
       printf(_("Err: Could not open directory %s: %s\n"), ff->fname, strerror(errno));
       break;
@@ -256,14 +260,14 @@ static int print_file(FF_PKT *ff, void *pkt)
       char attr[200];
       encode_attribsEx(NULL, attr, ff);
       if (*attr != 0) {
-         printf("AttrEx=%s\n", attr);
+        printf("AttrEx=%s\n", attr);
       }
 //    set_attribsEx(NULL, ff->fname, NULL, NULL, ff->type, attr);
    }
    return 1;
 }
 
-static void count_files(FF_PKT *ar) 
+static void count_files(FF_PKT *ar)
 {
    int fnl, pnl;
    char *l, *p;
@@ -272,7 +276,7 @@ static void count_files(FF_PKT *ar)
 
    num_files++;
 
-   /* Find path without the filename.  
+   /* Find path without the filename.
     * I.e. everything after the last / is a "filename".
     * OK, maybe it is a directory name, but we treat it like
     * a filename. If we don't find a / then the whole name
@@ -290,7 +294,7 @@ static void count_files(FF_PKT *ar)
    }
 
    /* If filename doesn't exist (i.e. root directory), we
-    * simply create a blank name consisting of a single 
+    * simply create a blank name consisting of a single
     * space. This makes handling zero length filenames
     * easier.
     */
@@ -311,7 +315,7 @@ static void count_files(FF_PKT *ar)
       file[1] = 0;
    }
 
-   pnl = l - ar->fname;    
+   pnl = l - ar->fname;
    if (pnl > max_path_len) {
       max_path_len = pnl;
    }
index 44f5a6f82a92ddbdc5b6391976df232b272e73b7..3d4b11af7090151a8f1c170f17727e4f6f83a413 100644 (file)
@@ -25,7 +25,7 @@
 
    You should have received a copy of the GNU General Public
    License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
    MA 02111-1307, USA.
  */
 
@@ -34,7 +34,7 @@
 #include "jcr.h"
 
 void senditf(const char *fmt, ...);
-void sendit(const char *buf); 
+void sendit(const char *buf);
 
 /* Commands sent to Director */
 static char DIRhello[]    = "Hello %s calling\n";
@@ -66,16 +66,16 @@ int authenticate_director(JCR *jcr, MONITOR *mon, DIRRES *director)
    bstrncpy(bashed_name, mon->hdr.name, sizeof(bashed_name));
    bash_spaces(bashed_name);
    password = mon->password;
-   
+
    /* Timeout Hello after 5 mins */
    btimer_t *tid = start_bsock_timer(dir, 60 * 5);
    bnet_fsend(dir, DIRhello, bashed_name);
 
-   if (!cram_md5_get_auth(dir, password, ssl_need) || 
+   if (!cram_md5_get_auth(dir, password, ssl_need) ||
        !cram_md5_auth(dir, password, ssl_need)) {
       stop_bsock_timer(tid);
       Jmsg0(jcr, M_FATAL, 0, _("Director authorization problem.\n"
-            "Most likely the passwords do not agree.\n"     
+           "Most likely the passwords do not agree.\n"
        "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       return 0;
    }
@@ -107,7 +107,7 @@ int authenticate_storage_daemon(JCR *jcr, MONITOR *monitor, STORE* store)
    char dirname[MAX_NAME_LENGTH];
    int ssl_need = BNET_SSL_NONE;
 
-   /* 
+   /*
     * Send my name to the Storage daemon then do authentication
     */
    bstrncpy(dirname, monitor->hdr.name, sizeof(dirname));
@@ -119,10 +119,10 @@ int authenticate_storage_daemon(JCR *jcr, MONITOR *monitor, STORE* store)
       Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to Storage daemon. ERR=%s\n"), bnet_strerror(sd));
       return 0;
    }
-   if (!cram_md5_get_auth(sd, store->password, ssl_need) || 
+   if (!cram_md5_get_auth(sd, store->password, ssl_need) ||
        !cram_md5_auth(sd, store->password, ssl_need)) {
       stop_bsock_timer(tid);
-      Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords or names not the same.\n"   
+      Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords or names not the same.\n"
        "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       return 0;
    }
@@ -151,7 +151,7 @@ int authenticate_file_daemon(JCR *jcr, MONITOR *monitor, CLIENT* client)
    char dirname[MAX_NAME_LENGTH];
    int ssl_need = BNET_SSL_NONE;
 
-   /* 
+   /*
     * Send my name to the File daemon then do authentication
     */
    bstrncpy(dirname, monitor->hdr.name, sizeof(dirname));
@@ -163,10 +163,10 @@ int authenticate_file_daemon(JCR *jcr, MONITOR *monitor, CLIENT* client)
       Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), bnet_strerror(fd));
       return 0;
    }
-   if (!cram_md5_get_auth(fd, client->password, ssl_need) || 
+   if (!cram_md5_get_auth(fd, client->password, ssl_need) ||
        !cram_md5_auth(fd, client->password, ssl_need)) {
       stop_bsock_timer(tid);
-      Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords or names not the same.\n"   
+      Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords or names not the same.\n"
        "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
       return 0;
    }
index 544848845c03add8da769bb61074d102ecf3bc87..c6e4369c49a36bddbd4e85dcd072fb2748ccf3b0 100644 (file)
@@ -52,16 +52,16 @@ extern "C" {
 /* VOID:OBJECT,OBJECT (eggmarshalers.list:1) */
 void
 _egg_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
-                                  GValue       *return_value,
-                                  guint         n_param_values,
-                                  const GValue *param_values,
-                                  gpointer      invocation_hint,
-                                  gpointer      marshal_data)
+                                 GValue       *return_value,
+                                 guint         n_param_values,
+                                 const GValue *param_values,
+                                 gpointer      invocation_hint,
+                                 gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer     data1,
-                                                    gpointer     arg_1,
-                                                    gpointer     arg_2,
-                                                    gpointer     data2);
+                                                   gpointer     arg_1,
+                                                   gpointer     arg_2,
+                                                   gpointer     data2);
   register GMarshalFunc_VOID__OBJECT_OBJECT callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -81,26 +81,26 @@ _egg_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
   callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_object (param_values + 1),
-            g_marshal_value_peek_object (param_values + 2),
-            data2);
+           g_marshal_value_peek_object (param_values + 1),
+           g_marshal_value_peek_object (param_values + 2),
+           data2);
 }
 
 /* VOID:OBJECT,STRING,LONG,LONG (eggmarshalers.list:2) */
 void
 _egg_marshal_VOID__OBJECT_STRING_LONG_LONG (GClosure     *closure,
-                                            GValue       *return_value,
-                                            guint         n_param_values,
-                                            const GValue *param_values,
-                                            gpointer      invocation_hint,
-                                            gpointer      marshal_data)
+                                           GValue       *return_value,
+                                           guint         n_param_values,
+                                           const GValue *param_values,
+                                           gpointer      invocation_hint,
+                                           gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG) (gpointer     data1,
-                                                              gpointer     arg_1,
-                                                              gpointer     arg_2,
-                                                              glong        arg_3,
-                                                              glong        arg_4,
-                                                              gpointer     data2);
+                                                             gpointer     arg_1,
+                                                             gpointer     arg_2,
+                                                             glong        arg_3,
+                                                             glong        arg_4,
+                                                             gpointer     data2);
   register GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -120,26 +120,26 @@ _egg_marshal_VOID__OBJECT_STRING_LONG_LONG (GClosure     *closure,
   callback = (GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_object (param_values + 1),
-            g_marshal_value_peek_string (param_values + 2),
-            g_marshal_value_peek_long (param_values + 3),
-            g_marshal_value_peek_long (param_values + 4),
-            data2);
+           g_marshal_value_peek_object (param_values + 1),
+           g_marshal_value_peek_string (param_values + 2),
+           g_marshal_value_peek_long (param_values + 3),
+           g_marshal_value_peek_long (param_values + 4),
+           data2);
 }
 
 /* VOID:OBJECT,LONG (eggmarshalers.list:3) */
 void
 _egg_marshal_VOID__OBJECT_LONG (GClosure     *closure,
-                                GValue       *return_value,
-                                guint         n_param_values,
-                                const GValue *param_values,
-                                gpointer      invocation_hint,
-                                gpointer      marshal_data)
+                               GValue       *return_value,
+                               guint         n_param_values,
+                               const GValue *param_values,
+                               gpointer      invocation_hint,
+                               gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_LONG) (gpointer     data1,
-                                                  gpointer     arg_1,
-                                                  glong        arg_2,
-                                                  gpointer     data2);
+                                                 gpointer     arg_1,
+                                                 glong        arg_2,
+                                                 gpointer     data2);
   register GMarshalFunc_VOID__OBJECT_LONG callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -159,25 +159,25 @@ _egg_marshal_VOID__OBJECT_LONG (GClosure     *closure,
   callback = (GMarshalFunc_VOID__OBJECT_LONG) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_object (param_values + 1),
-            g_marshal_value_peek_long (param_values + 2),
-            data2);
+           g_marshal_value_peek_object (param_values + 1),
+           g_marshal_value_peek_long (param_values + 2),
+           data2);
 }
 
 /* VOID:OBJECT,STRING,STRING (eggmarshalers.list:4) */
 void
 _egg_marshal_VOID__OBJECT_STRING_STRING (GClosure     *closure,
-                                         GValue       *return_value,
-                                         guint         n_param_values,
-                                         const GValue *param_values,
-                                         gpointer      invocation_hint,
-                                         gpointer      marshal_data)
+                                        GValue       *return_value,
+                                        guint         n_param_values,
+                                        const GValue *param_values,
+                                        gpointer      invocation_hint,
+                                        gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_STRING_STRING) (gpointer     data1,
-                                                           gpointer     arg_1,
-                                                           gpointer     arg_2,
-                                                           gpointer     arg_3,
-                                                           gpointer     data2);
+                                                          gpointer     arg_1,
+                                                          gpointer     arg_2,
+                                                          gpointer     arg_3,
+                                                          gpointer     data2);
   register GMarshalFunc_VOID__OBJECT_STRING_STRING callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -197,25 +197,25 @@ _egg_marshal_VOID__OBJECT_STRING_STRING (GClosure     *closure,
   callback = (GMarshalFunc_VOID__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_object (param_values + 1),
-            g_marshal_value_peek_string (param_values + 2),
-            g_marshal_value_peek_string (param_values + 3),
-            data2);
+           g_marshal_value_peek_object (param_values + 1),
+           g_marshal_value_peek_string (param_values + 2),
+           g_marshal_value_peek_string (param_values + 3),
+           data2);
 }
 
 /* VOID:UINT,UINT (eggmarshalers.list:5) */
 void
 _egg_marshal_VOID__UINT_UINT (GClosure     *closure,
-                              GValue       *return_value,
-                              guint         n_param_values,
-                              const GValue *param_values,
-                              gpointer      invocation_hint,
-                              gpointer      marshal_data)
+                             GValue       *return_value,
+                             guint         n_param_values,
+                             const GValue *param_values,
+                             gpointer      invocation_hint,
+                             gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer     data1,
-                                                guint        arg_1,
-                                                guint        arg_2,
-                                                gpointer     data2);
+                                               guint        arg_1,
+                                               guint        arg_2,
+                                               gpointer     data2);
   register GMarshalFunc_VOID__UINT_UINT callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -235,23 +235,23 @@ _egg_marshal_VOID__UINT_UINT (GClosure     *closure,
   callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_uint (param_values + 1),
-            g_marshal_value_peek_uint (param_values + 2),
-            data2);
+           g_marshal_value_peek_uint (param_values + 1),
+           g_marshal_value_peek_uint (param_values + 2),
+           data2);
 }
 
 /* BOOLEAN:INT (eggmarshalers.list:6) */
 void
 _egg_marshal_BOOLEAN__INT (GClosure     *closure,
-                           GValue       *return_value,
-                           guint         n_param_values,
-                           const GValue *param_values,
-                           gpointer      invocation_hint,
-                           gpointer      marshal_data)
+                          GValue       *return_value,
+                          guint         n_param_values,
+                          const GValue *param_values,
+                          gpointer      invocation_hint,
+                          gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__INT) (gpointer     data1,
-                                                 gint         arg_1,
-                                                 gpointer     data2);
+                                                gint         arg_1,
+                                                gpointer     data2);
   register GMarshalFunc_BOOLEAN__INT callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -273,8 +273,8 @@ _egg_marshal_BOOLEAN__INT (GClosure     *closure,
   callback = (GMarshalFunc_BOOLEAN__INT) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       g_marshal_value_peek_int (param_values + 1),
-                       data2);
+                      g_marshal_value_peek_int (param_values + 1),
+                      data2);
 
   g_value_set_boolean (return_value, v_return);
 }
@@ -282,15 +282,15 @@ _egg_marshal_BOOLEAN__INT (GClosure     *closure,
 /* BOOLEAN:ENUM (eggmarshalers.list:7) */
 void
 _egg_marshal_BOOLEAN__ENUM (GClosure     *closure,
-                            GValue       *return_value,
-                            guint         n_param_values,
-                            const GValue *param_values,
-                            gpointer      invocation_hint,
-                            gpointer      marshal_data)
+                           GValue       *return_value,
+                           guint         n_param_values,
+                           const GValue *param_values,
+                           gpointer      invocation_hint,
+                           gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__ENUM) (gpointer     data1,
-                                                  gint         arg_1,
-                                                  gpointer     data2);
+                                                 gint         arg_1,
+                                                 gpointer     data2);
   register GMarshalFunc_BOOLEAN__ENUM callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -312,8 +312,8 @@ _egg_marshal_BOOLEAN__ENUM (GClosure     *closure,
   callback = (GMarshalFunc_BOOLEAN__ENUM) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       g_marshal_value_peek_enum (param_values + 1),
-                       data2);
+                      g_marshal_value_peek_enum (param_values + 1),
+                      data2);
 
   g_value_set_boolean (return_value, v_return);
 }
@@ -321,14 +321,14 @@ _egg_marshal_BOOLEAN__ENUM (GClosure     *closure,
 /* BOOLEAN:VOID (eggmarshalers.list:8) */
 void
 _egg_marshal_BOOLEAN__VOID (GClosure     *closure,
-                            GValue       *return_value,
-                            guint         n_param_values,
-                            const GValue *param_values,
-                            gpointer      invocation_hint,
-                            gpointer      marshal_data)
+                           GValue       *return_value,
+                           guint         n_param_values,
+                           const GValue *param_values,
+                           gpointer      invocation_hint,
+                           gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer     data1,
-                                                  gpointer     data2);
+                                                 gpointer     data2);
   register GMarshalFunc_BOOLEAN__VOID callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -350,7 +350,7 @@ _egg_marshal_BOOLEAN__VOID (GClosure     *closure,
   callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       data2);
+                      data2);
 
   g_value_set_boolean (return_value, v_return);
 }
@@ -358,14 +358,14 @@ _egg_marshal_BOOLEAN__VOID (GClosure     *closure,
 /* OBJECT:VOID (eggmarshalers.list:9) */
 void
 _egg_marshal_OBJECT__VOID (GClosure     *closure,
-                           GValue       *return_value,
-                           guint         n_param_values,
-                           const GValue *param_values,
-                           gpointer      invocation_hint,
-                           gpointer      marshal_data)
+                          GValue       *return_value,
+                          guint         n_param_values,
+                          const GValue *param_values,
+                          gpointer      invocation_hint,
+                          gpointer      marshal_data)
 {
   typedef GObject* (*GMarshalFunc_OBJECT__VOID) (gpointer     data1,
-                                                 gpointer     data2);
+                                                gpointer     data2);
   register GMarshalFunc_OBJECT__VOID callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -387,7 +387,7 @@ _egg_marshal_OBJECT__VOID (GClosure     *closure,
   callback = (GMarshalFunc_OBJECT__VOID) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       data2);
+                      data2);
 
   g_value_set_object_take_ownership (return_value, v_return);
 }
@@ -397,16 +397,16 @@ _egg_marshal_OBJECT__VOID (GClosure     *closure,
 /* VOID:INT,INT (eggmarshalers.list:11) */
 void
 _egg_marshal_VOID__INT_INT (GClosure     *closure,
-                            GValue       *return_value,
-                            guint         n_param_values,
-                            const GValue *param_values,
-                            gpointer      invocation_hint,
-                            gpointer      marshal_data)
+                           GValue       *return_value,
+                           guint         n_param_values,
+                           const GValue *param_values,
+                           gpointer      invocation_hint,
+                           gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer     data1,
-                                              gint         arg_1,
-                                              gint         arg_2,
-                                              gpointer     data2);
+                                             gint         arg_1,
+                                             gint         arg_2,
+                                             gpointer     data2);
   register GMarshalFunc_VOID__INT_INT callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -426,9 +426,9 @@ _egg_marshal_VOID__INT_INT (GClosure     *closure,
   callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_int (param_values + 1),
-            g_marshal_value_peek_int (param_values + 2),
-            data2);
+           g_marshal_value_peek_int (param_values + 1),
+           g_marshal_value_peek_int (param_values + 2),
+           data2);
 }
 
 /* VOID:UINT,UINT (eggmarshalers.list:12) */
@@ -438,17 +438,17 @@ _egg_marshal_VOID__INT_INT (GClosure     *closure,
 /* VOID:OBJECT,ENUM,BOXED (eggmarshalers.list:14) */
 void
 _egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure     *closure,
-                                      GValue       *return_value,
-                                      guint         n_param_values,
-                                      const GValue *param_values,
-                                      gpointer      invocation_hint,
-                                      gpointer      marshal_data)
+                                     GValue       *return_value,
+                                     guint         n_param_values,
+                                     const GValue *param_values,
+                                     gpointer      invocation_hint,
+                                     gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_ENUM_BOXED) (gpointer     data1,
-                                                        gpointer     arg_1,
-                                                        gint         arg_2,
-                                                        gpointer     arg_3,
-                                                        gpointer     data2);
+                                                       gpointer     arg_1,
+                                                       gint         arg_2,
+                                                       gpointer     arg_3,
+                                                       gpointer     data2);
   register GMarshalFunc_VOID__OBJECT_ENUM_BOXED callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -468,10 +468,10 @@ _egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure     *closure,
   callback = (GMarshalFunc_VOID__OBJECT_ENUM_BOXED) (marshal_data ? marshal_data : cc->callback);
 
   callback (data1,
-            g_marshal_value_peek_object (param_values + 1),
-            g_marshal_value_peek_enum (param_values + 2),
-            g_marshal_value_peek_boxed (param_values + 3),
-            data2);
+           g_marshal_value_peek_object (param_values + 1),
+           g_marshal_value_peek_enum (param_values + 2),
+           g_marshal_value_peek_boxed (param_values + 3),
+           data2);
 }
 
 /* VOID:BOXED (eggmarshalers.list:15) */
@@ -479,15 +479,15 @@ _egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure     *closure,
 /* BOOLEAN:BOOLEAN (eggmarshalers.list:16) */
 void
 _egg_marshal_BOOLEAN__BOOLEAN (GClosure     *closure,
-                               GValue       *return_value,
-                               guint         n_param_values,
-                               const GValue *param_values,
-                               gpointer      invocation_hint,
-                               gpointer      marshal_data)
+                              GValue       *return_value,
+                              guint         n_param_values,
+                              const GValue *param_values,
+                              gpointer      invocation_hint,
+                              gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN) (gpointer     data1,
-                                                     gboolean     arg_1,
-                                                     gpointer     data2);
+                                                    gboolean     arg_1,
+                                                    gpointer     data2);
   register GMarshalFunc_BOOLEAN__BOOLEAN callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -509,8 +509,8 @@ _egg_marshal_BOOLEAN__BOOLEAN (GClosure     *closure,
   callback = (GMarshalFunc_BOOLEAN__BOOLEAN) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       g_marshal_value_peek_boolean (param_values + 1),
-                       data2);
+                      g_marshal_value_peek_boolean (param_values + 1),
+                      data2);
 
   g_value_set_boolean (return_value, v_return);
 }
@@ -518,17 +518,17 @@ _egg_marshal_BOOLEAN__BOOLEAN (GClosure     *closure,
 /* BOOLEAN:OBJECT,STRING,STRING (eggmarshalers.list:17) */
 void
 _egg_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure     *closure,
-                                            GValue       *return_value,
-                                            guint         n_param_values,
-                                            const GValue *param_values,
-                                            gpointer      invocation_hint,
-                                            gpointer      marshal_data)
+                                           GValue       *return_value,
+                                           guint         n_param_values,
+                                           const GValue *param_values,
+                                           gpointer      invocation_hint,
+                                           gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (gpointer     data1,
-                                                                  gpointer     arg_1,
-                                                                  gpointer     arg_2,
-                                                                  gpointer     arg_3,
-                                                                  gpointer     data2);
+                                                                 gpointer     arg_1,
+                                                                 gpointer     arg_2,
+                                                                 gpointer     arg_3,
+                                                                 gpointer     data2);
   register GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;
@@ -550,10 +550,10 @@ _egg_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure     *closure,
   callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
 
   v_return = callback (data1,
-                       g_marshal_value_peek_object (param_values + 1),
-                       g_marshal_value_peek_string (param_values + 2),
-                       g_marshal_value_peek_string (param_values + 3),
-                       data2);
+                      g_marshal_value_peek_object (param_values + 1),
+                      g_marshal_value_peek_string (param_values + 2),
+                      g_marshal_value_peek_string (param_values + 3),
+                      data2);
 
   g_value_set_boolean (return_value, v_return);
 }
index c375dbc04b3e01522e8da8a2e047c34a5bc5b4c7..d6d393cef4a9326cba9e2f1787d3a4dd545d1758 100644 (file)
@@ -8,86 +8,86 @@ G_BEGIN_DECLS
 
 /* VOID:OBJECT,OBJECT (eggmarshalers.list:1) */
 extern void _egg_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
-                                              GValue       *return_value,
-                                              guint         n_param_values,
-                                              const GValue *param_values,
-                                              gpointer      invocation_hint,
-                                              gpointer      marshal_data);
+                                             GValue       *return_value,
+                                             guint         n_param_values,
+                                             const GValue *param_values,
+                                             gpointer      invocation_hint,
+                                             gpointer      marshal_data);
 
 /* VOID:OBJECT,STRING,LONG,LONG (eggmarshalers.list:2) */
 extern void _egg_marshal_VOID__OBJECT_STRING_LONG_LONG (GClosure     *closure,
-                                                        GValue       *return_value,
-                                                        guint         n_param_values,
-                                                        const GValue *param_values,
-                                                        gpointer      invocation_hint,
-                                                        gpointer      marshal_data);
+                                                       GValue       *return_value,
+                                                       guint         n_param_values,
+                                                       const GValue *param_values,
+                                                       gpointer      invocation_hint,
+                                                       gpointer      marshal_data);
 
 /* VOID:OBJECT,LONG (eggmarshalers.list:3) */
 extern void _egg_marshal_VOID__OBJECT_LONG (GClosure     *closure,
-                                            GValue       *return_value,
-                                            guint         n_param_values,
-                                            const GValue *param_values,
-                                            gpointer      invocation_hint,
-                                            gpointer      marshal_data);
+                                           GValue       *return_value,
+                                           guint         n_param_values,
+                                           const GValue *param_values,
+                                           gpointer      invocation_hint,
+                                           gpointer      marshal_data);
 
 /* VOID:OBJECT,STRING,STRING (eggmarshalers.list:4) */
 extern void _egg_marshal_VOID__OBJECT_STRING_STRING (GClosure     *closure,
-                                                     GValue       *return_value,
-                                                     guint         n_param_values,
-                                                     const GValue *param_values,
-                                                     gpointer      invocation_hint,
-                                                     gpointer      marshal_data);
+                                                    GValue       *return_value,
+                                                    guint         n_param_values,
+                                                    const GValue *param_values,
+                                                    gpointer      invocation_hint,
+                                                    gpointer      marshal_data);
 
 /* VOID:UINT,UINT (eggmarshalers.list:5) */
 extern void _egg_marshal_VOID__UINT_UINT (GClosure     *closure,
-                                          GValue       *return_value,
-                                          guint         n_param_values,
-                                          const GValue *param_values,
-                                          gpointer      invocation_hint,
-                                          gpointer      marshal_data);
+                                         GValue       *return_value,
+                                         guint         n_param_values,
+                                         const GValue *param_values,
+                                         gpointer      invocation_hint,
+                                         gpointer      marshal_data);
 
 /* BOOLEAN:INT (eggmarshalers.list:6) */
 extern void _egg_marshal_BOOLEAN__INT (GClosure     *closure,
-                                       GValue       *return_value,
-                                       guint         n_param_values,
-                                       const GValue *param_values,
-                                       gpointer      invocation_hint,
-                                       gpointer      marshal_data);
+                                      GValue       *return_value,
+                                      guint         n_param_values,
+                                      const GValue *param_values,
+                                      gpointer      invocation_hint,
+                                      gpointer      marshal_data);
 
 /* BOOLEAN:ENUM (eggmarshalers.list:7) */
 extern void _egg_marshal_BOOLEAN__ENUM (GClosure     *closure,
-                                        GValue       *return_value,
-                                        guint         n_param_values,
-                                        const GValue *param_values,
-                                        gpointer      invocation_hint,
-                                        gpointer      marshal_data);
+                                       GValue       *return_value,
+                                       guint         n_param_values,
+                                       const GValue *param_values,
+                                       gpointer      invocation_hint,
+                                       gpointer      marshal_data);
 
 /* BOOLEAN:VOID (eggmarshalers.list:8) */
 extern void _egg_marshal_BOOLEAN__VOID (GClosure     *closure,
-                                        GValue       *return_value,
-                                        guint         n_param_values,
-                                        const GValue *param_values,
-                                        gpointer      invocation_hint,
-                                        gpointer      marshal_data);
+                                       GValue       *return_value,
+                                       guint         n_param_values,
+                                       const GValue *param_values,
+                                       gpointer      invocation_hint,
+                                       gpointer      marshal_data);
 
 /* OBJECT:VOID (eggmarshalers.list:9) */
 extern void _egg_marshal_OBJECT__VOID (GClosure     *closure,
-                                       GValue       *return_value,
-                                       guint         n_param_values,
-                                       const GValue *param_values,
-                                       gpointer      invocation_hint,
-                                       gpointer      marshal_data);
+                                      GValue       *return_value,
+                                      guint         n_param_values,
+                                      const GValue *param_values,
+                                      gpointer      invocation_hint,
+                                      gpointer      marshal_data);
 
 /* VOID:VOID (eggmarshalers.list:10) */
 #define _egg_marshal_VOID__VOID        g_cclosure_marshal_VOID__VOID
 
 /* VOID:INT,INT (eggmarshalers.list:11) */
 extern void _egg_marshal_VOID__INT_INT (GClosure     *closure,
-                                        GValue       *return_value,
-                                        guint         n_param_values,
-                                        const GValue *param_values,
-                                        gpointer      invocation_hint,
-                                        gpointer      marshal_data);
+                                       GValue       *return_value,
+                                       guint         n_param_values,
+                                       const GValue *param_values,
+                                       gpointer      invocation_hint,
+                                       gpointer      marshal_data);
 
 /* VOID:UINT,UINT (eggmarshalers.list:12) */
 
@@ -96,30 +96,30 @@ extern void _egg_marshal_VOID__INT_INT (GClosure     *closure,
 
 /* VOID:OBJECT,ENUM,BOXED (eggmarshalers.list:14) */
 extern void _egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure     *closure,
-                                                  GValue       *return_value,
-                                                  guint         n_param_values,
-                                                  const GValue *param_values,
-                                                  gpointer      invocation_hint,
-                                                  gpointer      marshal_data);
+                                                 GValue       *return_value,
+                                                 guint         n_param_values,
+                                                 const GValue *param_values,
+                                                 gpointer      invocation_hint,
+                                                 gpointer      marshal_data);
 
 /* VOID:BOXED (eggmarshalers.list:15) */
 #define _egg_marshal_VOID__BOXED       g_cclosure_marshal_VOID__BOXED
 
 /* BOOLEAN:BOOLEAN (eggmarshalers.list:16) */
 extern void _egg_marshal_BOOLEAN__BOOLEAN (GClosure     *closure,
-                                           GValue       *return_value,
-                                           guint         n_param_values,
-                                           const GValue *param_values,
-                                           gpointer      invocation_hint,
-                                           gpointer      marshal_data);
+                                          GValue       *return_value,
+                                          guint         n_param_values,
+                                          const GValue *param_values,
+                                          gpointer      invocation_hint,
+                                          gpointer      marshal_data);
 
 /* BOOLEAN:OBJECT,STRING,STRING (eggmarshalers.list:17) */
 extern void _egg_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure     *closure,
-                                                        GValue       *return_value,
-                                                        guint         n_param_values,
-                                                        const GValue *param_values,
-                                                        gpointer      invocation_hint,
-                                                        gpointer      marshal_data);
+                                                       GValue       *return_value,
+                                                       guint         n_param_values,
+                                                       const GValue *param_values,
+                                                       gpointer      invocation_hint,
+                                                       gpointer      marshal_data);
 
 G_END_DECLS
 
index f6bcc38bcad152a5effb44e26cd257ecda309a39..d6a0665143d617b78bf343831134fe11fa36f90d 100644 (file)
@@ -103,7 +103,7 @@ static gboolean egg_status_icon_button_release   (EggStatusIcon  *status_icon,
                                                  GdkEventButton *event);
 static void     egg_status_icon_disable_blinking (EggStatusIcon  *status_icon);
 static void     egg_status_icon_reset_image_data (EggStatusIcon  *status_icon);
-                                          
+
 
 static GObjectClass *parent_class = NULL;
 static guint status_icon_signals [LAST_SIGNAL] = { 0 };
@@ -112,7 +112,7 @@ GType
 egg_status_icon_get_type (void)
 {
   static GType status_icon_type = 0;
-  
+
   if (!status_icon_type)
     {
       static const GTypeInfo status_icon_info =
@@ -127,12 +127,12 @@ egg_status_icon_get_type (void)
        0,              /* n_preallocs */
        (GInstanceInitFunc) egg_status_icon_init,
       };
-      
+
       status_icon_type = g_type_register_static (G_TYPE_OBJECT,
                                                 "EggStatusIcon",
                                                 &status_icon_info, (GTypeFlags)0);
     }
-  
+
   return status_icon_type;
 }
 
@@ -170,7 +170,7 @@ egg_status_icon_class_init (EggStatusIconClass *klass)
                                                        "Stock ID for a stock image to display",
                                                        NULL,
                                                        (GParamFlags)G_PARAM_READWRITE));
-  
+
   g_object_class_install_property (gobject_class,
                                   PROP_PIXBUF_ANIMATION,
                                   g_param_spec_object ("pixbuf-animation",
@@ -178,7 +178,7 @@ egg_status_icon_class_init (EggStatusIconClass *klass)
                                                        "GdkPixbufAnimation to display",
                                                        GDK_TYPE_PIXBUF_ANIMATION,
                                                        (GParamFlags)G_PARAM_READWRITE));
-  
+
   g_object_class_install_property (gobject_class,
                                   PROP_STORAGE_TYPE,
                                   g_param_spec_enum ("image-type",
@@ -424,7 +424,7 @@ emit_size_changed_signal (EggStatusIcon *status_icon,
                          gint           size)
 {
   gboolean handled = FALSE;
-  
+
   g_signal_emit (status_icon,
                 status_icon_signals [SIZE_CHANGED_SIGNAL], 0,
                 size,
@@ -444,7 +444,7 @@ egg_status_icon_blank_icon (EggStatusIcon *status_icon)
       height = gdk_pixbuf_get_width (status_icon->priv->blank_icon);
 
       if (width  == status_icon->priv->size &&
-          height == status_icon->priv->size)
+         height == status_icon->priv->size)
        {
          return status_icon->priv->blank_icon;
        }
@@ -643,7 +643,7 @@ egg_status_icon_set_from_animation (EggStatusIcon      *status_icon,
   g_return_if_fail (EGG_IS_STATUS_ICON (status_icon));
   g_return_if_fail (animation == NULL || GDK_IS_PIXBUF_ANIMATION (animation));
 }
-                                                                                                             
+
 GtkImageType
 egg_status_icon_get_image_type (EggStatusIcon *status_icon)
 {
@@ -651,17 +651,17 @@ egg_status_icon_get_image_type (EggStatusIcon *status_icon)
 
   return status_icon->priv->image_type;
 }
-                                                                                                             
+
 GdkPixbuf *
 egg_status_icon_get_pixbuf (EggStatusIcon *status_icon)
 {
   g_return_val_if_fail (EGG_IS_STATUS_ICON (status_icon), NULL);
   g_return_val_if_fail (status_icon->priv->image_type == GTK_IMAGE_PIXBUF ||
                        status_icon->priv->image_type == GTK_IMAGE_EMPTY, NULL);
-                                                                                                             
+
   if (status_icon->priv->image_type == GTK_IMAGE_EMPTY)
     status_icon->priv->image_data.pixbuf = NULL;
-                                                                                                             
+
   return status_icon->priv->image_data.pixbuf;
 }
 
@@ -680,7 +680,7 @@ egg_status_icon_get_animation (EggStatusIcon *status_icon)
 
   return NULL;
 }
-                                                                                                             
+
 gint
 egg_status_icon_get_size (EggStatusIcon *status_icon)
 {
@@ -688,7 +688,7 @@ egg_status_icon_get_size (EggStatusIcon *status_icon)
 
   return status_icon->priv->size;
 }
-                                                                                                             
+
 void
 egg_status_icon_set_tooltip (EggStatusIcon *status_icon,
                             const gchar   *tooltip_text,
@@ -785,7 +785,7 @@ EggTrayIcon*
 egg_status_icon_get_tray_icon (EggStatusIcon      *status_icon)
 {
    g_return_val_if_fail (EGG_IS_STATUS_ICON (status_icon), NULL);
-   
+
    return EGG_TRAY_ICON(status_icon->priv->tray_icon);
 }
 
index 03e6f0757311074269a9c113a72b94f36831b7da..b3032994834fbbcc54d541afa28d4a5b5646f12f 100644 (file)
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
 #define EGG_IS_STATUS_ICON(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_TYPE_STATUS_ICON))
 #define EGG_IS_STATUS_ICON_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_TYPE_STATUS_ICON))
 #define EGG_STATUS_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_TYPE_STATUS_ICON, EggStatusIconClass))
-       
+
 typedef struct _EggStatusIcon       EggStatusIcon;
 typedef struct _EggStatusIconClass   EggStatusIconClass;
 typedef struct _EggStatusIconPrivate EggStatusIconPrivate;
index 902d9b7a55c1d2c1221c37e0bb7e0d6e355c65af..4b59d25e2aaec9511cb73338457ef1f9aa2cbe9c 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 extern "C" {
+
 #include <string.h>
 #include <libintl.h>
 
@@ -49,7 +49,7 @@ enum {
   PROP_0,
   PROP_ORIENTATION
 };
-         
+
 static GtkPlugClass *parent_class = NULL;
 
 static void egg_tray_icon_init (EggTrayIcon *icon);
@@ -96,7 +96,7 @@ egg_tray_icon_init (EggTrayIcon *icon)
 {
   icon->stamp = 1;
   icon->orientation = GTK_ORIENTATION_HORIZONTAL;
-  
+
   gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
 }
 
@@ -157,7 +157,7 @@ egg_tray_icon_get_orientation_property (EggTrayIcon *icon)
   int error, result;
 
   g_assert (icon->manager_window != None);
-  
+
   xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
 
   gdk_error_trap_push ();
@@ -218,7 +218,7 @@ egg_tray_icon_manager_filter (GdkXEvent *xevent, GdkEvent *event, gpointer user_
          egg_tray_icon_update_manager_window (icon);
        }
     }
-  
+
   return GDK_FILTER_CONTINUE;
 }
 
@@ -233,7 +233,7 @@ egg_tray_icon_unrealize (GtkWidget *widget)
       GdkWindow *gdkwin;
 
       gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (widget),
-                                              icon->manager_window);
+                                             icon->manager_window);
 
       gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
     }
@@ -256,7 +256,7 @@ egg_tray_icon_send_manager_message (EggTrayIcon *icon,
 {
   XClientMessageEvent ev;
   Display *display;
-  
+
   ev.type = ClientMessage;
   ev.window = window;
   ev.message_type = icon->system_tray_opcode_atom;
@@ -268,7 +268,7 @@ egg_tray_icon_send_manager_message (EggTrayIcon *icon,
   ev.data.l[4] = data3;
 
   display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-  
+
   gdk_error_trap_push ();
   XSendEvent (display,
              icon->manager_window, False, NoEventMask, (XEvent *)&ev);
@@ -290,21 +290,21 @@ static void
 egg_tray_icon_update_manager_window (EggTrayIcon *icon)
 {
   Display *xdisplay;
-  
+
   xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-  
+
   if (icon->manager_window != None)
     {
       GdkWindow *gdkwin;
 
       gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
                                              icon->manager_window);
-      
+
       gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
     }
-  
+
   XGrabServer (xdisplay);
-  
+
   icon->manager_window = XGetSelectionOwner (xdisplay,
                                             icon->selection_atom);
 
@@ -314,14 +314,14 @@ egg_tray_icon_update_manager_window (EggTrayIcon *icon)
 
   XUngrabServer (xdisplay);
   XFlush (xdisplay);
-  
+
   if (icon->manager_window != None)
     {
       GdkWindow *gdkwin;
 
       gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
                                              icon->manager_window);
-      
+
       gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
 
       /* Send a request that we'd like to dock */
@@ -354,9 +354,9 @@ egg_tray_icon_realize (GtkWidget *widget)
              gdk_screen_get_number (screen));
 
   icon->selection_atom = XInternAtom (xdisplay, buffer, False);
-  
+
   icon->manager_atom = XInternAtom (xdisplay, "MANAGER", False);
-  
+
   icon->system_tray_opcode_atom = XInternAtom (xdisplay,
                                                   "_NET_SYSTEM_TRAY_OPCODE",
                                                   False);
@@ -368,7 +368,7 @@ egg_tray_icon_realize (GtkWidget *widget)
   egg_tray_icon_update_manager_window (icon);
 
   root_window = gdk_screen_get_root_window (screen);
-  
+
   /* Add a root window filter so that we get changes on MANAGER */
   gdk_window_add_filter (root_window,
                         egg_tray_icon_manager_filter, icon);
@@ -407,11 +407,11 @@ egg_tray_icon_send_message (EggTrayIcon *icon,
                            gint         len)
 {
   guint stamp;
-  
+
   g_return_val_if_fail (EGG_IS_TRAY_ICON (icon), 0);
   g_return_val_if_fail (timeout >= 0, 0);
   g_return_val_if_fail (message != NULL, 0);
-                    
+
   if (icon->manager_window == None)
     return 0;
 
@@ -419,7 +419,7 @@ egg_tray_icon_send_message (EggTrayIcon *icon,
     len = strlen (message);
 
   stamp = icon->stamp++;
-  
+
   /* Get ready to send the message */
   egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_BEGIN_MESSAGE,
                                      (Window)gtk_plug_get_id (GTK_PLUG (icon)),
@@ -433,7 +433,7 @@ egg_tray_icon_send_message (EggTrayIcon *icon,
       Display *xdisplay;
 
       xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-      
+
       ev.type = ClientMessage;
       ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
       ev.format = 8;
@@ -466,7 +466,7 @@ egg_tray_icon_cancel_message (EggTrayIcon *icon,
 {
   g_return_if_fail (EGG_IS_TRAY_ICON (icon));
   g_return_if_fail (id > 0);
-  
+
   egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_CANCEL_MESSAGE,
                                      (Window)gtk_plug_get_id (GTK_PLUG (icon)),
                                      id, 0, 0);
index 007f4c18e9033b707558ffac88d2d85f04d02d82..215c217039ccc4458d01bc31b0affa374ce5a078 100644 (file)
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 #define EGG_IS_TRAY_ICON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TRAY_ICON))
 #define EGG_IS_TRAY_ICON_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
 #define EGG_TRAY_ICON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
-       
+
 typedef struct _EggTrayIcon      EggTrayIcon;
 typedef struct _EggTrayIconClass  EggTrayIconClass;
 
@@ -41,7 +41,7 @@ struct _EggTrayIcon
   GtkPlug parent_instance;
 
   guint stamp;
-  
+
   Atom selection_atom;
   Atom manager_atom;
   Atom system_tray_opcode_atom;
@@ -71,7 +71,7 @@ void         egg_tray_icon_cancel_message (EggTrayIcon *icon,
                                           guint        id);
 
 GtkOrientation egg_tray_icon_get_orientation (EggTrayIcon *icon);
-                                           
+
 G_END_DECLS
 
 #endif /* __EGG_TRAY_ICON_H__ */
index b24641dca459eadc97252a34d9431f0a47393e4a..f626a91b9604c882df8f084f8756246a509d05f5 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "generic.xpm"
 
+#define TRAY_DEBUG_MEMORY 0
+
 /* Imported functions */
 int authenticate_director(JCR *jcr, MONITOR *monitor, DIRRES *director);
 int authenticate_file_daemon(JCR *jcr, MONITOR *monitor, CLIENT* client);
@@ -47,7 +49,6 @@ void getstatus(monitoritem* item, int current, GString** str);
 /* Static variables */
 static char *configfile = NULL;
 static MONITOR *monitor;
-static POOLMEM *args;
 static JCR jcr;
 static int nitems = 0;
 static int fullitem = 0; //Item to be display in detailled status window
@@ -102,24 +103,24 @@ static void usage()
 "       -c <file>     set configuration file to file\n"
 "       -dnn          set debug level to nn\n"
 "       -t            test - read configuration and exit\n"
-"       -?            print this message.\n"  
+"       -?            print this message.\n"
 "\n"), HOST_OS, DISTNAME, DISTVER);
 }
 
-static GtkWidget *new_image_button(const gchar *stock_id, 
-                                   const gchar *label_text) {
+static GtkWidget *new_image_button(const gchar *stock_id,
+                                  const gchar *label_text) {
     GtkWidget *button;
     GtkWidget *box;
     GtkWidget *label;
     GtkWidget *image;
 
     button = gtk_button_new();
-   
+
     box = gtk_hbox_new(FALSE, 0);
     gtk_container_set_border_width(GTK_CONTAINER(box), 2);
     image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_BUTTON);
     label = gtk_label_new(label_text);
-    
+
     gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 3);
     gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 3);
 
@@ -129,10 +130,31 @@ static GtkWidget *new_image_button(const gchar *stock_id,
     gtk_widget_show(box);
 
     gtk_container_add(GTK_CONTAINER(button), box);
-    
+
     return button;
 }
 
+int sm_line = 0;
+
+#if TRAY_DEBUG_MEMORY
+gpointer smt_malloc(gsize    n_bytes) {
+   return sm_malloc("GLib", sm_line, n_bytes);
+}
+  
+gpointer smt_realloc(gpointer mem, gsize    n_bytes) {
+   return sm_realloc("GLib", sm_line, mem, n_bytes);
+}
+
+gpointer smt_calloc(gsize    n_blocks,
+                    gsize    n_block_bytes) {
+   return sm_calloc("GLib", sm_line, n_blocks, n_block_bytes);
+}
+
+void     smt_free(gpointer mem) {
+   sm_free("Glib", sm_line, mem);
+}
+#endif
+
 /*********************************************************************
  *
  *        Main Bacula Tray Monitor -- User Interface Program
@@ -140,6 +162,17 @@ static GtkWidget *new_image_button(const gchar *stock_id,
  */
 int main(int argc, char *argv[])
 {
+#if TRAY_DEBUG_MEMORY
+   GMemVTable smvtable;
+   smvtable.malloc = &smt_malloc;
+   smvtable.realloc = &smt_realloc;
+   smvtable.free = &smt_free;
+   smvtable.calloc = &smt_calloc;
+   smvtable.try_malloc = NULL;
+   smvtable.try_realloc = NULL;
+   g_mem_set_vtable(&smvtable);
+#endif
+   
    int ch, i;
    bool test_config = false;
    DIRRES* dird;
@@ -151,11 +184,10 @@ int main(int argc, char *argv[])
    textdomain("bacula");
    init_msg(NULL, NULL);
    working_directory = "/tmp";
-   args = get_pool_memory(PM_FNAME);
 
    struct sigaction sigignore;
    sigignore.sa_flags = 0;
-   sigignore.sa_handler = SIG_IGN;      
+   sigignore.sa_handler = SIG_IGN;
    sigfillset(&sigignore.sa_mask);
    sigaction(SIGPIPE, &sigignore, NULL);
 
@@ -164,29 +196,29 @@ int main(int argc, char *argv[])
    while ((ch = getopt(argc, argv, "bc:d:th?f:s:")) != -1) {
       switch (ch) {
       case 'c':                    /* configuration file */
-         if (configfile != NULL) {
-            free(configfile);
-         }
-         configfile = bstrdup(optarg);
-         break;
+        if (configfile != NULL) {
+           free(configfile);
+        }
+        configfile = bstrdup(optarg);
+        break;
 
       case 'd':
-         debug_level = atoi(optarg);
-         if (debug_level <= 0) {
-            debug_level = 1;
-         }
-         break;
+        debug_level = atoi(optarg);
+        if (debug_level <= 0) {
+           debug_level = 1;
+        }
+        break;
 
       case 't':
-         test_config = true;
-         break;
+        test_config = true;
+        break;
 
       case 'h':
       case '?':
       default:
-         usage();
-         exit(1);
-      }  
+        usage();
+        exit(1);
+      }
    }
    argc -= optind;
    //argv += optind;
@@ -201,7 +233,7 @@ int main(int argc, char *argv[])
    }
 
    parse_config(configfile);
-   
+
    LockRes();
    nitems = 0;
    foreach_res(monitor, R_MONITOR) {
@@ -209,10 +241,10 @@ int main(int argc, char *argv[])
    }
 
    if (nitems != 1) {
-      Emsg2(M_ERROR_TERM, 0, 
-         _("Error: %d Monitor resource defined in %s. You must define one and only one Monitor resource.\n"), nitems, configfile);
+      Emsg2(M_ERROR_TERM, 0,
+        _("Error: %d Monitor resource defined in %s. You must define one and only one Monitor resource.\n"), nitems, configfile);
    }
-         
+
    nitems = 0;
    foreach_res(dird, R_DIRECTOR) {
       items[nitems].type = R_DIRECTOR;
@@ -239,34 +271,34 @@ int main(int argc, char *argv[])
       nitems++;
    }
    UnlockRes();
-     
+
    if (nitems == 0) {
-      Emsg1(M_ERROR_TERM, 0, _("No Client, Storage nor Director resource defined in %s\n\
-Without that I don't how to get status from the File, Storage or Director Daemon :-(\n"), configfile);
+      Emsg1(M_ERROR_TERM, 0, _("No Client, Storage nor Director resource defined in %s\n"
+"Without that I don't how to get status from the File, Storage or Director Daemon :-(\n"), configfile);
    }
 
    if (test_config) {
       exit(0);
    }
-   
+
    //Copy the content of xpm_generic in xpm_generic_var to be able to modify it
    g_assert((xpm_generic_var = (char**)g_malloc(sizeof(xpm_generic))));
    for (i = 0; i < (int)(sizeof(xpm_generic)/sizeof(const char*)); i++) {
-      g_assert((xpm_generic_var[i] = (char*)g_malloc(strlen(xpm_generic[i])*sizeof(char))));
+      g_assert((xpm_generic_var[i] = (char*)g_malloc((strlen(xpm_generic[i])+1)*sizeof(char))));
       strcpy(xpm_generic_var[i], xpm_generic[i]);
    }
-   
+
    (void)WSA_Init();                /* Initialize Windows sockets */
-   
+
    LockRes();
    monitor = (MONITOR*)GetNextRes(R_MONITOR, (RES *)NULL);
    UnlockRes();
-   
+
    if ((monitor->RefreshInterval < 1) || (monitor->RefreshInterval > 600)) {
-      Emsg2(M_ERROR_TERM, 0, _("Invalid refresh interval defined in %s\n\
-This value must be greater or equal to 1 second and less or equal to 10 minutes (read value: %d).\n"), configfile, monitor->RefreshInterval);
+      Emsg2(M_ERROR_TERM, 0, _("Invalid refresh interval defined in %s\n"
+"This value must be greater or equal to 1 second and less or equal to 10 minutes (read value: %d).\n"), configfile, monitor->RefreshInterval);
    }
-   
+
    GdkPixbuf* pixbuf = gdk_pixbuf_new_from_xpm_data(generateXPM(warn, warn));
    // This should be ideally replaced by a completely libpr0n-based icon rendering.
    mTrayIcon = egg_status_icon_new_from_pixbuf(pixbuf);
@@ -275,92 +307,92 @@ This value must be greater or equal to 1 second and less or equal to 10 minutes
    g_object_unref(G_OBJECT(pixbuf));
 
    mTrayMenu = gtk_menu_new();
-   
+
    GtkWidget *entry;
-   
+
    entry = gtk_menu_item_new_with_label("Open status window...");
    g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(TrayIconActivate), NULL);
    gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), entry);
-      
+
    gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), gtk_separator_menu_item_new());
-   
+
    entry = gtk_menu_item_new_with_label("Exit");
    g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(TrayIconExit), NULL);
    gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), entry);
-   
+
    gtk_widget_show_all(mTrayMenu);
-   
+
    timerTag = g_timeout_add( 1000*monitor->RefreshInterval/nitems, fd_read, NULL );
-   
+
    g_timeout_add( 1000, blink, NULL );
-   
+
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-   
+
    gtk_window_set_title(GTK_WINDOW(window), "Bacula tray monitor");
-   
+
    g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL);
    //g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL);
-   
+
    gtk_container_set_border_width(GTK_CONTAINER(window), 10);
-   
+
    GtkWidget* vbox = gtk_vbox_new(FALSE, 10);
-   
+
    GtkWidget* daemon_table = gtk_table_new((nitems*2)+2, 3, FALSE);
-   
+
    gtk_table_set_col_spacings(GTK_TABLE(daemon_table), 8);
-   
+
    GtkWidget* separator = gtk_hseparator_new();
    gtk_table_attach_defaults(GTK_TABLE(daemon_table), separator, 0, 3, 0, 1);
-      
+
    GString *str;
    GSList *group = NULL;
    GtkWidget* radio;
    GtkWidget* align;
-   
+
    for (int i = 0; i < nitems; i++) {
       switch (items[i].type) {
       case R_DIRECTOR:
-         str = g_string_new(((DIRRES*)(items[i].resource))->hdr.name);
-         g_string_append(str, _(" (DIR)"));
-         break;
+        str = g_string_new(((DIRRES*)(items[i].resource))->hdr.name);
+        g_string_append(str, _(" (DIR)"));
+        break;
       case R_CLIENT:
-         str = g_string_new(((CLIENT*)(items[i].resource))->hdr.name);
-         g_string_append(str, _(" (FD)"));
-         break;
+        str = g_string_new(((CLIENT*)(items[i].resource))->hdr.name);
+        g_string_append(str, _(" (FD)"));
+        break;
       case R_STORAGE:
-         str = g_string_new(((STORE*)(items[i].resource))->hdr.name);
-         g_string_append(str, _(" (SD)"));
-         break;
+        str = g_string_new(((STORE*)(items[i].resource))->hdr.name);
+        g_string_append(str, _(" (SD)"));
+        break;
       default:
-         continue;
+        continue;
       }
-      
+
       radio = gtk_radio_button_new_with_label(group, str->str);
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), i == 0);
       g_signal_connect(G_OBJECT(radio), "toggled", G_CALLBACK(DaemonChanged), &(items[i]));
-      
+
       pixbuf = gdk_pixbuf_new_from_xpm_data(generateXPM(warn, warn));
       items[i].image = gtk_image_new_from_pixbuf(pixbuf);
-      
+
       items[i].label =  gtk_label_new(_("Unknown status."));
       align = gtk_alignment_new(0.0, 0.5, 0.0, 1.0);
       gtk_container_add(GTK_CONTAINER(align), items[i].label);
-            
-      gtk_table_attach(GTK_TABLE(daemon_table), radio, 0, 1, (i*2)+1, (i*2)+2, 
-         GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-      gtk_table_attach(GTK_TABLE(daemon_table), items[i].image, 1, 2, (i*2)+1, (i*2)+2, 
-         GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-      gtk_table_attach(GTK_TABLE(daemon_table), align, 2, 3, (i*2)+1, (i*2)+2, 
-         (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-   
+
+      gtk_table_attach(GTK_TABLE(daemon_table), radio, 0, 1, (i*2)+1, (i*2)+2,
+        GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+      gtk_table_attach(GTK_TABLE(daemon_table), items[i].image, 1, 2, (i*2)+1, (i*2)+2,
+        GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+      gtk_table_attach(GTK_TABLE(daemon_table), align, 2, 3, (i*2)+1, (i*2)+2,
+        (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+
       separator = gtk_hseparator_new();
       gtk_table_attach_defaults(GTK_TABLE(daemon_table), separator, 0, 3, (i*2)+2, (i*2)+3);
-      
+
       group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio));
    }
-   
+
    gtk_box_pack_start(GTK_BOX(vbox), daemon_table, FALSE, FALSE, 0);
-   
+
    textview = gtk_text_view_new();
 
    buffer = gtk_text_buffer_new(NULL);
@@ -370,16 +402,16 @@ This value must be greater or equal to 1 second and less or equal to 10 minutes
    PangoFontDescription *font_desc = pango_font_description_from_string ("Fixed 10");
    gtk_widget_modify_font(textview, font_desc);
    pango_font_description_free(font_desc);
-   
+
    gtk_text_view_set_left_margin(GTK_TEXT_VIEW(textview), 20);
    gtk_text_view_set_right_margin(GTK_TEXT_VIEW(textview), 20);
-   
+
    gtk_text_view_set_editable(GTK_TEXT_VIEW(textview), FALSE);
-   
+
    gtk_text_view_set_buffer(GTK_TEXT_VIEW(textview), buffer);
-   
+
    gtk_box_pack_start(GTK_BOX(vbox), textview, TRUE, TRUE, 0);
-   
+
    GtkWidget* hbox = gtk_hbox_new(FALSE, 10);
 
    GtkWidget* hbox2 = gtk_hbox_new(FALSE, 0);
@@ -390,44 +422,55 @@ This value must be greater or equal to 1 second and less or equal to 10 minutes
    g_signal_connect(G_OBJECT(timeoutspinner), "value-changed", G_CALLBACK(IntervalChanged), NULL);
    gtk_box_pack_start(GTK_BOX(hbox2), timeoutspinner, TRUE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), hbox2, TRUE, FALSE, 0);
-   
+
    GtkWidget* button = new_image_button("gtk-refresh", _("Refresh now"));
    g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(MonitorRefresh), NULL);
    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-   
+
    button = new_image_button("gtk-help", _("About"));
    g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(MonitorAbout), NULL);
    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-   
+
    button = new_image_button("gtk-close", _("Close"));
-   g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window)); 
+   g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window));
    gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-   
+
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-   
+
    gtk_container_add(GTK_CONTAINER (window), vbox);
-   
+
    gtk_widget_show_all(vbox);
-   
+
    gtk_main();
-      
+   
+   g_source_remove(timerTag);
+   
+   sm_line = 0;
+
    for (i = 0; i < nitems; i++) {
       if (items[i].D_sock) {
-         writecmd(&items[i], "quit");
-         bnet_sig(items[i].D_sock, BNET_TERMINATE); /* send EOF */
-         bnet_close(items[i].D_sock);
+        writecmd(&items[i], "quit");
+        bnet_sig(items[i].D_sock, BNET_TERMINATE); /* send EOF */
+        bnet_close(items[i].D_sock);
       }
    }
 
-   free_pool_memory(args);
    (void)WSACleanup();              /* Cleanup Windows sockets */
-   
+
    //Free xpm_generic_var
    for (i = 0; i < (int)(sizeof(xpm_generic)/sizeof(const char*)); i++) {
       g_free(xpm_generic_var[i]);
    }
    g_free(xpm_generic_var);
    
+   gtk_object_destroy(GTK_OBJECT(window));
+   gtk_object_destroy(GTK_OBJECT(mTrayMenu));
+   term_msg();
+
+#if TRAY_DEBUG_MEMORY
+   sm_dump(false);
+#endif
+   
    return 0;
 }
 
@@ -445,7 +488,7 @@ static void MonitorAbout(GtkWidget *widget, gpointer data) {
       "Copyright (C) 2004 Kern Sibbald and John Walker\n"
       "Written by Nicolas Boichat\n"
       "\nVersion: " VERSION " (" BDATE ") %s %s %s"
-   ), HOST_OS, DISTNAME, DISTVER); 
+   ), HOST_OS, DISTNAME, DISTVER);
 #endif
    gtk_dialog_run(GTK_DIALOG(about));
    gtk_widget_destroy(about);
@@ -458,8 +501,8 @@ static void MonitorRefresh(GtkWidget *widget, gpointer data) {
 }
 
 static gboolean delete_event( GtkWidget *widget,
-                              GdkEvent  *event,
-                              gpointer   data ) {
+                             GdkEvent  *event,
+                             gpointer   data ) {
    gtk_widget_hide(window);
    return TRUE; /* do not destroy the window */
 }
@@ -481,7 +524,7 @@ static void IntervalChanged(GtkWidget *widget, gpointer data) {
    g_source_remove(timerTag);
    timerTag = g_timeout_add(
       (guint)(
-         gtk_spin_button_get_value(GTK_SPIN_BUTTON(timeoutspinner))*1000/nitems
+        gtk_spin_button_get_value(GTK_SPIN_BUTTON(timeoutspinner))*1000/nitems
       ), fd_read, NULL );
 }
 
@@ -489,10 +532,10 @@ static void DaemonChanged(GtkWidget *widget, monitoritem* data) {
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
       fullitem = -1;
       for (int i = 0; i < nitems; i++) {
-         if (data == &(items[i])) {
-            fullitem = i;
-            break;
-         }
+        if (data == &(items[i])) {
+           fullitem = i;
+           break;
+        }
       }
       g_return_if_fail(fullitem != -1);
 
@@ -507,7 +550,7 @@ static int authenticate_daemon(monitoritem* item, JCR *jcr) {
    switch (item->type) {
    case R_DIRECTOR:
       return authenticate_director(jcr, monitor, (DIRRES*)item->resource);
-      break;      
+      break;
    case R_CLIENT:
       return authenticate_file_daemon(jcr, monitor, (CLIENT*)item->resource);
       break;
@@ -531,61 +574,69 @@ static gboolean blink(gpointer data) {
 }
 
 static gboolean fd_read(gpointer data) {
-   GtkTextBuffer *newbuffer = gtk_text_buffer_new(NULL);
+   sm_line++;
+#if TRAY_DEBUG_MEMORY
+   printf("sm_line=%d\n", sm_line);
+#endif
+   GtkTextBuffer *newbuffer;
    GtkTextIter start, stop, nstart, nstop;
 
    GSList *list, *it;
-   
+
    GString *strlast, *strcurrent;
-   
+
    lastupdated++;
    if (lastupdated == nitems) {
       lastupdated = 0;
    }
-     
+
    if (lastupdated == fullitem) {
+      newbuffer = gtk_text_buffer_new(NULL);
+      
       if (items[lastupdated].type == R_DIRECTOR)
-         docmd(&items[lastupdated], "status Director\n", &list);
+        docmd(&items[lastupdated], "status Director\n", &list);
       else
-         docmd(&items[lastupdated], "status\n", &list);
-      
+        docmd(&items[lastupdated], "status\n", &list);
+
       it = list->next;
       do {
-         gtk_text_buffer_get_end_iter(newbuffer, &stop);
-         gtk_text_buffer_insert (newbuffer, &stop, ((GString*)it->data)->str, -1);
-         if (it->data) g_string_free((GString*)it->data, TRUE);
+        gtk_text_buffer_get_end_iter(newbuffer, &stop);
+        gtk_text_buffer_insert (newbuffer, &stop, ((GString*)it->data)->str, -1);
+        if (it->data) g_string_free((GString*)it->data, TRUE);
       } while ((it = it->next) != NULL);
-         
+
+      g_slist_free(list);
+            
       /* Keep the selection if necessary */
       if (gtk_text_buffer_get_selection_bounds(buffer, &start, &stop)) {
-         gtk_text_buffer_get_iter_at_offset(newbuffer, &nstart, gtk_text_iter_get_offset(&start));
-         gtk_text_buffer_get_iter_at_offset(newbuffer, &nstop,  gtk_text_iter_get_offset(&stop ));
-         
+        gtk_text_buffer_get_iter_at_offset(newbuffer, &nstart, gtk_text_iter_get_offset(&start));
+        gtk_text_buffer_get_iter_at_offset(newbuffer, &nstop,  gtk_text_iter_get_offset(&stop ));
+
    #if HAVE_GTK_2_4
-         gtk_text_buffer_select_range(newbuffer, &nstart, &nstop);
+        gtk_text_buffer_select_range(newbuffer, &nstart, &nstop);
    #else
-         gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "insert"), &nstart);
-         gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "selection_bound"), &nstop);
+        gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "insert"), &nstart);
+        gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "selection_bound"), &nstop);
    #endif
       }
-   
+
       g_object_unref(buffer);
-      
+
       buffer = newbuffer;
       gtk_text_view_set_buffer(GTK_TEXT_VIEW(textview), buffer);
    }
-   
+
    getstatus(&items[lastupdated], 1, &strcurrent);
    getstatus(&items[lastupdated], 0, &strlast);
    updateStatusIcon(&items[lastupdated]);
-     
+
    changeStatusMessage(&items[lastupdated], "Current job: %s\nLast job: %s", strcurrent->str, strlast->str);
-   
+
    updateStatusIcon(NULL);
-   
+
    g_string_free(strcurrent, TRUE);
    g_string_free(strlast, TRUE);
-      
+
    return 1;
 }
 
@@ -596,136 +647,136 @@ void getstatus(monitoritem* item, int current, GString** str) {
    char jobstatus = JS_ErrorTerminated;
    char num;
    int k;
-   
+
    *str = g_string_sized_new(128);
-   
+
    if (current) {
       if (item->type == R_DIRECTOR)
-         docmd(&items[lastupdated], ".status dir current\n", &list);
+        docmd(&items[lastupdated], ".status dir current\n", &list);
       else
-         docmd(&items[lastupdated], ".status current\n", &list);
+        docmd(&items[lastupdated], ".status current\n", &list);
    }
    else {
       if (item->type == R_DIRECTOR)
-         docmd(&items[lastupdated], ".status dir last\n", &list);
+        docmd(&items[lastupdated], ".status dir last\n", &list);
       else
-         docmd(&items[lastupdated], ".status last\n", &list);
+        docmd(&items[lastupdated], ".status last\n", &list);
    }
 
    it = list->next;
    if ((it == NULL) || (sscanf(((GString*)it->data)->str, OKqstatus, &num) != 1)) {
       g_string_append_printf(*str, ".status error : %s", (it == NULL) ? "" : ((GString*)it->data)->str);
       while (((*str)->str[(*str)->len-1] == '\n') || ((*str)->str[(*str)->len-1] == '\r')) {
-         g_string_set_size(*str, (*str)->len-1);
+        g_string_set_size(*str, (*str)->len-1);
       }
       ret = error;
    }
    else if ((it = it->next) == NULL) {
       if (current) {
-         g_string_append(*str, _("No current job."));
+        g_string_append(*str, _("No current job."));
       }
       else {
-         g_string_append(*str, _("No last job."));
+        g_string_append(*str, _("No last job."));
       }
       ret = idle;
    }
    else if ((k = sscanf(((GString*)it->data)->str, DotStatusJob, &jobid, &jobstatus, &joberrors)) == 3) {
       switch (jobstatus) {
       case JS_Created:
-         ret = (joberrors > 0) ? warn : running;
-         g_string_append_printf(*str, _("Job status: Created (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         break;
+        ret = (joberrors > 0) ? warn : running;
+        g_string_append_printf(*str, _("Job status: Created (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        break;
       case JS_Running:
-         ret = (joberrors > 0) ? warn : running;
-         g_string_append_printf(*str, _("Job status: Running (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         break;
+        ret = (joberrors > 0) ? warn : running;
+        g_string_append_printf(*str, _("Job status: Running (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        break;
       case JS_Blocked:
-         g_string_append_printf(*str, _("Job status: Blocked (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Blocked (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_Terminated:
-         g_string_append_printf(*str, _("Job status: Terminated (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = (joberrors > 0) ? warn : idle;
-         break;
+        g_string_append_printf(*str, _("Job status: Terminated (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = (joberrors > 0) ? warn : idle;
+        break;
       case JS_ErrorTerminated:
-         g_string_append_printf(*str, _("Job status: Terminated in error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = error;
-         break;
+        g_string_append_printf(*str, _("Job status: Terminated in error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = error;
+        break;
       case JS_Error:
-         ret = (joberrors > 0) ? warn : running;
-         g_string_append_printf(*str, _("Job status: Error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         break;
+        ret = (joberrors > 0) ? warn : running;
+        g_string_append_printf(*str, _("Job status: Error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        break;
       case JS_FatalError:
-         g_string_append_printf(*str, _("Job status: Fatal error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = error;
-         break;
+        g_string_append_printf(*str, _("Job status: Fatal error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = error;
+        break;
       case JS_Differences:
-         g_string_append_printf(*str, _("Job status: Verify differences (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Verify differences (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_Canceled:
-         g_string_append_printf(*str, _("Job status: Canceled (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Canceled (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitFD:
-         g_string_append_printf(*str, _("Job status: Waiting on File daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting on File daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitSD:
-         g_string_append_printf(*str, _("Job status: Waiting on the Storage daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting on the Storage daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitMedia:
-         g_string_append_printf(*str, _("Job status: Waiting for new media (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for new media (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitMount:
-         g_string_append_printf(*str, _("Job status: Waiting for Mount (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for Mount (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitStoreRes:
-         g_string_append_printf(*str, _("Job status: Waiting for storage resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for storage resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitJobRes:
-         g_string_append_printf(*str, _("Job status: Waiting for job resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for job resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitClientRes:
-         g_string_append_printf(*str, _("Job status: Waiting for Client resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for Client resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitMaxJobs:
-         g_string_append_printf(*str, _("Job status: Waiting for maximum jobs (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for maximum jobs (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitStartTime:
-         g_string_append_printf(*str, _("Job status: Waiting for start time (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for start time (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       case JS_WaitPriority:
-         g_string_append_printf(*str, _("Job status: Waiting for higher priority jobs to finish (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_string_append_printf(*str, _("Job status: Waiting for higher priority jobs to finish (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       default:
-         g_warning("Unknown job status %c.", jobstatus);
-         g_string_append_printf(*str, _("Job status: Unknown(%c) (%d error%s)"), jobstatus, joberrors, (joberrors > 1) ? "s" : "");
-         ret = warn;
-         break;
+        g_warning("Unknown job status %c.", jobstatus);
+        g_string_append_printf(*str, _("Job status: Unknown(%c) (%d error%s)"), jobstatus, joberrors, (joberrors > 1) ? "s" : "");
+        ret = warn;
+        break;
       }
    }
    else {
       fprintf(stderr, "Bad scan : '%s' %d\n", (it == NULL) ? "" : ((GString*)it->data)->str, k);
       ret = error;
    }
-      
+
    it = list;
    do {
       if (it->data) g_string_free((GString*)it->data, TRUE);
    } while ((it = it->next) != NULL);
-   
+
    g_slist_free(list);
-   
+
    if (current) {
       item->state = ret;
    }
@@ -737,142 +788,142 @@ void getstatus(monitoritem* item, int current, GString** str) {
 int docmd(monitoritem* item, const char* command, GSList** list) {
    int stat;
    GString* str = NULL;
-   
+
    *list = g_slist_alloc();
 
    //str = g_string_sized_new(64);
-   
+
    if (!item->D_sock) {
       memset(&jcr, 0, sizeof(jcr));
-      
+
       DIRRES* dird;
       CLIENT* filed;
       STORE* stored;
-      
+
       switch (item->type) {
       case R_DIRECTOR:
-         dird = (DIRRES*)item->resource;      
-         trayMessage("Connecting to Director %s:%d\n", dird->address, dird->DIRport);
-         changeStatusMessage(item, "Connecting to Director %s:%d", dird->address, dird->DIRport);
-         item->D_sock = bnet_connect(NULL, 0, 0, "Director daemon", dird->address, NULL, dird->DIRport, 0);
-         jcr.dir_bsock = item->D_sock;
-         break;
+        dird = (DIRRES*)item->resource;
+        trayMessage("Connecting to Director %s:%d\n", dird->address, dird->DIRport);
+        changeStatusMessage(item, "Connecting to Director %s:%d", dird->address, dird->DIRport);
+        item->D_sock = bnet_connect(NULL, 0, 0, "Director daemon", dird->address, NULL, dird->DIRport, 0);
+        jcr.dir_bsock = item->D_sock;
+        break;
       case R_CLIENT:
-         filed = (CLIENT*)item->resource;      
-         trayMessage("Connecting to Client %s:%d\n", filed->address, filed->FDport);
-         changeStatusMessage(item, "Connecting to Client %s:%d", filed->address, filed->FDport);
-         item->D_sock = bnet_connect(NULL, 0, 0, "File daemon", filed->address, NULL, filed->FDport, 0);
-         jcr.file_bsock = item->D_sock;
-         break;
+        filed = (CLIENT*)item->resource;
+        trayMessage("Connecting to Client %s:%d\n", filed->address, filed->FDport);
+        changeStatusMessage(item, "Connecting to Client %s:%d", filed->address, filed->FDport);
+        item->D_sock = bnet_connect(NULL, 0, 0, "File daemon", filed->address, NULL, filed->FDport, 0);
+        jcr.file_bsock = item->D_sock;
+        break;
       case R_STORAGE:
-         stored = (STORE*)item->resource;      
-         trayMessage("Connecting to Storage %s:%d\n", stored->address, stored->SDport);
-         changeStatusMessage(item, "Connecting to Storage %s:%d", stored->address, stored->SDport);
-         item->D_sock = bnet_connect(NULL, 0, 0, "Storage daemon", stored->address, NULL, stored->SDport, 0);
-         jcr.store_bsock = item->D_sock;
-         break;
+        stored = (STORE*)item->resource;
+        trayMessage("Connecting to Storage %s:%d\n", stored->address, stored->SDport);
+        changeStatusMessage(item, "Connecting to Storage %s:%d", stored->address, stored->SDport);
+        item->D_sock = bnet_connect(NULL, 0, 0, "Storage daemon", stored->address, NULL, stored->SDport, 0);
+        jcr.store_bsock = item->D_sock;
+        break;
       default:
-         printf("Error, currentitem is not a Client, a Storage or a Director..\n");
-         gtk_main_quit();
-         return 0;
+        printf("Error, currentitem is not a Client, a Storage or a Director..\n");
+        gtk_main_quit();
+        return 0;
       }
-      
+
       if (item->D_sock == NULL) {
-         g_slist_append(*list, g_string_new("Cannot connect to daemon.\n"));
-         changeStatusMessage(item, "Cannot connect to daemon.");
-         item->state = error;
-         item->oldstate = error;
-         return 0;
+        g_slist_append(*list, g_string_new("Cannot connect to daemon.\n"));
+        changeStatusMessage(item, "Cannot connect to daemon.");
+        item->state = error;
+        item->oldstate = error;
+        return 0;
       }
-      
+
       if (!authenticate_daemon(item, &jcr)) {
-         str = g_string_sized_new(64);
-         g_string_printf(str, "ERR=%s\n", item->D_sock->msg);
-         g_slist_append(*list, str);
-         item->state = error;
-         item->oldstate = error;
-         changeStatusMessage(item, "Authentication error : %s", item->D_sock->msg);
-         item->D_sock = NULL;
-         return 0;
+        str = g_string_sized_new(64);
+        g_string_printf(str, "ERR=%s\n", item->D_sock->msg);
+        g_slist_append(*list, str);
+        item->state = error;
+        item->oldstate = error;
+        changeStatusMessage(item, "Authentication error : %s", item->D_sock->msg);
+        item->D_sock = NULL;
+        return 0;
       }
-      
+
       switch (item->type) {
       case R_DIRECTOR:
-         trayMessage("Opened connection with Director daemon.\n");
-         changeStatusMessage(item, "Opened connection with Director daemon.");
-         break;
+        trayMessage("Opened connection with Director daemon.\n");
+        changeStatusMessage(item, "Opened connection with Director daemon.");
+        break;
       case R_CLIENT:
-         trayMessage("Opened connection with File daemon.\n");
-         changeStatusMessage(item, "Opened connection with File daemon.");
-         break;
+        trayMessage("Opened connection with File daemon.\n");
+        changeStatusMessage(item, "Opened connection with File daemon.");
+        break;
       case R_STORAGE:
-         trayMessage("Opened connection with Storage daemon.\n");
-         changeStatusMessage(item, "Opened connection with Storage daemon.");
-         break;
+        trayMessage("Opened connection with Storage daemon.\n");
+        changeStatusMessage(item, "Opened connection with Storage daemon.");
+        break;
       default:
-         printf("Error, currentitem is not a Client, a Storage or a Director..\n");
-         gtk_main_quit();
-         return 0;
-         break;
+        printf("Error, currentitem is not a Client, a Storage or a Director..\n");
+        gtk_main_quit();
+        return 0;
+        break;
       }
-      
+
       if (item->type == R_DIRECTOR) { /* Read connection messages... */
-         GSList *list, *it;
-         docmd(item, "", &list); /* Usually invalid, but no matter */
-         it = list;
-         do {
-            if (it->data) g_string_free((GString*)it->data, TRUE);
-         } while ((it = it->next) != NULL);
-         
-         g_slist_free(list);         
+        GSList *list, *it;
+        docmd(item, "", &list); /* Usually invalid, but no matter */
+        it = list;
+        do {
+           if (it->data) g_string_free((GString*)it->data, TRUE);
+        } while ((it = it->next) != NULL);
+
+        g_slist_free(list);
       }
    }
-   
+
    if (command[0] != 0)
       writecmd(item, command);
-   
+
    while(1) {
       if ((stat = bnet_recv(item->D_sock)) >= 0) {
-         g_slist_append(*list, g_string_new(item->D_sock->msg));
+        g_slist_append(*list, g_string_new(item->D_sock->msg));
       }
       else if (stat == BNET_SIGNAL) {
-         if (item->D_sock->msglen == BNET_EOD) {
-            //fprintf(stderr, "<< EOD >>\n");
-            return 1;
-         }
-         else if (item->D_sock->msglen == BNET_PROMPT) {
-            //fprintf(stderr, "<< PROMPT >>\n");
-            g_slist_append(*list, g_string_new("<< Error: BNET_PROMPT signal received. >>\n"));
-            return 0;
-         }
-         else if (item->D_sock->msglen == BNET_HEARTBEAT) {
-            bnet_sig(item->D_sock, BNET_HB_RESPONSE);
-            g_slist_append(*list, g_string_new("<< Heartbeat signal received, answered. >>\n"));
-         }
-         else {
-            str = g_string_sized_new(64);
-            g_string_printf(str, "<< Unexpected signal received : %s >>\n", bnet_sig_to_ascii(item->D_sock));
-            g_slist_append(*list, str);
-         }
+        if (item->D_sock->msglen == BNET_EOD) {
+           //fprintf(stderr, "<< EOD >>\n");
+           return 1;
+        }
+        else if (item->D_sock->msglen == BNET_PROMPT) {
+           //fprintf(stderr, "<< PROMPT >>\n");
+           g_slist_append(*list, g_string_new("<< Error: BNET_PROMPT signal received. >>\n"));
+           return 0;
+        }
+        else if (item->D_sock->msglen == BNET_HEARTBEAT) {
+           bnet_sig(item->D_sock, BNET_HB_RESPONSE);
+           g_slist_append(*list, g_string_new("<< Heartbeat signal received, answered. >>\n"));
+        }
+        else {
+           str = g_string_sized_new(64);
+           g_string_printf(str, "<< Unexpected signal received : %s >>\n", bnet_sig_to_ascii(item->D_sock));
+           g_slist_append(*list, str);
+        }
       }
       else { /* BNET_HARDEOF || BNET_ERROR */
-         g_slist_append(*list, g_string_new("<ERROR>\n"));
-         item->D_sock = NULL;
-         item->state = error;
-         item->oldstate = error;
-         changeStatusMessage(item, "Error : BNET_HARDEOF or BNET_ERROR");
-         //fprintf(stderr, "<< ERROR >>\n");
-         return 0;
+        g_slist_append(*list, g_string_new("<ERROR>\n"));
+        item->D_sock = NULL;
+        item->state = error;
+        item->oldstate = error;
+        changeStatusMessage(item, "Error : BNET_HARDEOF or BNET_ERROR");
+        //fprintf(stderr, "<< ERROR >>\n");
+        return 0;
       }
-           
+
       if (is_bnet_stop(item->D_sock)) {
-         g_string_append_printf(str, "<STOP>\n");
-         item->D_sock = NULL;
-         item->state = error;
-         item->oldstate = error;
-         changeStatusMessage(item, "Error : Connection closed.");
-         //fprintf(stderr, "<< STOP >>\n");
-         return 0;            /* error or term */
+        g_string_append_printf(str, "<STOP>\n");
+        item->D_sock = NULL;
+        item->state = error;
+        item->oldstate = error;
+        changeStatusMessage(item, "Error : Connection closed.");
+        //fprintf(stderr, "<< STOP >>\n");
+        return 0;            /* error or term */
       }
    }
 }
@@ -889,20 +940,20 @@ void writecmd(monitoritem* item, const char* command) {
 void trayMessage(const char *fmt,...) {
    char buf[512];
    va_list arg_ptr;
-   
+
    va_start(arg_ptr, fmt);
    bvsnprintf(buf, sizeof(buf), (char *)fmt, arg_ptr);
    va_end(arg_ptr);
-   
+
    fprintf(stderr, buf);
-   
+
    egg_tray_icon_send_message(egg_status_icon_get_tray_icon(mTrayIcon), 5000, (const char*)&buf, -1);
 }
 
 void changeStatusMessage(monitoritem* item, const char *fmt,...) {
    char buf[512];
    va_list arg_ptr;
-   
+
    va_start(arg_ptr, fmt);
    bvsnprintf(buf, sizeof(buf), (char *)fmt, arg_ptr);
    va_end(arg_ptr);
@@ -912,47 +963,47 @@ void changeStatusMessage(monitoritem* item, const char *fmt,...) {
 
 void updateStatusIcon(monitoritem* item) {
    const char** xpm;
-   
+
    if (item == NULL) {
       /* For the current status, select the two worse for blinking,
-         but never blink a D_Sock == NULL error with idle. */
+        but never blink a D_Sock == NULL error with idle. */
       stateenum state1, state2, oldstate;
       gboolean onenull = FALSE;
       state1 = idle;
       state2 = idle;
       oldstate = idle;
       for (int i = 0; i < nitems; i++) {
-         if (items[i].D_sock == NULL) onenull = TRUE;
-         if (items[i].state >= state1) {
-            state2 = state1;
-            state1 = items[i].state;
-         }
-         else if (items[i].state > state2) {
-            state2 = items[i].state;
-         }
-         if (items[i].oldstate > oldstate) oldstate = items[i].oldstate;
+        if (items[i].D_sock == NULL) onenull = TRUE;
+        if (items[i].state >= state1) {
+           state2 = state1;
+           state1 = items[i].state;
+        }
+        else if (items[i].state > state2) {
+           state2 = items[i].state;
+        }
+        if (items[i].oldstate > oldstate) oldstate = items[i].oldstate;
       }
-      
+
       if ((onenull == TRUE) && (state2 == idle)) {
-         state2 = error;
+        state2 = error;
       }
-                  
+
       xpm = generateXPM(blinkstate ? state1 : state2, oldstate);
    }
    else {
       if ((blinkstate) && (item->D_sock != NULL)) {
-         if (item->state > 1) { //Warning or error while running
-            xpm = generateXPM(running, item->oldstate);
-         }
-         else {
-            xpm = generateXPM(idle, item->oldstate);
-         }
+        if (item->state > 1) { //Warning or error while running
+           xpm = generateXPM(running, item->oldstate);
+        }
+        else {
+           xpm = generateXPM(idle, item->oldstate);
+        }
       }
       else {
-         xpm = generateXPM(item->state, item->oldstate);
+        xpm = generateXPM(item->state, item->oldstate);
       }
    }
-   
+
    GdkPixbuf* pixbuf = gdk_pixbuf_new_from_xpm_data(xpm);
    if (item == NULL) {
       egg_status_icon_set_from_pixbuf(mTrayIcon, pixbuf);
@@ -961,6 +1012,7 @@ void updateStatusIcon(monitoritem* item) {
    else {
       gtk_image_set_from_pixbuf(GTK_IMAGE(item->image), pixbuf);
    }
+   g_object_unref(G_OBJECT(pixbuf));
 }
 
 /* Note: result should not be stored, as it is a reference to xpm_generic_var */
@@ -980,7 +1032,7 @@ static const char** generateXPM(stateenum newstate, stateenum oldstate) {
       strcpy(address, "ffff00");
       break;
    }
-   
+
    address = &xpm_generic_var[xpm_generic_second_color][xpm_generic_column];
    switch (oldstate) {
    case error:
@@ -996,6 +1048,6 @@ static const char** generateXPM(stateenum newstate, stateenum oldstate) {
       strcpy(address, "ffff00");
       break;
    }
-   
+
    return (const char**)xpm_generic_var;
 }
index 334f54c4a9a31018cd0e659e3777d4321a6aa065..4e33daafb50214e050468ad75d6a76825bdc6ec1 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include <gtk/gtk.h>
+
 #include "tray_conf.h"
 
 #include "jcr.h"
index 0c53f17d00f22d4e3e1532d993a2e3cbb25a8a36..8aaea718dfd5b9076032e8000e900ea5fe90f8de 100644 (file)
@@ -7,7 +7,7 @@
 *
 *   1. The generic lexical scanner in lib/lex.c and lib/lex.h
 *
-*   2. The generic config  scanner in lib/parse_config.c and 
+*   2. The generic config  scanner in lib/parse_config.c and
 *      lib/parse_config.h.
 *      These files contain the parser code, some utility
 *      routines, and the common store routines (name, int,
@@ -63,10 +63,10 @@ int  res_all_size = sizeof(res_all);
 
 
 /* Definition of records permitted within each
-* resource with the routine to process the record 
+* resource with the routine to process the record
 * information.  NOTE! quoted names must be in lower case.
-*/ 
-/* 
+*/
+/*
 *    Monitor Resource
 *
 *   name          handler     value                 code flags    default_value
@@ -89,10 +89,10 @@ static RES_ITEM dir_items[] = {
    {"dirport",     store_int,      ITEM(res_dir.DIRport),  0, ITEM_DEFAULT, 9101},
    {"address",     store_str,      ITEM(res_dir.address),  0, 0, 0},
    {"enablessl",   store_yesno,    ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0},
-   {NULL, NULL, NULL, 0, 0, 0} 
+   {NULL, NULL, NULL, 0, 0, 0}
 };
 
-/* 
+/*
 *    Client or File daemon resource
 *
 *   name          handler     value                 code flags    default_value
@@ -105,7 +105,7 @@ static RES_ITEM cli_items[] = {
    {"fdport",   store_pint,       ITEM(res_client.FDport),   0, ITEM_DEFAULT, 9102},
    {"password", store_password,   ITEM(res_client.password), 0, ITEM_REQUIRED, 0},
    {"enablessl", store_yesno,     ITEM(res_client.enable_ssl), 1, ITEM_DEFAULT, 0},
-   {NULL, NULL, NULL, 0, 0, 0} 
+   {NULL, NULL, NULL, 0, 0, 0}
 };
 
 /* Storage daemon resource
@@ -121,11 +121,11 @@ static RES_ITEM store_items[] = {
    {"password",    store_password, ITEM(res_store.password),   0, ITEM_REQUIRED, 0},
    {"sdpassword",  store_password, ITEM(res_store.password),   0, 0, 0},
    {"enablessl",   store_yesno,    ITEM(res_store.enable_ssl),  1, ITEM_DEFAULT, 0},
-   {NULL, NULL, NULL, 0, 0, 0} 
+   {NULL, NULL, NULL, 0, 0, 0}
 };
 
-/* 
-* This is the master resource definition.  
+/*
+* This is the master resource definition.
 * It must have one item for each of the resources.
 *
 *  NOTE!!! keep it in the same order as the R_codes
@@ -158,8 +158,8 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
    }
    switch (type) {
    case R_MONITOR:
-      sendit(sock, "Monitor: name=%s FDtimeout=%s SDtimeout=%s\n", 
-   reshdr->name, 
+      sendit(sock, "Monitor: name=%s FDtimeout=%s SDtimeout=%s\n",
+   reshdr->name,
    edit_uint64(res->res_monitor.FDConnectTimeout, ed1),
    edit_uint64(res->res_monitor.SDConnectTimeout, ed2));
       break;
@@ -185,10 +185,10 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
 }
 
 
-/* 
+/*
 * Free memory of resource -- called when daemon terminates.
 * NB, we don't need to worry about freeing any references
-* to other resources as they will be freed when that 
+* to other resources as they will be freed when that
 * resource chain is traversed.  Mainly we worry about freeing
 * allocated strings (names).
 */
@@ -243,7 +243,7 @@ void free_resource(RES *sres, int type)
 /*
 * Save the new resource by chaining it into the head list for
 * the resource. If this is pass 2, we update any resource
-* pointers because they may not have been defined until 
+* pointers because they may not have been defined until
 * later in pass 1.
 */
 void save_resource(int type, RES_ITEM *items, int pass)
@@ -252,25 +252,25 @@ void save_resource(int type, RES_ITEM *items, int pass)
    int rindex = type - r_first;
    int i, size;
    int error = 0;
-   
-   /* 
+
+   /*
    * Ensure that all required items are present
    */
    for (i=0; items[i].name; i++) {
       if (items[i].flags & ITEM_REQUIRED) {
-         if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) {
-               Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
-                  items[i].name, resources[rindex]);
-         }
+        if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) {
+              Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+                 items[i].name, resources[rindex]);
+        }
       }
       /* If this triggers, take a look at lib/parse_conf.h */
       if (i >= MAX_RES_ITEMS) {
-         Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
+        Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
       }
    }
 
    /*
-   * During pass 2 in each "store" routine, we looked up pointers 
+   * During pass 2 in each "store" routine, we looked up pointers
    * to all the resources referrenced in the current resource, now we
    * must copy their addresses from the static record to the allocated
    * record.
@@ -282,28 +282,28 @@ void save_resource(int type, RES_ITEM *items, int pass)
       case R_CLIENT:
       case R_STORAGE:
       case R_DIRECTOR:
-         break;
+        break;
       default:
-         Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
-         error = 1;
-         break;
+        Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
+        error = 1;
+        break;
       }
       /* Note, the resource name was already saved during pass 1,
       * so here, we can just release it.
       */
       if (res_all.res_monitor.hdr.name) {
-         free(res_all.res_monitor.hdr.name);
-         res_all.res_monitor.hdr.name = NULL;
+        free(res_all.res_monitor.hdr.name);
+        res_all.res_monitor.hdr.name = NULL;
       }
       if (res_all.res_monitor.hdr.desc) {
-         free(res_all.res_monitor.hdr.desc);
-         res_all.res_monitor.hdr.desc = NULL;
+        free(res_all.res_monitor.hdr.desc);
+        res_all.res_monitor.hdr.desc = NULL;
       }
       return;
    }
 
    /*
-   * The following code is only executed during pass 1   
+   * The following code is only executed during pass 1
    */
    switch (type) {
    case R_MONITOR:
@@ -316,7 +316,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
       size = sizeof(CLIENT);
       break;
    case R_STORAGE:
-      size = sizeof(STORE); 
+      size = sizeof(STORE);
       break;
    default:
       printf("Unknown resource type %d in save_resrouce.\n", type);
@@ -330,21 +330,21 @@ void save_resource(int type, RES_ITEM *items, int pass)
       memcpy(res, &res_all, size);
       if (!res_head[rindex]) {
    res_head[rindex] = (RES *)res; /* store first entry */
-         Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
-         res->res_monitor.hdr.name, rindex);
+        Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
+        res->res_monitor.hdr.name, rindex);
       } else {
    RES *next;
    /* Add new res to end of chain */
    for (next=res_head[rindex]; next->next; next=next->next) {
       if (strcmp(next->name, res->res_monitor.hdr.name) == 0) {
-         Emsg2(M_ERROR_TERM, 0,
-                  _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
-         resources[rindex].name, res->res_monitor.hdr.name);
+        Emsg2(M_ERROR_TERM, 0,
+                 _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
+        resources[rindex].name, res->res_monitor.hdr.name);
       }
    }
    next->next = (RES *)res;
-         Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
-         res->res_monitor.hdr.name, rindex, pass);
+        Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
+        res->res_monitor.hdr.name, rindex, pass);
       }
    }
 }
index 0ee985f710e66316094fbeb66d10148f78223b7c..23f7d5bef0956c590a4b4ccd64213d8cf44c6001 100644 (file)
@@ -30,7 +30,7 @@
 /* NOTE:  #includes at the end of this file */
 
 /*
- * Resource codes -- they must be sequential for indexing   
+ * Resource codes -- they must be sequential for indexing
  */
 enum rescode {
    R_MONITOR = 1001,
@@ -61,8 +61,8 @@ struct DIRRES {
    int enable_ssl;                    /* Use SSL */
 };
 
-/* 
- *   Tray Monitor Resource  
+/*
+ *   Tray Monitor Resource
  *
  */
 struct MONITOR {
@@ -91,7 +91,7 @@ struct CLIENT {
 
 /*
  *   Store Resource
- * 
+ *
  */
 struct STORE {
    RES   hdr;
index 7cc3d2a284b1e334760a7271e68227672bf6c7f3..bfffe8decaf86047fc4a26abbb52ed98afb28a67 100644 (file)
@@ -1,18 +1,18 @@
 /* */
 #undef  VERSION
-#define VERSION "1.36.1"
-#define BDATE   "24 November 2004"
-#define LSMDATE "24Nov04"
+#define VERSION "1.36.3"
+#define BDATE   "22 April 2005"
+#define LSMDATE "22Apr05"
 
 /* Debug flags */
 #undef  DEBUG
 #define DEBUG 1
 #define TRACEBACK 1
-#define SMCHECK     
-#define TRACE_FILE 1  
+#define SMCHECK
+#define TRACE_FILE 1
 
 /* If this is set stdout will not be closed on startup */
-#define DEVELOPER 1
+/* #define DEVELOPER 1 */
 
 
 
@@ -21,6 +21,7 @@
 /* #define TRACE_JCR_CHAIN 1 */
 /* #define TRACE_RES 1 */
 /* #define DEBUG_MEMSET 1 */
+/* #define DEBUG_MUTEX 1 */
 
 /* Check if header of tape block is zero before writing */
 #define DEBUG_BLOCK_ZEROING 1
@@ -33,7 +34,7 @@
 /*  #define SEND_DMSG_TO_FILE 1 */
 
 
+/* The following are turned on for performance testing */
 /* #define NO_ATTRIBUTES_TEST 1 */
 /* #define NO_TAPE_WRITE_TEST 1 */
 /* #define FD_NO_SEND TEST 1 */
-/* #define DEBUG_MUTEX 1 */
index d75e87aa8d457791fed94492d4ce5cdffdfea277..8bb6b8b70826a7faf6c07fc00b9a10bd19df3b66 100644 (file)
@@ -98,31 +98,30 @@ wchar_win32_path(const char *name, WCHAR *win32_name)
     }
 }
 
-int
-umask(int)
+int umask(int)
 {
-    return 0;
+   return 0;
 }
 
-int
-chmod(const char *, mode_t)
+int chmod(const char *, mode_t)
 {
-    return 0;
+   return 0;
 }
 
-int
-chown(const char *k, uid_t, gid_t)
+int chown(const char *k, uid_t, gid_t)
 {
-    return 0;
+   return 0;
 }
 
-int
-lchown(const char *k, uid_t, gid_t)
+int lchown(const char *k, uid_t, gid_t)
 {
-    return 0;
+   return 0;
 }
 
-
+bool fstype(const char *fname, char *fs, int fslen)
+{
+   return true;
+}
 
 long int
 random(void)
@@ -133,7 +132,7 @@ random(void)
 void
 srandom(unsigned int seed)
 {
-    srand(seed);
+   srand(seed);
 }
 // /////////////////////////////////////////////////////////////////
 // convert from Windows concept of time to Unix concept of time
@@ -1090,13 +1089,13 @@ cleanup:
 int
 kill(int pid, int signal)
 {
-    int rval = 0;
-    if (!TerminateProcess((HANDLE)pid, (UINT) signal)) {
-        rval = -1;
-        errno = b_errno_win32;
-    }
-    CloseHandle((HANDLE)pid);
-    return rval;
+   int rval = 0;
+   if (!TerminateProcess((HANDLE)pid, (UINT) signal)) {
+      rval = -1;
+      errno = b_errno_win32;
+   }
+   CloseHandle((HANDLE)pid);
+   return rval;
 }
 
 #ifndef HAVE_MINGW
@@ -1104,37 +1103,45 @@ kill(int pid, int signal)
 int
 close_bpipe(BPIPE *bpipe)
 {
-    int rval = 0;
-    if (bpipe->rfd) fclose(bpipe->rfd);
-    if (bpipe->wfd) fclose(bpipe->wfd);
-
-    if (bpipe->wait) {
-        int remaining_wait = bpipe->wait;
-        do {
-            DWORD exitCode;
-            if (!GetExitCodeProcess((HANDLE)bpipe->worker_pid, &exitCode)) {
-                const char *err = errorString();
-                rval = b_errno_win32;
-                d_msg(__FILE__, __LINE__, 0,
-                      "GetExitCode error %s\n", err);
-                LocalFree((void *)err);
-                break;
-            }
-
-            if (exitCode == STILL_ACTIVE) {
-                bmicrosleep(1, 0);             /* wait one second */
-                remaining_wait--;
-            }
-            else break;
-        } while(remaining_wait);
-        rval = ETIME;                 /* timed out */
-    }
+   int rval = 0;
+   int32_t remaining_wait = bpipe->wait;
 
-    if (bpipe->timer_id) {
-        stop_child_timer(bpipe->timer_id);
-    }
-    free((void *)bpipe);
-    return rval;
+   if (remaining_wait == 0) {         /* wait indefinitely */
+      remaining_wait = INT32_MAX;
+   }
+   for ( ;; ) {
+      DWORD exitCode;
+      if (!GetExitCodeProcess((HANDLE)bpipe->worker_pid, &exitCode)) {
+         const char *err = errorString();
+         rval = b_errno_win32;
+         d_msg(__FILE__, __LINE__, 0,
+               "GetExitCode error %s\n", err);
+         LocalFree((void *)err);
+         break;
+      }
+      if (exitCode == STILL_ACTIVE) {
+         if (remaining_wait <= 0) {
+            rval = ETIME;             /* timed out */
+            break;
+         }
+         bmicrosleep(1, 0);           /* wait one second */
+         remaining_wait--;
+      } else if (exitCode != 0) {
+         /* Truncate exit code as it doesn't seem to be correct */
+         rval = (exitCode & 0xFF) | b_errno_exit;
+         break;
+      } else {
+         break;                       /* Shouldn't get here */
+      }
+   }
+
+   if (bpipe->timer_id) {
+       stop_child_timer(bpipe->timer_id);
+   }
+   if (bpipe->rfd) fclose(bpipe->rfd);
+   if (bpipe->wfd) fclose(bpipe->wfd);
+   free((void *)bpipe);
+   return rval;
 }
 
 int
index ce98b43ed5a54c971ac8061afb0a0810b5bf0dd8..a6e9be065216bbee138fa6388f56eae1149002a2 100755 (executable)
@@ -1,8 +1,8 @@
 ; winbacula.nsi
 ;
-; Written by Michel Meyers (michel@tcnnet.dyndns.org)
+; Began as a version written by Michel Meyers (michel@tcnnet.dyndns.org)
 ;
-; Updated by Kern Sibbald for native Win32 Bacula
+; Adapted by Kern Sibbald for native Win32 Bacula
 ;    added a number of elements from Christopher Hull's installer
 ;
 ; D. Scott Barninger Nov 13 2004
 ; added Start Menu items
 ; fix uninstall of config files to do all not just bacula-fd.conf
 ;
+; D. Scott Barninger Dec 05 2004
+; added specification of default permissions for bacula-fd.conf
+;   - thanks to Jamie Ffolliott for pointing me at cacls
+; added removal of working-dir files if user selects to remove config
+; uninstall is now 100% clean
+;
+; D. Scott Barninger Apr 17 2005
+; 1.36.3 release docs update
+; add pdf manual and menu shortcut
+;
 ; Command line options:
 ;
 ; /cygwin     -  do cygwin install into c:\cygwin\bacula
@@ -154,8 +164,11 @@ Section "Bacula File Service" SecService
   Call IsNt
   Pop $R0
   StrCmp $R0 "false" do_win98
-  MessageBox MB_YESNO|MB_ICONQUESTION  "Would you like to start the Bacula Client now?" IDNO NoStart
+  MessageBox MB_YESNO|MB_ICONQUESTION  "Would you like to start the Bacula Client now?" IDNO SetPerms
   Exec 'net start bacula'
+ SetPerms:
+  ; set default permissions on config file so it's not world readable
+  Exec 'cmd /C echo Y|cacls "$INSTDIR\bin\bacula-fd.conf" /G SYSTEM:F Administrators:F'
   goto NoStart 
  do_win98:
   File Start.bat
@@ -209,9 +222,13 @@ SectionEnd
 Section "Install Documentation" SecDoc
   SetOutPath "$INSTDIR\doc"
   CreateDirectory "$INSTDIR\doc"
-  File ..\..\doc\html-manual\*.html
-  File ..\..\doc\html-manual\*.gif
-  File ..\..\doc\html-manual\*.jpg
+  File ..\..\doc\latex\bacula\*.html
+  File ..\..\doc\latex\bacula\*.png
+  File ..\..\doc\latex\bacula\*.css
+  File ..\..\doc\latex\bacula.pdf
+  ; Create Start Menu entry
+  SetShellVarContext all
+  CreateShortCut "$SMPROGRAMS\Bacula\Manual.lnk" "$INSTDIR\doc\bacula.pdf"
 SectionEnd
 
 ;
@@ -274,8 +291,9 @@ Section "Uninstall"
   Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
 
   ; Check for existing installation
-  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to delete the current configuration files?" IDNO LeaveConfig
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to delete the current configuration files and the working state file?" IDNO LeaveConfig
   Delete /REBOOTOK "$INSTDIR\bin\*.conf"
+  Delete /REBOOTOK "$INSTDIR\working\*"
   ; remove directories used
   RMDir "$INSTDIR\bin"
   RMDir "$INSTDIR\doc"
index 30447967633425215ab3b30b00b1da9eb362dca4..9ffc7b3f300d907ed2010ca98c1fc0d8044f6788 100644 (file)
@@ -1,3 +1,12 @@
+24-03-2005 :
+ - wxbMainFrame : Fix a bug with GTK+-1.2 which caused wx-console to crash
+   when starting.
+ - wxbRestorePanel : Fix a major bug which caused wx-console to enter in an
+   infinite loop which allocate a lot of memory and could make the system crash.
+
+10-03-2005 :
+ - wxbMainFrame : Fix bug #0000221 (Debian 292517)
+
 13-08-2004 :
  - wxbHistoryTextCtrl : Fixed Win32 build error
  - general : implemented command completion and interactive help.
index 0cdd6121937071b79bd73886963f0ea741f55635..91a4edfe38eac351a91f31858f1cd89516b96ab5 100644 (file)
@@ -128,7 +128,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index e112c58e318af1fcbd292c0f743a6a9739fd2a9a..440987cbcff334b10fa1344f222666992d40756e 100644 (file)
@@ -123,15 +123,15 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
    }
    switch (type) {
       case R_CONSOLE:
-         printf("Console: name=%s rcfile=%s histfile=%s\n", reshdr->name,
+        printf("Console: name=%s rcfile=%s histfile=%s\n", reshdr->name,
       res->res_cons.rc_file, res->res_cons.hist_file);
     break;
       case R_DIRECTOR:
-         printf("Director: name=%s address=%s DIRport=%d\n", reshdr->name,
+        printf("Director: name=%s address=%s DIRport=%d\n", reshdr->name,
        res->res_dir.address, res->res_dir.DIRport);
     break;
       default:
-         printf("Unknown resource type %d\n", type);
+        printf("Unknown resource type %d\n", type);
    }
    if (recurse && res->res_dir.hdr.next) {
       dump_resource(type, res->res_dir.hdr.next, sendit, sock);
@@ -175,7 +175,7 @@ void free_resource(RES *sres, int type)
        free(res->res_dir.address);
     break;
       default:
-         printf("Unknown resource type %d\n", type);
+        printf("Unknown resource type %d\n", type);
    }
    /* Common stuff again -- free the resource, recurse to next one */
    free(res);
@@ -201,7 +201,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
    for (i=0; items[i].name; i++) {
       if (items[i].flags & ITEM_REQUIRED) {
        if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {
-               Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n",
+              Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n",
        items[i].name, resources[rindex]);
        }
       }
@@ -220,7 +220,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
        break;
 
     default:
-            Emsg1(M_ERROR, 0, "Unknown resource type %d\n", type);
+           Emsg1(M_ERROR, 0, "Unknown resource type %d\n", type);
        error = 1;
        break;
       }
@@ -247,7 +247,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
     size = sizeof(DIRRES);
     break;
       default:
-         printf("Unknown resource type %d\n", type);
+        printf("Unknown resource type %d\n", type);
     error = 1;
     size = 1;
     break;
@@ -263,12 +263,12 @@ void save_resource(int type, RES_ITEM *items, int pass)
     for (next=res_head[rindex]; next->next; next=next->next) {
        if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
          Emsg2(M_ERROR_TERM, 0,
-                  _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
+                 _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
        resources[rindex].name, res->res_dir.hdr.name);
        }
     }
     next->next = (RES *)res;
-         Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
+        Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
          res->res_dir.hdr.name);
       }
    }
index ff126d3d7616612472c92da41eca617661bb3f3f..eaee9ec92e66411a1e257f85120e239ef1ad7fa7 100644 (file)
@@ -47,7 +47,7 @@ class console_thread : public wxThread
       void* Entry();
       void Write(const char* str);
       virtual void Delete();
-      
+
       static void InitLib();
       static void FreeLib();
       static wxString LoadConfig(wxString configfile);
@@ -55,13 +55,13 @@ class console_thread : public wxThread
    private:
       static bool inited;
       static bool configloaded;
-      
+
       bool choosingdirector;
-      
+
       static wxString working_dir;
-      
+
       int directorchoosen;
-      
+
       BSOCK* UA_sock;
       JCR jcr;
 };
index de432dcc397c06cff1be5b9e25df93c75897ad8a..852d8d6457f7dc87aab670d26e80038411d652fa 100644 (file)
 
 class wxbConfigFileEditor : public wxDialog {
 public:
-        wxbConfigFileEditor(wxWindow* parent, wxString filename);
-        virtual ~wxbConfigFileEditor();
+       wxbConfigFileEditor(wxWindow* parent, wxString filename);
+       virtual ~wxbConfigFileEditor();
 private:
    wxString filename;
-   
+
    wxTextCtrl* textCtrl;
-   
+
    void OnSave(wxCommandEvent& event);
    void OnQuit(wxCommandEvent& event);
-   
+
    DECLARE_EVENT_TABLE()
 };
index 79908062ec3b1d8bee9c2d14020cfe7df0c8b1a8..6ba123b8be63d75483fa8f234d86f6047a8cf84a 100644 (file)
@@ -42,36 +42,36 @@ enum wxbConfigType {
 };
 
 class wxbConfigParam {
-   public:  
+   public:
       /* Create a new config parameter */
       wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, wxString value);
       wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, int n, wxString values[]);
      ~wxbConfigParam();
-     
+
      void AddControl(wxWindow* parent, wxSizer* sizer);
-     
+
      wxString GetValue();
      void SetValue(wxString str);
-     
+
      int GetIndex();
      void SetIndex(int ind);
-     
+
      void Clear();
      void Add(wxString value);
-     
+
      wxString GetTitle();
-   
+
    private:
       wxString value;
       wxString* values;
       int nvalues;
-   
+
       wxString title;
-      
+
       wxWindowID id;
-      
+
       wxbConfigType type;
-   
+
       wxChoice* choicectrl;
       wxTextCtrl* textctrl;
       wxStaticText* statictext;
@@ -82,9 +82,9 @@ WX_DECLARE_OBJARRAY(wxbConfigParam, wxbConfig);
 class wxbConfigPanel : public wxPanel {
 public:
    /* Creates a new config panel, config must be allocated with new */
-        wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
-        ~wxbConfigPanel();
-   
+       wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
+       ~wxbConfigPanel();
+
    void SetRowString(const char* title, wxString value);
    wxString GetRowString(const char* title);
    int GetRowSelection(const char* title);
@@ -104,7 +104,7 @@ private:
    wxButton* cfgOk;
    wxButton* cfgCancel;
    wxButton* cfgApply;
-   
+
    int FindRow(const char* title);
 };
 
index 9020f0d3eed5f56c9dc43ce5a10a3a3febed2bfe..6c7478bee1c9b605c446a2b190db534d4c626aa3 100644 (file)
@@ -41,10 +41,10 @@ WX_DECLARE_STRING_HASH_MAP( wxString, wxbCommands );
 class wxbHistoryTextCtrl: public wxTextCtrl {
    public:
       wxbHistoryTextCtrl(wxStaticText* help, wxWindow* parent, wxWindowID id,
-         const wxString& value = "", const wxPoint& pos = wxDefaultPosition,
-         const wxSize& size = wxDefaultSize,
-         const wxValidator& validator = wxDefaultValidator,
-         const wxString& name = wxTextCtrlNameStr);
+        const wxString& value = "", const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        const wxValidator& validator = wxDefaultValidator,
+        const wxString& name = wxTextCtrlNameStr);
 
       void HistoryAdd(wxString cmd);
 
index b35dc033079426192d289c6e1801f701162117b6..f7f9950978f050e5f5fe9710a3a6ae7a483fd305 100644 (file)
@@ -54,9 +54,9 @@ typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
 
 #define EVT_LIST_MARKED_EVENT(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
-        wxbLIST_MARKED_EVENT, id, wxID_ANY, \
-        (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
-        (wxObject *) NULL \
+       wxbLIST_MARKED_EVENT, id, wxID_ANY, \
+       (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
+       (wxObject *) NULL \
     ),
 
 /* Customized list, which transmit double clicks on images */
@@ -64,13 +64,13 @@ class wxbListCtrl: public wxListCtrl {
    public:
       wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
       ~wxbListCtrl();
-      
+
    private:
       void OnDoubleClicked(wxMouseEvent& event);
       void OnRightClicked(wxMouseEvent& event);
-      
+
       wxEvtHandler* handler;
-      
+
       DECLARE_EVENT_TABLE();
 };
 
index 15b6e85e93c1963fb408b6fa37d7bd140adaec09..d1373d97487c859c6ded88dfd9484f2fbab2e3f8 100644 (file)
@@ -207,6 +207,8 @@ wxbMainFrame::~wxbMainFrame()
 wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
       : wxFrame(NULL, -1, title, pos, size, style)
 {
+   lockedbyconsole = false;
+   
    ct = NULL;
    
    promptparser = NULL;
@@ -313,8 +315,6 @@ wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSi
    this->SetSize(size);
    EnableConsole(false);
    
-   lockedbyconsole = false;
-   
    consoleBuffer = "";
    
    configfile = "";
@@ -647,8 +647,8 @@ void wxbMainFrame::Print(wxString str, int status)
             
             int res = ::wxGetSingleChoiceIndex(message,
                "wx-console: unexpected director's question.", n, choices, this);
-            if (res == -1) {
-               Send("\n");
+            if (res == -1) { //Cancel pressed
+               Send(".\n");
             }
             else {
                if (promptparser->isNumericalChoice()) {
index 45143b2333d77430771a39abf8377162e0335819..f3d8fbfb484af9c7e41f59eb7f33d7e2c469bdd3 100644 (file)
@@ -62,13 +62,13 @@ class wxbPrintObject: public wxObject {
       wxString str;
       int status;
       wxbPrintObject(wxString str, int status): wxObject() {
-         this->str = str;
-         this->status = status;
+        this->str = str;
+        this->status = status;
       }
 
       wxbPrintObject(const wxbPrintObject& pe) {
-         this->str = pe.str;
-         this->status = pe.status;
+        this->str = pe.str;
+        this->status = pe.status;
       }
 };
 
@@ -107,7 +107,7 @@ public:
    /* Enable and disable panels */
    void EnablePanels();
    void DisablePanels(void* except = NULL);
-   
+
    void EnableConsole(bool enable = true);
 
    /*
@@ -124,10 +124,10 @@ public:
     *  If config is not empty, uses this config file.
     */
    void StartConsoleThread(const wxString& config);
-   
+
    /* Register a new wxbDataParser */
    void Register(wxbDataParser* dp);
-   
+
    /* Unregister a wxbDataParser */
    void Unregister(wxbDataParser* dp);
 
@@ -137,7 +137,7 @@ private:
    /* private constructor, singleton */
    wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style);
    ~wxbMainFrame();
-   
+
    static wxbMainFrame *frame; /* this */
 
    wxMenu *menuFile;
@@ -154,11 +154,11 @@ private:
    wxbPromptParser* promptparser; /* prompt parser catching uncatched questions */
 
    bool lockedbyconsole; /* true if the panels have been locked by something typed in the console */
-   
+
    wxString configfile; /* configfile used */
-   
+
    wxString consoleBuffer; /* Buffer used to print in the console line by line */
-     
+
    // any class wishing to process wxWindows events must use this macro
    DECLARE_EVENT_TABLE()
 };
index 440ed3eff8b066a308b81561c82ca1bac996d63f..ff9840a922d8ff8f2222830412a0103066c04b79 100644 (file)
@@ -408,7 +408,7 @@ wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) {
 
    SetCursor(*wxSTANDARD_CURSOR);
 
-   markWhenListingDone = false;
+   markWhenCommandDone = false;
    
    cancelled = 0;
 }
@@ -1985,7 +1985,6 @@ void wxbRestorePanel::OnCancel(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnStart(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    SetWorking(true);
@@ -1995,14 +1994,12 @@ void wxbRestorePanel::OnStart(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeChanging(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       event.Veto();
    }
 }
 
 void wxbRestorePanel::OnTreeExpanding(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       event.Veto();
       return;
    }
@@ -2016,7 +2013,6 @@ void wxbRestorePanel::OnTreeExpanding(wxTreeEvent& event) {
 
 void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    if (currentTreeItem == event.GetItem()) {
@@ -2025,11 +2021,11 @@ void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
    treeadd->Enable(false);
    treeremove->Enable(false);
    treerefresh->Enable(false);
-   markWhenListingDone = false;
+   markWhenCommandDone = false;
    SetWorking(true);
    currentTreeItem = event.GetItem();
    CmdList(event.GetItem());
-   if (markWhenListingDone) {
+   if (markWhenCommandDone) {
       CmdMark(event.GetItem(), NULL, 0);
       tree->Refresh();
    }
@@ -2043,17 +2039,19 @@ void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
 }
 
 void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
-   csprint("Tree marked", CS_DEBUG);
    if (IsWorking()) {
       if (tree->GetSelection() == event.GetItem()) {
-         markWhenListingDone = !markWhenListingDone;
+         markWhenCommandDone = !markWhenCommandDone;
       }
-      AddPendingEvent(event);
       return;
    }
    SetWorking(true);
+   markWhenCommandDone = false;
    CmdMark(event.GetItem(), NULL, 0);
-   //event.Skip();
+   if (markWhenCommandDone) {
+      CmdMark(event.GetItem(), NULL, 0);
+      tree->Refresh();
+   }
    tree->Refresh();
    SetWorking(false);
    if (event.GetItem().IsOk()) {
@@ -2065,7 +2063,6 @@ void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
 
 void wxbRestorePanel::OnTreeAdd(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2081,7 +2078,6 @@ void wxbRestorePanel::OnTreeAdd(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeRemove(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2097,7 +2093,6 @@ void wxbRestorePanel::OnTreeRemove(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnTreeRefresh(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2108,8 +2103,6 @@ void wxbRestorePanel::OnTreeRefresh(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
-      //event.Skip();
       return;
    }
    
@@ -2129,7 +2122,7 @@ void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
       num++;
       item = list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
    }
-     
+   
    CmdMark(wxTreeItemId(), items, num);
    
    delete[] items;
@@ -2145,8 +2138,6 @@ void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
 
 void wxbRestorePanel::OnListActivated(wxListEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
-      //event.Skip();
       return;
    }
    SetWorking(true);
@@ -2183,7 +2174,6 @@ void wxbRestorePanel::OnListActivated(wxListEvent& event) {
 
 void wxbRestorePanel::OnListChanged(wxListEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
  
@@ -2220,7 +2210,6 @@ void wxbRestorePanel::OnListChanged(wxListEvent& event) {
 
 void wxbRestorePanel::OnListAdd(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2250,7 +2239,6 @@ void wxbRestorePanel::OnListAdd(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
@@ -2280,7 +2268,6 @@ void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
 
 void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
    if (IsWorking()) {
-      AddPendingEvent(event);
       return;
    }
    
index 30cd8fae72c0908376470d7979f24d7b8600ceb4..f956d67f7acb9258d38fdb199d365282d3ac063b 100644 (file)
@@ -151,7 +151,7 @@ class wxbRestorePanel : public wxbPanel
       bool working; // A command is running, discard GUI events
       void SetWorking(bool working);
       bool IsWorking();
-      bool markWhenListingDone;
+      bool markWhenCommandDone; //If an item should be (un)marked after the current listing/marking is done
       wxTreeItemId currentTreeItem; // Currently selected tree item
 
       /* Enable or disable config controls status */
index 565630165ac05e5254f3f84e24cd4bc3f87159e6..1e2b8cb208479c1a9ea4c01bfd7c820ca57186dc 100644 (file)
@@ -50,8 +50,8 @@
 
 #include <wx/dynarray.h>
 
-/* 
- * Allow the use of Object Array (auto-deletion, object returned as themselves 
+/*
+ * Allow the use of Object Array (auto-deletion, object returned as themselves
  * and not as pointers)
  */
 class wxbArrayString: public wxArrayString, public wxObject {
index 08fe8bd9ff781536232c219aab14055a3427c40a..3cf6012f272bf993fffdd5b4d4f80916adbcbc0b 100644 (file)
@@ -47,7 +47,7 @@ class wxbTreeMarkedEvent: public wxEvent {
       ~wxbTreeMarkedEvent();
       wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
       virtual wxEvent *Clone() const;
-      
+
       wxTreeItemId GetItem();
    private:
       wxTreeItemId item;
@@ -57,9 +57,9 @@ typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
 
 #define EVT_TREE_MARKED_EVENT(id, fn) \
     DECLARE_EVENT_TABLE_ENTRY( \
-        wxbTREE_MARKED_EVENT, id, wxID_ANY, \
-        (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
-        (wxObject *) NULL \
+       wxbTREE_MARKED_EVENT, id, wxID_ANY, \
+       (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
+       (wxObject *) NULL \
     ),
 
 /* Customized tree, which transmit double clicks on images */
@@ -67,13 +67,13 @@ class wxbTreeCtrl: public wxTreeCtrl {
    public:
       wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
       ~wxbTreeCtrl();
-      
+
    private:
       void OnDoubleClicked(wxMouseEvent& event);
       void OnRightClicked(wxMouseEvent& event);
-      
+
       wxEvtHandler* handler;
-      
+
       DECLARE_EVENT_TABLE();
 };
 
index f2120072566c8fd820ceb98954b8c6675d3d3aae..6fa822ed22d6ddca1732d58457e87a12974b569b 100644 (file)
@@ -47,10 +47,10 @@ class wxbUtils
    public:
       /* Initialization */
       static void Init();
-      
+
       /* Reset state */
       static void Reset();
-   
+
       /* Parse a table in tableParser */
       static wxbTableParser* CreateAndWaitForParser(wxString cmd);
 
@@ -86,7 +86,7 @@ class wxbDataParser
       /*
        * Receives director information, forwarded by wxbMainFrame, and sends it
        * line by line to the virtual function Analyse.
-       * 
+       *
        * Returns true if status == CS_PROMPT and the message has been parsed
        * correctly.
        */
@@ -113,7 +113,7 @@ class wxbPanel : public wxPanel
        *   Tab title in the notebook.
        */
       virtual wxString GetTitle() = 0;
-      
+
       /*
        *   Enable or disable this panel
        */
@@ -122,7 +122,7 @@ class wxbPanel : public wxPanel
 
 /*
  *  Receives director information, and splits it by line.
- * 
+ *
  * datatokenizer[0] retrieves first line
  */
 class wxbDataTokenizer: public wxbDataParser, public wxArrayString
@@ -138,11 +138,11 @@ class wxbDataTokenizer: public wxbDataParser, public wxArrayString
        *   Receives data to analyse.
        */
       virtual bool Analyse(wxString str, int status);
-      
-      /* Returns true if the last signal received was an end signal, 
+
+      /* Returns true if the last signal received was an end signal,
        * indicating that no more data is available */
       bool hasFinished();
-      
+
    private:
       bool finished;
 };
@@ -163,11 +163,11 @@ class wxbPromptParser: public wxbDataParser
        *   Receives data to analyse.
        */
       virtual bool Analyse(wxString str, int status);
-      
-      /* Returns true if the last signal received was an prompt signal, 
+
+      /* Returns true if the last signal received was an prompt signal,
        * or an end signal */
       bool hasFinished();
-      
+
       /* Returns true if the last message received is a prompt message */
       bool isPrompt();
 
@@ -176,20 +176,20 @@ class wxbPromptParser: public wxbDataParser
 
       /* Returns question string */
       wxString getQuestionString();
-      
+
       /* Returns a wxArrayString containing the indexed choices we have
        * to answer the question, or NULL if this question is not a multiple
        * choice one. */
       wxArrayString* getChoices();
-      
+
       /* Returns true if the expected answer to the choice list is a number,
        * false if it is a string (for example yes/mod/no). */
       bool isNumericalChoice();
-      
+
    private:
       bool finished;
       bool prompt;
-      bool numerical;      
+      bool numerical;
       wxString introStr;
       wxArrayString* choices;
       wxString questionStr;
diff --git a/regress/.cvsignore b/regress/.cvsignore
deleted file mode 100644 (file)
index f29c785..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-build
-bin
-test.out
-weird-files
-weird-files2
-diff
-tmp
-working
-Makefile
diff --git a/regress/Makefile.in b/regress/Makefile.in
deleted file mode 100644 (file)
index a095af1..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Makefile for Bacula regression testing
-#
-#  Note, Makefile is built from Makefile.in, which you should not really 
-#    need to change, by envoking:
-#
-#  ./config <user's configuration>
-# e.g.
-#
-#  ./config kern.conf
-#
-#
-
-# suck in user's configuration
-@CONFIG@
-
-WHICHDB?="--with-sqlite=${SQLITE_DIR}"
-
-first_rule: all
-
-all:
-
-setup: bacula
-
-# 
-# Some machines cannot handle the sticky bit and other garbage that
-#  is in weird-files, so we load and run it only on Linux machines.
-#
-bacula: all   
-       @rm -rf bin build weird-files tmp
-       (if test x`uname` = xLinux -o x`uname` = xFreeBSD ; then \
-          tar xfz weird-files.tar.gz ;\
-        fi)
-       rm -rf tmp working
-       mkdir tmp working
-       scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB}
-       scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH}
-
-# Run all non-root userid tests
-test: 
-       ./all-non-root-tests
-
-# run all file and tape tests
-full_test:
-       ./all-tape-and-file-tests
-
-# These tests require you to run as root
-root_test:
-       ./all-root-tests
-
-clean:
-       scripts/cleanup
-       rm -f /tmp/file-list
-       rm -f tmp/* working/*
-       rm -f test.out
-       rm -f diff
-       rm -f 1 2 3 scripts/1 scripts/2 scripts/3 tests/1 tests/2 tests/3
-
-# Reset our userid after running as root
-reset:
-       chown -R ${USER}:${USER} . tmp working
-       scripts/cleanup
-       rm -f /tmp/file-list tmp/file-list
-       rm -f tmp/* working/*
-
-distclean: clean
-       rm -rf bin build weird-files weird-files weird-files2 tmp working
-       rm -f scripts/*.conf
-                     
diff --git a/regress/README b/regress/README
deleted file mode 100644 (file)
index c63b737..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-      Bacula Regression
-        Kern Sibbald
-        December 2003
-
-This is Bacula's regression script directory.  At this time
-(December 2003), it is still in development, so all the tests are
-not complete.
-
-To set it up, create your personal configuration file, by
-copying prototype.conf to xxx.conf or simply editing prototype.conf
-directly.
-
-Then edit your conf file and define appropriate values
-for the variables that are in that file.  If you want to see
-a real example, look at kern.conf, but please don't use my
-email address!
-
-Make sure that depkgs is pre-built if it isn't 
-already: (cd your-depkgs; make sqlite).
-
-Then do:
-
-   ./config xxx.conf
-   make setup
-
-You run the above one time.  This will build a Makefile from
-Makefile.in and your xxx.conf file, copy the Bacula source,
-configure, build it, and configure all the Bacula scripts
-and conf files.  If you change your source, you will need to
-redo this command.
-
-Then you can run any of the tests in the tests subdirectory.
-Each test whose name ends in -root requires you to be root for
-a resonable run.  Each test is totally independent of any other
-test. Aside from the required "make setup", each test is totally
-self-initalizing and should clean up after itself.
-
-Not all the tests yet report OK.  This is simply because there are
-some spurious differences that I haven't yet taken the time to
-eliminate.  The working scrips as of 24 Apr 03 are:
-
-backup-bacula-test
-sparse-test
-compressed-test
-sparse-compressed-test
-two-jobs-test
-wierd-files-test
-verify-vol-test
-
-The tests expect you to execute them from the main regress 
-directory!               
-
-You can run them individually as:
-
-   tests/two-jobs-test
-
-or all non-root tests (my normal testing under my account)
-
-  ./all-non-root-tests
-
-or all tests (I only run these before a production release):
-
-   su
-   ./all-tests
-
-
-after running the root tests, while still root, it is a good idea
-to do:
-
-   make reset
-
-this cleans up any files that may be created with root permissions.
-
-If you want to add more tests, do so by putting the shell script 
-in the tests subdirectory. Be careful when adding (or better not)
-new clients, pools, and such to the test-bacula-dir.conf.in file
-as it may invalidate a good number of tests, which respond to
-questions by answering with a number (i.e. the order of the selection
-list is known). It might be better to add your own testb-bacula...
-configuration file.  
-
-To avoid re-doing a make setup if you have made a change to the
-conf files, and you do not need a new copy of the source, you can simply do:
-
-   scripts/do-sed <your-email-address>
-
-Debugging failed tests:
-The simplest thing to do is to edit tests/xxxx where xxxx is the name of
-a or the test that is failing and change all:
- @output
-
-to
-  
- @tee
-
-re-run the test. The output will display on your terminal.  In rare cases,        
-for example to get bacula debug output, you might want to remove the
-"2>&1 >/dev/null" from the end of the bin/bacula call or from the end
-of the diff call, assuming you want to "see" the diff output.
-    
diff --git a/regress/all-non-root-2tape-tests b/regress/all-non-root-2tape-tests
deleted file mode 100755 (executable)
index 5201731..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# Run all tape tests
-#
-tests/test0
-tests/two-volume-tape
-tests/incremental-2tape
-echo " "
-echo " "
-echo "2 Tape Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests
deleted file mode 100755 (executable)
index 7af5fbf..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-#
-# Run all tape tests
-#
-tests/test0
-tests/backup-bacula-tape
-tests/small-file-size-tape
-tests/restore-by-file-tape
-tests/incremental-tape
-tests/four-concurrent-jobs-tape
-tests/four-jobs-tape
-tests/fixed-block-size-tape
-tests/bscan-tape
-tests/btape-fill-tape
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests
deleted file mode 100755 (executable)
index c36f440..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-tests/test0
-tests/backup-bacula-test
-tests/verify-vol-test
-tests/sparse-test
-tests/compressed-test
-tests/sparse-compressed-test
-tests/weird-files-test
-tests/two-jobs-test
-tests/two-vol-test
-tests/six-vol-test
-tests/bscan-test
-tests/weird-files2-test
-tests/concurrent-jobs-test
-tests/four-concurrent-jobs-test
-tests/bsr-opt-test
-tests/bextract-test
-tests/recycle-test
-tests/span-vol-test
-tests/restore-by-file-test
-tests/restore2-by-file-test
-tests/four-jobs-test
-tests/incremental-test
-tests/decremental-test
-tests/restore-disk-seek-test
-tests/query-test
-tests/auto-label-test
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
diff --git a/regress/all-root-tests b/regress/all-root-tests
deleted file mode 100755 (executable)
index 3f077bb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# Run all root tests
-#
-rm -f test.out
-tests/dev-test-root
-tests/etc-test-root
-tests/lib-test-root
-tests/usr-tape-root
-cat test.out
-scripts/cleanup
diff --git a/regress/all-tape-and-file-tests b/regress/all-tape-and-file-tests
deleted file mode 100755 (executable)
index 9bc3e76..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-./all-non-root-tests
-./all-non-root-tape-tests
diff --git a/regress/all-tests b/regress/all-tests
deleted file mode 100755 (executable)
index b1b2b35..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# Run all tests
-#
-./all-non-root-tests
-./all-root-tests
-cat test.out
-scripts/cleanup
diff --git a/regress/config b/regress/config
deleted file mode 100755 (executable)
index 4bc4f52..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#/bin/sh
-#
-# First argument is expected to be a user's configuration file
-#
-if ! test -e $1 ; then
-   echo "Arg1 must specify a config file (e.g. prototype.conf)"
-   exit 1
-fi
-sed -e "/@CONFIG@/r $1" -e "s/@CONFIG@//" Makefile.in >Makefile
diff --git a/regress/do_all b/regress/do_all
deleted file mode 100755 (executable)
index ce86177..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-make setup
-./all-tape-and-file-tests
diff --git a/regress/do_all_tapes b/regress/do_all_tapes
deleted file mode 100755 (executable)
index dd07d2e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-make setup
-./all-non-root-tape-tests
diff --git a/regress/file b/regress/file
deleted file mode 100755 (executable)
index 8f20890..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-./all-non-root-tests
diff --git a/regress/kern.conf b/regress/kern.conf
deleted file mode 100644 (file)
index dbe0c96..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# Where to get the source to be tested
-BACULA_SOURCE="${HOME}/bacula/k"
-
-# Where to send email   !!!!! Change me !!!!!!!
-EMAIL=kern@sibbald.com
-
-# Full "default" path where to find sqlite (no quotes!)
-SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
-
-TAPE_DRIVE="/dev/nst0"
-# if you don't have an autochanger set AUTOCHANGER to /dev/null
-AUTOCHANGER="/dev/sg0"
-
-# This must be the path to the autochanger including its name
-AUTOCHANGER_PATH="/usr/local/bin/mtx"
diff --git a/regress/prototype.conf b/regress/prototype.conf
deleted file mode 100644 (file)
index 14592a3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Prototype personal configuration file for the regression 
-#  scripts.  Either edit this file directly, or better copy
-#  it elsewhere so it won't get overwritten.          
-#
-
-#
-# Where to get the source to be tested
-#
-BACULA_SOURCE=
-
-# Where to send email messages
-#
-EMAIL=
-
-# Full "default" path where to find sqlite. 
-# This is only used if you do not specify a database override on the
-# make command.  
-#
-#    N.B. DON'T PUT QOUTES AROUND THE PATH.
-#
-SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
-
-#
-# The device name of your tape drive if you have one
-#
-TAPE_DRIVE=/dev/nst0
-
-#
-# if you don't have an autochanger set AUTOCHANGER to /dev/null
-#
-AUTOCHANGER=/dev/sg0
-
-#
-# This must be the path to the autochanger including its name
-#
-AUTOCHANGER_PATH=/bin/mtx
diff --git a/regress/run b/regress/run
deleted file mode 100755 (executable)
index d48e262..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-bin/bacula start
-bin/bconsole -c bin/bconsole.conf
diff --git a/regress/scripts/.cvsignore b/regress/scripts/.cvsignore
deleted file mode 100644 (file)
index 002e974..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-new-test-bacula-dir.conf
-bacula-dir.conf
-bacula-fd.conf
-bacula-sd.conf
-console.conf
-bconsole.conf
-test-bacula-dir.conf
-test-bacula-fd.conf
-test-bacula-sd.conf
-test-console.conf
-testa-bacula-dir.conf
-bacula-dir-tape.conf
-bacula-sd-tape.conf
-bacula-sd-2tape.conf
-cleanup-tape
-cleanup-2tape
-prepare-two-tapes
diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in
deleted file mode 100644 (file)
index 9cbb557..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Default Bacula Director Configuration file
-#
-#  The only thing that MUST be changed is to add one or more
-#   file or directory names in the Include directive of the
-#   FileSet resource.
-#
-#  For Bacula release 1.33
-#
-#  You might also want to change the default email address
-#   from root to your address.  See the "mail" and "operator"
-#   directives in the Messages resource.
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  Maximum Concurrent Jobs = 4
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
-  Messages = Daemon
-}
-
-#
-# Define the main nightly save backup job
-#   By default, this job will back up to disk in /tmp
-Job {
-  Name = "NightlySave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = DDS-4
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-  Maximum Concurrent Jobs = 4
-  SpoolData = yes
-}
-
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = DDS-4
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=MD5 { 
-    </tmp/file-list
-  }
-}
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-#  differential (i.e. incremental since full) every other sunday,
-#  and incremental backups other days
-Schedule {
-  Name = "WeeklyCycle"
-  Run = Full 1st sun at 1:05
-  Run = Differential 2nd-5th sun at 1:05
-  Run = Incremental mon-sat at 1:05
-}
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-  Maximum Concurrent Jobs = 4
-}
-
-# Definition of DDS tape storage device
-Storage {
-  Name = DDS-4
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-  Device = DDS-4                      # must be same as Device in Storage daemon
-  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
-  AutoChanger = yes
-  Maximum Concurrent Jobs = 4
-}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all, !terminate
-  operator = @job_email@ = mount
-  console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-#
-# Message delivery for daemon messages (no job).
-Messages {
-  Name = Daemon
-  mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
-  mail = @job_email@ = all, !skipped            
-  console = all, !skipped, !saved
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
diff --git a/regress/scripts/bacula-sd-2tape.conf.in b/regress/scripts/bacula-sd-2tape.conf.in
deleted file mode 100644 (file)
index 0bfc632..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = @hostname@-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = DDS-4                     # 
-  Media Type = DDS-4
-  Changer Device = @autochanger@
-  Changer Command ="@scriptdir@/mtx-changer %c %o %S %a"
-  Archive Device = @tape_drive@
-  AutomaticMount = yes;               # when device opened, read it
-  AlwaysOpen = yes;
-  RemovableMedia = yes;
-  @@sbindir@/tape_options
-# Maximum File Size = 1000000
-}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all, !terminate
-}
diff --git a/regress/scripts/bacula-sd-tape.conf.in b/regress/scripts/bacula-sd-tape.conf.in
deleted file mode 100644 (file)
index 62023f2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = @hostname@-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = DDS-4                     # 
-  Media Type = DDS-4
-  Archive Device = @tape_drive@
-  AutomaticMount = yes;               # when device opened, read it
-  AlwaysOpen = yes;
-  RemovableMedia = yes;
-  @@sbindir@/tape_options
-# Maximum File Size = 1000000
-# MaximumVolumeSize = 100M
-}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all, !terminate
-}
diff --git a/regress/scripts/bacula-sd.conf.in b/regress/scripts/bacula-sd.conf.in
deleted file mode 100644 (file)
index c035ea9..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = rufus-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "/home/kern/bacula/regress/working"
-  Pid Directory = "/home/kern/bacula/regress/working"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = rufus-dir
-  Password = "BzlEl8haeFmnv/Lv8V6zDzUBgFFQNsUtny6VkmccQpOy"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = FileStorage
-  Media Type = File
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabeled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-}
-
-#Device {
-#  Name = DDS-4                        # 
-#  Media Type = DDS-4
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-#  Name = "Exabyte 8mm"
-#  Media Type = "8mm"
-#  Archive Device = /dev/nst0
-#  Hardware end of medium = No;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = Yes;
-#  RemovableMedia = yes;
-#}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = rufus-dir = all, !terminate
-}
diff --git a/regress/scripts/check_for_zombie_jobs b/regress/scripts/check_for_zombie_jobs
deleted file mode 100755 (executable)
index 5fae9d3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-# Check for zombie jobs (not terminated).
-# Also scan logs for ERROR messages
-#
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output tmp/dir.out
-status dir
-@output tmp/fd.out
-status client
-@output tmp/sd.out
-status $1
-@output
-quit
-END_OF_DATA
-grep "No Jobs running." tmp/dir.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-  echo " "
-  echo "  !!!! Zombie Jobs in Director !!!!"
-  echo "  !!!! Zombie Jobs in Director !!!!" >>test.out
-  echo " "
-fi
-grep "No Jobs running." tmp/fd.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-  echo " "
-  echo "  !!!! Zombie Jobs in File daemon !!!!"
-  echo "  !!!! Zombie Jobs in File daemon !!!!" >>test.out
-  echo " "
-fi
-grep "No Jobs running." tmp/sd.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-  echo " "
-  echo "  !!!! Zombie Jobs in Storage daemon !!!!"
-  echo "  !!!! Zombie Jobs in Storage daemon !!!!" >>test.out
-  echo " "
-fi
-grep "ERROR" tmp/log*.out 2>&1 >/dev/null
-if [ $? = 0 ] ; then
-  echo " "
-  echo "  !!!! ERROR in log output !!!!"
-  echo "  !!!! ERROR in log output !!!!" >>test.out
-  echo " "
-fi
-grep "Fatal Error" tmp/log*.out 2>&1 >/dev/null
-if [ $? = 0 ] ; then
-  echo " "
-  echo "  !!!! Fatal Error in log output !!!!"
-  echo "  !!!! Fatal Error in log output !!!!" >>test.out
-  echo " "
-fi
-
-
diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup
deleted file mode 100755 (executable)
index 3651759..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
-rm -rf /tmp/sed_tmp /tmp/file-list
-rm -rf tmp/build tmp/restore-list tmp/restore2-list
-rm -rf tmp/fd.out tmp/dir.out tmp/sd.out
-rm -rf working/log tmp/TEST-*
-
-bin/bacula stop 2>&1 >/dev/null
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges >/dev/null 2>&1
-cd ..
diff --git a/regress/scripts/cleanup-2tape.in b/regress/scripts/cleanup-2tape.in
deleted file mode 100755 (executable)
index 70e6b7b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-scripts/cleanup
-
-if ! test x@autochanger@ = x/dev/null; then
-   drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x2; then
-      bin/mtx-changer @autochanger@ unload
-      bin/mtx-changer @autochanger@ load 2
-   fi
-   mt -f @tape_drive@ rewind
-   mt -f @tape_drive@ weof
-fi
-
-
-#
-# If we have an autochanger always load tape in slot 1
-#
-if ! test x@autochanger@ = x/dev/null; then
-   drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x1; then
-      bin/mtx-changer @autochanger@ unload
-      bin/mtx-changer @autochanger@ load 1
-   fi
-fi
-
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
diff --git a/regress/scripts/cleanup-tape.in b/regress/scripts/cleanup-tape.in
deleted file mode 100755 (executable)
index 98ed537..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-scripts/cleanup
-
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
diff --git a/regress/scripts/copy-2tape-confs b/regress/scripts/copy-2tape-confs
deleted file mode 100755 (executable)
index dbf9466..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-2tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
diff --git a/regress/scripts/copy-confs b/regress/scripts/copy-confs
deleted file mode 100755 (executable)
index d1e6cc1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/bconsole.conf bin/bconsole.conf
diff --git a/regress/scripts/copy-tape-confs b/regress/scripts/copy-tape-confs
deleted file mode 100755 (executable)
index 588dddc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
diff --git a/regress/scripts/copy-test-confs b/regress/scripts/copy-test-confs
deleted file mode 100755 (executable)
index 61b120f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/new-test-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
diff --git a/regress/scripts/copy-testa-confs b/regress/scripts/copy-testa-confs
deleted file mode 100755 (executable)
index 6b5f30c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-/bin/cp -f scripts/testa-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed
deleted file mode 100755 (executable)
index e999a52..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-if test $# != 4 ; then
-   echo "First arg must be email name"
-   echo "  and the second must be a tape drive"
-   echo "  and the third must be a tape control name or /dev/null"
-   echo "  and the fourth must be the full path to the mtx program"
-   exit 1
-fi
-out="/tmp/sed_tmp"
-cwd=`pwd`
-host=`hostname | tr '.' ' ' | cut -f 1 -d ' '`
-if test x$host = x ; then
-   host=localhost 
-fi
-# Create sed command script
-echo "s%@sbindir@%${cwd}/bin%g" >${out}
-echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
-echo "s%@working_dir@%${cwd}/working%g" >>${out}
-echo "s%@piddir@%${cwd}/working%g" >>${out}
-echo "s%@subsysdir@%${cwd}/working%g" >>${out}
-echo "s%@job_email@%${1}%g" >>${out}
-echo "s%@tape_drive@%${2}%g" >>${out}
-echo "s%@autochanger@%${3}%g" >>${out}
-echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
-echo "s%@hostname@%${host}%g" >>${out}
-echo "s%@changer_path@%${4}%g" >>${out}
-
-# process .in files with sed script
-sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
-sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
-sed -f ${out} ${cwd}/scripts/cleanup-2tape.in >${cwd}/scripts/cleanup-2tape
-sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
-cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$
-sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 777 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/prepare-two-tapes
-rm -f /tmp/bac$$
-cp ${cwd}/bin/mtx-changer /tmp/bac$$
-sed "s%^MTX.*$%MTX=${4}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
-chmod 777 ${cwd}/bin/mtx-changer
-
-# get proper SD tape definitions
-if test x`uname` = xLinux ; then \
-   cp -f scripts/linux_tape_options bin/tape_options ; \
-fi
-if test x`uname` = xFreeBSD ; then \
-   cp -f scripts/freebsd_tape_options bin/tape_options ; \
-fi
-
-rm -f ${out}
-rm -f /tmp/bac$$
diff --git a/regress/scripts/exclude-dev-test b/regress/scripts/exclude-dev-test
deleted file mode 100644 (file)
index 4165ea1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-dev/ptmx
-dev/pts
-dev/rd/c5d2
-dev/rd
-dev/shm
diff --git a/regress/scripts/exclude-etc-test b/regress/scripts/exclude-etc-test
deleted file mode 100644 (file)
index f59ca8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-etc/mail/statistics
diff --git a/regress/scripts/exclude-lib-test b/regress/scripts/exclude-lib-test
deleted file mode 100644 (file)
index 5be32f4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-lib/ld-2.2.5.so
-lib/libtermcap.so.2.0.8
-lib/libc-2.2.5.so
-lib/libnsl-2.2.5.so
-lib/libnss_files-2.2.5.so
diff --git a/regress/scripts/flist b/regress/scripts/flist
deleted file mode 100644 (file)
index 7e7e1f0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/build/doc/bacula.pdf
-/build/configure
-/build/src/stored/bextract
-/build/src/tools/testfind
-/build/Makefile.in
-/build/src/dird/bacula-dir
-/build/src/console/bconsole
-/build/src/filed/bacula-fd
-/build/src/findlib/find_one.c
-/build/src/jcr.h
-/build/platforms/Makefile.in
-/build/platforms/redhat/Makefile.in
-/build/scripts/Makefile.in
-/build/src/filed/win32/bin/cygwin1.dll
-/build/src/filed/win32/winservice.cpp
-/build/src/filed/restore.c
diff --git a/regress/scripts/freebsd_tape_options b/regress/scripts/freebsd_tape_options
deleted file mode 100644 (file)
index 05be344..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# FreeBSD tape drive options
-#
-Hardware End of Medium = no
-Fast Forward Space File = no
-BSF at EOM = yes
-Backward Space Record = no
-TWO EOF = yes
diff --git a/regress/scripts/linux_osst_tape_options b/regress/scripts/linux_osst_tape_options
deleted file mode 100644 (file)
index 5def0c0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-  Minimum Block Size = 32768
-  Maximum Block Size = 32768
-  Hardware End of Medium = yes
-  BSF at EOM = yes
-  Fast Forward Space File = yes
-  Two EOF = no
-
diff --git a/regress/scripts/linux_tape_options b/regress/scripts/linux_tape_options
deleted file mode 100644 (file)
index 601eb82..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# nothing needed for Linux
diff --git a/regress/scripts/new-test-bacula-dir.conf.in b/regress/scripts/new-test-bacula-dir.conf.in
deleted file mode 100644 (file)
index d1c849f..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-#
-# Default Bacula Director Configuration file
-#
-#  The only thing that MUST be changed is to add one or more
-#   file or directory names in the Include directive of the
-#   FileSet resource.
-#
-#  For Bacula release 1.33 
-#
-#  You might also want to change the default email address
-#   from root to your address.  See the "mail" and "operator"
-#   directives in the Messages resource.
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  SubSysDirectory = "@subsysdir@"
-  Maximum Concurrent Jobs = 4
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
-  Messages = Standard
-}
-
-#
-# Define the main nightly save backup job
-#   By default, this job will back up to disk in /tmp
-Job {
-  Name = "NightlySave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-  Maximum Concurrent Jobs = 4
-  SpoolData=yes
-}
-
-Job {
-  Name = "MonsterSave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File1
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "VerifyVolume"
-  Type = Verify
-  Level = VolumeToCatalog
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "SparseTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "CompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="CompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Maximum Concurrent Jobs = 4
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "SparseCompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseCompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-# Backup the catalog database (after the nightly save)
-Job {
-  Name = "BackupCatalog"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Catalog"
-#  Schedule = "WeeklyCycleAfterBackup"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  # This creates an ASCII copy of the catalog
-  RunBeforeJob = "@sbindir@/make_catalog_backup -u bacula"
-  # This deletes the copy of the catalog
-  RunAfterJob  = "@sbindir@/delete_catalog_backup"
-  Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
-}
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=MD5 { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseSet"
-  Include {
-    Options {
-      signature=MD5 sparse=yes
-    }
-    File = </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "CompressedSet"
-  Include {
-    Options {
-      signature=MD5 compression=GZIP 
-    }
-    File = </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseCompressedSet"
-  Include {
-    Options {
-      signature=MD5 compression=GZIP
-    }
-    File = </tmp/file-list
-  }
-}
-
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-#  differential (i.e. incremental since full) every other sunday,
-#  and incremental backups other days
-Schedule {
-  Name = "WeeklyCycle"
-  Run = Full 1st sun at 1:05
-  Run = Differential 2nd-5th sun at 1:05
-  Run = Incremental mon-sat at 1:05
-}
-
-# This schedule does the catalog. It starts after the WeeklyCycle
-Schedule {
-  Name = "WeeklyCycleAfterBackup"
-  Run = Full sun-sat at 1:10
-}
-
-# This is the backup of the catalog
-FileSet {
-  Name = "Catalog"
-  Include {
-    Options {
-      signature=MD5
-    }
-    File = /home/kern/bacula/regress/bin/working/bacula.sql
-  }
-}
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-  Maximum Concurrent Jobs = 4
-}
-
-# Definiton of file storage device
-Storage {
-  Name = File
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage
-  Media Type = File
-  Maximum Concurrent Jobs = 4
-}
-
-Storage {
-  Name = File1
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage1
-  Media Type = File1
-  Maximum Concurrent Jobs = 4
-}
-
-
-# Definition of DLT tape storage device
-#Storage {
-#  Name = DLTDrive
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = "HP DLT 80"                # must be same as Device in Storage daemon
-#  Media Type = DLT8000                # must be same as MediaType in Storage daemon
-#}
-
-# Definition of DDS tape storage device
-#Storage {
-#  Name = SDT-10000
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = SDT-10000                  # must be same as Device in Storage daemon
-#  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
-#}
-
-# Definition of 8mm tape storage device
-#Storage {
-#  Name = "8mmDrive"
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-#  Device = "Exabyte 8mm"
-#  MediaType = "8mm"
-#}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all
-  operator = @job_email@ = mount
-  console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
-  Name = NoEmail
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped, !terminate
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-# Label Format = "TEST-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}:${NumVols}"
-}
diff --git a/regress/scripts/prepare-two-tapes.in b/regress/scripts/prepare-two-tapes.in
deleted file mode 100755 (executable)
index 44cb7f9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-#
-# Create two blank tapes
-#
-@changer_path@ -f @autochanger@ unload
-@changer_path@ -f @autochanger@ load 1
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
-@changer_path@ -f @autochanger@ unload
-@changer_path@ -f @autochanger@ load 2
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
-@changer_path@ -f @autochanger@ unload
diff --git a/regress/scripts/regress-config b/regress/scripts/regress-config
deleted file mode 100755 (executable)
index 7ef93d8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# This is the configuration script for regression testing
-#
-
-CFLAGS="-g -O2 -Wall" \
- ./configure \
-    --sbindir=$1/bin \
-    --sysconfdir=$1/bin \
-    --with-pid-dir=$1/working \
-    --with-subsys-dir=$1/working \
-    --enable-smartalloc \
-    --disable-readline \
-    --with-working-dir=$1/working \
-    --with-dump-email=$2 \
-    --with-job-email=$2 \
-    $3 \
-    --with-baseport=8101 \
-    $4
-
-exit 0
diff --git a/regress/scripts/setup b/regress/scripts/setup
deleted file mode 100755 (executable)
index 1f8ba1b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-#
-# Script to setup running Bacula regression tests
-#
-cwd=`pwd`
-if [ $# != 4 ] ; then
-   echo "Incorrect number of arguments. Got $#. Need:"
-   echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
-   echo " "
-   exit 1
-fi
-if [ ! -d $1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
-   echo " "
-   exit 1
-fi
-rm -rf build bin
-# Copy new source
-echo "Copying source from $1"
-cp -rp $1 build
-cp scripts/regress-config build
-cd build
-rm -f Makefile config.cache
-# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
-make
-make install
-cp src/tools/testls ../bin
-
-cd ..
-bin/bacula stop
-cd bin
-./create_bacula_database
-./drop_bacula_tables
-./make_bacula_tables
-./grant_bacula_privileges
-cd ..
-# Start and stop Bacula to ensure conf files are OK
-bin/bacula start
-bin/bacula stop
-#
-# Save Bacula default conf files for later use
-#
-cp -f bin/*.conf scripts
diff --git a/regress/scripts/test-bacula-dir.conf.in b/regress/scripts/test-bacula-dir.conf.in
deleted file mode 100644 (file)
index e13bef2..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-#
-# Default Bacula Director Configuration file
-#
-#  The only thing that MUST be changed is to add one or more
-#   file or directory names in the Include directive of the
-#   FileSet resource.
-#
-#  For Bacula release 1.33 
-#
-#  You might also want to change the default email address
-#   from root to your address.  See the "mail" and "operator"
-#   directives in the Messages resource.
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  SubSysDirectory = "@subsysdir@"
-  Maximum Concurrent Jobs = 4
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
-  Messages = Daemon
-}
-
-#
-# Define the main nightly save backup job
-#   By default, this job will back up to disk in /tmp
-Job {
-  Name = "NightlySave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-  Maximum Concurrent Jobs = 4
-  SpoolData=yes
-}
-
-Job {
-  Name = "MonsterSave"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File1
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "VerifyVolume"
-  Type = Verify
-  Level = VolumeToCatalog
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
-  Name = "SparseTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "CompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="CompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Maximum Concurrent Jobs = 4
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
-  Name = "SparseCompressedTest"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="SparseCompressedSet"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-# Backup the catalog database (after the nightly save)
-Job {
-  Name = "BackupCatalog"
-  Type = Backup
-  Client=@hostname@-fd 
-  FileSet="Catalog"
-#  Schedule = "WeeklyCycleAfterBackup"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  # This creates an ASCII copy of the catalog
-  RunBeforeJob = "@sbindir@/make_catalog_backup -u bacula"
-  # This deletes the copy of the catalog
-  RunAfterJob  = "@sbindir@/delete_catalog_backup"
-  Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
-}
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=MD5 { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseSet"
-  Include = signature=MD5 sparse=yes { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "CompressedSet"
-  Include = signature=MD5 compression=GZIP { 
-    </tmp/file-list
-  }
-}
-
-FileSet {
-  Name = "SparseCompressedSet"
-  Include = signature=MD5 compression=GZIP { 
-    </tmp/file-list
-  }
-}
-
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-#  differential (i.e. incremental since full) every other sunday,
-#  and incremental backups other days
-Schedule {
-  Name = "WeeklyCycle"
-  Run = Full 1st sun at 1:05
-  Run = Differential 2nd-5th sun at 1:05
-  Run = Incremental mon-sat at 1:05
-}
-
-# This schedule does the catalog. It starts after the WeeklyCycle
-Schedule {
-  Name = "WeeklyCycleAfterBackup"
-  Run = Full sun-sat at 1:10
-}
-
-# This is the backup of the catalog
-FileSet {
-  Name = "Catalog"
-  Include = signature=MD5 {
-     /home/kern/bacula/regress/bin/working/bacula.sql
-  }
-}
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-  Maximum Concurrent Jobs = 4
-}
-
-# Definiton of file storage device
-Storage {
-  Name = File
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage
-  Media Type = File
-  Maximum Concurrent Jobs = 4
-}
-
-Storage {
-  Name = File1
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage1
-  Media Type = File1
-  Maximum Concurrent Jobs = 4
-}
-
-
-# Definition of DLT tape storage device
-#Storage {
-#  Name = DLTDrive
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = "HP DLT 80"                # must be same as Device in Storage daemon
-#  Media Type = DLT8000                # must be same as MediaType in Storage daemon
-#}
-
-# Definition of DDS tape storage device
-#Storage {
-#  Name = SDT-10000
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"          # password for Storage daemon
-#  Device = SDT-10000                  # must be same as Device in Storage daemon
-#  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
-#}
-
-# Definition of 8mm tape storage device
-#Storage {
-#  Name = "8mmDrive"
-#  Address = @hostname@                # N.B. Use a fully qualified name here
-#  SDPort = 8103
-#  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-#  Device = "Exabyte 8mm"
-#  MediaType = "8mm"
-#}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all
-  operator = @job_email@ = mount
-  console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
-  Name = NoEmail
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped, !terminate
-#
-# WARNING! the following will create a file that you must cycle from
-#          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
-#
-  append = "@working_dir@/log" = all, !skipped
-}
-
-#
-# Message delivery for daemon messages (no job).
-Messages {
-  Name = Daemon
-  mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
-  mail = @job_email@ = all, !skipped            
-  console = all, !skipped, !saved
-  append = "@working_dir@/log" = all, !skipped
-}
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
diff --git a/regress/scripts/test-bacula-fd.conf.in b/regress/scripts/test-bacula-fd.conf.in
deleted file mode 100644 (file)
index 1879119..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Default  Bacula File Daemon Configuration file
-#
-#  For Bacula release 1.33
-#
-# There is not much to change here except perhaps the
-# File daemon Name to
-#
-
-#
-# List Directors who are permitted to contact this File daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"
-}
-
-#
-# "Global" File daemon configuration specifications
-#
-FileDaemon {                          # this is me
-  Name = @hostname@-fd
-  FDport = 8102                  # where we listen for the director
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  SubSys Directory = "@subsysdir@"
-}
-
-# Send all messages except skipped files back to Director
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all, !terminate
-}
diff --git a/regress/scripts/test-bacula-sd.conf.in b/regress/scripts/test-bacula-sd.conf.in
deleted file mode 100644 (file)
index 390e0fb..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# Default Bacula Storage Daemon Configuration file
-#
-#  For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-#   on the "Archive Device" directive in the Device
-#   resource.  If you change the Name and/or the 
-#   "Media Type" in the Device resource, please ensure
-#   that dird.conf has corresponding changes.
-#
-
-Storage {                             # definition of myself
-  Name = @hostname@-sd
-  SDPort = 8103                  # Director's port      
-  WorkingDirectory = "@working_dir@"
-  Pid Directory = "@piddir@"
-  Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
-  Name = @hostname@-dir
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-#  same Name and MediaType. 
-#
-
-Device {
-  Name = FileStorage
-  Media Type = File
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabelled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-# Maximum File Size = 10KB
-}
-
-Device {
-  Name = FileStorage1
-  Media Type = File1
-  Archive Device = @tmpdir@
-  LabelMedia = yes;                   # lets Bacula label unlabelled media
-  Random Access = Yes;
-  AutomaticMount = yes;               # when device opened, read it
-  RemovableMedia = no;
-  AlwaysOpen = no;
-}
-
-
-#Device {
-#  Name = "HP DLT 80"
-#  Media Type = DLT8000
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#Device {
-#  Name = SDT-7000                     # 
-#  Media Type = DDS-2
-#  Archive Device = /dev/nst0
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = yes;
-#  RemovableMedia = yes;
-#}
-
-#Device {
-#  Name = Floppy
-#  Media Type = Floppy
-#  Archive Device = /mnt/floppy
-#  RemovableMedia = yes;
-#  Random Access = Yes;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = no;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-#  Name = "Exabyte 8mm"
-#  Media Type = "8mm"
-#  Archive Device = /dev/nst0
-#  Hardware end of medium = No;
-#  AutomaticMount = yes;               # when device opened, read it
-#  AlwaysOpen = Yes;
-#  RemovableMedia = yes;
-#}
-
-# 
-# Send all messages to the Director, 
-# mount messages also are sent to the email address
-#
-Messages {
-  Name = Standard
-  director = @hostname@-dir = all, !terminate
-}
diff --git a/regress/scripts/test-console.conf.in b/regress/scripts/test-console.conf.in
deleted file mode 100644 (file)
index 0fe916b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Bacula User Agent (or Console) Configuration File
-#
-
-Director {
-  Name = @hostname@-dir
-  DIRport = 8101
-  address = @hostname@
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
-}
diff --git a/regress/scripts/testa-bacula-dir.conf.in b/regress/scripts/testa-bacula-dir.conf.in
deleted file mode 100644 (file)
index 33701f7..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#
-# TestA   Bacula Director Configuration file
-#
-#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-
-Director {                            # define myself
-  Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
-  QueryFile = "@scriptdir@/query.sql"
-  WorkingDirectory = "@working_dir@"
-  PidDirectory = "@piddir@"
-  SubSysDirectory = "@subsysdir@"
-  Maximum Concurrent Jobs = 1
-  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
-  Messages = Standard
-}
-
-
-Job {
-  Name = "MultiVol"
-  Type = Backup
-  Client=@hostname@-fd 
-  Level = Full
-  FileSet="Full Set"
-  Storage = File 
-  Messages = Standard
-  Write Bootstrap = "@working_dir@/SmallVols.bsr"
-  Pool = SmallVols
-  SpoolData = yes
-}
-
-
-Job {
-  Name = "VerifyVolume"
-  Type = Verify
-  Level = VolumeToCatalog
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-
-# Standard Restore template, to be changed by Console program
-Job {
-  Name = "RestoreFiles"
-  Type = Restore
-  Client=@hostname@-fd 
-  FileSet="Full Set"
-  Storage = File
-  Messages = Standard
-  Pool = Default
-  Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
-  Name = "Full Set"
-  Include = signature=SHA1 { 
-    </tmp/file-list
-  }
-}
-
-
-# Client (File Services) to backup
-Client {
-  Name = @hostname@-fd
-  Address = @hostname@
-  FDPort = 8102
-  Catalog = MyCatalog
-  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
-  File Retention = 30d                # 30 days
-  Job Retention = 180d                # six months
-  AutoPrune = yes                     # Prune expired Jobs/Files
-}
-
-# Definiton of file storage device
-Storage {
-  Name = File
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage
-  Media Type = File
-}
-
-Storage {
-  Name = File1
-  Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
-  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-  Device = FileStorage1
-  Media Type = File1
-}
-
-
-# Generic catalog service
-Catalog {
-  Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-#  and to the console
-Messages {
-  Name = Standard
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = @job_email@ = all, !terminate
-  operator = @job_email@ = mount
-  console = all, !skipped, !terminate
-
-  append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
-  Name = NoEmail
-  mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped, !terminate, !restored
-  append = "@working_dir@/log" = all, !skipped
-}
-
-    
-# Default pool definition
-Pool {
-  Name = Default
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-}
-
-Pool {
-  Name = SmallVols
-  Pool Type = Backup
-  Recycle = yes                       # Bacula can automatically recycle Volumes
-  AutoPrune = yes                     # Prune expired volumes
-  Volume Retention = 365d             # one year
-  Accept Any Volume = yes             # write on any volume in the pool
-  Maximum Volumes = 10
-  MaximumVolumeBytes = 10M
-  LabelFormat = Small
-}
diff --git a/regress/tape b/regress/tape
deleted file mode 100755 (executable)
index 718cefe..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-./all-non-root-tape-tests
diff --git a/regress/tests/.cvsignore b/regress/tests/.cvsignore
deleted file mode 100644 (file)
index d00491f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/regress/tests/auto-label-test b/regress/tests/auto-label-test
deleted file mode 100755 (executable)
index 7f248ba..0000000
Binary files a/regress/tests/auto-label-test and /dev/null differ
diff --git a/regress/tests/backup-bacula-tape b/regress/tests/backup-bacula-tape
deleted file mode 100755 (executable)
index 4eedff4..0000000
Binary files a/regress/tests/backup-bacula-tape and /dev/null differ
diff --git a/regress/tests/backup-bacula-test b/regress/tests/backup-bacula-test
deleted file mode 100755 (executable)
index ecf1d3b..0000000
Binary files a/regress/tests/backup-bacula-test and /dev/null differ
diff --git a/regress/tests/bextract-test b/regress/tests/bextract-test
deleted file mode 100755 (executable)
index 8a55c19..0000000
Binary files a/regress/tests/bextract-test and /dev/null differ
diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape
deleted file mode 100755 (executable)
index 8858b6a..0000000
Binary files a/regress/tests/bscan-tape and /dev/null differ
diff --git a/regress/tests/bscan-test b/regress/tests/bscan-test
deleted file mode 100755 (executable)
index 3194a65..0000000
Binary files a/regress/tests/bscan-test and /dev/null differ
diff --git a/regress/tests/bsr-opt-test b/regress/tests/bsr-opt-test
deleted file mode 100755 (executable)
index 7284cc1..0000000
Binary files a/regress/tests/bsr-opt-test and /dev/null differ
diff --git a/regress/tests/btape-fill-full-tape b/regress/tests/btape-fill-full-tape
deleted file mode 100755 (executable)
index a2d5b5a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# Test the fill command in btape
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-
-echo " "
-echo " "
-echo " === Starting btape fill test ==="
-echo " === Starting btape fill test ===" >>working/log
-echo " "
-
-bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
-fill
-s
-
-quit
-END_OF_DATA
-
-
-grep "^The last block on the tape matches\. Test succeeded\." tmp/log1.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! btape fill test failed!!! !!!!! "
-   echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== btape fill test OK ===== "
-   echo "  ===== btape fill test OK ===== " >>test.out
-#  scripts/cleanup
-fi
diff --git a/regress/tests/btape-fill-tape b/regress/tests/btape-fill-tape
deleted file mode 100755 (executable)
index e32df1e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# Test the fill command in btape
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-
-echo "${cwd}/build" >/tmp/file-list
-
-cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
-sed "s%# MaximumVolumeSize%  MaximumVolumeSize%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-
-echo " "
-echo " "
-echo " === Starting btape fill test ==="
-echo " === Starting btape fill test ===" >>working/log
-echo " "
-exit
-bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
-fill
-s
-
-quit
-END_OF_DATA
-
-
-grep "^The last block on the tape matches\. Test succeeded\." tmp/log1.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! btape fill test failed!!! !!!!! "
-   echo "  !!!!! btape fill test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== btape fill test OK ===== "
-   echo "  ===== btape fill test OK ===== " >>test.out
-#  scripts/cleanup
-fi
diff --git a/regress/tests/compressed-test b/regress/tests/compressed-test
deleted file mode 100755 (executable)
index 6bd5d41..0000000
Binary files a/regress/tests/compressed-test and /dev/null differ
diff --git a/regress/tests/concurrent-jobs-test b/regress/tests/concurrent-jobs-test
deleted file mode 100755 (executable)
index dcd03a3..0000000
Binary files a/regress/tests/concurrent-jobs-test and /dev/null differ
diff --git a/regress/tests/decremental-test b/regress/tests/decremental-test
deleted file mode 100755 (executable)
index 41b2743..0000000
Binary files a/regress/tests/decremental-test and /dev/null differ
diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root
deleted file mode 100755 (executable)
index a032875..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! dev-test-root not run !!!! ===== "
-   echo "  ===== !!!! dev-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/dev" >/tmp/file-list
-
-echo " "
-echo " "
-echo " ===     Starting dev-test-root test       ==="
-echo " "
-echo " ===  Note, this test can fail for trivial ==="
-echo " ===  reasons on non-Linux systems.        ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
-cd ${cwd}/tmp
-#
-# Use sed to cut out parts that *always* change
-#
-cat >sed.scr <<END_OF_DATA
-s%.*dev$%dev%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
-END_OF_DATA
-
-# strip file system change messages then sed and sort
-grep -v "Skip: File system change prohibited." original >1
-sed -f sed.scr 1 | sort >original
-#
-mv -f restored 1
-sed -f sed.scr 1 | sort >restored
-rm -f sed.scr
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== !!!! dev-test-root failed !!!! ===== "
-   echo "  ===== !!!! dev-test-root failed !!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== dev-test-root OK ===== "
-   echo "  ===== dev-test-root OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root
deleted file mode 100755 (executable)
index 859745e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! etc-test-root not run !!!! ===== "
-   echo "  ===== !!!! etc-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-echo " "
-echo " "
-echo " === Starting /etc save/restore test ==="
-echo " "
-echo " "
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/etc" >/tmp/file-list
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select    
-unmark *
-mark *
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
-sort <${cwd}/tmp/1 >${cwd}/tmp/original
-sort <${cwd}/tmp/2 >${cwd}/tmp/restored
-rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/null
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== !!!! etc-test-root failed !!!! ===== "
-   echo "  ===== !!!! etc-test-root failed !!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== etc-test-root OK ===== "
-   echo "  ===== etc-test-root OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/fixed-block-size-tape b/regress/tests/fixed-block-size-tape
deleted file mode 100755 (executable)
index 23fe49a..0000000
Binary files a/regress/tests/fixed-block-size-tape and /dev/null differ
diff --git a/regress/tests/four-concurrent-jobs-tape b/regress/tests/four-concurrent-jobs-tape
deleted file mode 100755 (executable)
index 17f9d35..0000000
Binary files a/regress/tests/four-concurrent-jobs-tape and /dev/null differ
diff --git a/regress/tests/four-concurrent-jobs-test b/regress/tests/four-concurrent-jobs-test
deleted file mode 100755 (executable)
index 97772f7..0000000
Binary files a/regress/tests/four-concurrent-jobs-test and /dev/null differ
diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape
deleted file mode 100755 (executable)
index 90deecf..0000000
Binary files a/regress/tests/four-jobs-tape and /dev/null differ
diff --git a/regress/tests/four-jobs-test b/regress/tests/four-jobs-test
deleted file mode 100755 (executable)
index 092d88a..0000000
Binary files a/regress/tests/four-jobs-test and /dev/null differ
diff --git a/regress/tests/incremental-2tape b/regress/tests/incremental-2tape
deleted file mode 100755 (executable)
index 695a033..0000000
Binary files a/regress/tests/incremental-2tape and /dev/null differ
diff --git a/regress/tests/incremental-tape b/regress/tests/incremental-tape
deleted file mode 100755 (executable)
index 9a5b396..0000000
Binary files a/regress/tests/incremental-tape and /dev/null differ
diff --git a/regress/tests/incremental-test b/regress/tests/incremental-test
deleted file mode 100755 (executable)
index 7b0581c..0000000
Binary files a/regress/tests/incremental-test and /dev/null differ
diff --git a/regress/tests/lib-tape-root b/regress/tests/lib-tape-root
deleted file mode 100755 (executable)
index 8701602..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the /lib directory
-#   then restore it.
-#
-cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
-
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "/lib" >/tmp/file-list
-echo " "
-echo " "
-echo " === Starting lib-tape-root test ==="
-echo " "
-echo " "
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 Volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== lib-tape-root failed!!! ===== "
-   echo "  ===== lib-tape-root failed!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== lib-tape-root OK ===== "
-   echo "  ===== lib-tape-root OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root
deleted file mode 100755 (executable)
index 7efeb34..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-#   then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! lib-test-root not run !!!! ===== "
-   echo "  ===== !!!! lib-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/lib" >/tmp/file-list
-
-echo " "
-echo " "
-echo " === Starting /lib save/restore test ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select    
-unmark *
-mark *
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== !!!! lib-test-root failed !!!! ===== "
-   echo "  ===== !!!! lib-test-root failed !!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== lib-test-root OK ===== "
-   echo "  ===== lib-test-root OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/query-test b/regress/tests/query-test
deleted file mode 100755 (executable)
index 4c6523b..0000000
Binary files a/regress/tests/query-test and /dev/null differ
diff --git a/regress/tests/recycle-test b/regress/tests/recycle-test
deleted file mode 100755 (executable)
index df8a0ec..0000000
Binary files a/regress/tests/recycle-test and /dev/null differ
diff --git a/regress/tests/restore-by-file-tape b/regress/tests/restore-by-file-tape
deleted file mode 100755 (executable)
index 45ff175..0000000
Binary files a/regress/tests/restore-by-file-tape and /dev/null differ
diff --git a/regress/tests/restore-by-file-test b/regress/tests/restore-by-file-test
deleted file mode 100755 (executable)
index 5d1762c..0000000
Binary files a/regress/tests/restore-by-file-test and /dev/null differ
diff --git a/regress/tests/restore-disk-seek-test b/regress/tests/restore-disk-seek-test
deleted file mode 100755 (executable)
index c9dba17..0000000
Binary files a/regress/tests/restore-disk-seek-test and /dev/null differ
diff --git a/regress/tests/restore2-by-file-test b/regress/tests/restore2-by-file-test
deleted file mode 100755 (executable)
index 3d31a2b..0000000
Binary files a/regress/tests/restore2-by-file-test and /dev/null differ
diff --git a/regress/tests/six-vol-test b/regress/tests/six-vol-test
deleted file mode 100755 (executable)
index cb10f73..0000000
Binary files a/regress/tests/six-vol-test and /dev/null differ
diff --git a/regress/tests/small-file-size-tape b/regress/tests/small-file-size-tape
deleted file mode 100755 (executable)
index 9b7fa3f..0000000
Binary files a/regress/tests/small-file-size-tape and /dev/null differ
diff --git a/regress/tests/span-vol-test b/regress/tests/span-vol-test
deleted file mode 100755 (executable)
index 2b68dc0..0000000
Binary files a/regress/tests/span-vol-test and /dev/null differ
diff --git a/regress/tests/sparse-compressed-test b/regress/tests/sparse-compressed-test
deleted file mode 100755 (executable)
index 758ccef..0000000
Binary files a/regress/tests/sparse-compressed-test and /dev/null differ
diff --git a/regress/tests/sparse-test b/regress/tests/sparse-test
deleted file mode 100755 (executable)
index 33ee35f..0000000
Binary files a/regress/tests/sparse-test and /dev/null differ
diff --git a/regress/tests/test0 b/regress/tests/test0
deleted file mode 100755 (executable)
index 0d0edd0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-echo " " >test.out
-rm -f bin/working/*
diff --git a/regress/tests/two-jobs-test b/regress/tests/two-jobs-test
deleted file mode 100755 (executable)
index 9ae89ea..0000000
Binary files a/regress/tests/two-jobs-test and /dev/null differ
diff --git a/regress/tests/two-vol-test b/regress/tests/two-vol-test
deleted file mode 100755 (executable)
index adef8e4..0000000
Binary files a/regress/tests/two-vol-test and /dev/null differ
diff --git a/regress/tests/two-volume-tape b/regress/tests/two-volume-tape
deleted file mode 100755 (executable)
index d33e4e5..0000000
Binary files a/regress/tests/two-volume-tape and /dev/null differ
diff --git a/regress/tests/usr-tape-root b/regress/tests/usr-tape-root
deleted file mode 100755 (executable)
index 0f5002d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# Run a simple backup of the /usr directory
-#   then restore it.
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "/usr" >/tmp/file-list
-
-echo " "
-echo " "
-echo " === Starting usr-tape-root test ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 Volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  ===== !!!! usr-tape-root failed !!!! ===== "
-   echo "  ===== !!!! usr-tape-root failed !!!! ===== " >>test.out
-   echo " "
-else
-   echo "  ===== usr-tape-root OK ===== "
-   echo "  ===== usr-tape-root OK ===== " >>test.out
-   scripts/cleanup
-fi
diff --git a/regress/tests/verify-vol-test b/regress/tests/verify-vol-test
deleted file mode 100755 (executable)
index 0fcc2ea..0000000
Binary files a/regress/tests/verify-vol-test and /dev/null differ
diff --git a/regress/tests/weird-files-test b/regress/tests/weird-files-test
deleted file mode 100755 (executable)
index b4623fa..0000000
Binary files a/regress/tests/weird-files-test and /dev/null differ
diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test
deleted file mode 100755 (executable)
index 3d16e77..0000000
Binary files a/regress/tests/weird-files2-test and /dev/null differ
diff --git a/regress/weird-files.tar.gz b/regress/weird-files.tar.gz
deleted file mode 100644 (file)
index f84d1c0..0000000
Binary files a/regress/weird-files.tar.gz and /dev/null differ