Imported Upstream version 2.6.0p2 upstream/2.6.0p2
authorBdale Garbee <bdale@gag.com>
Mon, 20 Oct 2008 23:56:05 +0000 (01:56 +0200)
committerBdale Garbee <bdale@gag.com>
Mon, 20 Oct 2008 23:56:05 +0000 (01:56 +0200)
161 files changed:
ChangeLog
Makefile.in
NEWS
aclocal.m4
amandad-src/Makefile.in
amandad-src/amandad.c
amplot/Makefile.in
changer-src/Makefile.in
changer-src/chg-disk.sh
changer-src/chg-lib.sh.in
changer-src/chg-zd-mtx.sh
client-src/Makefile.am
client-src/Makefile.in
client-src/sendsize.c
common-src/Makefile.in
common-src/amanda.h
common-src/bsd-security.c
common-src/bsdtcp-security.c
common-src/bsdudp-security.c
common-src/conffile.c
common-src/debug.c
common-src/dgram.c
common-src/dgram.h
common-src/genversion.h
common-src/krb5-security.c
common-src/security-util.c
common-src/security-util.h
common-src/sockaddr-util.c
common-src/sockaddr-util.h
common-src/stream.c
common-src/svn-info.h
common-src/util.c
common-src/util.h
common-src/version.h
common-src/versuff.c
config/Makefile.in
config/amanda/debugging.m4
config/amanda/devprefix.m4
config/amanda/file-list
config/amanda/s3-device.m4
config/amanda/socklen_t_equiv.m4 [new file with mode: 0644]
config/config.h.in
configure
configure.in
device-src/Makefile.in
device-src/device.c
device-src/device.h
device-src/queueing.c
device-src/rait-device.c
device-src/s3-device.c
device-src/s3.c
device-src/tape-aix.c
device-src/tape-device.c
device-src/tape-ops.h
device-src/tape-posix.c
device-src/tape-uware.c
device-src/tape-xenix.c
device-src/tests/Makefile.in
device-src/tests/semaphore-test.c
device-src/tests/vfs_test.c
device-src/vfs-device.c
dumper-src/Makefile.in
example/Makefile.in
gnulib/Makefile.in
installcheck/Amanda_Config.pl
installcheck/Makefile.in
installcheck/amgetconf.pl
man/Makefile.am
man/Makefile.in
man/amaddclient.8
man/amadmin.8
man/amaespipe.8
man/amanda-client.conf.5
man/amanda.8
man/amanda.conf.5
man/amanda.css [new file with mode: 0644]
man/amcheck.8
man/amcheckdb.8
man/amcheckdump.8
man/amcleanup.8
man/amcrypt-ossl-asym.8
man/amcrypt-ossl.8
man/amcrypt.8
man/amcryptsimple.8
man/amdd.8
man/amdevcheck.8
man/amdump.8
man/amfetchdump.8
man/amflush.8
man/amgetconf.8
man/amgpgcrypt.8
man/amlabel.8
man/ammt.8
man/amoverview.8
man/amplot.8
man/amrecover.8
man/amreport.8
man/amrestore.8
man/amrmtape.8
man/amserverconfig.8
man/amstatus.8
man/amtape.8
man/amtapetype.8
man/amtoc.8
man/amverify.8
man/amverifyrun.8
man/index.php [new file with mode: 0644]
man/xml-source/amanda.conf.5.xml
man/xml-source/amcheck.8.xml
man/xml-source/amdump.8.xml
man/xml-source/amflush.8.xml
man/xml-source/amreport.8.xml
man/xml-source/amstatus.8.xml
man/xml-source/amtoc.8.xml
man/xslt/html.xsl.in [new file with mode: 0644]
man/xslt/man.xsl [deleted file]
man/xslt/man.xsl.in [new file with mode: 0644]
oldrecover-src/Makefile.in
packaging/Makefile.in
packaging/deb/amanda-backup-client.postrm
packaging/deb/amanda-backup-server.postrm
packaging/deb/buildpkg
packaging/deb/control
packaging/deb/postrm
packaging/deb/rules
packaging/rpm/amanda.spec
packaging/rpm/amanda.spec.orig [deleted file]
packaging/rpm/amanda.spec.rej [deleted file]
packaging/rpm/buildpkg
packaging/rpm/buildpkg.orig [deleted file]
packaging/rpm/buildpkg.rej [deleted file]
perl/Amanda/Changer.pm
perl/Amanda/Cmdline.pm
perl/Amanda/Cmdline.swg
perl/Amanda/Config.pm
perl/Amanda/Config.swg
perl/Amanda/Device.pm
perl/Amanda/Device.swg
perl/Amanda/Logfile.pm
perl/Amanda/Logfile.swg
perl/Amanda/Tapefile.pm
perl/Amanda/Tapefile.swg
perl/Amanda/Util.pm
perl/Amanda/Util.swg
perl/Makefile.am
perl/Makefile.in
perl/amglue/bigint.c
po/Makefile.in
recover-src/Makefile.in
restore-src/Makefile.in
restore-src/amidxtaped.c
server-src/Makefile.in
server-src/amadmin.c
server-src/amindexd.c
server-src/chunker.c
server-src/driver.c
server-src/reporter.c
server-src/tapefile.c
server-src/tapefile.h
server-src/taper.c
tape-src/Makefile.in

index 42929cf126d5d044973e2a6e646b0e797e672493..e671971a8cdbcfc14a817bad211e0b90a74e51a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,235 @@
+2008-08-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in, packaging/deb/rules,
+         packaging/deb/buildpkg, packaging/rpm/buildpkg,
+         packaging/rpm/amanda.spec: Change release to 2.6.0p2
+       * NEWS: News in 2.6.0p2
+
+2008-08-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/amglue/bigint.c: add #include "stdint.h"
+
+2008-08-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c (tape): Correctly print next tape to use.
+       * server-src/tapefile.c (print_new_tapes): New function to print new
+                                                  tapes.
+       * server-src/tapefile.h (print_new_tapes): Prototype.
+       * server-src/reporter.c: Correctly print next tape to use.
+
+2008-08-22  Dustin J. Mitchell <dustin@zmanda.com>
+       Thanks to Stefan G. Weichinger <sgw@amanda.org>
+       * server-src/taper.c: check errors from device, and handle them by
+         either requesting a new tape or just using the next tape in the
+         changer
+
+2008-08-22  Olivier Nicole <on@cs.ait.ac.th>
+       * changer-src/chg-disk.sh: replace == with =
+
+2008-08-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-lib.sh.in: fix sed invocation for BSD's sed
+
+2008-08-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Fix computation of compression ratio.
+
+2008-08-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Fix security_seterror use.
+
+2008-08-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/queueing.c: Fix compiler warning.
+
+2008-08-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: check for getgrgid_r and getpwuid_r
+       * common-src/security-util.c: conditionalize on checks
+
+2008-08-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/version.h: remove #include of config.h
+       * device-src/vfs-device.c: #include amanda.h first
+
+2008-08-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/debug.c: include backtraces on fatal errors
+       * config/amanda/debugging.m4: look for glibc's backtrace support
+       * configure.in: ditto
+
+2008-08-05 Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec:  Merged fixes from trunk .spec for
+         parsing redhat-release for fedora versions correctly.
+
+2008-08-04 Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec:  add %{tarver} macro and set the correct
+         minimum version per distro (Thanks to Jesse Angell for the rhel4 tip)
+
+2008-07-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer.pm perl/Amanda/Cmdline.swg
+         perl/Amanda/Config.swg perl/Amanda/DB/Catalog.pm
+         perl/Amanda/Device.swg perl/Amanda/Logfile.swg 
+         perl/Amanda/Util.swg: POD cleanup
+       * perl/Makefile.am: new files, rules to make HTML
+       * perl/amperl.css: CSS file for online POD
+       * perl/make_html.pl: make online POD
+
+2008-07-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/Makefile.am man/amanda.css man/index.php man/xslt/html.xsl.in:
+         new files for HTML output
+       * man/xslt/man.xsl.in: substitute XSLT_VERS
+       * man/xml-source/amanda-devices.7.xml: tweaks
+       * man/xml-source/amanda.8.xml: tweaks
+       * man/xml-source/amanda.conf.5.xml: tweaks
+       * man/xml-source/amgetconf.8.xml: tweaks
+       * man/xml-source/amtoc.8.xml: tweaks
+
+2008-07-30 Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec: removed activate-devpay from %files section
+
+2008-07-30 Dan Locks <dwlocks@zmanda.com>
+       * device-src/s3.c: Merged changes from 968 to work around a libcurl bug.
+       * config/amanda/s3-device.m4: Same
+
+2008-07-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Config.pl: add + to avoid perl-5.6.0 parsing bug
+       * installcheck/amgetconf.pl: ditto
+
+2008-07-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendsize.c: remove cruft causing compile errors on HP/UX
+
+2008-07-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tests/semaphore-test.c: move function call out of
+         variable initialization
+
+2008-07-25 Dan Locks <dwlocks@zmanda.com>
+       * packaging/deb/control: added alternative dependency of libssl0.9.8 for
+         Ubuntu 8.x builds.  Added build dependencies for debhelper, fakeroot,
+         libcurl-dev, libssl-dev.  Updated server and client dependency for curl
+         to libcurl3
+
+2008-07-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/conffile.c: fix handling for config overwrites of
+         non-string parameters
+
+2008-07-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: amandad must be run by root for krb5 auth.
+
+200i-07-14 Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec: fix distribution detection, add
+       activate-devpay to server files list
+
+2008-07-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/rait-device.c: fix RAIT file numbers; don't pass
+         block-size-related properties down to child devices (we set the block
+         size in find_block_size); don't use union_robust for checking whether
+         labels changed, as it causes spurious failures
+
+2008-07-11  Dustin J. Mitchell <dustin@zmanda.com>
+       Thanks to Stefan G. Weichinger <sgw@amanda.org>
+       * device-src/tape-*.c: return DEVICE_ERROR|VOLUME_MISSING on EIO while
+         checking tape_is_tape_device
+       * changer-src/chg-lib.sh.in: keep waiting for a device if it *might*
+         be busy or offline
+
+2008-07-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/rait-device.c: rewrite g_ptr_array_union_robust to
+         correctly detect and handle child device failures
+
+2008-07-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Logfile.swg: POD tweaks
+
+2008-07-06 Dan Locks <dwlocks@zmanda.com>
+       * packaging/deb/amanda-backup-server.postrm
+         packaging/deb/amanda-backup-client.postrm: removed unused
+         code
+       * packaging/deb/postrm: fixed typo in deluser command
+       * packaging/deb/rules: added specific preinst and postrm scripts for
+         client and server.
+
+2008-07-04 Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/buildpkg: add lines to copy rpms to root of the build dir.
+
+2008-06-30  Ian Turner <ian@zmanda.com>
+       * device-src/rait-device.c: Fix a memory corruption issue on the last
+         block of a file.
+       * device-src/rait-device.c: Track file numbers properly when child
+         devices change them (that is, in rait_device_start_file() and
+         rait_device_seek_file()).
+
+2008-06-27  Ian Turner <ian@zmanda.com>
+       * device-src/rait-device.c (rait_device_start): Check for consistent
+         volume label on all child devices, otherwise fail
+
+2008-06-27  Ian Turner <ian@zmanda.com>
+       * device-src/rait-device.c: Silence a compiler warning.
+
+2008-06-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/rait-device.c: hack around glib bug in versions <2.10.2
+
+2008-06-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/conffile.c: don't complain about a missing client conf
+         file, as the complaint interferes with the network communication
+         ("invalid size: could not open conf file")
+
+2008-06-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/*: bugfixes backported from trunk r1087
+         - device_read_block returns an int, not a gboolean, and sets in_file
+           = FALSE on EOF
+         - tape device only requires a label in READ and APPEND modes
+         - tape device isn't opened until start or read_label
+         - rait sets self->file correctly in start
+         - rait compares child devices' labels and times correctly
+         - vfs correctly chains up in property_get
+         - vfs sets self->file correctly in start with ACCESS_APPEND
+
+2008-06-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amdump.8.xml, man/xml-source/amreport.8.xml,
+         man/xml-source/amcheck.8.xml, man/xml-source/amflush.8.xml,
+         man/xml-source/amstatus.8.xml: Add "EXIT CODE" section".
+
+2008-05-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Remove unneeded pointer cast.
+       * common-src/stream.c: Fix compiler error.
+
+2008-05-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h, common-src/bsd-security.c,
+         common-src/bsdtcp-security.c, common-src/bsdudp-security.c,
+         common-src/dgram.c, common-src/dgram.h, common-src/krb5-security.c,
+         common-src/security-util.c, common-src/security-util.h,
+         common-src/sockaddr-util.c, common-src/sockaddr-util.h,
+         common-src/stream.c, common-src/util.c, common-src/util.h,
+         restore-src/amidxtaped.c, server-src/amindexd.c: add sockaddr_union,
+         change all relevant functions to use it, to avoid aliasing violations
+
+2008-05-29  Orion Poplawski <orion@cora.nwra.com>
+       * device-src/tests/semaphore-test.c: fix call to amanda_thread_init
+       * device-src/tests/vfs_test.c: fix call to amanda_thread_init
+       * server-src/chunker.c: fix buffer overrun
+
+2008-05-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (client_keytab): Remove "DEVICE-PROPERTY".
+
+2008-05-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/rait-device.c: rait-device returns correct size when
+         blocksize is too small
+
+2008-05-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-zd-mtx.sh: Fix logging.
+
+2008-05-25  Jean-Louis Martineau <martineau@zmanda.com>
+        * packaging/rpm/amanda.spec: Fix output message.
+
+2008-05-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Fix quoting of diskname.
+
+2008-05-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/socklen_t_equiv.m4: detect the type (not
+         necessarily socklen_t used by getpeername et al.
+       * amandad-src/amandad.c server-src/amindexd.c restore-src/amidxtaped.c
+         common-src/util.c common-src/bsdtcp-security.c common-src/amanda.h
+         common-src/krb5-security.c common-src/dgram.c common-src/stream.c:
+         use the type instead of socklen_t
+
+2008-05-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/amhpfixdevs.sh client-src/Makefile.am
+         client-src/amsinixfixdevs.sh config/amanda/devprefix.m4:
+         permanently remove amsinixfixdevs and amhpfixdevs
+
+2008-05-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Fix conf_parserror use.
+
 2008-05-13 Dan Locks <dwlocks@zmanda.com>
        * packaging/deb/buildpkg: modified build script to create unsigned
          packages
index 7119e180d223a9a10ff413387ead870f73d9b808..ac65c5e70b58582f2b4528d9c6bab7b0a7345be2 100644 (file)
@@ -83,6 +83,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
diff --git a/NEWS b/NEWS
index 88b0c32f31acc032f07a43ff2dcfcd8431c217bc..a039ad819cf41aa1fdd68a0da0426225d7c49fa9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Changes in release 2.6.0p2
+
+   * Bugs fix only:
+         o Various device-api fix
+         o Compilation on various platform
+         o others small fixes.
+
 Changes in release 2.6.0p1
 
    * Bugs fix only:
index 89cd353bc1a1e58eb1122b76bc709b5301503816..09703f0811d81a4135cb92a7eb00708d14475f67 100644 (file)
@@ -1287,6 +1287,7 @@ m4_include([config/amanda/readline.m4])
 m4_include([config/amanda/rsh-security.m4])
 m4_include([config/amanda/s3-device.m4])
 m4_include([config/amanda/shmem.m4])
+m4_include([config/amanda/socklen_t_equiv.m4])
 m4_include([config/amanda/ssh-security.m4])
 m4_include([config/amanda/summary.m4])
 m4_include([config/amanda/swig.m4])
index 3959987da3a74bd04c9c04ec7a5c770c9371222b..489ef144308d37a014c2d70c60213a66828e8ec3 100644 (file)
@@ -125,6 +125,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index ca3bde92305d14e36f4ecbaa8e4fff7a606a733e..430f2b7f6a5a33990c396891725f6a1f8f171e92 100644 (file)
@@ -218,7 +218,15 @@ main(
 
     config_init(CONFIG_INIT_CLIENT, NULL);
 
-    check_running_as(RUNNING_AS_CLIENT_LOGIN);
+    if (geteuid() == 0) {
+       check_running_as(RUNNING_AS_ROOT);
+       initgroups(CLIENT_LOGIN, get_client_gid());
+       setgid(get_client_gid());
+       setegid(get_client_gid());
+       seteuid(get_client_uid());
+    } else {
+       check_running_as(RUNNING_AS_CLIENT_LOGIN);
+    }
 
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
 
@@ -290,7 +298,7 @@ main(
            }
 #ifdef USE_REUSEADDR
            r = setsockopt(in, SOL_SOCKET, SO_REUSEADDR,
-               (void *)&on, (socklen_t)sizeof(on));
+               (void *)&on, (socklen_t_equiv)sizeof(on));
            if (r < 0) {
                dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"),
                          strerror(errno));
@@ -306,7 +314,7 @@ main(
            sin.sin_addr.s_addr = INADDR_ANY;
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
 #endif
-           if (bind(in, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
+           if (bind(in, (struct sockaddr *)&sin, (socklen_t_equiv)sizeof(sin)) < 0) {
                error(_("can't bind to port %d: %s\n"), atoi(argv[i]),
                    strerror(errno));
                /*NOTREACHED*/
@@ -322,7 +330,7 @@ main(
            struct sockaddr_in sin;
 #endif
            int sock;
-           socklen_t n;
+           socklen_t_equiv n;
 
            argv[i] += strlen("-tcp=");
 #ifdef WORKING_IPV6
@@ -336,7 +344,7 @@ main(
            }
 #ifdef USE_REUSEADDR
            r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-               (void *)&on, (socklen_t)sizeof(on));
+               (void *)&on, (socklen_t_equiv)sizeof(on));
            if (r < 0) {
                dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"),
                          strerror(errno));
@@ -351,13 +359,13 @@ main(
            sin.sin_addr.s_addr = INADDR_ANY;
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
 #endif
-           if (bind(sock, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
+           if (bind(sock, (struct sockaddr *)&sin, (socklen_t_equiv)sizeof(sin)) < 0) {
                error(_("can't bind to port %d: %s\n"), atoi(argv[i]),
                    strerror(errno));
                /*NOTREACHED*/
            }
            listen(sock, 10);
-           n = (socklen_t)sizeof(sin);
+           n = (socklen_t_equiv)sizeof(sin);
            in = out = accept(sock, (struct sockaddr *)&sin, &n);
        }
        /*
@@ -409,6 +417,18 @@ main(
        exit_on_qlength = 1;
     }
 
+    if (getuid() == 0) {
+       if (strcasecmp(auth, "krb5") != 0) {
+           error(_("Amanda must be run as user '%s' when using '%s' authetication"),
+                 CLIENT_LOGIN, auth);
+       }
+    } else {
+       if (strcasecmp(auth, "krb5") == 0) {
+           error(_("Amanda must be run as user 'root' when using 'krb5' authetication"));
+       }
+    }
+
+
     /* initialize */
 
     startclock();
@@ -422,6 +442,11 @@ main(
        dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n"));
     }
 
+    /* krb5 require the euid to be 0 */
+    if (strcasecmp(auth, "krb5") == 0) {
+       seteuid((uid_t)0);
+    }
+
     /*
      * Schedule to call protocol_accept() when new security handles
      * are created on stdin.
index cf7bc5e94578e9ff3e708d37d0c1ced43e782e90..f2e6b09beb74962be2b2a1f73160bb717f86626e 100644 (file)
@@ -206,6 +206,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 65dad199f89938605bb33b6e1d4a94f3e25f2f72..fb70087469307b02e1ab7d10e345d7f16506b73b 100644 (file)
@@ -218,6 +218,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index d8765845a604939743bd92740f4ecdd2f362f9d9..bdce74ace0796cd5885965cf6c2048a160f1ae34 100644 (file)
@@ -83,7 +83,7 @@ fi
 MYNAME=$0
 
 TAPE=`amgetconf$SUF tapedev`
-if test X"$TAPE" == X""; then
+if test X"$TAPE" = X""; then
     echo `_ '<none> tapedev not specified in amanda.conf.'`
     exit 2
 fi
index 7ed4e5a98a8b6cfacb4116ae8efa8482a67af44e..791154c70243ce2cb8ea3b4d8ff9d09a73c18c77 100644 (file)
@@ -95,15 +95,24 @@ tape_device_filename() {
 # on device status, since some devices can't differentiate between device
 # problems and an unlabeled volume.
 amdevcheck_status() {
-    amdevcheck_config_dir=`pwd`
-    amdevcheck_config_name=`basename $amdevcheck_config_dir`
-    amdevcheck_output=`amdevcheck $amdevcheck_config_name $@`
-
-    if test $? -eq 0 || \
-        echo $amdevcheck_output | grep UNLABELED > /dev/null; then
-        return 0
+    amdevcheck_message=
+    local amdevcheck_config_dir=`pwd`
+    local amdevcheck_config_name=`basename $amdevcheck_config_dir`
+    local amdevcheck_output=`amdevcheck $amdevcheck_config_name $@`
+    local amdevcheck_status=$?
+
+    test "$amdevcheck_status" -ne 0 && return 0
+
+    # extract any messages
+    amdevcheck_message=`echo "$amdevcheck_output" | sed '/^MESSAGE /{s/^MESSAGE //;p;}; d'`
+
+    # Return 1 if it's possible that the device is offline or busy; if the device cannot
+    # distinguish this state from an error condition, then our caller will just have to
+    # time out
+    if echo "$amdevcheck_output" | $EGREP "VOLUME_MISSING" > /dev/null; then
+       return 1
     else
-        return 1
+       return 0
     fi
 }
 
index 1588c2e45902e1a4c365e86e0211bd76e9f2b46e..464c07519537bdc4053e16dde5b0b92f11e124f9 100644 (file)
@@ -385,7 +385,7 @@ Exit() {
 ###
 
 Run() {
-       Log `_ 'Running: %s' "$@"`
+       Log `_ 'Running: %s' "$*"`
        rm -f $stdout $stderr
        "$@" > $stdout 2> $stderr
        exitcode=$?
index fa768ce5dded07f8b5f12c5ad661449b2950b99c..e21b7bb51cebde6278ab62901c52875b7db451ce 100644 (file)
@@ -20,9 +20,6 @@ amlib_LTLIBRARIES =   libamclient.la
 
 amlibexec_PROGRAMS =   noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize versionsuffix
 
-sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@
-EXTRA_SCRIPTS =        amhpfixdevs amsinixfixdevs
-
 amlibexec_SCRIPTS = patch-system
 
 CHECK_PERL = $(sbin_SCRIPTS)
index 4864f2bf13c00b913a1e35798728bccf60214748..e830366671f9fb0578c9b67a9f881ea817a70cd3 100644 (file)
@@ -217,6 +217,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
@@ -294,7 +295,7 @@ am__vpath_adj = case $$p in \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
-       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"
+       "$(DESTDIR)$(amlibexecdir)"
 amlibLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(amlib_LTLIBRARIES)
 libamclient_la_DEPENDENCIES = ../common-src/libamanda.la
@@ -372,8 +373,7 @@ versionsuffix_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
        ../amandad-src/libamandad.la ../common-src/libamanda.la \
        ../gnulib/libgnu.la
 amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS)
+SCRIPTS = $(amlibexec_SCRIPTS)
 DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -825,8 +825,6 @@ AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 amlib_LTLIBRARIES = libamclient.la
-sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@
-EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs
 amlibexec_SCRIPTS = patch-system
 CHECK_PERL = $(sbin_SCRIPTS)
 SCRIPTS_PERL = $(CHECK_PERL)
@@ -1004,25 +1002,6 @@ uninstall-amlibexecSCRIPTS:
          echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
          rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
-install-sbinSCRIPTS: $(sbin_SCRIPTS)
-       @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
-       @list='$(sbin_SCRIPTS)'; for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         if test -f $$d$$p; then \
-           f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-           echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
-           $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
-         else :; fi; \
-       done
-
-uninstall-sbinSCRIPTS:
-       @$(NORMAL_UNINSTALL)
-       @list='$(sbin_SCRIPTS)'; for p in $$list; do \
-         f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-         echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
-         rm -f "$(DESTDIR)$(sbindir)/$$f"; \
-       done
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -1158,7 +1137,7 @@ check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -1220,8 +1199,7 @@ install-data-am: install-amlibLTLIBRARIES
 
 install-dvi: install-dvi-am
 
-install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \
-       install-sbinSCRIPTS
+install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
@@ -1256,7 +1234,7 @@ ps: ps-am
 ps-am:
 
 uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
-       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
+       uninstall-amlibexecSCRIPTS
 
 .MAKE: install-am install-data-am install-exec-am install-strip
 
@@ -1270,13 +1248,12 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        install-data-hook install-dvi install-dvi-am install-exec \
        install-exec-am install-exec-hook install-html install-html-am \
        install-info install-info-am install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags uninstall uninstall-am \
-       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
-       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-amlibLTLIBRARIES \
+       uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS
 
 
 # Perl
index 97b28571ad5bcd7120effd66359b4ab13957a89b..4a335b7bdfb4a0ddf25d6ad5ea15666533d8219d 100644 (file)
@@ -1087,7 +1087,7 @@ getsize_dump(
     char       *disk,
     char       *amdevice,
     int                level,
-    option_t   *options,
+    option_t   *options G_GNUC_UNUSED,
     char      **errmsg)
 {
     int pipefd[2], nullfd, stdoutfd, killctl[2];
@@ -1112,10 +1112,6 @@ getsize_dump(
     int is_rundump = 1;
 #endif
 
-    (void)options;     /* Quiet unused parameter warning */
-
-    (void)getsize_smbtar;      /* Quiet unused parameter warning */
-
     g_snprintf(level_str, SIZEOF(level_str), "%d", level);
 
     device = amname_to_devname(amdevice);
index 4e5b8a9191b591f49acd2b1591dd5a9c24880e09..b88a9732f9f66144c8d89d553614d0037b8e52c6 100644 (file)
@@ -224,6 +224,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 886e1156ab9766b14946d288470b51c80a1a75fb..9aa3d6a4fafb080c308680991033e40d1ff456ab 100644 (file)
@@ -302,12 +302,6 @@ struct iovec {
 #include <arpa/inet.h>
 #endif
 
-/* Support for missing IPv6 components */
-#ifndef HAVE_SOCKADDR_STORAGE
-#  define sockaddr_storage sockaddr_in
-#  define ss_family sin_family
-#endif
-
 #ifdef WORKING_IPV6
 #define INET6
 #endif
@@ -420,6 +414,21 @@ extern int errno;
 #define MAX_TAPE_LABEL_BUF (MAX_TAPE_LABEL_LEN+1)
 #define MAX_TAPE_LABEL_FMT "%10240s"
 
+/* Unfortunately, the system-level sockaddr_storage definition can lead to
+ * C aliasing errors (where the optimizer doesn't notice that two operations
+ * affect the same datum).  We define our own similar type as a union.
+ */
+typedef union sockaddr_union {
+    struct sockaddr         sa;
+    struct sockaddr_in      sin;
+#ifdef WORKING_IPV6
+    struct sockaddr_in6     sin6;
+#endif
+#ifdef HAVE_SOCKADDR_STORAGE
+    struct sockaddr_storage ss;        /* not used; just here to make the union full-size */
+#endif
+} sockaddr_union;
+
 #include "debug.h"
 #include "file.h"
 
@@ -712,7 +721,7 @@ time_t      unctime(char *timestr);
 
 /* from old bsd-security.c */
 extern int debug;
-extern int check_security(struct sockaddr_storage *, char *, unsigned long, char **);
+extern int check_security(sockaddr_union *, char *, unsigned long, char **);
 
 /*
  * Handle functions which are not always declared on all systems.  This
@@ -721,7 +730,7 @@ extern int check_security(struct sockaddr_storage *, char *, unsigned long, char
 
 /* AIX #defines accept, and provides a prototype for the alternate name */
 #if !defined(HAVE_ACCEPT_DECL) && !defined(accept)
-extern int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
+extern int accept(int s, struct sockaddr *addr, socklen_t_equiv *addrlen);
 #endif
 
 #ifndef HAVE_ATOF_DECL
@@ -737,7 +746,7 @@ extern void bcopy(const void *s1, void *s2, size_t n);
 #endif
 
 #ifndef HAVE_BIND_DECL
-extern int bind(int s, const struct sockaddr *name, socklen_t namelen);
+extern int bind(int s, const struct sockaddr *name, socklen_t_equiv namelen);
 #endif
 
 #ifndef HAVE_BZERO
@@ -753,7 +762,7 @@ extern void closelog(void);
 #endif
 
 #ifndef HAVE_CONNECT_DECL
-extern int connect(int s, struct sockaddr *name, socklen_t namelen);
+extern int connect(int s, struct sockaddr *name, socklen_t_equiv namelen);
 #endif
 
 #ifndef HAVE_FCLOSE_DECL
@@ -800,17 +809,17 @@ extern int getopt(int argc, char * const *argv, const char *optstring);
 
 /* AIX #defines getpeername, and provides a prototype for the alternate name */
 #if !defined(HAVE_GETPEERNAME_DECL) && !defined(getpeername)
-extern int getpeername(int s, struct sockaddr *name, socklen_t *namelen);
+extern int getpeername(int s, struct sockaddr *name, socklen_t_equiv *namelen);
 #endif
 
 /* AIX #defines getsockname, and provides a prototype for the alternate name */
 #if !defined(HAVE_GETSOCKNAME_DECL) && !defined(getsockname)
-extern int getsockname(int s, struct sockaddr *name, socklen_t *namelen);
+extern int getsockname(int s, struct sockaddr *name, socklen_t_equiv *namelen);
 #endif
 
 #ifndef HAVE_GETSOCKOPT_DECL
 extern int getsockopt(int s, int level, int optname, char *optval,
-                        socklen_t *optlen);
+                        socklen_t_equiv *optlen);
 #endif
 
 #ifndef HAVE_INITGROUPS
@@ -898,7 +907,7 @@ extern void *realloc(void *ptr, size_t size);
 /* AIX #defines recvfrom, and provides a prototype for the alternate name */
 #if !defined(HAVE_RECVFROM_DECL) && !defined(recvfrom)
 extern int recvfrom(int s, char *buf, int len, int flags,
-                      struct sockaddr *from, socklen_t *fromlen);
+                      struct sockaddr *from, socklen_t_equiv *fromlen);
 #endif
 
 #ifndef HAVE_REMOVE_DECL
index 8953f1f9308e72bf3a951bda549a45258cef2f46..4be79482bb6bc036871bcc539bab6b8c6d133dd2 100644 (file)
@@ -37,6 +37,7 @@
 #include "packet.h"
 #include "security.h"
 #include "security-util.h"
+#include "sockaddr-util.h"
 #include "stream.h"
 #include "version.h"
 
@@ -277,7 +278,7 @@ bsd_connect(
     handle=alloc(15);
     g_snprintf(handle, 14, "000-%08x",  (unsigned)newhandle++);
     if (udp_inithandle(bh->udp, bh, canonname,
-       (struct sockaddr_storage *)res_addr->ai_addr, port, handle, sequence) < 0) {
+       (sockaddr_union *)res_addr->ai_addr, port, handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
        amfree(bh);
@@ -387,7 +388,7 @@ bsd_stream_server(
 
     bs = alloc(SIZEOF(*bs));
     security_streaminit(&bs->secstr, &bsd_security_driver);
-    bs->socket = stream_server(bh->udp->peer.ss_family, &bs->port,
+    bs->socket = stream_server(SU_GET_FAMILY(&bh->udp->peer), &bs->port,
                               (size_t)STREAM_BUFSIZE, (size_t)STREAM_BUFSIZE,
                               0);
     if (bs->socket < 0) {
index 3c2e84b04fdcc42c2f42c20f5bebba2da01c80f8..50985d97d3b132eb50abbf30c1ddc68a3aabef61 100644 (file)
@@ -197,8 +197,8 @@ bsdtcp_accept(
     void       (*fn)(security_handle_t *, pkt_t *),
     void       *datap)
 {
-    struct sockaddr_storage sin;
-    socklen_t len;
+    sockaddr_union sin;
+    socklen_t_equiv len;
     struct tcp_conn *rc;
     char hostname[NI_MAXHOST];
     int result;
index 2ae9e4edb1cb26ed063c82f9a7e1182601640bec..d42432080971afd323d53172302daced685e1f3b 100644 (file)
@@ -261,7 +261,7 @@ bsdudp_connect(
     handle=alloc(15);
     g_snprintf(handle,14,"000-%08x", newhandle++);
     if (udp_inithandle(bh->udp, bh, canonname,
-                      (struct sockaddr_storage *)res_addr->ai_addr, port,
+                      (sockaddr_union *)res_addr->ai_addr, port,
                       handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
index b25484566f18790c3307973dc34e01d9560e704c..18afa9e8d1843d86b275ac25a792ee12c6397175 100644 (file)
@@ -582,7 +582,6 @@ keytab_t client_keytab[] = {
     { "INDEX_SERVER", CONF_INDEX_SERVER },
     { "TAPE_SERVER", CONF_TAPE_SERVER },
     { "TAPEDEV", CONF_TAPEDEV },
-    { "DEVICE-PROPERTY", CONF_DEVICE_PROPERTY },
     { "AUTH", CONF_AUTH },
     { "SSH_KEYS", CONF_SSH_KEYS },
     { "AMANDAD_PATH", CONF_AMANDAD_PATH },
@@ -1388,8 +1387,14 @@ read_conffile(
     current_filename = config_dir_relative(filename);
 
     if ((current_file = fopen(current_filename, "r")) == NULL) {
-       g_fprintf(stderr, _("could not open conf file \"%s\": %s\n"), current_filename,
+       /* client conf files are optional, and this fprintf ends up sending this message back
+        * to the server without proper auth encapsulation, leading to "invalid size: could not
+        * open .."  This is fixed in TRUNK by completely rewriting this module's error-handling
+        * code. */
+       if (!is_client) {
+           g_fprintf(stderr, _("could not open conf file \"%s\": %s\n"), current_filename,
                strerror(errno));
+       }
        got_parserror = TRUE;
        goto finish;
     }
@@ -1573,7 +1578,7 @@ read_block(
                    if(np->token == tok) break;
 
                if(np->token == CONF_UNKNOWN)
-                   conf_parserror(errormsg);
+                   conf_parserror("%s", errormsg);
                else {
                    np->read_function(np, &valarray[np->parm]);
                    if(np->validate_function)
@@ -3962,7 +3967,7 @@ apply_config_overwrites(
        if (key_parm->type == CONFTYPE_STR) {
            current_line = vstralloc("\"", value, "\"", NULL);
        } else {
-           current_line = stralloc("");
+           current_line = stralloc(value);
        }
 
        current_char = current_line;
index a6de4154c5efcf350f3bd7a5947649e7c8e7e06c..ed036e48599056208a027e9fa3a55d9455ee5e32 100644 (file)
 #include "timestamp.h"
 #include "conffile.h"
 
+#ifdef HAVE_GLIBC_BACKTRACE
+#include <execinfo.h>
+#endif
+
 /* Minimum file descriptor on which to keep the debug file.  This is intended
  * to keep the descriptor "out of the way" of other processing.  It's not clear
  * that this is required any longer, but it doesn't hurt anything.
@@ -159,6 +163,16 @@ debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED,
            fflush(stderr);
        }
 
+#ifdef HAVE_GLIBC_BACKTRACE
+       /* try logging a traceback to the debug log */
+       if (db_fd != -1) {
+           void *stack[32];
+           int naddrs;
+           naddrs = backtrace(stack, sizeof(stack)/sizeof(*stack));
+           backtrace_symbols_fd(stack, naddrs, db_fd);
+       }
+#endif
+
        /* we're done */
        if (log_level & G_LOG_LEVEL_CRITICAL)
            exit(error_exit_status);
index 338baa8eab8f6cd269bb05de72a506fe9d735fae..7fbabb0c517339be80df497ff4b9d06a1306c4aa 100644 (file)
@@ -57,8 +57,8 @@ dgram_bind(
     in_port_t *        portp)
 {
     int s, retries;
-    socklen_t len;
-    struct sockaddr_storage name;
+    socklen_t_equiv len;
+    sockaddr_union name;
     int save_errno;
     int *portrange;
 
@@ -79,8 +79,8 @@ dgram_bind(
        return -1;
     }
 
-    SS_INIT(&name, family);
-    SS_SET_INADDR_ANY(&name);
+    SU_INIT(&name, family);
+    SU_SET_INADDR_ANY(&name);
 
     /*
      * If a port range was specified, we try to get a port in that
@@ -117,7 +117,7 @@ dgram_bind(
 out:
     /* find out what name was actually used */
 
-    len = (socklen_t)sizeof(name);
+    len = (socklen_t_equiv)sizeof(name);
     if(getsockname(s, (struct sockaddr *)&name, &len) == -1) {
        save_errno = errno;
        dbprintf(_("dgram_bind: getsockname() failed: %s\n"), strerror(save_errno));
@@ -125,7 +125,7 @@ out:
        aclose(s);
        return -1;
     }
-    *portp = SS_GET_PORT(&name);
+    *portp = SU_GET_PORT(&name);
     dgram->socket = s;
 
     dbprintf(_("dgram_bind: socket %d bound to %s\n"),
@@ -136,7 +136,7 @@ out:
 
 int
 dgram_send_addr(
-    struct sockaddr_storage    *addr,
+    sockaddr_union     *addr,
     dgram_t *          dgram)
 {
     int s, rc;
@@ -158,7 +158,7 @@ dgram_send_addr(
        s = dgram->socket;
        socket_opened = 0;
     } else {
-       if((s = socket(addr->ss_family, SOCK_DGRAM, 0)) == -1) {
+       if((s = socket(SU_GET_FAMILY(addr), SOCK_DGRAM, 0)) == -1) {
            save_errno = errno;
            dbprintf(_("dgram_send_addr: socket() failed: %s\n"),
                      strerror(save_errno));
@@ -168,7 +168,7 @@ dgram_send_addr(
        socket_opened = 1;
 #ifdef USE_REUSEADDR
        r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
-               (void *)&on, (socklen_t)sizeof(on));
+               (void *)&on, (socklen_t_equiv)sizeof(on));
        if (r < 0) {
            dbprintf(_("dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n"),
                      strerror(errno));
@@ -241,13 +241,13 @@ ssize_t
 dgram_recv(
     dgram_t *          dgram,
     int                        timeout,
-    struct sockaddr_storage *fromaddr)
+    sockaddr_union *fromaddr)
 {
     SELECT_ARG_TYPE ready;
     struct timeval to;
     ssize_t size;
     int sock;
-    socklen_t addrlen;
+    socklen_t_equiv addrlen;
     ssize_t nfound;
     int save_errno;
 
@@ -287,7 +287,7 @@ dgram_recv(
        return nfound;
     }
 
-    addrlen = (socklen_t)sizeof(struct sockaddr_storage);
+    addrlen = (socklen_t_equiv)sizeof(sockaddr_union);
     size = recvfrom(sock, dgram->data, (size_t)MAX_DGRAM, 0,
                    (struct sockaddr *)fromaddr, &addrlen);
     if(size == -1) {
index 442fee845e4acb85a2e808ce65c5416c94838a05..84277b8a9d7bae6c036a6edcdf85873e7950eb7d 100644 (file)
@@ -50,9 +50,9 @@ typedef struct dgram_s {
 
 int    dgram_bind(dgram_t *dgram, sa_family_t family, in_port_t *portp);
 void   dgram_socket(dgram_t *dgram, int sock);
-int    dgram_send_addr(struct sockaddr_storage *addr, dgram_t *dgram);
+int    dgram_send_addr(sockaddr_union *addr, dgram_t *dgram);
 ssize_t        dgram_recv(dgram_t *dgram, int timeout,
-                  struct sockaddr_storage *fromaddr);
+                  sockaddr_union *fromaddr);
 void   dgram_zero(dgram_t *dgram);
 int    dgram_cat(dgram_t *dgram, const char *fmt, ...)
      G_GNUC_PRINTF(2,3);
index b6635632303d00ccc6586b0482037f542c69fb6d..316c245b61cd255d966d16c07337b482b81a8a4e 100644 (file)
@@ -1,3 +1,3 @@
 #define CC "gcc"
-#define BUILT_DATE "Wed May 14 17:05:51 EDT 2008"
+#define BUILT_DATE "Fri Aug 22 14:21:05 EDT 2008"
 #define BUILT_MACH "x86_64-unknown-linux-gnu"
index dc70b318dcb49a00204c547a4b4bc4f91a435716..6c6572b619abcb557e532b64eafb7db5ff45279e 100644 (file)
@@ -331,8 +331,8 @@ krb5_accept(
     void       (*fn)(security_handle_t *, pkt_t *),
     void       *datap)
 {
-    struct sockaddr_storage sin;
-    socklen_t len;
+    sockaddr_union sin;
+    socklen_t_equiv len;
     struct tcp_conn *rc;
     char hostname[NI_MAXHOST];
     int result;
@@ -511,7 +511,7 @@ gss_client(
         * Send back the response
         */
        if (send_tok.length != 0 && tcpm_send_token(rc, rc->write, rs->handle, &errmsg, send_tok.value, send_tok.length) < 0) {
-           security_seterror(&rh->sech, rc->errmsg);
+           security_seterror(&rh->sech, "%s", rc->errmsg);
            gss_release_buffer(&min_stat, &send_tok);
            goto done;
        }
index 7ecb4437759c302a854e421d0f2f5e1dd01b1023..77e5d0c8c914a8daac3996b5ffb0797e20d582f5 100644 (file)
@@ -764,7 +764,7 @@ tcp1_stream_server(
        rh->rc = sec_tcp_conn_get(rh->hostname, 1);
        rh->rc->driver = rh->sech.driver;
        rs->rc = rh->rc;
-       rs->socket = stream_server(rh->udp->peer.ss_family, &rs->port,
+       rs->socket = stream_server(SU_GET_FAMILY(&rh->udp->peer), &rs->port,
                                   STREAM_BUFSIZE, STREAM_BUFSIZE, 0);
        if (rs->socket < 0) {
            security_seterror(&rh->sech,
@@ -963,7 +963,7 @@ bsd_recv_security_ok(
        /*
         * Request packets must come from a reserved port
         */
-    port = SS_GET_PORT(&rh->peer);
+    port = SU_GET_PORT(&rh->peer);
        if (port >= IPPORT_RESERVED) {
            security_seterror(&rh->sech,
                _("host %s: port %u not secure"), rh->hostname,
@@ -1274,7 +1274,7 @@ udp_inithandle(
     udp_handle_t *     udp,
     struct sec_handle *        rh,
     char *              hostname,
-    struct sockaddr_storage *addr,
+    sockaddr_union *addr,
     in_port_t          port,
     char *             handle,
     int                        sequence)
@@ -1288,7 +1288,7 @@ udp_inithandle(
 
     rh->hostname = stralloc(hostname);
     copy_sockaddr(&rh->peer, addr);
-    SS_SET_PORT(&rh->peer, port);
+    SU_SET_PORT(&rh->peer, port);
 
 
     rh->prev = udp->bh_last;
@@ -1395,7 +1395,7 @@ udp_netfd_read_callback(
        return;
     }
 
-    port = SS_GET_PORT(&udp->peer);
+    port = SU_GET_PORT(&udp->peer);
     a = udp_inithandle(udp, rh,
                   hostname,
                   &udp->peer,
@@ -2077,7 +2077,7 @@ check_user_ruserok(
 char *
 check_user_amandahosts(
     const char *       host,
-    struct sockaddr_storage *addr,
+    sockaddr_union *addr,
     struct passwd *    pwd,
     const char *       remoteuser,
     const char *       service)
@@ -2160,12 +2160,12 @@ check_user_amandahosts(
            (strcasecmp(filehost, "localhost")== 0 ||
             strcasecmp(filehost, "localhost.localdomain")== 0)) {
 #ifdef WORKING_IPV6
-           if (addr->ss_family == (sa_family_t)AF_INET6)
-               inet_ntop(AF_INET6, &((struct sockaddr_in6 *)addr)->sin6_addr,
+           if (SU_GET_FAMILY(addr) == (sa_family_t)AF_INET6)
+               inet_ntop(AF_INET6, &addr->sin6.sin6_addr,
                          ipstr, sizeof(ipstr));
            else
 #endif
-               inet_ntop(AF_INET, &((struct sockaddr_in *)addr)->sin_addr,
+               inet_ntop(AF_INET, &addr->sin.sin_addr,
                          ipstr, sizeof(ipstr));
            if (strcmp(ipstr, "127.0.0.1") == 0 ||
                strcmp(ipstr, "::1") == 0)
@@ -2260,7 +2260,7 @@ common_exit:
 /* return 1 on success, 0 on failure */
 int
 check_security(
-    struct sockaddr_storage *addr,
+    sockaddr_union *addr,
     char *             str,
     unsigned long      cksum,
     char **            errstr)
@@ -2304,7 +2304,7 @@ check_security(
 
 
     /* next, make sure the remote port is a "reserved" one */
-    port = SS_GET_PORT(addr);
+    port = SU_GET_PORT(addr);
     if (port >= IPPORT_RESERVED) {
        *errstr = vstrallocf(_("[host %s: port %u not secure]"),
                        remotehost, (unsigned int)port);
@@ -2504,14 +2504,14 @@ show_stat_info(
 {
     char *name = vstralloc(a, b, NULL);
     struct stat sbuf;
-    struct passwd *pwptr;
-    struct passwd pw;
+    struct passwd *pwptr G_GNUC_UNUSED;
+    struct passwd pw G_GNUC_UNUSED;
     char *owner;
-    struct group *grptr;
-    struct group gr;
+    struct group *grptr G_GNUC_UNUSED;
+    struct group gr G_GNUC_UNUSED;
     char *group;
-    int buflen;
-    char *buf;
+    int buflen G_GNUC_UNUSED;
+    char *buf G_GNUC_UNUSED;
 
     if (stat(name, &sbuf) != 0) {
        auth_debug(1, _("bsd: cannot stat %s: %s\n"), name, strerror(errno));
@@ -2528,20 +2528,27 @@ show_stat_info(
 #endif
     buf = malloc(buflen);
 
-    if (getpwuid_r(sbuf.st_uid, &pw, buf, buflen, &pwptr) != 0 ||
-       pwptr == NULL) {
+#ifdef HAVE_GETPWUID_R
+    if (getpwuid_r(sbuf.st_uid, &pw, buf, buflen, &pwptr) == 0 &&
+       pwptr != NULL) {
+       owner = stralloc(pwptr->pw_name);
+    } else
+#endif
+    {
        owner = alloc(NUM_STR_SIZE + 1);
        g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_uid);
-    } else {
-       owner = stralloc(pwptr->pw_name);
     }
-    if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) != 0 ||
-       grptr == NULL) {
+#ifdef HAVE_GETGRGID_R
+    if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) == 0 &&
+       grptr != NULL) {
+       group = stralloc(grptr->gr_name);
+    } else
+#endif
+    {
        group = alloc(NUM_STR_SIZE + 1);
        g_snprintf(group, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid);
-    } else {
-       group = stralloc(grptr->gr_name);
     }
+
     auth_debug(1, _("bsd: processing file: %s\n"), name);
     auth_debug(1, _("bsd:                  owner=%s group=%s mode=%03o\n"),
                   owner, group,
@@ -2588,7 +2595,7 @@ check_name_give_sockaddr(
     }
 
     for(res1=res; res1 != NULL; res1 = res1->ai_next) {
-       if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) {
+       if (cmp_sockaddr((sockaddr_union *)res1->ai_addr, (sockaddr_union *)addr, 1) == 0) {
            freeaddrinfo(res);
            amfree(canonname);
            return 0;
@@ -2596,10 +2603,10 @@ check_name_give_sockaddr(
     }
 
     dbprintf(_("%s doesn't resolve to %s"),
-           hostname, str_sockaddr((struct sockaddr_storage *)addr));
+           hostname, str_sockaddr((sockaddr_union *)addr));
     *errstr = newvstrallocf(*errstr,
                           "%s doesn't resolve to %s",
-                          hostname, str_sockaddr((struct sockaddr_storage *)addr));
+                          hostname, str_sockaddr((sockaddr_union *)addr));
 error:
     if (res) freeaddrinfo(res);
     amfree(canonname);
index dd1e3ccb9e5542b1d278eacb7a44b616d88d9231..22accfc4b8395026de00c3be4056901d569ea5bd 100644 (file)
@@ -76,7 +76,7 @@ struct tcp_conn {
     int                        refcnt;                 /* number of handles using */
     int                        handle;                 /* last proto handle read */
     void               (*accept_fn)(security_handle_t *, pkt_t *);
-    struct sockaddr_storage    peer;
+    sockaddr_union     peer;
     TAILQ_ENTRY(tcp_conn) tq;                  /* queue handle */
     int                        (*recv_security_ok)(struct sec_handle *, pkt_t *);
     char *             (*prefix_packet)(void *, pkt_t *);
@@ -109,7 +109,7 @@ struct sec_handle {
     } fn;
     void *             arg;            /* argument to pass function */
     event_handle_t *   ev_timeout;     /* timeout handle for recv */
-    struct sockaddr_storage    peer;
+    sockaddr_union     peer;
     int                        sequence;
     event_id_t         event_id;
     char *             proto_handle;
@@ -165,7 +165,7 @@ extern struct connq_s connq;
 typedef struct udp_handle {
     const struct security_driver *driver;      /* MUST be first */
     dgram_t dgram;             /* datagram to read/write from */
-    struct sockaddr_storage peer;      /* who sent it to us */
+    sockaddr_union peer;       /* who sent it to us */
     pkt_t pkt;                 /* parsed form of dgram */
     char *handle;              /* handle from recvd packet */
     int sequence;              /* seq no of packet */
@@ -255,7 +255,7 @@ void        udp_recvpkt_cancel(void *);
 void   udp_recvpkt_callback(void *);
 void   udp_recvpkt_timeout(void *);
 int    udp_inithandle(udp_handle_t *, struct sec_handle *, char *hostname,
-                      struct sockaddr_storage *, in_port_t, char *, int);
+                      sockaddr_union *, in_port_t, char *, int);
 void   udp_netfd_read_callback(void *);
 
 struct tcp_conn *sec_tcp_conn_get(const char *, int);
@@ -270,7 +270,7 @@ char *      check_user_ruserok    (const char *host,
                                struct passwd *pwd,
                                const char *user);
 char * check_user_amandahosts(const char *host,
-                               struct sockaddr_storage *addr,
+                               sockaddr_union *addr,
                                struct passwd *pwd,
                                const char *user,
                                const char *service);
index 77fd54a0b11730ee1d001c2c655018caa8530741..ffc6ca2faff88c8842dd8a6142e66d02d0ae2b9d 100644 (file)
@@ -27,7 +27,7 @@
 
 void
 dump_sockaddr(
-    struct sockaddr_storage *sa)
+    sockaddr_union *sa)
 {
 #ifdef WORKING_IPV6
     char ipstr[INET6_ADDRSTRLEN];
@@ -36,24 +36,22 @@ dump_sockaddr(
 #endif
     int port;
 
-    port = SS_GET_PORT(sa);
+    port = SU_GET_PORT(sa);
 #ifdef WORKING_IPV6
-    if (sa->ss_family == (sa_family_t)AF_INET6) {
-       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
-                 ipstr, sizeof(ipstr));
+    if (SU_GET_FAMILY(sa) == AF_INET6) {
+       inet_ntop(AF_INET6, &sa->sin6.sin6_addr, ipstr, sizeof(ipstr));
        dbprintf("(sockaddr_in6 *)%p = { %d, %d, %s }\n",
                 sa,
-                ((struct sockaddr_in6 *)sa)->sin6_family,
+                SU_GET_FAMILY(sa),
                 port,
                 ipstr);
     } else
 #endif
     {
-       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
-                 sizeof(ipstr));
+       inet_ntop(AF_INET, &sa->sin.sin_addr.s_addr, ipstr, sizeof(ipstr));
        dbprintf("(sockaddr_in *)%p = { %d, %d, %s }\n",
                 sa,
-                ((struct sockaddr_in *)sa)->sin_family,
+                SU_GET_FAMILY(sa),
                 port,
                 ipstr);
     }
@@ -68,7 +66,7 @@ static char mystr_sockaddr[INET_ADDRSTRLEN + 20];
 
 char *
 str_sockaddr(
-    struct sockaddr_storage *sa)
+    sockaddr_union *sa)
 {
 #ifdef WORKING_IPV6
     char ipstr[INET6_ADDRSTRLEN];
@@ -77,77 +75,80 @@ str_sockaddr(
 #endif
     int port;
 
-    port = SS_GET_PORT(sa);
+    port = SU_GET_PORT(sa);
 #ifdef WORKING_IPV6
-    if ( sa->ss_family == (sa_family_t)AF_INET6) {
-       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
-                 ipstr, sizeof(ipstr));
+    if ( SU_GET_FAMILY(sa) == AF_INET6) {
+       inet_ntop(AF_INET6, &sa->sin6.sin6_addr, ipstr, sizeof(ipstr));
     } else
 #endif
     {
-       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
-                 sizeof(ipstr));
+       inet_ntop(AF_INET, &sa->sin.sin_addr.s_addr, ipstr, sizeof(ipstr));
     }
     g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port);
+    mystr_sockaddr[sizeof(mystr_sockaddr)-1] = '\0';
+
     return mystr_sockaddr;
 }
 
-int
-cmp_sockaddr(
-    struct sockaddr_storage *ss1,
-    struct sockaddr_storage *ss2,
-    int addr_only)
+/* Unmap a V4MAPPED IPv6 address into its equivalent IPv4 address.  The location
+ * TMP is used to store the rewritten address, if necessary.  Returns a pointer
+ * to the unmapped address.
+ */
+#if defined(WORKING_IPV6) && defined(IN6_IS_ADDR_V4MAPPED)
+static sockaddr_union *
+unmap_v4mapped(
+    sockaddr_union *sa,
+    sockaddr_union *tmp)
 {
-    /* if addresses are v4mapped, "unmap" them */
-#ifdef WORKING_IPV6
-#ifdef IN6_IS_ADDR_V4MAPPED
-    struct sockaddr_in ss1_v4;
-    struct sockaddr_in ss2_v4;
-
-    if (ss1->ss_family == AF_INET6 &&
-        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) {
-       memset(&ss1_v4, 0, sizeof(struct sockaddr_in));
-       memcpy(&ss1_v4.sin_addr.s_addr,
-              &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]),
+    if (SU_GET_FAMILY(sa) == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->sin6.sin6_addr)) {
+       SU_INIT(tmp, AF_INET);
+       SU_SET_PORT(tmp, SU_GET_PORT(sa));
+       /* extract the v4 address from byte 12 of the v6 address */
+       memcpy(&tmp->sin.sin_addr.s_addr,
+              &sa->sin6.sin6_addr.s6_addr[12],
               sizeof(struct in_addr));
-       ss1_v4.sin_family = AF_INET;
-       SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1));
-       ss1 = (struct sockaddr_storage *)&ss1_v4;
+       return tmp;
     }
 
-    if (ss2->ss_family == AF_INET6 &&
-        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) {
-       memset(&ss2_v4, 0, sizeof(struct sockaddr_in));
-       memcpy(&ss2_v4.sin_addr.s_addr,
-              &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]),
-              sizeof(struct in_addr));
-       ss2_v4.sin_family = AF_INET;
-       SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2));
-       ss2 = (struct sockaddr_storage *)&ss2_v4;
-    }
-#endif
+    return sa;
+}
+#else
+/* nothing to do if no IPv6 */
+#define unmap_v4mapped(sa, tmp) ((void)tmp, sa)
 #endif
 
-    if (ss1->ss_family == ss2->ss_family) {
+int
+cmp_sockaddr(
+    sockaddr_union *ss1,
+    sockaddr_union *ss2,
+    int addr_only)
+{
+    sockaddr_union tmp1, tmp2;
+
+    /* if addresses are v4mapped, "unmap" them */
+    ss1 = unmap_v4mapped(ss1, &tmp1);
+    ss2 = unmap_v4mapped(ss2, &tmp2);
+
+    if (SU_GET_FAMILY(ss1) == SU_GET_FAMILY(ss2)) {
         if (addr_only) {
 #ifdef WORKING_IPV6
-            if(ss1->ss_family == (sa_family_t)AF_INET6)
+            if(SU_GET_FAMILY(ss1) == AF_INET6)
                 return memcmp(
-                    &((struct sockaddr_in6 *)ss1)->sin6_addr,
-                    &((struct sockaddr_in6 *)ss2)->sin6_addr,
-                    sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr));
+                    &ss1->sin6.sin6_addr,
+                    &ss2->sin6.sin6_addr,
+                    sizeof(ss1->sin6.sin6_addr));
             else
 #endif
                 return memcmp(
-                    &((struct sockaddr_in *)ss1)->sin_addr,
-                    &((struct sockaddr_in *)ss2)->sin_addr,
-                    sizeof(((struct sockaddr_in *)ss1)->sin_addr));
+                    &ss1->sin.sin_addr,
+                    &ss2->sin.sin_addr,
+                    sizeof(ss1->sin.sin_addr));
         } else {
             return memcmp(ss1, ss2, SS_LEN(ss1));
         }
     } else {
         /* compare families to give a total order */
-        if (ss1->ss_family < ss2->ss_family)
+        if (SU_GET_FAMILY(ss1) < SU_GET_FAMILY(ss2))
             return -1;
         else
             return 1;
index 849dd2ac758a53becbfa851a22c48ed41ba50156..977c4f9a2efefc5af73660909caf7fa01f57e85a 100644 (file)
  * Utility routines for handling sockaddrs
  */
 
-#ifndef SOCKADDR_H
-#define        SOCKADDR_H
+#ifndef SOCKADDR_UTIL_H
+#define        SOCKADDR_UTIL_H
 
 #include "amanda.h"
 
-/* Dump a sockaddr_storage using dbprintf
+/* Dump a sockaddr_union using dbprintf
  *
  * @param sa: the sockaddr to dump
  */
-void   dump_sockaddr(struct sockaddr_storage * sa);
+void   dump_sockaddr(sockaddr_union *  sa);
 
-/* Convert a sockaddr_storage to a string.
+/* Convert a sockaddr_union to a string.
  *
  * NOTE: this function is not threadsafe!
  *
- * @param sa: the sockaddr_storage to dump
+ * @param sa: the sockaddr_union to dump
  * @returns: pointer to statically allocated string
  */
-char *  str_sockaddr(struct sockaddr_storage *sa);
+char *  str_sockaddr(sockaddr_union *sa);
 
-/* Compare two sockaddr_storage objects, optionally comparing
+/* Compare two sockaddr_union objects, optionally comparing
  * only the address (and thus ignoring port, flow info, etc.).
  *
- * @param ss1: one sockaddr_storage to compare
- * @param ss2: the other sockaddr_storage to compare
+ * @param su1: one sockaddr_union to compare
+ * @param su2: the other sockaddr_union to compare
  * @param addr_only: if true, ignore port, flow info, etc.
  * @returns: -1, 0, or 1 for <, ==, >, respectively
  */
-int     cmp_sockaddr(struct sockaddr_storage *ss1,
-                    struct sockaddr_storage *ss2,
+int     cmp_sockaddr(sockaddr_union *su1,
+                    sockaddr_union *su2,
                     int addr_only);
 
 /* Copy a sockaddr object.
@@ -62,100 +62,101 @@ int     cmp_sockaddr(struct sockaddr_storage *ss1,
  */
 #define copy_sockaddr(dest, src) memcpy((dest), (src), SS_LEN((src)))
 
-/* Calculate the length of the data in a struct sockaddr_storage.
- *
- * @param ss: the sockaddr_storage to examine
- * @returns: length of the data in the object
+/* The "best" address family we support.
  */
-/* SS_LEN(ss) */
+/* AF_NATIVE */
 #ifdef WORKING_IPV6
-# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in))
+#define AF_NATIVE AF_INET6
 #else
-# define SS_LEN(ss) (sizeof(struct sockaddr_in))
+#define AF_NATIVE AF_INET
 #endif
 
-/* The "best" address family we support.
+/* Get the family for a sockaddr_union.
+ *
+ * @param su: the sockaddr_union to examine
  */
-/* AF_NATIVE */
+#define SU_GET_FAMILY(su) ((su)->sa.sa_family)
+/* Calculate the length of the data in a sockaddr_union.
+ *
+ * @param su: the sockaddr_union to examine
+ * @returns: length of the data in the object
+ */
+/* SS_LEN(su) */
 #ifdef WORKING_IPV6
-#define AF_NATIVE AF_INET6
+# define SS_LEN(su) (SU_GET_FAMILY(su)==AF_INET6? sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in))
 #else
-#define AF_NATIVE AF_INET
+# define SS_LEN(su) (sizeof(struct sockaddr_in))
 #endif
 
-/* Initialize a sockaddr_storage to all zeroes (as directed by RFC),
- * and set its ss_family as specified
+/* Initialize a sockaddr_union to all zeroes (as directed by RFC),
+ * and set its address family as specified
  *
- * @param ss: sockaddr_storage object to initialize
+ * @param su: sockaddr_union object to initialize
  * @param family: an AF_* constant
  */
-/* SS_INIT(ss, family) */
-#define SS_INIT(ss, family) do { \
-    memset((ss), 0, sizeof(*(ss))); \
-    (ss)->ss_family = (family); \
+/* SU_INIT(su, family) */
+#define SU_INIT(su, family) do { \
+    memset((su), 0, sizeof(*(su))); \
+    (su)->sa.sa_family = (family); \
 } while (0);
 
-/* set a sockaddr_storage to the family-appropriate equivalent of
- * INADDR_ANY -- a wildcard address and port.  Call SS_INIT(ss)
+/* set a sockaddr_union to the family-appropriate equivalent of
+ * INADDR_ANY -- a wildcard address and port.  Call SU_INIT(su)
  * first to initialize the object and set the family.
  *
- * @param ss: the sockaddr_storage to set
+ * @param su: the sockaddr_union to set
  */
-/* SS_SET_INADDR_ANY(ss) */
+/* SU_SET_INADDR_ANY(su) */
 #ifdef WORKING_IPV6
-#define SS_SET_INADDR_ANY(ss) do { \
-    switch ((ss)->ss_family) { \
+#define SU_SET_INADDR_ANY(su) do { \
+    switch (SU_GET_FAMILY(su)) { \
         case AF_INET6: \
-            ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \
-            ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \
+            (su)->sin6.sin6_flowinfo = 0; \
+            (su)->sin6.sin6_addr = in6addr_any; \
             break; \
         case AF_INET: \
-            ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+            (su)->sin.sin_addr.s_addr = INADDR_ANY; \
             break; \
     } \
 } while (0);
 #else
-#define SS_SET_INADDR_ANY(ss) do { \
-    ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+#define SU_SET_INADDR_ANY(su) do { \
+    (su)->sin.sin_addr.s_addr = INADDR_ANY; \
 } while (0);
 #endif
 
-/* Set the port in a sockaddr_storage that already has an family
+/* Set the port in a sockaddr_union that already has an family
  *
- * @param ss: the sockaddr_storage to manipulate
- * @param port: the port to insert
+ * @param su: the sockaddr_union to manipulate
+ * @param port: the port to insert (in host byte order)
  */
-/* SS_SET_PORT(ss, port) */
+/* SU_SET_PORT(su, port) */
 #ifdef WORKING_IPV6
-#define SS_SET_PORT(ss, port) \
-switch ((ss)->ss_family) { \
+#define SU_SET_PORT(su, port) \
+switch (SU_GET_FAMILY(su)) { \
     case AF_INET: \
-        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \
+        (su)->sin.sin_port = (in_port_t)htons((port)); \
         break; \
     case AF_INET6: \
-        ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \
+        (su)->sin6.sin6_port = (in_port_t)htons((port)); \
         break; \
     default: assert(0); \
 }
 #else
-#define SS_SET_PORT(ss, port) \
-        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port));
+#define SU_SET_PORT(su, port) \
+        (su)->sin.sin_port = (in_port_t)htons((port));
 #endif
 
-/* Get the port in a sockaddr_storage object
+/* Get the port in a sockaddr_union object
  *
- * @param ss: the sockaddr_storage to manipulate
+ * @param su: the sockaddr_union to manipulate
+ * @return: the port, in host byte horder
  */
-/* SS_GET_PORT(ss) */
+/* SU_GET_PORT(su) */
 #ifdef WORKING_IPV6
-#define SS_GET_PORT(ss) (ntohs( \
-       (ss)->ss_family == AF_INET6? \
-        ((struct sockaddr_in6 *)(ss))->sin6_port \
-       :((struct sockaddr_in *)(ss))->sin_port))
+#define SU_GET_PORT(su) (ntohs(SU_GET_FAMILY(su) == AF_INET6? (su)->sin6.sin6_port:(su)->sin.sin_port))
 #else
-#define SS_GET_PORT(ss) (ntohs( \
-        ((struct sockaddr_in *)(ss))->sin_port))
+#define SU_GET_PORT(su) (ntohs((su)->sin.sin_port))
 #endif
 
-#endif /* SOCKADDR_H */
-
+#endif /* SOCKADDR_UTIL_H */
index 789de4a4c16098b4127765160713eee5f4801422..d9504fcdf4771236d10e50cbc20bfa1f344ede63 100644 (file)
@@ -52,15 +52,15 @@ stream_server(
     int    priv)
 {
     int server_socket, retries;
-    socklen_t len;
+    socklen_t_equiv len;
 #if defined(SO_KEEPALIVE) || defined(USE_REUSEADDR)
     const int on = 1;
     int r;
 #endif
-    struct sockaddr_storage server;
+    sockaddr_union server;
     int save_errno;
     int *portrange;
-    socklen_t socklen;
+    socklen_t_equiv socklen;
     int socket_family;
 
     *portp = USHRT_MAX;                                /* in case we error exit */
@@ -95,12 +95,12 @@ stream_server(
        return -1;
     }
 
-    SS_INIT(&server, socket_family);
-    SS_SET_INADDR_ANY(&server);
+    SU_INIT(&server, socket_family);
+    SU_SET_INADDR_ANY(&server);
 
 #ifdef USE_REUSEADDR
     r = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR,
-       (void *)&on, (socklen_t)sizeof(on));
+       (void *)&on, (socklen_t_equiv)sizeof(on));
     if (r < 0) {
        dbprintf(_("stream_server: setsockopt(SO_REUSEADDR) failed: %s\n"),
                  strerror(errno));
@@ -174,7 +174,7 @@ out:
 
 #ifdef SO_KEEPALIVE
     r = setsockopt(server_socket, SOL_SOCKET, SO_KEEPALIVE,
-       (void *)&on, (socklen_t)sizeof(on));
+       (void *)&on, (socklen_t_equiv)sizeof(on));
     if(r == -1) {
        save_errno = errno;
        dbprintf(_("stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n"),
@@ -185,7 +185,7 @@ out:
     }
 #endif
 
-    *portp = SS_GET_PORT(&server);
+    *portp = SU_GET_PORT(&server);
     dbprintf(_("stream_server: waiting for connection: %s\n"),
              str_sockaddr(&server));
     return server_socket;
@@ -201,7 +201,7 @@ stream_client_internal(
     int nonblock,
     int priv)
 {
-    struct sockaddr_storage svaddr, claddr;
+    sockaddr_union svaddr, claddr;
     int save_errno;
     char *f;
     int client_socket;
@@ -225,11 +225,11 @@ stream_client_internal(
 
     for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
        /* copy the first (preferred) address we found */
-       copy_sockaddr(&svaddr, res_addr->ai_addr);
-       SS_SET_PORT(&svaddr, port);
+       copy_sockaddr(&svaddr, (sockaddr_union *)res_addr->ai_addr);
+       SU_SET_PORT(&svaddr, port);
 
-       SS_INIT(&claddr, svaddr.ss_family);
-       SS_SET_INADDR_ANY(&claddr);
+       SU_INIT(&claddr, SU_GET_FAMILY(&svaddr));
+       SU_SET_INADDR_ANY(&claddr);
 
        /*
         * If a privileged port range was requested, we try to get a port in
@@ -269,7 +269,7 @@ out:
     try_socksize(client_socket, SO_SNDBUF, sendsize);
     try_socksize(client_socket, SO_RCVBUF, recvsize);
     if (localport != NULL)
-       *localport = SS_GET_PORT(&claddr);
+       *localport = SU_GET_PORT(&claddr);
     return client_socket;
 }
 
@@ -310,8 +310,8 @@ stream_client(
 }
 
 /* don't care about these values */
-static struct sockaddr_storage addr;
-static socklen_t addrlen;
+static sockaddr_union addr;
+static socklen_t_equiv addrlen;
 
 int
 stream_accept(
@@ -369,7 +369,7 @@ stream_accept(
     } while (nfound <= 0);
 
     while(1) {
-       addrlen = (socklen_t)sizeof(struct sockaddr_storage);
+       addrlen = (socklen_t_equiv)sizeof(sockaddr_union);
        connected_socket = accept(server_socket,
                                  (struct sockaddr *)&addr,
                                  &addrlen);
@@ -382,12 +382,12 @@ stream_accept(
         * Make certain we got an inet connection and that it is not
         * from port 20 (a favorite unauthorized entry tool).
         */
-       if (addr.ss_family == (sa_family_t)AF_INET
+       if (SU_GET_FAMILY(&addr) == AF_INET
 #ifdef WORKING_IPV6
-           || addr.ss_family == (sa_family_t)AF_INET6
+           || SU_GET_FAMILY(&addr) == AF_INET6
 #endif
            ){
-           port = SS_GET_PORT(&addr);
+           port = SU_GET_PORT(&addr);
            if (port != (in_port_t)20) {
                try_socksize(connected_socket, SO_SNDBUF, sendsize);
                try_socksize(connected_socket, SO_RCVBUF, recvsize);
@@ -400,12 +400,12 @@ stream_accept(
 #ifdef WORKING_IPV6
            dbprintf(_("family is %d instead of %d(AF_INET)"
                      " or %d(AF_INET6): ignored\n"),
-                     addr.ss_family,
+                     SU_GET_FAMILY(&addr),
                      AF_INET, AF_INET6);
 #else
            dbprintf(_("family is %d instead of %d(AF_INET)"
                      ": ignored\n"),
-                     addr.ss_family,
+                     SU_GET_FAMILY(&addr),
                      AF_INET);
 #endif
        }
@@ -436,7 +436,7 @@ try_socksize(
     /* keep trying, get as big a buffer as possible */
     while((isize > 1024) &&
          (setsockopt(sock, SOL_SOCKET,
-                     which, (void *) &isize, (socklen_t)sizeof(isize)) < 0)) {
+                     which, (void *) &isize, (socklen_t_equiv)sizeof(isize)) < 0)) {
        isize -= 1024;
     }
     if(isize > 1024) {
index 415f16faafb45a3b2d9fadc0919151e7049f7aa5..5357aaf84b37c54a56b6d61e7a1e1b9e6b5cb130 100644 (file)
@@ -1,2 +1,2 @@
-#define BUILT_REV "1023"
+#define BUILT_REV "1266"
 #define BUILT_BRANCH "amanda-260"
index 06c4de22911c8dcc14ff0af35d31950620894224..c1ba9d5abeca516167211cc072575ba591378b79 100644 (file)
@@ -40,8 +40,8 @@
 #endif
 
 static int make_socket(sa_family_t family);
-static int connect_port(struct sockaddr_storage *addrp, in_port_t port, char *proto,
-                       struct sockaddr_storage *svaddr, int nonblock);
+static int connect_port(sockaddr_union *addrp, in_port_t port, char *proto,
+                       sockaddr_union *svaddr, int nonblock);
 
 /*
  * Keep calling read() until we've read buflen's worth of data, or EOF,
@@ -161,11 +161,11 @@ make_socket(
 /* return -1     on failure */
 int
 connect_portrange(
-    struct sockaddr_storage *addrp,
+    sockaddr_union *addrp,
     in_port_t          first_port,
     in_port_t          last_port,
     char *             proto,
-    struct sockaddr_storage *svaddr,
+    sockaddr_union *svaddr,
     int                        nonblock)
 {
     int                        s;
@@ -216,16 +216,16 @@ connect_portrange(
 /* return >0: this is the connected socket */
 int
 connect_port(
-    struct sockaddr_storage *addrp,
+    sockaddr_union *addrp,
     in_port_t                  port,
     char *             proto,
-    struct sockaddr_storage *svaddr,
+    sockaddr_union *svaddr,
     int                        nonblock)
 {
     int                        save_errno;
     struct servent *   servPort;
-    socklen_t          len;
-    socklen_t          socklen;
+    socklen_t_equiv    len;
+    socklen_t_equiv    socklen;
     int                        s;
 
     servPort = getservbyport((int)htons(port), proto);
@@ -236,9 +236,9 @@ connect_port(
        return -1;
     }
 
-    if ((s = make_socket(addrp->ss_family)) == -1) return -2;
+    if ((s = make_socket(SU_GET_FAMILY(addrp))) == -1) return -2;
 
-    SS_SET_PORT(addrp, port);
+    SU_SET_PORT(addrp, port);
     socklen = SS_LEN(addrp);
     if (bind(s, (struct sockaddr *)addrp, socklen) != 0) {
        save_errno = errno;
@@ -315,14 +315,14 @@ connect_port(
 int
 bind_portrange(
     int                        s,
-    struct sockaddr_storage *addrp,
+    sockaddr_union *addrp,
     in_port_t          first_port,
     in_port_t          last_port,
     char *             proto)
 {
     in_port_t port;
     in_port_t cnt;
-    socklen_t socklen;
+    socklen_t_equiv socklen;
     struct servent *servPort;
     const in_port_t num_ports = (in_port_t)(last_port - first_port + 1);
     int save_errno = EAGAIN;
@@ -343,7 +343,7 @@ bind_portrange(
     for (cnt = 0; cnt < num_ports; cnt++) {
        servPort = getservbyport((int)htons(port), proto);
        if ((servPort == NULL) || strstr(servPort->s_name, "amanda")) {
-           SS_SET_PORT(addrp, port);
+           SU_SET_PORT(addrp, port);
            socklen = SS_LEN(addrp);
            if (bind(s, (struct sockaddr *)addrp, socklen) >= 0) {
                if (servPort == NULL) {
index cab9d8d21e1eb717b35bad29eec1a0e1c1892520..3a9efe7fcc880eadf00d4f710cb3914fecd4948d 100644 (file)
@@ -48,9 +48,9 @@
 ssize_t        fullread(int, void *, size_t);
 ssize_t        fullwrite(int, const void *, size_t);
 
-int    connect_portrange(struct sockaddr_storage *, in_port_t, in_port_t, char *,
-                         struct sockaddr_storage *, int);
-int    bind_portrange(int, struct sockaddr_storage *, in_port_t, in_port_t,
+int    connect_portrange(sockaddr_union *, in_port_t, in_port_t, char *,
+                         sockaddr_union *, int);
+int    bind_portrange(int, sockaddr_union *, in_port_t, in_port_t,
                       char *);
 
 char * construct_datestamp(time_t *t);
index 1ee7cf988f18d258b20770cf7e25200d7782388e..f5b7871dc878ea9b6e543a4695611bb9f96d9f4e 100644 (file)
 #ifndef VERSION_H
 #define VERSION_H
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 extern const int   VERSION_MAJOR;
 extern const int   VERSION_MINOR;
 extern const int   VERSION_PATCH;
index 044fe693b464bd1d0844653f5ddbeeb6060f4019..3504b3089e89542ebdc9793ea24841597d4023a4 100644 (file)
 const int   VERSION_MAJOR   = 2;
 const int   VERSION_MINOR   = 6;
 const int   VERSION_PATCH   = 0;
-const char *const VERSION_COMMENT = "p1";
+const char *const VERSION_COMMENT = "p2";
 
 const char *
 versionsuffix(void)
 {
 #ifdef USE_VERSION_SUFFIXES
-    return "-2.6.0p1";
+    return "-2.6.0p2";
 #else
     return "";
 #endif
@@ -49,5 +49,5 @@ versionsuffix(void)
 const char *
 version(void)
 {
-    return "2.6.0p1";
+    return "2.6.0p2";
 }
index 9a0b85562359d2a65563684be1cf477c7ba51e67..7f0a293e2f418cb909f23e7e17749b0dc16f3b70 100644 (file)
@@ -80,6 +80,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
@@ -565,10 +566,10 @@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \
        amanda/ipv6.m4 amanda/krb4-security.m4 amanda/krb5-security.m4 \
        amanda/lfs.m4 amanda/libs.m4 amanda/net.m4 amanda/progs.m4 \
        amanda/readdir.m4 amanda/readline.m4 amanda/rsh-security.m4 \
-       amanda/s3-device.m4 amanda/shmem.m4 amanda/ssh-security.m4 \
-       amanda/summary.m4 amanda/swig.m4 amanda/syshacks.m4 \
-       amanda/tape.m4 amanda/types.m4 amanda/userid.m4 \
-       amanda/version.m4 gettext-macros/codeset.m4 \
+       amanda/s3-device.m4 amanda/shmem.m4 amanda/socklen_t_equiv.m4 \
+       amanda/ssh-security.m4 amanda/summary.m4 amanda/swig.m4 \
+       amanda/syshacks.m4 amanda/tape.m4 amanda/types.m4 \
+       amanda/userid.m4 amanda/version.m4 gettext-macros/codeset.m4 \
        gettext-macros/gettext.m4 gettext-macros/glibc21.m4 \
        gettext-macros/glibc2.m4 gettext-macros/iconv.m4 \
        gettext-macros/intdiv0.m4 gettext-macros/intmax.m4 \
index 6793c8f066df2fdc43bce0c6b92c2ffbc5c70c6d..4a499dc553469401ec7ee40d2321d4eef9635d65 100644 (file)
@@ -56,6 +56,23 @@ AC_DEFUN([AMANDA_WITH_DEBUGGING],
        [Location of Amanda directories and files. ])
 ])
 
+# SYNOPSIS
+#
+#   AMANDA_GLIBC_BACKTRACE
+#
+# OVERVIEW
+#
+#   Check for glibc's backtrace support, and define HAVE_GLIBC_BACKTRACE if it is present.
+AC_DEFUN([AMANDA_GLIBC_BACKTRACE],
+[
+    AC_CHECK_HEADER([execinfo.h], [
+       AC_CHECK_FUNC([backtrace_symbols_fd], [
+           AC_DEFINE(HAVE_GLIBC_BACKTRACE, 1,
+               [Define this if glibc's backtrace functionality (execinfo.h) is present])
+       ])
+    ])
+])
+
 # SYNOPSIS
 #
 #   AMANDA_WITH_DEBUG_DAYS
index 7359d7448083973ca4b6e7576b49a1510235d1ad..6231dbfa5daa01772d15a510195a72812aa8c649 100644 (file)
@@ -4,11 +4,7 @@
 #
 # DESCRIPTION
 #
-#   Check for the prefixes used for particular devices.  If the prefixes
-#   are broken on this system (Sinix and HPUX), suggest how to fix them.
-#
-#   Substitutes CLIENT_SCRIPTS_OPT with the name of the script used to fix
-#   broken systems.
+#   Check for the prefixes used for particular devices.
 #
 #   Defines DEV_PREFIX and RDEV_PREFIX to the appropriate prefixes.
 #
index a370d2ab5defeb7234b3a4a802f0a779629881f2..7e929ac3915cb1b0c9fe064a23c846aef9e8a027 100644 (file)
@@ -30,6 +30,7 @@ EXTRA_DIST += amanda/readline.m4
 EXTRA_DIST += amanda/rsh-security.m4
 EXTRA_DIST += amanda/s3-device.m4
 EXTRA_DIST += amanda/shmem.m4
+EXTRA_DIST += amanda/socklen_t_equiv.m4
 EXTRA_DIST += amanda/ssh-security.m4
 EXTRA_DIST += amanda/summary.m4
 EXTRA_DIST += amanda/swig.m4
index 9883d2002a80077b9e1475e380c2bcd699f7d451..1aa37cbacdc182daea77e7fc911adec2d252cdfd 100644 (file)
@@ -14,13 +14,6 @@ AC_DEFUN([AMANDA_S3_DEVICE], [
     AC_REQUIRE([AMANDA_CHECK_LIBCURL])
     AC_REQUIRE([AMANDA_CHECK_HMAC])
 
-    if test "$libcurl_feature_SSL" != "yes" ||
-       test "$libcurl_protocol_HTTPS" != "yes"; then
-        s3_ssl=no
-    else
-       s3_ssl=yes
-    fi
-
     AC_ARG_ENABLE([s3-device],
        AS_HELP_STRING([--disable-s3-device],
                       [disable the S3 device]),
@@ -49,9 +42,6 @@ AC_DEFUN([AMANDA_S3_DEVICE], [
     # Now handle any setup for S3, if we want it.
     if test x"$WANT_S3_DEVICE" = x"yes"; then
        AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver])
-       if test x"$s3_ssl" = x"no"; then
-         AMANDA_MSG_WARN([Encryption support is not available for S3; requests will be sent in plaintext.])
-       fi
     fi
                          
 
@@ -67,11 +57,6 @@ AC_DEFUN([AMANDA_S3_DEVICE], [
            AC_MSG_ERROR([DevPay support requires the S3 device (--enable-s3-device)])
        fi
 
-       if test "$s3_ssl" != "yes"; then
-           AC_MSG_RESULT(no)
-           AC_MSG_ERROR([Cannot use devpay without HTTPS/SSL support in libcurl.])
-       fi
-
        AC_DEFINE([WANT_DEVPAY], [], [Compile Amazon DevPay support])
     fi
     AC_MSG_RESULT($WANT_DEVPAY)
diff --git a/config/amanda/socklen_t_equiv.m4 b/config/amanda/socklen_t_equiv.m4
new file mode 100644 (file)
index 0000000..1d95d3b
--- /dev/null
@@ -0,0 +1,48 @@
+# SYNOPSIS
+#
+#   AMANDA_SOCKLEN_T_EQUIV
+#
+# OVERVIEW
+#
+#   Find a type which will work like socklen_t should.  Unfortunately, 
+#   HP/UX systems define socklen_t, but use int * as the result parameter
+#   for socket functions returning a socket length.
+#
+#   This check defines a type socklen_t_equiv which is of the appropriate
+#   size to be used with socket functions.
+#
+AC_DEFUN([AMANDA_SOCKLEN_T_EQUIV],
+[
+      ## lifted from config/gnulib/socklen.m4
+      AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
+      AC_MSG_CHECKING([for socklen_t equivalent])
+      AC_CACHE_VAL([gl_cv_socklen_t_equiv],
+       [# Systems have either "struct sockaddr *" or
+        # "void *" as the second argument to getpeername
+        gl_cv_socklen_t_equiv=
+        for arg2 in "struct sockaddr" void; do
+          for t in socklen_t int size_t "unsigned int" "long int" "unsigned long int"; do
+            AC_TRY_COMPILE(
+              [#include <sys/types.h>
+               #include <sys/socket.h>
+
+               int getpeername (int, $arg2 *, $t *);],
+              [$t len;
+               getpeername (0, 0, &len);],
+              [gl_cv_socklen_t_equiv="$t"])
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
+      ])
+      ## end lifting from config/gnulib/socklen.m4
+      # fallback if the check fails
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       gl_cv_socklen_t_equiv=socklen_t
+      fi
+      AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
+
+      AC_DEFINE_UNQUOTED([socklen_t_equiv], [$gl_cv_socklen_t_equiv],
+       [type to use for socket length parameters; use instead of socklen_t])
+])
+
index 74e81696eb4a3fbe03d133554682ece9b663cd3f..5c2d00400c8f3a0e4d4fe8ba3f35330129cedf7f 100644 (file)
 /* Define to 1 if you have the `getaddrinfo' function. */
 #undef HAVE_GETADDRINFO
 
+/* Define to 1 if you have the `getgrgid_r' function. */
+#undef HAVE_GETGRGID_R
+
 /* Define to 1 if you have the `gethostbyname' function. */
 #undef HAVE_GETHOSTBYNAME
 
 /* Define if getpeername is declared. */
 #undef HAVE_GETPEERNAME_DECL
 
+/* Define to 1 if you have the `getpwuid_r' function. */
+#undef HAVE_GETPWUID_R
+
 /* Define to 1 if you have the `getsockname' function. */
 #undef HAVE_GETSOCKNAME
 
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
+/* Define this if glibc's backtrace functionality (execinfo.h) is present */
+#undef HAVE_GLIBC_BACKTRACE
+
 /* Define to 1 if you have the <grp.h> header file. */
 #undef HAVE_GRP_H
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
-/* Type for socklen_t, if it is not defined by the system */
+/* type to use in place of socklen_t if not defined */
 #undef socklen_t
 
+/* type to use for socket length parameters; use instead of socklen_t */
+#undef socklen_t_equiv
+
 /* Define as a signed type of the same size as size_t. */
 #undef ssize_t
 
index a48f35d6efed7e06588aba26696ec08254f70b94..49ddd558d6e39df0daedc71056759463218117b8 100755 (executable)
--- a/configure
+++ b/configure
@@ -2950,7 +2950,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=amanda
- VERSION="2.6.0p1"
+ VERSION="2.6.0p2"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -27790,13 +27790,6 @@ done
 
 
 
-    if test "$libcurl_feature_SSL" != "yes" ||
-       test "$libcurl_protocol_HTTPS" != "yes"; then
-        s3_ssl=no
-    else
-       s3_ssl=yes
-    fi
-
     # Check whether --enable-s3-device was given.
 if test "${enable_s3_device+set}" = set; then
   enableval=$enable_s3_device;  WANT_S3_DEVICE=$enableval
@@ -27844,18 +27837,6 @@ cat >>confdefs.h <<\_ACEOF
 #define WANT_S3_DEVICE
 _ACEOF
 
-       if test x"$s3_ssl" = x"no"; then
-
-    { echo "$as_me:$LINENO: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&5
-echo "$as_me: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-Encryption support is not available for S3; requests will be sent in plaintext.
-AAW_EOF
-
-
-       fi
     fi
 
 
@@ -27875,14 +27856,6 @@ echo $ECHO_N "checking whether to include the Amazon S3 device's DevPay support.
 echo "${ECHO_T}no" >&6; }
            { { echo "$as_me:$LINENO: error: DevPay support requires the S3 device (--enable-s3-device)" >&5
 echo "$as_me: error: DevPay support requires the S3 device (--enable-s3-device)" >&2;}
-   { (exit 1); exit 1; }; }
-       fi
-
-       if test "$s3_ssl" != "yes"; then
-           { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-           { { echo "$as_me:$LINENO: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&5
-echo "$as_me: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&2;}
    { (exit 1); exit 1; }; }
        fi
 
@@ -32928,7 +32901,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 32931 "configure"' > conftest.$ac_ext
+  echo '#line 32904 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -35215,11 +35188,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:35218: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:35191: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:35222: \$? = $ac_status" >&5
+   echo "$as_me:35195: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -35477,11 +35450,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:35480: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:35453: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:35484: \$? = $ac_status" >&5
+   echo "$as_me:35457: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -35539,11 +35512,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:35542: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:35515: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:35546: \$? = $ac_status" >&5
+   echo "$as_me:35519: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -37768,7 +37741,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 37771 "configure"
+#line 37744 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -37866,7 +37839,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 37869 "configure"
+#line 37842 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -40165,11 +40138,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:40168: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:40141: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:40172: \$? = $ac_status" >&5
+   echo "$as_me:40145: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -40227,11 +40200,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:40230: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:40203: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:40234: \$? = $ac_status" >&5
+   echo "$as_me:40207: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -41579,7 +41552,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 41582 "configure"
+#line 41555 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -41677,7 +41650,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 41680 "configure"
+#line 41653 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -42562,11 +42535,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:42565: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:42538: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:42569: \$? = $ac_status" >&5
+   echo "$as_me:42542: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -42624,11 +42597,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:42627: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:42600: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:42631: \$? = $ac_status" >&5
+   echo "$as_me:42604: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -44771,11 +44744,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:44774: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:44747: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:44778: \$? = $ac_status" >&5
+   echo "$as_me:44751: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -45033,11 +45006,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45036: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:45009: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:45040: \$? = $ac_status" >&5
+   echo "$as_me:45013: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -45095,11 +45068,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45098: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:45071: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:45102: \$? = $ac_status" >&5
+   echo "$as_me:45075: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -47324,7 +47297,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 47327 "configure"
+#line 47300 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -47422,7 +47395,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 47425 "configure"
+#line 47398 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -52571,35 +52544,32 @@ _ACEOF
 fi
 
 
-
-    { echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_socklen_t+set}" = set; then
+      ## lifted from config/gnulib/socklen.m4
+            { echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
+echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6; }
+      if test "${gl_cv_socklen_t_equiv+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Systems have either "struct sockaddr *" or
+        # "void *" as the second argument to getpeername
+        gl_cv_socklen_t_equiv=
+        for arg2 in "struct sockaddr" void; do
+          for t in socklen_t int size_t "unsigned int" "long int" "unsigned long int"; do
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/socket.h>
 
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-
-
-
-typedef socklen_t ac__type_new_;
+               int getpeername (int, $arg2 *, $t *);
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+$t len;
+               getpeername (0, 0, &len);
   ;
   return 0;
 }
@@ -52621,29 +52591,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_socklen_t=yes
+  gl_cv_socklen_t_equiv="$t"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_socklen_t=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; }
-if test $ac_cv_type_socklen_t = yes; then
-  :
-else
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
 
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define socklen_t int
-_ACEOF
+      ## end lifting from config/gnulib/socklen.m4
+      # fallback if the check fails
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       gl_cv_socklen_t_equiv=socklen_t
+      fi
+      { echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
+echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6; }
 
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define socklen_t_equiv $gl_cv_socklen_t_equiv
+_ACEOF
 
 
 
@@ -54723,6 +54698,230 @@ _ACEOF
 fi
 
 
+    if test "${ac_cv_header_execinfo_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for execinfo.h" >&5
+echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking execinfo.h usability" >&5
+echo $ECHO_N "checking execinfo.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <execinfo.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking execinfo.h presence" >&5
+echo $ECHO_N "checking execinfo.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <execinfo.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ 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:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: execinfo.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for execinfo.h" >&5
+echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_execinfo_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
+
+fi
+if test $ac_cv_header_execinfo_h = yes; then
+
+       { echo "$as_me:$LINENO: checking for backtrace_symbols_fd" >&5
+echo $ECHO_N "checking for backtrace_symbols_fd... $ECHO_C" >&6; }
+if test "${ac_cv_func_backtrace_symbols_fd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define backtrace_symbols_fd to an innocuous variant, in case <limits.h> declares backtrace_symbols_fd.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define backtrace_symbols_fd innocuous_backtrace_symbols_fd
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char backtrace_symbols_fd (); 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 backtrace_symbols_fd
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char backtrace_symbols_fd ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_backtrace_symbols_fd || defined __stub___backtrace_symbols_fd
+choke me
+#endif
+
+int
+main ()
+{
+return backtrace_symbols_fd ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_backtrace_symbols_fd=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_backtrace_symbols_fd=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_backtrace_symbols_fd" >&5
+echo "${ECHO_T}$ac_cv_func_backtrace_symbols_fd" >&6; }
+if test $ac_cv_func_backtrace_symbols_fd = yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GLIBC_BACKTRACE 1
+_ACEOF
+
+
+fi
+
+
+fi
+
+
+
+
 #
 # Declarations
 #
 fi
 
 
+for ac_func in getgrgid_r
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* 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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in getpwuid_r
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* 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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 ice_have_gethostname=no
 
 for ac_func in gethostname
index 74bae5f9eddcc32ce6201da651dd8fd10330d2ae..b5eee29592b7b48329893e1e17dcccc0331a1156 100644 (file)
@@ -6,7 +6,7 @@ AC_CANONICAL_TARGET([])
 PACKAGE=amanda
 AC_SUBST(PACKAGE)
 
-AM_INIT_AUTOMAKE(amanda, "2.6.0p1")
+AM_INIT_AUTOMAKE(amanda, "2.6.0p2")
 AC_CONFIG_HEADERS([config/config.h])
 
 dnl Minimum Autoconf version required.
@@ -233,7 +233,7 @@ AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 AC_TYPE_SIGNAL
 AC_STRUCT_TM
-AMANDA_CHECK_TYPE(socklen_t, int, sys/socket.h)
+AMANDA_SOCKLEN_T_EQUIV
 AMANDA_CHECK_TYPE(sa_family_t, unsigned short, sys/socket.h)
 AMANDA_CHECK_TYPE(in_port_t, unsigned short, netinet/in.h)
 CF_WAIT
@@ -249,6 +249,7 @@ AMANDA_CHECK_NET_LIBS
 AMANDA_CHECK_GLIB
 AMANDA_CHECK_READLINE
 AC_CHECK_LIB(m,modf)
+AMANDA_GLIBC_BACKTRACE
 
 #
 # Declarations
@@ -282,6 +283,8 @@ ICE_CHECK_DECL(fputs,stdio.h)
 ICE_CHECK_DECL(fread,stdio.h stdlib.h)
 ICE_CHECK_DECL(fseek,stdio.h)
 ICE_CHECK_DECL(fwrite,stdio.h stdlib.h)
+AC_CHECK_FUNCS(getgrgid_r)
+AC_CHECK_FUNCS(getpwuid_r)
 ICE_CHECK_DECL(gethostname,unistd.h)
 ICE_CHECK_DECL(getopt,stdlib.h unistd.h libc.h)
 ICE_CHECK_DECL(getpeername,sys/types.h sys/socket.h)
index e23935b16e691a50c7f2749503c28a0228244eeb..70898dd42826df26b74c5daabdb33978315a1fe4 100644 (file)
@@ -96,6 +96,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index bf8cbd4e5dc30d0c16fa067393449a13f26e9d48..001db2ac08ed2102c9a98be8979232b3d8ec7789 100644 (file)
@@ -651,6 +651,7 @@ static gboolean
 default_device_start (Device * self, DeviceAccessMode mode, char * label,
                       char * timestamp) {
     if (mode != ACCESS_WRITE && self->volume_label == NULL) {
+       g_debug("default_device_start calling device_read_label with mode %d", mode);
         if (device_read_label(self) != READ_LABEL_STATUS_SUCCESS)
             return FALSE;
     } else if (mode == ACCESS_WRITE) {
@@ -773,18 +774,52 @@ default_device_property_get(Device * self, DevicePropertyId ID,
 
 static gboolean
 default_device_read_to_fd(Device *self, int fd) {
-    return do_consumer_producer_queue(device_read_producer,
-                                      self,
-                                      fd_write_consumer,
-                                      GINT_TO_POINTER(fd));
+    GValue val;
+    StreamingRequirement streaming_mode;
+
+    /* Get the device's parameters */
+    bzero(&val, sizeof(val));
+    if (!device_property_get(self, PROPERTY_STREAMING, &val)
+       || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
+       streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
+    } else {
+       streaming_mode = g_value_get_enum(&val);
+    }
+
+    return QUEUE_SUCCESS ==
+       do_consumer_producer_queue_full(
+           device_read_producer,
+           self,
+           fd_write_consumer,
+           GINT_TO_POINTER(fd),
+           device_read_max_size(self),
+           DEFAULT_MAX_BUFFER_MEMORY,
+           streaming_mode);
 }
 
 static gboolean
 default_device_write_from_fd(Device *self, int fd) {
-    return do_consumer_producer_queue(fd_read_producer,
-                                      GINT_TO_POINTER(fd),
-                                      device_write_consumer,
-                                      self);
+    GValue val;
+    StreamingRequirement streaming_mode;
+
+    /* Get the device's parameters */
+    bzero(&val, sizeof(val));
+    if (!device_property_get(self, PROPERTY_STREAMING, &val)
+       || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
+       streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
+    } else {
+       streaming_mode = g_value_get_enum(&val);
+    }
+
+    return QUEUE_SUCCESS ==
+       do_consumer_producer_queue_full(
+           fd_read_producer,
+           GINT_TO_POINTER(fd),
+           device_write_consumer,
+           self,
+           device_write_max_size(self),
+           DEFAULT_MAX_BUFFER_MEMORY,
+           streaming_mode);
 }
 
 /* XXX WARNING XXX
@@ -810,6 +845,7 @@ device_open_device (Device * self, char * device_name)
 
 ReadLabelStatusFlags device_read_label(Device * self) {
     DeviceClass * klass;
+    g_debug("device_read_label; mode = %d", self->access_mode);
     g_return_val_if_fail(self != NULL, FALSE);
     g_return_val_if_fail(IS_DEVICE(self), FALSE);
     g_return_val_if_fail(self->access_mode == ACCESS_NULL, FALSE);
@@ -849,6 +885,7 @@ device_start (Device * self, DeviceAccessMode mode,
 {
        DeviceClass *klass;
 
+       g_debug("device_start mode = %d", mode);
        g_return_val_if_fail (self != NULL, FALSE);
        g_return_val_if_fail (IS_DEVICE (self), FALSE);
         g_return_val_if_fail (mode != ACCESS_NULL, FALSE);
@@ -869,6 +906,7 @@ device_start (Device * self, DeviceAccessMode mode,
 
             rv = (*klass->start)(self, mode, label, timestamp);
            amfree(local_timestamp);
+           g_debug("device_start done; dev->access_mode = %d, result %d", self->access_mode, rv);
            return rv;
         } else {
             return FALSE;
index e01efdcb3f759974049b8b6d0dcd32f02a1d2de9..262be39e4f99794163068844c0e2b0ed8b37c980 100644 (file)
@@ -144,7 +144,7 @@ struct _DeviceClass {
     gboolean (* finish_file) (Device * self);
     dumpfile_t* (* seek_file) (Device * self, guint file);
     gboolean (* seek_block) (Device * self, guint64 block);
-    gboolean (* read_block) (Device * self, gpointer buf, int * size);
+    int (* read_block) (Device * self, gpointer buf, int * size);
     gboolean (* read_to_fd) (Device * self, int fd);
     gboolean (* property_get) (Device * self, DevicePropertyId id,
                                GValue * val);
index 504102fa9d5cdae0274301aa84fa0853fe683fda..2ec0e8c96c399b199a37ab9ec5b71a98d2d36a3c 100644 (file)
@@ -440,12 +440,18 @@ producer_result_t device_read_producer(gpointer devicep,
 int device_write_consumer(gpointer devicep, queue_buffer_t *buffer) {
     Device* device;
     unsigned int write_size;
+    static gboolean wrote_blocksize = FALSE;
 
     device = (Device*) devicep;
     g_assert(IS_DEVICE(device));
     write_size = MIN(buffer->data_size,
                      device_write_max_size(device));
 
+    if (!wrote_blocksize) {
+       wrote_blocksize = TRUE;
+       dbprintf("USING BLOCKSIZE %d bytes\n", write_size);
+    }
+
     if (device_write_block(device, write_size,
                            buffer->data + buffer->offset,
                            buffer->data_size <
index b38bf8ded93b25302e96e3f8bfaf50e55f57938e..72f7c6dfff0114bb84f73571601805775d1db9b2 100644 (file)
@@ -24,7 +24,7 @@
 #include "rait-device.h"
 #include <amanda.h>
 #include "property.h"
-#include <util.h>
+#include "util.h"
 
 typedef enum {
     RAIT_STATUS_COMPLETE, /* All subdevices OK. */
@@ -168,6 +168,18 @@ rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED)
 
     g_object_class->finalize = rait_device_finalize;
 
+    /* Versions of glib before 2.10.2 crash if
+     * g_thread_pool_set_max_unused_threads is called before the first
+     * invocation of g_thread_pool_new.  So we make up a thread pool, but don't
+     * start any threads in it, and free it */
+
+#if !GLIB_CHECK_VERSION(2,10,2)
+    {
+       GThreadPool *pool = g_thread_pool_new((GFunc)-1, NULL, -1, FALSE, NULL);
+       g_thread_pool_free(pool, TRUE, FALSE);
+    }
+#endif
+
     g_thread_pool_set_max_unused_threads(-1);
 }
 
@@ -358,7 +370,7 @@ static void register_rait_properties(RaitDevice * self) {
 }
 
 static void property_hash_union(GHashTable * properties,
-                                DeviceProperty * prop) {
+                                const DeviceProperty * prop) {
     PropertyAccessFlags before, after;
     gpointer tmp;
     gboolean found;
@@ -415,7 +427,7 @@ static void register_properties(RaitDevice * self) {
 
         device_property_list = device_property_get_list(child);
         for (i = 0; device_property_list[i].base != NULL; i ++) {
-            property_hash_union(properties, (gpointer)&(device_property_list[i]));
+            property_hash_union(properties, &(device_property_list[i]));
         }
     }
 
@@ -481,6 +493,23 @@ static gboolean g_ptr_array_and(GPtrArray * array,
     return TRUE;
 }
 
+/* Calls extractor on each element of the array, and returns
+   TRUE if at least one of the calls to extractor return TRUE.
+*/
+static gboolean g_ptr_array_or(GPtrArray * array,
+                                BooleanExtractor extractor) {
+    guint i;
+    if (array == NULL || array->len <= 0)
+        return FALSE;
+
+    for (i = 0; i < array->len; i ++) {
+        if (extractor(g_ptr_array_index(array, i)))
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
 /* Takes a RaitDevice, and makes a GPtrArray of GenericOp. */
 static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) {
     GPtrArray * rval;
@@ -504,37 +533,37 @@ static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) {
    occured. */
 static gboolean g_ptr_array_union_robust(RaitDevice * self, GPtrArray * ops,
                                          BooleanExtractor extractor) {
-    gboolean success;
-    gpointer isolated_op = NULL;
+    int nfailed;
+    guint i;
 
-    for (;;) {
-        success = g_ptr_array_and(ops, extractor);
-        
-        if (success || self->private->status != RAIT_STATUS_COMPLETE) {
-            break;
-        } else {
-            guint i;
-            /* First device failure, note the device and march on. */
-            self->private->status = RAIT_STATUS_DEGRADED;
-            for (i = 0; i < ops->len; i ++) {
-                GenericOp * op = g_ptr_array_index(ops, i);
-                if (!(op->result)) {
-                    isolated_op = g_ptr_array_remove_index_fast(ops, i);
-                    self->private->failed = op->child_index;
-                    g_fprintf(stderr, "RAIT array %s Isolated device %s.\n",
-                            DEVICE(self)->device_name,
-                            op->child->device_name);
-                    break;
-                }
-            }
-        }
+    /* We found one or more failed elements.  See which elements failed, and
+     * isolate them*/
+    nfailed = 0;
+    for (i = 0; i < ops->len; i ++) {
+       GenericOp * op = g_ptr_array_index(ops, i);
+       if (!extractor(op)) {
+           self->private->failed = op->child_index;
+           g_fprintf(stderr, "RAIT array %s isolated device %s\n",
+                   DEVICE(self)->device_name,
+                   op->child->device_name);
+           nfailed++;
+       }
     }
 
-    /* Return isolated op so any data members can be freed. */
-    if (isolated_op != NULL) {
-        g_ptr_array_add(ops, isolated_op);
+    /* no failures? great! */
+    if (nfailed == 0)
+       return TRUE;
+
+    /* a single failure in COMPLETE just puts us in DEGRADED mode */
+    if (self->private->status == RAIT_STATUS_COMPLETE && nfailed == 1) {
+       self->private->status = RAIT_STATUS_DEGRADED;
+       g_fprintf(stderr, "RAIT array %s DEGRADED\n", DEVICE(self)->device_name);
+       return TRUE;
+    } else {
+       self->private->status = RAIT_STATUS_FAILED;
+       g_fprintf(stderr, "RAIT array %s FAILED\n", DEVICE(self)->device_name);
+       return FALSE;
     }
-    return success;
 }
 
 typedef struct {
@@ -553,13 +582,8 @@ static void open_device_do_op(gpointer data,
 
 /* Returns TRUE if and only if the volume label and time are equal. */
 static gboolean compare_volume_results(Device * a, Device * b) {
-    if (a->volume_time != b->volume_time)
-        return FALSE;
-    if (a->volume_label == NULL && b->volume_label == NULL)
-        return TRUE;
-    if (a->volume_label == NULL || b->volume_label == NULL)
-        return FALSE;
-    return 0 == strcmp(a->volume_label, b->volume_label);
+    return (0 == compare_possibly_null_strings(a->volume_time, b->volume_time)
+        && 0 == compare_possibly_null_strings(a->volume_label, b->volume_label));
 }
 
 static gboolean 
@@ -739,10 +763,14 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label,
     guint i;
     gboolean success;
     RaitDevice * self;
+    char * label_from_device = NULL;
 
     self = RAIT_DEVICE(dself);
     g_return_val_if_fail(self != NULL, FALSE);
 
+    amfree(dself->volume_label);
+    amfree(dself->volume_time);
+
     ops = g_ptr_array_sized_new(self->private->children->len);
     for (i = 0; i < self->private->children->len; i ++) {
         StartOp * op;
@@ -758,6 +786,45 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label,
 
     success = g_ptr_array_and(ops, extract_boolean_generic_op);
 
+    /* check that all of the volume labels agree */
+    if (success) {
+       for (i = 0; i < self->private->children->len; i ++) {
+           Device *child = g_ptr_array_index(self->private->children, i);
+
+           if (child->volume_label != NULL && child->volume_time != NULL) {
+                if (dself->volume_label != NULL && dself->volume_time != NULL) {
+                    if (strcmp(child->volume_label, dself->volume_label) != 0 ||
+                        strcmp(child->volume_time, dself->volume_time) != 0) {
+                        /* Mismatch! (Two devices provided different labels) */
+                       g_fprintf(stderr, "%s: Label (%s/%s) is different "
+                                          "from label (%s/%s) found at "
+                                          "device %s",
+                                          child->device_name,
+                                          child->volume_label,
+                                          child->volume_time,
+                                          dself->volume_label,
+                                          dself->volume_time,
+                                          label_from_device);
+                       success = FALSE;
+                    }
+                } else {
+                    /* First device with a volume. */
+                    dself->volume_label = g_strdup(child->volume_label);
+                    dself->volume_time = g_strdup(child->volume_time);
+                    label_from_device = g_strdup(child->device_name);
+                }
+            } else {
+                /* Device problem, it says it succeeded but sets no label? */
+               g_fprintf(stderr, "%s: %s",
+                                  child->device_name,
+                                  "Says label read, but device->volume_label "
+                                  " is NULL.");
+               success = FALSE;
+            }
+       }
+    }
+
+    amfree(label_from_device);
     g_ptr_array_free_full(ops);
 
     if (!success) {
@@ -772,6 +839,7 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label,
 typedef struct {
     GenericOp base;
     const dumpfile_t * info; /* IN */
+    int fileno;
 } StartFileOp;
 
 /* a GFunc */
@@ -779,6 +847,10 @@ static void start_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
     StartFileOp * op = data;
     op->base.result = GINT_TO_POINTER(device_start_file(op->base.child,
                                                         op->info));
+    op->fileno = op->base.child->file;
+    if (op->fileno < 1) {
+        op->base.result = FALSE;
+    }
 }
 
 static gboolean
@@ -787,6 +859,7 @@ rait_device_start_file (Device * dself, const dumpfile_t * info) {
     guint i;
     gboolean success;
     RaitDevice * self;
+    int actual_file = -1;
 
     self = RAIT_DEVICE(dself);
     g_return_val_if_fail(self != NULL, FALSE);
@@ -803,10 +876,37 @@ rait_device_start_file (Device * dself, const dumpfile_t * info) {
     do_rait_child_ops(start_file_do_op, ops, NULL);
 
     success = g_ptr_array_and(ops, extract_boolean_generic_op);
+    
+    for (i = 0; i < self->private->children->len && success; i ++) {
+        StartFileOp * op = g_ptr_array_index(ops, i);
+        if (!op->base.result)
+            continue;
+        g_assert(op->fileno >= 1);
+        if (actual_file < 1) {
+            actual_file = op->fileno;
+        }
+        if (actual_file != op->fileno) {
+            /* File number mismatch! Aah, my hair is on fire! */
+           g_fprintf(stderr, "File number mismatch in "
+                            "rait_device_start_file(): "
+                            "Child %s reported file number "
+                            "%d, another child reported "
+                            "file number %d.",
+                            op->base.child->device_name,
+                            op->fileno, actual_file);
+            success = FALSE;
+            op->base.result = FALSE;
+        }
+    }
 
     g_ptr_array_free_full(ops);
 
+    g_assert(actual_file >= 1);
+    dself->file = actual_file - 1; /* chain-up, below, will re-increment this */
+    dself->in_file = TRUE;
+
     if (!success) {
+       g_fprintf(stderr, _("One or more devices failed to start_file"));
         return FALSE;
     } else if (parent_class->start_file) {
         return parent_class->start_file(dself, info);
@@ -963,10 +1063,6 @@ rait_device_write_block (Device * dself, guint size, gpointer data,
         g_ptr_array_add(ops, op);
     }
 
-    if (last_block) {
-        amfree(data);
-    }
-    
     do_rait_child_ops(write_block_do_op, ops, NULL);
 
     success = g_ptr_array_and(ops, extract_boolean_generic_op);
@@ -977,9 +1073,20 @@ rait_device_write_block (Device * dself, guint size, gpointer data,
             free(op->data);
     }
 
+    if (last_block) {
+        amfree(data);
+    }
+    
     g_ptr_array_free_full(ops);
 
     if (!success) {
+       /* TODO be more specific here */
+       /* TODO: handle EOF here -- if one or more (or two or more??)
+        * children have is_eof* set, then reflect that in our error
+        * status, and finish_file all of the non-EOF children. What's
+        * more fun is when one device fails and must be isolated at
+        * the same time another hits EOF. */
+       g_fprintf(stderr, "One or more devices failed to write_block");
         return FALSE;
     } else {
         /* We don't chain up here because we must handle finish_file
@@ -1180,6 +1287,7 @@ static gboolean extract_boolean_read_block_op_eof(gpointer data) {
     return op->base.child->is_eof;
 }
 
+/* Counts the number of elements in an array matching a given proposition. */
 static int g_ptr_array_count(GPtrArray * array, BooleanExtractor filter) {
     int rval;
     unsigned int i;
@@ -1192,7 +1300,7 @@ static int g_ptr_array_count(GPtrArray * array, BooleanExtractor filter) {
 }
 
 static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops,
-                                      gpointer buf) {
+                                      gpointer buf, size_t bufsize) {
     guint num_children, data_children;
     int blocksize, child_blocksize;
     guint i;
@@ -1216,6 +1324,7 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops,
         if ((int)(op->base.child_index) == parity_child) {
             parity_block = op->buffer;
         } else {
+           g_assert(child_blocksize * (op->base.child_index+1) <= bufsize);
             memcpy((char *)buf + child_blocksize * op->base.child_index, op->buffer,
                    child_blocksize);
         }
@@ -1250,6 +1359,7 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops,
             amfree(constructed_parity);
         } else { /* do nothing. */ }
     } else if (self->private->status == RAIT_STATUS_DEGRADED) {
+       g_assert(self->private->failed >= 0 && self->private->failed < (int)num_children);
         /* We are in degraded mode. What's missing? */
         if (self->private->failed == parity_child) {
             /* do nothing. */
@@ -1290,6 +1400,7 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
     gboolean success;
     guint num_children, data_children;
     int blocksize;
+    gsize child_blocksize;
 
     RaitDevice * self = RAIT_DEVICE(dself);
     g_return_val_if_fail(self != NULL, -1);
@@ -1297,9 +1408,16 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
     find_simple_params(self, &num_children, &data_children,
                        &blocksize);
 
+    /* tell caller they haven't given us a big enough buffer */
+    if (blocksize < *size) {
+       *size = blocksize;
+       return 0;
+    }
+
     g_return_val_if_fail(*size >= (int)device_write_min_size(dself), -1);
-    g_assert(blocksize % data_children == 0); /* If not we are screwed */
 
+    g_assert(blocksize % data_children == 0); /* If not we are screwed */
+    child_blocksize = blocksize / data_children;
 
     ops = g_ptr_array_sized_new(num_children);
     for (i = 0; i < num_children; i ++) {
@@ -1309,7 +1427,7 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
         op = malloc(sizeof(*op));
         op->base.child = g_ptr_array_index(self->private->children, i);
         op->base.child_index = i;
-        op->buffer = malloc(blocksize / data_children);
+        op->buffer = malloc(child_blocksize);
         op->desired_read_size = op->read_size = blocksize / data_children;
         g_ptr_array_add(ops, op);
     }
@@ -1317,12 +1435,14 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
     do_rait_child_ops(read_block_do_op, ops, NULL);
 
     if (g_ptr_array_count(ops, extract_boolean_read_block_op_data)) {
-        success =
-            g_ptr_array_union_robust(RAIT_DEVICE(self),
+        if (!g_ptr_array_union_robust(RAIT_DEVICE(self),
                                      ops,
-                                     extract_boolean_read_block_op_data) &&
-            raid_block_reconstruction(RAIT_DEVICE(self),
-                                      ops, buf);
+                                     extract_boolean_read_block_op_data)) {
+           success = FALSE;
+       } else {
+           success = raid_block_reconstruction(RAIT_DEVICE(self),
+                                                ops, buf, (size_t)*size);
+       }
     } else {
         success = FALSE;
         if (g_ptr_array_union_robust(RAIT_DEVICE(self),
@@ -1330,7 +1450,10 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
                                      extract_boolean_read_block_op_eof)) {
             /* We hit EOF. */
             dself->is_eof = TRUE;
-        }
+           dself->in_file = FALSE;
+        } else {
+           g_fprintf(stderr, _("All child devices failed to read, but not all are at eof"));
+       }
     }
 
     for (i = 0; i < ops->len; i ++) {
@@ -1342,6 +1465,7 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) {
     if (success) {
         if (parent_class->read_block)
             parent_class->read_block(dself, buf, size);
+       *size = blocksize;
         return blocksize;
     } else {
         return -1;
@@ -1607,7 +1731,9 @@ rait_device_property_get (Device * dself, DevicePropertyId id, GValue * val) {
                 !g_value_compare(&result, &(op->value))) {
                 success = FALSE;
             }
-            g_value_unset(&(op->value));
+           /* free the GValue if the child call succeeded */
+           if (GPOINTER_TO_INT(op->base.result))
+               g_value_unset(&(op->value));
         }
 
         if (success) {
@@ -1656,14 +1782,21 @@ rait_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) {
     self = RAIT_DEVICE(d_self);
     g_return_val_if_fail(self != NULL, FALSE);
 
+    /* it doesn't make sense to hand these properties down to our child devices,
+     * so we'll just pretend we set them.  This is a 2.6.0 hack -- the device gets
+     * this right in 2.6.1.  */
+    if (id == PROPERTY_BLOCK_SIZE
+       || id == PROPERTY_MIN_BLOCK_SIZE
+       || id == PROPERTY_MAX_BLOCK_SIZE) {
+       return TRUE; /* lies! */
+    }
+
     ops = make_property_op_array(self, id, val);
     
     do_rait_child_ops(property_set_do_op, ops, NULL);
 
     success = g_ptr_array_union_robust(self, ops, extract_boolean_generic_op);
-    label_changed =
-        g_ptr_array_union_robust(self, ops,
-                                 extract_label_changed_property_op);
+    label_changed = g_ptr_array_or(ops, extract_label_changed_property_op);
     g_ptr_array_free_full(ops);
 
     if (label_changed) {
index ca83d52661af24286575d93cd9bf77298f906f09..bebb6efb436a5dd002a343502f850d69dcbb6921 100644 (file)
@@ -197,7 +197,7 @@ static gboolean
 s3_device_seek_block(Device *pself, 
                      guint64 block);
 
-static gboolean 
+static int
 s3_device_read_block(Device * pself, 
                      gpointer data, 
                      int *size_req);
@@ -1144,6 +1144,7 @@ s3_device_read_block (Device * pself, gpointer data, int *size_req) {
             /* if it's an expected error (not found), just return -1 */
             if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) {
                 pself->is_eof = TRUE;
+                pself->in_file = FALSE;
                 return -1;
             }
 
index 161ff4ea7a017b4a294052765c7f61f4d7e81efd..dfd29dc42200762e642211cfe486fef10f27a77d 100644 (file)
  * (*excluding* null terminator) */
 #define S3_MAX_KEY_LENGTH 1024
 
-#if defined(LIBCURL_FEATURE_SSL) && defined(LIBCURL_PROTOCOL_HTTPS)
-# define S3_URL "https://s3.amazonaws.com"
-#else
-# define S3_URL "http://s3.amazonaws.com"
-#endif
-
 #define AMAZON_SECURITY_HEADER "x-amz-security-token"
 
 /* parameters for exponential backoff in the face of retriable errors */
@@ -159,6 +153,13 @@ s3_error_code_from_name(char *s3_error_name);
 static const char *
 s3_error_name_from_code(s3_error_code_t s3_error_code);
 
+/* Does this install of curl support SSL?
+ *
+ * @returns: boolean
+ */
+static gboolean
+s3_curl_supports_ssl(void);
+
 /*
  * result handling */
 
@@ -321,6 +322,28 @@ s3_error_name_from_code(s3_error_code_t s3_error_code)
 }
 /* }}} */
 
+/* {{{ s3_curl_supports_ssl */
+static gboolean
+s3_curl_supports_ssl(void)
+{
+    static int supported = -1;
+
+    if (supported == -1) {
+#if defined(CURL_VERSION_SSL)
+       curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
+       if (info->features & CURL_VERSION_SSL)
+           supported = 1;
+       else
+           supported = 0;
+#else
+       supported = 0;
+#endif
+    }
+
+    return supported;
+}
+/* }}} */
+
 /* {{{ lookup_result */
 static s3_result_t
 lookup_result(const result_handling_t *result_handling,
@@ -660,6 +683,7 @@ perform_request(S3Handle *hdl,
                 guint preallocate_response_size,
                 const result_handling_t *result_handling)
 {
+    const char *baseurl;
     char *url = NULL;
     s3_result_t result = S3_RESULT_FAIL; /* assume the worst.. */
     CURLcode curl_code = CURLE_OK;
@@ -675,7 +699,8 @@ perform_request(S3Handle *hdl,
 
     s3_reset(hdl);
 
-    url = g_strconcat(S3_URL, uri, NULL);
+    baseurl = s3_curl_supports_ssl()? "https://s3.amazonaws.com":"http://s3.amazonaws.com";
+    url = g_strconcat(baseurl, uri, NULL);
     if (!url) goto cleanup;
 
     if (preallocate_response_size) {
index b5701a1ed95f186e47c0a674a7339aae716d777c..a9665a74f5982c4680681b53bb327e5bd8420fbd 100644 (file)
@@ -91,9 +91,9 @@ gboolean tape_setcompression(int fd, gboolean on) {
     return FALSE;
 }
 
-TapeCheckResult tape_is_tape_device(int fd) {
+ReadLabelStatusFlags tape_is_tape_device(int fd) {
     /* AIX doesn't have a no-op. */
-    return TAPE_CHECK_UNKNOWN;
+    return READ_LABEL_STATUS_SUCCESS;
 }
 
 TapeCheckResult tape_is_ready(int fd) {
index ca629bfe71688baf97b99d37b87eb76249437541..1274fcd993cfe581ec60a82d8233b12705617dee 100644 (file)
@@ -56,7 +56,7 @@ static gboolean tape_device_open_device (Device * self, char * device_name);
 static ReadLabelStatusFlags tape_device_read_label(Device * self);
 static gboolean tape_device_write_block(Device * self, guint size,
                                         gpointer data, gboolean short_block);
-static gboolean tape_device_read_block(Device * self,  gpointer buf,
+static int tape_device_read_block(Device * self,  gpointer buf,
                                        int * size_req);
 static gboolean tape_device_start (Device * self, DeviceAccessMode mode,
                                    char * label, char * timestamp);
@@ -228,48 +228,84 @@ void tape_device_register(void) {
     register_device(tape_device_factory, device_prefix_list);
 }
 
-#ifdef O_NONBLOCK
 /* Open the tape device, trying various combinations of O_RDWR and
-   O_NONBLOCK. */
-static int try_open_tape_device(TapeDevice * self, char * device_name) {
-    int rval;
-    rval  = robust_open(device_name, O_RDWR | O_NONBLOCK, 0);
-    if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) {
+   O_NONBLOCK.  Returns -1 and sets status_result for errors */
+static int try_open_tape_device(TapeDevice * self, char * device_filename,
+       ReadLabelStatusFlags *status_result) {
+    int fd;
+    int save_errno;
+    ReadLabelStatusFlags new_status;
+    TapeCheckResult tcr;
+    *status_result = READ_LABEL_STATUS_SUCCESS;
+
+#ifdef O_NONBLOCK
+    fd  = robust_open(device_filename, O_RDWR | O_NONBLOCK, 0);
+    save_errno = errno;
+    if (fd < 0 && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) {
         /* Maybe we don't support O_NONBLOCK for tape devices. */
-        rval = robust_open(device_name, O_RDWR, 0);
+        fd = robust_open(device_filename, O_RDWR, 0);
+       save_errno = errno;
     }
-    if (rval >= 0) {
+#else
+    fd = robust_open(device_filename, O_RDWR);
+    save_errno = errno;
+#endif
+    if (fd >= 0) {
         self->write_open_errno = 0;
     } else {
         if (errno == EACCES || errno == EPERM) {
             /* Device is write-protected. */
             self->write_open_errno = errno;
-            rval = robust_open(device_name, O_RDONLY | O_NONBLOCK, 0);
-            if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) {
-                rval = robust_open(device_name, O_RDONLY, 0);
+#ifdef O_NONBLOCK
+            fd = robust_open(device_filename, O_RDONLY | O_NONBLOCK, 0);
+           save_errno = errno;
+            if (fd < 0 && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) {
+                fd = robust_open(device_filename, O_RDONLY, 0);
+               save_errno = errno;
             }
+#else
+            fd = robust_open(device_filename, O_RDONLY);
+           save_errno = errno;
+#endif
         }
     }
+#ifdef O_NONBLOCK
     /* Clear O_NONBLOCK for operations from now on. */
-    fcntl(rval, F_SETFL, fcntl(rval, F_GETFL, 0) & ~O_NONBLOCK);
-    return rval;
-}
-#else /* !defined(O_NONBLOCK) */
-static int try_open_tape_device(TapeDevice * self, char * device_name) {
-    int rval;
-    rval = robust_open(device_name, O_RDWR);
-    if (rval >= 0) {
-        self->write_open_errno = 0;
-    } else {
-        if (errno == EACCES || errno == EPERM) {
-            /* Device is write-protected. */
-            self->write_open_errno = errno;
-            rval = robust_open(device_name, O_RDONLY);
-        }
+    if (fd >= 0)
+       fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK);
+    errno = save_errno;
+    /* function continues after #endif */
+
+#endif /* O_NONBLOCK */
+
+    if (fd < 0) {
+       g_fprintf(stderr, _("Can't open tape device %s: %s\n"),
+           DEVICE(self)->device_name, strerror(errno));
+       *status_result = READ_LABEL_STATUS_DEVICE_ERROR;
+        return -1;
+    }
+
+    /* Check that this is actually a tape device. */
+    new_status = tape_is_tape_device(fd);
+    if (new_status & (READ_LABEL_STATUS_DEVICE_ERROR | READ_LABEL_STATUS_VOLUME_MISSING)) {
+       g_fprintf(stderr, _("File %s is not a tape device\n"),
+           DEVICE(self)->device_name);
+        robust_close(fd);
+       *status_result = new_status;
+        return -1;
     }
-    return rval;
+
+    tcr = tape_is_ready(fd);
+    if (new_status == TAPE_CHECK_FAILURE) {
+       g_fprintf(stderr, _("Tape device %s is not ready or is empty\n"),
+           DEVICE(self)->device_name);
+        robust_close(fd);
+       *status_result = READ_LABEL_STATUS_DEVICE_ERROR;
+        return -1;
+    }
+
+    return fd;
 }
-#endif /* O_NONBLOCK */
 
 static gboolean 
 tape_device_open_device (Device * d_self, char * device_name) {
@@ -279,38 +315,6 @@ tape_device_open_device (Device * d_self, char * device_name) {
     g_return_val_if_fail (self != NULL, FALSE);
     g_return_val_if_fail (device_name != NULL, FALSE);
 
-    self->fd = try_open_tape_device(self, device_name);
-
-    if (self->fd < 0) {
-        g_fprintf(stderr, "Can't open tape device %s: %s\n",
-                device_name, strerror(errno));
-        return FALSE;
-    }
-
-    /* Check that this is actually a tape device. */
-    if (tape_is_tape_device(self->fd) == TAPE_CHECK_FAILURE) {
-        g_fprintf(stderr, "File %s is not a tape device.\n",
-                device_name);
-        robust_close(self->fd);
-        return FALSE;
-    }
-
-    if (tape_is_ready(self->fd) == TAPE_CHECK_FAILURE) {
-        g_fprintf(stderr,
-                  "Tape device %s is not ready or is empty.\n",
-                  device_name);
-        robust_close(self->fd);
-        return FALSE;
-    }
-
-    /* Rewind it. */
-    if (!tape_rewind(self->fd)) {
-        g_fprintf(stderr, "Error rewinding device %s\n",
-                device_name);
-        robust_close(self->fd);
-        return FALSE;
-    }
-
     /* Get tape drive/OS info */
     tape_device_discover_capabilities(self);
 
@@ -345,6 +349,17 @@ static ReadLabelStatusFlags tape_device_read_label(Device * dself) {
     self = TAPE_DEVICE(dself);
     g_return_val_if_fail(self != NULL, FALSE);
 
+    amfree(dself->volume_label);
+    amfree(dself->volume_time);
+
+    if (self->fd == -1) {
+       ReadLabelStatusFlags status;
+        self->fd = try_open_tape_device(self, dself->device_name, &status);
+       if (self->fd == -1)
+           return status;
+    }
+
+    /* Rewind it. */
     if (!tape_rewind(self->fd)) {
         g_fprintf(stderr, "Error rewinding device %s\n",
                 dself->device_name);
@@ -464,7 +479,9 @@ static int tape_device_read_block (Device * pself, gpointer buf,
     }
     case RESULT_NO_DATA:
         pself->is_eof = TRUE;
-        /* FALLTHROUGH */
+       pself->in_file = FALSE;
+        return -1;
+
     default:
         return -1;
     }
@@ -509,7 +526,23 @@ tape_device_start (Device * d_self, DeviceAccessMode mode, char * label,
 
     self = TAPE_DEVICE(d_self);
     g_return_val_if_fail(self != NULL, FALSE);
-    
+
+    if (self->fd == -1) {
+       ReadLabelStatusFlags status;
+        self->fd = try_open_tape_device(self, d_self->device_name, &status);
+       if (self->fd == -1)
+           return FALSE;   /* can't do anything with status here */
+    }
+
+    if (mode != ACCESS_WRITE && d_self->volume_label == NULL) {
+       /* we need a labeled volume for APPEND and READ */
+       if (tape_device_read_label(d_self) != READ_LABEL_STATUS_SUCCESS)
+           return FALSE;
+    }
+
+    d_self->access_mode = mode;
+    d_self->in_file = FALSE;
+
     if (IS_WRITABLE_ACCESS_MODE(mode)) {
         if (self->write_open_errno != 0) {
             /* We tried and failed to open the device in write mode. */
index 24483738550061f20641eba97e20bfda89bc80aa..bebe28abc3b32ca45c096f3002e49462d51a8f60 100644 (file)
@@ -53,7 +53,7 @@ typedef enum {
     TAPE_CHECK_UNKNOWN,
     TAPE_CHECK_FAILURE
 } TapeCheckResult;
-TapeCheckResult tape_is_tape_device(int fd);
+ReadLabelStatusFlags tape_is_tape_device(int fd);
 TapeCheckResult tape_is_ready(int fd);
 
 /* Also implemented in above files. Sets properties on the device. */
index a9a31bbbef023d0fadcd86ce1a485fa532b0e92c..70e948002f4f72b4fa8cc199f44c53eb4bb0d50f 100644 (file)
@@ -131,16 +131,21 @@ gboolean tape_setcompression(int fd G_GNUC_UNUSED,
 #endif
 }
 
-TapeCheckResult tape_is_tape_device(int fd) {
+ReadLabelStatusFlags tape_is_tape_device(int fd) {
     struct mtop mt;
     mt.mt_op = MTNOP;
     mt.mt_count = 1;
     if (0 == ioctl(fd, MTIOCTOP, &mt)) {
-        return TAPE_CHECK_SUCCESS;
+        return READ_LABEL_STATUS_SUCCESS;
     } else {
        dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
                 strerror(errno));
-        return TAPE_CHECK_FAILURE;
+       if (errno == EIO) {
+           /* some devices return EIO while the drive is busy loading */
+           return READ_LABEL_STATUS_DEVICE_ERROR|READ_LABEL_STATUS_VOLUME_MISSING;
+       } else {
+           return READ_LABEL_STATUS_DEVICE_ERROR;
+       }
     }
 }
 
index 4f216161db3dad4f585cf4d623037bf743d69acc..0b86761ec5c9c56ce925a12e77540030afc95289 100644 (file)
@@ -83,13 +83,15 @@ gboolean tape_setcompression(int fd, gboolean on) {
     return 0 == ioctl(fd, T_SETCOMP, cmd);
 }
 
-TapeCheckResult tape_is_tape_device(int fd) {
+ReadLabelStatusFlags tape_is_tape_device(int fd) {
     /* If we can read block information, it's probably a tape device. */
     struct blklen result;
     if (0 == ioctl(fd, T_RDBLKLEN, &result)) {
-        return TAPE_CHECK_SUCCESS;
+        return READ_LABEL_STATUS_SUCCESS;
     } else {
-        return TAPE_CHECK_FAILURE;
+       dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
+                strerror(errno));
+       return READ_LABEL_STATUS_DEVICE_ERROR;
     }
 }
 
index 87be604bc8c1d9f49b451c06c113a1fc609bd896..1890cd20de66e3109463fd0186f567fd4ca53274 100644 (file)
@@ -81,12 +81,14 @@ gboolean tape_setcompression(int fd, gboolean on) {
     return FALSE;
 }
 
-TapeCheckResult tape_is_tape_device(int fd) {
+ReadLabelStatusFlags tape_is_tape_device(int fd) {
     struct tape_info result;
     if (0 == ioctl(fd, MT_STATUS, &result)) {
-        return TAPE_CHECK_SUCCESS;
+        return READ_LABEL_STATUS_SUCCESS;
     } else {
-        return TAPE_CHECK_FAILURE;
+       dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
+                strerror(errno));
+       return READ_LABEL_STATUS_DEVICE_ERROR;
     }
 }
 
index fd8b7ecb24d2765f22ded2325c528a2019d164be..37fe55e6bed149fbf09c2dd08465920a585c464e 100644 (file)
@@ -81,6 +81,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index cdfac17d66b4defac788fe1bae4758a131fca072..2e523c73ab9474bb0665bafb4397e20173567bb2 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "semaphore.h"
 #include "amanda.h"
+#include "util.h"
 
 /*
  * test that decrement waits properly
@@ -49,12 +50,11 @@ static gboolean
 test_decr_wait(void)
 {
     GThread *th;
-    struct test_decr_wait_data data = {
-       semaphore_new_with_value(10),
-       FALSE
-    };
+    struct test_decr_wait_data data = { NULL, FALSE };
     int rv;
 
+    data.sem = semaphore_new_with_value(10),
+
     /* die after 10 seconds (default signal disposition is to fail) */
     alarm(10);
 
@@ -254,7 +254,7 @@ main(void)
     gboolean pass = TRUE;
 
 #if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
-    amanda_thread_init(NULL);
+    amanda_thread_init();
 
     pass = test_decr_wait() && pass;
     pass = test_wait_empty() && pass;
index 5b63f2b2da51a346240bad1411885b1359e9eeed..b05ee781a3b11e920a1758be4b5606c552d59162 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <device.h>
 #include <amanda.h>
+#include "util.h"
 
 /* global so the 'atexit' handler can access it */
 
@@ -118,7 +119,7 @@ main(int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED)
     pid_t pid;
     amwait_t status;
 
-    amanda_thread_init(NULL);
+    amanda_thread_init();
 
     device_path = setup_vtape_dir();
 
index b197dcc1d91f7919a93297d17b2c737b4154b714..a69b584f69943c85a7489f99caa5c3a42ad70e66 100644 (file)
@@ -20,9 +20,9 @@
 
 #include <string.h> /* memset() */
 
+#include "amanda.h"
 #include "vfs-device.h"
 #include "fsusage.h"
-#include "amanda.h"
 #include "util.h"
 #include <regex.h>
 
@@ -726,7 +726,8 @@ vfs_device_read_block(Device * pself, gpointer data, int * size_req) {
         return size;
     case RESULT_NO_DATA:
         pself->is_eof = TRUE;
-        /* FALLTHROUGH */
+        pself->in_file = FALSE;
+        return -1;
     default:
         return -1;
     }
@@ -871,6 +872,9 @@ char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji) {
         }
     }
 
+    /* record that we're at this filenum now */
+    DEVICE(self)->file = fileno;
+
     base = g_strdup_printf("%05d.%s.%s.%d", fileno, ji->name, ji->disk,
                            ji->dumplevel);
     sanitary_base = sanitise_filename(base);
@@ -922,6 +926,8 @@ vfs_device_start_file (Device * pself, const dumpfile_t * ji) {
     }
 
     self->volume_bytes += VFS_DEVICE_LABEL_SIZE;
+    /* make_new_file_name set pself->file for us, but the parent class will increment it, so decrement it now */
+    pself->file--;
 
     if (parent_class->start_file) {
         parent_class->start_file(pself, ji);
@@ -1112,8 +1118,8 @@ vfs_device_property_set (Device * pself, DevicePropertyId ID, GValue * val) {
         self->volume_limit = g_value_get_uint64(val);
         return TRUE;
     } else {
-        if (parent_class->property_get) {
-            return parent_class->property_get(pself, ID, val);
+        if (parent_class->property_set) {
+            return parent_class->property_set(pself, ID, val);
         } else {
             return FALSE;
         }
index 50353aaf100c7daad2d44312428716baecd1cbfc..bd21ff1f59492a1f43489cf1556dd92138e0866e 100644 (file)
@@ -206,6 +206,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 70c041d008d520c41a0aa80bf6a6f6b9febf03fd..f866f46cfd35cedb938b7dc2c9e0c98a3ac5f576 100644 (file)
@@ -121,6 +121,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 04c9381405371ea511cf4f790e7b78522f2cfe53..aab44ad17d6183555072ca412dea319e406c71e9 100644 (file)
@@ -90,6 +90,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 8a2193595240c1e26fc6334b74c8e2b97f695f02..5a0bb2254fb879bbd3a544f7d9aeff144253efe5 100644 (file)
@@ -159,7 +159,7 @@ SKIP: { # tapetypes
     ok(!tapetype_seen($ttyp, $TAPETYPE_LBL_TEMPL),
        "tapetype lbl_templ was not seen");
 
-    is_deeply([ sort(getconf_list("tapetype")) ],
+    is_deeply([ sort(+getconf_list("tapetype")) ],
              [ sort("mytapetype", "TEST-TAPE") ],
        "getconf_list lists all tapetypes");
 }
@@ -205,7 +205,7 @@ SKIP: { # dumptypes
     ok(!dumptype_seen($dtyp, $DUMPTYPE_RECORD),
        "'record' parm was not seen");
 
-    is_deeply([ sort(getconf_list("dumptype")) ],
+    is_deeply([ sort(+getconf_list("dumptype")) ],
              [ sort(qw(
                mydumptype
                NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST
@@ -233,7 +233,7 @@ SKIP: { # interfaces
     ok(!interface_seen($iface, $INTER_MAXUSAGE),
        "seen not set for parameters that did not appear");
 
-    is_deeply([ sort(getconf_list("interface")) ],
+    is_deeply([ sort(+getconf_list("interface")) ],
              [ sort('inyoface', 'inherface', 'default') ],
        "getconf_list lists all interfaces (in any order)");
 }
@@ -271,7 +271,7 @@ SKIP: { # holdingdisks
     ok(!holdingdisk_next($hdisk),
        "no third holding disk");
 
-    is_deeply([ sort(getconf_list("holdingdisk")) ],
+    is_deeply([ sort(+getconf_list("holdingdisk")) ],
              [ sort('hd1', 'hd2') ],
        "getconf_list lists all holdingdisks (in any order)");
 }
index c42c8d1474df89c0d3a79ce87df412dc022d3235..afbc373e6f06faa7742aff214ee9c08fbfdc222a 100644 (file)
@@ -163,6 +163,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 7678feac99fc47914f962adf2f7423abb2ab67d0..31ea2041366e446f01cf6481b7ca7be2701c6e48 100644 (file)
@@ -116,7 +116,7 @@ $testconf->add_param("device_property", '"power" "on"');
 $testconf->add_param("device_property", '"turbo" "engaged"');
 $testconf->write();
 
-is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'device_property')))],
+is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'device_property')))],
          [sort('"power" "on"', '"turbo" "engaged"')],
     "device_property can have multiple values");
 
@@ -132,7 +132,7 @@ $testconf->add_interface("testiface", [ use => '10' ]);
 $testconf->add_holdingdisk("hd17", [ chunksize => '128' ]);
 $testconf->write();
 
-is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'tapetype')))],
+is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'tapetype')))],
          [sort("cassette", "reel2reel", "scotch", "TEST-TAPE")],
        "--list returns correct set of tapetypes");
 is(amgetconf('TESTCONF', 'tapetype:scotch:length'), '500', 
@@ -143,14 +143,14 @@ ok(grep { $_ eq 'testdump' } split(/\n/, amgetconf('TESTCONF', '--list', 'dumpty
 is(amgetconf('TESTCONF', 'dumptype:testdump:comment'), 'testdump-dumptype', 
     "returns dumptype parameter correctly");
 
-is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'interface')))], 
+is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'interface')))],
           [sort("testiface", "default")],
        "--list returns correct set of interfaces");
 is(amgetconf('TESTCONF', 'interface:testiface:use'), '10', 
     "returns interface parameter correctly");
 
-is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'holdingdisk')))], 
-         [sort("hd17")], 
+is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'holdingdisk')))],
+         [sort("hd17")],
        "--list returns correct set of holdingdisks");
 is(amgetconf('TESTCONF', 'holdingdisk:hd17:chunksize'), '128',
     "returns holdingdisk parameter correctly");
@@ -177,12 +177,12 @@ $testconf->add_dumptype("testdump", [
     ]);
 $testconf->write();
 
-is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:exclude')))],
+is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:exclude')))],
          [sort('FILE "f1" "f2"',
                'LIST "l1" "l2"')],
     "exclude files and lists displayed correctly; a non-final optional is ignored");
 
-is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:include')))],
+is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:include')))],
          [sort('FILE OPTIONAL "ifo"',
                'LIST OPTIONAL "ilo"')],
     "a final 'OPTIONAL' makes the whole include/exclude optional")
index 1a74ac440dc4fe2c61f7385d1783e02b061232f1..c06034116a84722ffcb767645e6d6302481cee9a 100644 (file)
@@ -70,24 +70,34 @@ SRCMANPAGEDIR  = $(srcdir)/xml-source
 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
 
 EXTRA_XML = xslt/expand-sambadoc.xsl \
-            xslt/man.xsl \
+            xslt/man.xsl.in \
+            xslt/html.xsl.in \
             xslt/settings.xsl \
            entities/global.entities \
            entities/xinclude.dtd
 
-EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_XML)
+EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML)
 
 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
 
 MOSTLYCLEANFILES = $(GEN_XML)
 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
 
+# some of the XSL needs to know what docbook-xsl version we've selected
+%.xsl: %.xsl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
 if   ENABLE_MANPAGE_BUILD
+# phase one of the documentation build expands some macros.
 xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
        $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
 
+# phase two generates a manpage from the resulting "expanded" docbook XML
 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/$(XSLREL)/manpages/docbook.xsl $<
+       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/man.xsl $<
+
+%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl
+       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/html.xsl $<
 
 else   !ENABLE_MANPAGE_BUILD
 
@@ -95,8 +105,24 @@ else        !ENABLE_MANPAGE_BUILD
        @echo WARNING: Not building needed $@ because building manpages is disabled.
        @echo 'DUMMY' > $@
 
+# (no rule to build HTML without ENABLE_MANPAGE_BUILD)
+
 endif
 
+##
+## HTML Generation
+##
+
+EXTRA_DIST += \
+       index.php \
+       amanda.css
+
+ALL_MAN_HTMLS = $(ALL_MAN_PAGES:%=%.html)
+
+# toplevel rule to build HTML manpages and tar them up
+html: amanda.css index.php $(ALL_MAN_HTMLS)
+       tar -zcf html.tar.gz $(ALL_MAN_HTMLS) amanda.css index.php
+
 # double-check that we don't ship dummy manpages
 dist-hook:
        for f in $(WANTED_MAN_PAGES); do \
index 33edd41911ea6b1062d9f2a488311cafde4ce922..80f0d8fb24228fb161c0560bf955afdec542f98e 100644 (file)
@@ -80,6 +80,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
@@ -612,15 +613,20 @@ WANTED_MAN_PAGES = $(COMMON_MAN_PAGES) $(am__append_1) $(am__append_2) \
 SRCMANPAGEDIR = $(srcdir)/xml-source
 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
 EXTRA_XML = xslt/expand-sambadoc.xsl \
-            xslt/man.xsl \
+            xslt/man.xsl.in \
+            xslt/html.xsl.in \
             xslt/settings.xsl \
            entities/global.entities \
            entities/xinclude.dtd
 
-EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_XML)
+
+# (no rule to build HTML without ENABLE_MANPAGE_BUILD)
+EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML) \
+       index.php amanda.css
 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
 MOSTLYCLEANFILES = $(GEN_XML)
 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
+ALL_MAN_HTMLS = $(ALL_MAN_PAGES:%=%.html)
 man_MANS = $(WANTED_MAN_PAGES)
 all: all-am
 
@@ -831,8 +837,6 @@ dvi: dvi-am
 
 dvi-am:
 
-html: html-am
-
 info: info-am
 
 info-am:
@@ -891,16 +895,29 @@ uninstall-man: uninstall-man5 uninstall-man8
        uninstall-man uninstall-man5 uninstall-man8
 
 
+# some of the XSL needs to know what docbook-xsl version we've selected
+%.xsl: %.xsl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# phase one of the documentation build expands some macros.
 @ENABLE_MANPAGE_BUILD_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
 @ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
 
+# phase two generates a manpage from the resulting "expanded" docbook XML
 @ENABLE_MANPAGE_BUILD_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/$(XSLREL)/manpages/docbook.xsl $<
+@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/man.xsl $<
+
+@ENABLE_MANPAGE_BUILD_TRUE@%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl
+@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/html.xsl $<
 
 @ENABLE_MANPAGE_BUILD_FALSE@%: $(SRCMANPAGEDIR)/%.xml
 @ENABLE_MANPAGE_BUILD_FALSE@   @echo WARNING: Not building needed $@ because building manpages is disabled.
 @ENABLE_MANPAGE_BUILD_FALSE@   @echo 'DUMMY' > $@
 
+# toplevel rule to build HTML manpages and tar them up
+html: amanda.css index.php $(ALL_MAN_HTMLS)
+       tar -zcf html.tar.gz $(ALL_MAN_HTMLS) amanda.css index.php
+
 # double-check that we don't ship dummy manpages
 dist-hook:
        for f in $(WANTED_MAN_PAGES); do \
index c83ddcc2157f1720302959c5585c5cedc301ab74..0857293bd8efc18394003cf0af95bf6753dcaeb6 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amaddclient
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMADDCLIENT" "8" "05/14/2008" "" ""
+.TH "AMADDCLIENT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -209,4 +209,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c
 \fBssh-keygen\fR(1)
 \fBssh-add\fR(1)
 \fBscp\fR(1)
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index cb38aec13da598f7ec7640966753c0840d043b6e..871d67914c20e97a277e61dc3d0e3ffd9053f3bc 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amadmin
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMADMIN" "8" "05/14/2008" "" ""
+.TH "AMADMIN" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -144,7 +144,6 @@ The
 \fB\-\-sort\fR
 option changes the sort order using the following flags:
 .sp
-.RS 4
 .nf
 \fIh\fR: host name
 \fIk\fR: disk name
@@ -153,7 +152,6 @@ option changes the sort order using the following flags:
 \fIp\fR: dump part
 \fIb\fR: tape label
 .fi
-.RE
 .sp
 An uppercase letter reverses the sort order for that key\. The default sort order is
 \fBhkdlpb\fR\.
@@ -263,23 +261,18 @@ Request three specific file systems on
 get a full level 0 backup during the next
 \fIAmanda\fR
 run\.
-.sp
-.RS 4
 .nf
 $ amadmin daily force machine\-a / /var /usr
 amadmin: machine\-a:/ is set to a forced level 0 tonight\.
 amadmin: machine\-a:/var is set to a forced level 0 tonight\.
 amadmin: machine\-a:/usr is set to a forced level 0 tonight\.
 .fi
-.RE
 .PP
 Request all file systems on
 \fImachine\-b\fR
 get a full level 0 backup during the next
 \fIAmanda\fR
 run\.
-.sp
-.RS 4
 .nf
 $ amadmin daily force machine\-b
 amadmin: machine\-b:/ is set to a forced level 0 tonight\.
@@ -287,7 +280,6 @@ amadmin: machine\-b:/var is set to a forced level 0 tonight\.
 amadmin: machine\-b:/usr is set to a forced level 0 tonight\.
 amadmin: machine\-b:/home is set to a forced level 0 tonight\.
 .fi
-.RE
 .PP
 Undo the previous
 \fBforce\fR
@@ -295,13 +287,10 @@ request for
 \fI/home\fR
 on
 \fImachine\-b\fR\. The other file systems will still get a full level 0 backup\.
-.sp
-.RS 4
 .nf
 $ amadmin daily unforce machine\-b /home
 amadmin: force command for machine\-b:/home cleared\.
 .fi
-.RE
 .PP
 Locate backup images of
 \fI/var\fR
@@ -313,8 +302,6 @@ column displays either a tape label or a filename depending on whether the image
 column tells you which file on the tape has the image (file number zero is a tape label)\. This column shows zero and is not meaningful if the image is still in the holding disk\. The
 \fIstatus\fR
 column tells you whether the backup was successful or had some type of error\.
-.sp
-.RS 4
 .nf
 $ amadmin daily find machine\-c /var
 date        host      disk lv tape or file                 file part  status
@@ -329,7 +316,6 @@ date        host      disk lv tape or file                 file part  status
 2000\-11\-01  machine\-c /var  1 000102                       5   \-\-  OK
 2000\-10\-31  machine\-c /var  1 000101                       3   \-\-  OK
 .fi
-.RE
 .PP
 Forget about the
 \fI/workspace\fR
@@ -339,26 +325,20 @@ disk on
 file,
 \fIAmanda\fR
 will treat it as a new disk during the next run\.
-.sp
-.RS 4
 .nf
 $ amadmin daily delete machine\-d /workspace
 amadmin: machine\-d:/workspace deleted from database\.
 amadmin: NOTE: you\'ll have to remove these from the disklist yourself\.
 .fi
-.RE
 .PP
 Find the next tape
 \fIAmanda\fR
 will use (in this case,
 123456)\.
-.sp
-.RS 4
 .nf
 $ amadmin daily tape
 The next \fIAmanda\fR run should go onto tape 123456 or a new tape\.
 .fi
-.RE
 .PP
 Show how well full backups are balanced across the dump cycle\. The
 \fIdue\-date\fR
@@ -383,8 +363,6 @@ The last line also shows an estimate of how many
 runs will be made between full backups for a file system\. In the example, a file system will probably have a full backup done every eight times
 \fIAmanda\fR
 is run (e\.g\. every eight days)\.
-.sp
-.RS 4
 .nf
 $ amadmin daily balance
  due\-date  #fs   orig KB    out KB  balance
@@ -402,7 +380,6 @@ $ amadmin daily balance
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
 TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 .fi
-.RE
 .SH "FILES"
 .PP
 /usr/local/etc/amanda/\fIconfig\fR/amanda\.conf
@@ -422,4 +399,4 @@ Stefan G\. Weichinger,
 \fBamdump\fR(8),
 \fBamrestore\fR(8),
 \fBamfetchdump\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 13dd165c3d890f4cf7c645dc38d4e4ea88ce9ffb..5bf745110dcc3c305c52a03c381997f9b22879f7 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amaespipe
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMAESPIPE" "8" "05/14/2008" "" ""
+.TH "AMAESPIPE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -25,7 +25,7 @@ requires
 and
 \fBgpg\fR
 to work\. Aespipe is available from
-\fI\%http://loop-aes.sourceforge.net\fR
+: http://loop-aes.sourceforge.net
 .PP
 
 \fBamaespipe\fR
@@ -53,4 +53,4 @@ autodects encryption type and hash function from the encrypted image\.
 \fBaespipe\fR(1),
 \fBamcrypt\fR(8),
 \fBgpg\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 83d9978ab824d31b4ea3611a5d506dd9002c9d74..fb15d229cd3c44fd8d39a08ec9003cef01536ba8 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda-client.conf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA\-CLIENT\.CONF" "5" "05/14/2008" "" ""
+.TH "AMANDA\-CLIENT\.CONF" "5" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -298,4 +298,4 @@ Stefan G\. Weichinger,
 \fBamanda.conf\fR(5),
 \fBamcrypt\fR(8),
 \fBaespipe\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 15dbba4ded98b126bd9df11c5cc1bc2aaf2e43b1..ef16e72828242ee6367e09560e46f69def53ff07 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA" "8" "05/14/2008" "" ""
+.TH "AMANDA" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -396,12 +396,9 @@ The
 \fIdisklist\fR
 file determines which disks will be backed up by
 \fIAmanda\fR\. The file usually contains one line per disk:
-.sp
-.RS 4
 .nf
 \fIhostname diskname\fR [\fIdiskdevice\fR] \fIdumptype\fR [\fIspindle\fR [\fIinterface\fR] ]
 .fi
-.RE
 .PP
 All pairs [
 \fIhostname diskname\fR
@@ -505,15 +502,12 @@ For instance, if a
 named
 \fInormal\fR
 is used for most disks, but use of the holding disk needs to be disabled for the file system that holds it, this would work instead of defining a new dumptype:
-.sp
-.RS 4
 .nf
 \fIhostname diskname\fR [ \fIdiskdevice\fR ] {
   normal
   holdingdisk never
 } [ \fIspindle\fR [ \fIinterface\fR ] ]
 .fi
-.RE
 .SH "TAPE MANAGEMENT"
 .PP
 The
@@ -522,11 +516,9 @@ file contains the list of tapes in active use\. This file is maintained entirely
 \fIAmanda\fR
 and should not be created or edited during normal operation\. It contains lines of the form:
 .PP
-.RS 4
 .nf
 YYYYMMDD label flags
 .fi
-.RE
 .PP
 Where
 \fIYYYYMMDD\fR
@@ -581,20 +573,15 @@ This is the default driver\. The
 \fIdriver\-info\fR
 is the tape device name\. Entering
 .sp
-.RS 4
 .nf
 tapedev /dev/rmt/0mn
 .fi
-.RE
-.sp
 is really a short hand for
 .sp
-.RS 4
 .nf
 tapedev tape:/dev/rmt/0mn
 .fi
 .RE
-.RE
 .PP
 \fInull\fR
 .RS 4
@@ -606,11 +593,9 @@ checks for and allows through regardless of what you have set in
 field is not used and may be left blank:
 .sp
 .sp
-.RS 4
 .nf
 tapedev null:
 .fi
-.RE
 .sp
 The
 \fIlength\fR
@@ -641,11 +626,9 @@ The
 field describes the devices to use\. Curly braces indicate multiple replacements in the string\. For instance:
 .sp
 .sp
-.RS 4
 .nf
 tapedev rait:/dev/rmt/tps0d{4,5,6}n
 .fi
-.RE
 .sp
 would use the following devices:
 .sp
@@ -784,13 +767,10 @@ needs a file on the Samba server (which may or may not also be the tape server)
 \fI/etc/amandapass\fR
 with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated\. By default, the user used to connect to the PC is the same for all PC\'s and is compiled into
 \fIAmanda\fR\. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password\. For instance:
-.sp
-.RS 4
 .nf
   //some\-pc/home normalpw
   //another\-pc/disk otheruser%otherpw
 .fi
-.RE
 With clear text passwords, this file should obviously be tightly protected\. It only needs to be readable by the
 \fIAmanda\fR\-user on the Samba server\.
 .sp
@@ -1117,12 +1097,9 @@ For global options,
 \fIname\fR
 is simply the name of the option, e\.g\.,
 .sp
-.RS 4
 .nf
 amdump \-oruntapes=2
 .fi
-.RE
-.sp
 For options in a named section of the configuration,
 \fIname\fR
 has the form
@@ -1132,24 +1109,19 @@ is one of TAPETYPE, DUMPTYPE, HOLDINGDISK, or INTERFACE, and
 \fIsection_name\fR
 is the name of the tapetype, dumptype, holdingdisk, or interface\. Examples:
 .sp
-.RS 4
 .nf
 amdump \-o TAPETYPE:HP\-DAT:length=2000m
 amdump \-o DUMPTYPE:no\-compress:compress="server fast"
 amdump \-o HOLDINGDISK:hd1:use="\-100 mb"
 amdump \-o INTERFACE:local:use="2000 kbps"
 .fi
-.RE
 .PP
 Note that configuration overrides are not effective for tape changers, which supply a tapedev based on their own configuration\. In order to override
 \fItapedev\fR, you must also disable any changer:
 .sp
-.RS 4
 .nf
 amdump \-otapedev=/dev/nst1 \-otpchanger=\'\'
 .fi
-.RE
-.sp
 .SH "AUTHOR"
 .PP
 James da Silva,
@@ -1188,4 +1160,4 @@ Stefan G\. Weichinger,
 \fBamcheckdump\fR(8),
 \fBamserverconfig\fR(8),
 \fBamaddclient\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 3e5ea9641cf184bda9d75601a23fec334790d27a..31e7d4626d710595d3b37b57a0e6ce9ccc27f031 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda.conf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA\.CONF" "5" "05/14/2008" "" ""
+.TH "AMANDA\.CONF" "5" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -259,12 +259,8 @@ option set to
 These options can set various device properties, including block size, maximum volume usage, authentication information, hardware feature support, and more\.Specifics of how properties are used are device\-dependent, though some common properties are supported across multiple device drivers\.
 .sp
 Both strings are quoted; the first string contains the name of the property to set, and the second contains its value\. For example, to set a fixed block size of 128k, do:
-.sp
-.RS 4
 .nf
-device_property "BLOCK_SIZE" "131072"
-.fi
-.RE
+device_property "BLOCK_SIZE" "131072".fi
 .sp
 The order in which device properties are set is as follows:
 .sp
@@ -462,7 +458,6 @@ Default:
 Default:
 \fItttTTTTTTT\fR\. The priority order of each dumper:
 .sp
-.RS 4
 .nf
 s: smallest size
 S: largest size
@@ -472,7 +467,6 @@ b: smallest bandwidth
 B: largest bandwidth
 .fi
 .RE
-.RE
 .PP
 \fBmaxdumps\fR int
 .RS 4
@@ -661,8 +655,6 @@ is a comma (\',\') separated list of triples\. Each triple consists of three par
 .sp
 .RS 4
 \h'-04' 1.\h'+02'the name of the column, which may be:
-.sp
-.RS 4
 .nf
        Compress (compression ratio)
        Disk (client disk name)
@@ -674,9 +666,7 @@ is a comma (\',\') separated list of triples\. Each triple consists of three par
        OutKB (output image size in KBytes)
        TapeRate (tape writing rate in KBytes/sec)
        TapeTime (total tape time in hours:minutes)
-       
-.fi
-.RE
+       .fi
 .RE
 .sp
 .RS 4
@@ -690,11 +680,9 @@ is a comma (\',\') separated list of triples\. Each triple consists of three par
 .IP "" 4
 Here is an example:
 .sp
-.RS 4
 .nf
 columnspec "Disk=1:18,HostName=0:10,OutKB=1:7"
 .fi
-.RE
 .sp
 The above will display the disk information in 18 characters and put one space before it\. The hostname column will be 10 characters wide with no space to the left\. The output KBytes column is seven characters wide with one space before it\.
 .RE
@@ -865,15 +853,12 @@ Default: \-\-with\-tcpportrange or
 The
 \fBamanda\.conf\fR
 file may define one or more holding disks used as buffers to hold backup images before they are written to tape\. The syntax is:
-.sp
-.RS 4
 .nf
 holdingdisk \fIname\fR {
     \fIholdingdisk\-option\fR \fIholdingdisk\-value\fR
     \.\.\.
 }
 .fi
-.RE
 .PP
 \fIName\fR
 is a logical name for this holding disk\.
@@ -926,15 +911,12 @@ file\. For instance, one set of options might be defined for file systems that c
 A set of backup options are entered in a
 \fBdumptype\fR
 section, which looks like this:
-.sp
-.RS 4
 .nf
 define dumptype \fIname\fR {
     \fIdumptype\-option\fR \fIdumptype\-value\fR
     \.\.\.
 }
 .fi
-.RE
 .PP
 \fIName\fR
 is the name of this set of backup options\. It is referenced from the
@@ -1254,12 +1236,9 @@ is specified for
 .sp
 For
 \fBexclude list\fR, if the file name is relative, the disk name being backed up is prepended\. So if this is entered:
-.sp
-.RS 4
 .nf
     exclude list "\.amanda\.excludes"
 .fi
-.RE
 the actual file used would be
 \fI/var/\.amanda\.excludes\fR
 for a backup of
@@ -1508,8 +1487,6 @@ The following
 \fBdumptype\fR
 entries are predefined by
 \fIAmanda\fR:
-.sp
-.RS 4
 .nf
 define dumptype no\-compress {
     compress none
@@ -1539,7 +1516,6 @@ define dumptype no\-full {
     skip\-full yes
 } 
 .fi
-.RE
 .PP
 In addition to options in a
 \fBdumptype\fR
@@ -1551,8 +1527,6 @@ inherit options from other previously defined
 \fBdumptype\fRs\. For instance, two sections might be the same except for the
 \fBrecord\fR
 option:
-.sp
-.RS 4
 .nf
 define dumptype normal {
     comment "Normal backup, no compression, do indexing"
@@ -1566,7 +1540,6 @@ define dumptype testing {
     record no
 }
 .fi
-.RE
 .PP
 \fIAmanda\fR
 provides a
@@ -1585,15 +1558,12 @@ The
 file may define multiple types of tape media and devices\. The information is entered in a
 \fBtapetype\fR
 section, which looks like this in the config file:
-.sp
-.RS 4
 .nf
 define tapetype \fIname\fR {
     \fItapetype\-option\fR \fItapetype\-value\fR
     \.\.\.
 }
 .fi
-.RE
 .PP
 \fIName\fR
 is the name of this type of tape medium/device\. It is referenced from the
@@ -1685,8 +1655,6 @@ name may be entered, which makes this
 \fBtapetype\fR
 inherit options from another
 \fBtapetype\fR\. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape\. So they could be entered as:
-.sp
-.RS 4
 .nf
 define tapetype DLT4000\-III {
     comment "DLT4000 tape drives with Compact\-III tapes"
@@ -1700,8 +1668,6 @@ define tapetype DLT4000\-IV {
     length 25000 mbytes         # 20 Gig tapes with some compression
 }
 .fi
-.RE
-.sp
 .SH "INTERFACE SECTION"
 .PP
 The
@@ -1709,15 +1675,12 @@ The
 file may define multiple types of network interfaces\. The information is entered in an
 \fBinterface\fR
 section, which looks like this:
-.sp
-.RS 4
 .nf
 define interface \fIname\fR {
     \fIinterface\-option\fR \fIinterface\-value\fR
     \.\.\.
 }
 .fi
-.RE
 .PP
 \fIname\fR
 is the name of this type of network interface\. It is referenced from the
@@ -1766,6 +1729,4 @@ Stefan G\. Weichinger,
 \fBamanda-client.conf\fR(5),
 \fBamcrypt\fR(8),
 \fBaespipe\fR(1),
-\fI\%http://wiki.zmanda.com\fR
-.PP
-An updated version of this man page may be available at http://wiki\.zmanda\.com/index\.php/Amanda\.conf\.
+: http://wiki.zmanda.com
diff --git a/man/amanda.css b/man/amanda.css
new file mode 100644 (file)
index 0000000..d6ee054
--- /dev/null
@@ -0,0 +1,48 @@
+/* Taken from the Zmanda wiki, for at least a little bit of visual continuity */
+body {
+    font: small sans-serif;
+    background: #82B1C8 0 0 no-repeat;
+    color: black;
+}
+
+div.refentry {
+    background: white;
+    margin-left: 11em;
+    margin-top: 2em;
+    padding: .6em;
+    padding-top: 0;
+    border: thin gray ridge;
+}
+
+pre {
+    padding: 1em;
+    border: 1px dashed #2f6fab;
+    color: black;
+    background-color: #f9f9f9;
+    line-height: 1.1em;
+}
+
+/* browsers override this for some reason */
+table {
+    font-size: small;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    color: black;
+    background: none;
+    font-weight: normal;
+    margin: 0;
+    padding-top: .5em;
+    padding-bottom: .17em;
+    border-bottom: 1px solid #5C706D;
+}
+h1 { font-size: 188%; }
+h2 { font-size: 150%; }
+h3, h4, h5, h6 {
+    border-bottom: none;
+    font-weight: bold;
+}
+h3 { font-size: 132%; }
+h4 { font-size: 116%; }
+h5 { font-size: 100%; }
+h6 { font-size: 80%;  }
index e7fab67f97e6aafece523e098e043cd1122b03c8..e4d7f6fc45ec26bb990c10aa0622d43b85a99705 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcheck
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECK" "8" "05/14/2008" "" ""
+.TH "AMCHECK" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -116,8 +116,6 @@ The default is
 .SH "EXAMPLES"
 .PP
 In this example, both the tape server and client tests are run\. The results are displayed on standard output\.
-.sp
-.RS 4
 .nf
 % amcheck daily
 \fIAmanda\fR Tape Server Host Check
@@ -136,7 +134,6 @@ Client check: 136 hosts checked in 51\.945 seconds, 3 problems found\.
 
 (brought to you by \fIAmanda\fR 2\.5\.0) 
 .fi
-.RE
 .PP
 In this example, if the line
 \fBmailto csd\-amanda\fR
@@ -144,12 +141,9 @@ is in
 \fIamanda\.conf\fR, mail will be sent to
 \fBcsd\-amanda\fR
 if the server check returns an error\.
-.sp
-.RS 4
 .nf
 % amcheck \-s \-m daily 
 .fi
-.RE
 .SH "MESSAGES"
 .PP
 fatal slot \fIslot\fR: \fIerror message\fR
@@ -679,6 +673,13 @@ ERROR: \fIhost\fR: \fImessage\fR
 was reported by the status check on
 \fIhost\fR\.
 .RE
+.SH "EXIT CODE"
+
+The exit code of \fBamcheck\fR is one of:
+.nf
+ 0  = success
+ 1  = error
+.fi
 .SH "AUTHOR"
 .PP
 James da Silva,
@@ -692,4 +693,4 @@ Stefan G\. Weichinger,
 .PP
 \fBamanda\fR(8),
 \fBamdump\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 4d273e0e958cdcd8b8de824a80ce1ab22069cc97..754c3126d09427b98758b9e20f1a339bff3f2f1f 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcheckdb
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECKDB" "8" "05/14/2008" "" ""
+.TH "AMCHECKDB" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -31,27 +31,21 @@ man page for more details about
 .SH "EXAMPLE"
 .PP
 This shows a normal response:
-.sp
-.RS 4
 .nf
 # amcheckdb daily
 Ready\.
 .fi
-.RE
 .PP
 This shows tape
 \fIDMP014\fR
 is still listed in the database but is no longer listed in the
 \fItapelist\fR
 file:
-.sp
-.RS 4
 .nf
 # amcheckdb daily
 Tape DMP014 missing in /usr/local/etc/amanda//daily/tapelist
 Ready\.
 .fi
-.RE
 .SH "AUTHOR"
 .PP
 Adrian T\. Filipi\-Martin <atf3r@cs\.virginia\.edu>: Original text
@@ -64,4 +58,4 @@ Stefan G\. Weichinger,
 \fBamadmin\fR(8),
 \fBamrmtape\fR(8),
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index e9340ad02120bb8fa467956445325886ed3d043d..4371b8353d86a1ee434f36b1772715827b142f4e 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcheckdump
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECKDUMP" "8" "05/14/2008" "" ""
+.TH "AMCHECKDUMP" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -38,10 +38,9 @@ option\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
 .SH "EXAMPLE"
 .PP
-.RS 4
 .nf
 # check the most recent dump
 amcheckdump MYCONFIG
@@ -49,7 +48,6 @@ amcheckdump MYCONFIG
 # check a specific dump from back in \'78
 amcheckdump MYCONFIG \-\-timestamp 19780615
 .fi
-.RE
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
index 666d26a3e08442a944be03aa18d9cb2991b02b46..04dc0f8b6354197d620c9f848961fce4122e0deb 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcleanup
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCLEANUP" "8" "05/14/2008" "" ""
+.TH "AMCLEANUP" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -50,33 +50,24 @@ Generate verbose output\.
 This example runs the
 \fIAmanda\fR
 cleanup process by hand after a failure\.
-.sp
-.RS 4
 .nf
 % amcleanup daily
 .fi
-.RE
 .PP
 Putting the following line in a system boot script (e\.g\.
 \fI/etc/rc\.local\fR) runs the
 \fIAmanda\fR
 cleanup process as part of the reboot, eliminating the need to run it by hand\.
-.sp
-.RS 4
 .nf
 /usr/local/sbin/amcleanup daily
 .fi
-.RE
 .PP
 If nothing needs to be done,
 \fBamcleanup\fR
 exits normally with the message:
-.sp
-.RS 4
 .nf
 amcleanup: no unprocessed logfile to clean up\.
 .fi
-.RE
 .SH "AUTHOR"
 .PP
 James da Silva,
@@ -89,4 +80,4 @@ Stefan G\. Weichinger,
 .PP
 \fBamanda\fR(8),
 \fBamdump\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index d01a04c925369058a6844e88de31d7acb565eb32..6971d8d32df9625ff4068eb212fe4fc63afe59c4 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt-ossl-asym
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "05/14/2008" "" ""
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -22,7 +22,7 @@ amcrypt-ossl-asym - crypt program for Amanda asymmetric data encryption using Op
 uses
 \fBOpenSSL\fR
 to encrypt and decrypt data\. OpenSSL is available from
-\fIwww\.openssl\.org\fR\&[1]\. OpenSSL offers a wide variety of cipher choices (
+www\.openssl\.org\. OpenSSL offers a wide variety of cipher choices (
 \fBamcrypt\-ossl\-asym\fR
 defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\.
 .PP
@@ -32,8 +32,6 @@ will search for the OpenSSL program in the following directories: /bin:/usr/bin:
 .SH "GENERATING PUBLIC AND PRIVATE KEYS"
 .PP
 RSA keys can be generated with the standard OpenSSL commands, e\.g\.:
-.sp
-.RS 4
 .nf
 $ cd /var/lib/amanda
 $ openssl genrsa \-aes128 \-out backup\-privkey\.pem 1024
@@ -45,9 +43,7 @@ Verifying \- Enter pass phrase for backup\-key\.pem: \fIENTER YOUR PASS PHRASE\f
 $ openssl rsa \-in backup\-privkey\.pem \-pubout \-out backup\-pubkey\.pem
 Enter pass phrase for backup\-privkey\.pem: \fIENTER YOUR PASS PHRASE\fR
 Writing RSA key
-
 .fi
-.RE
 .PP
 To generate a private key without a passphrase, omit the
 \fB\-aes128\fR
@@ -69,7 +65,7 @@ is used to decrypt data, and must be protected\. Encrypted backup data cannot be
 While the public key must be online at all times to perorm backups, the private key and optional passphrase are only needed to restore data\. It is recommended that the latter be stored offline all other times\. For example, you could keep the private key on removable media, and copy it into place for a restore; or you could keep the private key online, encrypted with a passphrase that is present only for a restore\.
 .PP
 OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see
-\fIwww\.diceware\.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember\.
+www\.diceware\.com) can be used to create passphrases that are difficult to guess and easy to remember\.
 .SH "FILES"
 .PP
 /var/lib/amanda/backup\-privkey\.pem
@@ -97,7 +93,7 @@ user\.
 \fBamanda.conf\fR(5),
 \fBopenssl\fR(1),
 \fBamcrypt-ossl\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
 .SH "NOTES"
 .IP " 1." 4
 www.openssl.org
index cfa338f85b21665550617d500b47c3086a77ffa1..9e4903c96a8e92ba254526b73c3fe399a4b51f50 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt-ossl
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL" "8" "05/14/2008" "" ""
+.TH "AMCRYPT\-OSSL" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -22,7 +22,7 @@ amcrypt-ossl - crypt program for Amanda symmetric data encryption using OpenSSL
 uses
 \fBOpenSSL\fR
 to encrypt and decrypt data\. OpenSSL is available from
-\fIwww\.openssl\.org\fR\&[1]\. OpenSSL offers a wide variety of cipher choices (
+www\.openssl\.org\. OpenSSL offers a wide variety of cipher choices (
 \fBamcrypt\-ossl\fR
 defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\.
 .PP
@@ -38,7 +38,7 @@ uses the same pass phrase to encrypt and decrypt data\. It is very important to
 be recovered with the correct passphrase\.
 .PP
 OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see
-\fIwww\.diceware\.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember\.
+www\.diceware\.com) can be used to create passphrases that are difficult to guess and easy to remember\.
 .SH "FILES"
 .PP
 /var/lib/amanda/\.am_passphrase
@@ -54,7 +54,7 @@ user\.
 \fBamanda.conf\fR(5),
 \fBopenssl\fR(1),
 \fBamcrypt-ossl-asym\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
 .SH "NOTES"
 .IP " 1." 4
 www.openssl.org
index 36dae74b741f07a00e3522e13e9aeb015c20fd05..9b3276f3bfed1e0b751c358dd12b1aee6398f3fc 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT" "8" "05/14/2008" "" ""
+.TH "AMCRYPT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -25,7 +25,7 @@ requires
 and
 \fBgpg\fR
 to work\. Aespipe is available from
-\fI\%http://loop-aes.sourceforge.net\fR
+: http://loop-aes.sourceforge.net
 .PP
 
 \fBamcrypt\fR
@@ -47,14 +47,11 @@ head \-c 2925 /dev/random | uuencode \-m \- | head \-n 66 | tail \-n 65 \e | gpg
 This will ask for a passphrase\. Remember this passphrase as you will need it in the next step\.
 .PP
 2\. Store the passphrase inside the home\-directory of the AMANDA\-user and protect it with proper permissions:
-.sp
-.RS 4
 .nf
 echo my_secret_passphrase > ~amanda/\.am_passphrase
 chown amanda:disk ~amanda/\.am_passphrase
 chmod 700 ~amanda/\.am_passphrase
 .fi
-.RE
 .SH "KEY AND PASSPHRASE"
 .PP
 
@@ -71,4 +68,4 @@ be recovered with the correct key and passphrase\.
 \fBaespipe\fR(1),
 \fBamaespipe\fR(8),
 \fBgpg\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 2ca624e00c2d2e052acfb6c89d927584db999d6d..cecbd1f134db855d88e38c8d4ba62db042fd6d90 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcryptsimple
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPTSIMPLE" "8" "05/14/2008" "" ""
+.TH "AMCRYPTSIMPLE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -63,4 +63,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c
 \fBamgpgcrypt\fR(8),
 \fBamrestore\fR(8),
 \fBgpg\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 545a2cdf48dd992f065ffb01e16d706903e1ee5b..55382d412531660d8cb2f7f1c0cd4b9e607b8020 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amdd
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDD" "8" "05/14/2008" "" ""
+.TH "AMDD" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -118,4 +118,4 @@ Stefan G\. Weichinger,
 .PP
 
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index a0602e29cc867ac3090641016bef00c4f59f1a86..a9b403ecbcf2a043abfb9568464585b02f500848 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amdevcheck
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDEVCHECK" "8" "05/14/2008" "" ""
+.TH "AMDEVCHECK" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -66,4 +66,4 @@ and others\. Authorship of this tool and its documentation was funded by Zmanda,
 
 \fBamanda\fR(8),
 \fBammt\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 01fa1acd18f5ebeb4367a927eccfc7250a2e29a3..90b963c88b3c7e8d58952a6b25bb6d30af5be915 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amdump
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDUMP" "8" "05/14/2008" "" ""
+.TH "AMDUMP" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -57,12 +57,9 @@ Here is a typical crontab entry\. It runs
 \fBamdump\fR
 every weeknight at 1 a\.m\. as user
 \fBbin\fR:
-.sp
-.RS 4
 .nf
 0 1 * * 1\-5 bin /usr/local/sbin/amdump daily
 .fi
-.RE
 .PP
 Please see the
 \fBcrontab\fR(5)
@@ -93,6 +90,17 @@ run\. This run is terminated\. If the problem is caused by the remains of a prev
 and then rerun
 \fBamdump\fR\.
 .RE
+.SH "EXIT CODE"
+
+The exit code of \fBamdump\fR is the ORed value of:
+.nf
+ 0  = success
+ 1  = error
+ 2  = a dle give strange message
+ 4  = a dle failed
+ 8  = Don\'t know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+.fi
 .SH "AUTHOR"
 .PP
 James da Silva,
@@ -111,4 +119,4 @@ Stefan G\. Weichinger,
 \fBamrestore\fR(8),
 \fBamflush\fR(8),
 \fBcron\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index a2a3bc0e25372e42613e374e5f3dbb6378b1f4ee..903599012c943f48559fbd364ade4690a1e3acd5 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amfetchdump
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFETCHDUMP" "8" "05/14/2008" "" ""
+.TH "AMFETCHDUMP" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -164,4 +164,4 @@ Ian Turner,
 \fBamrestore\fR(8),
 \fBtar\fR(1),
 \fBrestore\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index e7d665d172222a292fb5bcae6dec4023fff4d6ca..7568e4035a874576e61b466a9bdf515db1f492ed 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amflush
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFLUSH" "8" "05/14/2008" "" ""
+.TH "AMFLUSH" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -106,8 +106,6 @@ configuration\. After you select which holding area to flush,
 \fBamflush\fR
 writes the data to tape, updates the databases and sends a mail report similar to
 \fBamdump\fR(8)\.
-.sp
-.RS 4
 .nf
 % amflush daily
 Scanning /amanda\-hold\.\.\.
@@ -127,7 +125,16 @@ Are you sure you want to do this? yes
 Running in background, you can log off now\.
 You\'ll get mail when amflush is finished\.
 .fi
-.RE
+.SH "EXIT CODE"
+
+The exit code of \fBamflush\fR is the ORed value of:
+.nf
+ 0  = success
+ 1  = error
+ 4  = a dle failed
+ 8  = Don\'t know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+.fi
 .SH "AUTHOR"
 .PP
 James da Silva,
@@ -142,4 +149,4 @@ Stefan G\. Weichinger,
 
 \fBamanda\fR(8),
 \fBamdump\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 0c57f4f1df8da74af7f15938fd1c2e52892d81ec..753a845d050a3dee106cbfbff424246d841e0cb9 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amgetconf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMGETCONF" "8" "05/14/2008" "" ""
+.TH "AMGETCONF" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -168,4 +168,4 @@ keyword)\.
 .PP
 
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index bb71017b829b3a940ad8c757878caac76960a93e..ad36e698176cf3a6f0f0ace1c6b4e690fae2364c 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amgpgcrypt
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMGPGCRYPT" "8" "05/14/2008" "" ""
+.TH "AMGPGCRYPT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -56,8 +56,6 @@ Store the passphrase that you used in following "gpg \-\-gen\-key" command insid
    chmod 700 ~$amanda_user/\.am_passphrase
 .PP
 Run "gpg \-\-gen\-key"\. Below is an example:
-.sp
-.RS 4
 .nf
 $ gpg \-\-gen\-key
 gpg (GnuPG) 1\.2\.6; Copyright (C) 2004 Free Software Foundation, Inc\.
@@ -116,9 +114,7 @@ key marked as ultimately trusted\.
 pub  1024D/4417A8CB 2006\-02\-07 amandabackup (gpg keys for amandabackup)
      Key fingerprint = 139C 6369 44FC 7F1A 655C  E5E9 7EAA 515A 4417 A8CB
 sub  1024g/8C3A6A78 2006\-02\-07 [expires: 2006\-08\-06]
-
 .fi
-.RE
 .SH "FILES"
 .PP
 \fB$AMANDA_HOME/\.gnupg/pubring\.gpg\fR
@@ -154,4 +150,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c
 \fBamcrypt\fR(8),
 \fBamrestore\fR(8),
 \fBgpg\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 5c738b9286e2c6c98f6a1490e248dd311034abe8..f57e013fa670690c94e3cd225ff1f52a97f3fe10 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amlabel
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMLABEL" "8" "05/14/2008" "" ""
+.TH "AMLABEL" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -81,20 +81,14 @@ Write an
 label with the string "DMP000" on the tape loaded in the device named in the
 \fBtapedev\fR
 option in /usr/local/etc/amanda/daily/amanda\.conf:
-.sp
-.RS 4
 .nf
 % amlabel daily DMP000 
 .fi
-.RE
 .PP
 Label the tape in slot 3 of the currently configured tape changer with the string "DMP003":
-.sp
-.RS 4
 .nf
 % amlabel daily DMP003 slot 3 
 .fi
-.RE
 .SH "MESSAGES"
 .PP
 label \fIlabel\fR doesn\'t match labelstr \fIstr\fR
@@ -171,4 +165,4 @@ Stefan G\. Weichinger,
 \fBamanda\fR(8),
 \fBamdump\fR(8),
 \fBamflush\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index a8acd7bd4757a109aeb8b259b22b54a1b76f6903..1283e230953db1938d531da36b65d406b3991140 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: ammt
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMMT" "8" "05/14/2008" "" ""
+.TH "AMMT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -180,4 +180,4 @@ Stefan G\. Weichinger,
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 18bd4b6914eabf34a79f438264cfc819c2f5f089..4ba2aaab8ee6a0b74baedd434f4d1dce0bbaac43 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amoverview
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMOVERVIEW" "8" "05/14/2008" "" ""
+.TH "AMOVERVIEW" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -103,8 +103,6 @@ This shows the
 file system on
 \fIhost2\fR
 was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th\.
-.sp
-.RS 4
 .nf
 # amoverview
                          date 12 12 12 12 12 12
@@ -117,9 +115,8 @@ host2    /home                 3  3  3  0  1  2
 host2    /opt                  1  1  1  1  1  1
 host2    /var                  1  1  0  1  1  1 
 .fi
-.RE
 .SH "SEE ALSO"
 .PP
 \fBamadmin\fR(8),
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 4b3c3796744775de767de9b14bc5395e8a4e5b99..6da1ecfc48f8046b0b9a2ddf63d0464a66c0d203 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amplot
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMPLOT" "8" "05/14/2008" "" ""
+.TH "AMPLOT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -159,4 +159,4 @@ Reports lines it does not recognize, mainly error cases but some are legitimate
 \fBsh\fR(1),
 \fBcompress\fR(1),
 \fBgzip\fR(1),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index ece641d62c1dc36cb8b97415819da1d28ce4acff..01608fb097c5fdc7b4411595b06b7d7099efb742 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrecover
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRECOVER" "8" "05/14/2008" "" ""
+.TH "AMRECOVER" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -169,15 +169,10 @@ If you want amrecover to use your changer, the
 must be equal to the amrecover_changer setting on the server\.
 .sp
 If you need to change the protocol (tape:, rait:, file:, null:) then you must specify the hostname\.
-.sp
-.RS 4
 .nf
 settape 192\.168\.0\.10:file:/file1
 .fi
-.RE
 You can change the tape device when amrecover ask you to load the tape:
-.sp
-.RS 4
 .nf
 Load tape DMP014 now
 Continue? [Y/n/t]: t
@@ -186,7 +181,6 @@ Continue? [Y/n/t]: Y
 Using tape /dev/nst2 from server server2\.
 .fi
 .RE
-.RE
 .PP
 \fBsetmode\fR \fImode\fR
 .RS 4
@@ -314,8 +308,6 @@ Display a brief list of these commands\.
 The following shows the recovery of an old
 \fIsyslog\fR
 file\.
-.sp
-.RS 4
 .nf
 # cd /var/log
 # ls \-l syslog\.7
@@ -368,13 +360,10 @@ amrecover> quit
 total 26
 \-rw\-r\-\-r\-\-   1 root     other      12678 Oct 14 16:36 syslog\.7
 .fi
-.RE
 .PP
 If you do not want to overwrite existing files, create a subdirectory to run
 \fBamrecover\fR
 from and then move the restored files afterward\.
-.sp
-.RS 4
 .nf
 # cd /var
 # (umask 077 ; mkdir \.restore)
@@ -400,7 +389,6 @@ amrecover> quit
 # cd \.\.
 # rm \-fr \.restore
 .fi
-.RE
 .PP
 If you need to run
 \fBamrestore\fR
@@ -409,8 +397,6 @@ by hand instead of letting
 control it, use the
 \fBlist\fR
 command after browsing to display the needed tapes\.
-.sp
-.RS 4
 .nf
 # cd /var/log
 # amrecover
@@ -430,15 +416,12 @@ TAPE DMP015 LEVEL 1 DATE 1997\-12\-09
         /log/syslog
 amrecover> quit 
 .fi
-.RE
 .PP
 The
 \fBhistory\fR
 command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape\. All active tapes are listed, not just back to the most recent full dump\.
 .PP
 Tape file position zero is a label\. The first backup image is in file position one\.
-.sp
-.RS 4
 .nf
 # cd /var/log
 # amrecover
@@ -459,7 +442,6 @@ amrecover> history
 \.\.\.
 amrecover> quit 
 .fi
-.RE
 .SH "ENVIRONMENT"
 .PP
 \fBPAGER\fR
@@ -492,4 +474,4 @@ Stefan G\. Weichinger,
 \fBamrestore\fR(8),
 \fBamfetchdump\fR(8),
 \fBreadline\fR(3),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index be28b5b46c0c3bf90679fd3c0186c7bcf66de108..d8feabbfe1f5632eaf88528c2ae96552154d3c59 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amreport
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMREPORT" "8" "05/14/2008" "" ""
+.TH "AMREPORT" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -118,8 +118,19 @@ provides label templates for the following tape types\. These are pretty generic
 .RE
 .PP
 The 3\-ring binder type is the most generic\. It may be used to make a hardcopy log of the tapes\.
+.SH "EXIT CODE"
+
+The exit code of \fBamreport\fR is the ORed value of:
+.nf
+ 0  = success
+ 1  = error
+ 2  = a dle give strange message
+ 4  = a dle failed
+ 8  = Don\'t know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+.fi
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamflush\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index df874ba2e3a717ac7e4cc7b432c62c85b6beb1af..d7617d963bdb5af91b26533e94c3f995f48fa2ef 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrestore
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRESTORE" "8" "05/14/2008" "" ""
+.TH "AMRESTORE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -262,4 +262,4 @@ Stefan G\. Weichinger,
 \fBamflush\fR(8),
 \fBtar\fR(1),
 \fBrestore\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 44b7b04c32c8110637a59e50af61352931832a5e..e3f1cf7054fb4c87ff178fd1c26e5c286a4a57c8 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrmtape
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRMTAPE" "8" "05/14/2008" "" ""
+.TH "AMRMTAPE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -59,12 +59,9 @@ Remove tape labeled
 from the
 \fIDailySet1\fR
 configuration\.
-.sp
-.RS 4
 .nf
 # amrmtape DailySet1 DAILY034
 .fi
-.RE
 .SH "AUTHOR"
 .PP
 Adrian T\. Filipi\-Martin
@@ -77,4 +74,4 @@ Stefan G\. Weichinger,
 .PP
 \fBamadmin\fR(8),
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index df32401011f130d85e9917801e9c85e9b9318bdc..093899de8468648c792327a8d6cf27a10b22f4ab 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amserverconfig
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMSERVERCONFIG" "8" "05/14/2008" "" ""
+.TH "AMSERVERCONFIG" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -178,4 +178,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBamaddclient\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 6a146ec31595bfe9271c91028c7a769bd8f99582..f17d645534b71645d8765facb65230248318aadf 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amstatus
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMSTATUS" "8" "05/14/2008" "" ""
+.TH "AMSTATUS" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -109,6 +109,16 @@ Display statistics about active\-time of taper and dumpers\.
 .RS 4
 Output the date in a locale independent format\. The format is the same executing: date +\'%Y\-%m\-%d %H:%M:%S %Z\'
 .RE
+.SH "EXIT CODE"
+
+The exit code of \fBamstatus\fR is the ORed value of:
+.nf
+ 0  = success
+ 1  = error
+ 4  = a dle failed
+ 8  = Don\'t know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+.fi
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
@@ -116,4 +126,4 @@ Output the date in a locale independent format\. The format is the same executin
 \fBamdump\fR(8),
 \fBamrestore\fR(8),
 \fBamadmin\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 6f3b5bea3287fa2507998323db88153340d671ca..fcf3296bb4cffb64affad105e183bb2c6c0210f6 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtape
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPE" "8" "05/14/2008" "" ""
+.TH "AMTAPE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -169,4 +169,4 @@ Stefan G\. Weichinger,
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index 0c76c44fa606afbd461757a215d47046cd719d14..a4f0b70fc171911ea0ef61a1d135f9ecc3e89e58 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtapetype
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPETYPE" "8" "05/14/2008" "" ""
+.TH "AMTAPETYPE" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -95,4 +95,4 @@ used to sometimes report a negative file mark size if the math happened to end u
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index e6bc640ef346d03f34a8d9764ee2fcffb648d4bc..045ff1d9c9299a89b17d88a729a8a9b04ce2218f 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtoc
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTOC" "8" "05/14/2008" "" ""
+.TH "AMTOC" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -75,8 +75,6 @@ Marks the last option so the next parameter is the
 .SH "OUTPUT FORMAT"
 .PP
 The standard output has five fields separated by two spaces:
-.sp
-.RS 4
 .nf
 #  Server:/partition  date  level  size[Kb]
 0  daily\-05:  19991005  \-  \-
@@ -85,14 +83,9 @@ The standard output has five fields separated by two spaces:
   \.\.\.
 103  cuisg11:/  19991005  0  4139136
 103  total:  \-  \-  16716288
-
-
 .fi
-.RE
 .PP
 In tabular format (\-t), this would look like:
-.sp
-.RS 4
 .nf
   #  Server:/partition           date      lev  size[Kb]
   0  daily\-05:                   19991005    \-         \-
@@ -101,9 +94,7 @@ In tabular format (\-t), this would look like:
   \.\.\.
 103  cuisg11:/                   19991005    0   4139136
 103  total:                      \-           \-  16716288
-
 .fi
-.RE
 .SH "USAGE"
 .PP
 The easiest way to use it is to run
@@ -112,12 +103,9 @@ right after
 \fIamdump\fR
 in the
 \fIcron job:\fR
-.sp
-.RS 4
 .nf
 amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls \-1t $logdir/log\.*\.[0\-9] | head \-1` ; amtoc \-a $log
 .fi
-.RE
 .PP
 which will generate /usr/local/etc/amanda//daily/\fItape_label\fR\.toc\. You may also want to call
 \fBamtoc\fR
@@ -129,7 +117,7 @@ after an
 \fBamdump\fR(8),
 \fBamflush\fR(8),
 \fBamgetconf\fR(8), cron, perl,
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
 .SH "AUTHOR"
 .PP
 Nicolas Mayencourt
index a4ac08d322296bcd6d6a116b43870a1f388ebfd2..d9ada11abf8160570139de64ffd718140df8e152 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amverify
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFY" "8" "05/14/2008" "" ""
+.TH "AMVERIFY" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -61,4 +61,4 @@ Stefan G\. Weichinger,
 \fBamrestore\fR(8),
 \fBamanda\fR(8),
 \fBamverifyrun\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
index b80c3f09360def1a6406f5288790efdcbac9ec38..839057425dac9354e428a301c6e5a53fb9d23cf2 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amverifyrun
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/14/2008
+.\"      Date: 08/22/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFYRUN" "8" "05/14/2008" "" ""
+.TH "AMVERIFYRUN" "8" "08/22/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -27,4 +27,4 @@ with these argument\.
 .PP
 \fBamanda\fR(8),
 \fBamverify\fR(8),
-\fI\%http://wiki.zmanda.com\fR
+: http://wiki.zmanda.com
diff --git a/man/index.php b/man/index.php
new file mode 100644 (file)
index 0000000..5322dd6
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+/* send the user straight to the amanda(8) manpage */
+header("Location: amanda.8.html");
+exit;
index 15747a311013c92c6bbef71a56c66a1feb785ff6..6b15ca7ddf6fe6b2469d288b816a6d4638b1a22f 100644 (file)
@@ -2132,9 +2132,6 @@ At the moment, this is of little use.</para>
 <ulink url="http://wiki.zmanda.com"/>
 </para>
 
-<para>
-An updated version of this man page may be available at http://wiki.zmanda.com/index.php/Amanda.conf.
-</para>
 </refsect1>
 </refentry>
 
index 5bc33fd74aa5a76ff3107f6194bc0502b22c5a60..0ee87d5ef46052a79af6950472d899490435c379 100644 (file)
@@ -862,6 +862,14 @@ was reported by the status check on
 </variablelist>
 </refsect1>
 
+<refsect1><title>EXIT CODE</title>
+The exit code of <command>amcheck</command> is one of:
+<programlisting>
+ 0  = success
+ 1  = error
+</programlisting>
+</refsect1>
+
 <refsect1><title>AUTHOR</title>
 <para>James da Silva, &email.jds; : Original text</para>
 <para>&maintainer.sgw;: XML-conversion</para>
index f1239d0d57d75d9506281075290cc639d05a162d..c559cfd8d7a15bb0b20fbc6ea741f5354941b1b5 100644 (file)
@@ -123,6 +123,18 @@ and then rerun
 </variablelist>
 </refsect1>
 
+<refsect1><title>EXIT CODE</title>
+The exit code of <command>amdump</command> is the ORed value of:
+<programlisting>
+ 0  = success
+ 1  = error
+ 2  = a dle give strange message
+ 4  = a dle failed
+ 8  = Don't know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+</programlisting>
+</refsect1>
+
 <refsect1><title>AUTHOR</title>
 <para>James da Silva, &email.jds; : Original text</para>
 <para>&maintainer.sgw;: XML-conversion</para>
index 086f942b4fd9389d871b0bb086336e475311551a..24fde4e0af651f09c0678f2de94a6c7c5dda75d3 100644 (file)
@@ -171,6 +171,17 @@ You'll get mail when amflush is finished.
 </programlisting>
 </refsect1>
 
+<refsect1><title>EXIT CODE</title>
+The exit code of <command>amflush</command> is the ORed value of:
+<programlisting>
+ 0  = success
+ 1  = error
+ 4  = a dle failed
+ 8  = Don't know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+</programlisting>
+</refsect1>
+
 <refsect1><title>AUTHOR</title>
 <para>James da Silva, &email.jds; : Original text</para>
 <para>&maintainer.sgw;: XML-conversion</para>
index e8c6ea879c926d46208c80f4a1fd866b855b6c81..38e7fbea06b74fee5b7de333031f365a96c4db22 100644 (file)
@@ -179,6 +179,18 @@ other tape types or particular site needs.</para>
 It may be used to make a hardcopy log of the tapes.</para>
 </refsect1>
 
+<refsect1><title>EXIT CODE</title>
+The exit code of <command>amreport</command> is the ORed value of:
+<programlisting>
+ 0  = success
+ 1  = error
+ 2  = a dle give strange message
+ 4  = a dle failed
+ 8  = Don't know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+</programlisting>
+</refsect1>
+
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
index 6058f4b486d83bd57e7ba3436aafcb456c5f80ce..10730239f3c6635dba6b37a56c47ee71b3f01341 100644 (file)
@@ -152,6 +152,17 @@ Works only during the estimate phase.</para>
 </variablelist>
 </refsect1>
 
+<refsect1><title>EXIT CODE</title>
+The exit code of <command>amstatus</command> is the ORed value of:
+<programlisting>
+ 0  = success
+ 1  = error
+ 4  = a dle failed
+ 8  = Don't know the status of a dle (RESULT_MISSING in the report)
+ 16 = tape error or no more tape
+</programlisting>
+</refsect1>
+
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amcheck</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
index 8857a967ce5aa6e66a24bbdc3cca9eb72733da1e..b4eb1eb1be7bec0871cd25a8de019522b3897809 100644 (file)
@@ -108,8 +108,7 @@ option is equivalent to
 <refsect1><title>OUTPUT FORMAT</title>
 <para>The standard output has five fields separated by two spaces:</para>
 
-<!-- .RS -->
-<literallayout remap='.nf'>
+<programlisting>
 #  Server:/partition  date  level  size[Kb]
 0  daily-05:  19991005  -  -
 1  cuisun15:/cuisun15/home  19991005  1  96
@@ -117,12 +116,10 @@ option is equivalent to
   ...
 103  cuisg11:/  19991005  0  4139136
 103  total:  -  -  16716288
-<!-- .RE -->
-
-</literallayout><para>In tabular format (-t), this would look like:</para>
+</programlisting>
+<para>In tabular format (-t), this would look like:</para>
 
-<!-- .RS -->
-<literallayout remap='.nf'>
+<programlisting>
   #  Server:/partition           date      lev  size[Kb]
   0  daily-05:                   19991005    -         -
   1  cuisun15:/cuisun15/home     19991005    1        96
@@ -130,8 +127,7 @@ option is equivalent to
   ...
 103  cuisg11:/                   19991005    0   4139136
 103  total:                      -           -  16716288
-<!-- .RE -->
-</literallayout></refsect1>
+</programlisting></refsect1>
 
 <refsect1><title>USAGE</title>
 <para>The easiest way to use it is to run
@@ -142,9 +138,9 @@ in the
 <emphasis remap='I'>cron job:</emphasis></para>
 
 <!-- .RS -->
-<literallayout remap='.nf'>
+<programlisting>
 amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log
-</literallayout> <!-- .fi -->
+</programlisting>
 
 <para>which will generate /usr/local/etc/amanda//daily/<emphasis remap='I'>tape_label</emphasis>.toc.
 You may also want to call
diff --git a/man/xslt/html.xsl.in b/man/xslt/html.xsl.in
new file mode 100644 (file)
index 0000000..03ae385
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version='1.0'?>
+<!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version='1.0'>
+
+
+<!-- the @..@ is substituted by config.status to contain the XSL release selected
+     at configure time -->
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/@XSLREL@/html/docbook.xsl"/>
+
+<xsl:import href="settings.xsl"/>
+
+<xsl:param name="citerefentry.link" select="'1'"/>
+<xsl:param name="css.decoration" select="1"/>
+<xsl:param name="html.stylesheet" select="'amanda.css'"/>
+<xsl:param name="html.stylesheet.type">text/css</xsl:param>
+<xsl:param name="html.cleanup" select="1"/>
+<xsl:param name="use.extensions" select="'0'"/>
+<xsl:param name="use.id.as.filename" select="'0'"/>
+<xsl:param name="use.local.olink.style" select="1"/>
+<xsl:param name="use.role.as.xrefstyle" select="1"/>
+
+<!-- generate correct links to other manpages -->
+<xsl:template name="generate.citerefentry.link">
+  <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text>
+</xsl:template>
+
+<xsl:template match="author">
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/man/xslt/man.xsl b/man/xslt/man.xsl
deleted file mode 100644 (file)
index 3dac788..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version='1.0'?>
-<!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version='1.0'>
-
-
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
-
-<xsl:import href="settings.xsl"/>
-
-<xsl:param name="chunk.section.depth" select="0"/>
-<xsl:param name="chunk.first.sections" select="1"/>
-<xsl:param name="use.id.as.filename" select="1"/>
-
-<!-- 
-    Our ulink stylesheet omits @url part if content was specified
--->
-<xsl:template match="ulink">
-  <xsl:variable name="content">
-    <xsl:apply-templates/>
-  </xsl:variable>
-  <xsl:if test="$content = ''">
-    <xsl:text>: </xsl:text>
-  </xsl:if>
-  <xsl:if test="$content != ''">
-    <xsl:value-of select="$content" />
-  </xsl:if>
-  <xsl:if test="$content = ''">
-    <xsl:apply-templates mode="italic" select="@url" />
-  </xsl:if>
-</xsl:template>
-
-<xsl:template match="informalexample|screen|programlisting">
-  <xsl:text>.nf&#10;</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>.fi&#10;</xsl:text>
-</xsl:template>
-
-<xsl:template match="para|simpara|remark" mode="list">
-  <xsl:variable name="foo">
-    <xsl:apply-templates/>
-  </xsl:variable>
-  <xsl:choose match="node()">
-    <!-- Don't normalize-space() for verbatim paragraphs        -->
-    <xsl:when test="informalexample|screen|programlisting">
-      <xsl:value-of select="$foo"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="normalize-space($foo)"/>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:otherwise>
-  </xsl:choose>
-  <xsl:text>&#10;</xsl:text>
-  <xsl:if test="following-sibling::para or following-sibling::simpara or
-               following-sibling::remark">
-    <!-- Make sure multiple paragraphs within a list item don't -->
-    <!-- merge together.                                        -->
-    <xsl:text>&#10;</xsl:text>
-  </xsl:if>
-</xsl:template>
-
-<xsl:template match="refsect3">
-  <xsl:text>&#10;.SS "</xsl:text>
-  <xsl:value-of select="title[1]"/>
-  <xsl:text>"&#10;</xsl:text>
-  <xsl:apply-templates/>
-</xsl:template>
-
-
-</xsl:stylesheet>
diff --git a/man/xslt/man.xsl.in b/man/xslt/man.xsl.in
new file mode 100644 (file)
index 0000000..2453bc0
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version='1.0'?>
+<!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version='1.0'>
+
+
+<!-- the @..@ is substituted by config.status to contain the XSL release selected
+     at configure time -->
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/@XSLREL@/manpages/docbook.xsl"/>
+
+<xsl:import href="settings.xsl"/>
+
+<xsl:param name="chunk.section.depth" select="0"/>
+<xsl:param name="chunk.first.sections" select="1"/>
+<xsl:param name="use.id.as.filename" select="0"/>
+
+<!--
+    Our ulink stylesheet omits @url part if content was specified
+-->
+<xsl:template match="ulink">
+  <xsl:variable name="content">
+    <xsl:apply-templates/>
+  </xsl:variable>
+  <xsl:if test="$content = ''">
+    <xsl:text>: </xsl:text>
+  </xsl:if>
+  <xsl:if test="$content != ''">
+    <xsl:value-of select="$content" />
+  </xsl:if>
+  <xsl:if test="$content = ''">
+    <xsl:apply-templates mode="italic" select="@url" />
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="informalexample|screen|programlisting">
+  <xsl:text>.nf&#10;</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>.fi&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="para|simpara|remark" mode="list">
+  <xsl:variable name="foo">
+    <xsl:apply-templates/>
+  </xsl:variable>
+  <xsl:choose match="node()">
+    <!-- Don't normalize-space() for verbatim paragraphs        -->
+    <xsl:when test="informalexample|screen|programlisting">
+      <xsl:value-of select="$foo"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="normalize-space($foo)"/>
+      <xsl:text>&#10;</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:if test="following-sibling::para or following-sibling::simpara or
+               following-sibling::remark">
+    <!-- Make sure multiple paragraphs within a list item don't -->
+    <!-- merge together.                                        -->
+    <xsl:text>&#10;</xsl:text>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="refsect3">
+  <xsl:text>&#10;.SS "</xsl:text>
+  <xsl:value-of select="title[1]"/>
+  <xsl:text>"&#10;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+
+</xsl:stylesheet>
index 98ba6ad41a7e3b1971a212e7235d520ea1015f0c..3caa50fdaee614cda85a7271c1b50c65df6f8b5b 100644 (file)
@@ -125,6 +125,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 7a4d4e9489fdfede135478130ec6cb25b447ee9a..1952026447374300f8b4bdbf26a56ca37cb693c9 100644 (file)
@@ -75,6 +75,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 74ecbb839ef19e1a2a2d308b2fb116b471b522c3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100755 (executable)
@@ -1,3 +0,0 @@
-#!/bin/sh
-# Automatically added by dh_makeshlibs
-# End automatically added section
index 74ecbb839ef19e1a2a2d308b2fb116b471b522c3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100755 (executable)
@@ -1,3 +0,0 @@
-#!/bin/sh
-# Automatically added by dh_makeshlibs
-# End automatically added section
index 6e41192e33b339f6083db18d88c201c746c8cb7a..4cee2d6fa759b46ec5ba474f80262db7e365e565 100755 (executable)
@@ -49,7 +49,7 @@ fi
 
 if [ -z $AMVER ]
 then
-    AMVER=amanda-2.6.0p1
+    AMVER=amanda-2.6.0p2
 fi
 
 if [ -z $AMTARBALL ]
index 76afb65a096bb00e7be902fd14b15ac4843d0600..c74248d315fb4dbb90c77713f13f8f040c962eed 100644 (file)
@@ -2,12 +2,13 @@ Source: amanda
 Section: utils
 Priority: optional
 Maintainer: Zmanda Inc <support@zmanda.com>
-Build-Depends: dump, gnuplot, libncurses5-dev, libreadline5-dev | libreadline-dev, libtool, flex, perl (>=5.6.0), smbclient, mailx, mtx
+Build-Depends: debhelper, dump, fakeroot, flex, gnuplot, libtool, mailx, mtx, perl (>=5.6.0), smbclient,
+       libcurl-dev, libncurses5-dev, libreadline5-dev | libreadline-dev, libssl-dev
 Standards-Version: 3.6.1
 
 Package: amanda-backup-server
 Architecture: any
-Depends: xinetd, perl (>=5.6.0), mailx, gnuplot, tar (>=1.15), curl (>=7.10.0), libglib2.0-0 (>=2.2.0)
+Depends: xinetd, perl (>=5.6.0), mailx, gnuplot, tar (>=1.15), libcurl3 (>=7.10.0), libglib2.0-0 (>=2.2.0), libssl | libssl0.9.8
 Suggests: amanda-backup-client (= ${Source-Version})
 Description: Amanda Network Backup and Archiving software
  .
@@ -23,7 +24,7 @@ Description: Amanda Network Backup and Archiving software
 
 Package: amanda-backup-client
 Architecture: any
-Depends: xinetd, perl (>=5.6.0), libglib2.0-0 (>=2.2.0)
+Depends: xinetd, perl (>=5.6.0), grep, libcurl3 (>=7.10.0), libglib2.0-0 (>=2.2.0), libssl | libssl0.9.8
 Conflicts: amanda-backup-server (>=${Source-Version})
 Description: Amanda Network Backup and Archiving software
  .
index d9fde0187a13285e8d30e8041e112a554432175e..e972af605979bf173c2d96318d8eab99b37a478e 100755 (executable)
@@ -21,7 +21,7 @@ case "$1" in
                           awk -F: '{ print $4 }' |
                           awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' |
                           grep '^amandabackup$' > /dev/null; then
-                               deluser "amandabackup$group" || true
+                               deluser "amandabackup $group" || true
                        fi
                done
        fi
index 511e3f71d393b49b9ef62d9a7e5e1beb1d764765..bae37a02d27424c654a7cd569048c6ee81d47849 100755 (executable)
@@ -8,7 +8,7 @@
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
-AMVER=2.6.0p1
+AMVER=2.6.0p2
 
 # These are variables that the user can override.  They get used in various
 # places during configure, build, and install.
@@ -81,6 +81,13 @@ build-stamp: /sbin/dump /usr/bin/smbclient
                --enable-s3-device \
                --disable-installperms
        touch missing
+       # There's probably a better way to do this.  Preinst and postrm are the
+       # same for client and server, but we leave room for differences by just
+       # appending here.
+       cat $(shell pwd)/debian/preinst >> $(shell pwd)/debian/amanda-backup-client.preinst
+       cat $(shell pwd)/debian/preinst >> $(shell pwd)/debian/amanda-backup-server.preinst
+       cat $(shell pwd)/debian/postrm >> $(shell pwd)/debian/amanda-backup-client.postrm
+       cat $(shell pwd)/debian/postrm >> $(shell pwd)/debian/amanda-backup-server.postrm
        make 
        touch build-stamp
 
index b71eb0cf5be2f7e176969b32086f95d9a9c9d2dd..64deb845989da8419ea1954fa900e3b598660d25 100644 (file)
 # Try to detect the distribution we are building:
 %if %{_vendor} == redhat 
     # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
-    # fc3-7.  So RHEL and Fedora look at the same file.  The awk trickery here
-    # forces the field to be numeric so that the spec comparison works
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3
+    # fc3-8.  So RHEL and Fedora look at the same file.  Different versions have
+    # different numbers of spaces; hence the use if $3 vs. $4..
+    %if %(awk '$1 == "Fedora" && $4 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 3
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4
+    %if %(awk '$1 == "Fedora" && $4 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 4
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5
+    %if %(awk '$1 == "Fedora" && $4 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 5
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6
+    %if %(awk '$1 == "Fedora" && $4 ~ /6.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 6
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7
+    %if %(awk '$1 == "Fedora" && $3 ~ /7.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 7
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8
+    %if %(awk '$1 == "Fedora" && $3 ~ /8.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist fedora
         %define disttag fc
         %define distver 8
                 %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
         %endif
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3
+    %if %(awk '$1 == "Red" && $7 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist redhat
         %define disttag rhel
         %define distver 3
+        %define tarver 1.14
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4
+    %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist redhat
         %define disttag rhel
         %define distver 4
+        %define tarver 1.14
     %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5
+    %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist redhat
         %define disttag rhel
         %define distver 5
     %define xinetd_reload restart
 %endif
 
+# Set minimum tar version if it wasn't set in the per-distro section
+%{!?tarver: %define tarver 1.15}
+
 %define packer %(%{__id_u} -n)
 
 # --- Definitions ---
 
 # Define amanda_version if it is not already defined.
-%{!?amanda_version: %define amanda_version 2.6.0p1}
+%{!?amanda_version: %define amanda_version 2.6.0p2}
 %{!?amanda_release: %define amanda_release 1}
 %define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
 %define amanda_user amandabackup
@@ -171,7 +176,7 @@ Requires: libnsl.so.1
 Requires: curl >= 7.10.0
 Requires: xinetd
 Requires: perl >= 5.6.0
-Requires: tar >= 1.15
+Requires: tar >= %{tarver}
 %if  %{dist} == redhat || %{dist}== fedora
 Requires: libtermcap.so.2
 Requires: initscripts
@@ -649,7 +654,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
         fi
 fi
 if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
         chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
         ret_val=$?
         if [ ${ret_val} -eq 0 ]; then
@@ -1052,7 +1057,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
         fi
 fi
 if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
         chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
         ret_val=$?
         if [ ${ret_val} -eq 0 ]; then
@@ -1419,7 +1424,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
         fi
 fi
 if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
         chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
         ret_val=$?
         if [ ${ret_val} -eq 0 ]; then
@@ -1500,7 +1505,8 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an
 /sbin/ldconfig
 
 # --- Files to install ---
-
+# Notes:  Do not use wildcards on directories not wholly owned by amanda.  An
+# uninstall of the software will attempt to delete whatever matches here.
 %files backup_client
 %defattr(0755,%{amanda_user},%{amanda_group})
 %{SYSCONFDIR}/amanda
diff --git a/packaging/rpm/amanda.spec.orig b/packaging/rpm/amanda.spec.orig
deleted file mode 100644 (file)
index b71eb0c..0000000
+++ /dev/null
@@ -1,1788 +0,0 @@
-#
-#                  Copyright (C) 2005 Zmanda Incorporated.
-#                            All Rights Reserved.
-#
-#  This program is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License version 2 as published
-#  by the Free Software Foundation.
-# 
-#  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
-# 
-#  Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
-#  Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
-#
-
-
-%define build_srpm 0
-%{?srpm_only: %define build_srpm 1}
-
-# Pkg-config sometimes needs its own path set, and we need to allow users to
-# override our guess during detection.  This macro takes care of that.
-# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is 
-# set then use the env var.
-%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}}
-
-%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}}
-
-# Define which Distribution we are building:
-# Try to detect the distribution we are building:
-%if %{_vendor} == redhat 
-    # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
-    # fc3-7.  So RHEL and Fedora look at the same file.  The awk trickery here
-    # forces the field to be numeric so that the spec comparison works
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3
-        %define dist fedora
-        %define disttag fc
-        %define distver 3
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4
-        %define dist fedora
-        %define disttag fc
-        %define distver 4
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5
-        %define dist fedora
-        %define disttag fc
-        %define distver 5
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6
-        %define dist fedora
-        %define disttag fc
-        %define distver 6
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7
-        %define dist fedora
-        %define disttag fc
-        %define distver 7
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8
-        %define dist fedora
-        %define disttag fc
-        %define distver 8
-        # TODO: generalize this so that any platform can cross compile
-        %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686
-                # Do nothing if PKG_CONFIG_PATH was set by the user above.
-                %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
-        %endif
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3
-        %define dist redhat
-        %define disttag rhel
-        %define distver 3
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4
-        %define dist redhat
-        %define disttag rhel
-        %define distver 4
-    %endif
-    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5
-        %define dist redhat
-        %define disttag rhel
-        %define distver 5
-    %endif
-%endif
-# Detect Suse variants.  Suse gives us some nice macros in their rpms
-%if %{_vendor} == "suse"
-    %if %{suse_version} == 910
-        %define dist SuSE
-        %define disttag sles
-        %define distver 9
-    %endif
-    %if %{suse_version} == 1010
-        %define dist SuSE
-        %define disttag sles
-        %define distver 10
-    %endif
-    %if %{suse_version} == 1000
-        %define dist SuSE
-        %define disttag suse
-        %define distver 10
-    %endif
-%endif
-
-# Set options per distribution
-%if %{dist} == redhat || %{dist} == fedora
-    %define rpm_group Applications/Archiving
-    %define xinetd_reload restart
-%endif
-%if %{dist} == SuSE
-    %define rpm_group Productivity/Archiving/Backup
-    %define xinetd_reload restart
-%endif
-
-%define packer %(%{__id_u} -n)
-
-# --- Definitions ---
-
-# Define amanda_version if it is not already defined.
-%{!?amanda_version: %define amanda_version 2.6.0p1}
-%{!?amanda_release: %define amanda_release 1}
-%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
-%define amanda_user amandabackup
-%define amanda_group disk
-%define udpportrange "700,740"
-%define tcpportrange "11000,11040"
-%define low_tcpportrange "700,710"
-
-Summary: The Amanda Backup and Archiving System
-Name: amanda
-Version: %{amanda_version}
-%define rpm_release %{amanda_release}.%{disttag}%{distver}
-%if %{build_srpm}
-%define rpm_release %{amanda_release}
-%endif
-Release: %{rpm_release}
-Source: %{name}-%{version}.tar.gz
-License: http://wiki.zmanda.com/index.php/Amanda_Copyright
-Vendor: Zmanda, Inc.
-Packager: www.zmanda.com
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot
-Group: %{rpm_group}
-# TODO - Need required versions for these:
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: binutils
-BuildRequires: bison
-BuildRequires: flex
-BuildRequires: gcc
-BuildRequires: glibc >= 2.2.0
-BuildRequires: readline
-BuildRequires: curl >= 7.10.0
-Requires: /bin/awk
-Requires: /bin/date
-Requires: /usr/bin/id
-Requires: /sbin/ldconfig
-Requires: /bin/sh
-Requires: /usr/sbin/useradd
-Requires: /usr/sbin/usermod
-Requires: fileutils
-Requires: grep
-Requires: gnuplot
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-Requires: curl >= 7.10.0
-Requires: xinetd
-Requires: perl >= 5.6.0
-Requires: tar >= 1.15
-%if  %{dist} == redhat || %{dist}== fedora
-Requires: libtermcap.so.2
-Requires: initscripts
-%endif
-Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version}
-
-%package backup_client
-Summary: The Amanda Backup and Archiving Client
-Group: %{rpm_group}
-Requires: /bin/awk
-Requires: fileutils
-Requires: grep
-%if  %{dist} == redhat || %{dist}== fedora
-Requires: libtermcap.so.2
-Requires: initscripts
-%endif
-Requires: xinetd
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-Requires: perl >= 5.6.0
-Requires: tar >= 1.15
-Provides: amanda-backup_client = %{amanda_version}
-Provides: libamclient-%{version}.so = %{amanda_version}
-Provides: libamanda-%{version}.so = %{amanda_version}
-Conflicts: amanda-backup_server 
-
-%package backup_server
-Summary: The Amanda Backup and Archiving Server
-Group: %{rpm_group}
-Requires: /bin/awk
-Requires: fileutils
-Requires: grep
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-%if  %{dist} == redhat || %{dist}== fedora
-Requires: libtermcap.so.2
-Requires: initscripts
-%endif
-Requires: xinetd
-Requires: perl >= 5.6.0
-Requires: tar >= 1.15
-Provides: amanda-backup_server = %{amanda_version}
-Provides: libamclient-%{version}.so = %{amanda_version}
-Provides: libamanda-%{version}.so = %{amanda_version}
-Provides: libamserver-%{version}.so = %{amanda_version}
-Provides: librestore-%{version}.so = %{amanda_version}
-Provides: libamtape-%{version}.so = %{amanda_version}
-Provides: libamdevice-%{version}.so = %{amanda_version}
-
-# --- Package descriptions ---
-
-%description
-Amanda is the leading Open-Source Backup and Archiving software.
-
-The amanda-backup_server package should be installed on the Amanda server, i.e. 
-the machine attached to backup media (such as a tape drive or disk 
-drives) where backups will be written. The amanda-backup_server package
-includes Amanda client.  The amanda-backup_client package needs 
-to be installed on every system that is being backed up.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-
-
-%description backup_server
-Amanda is the leading Open-Source Backup and Archiving software.
-
-This package contains the Amanda server.  The amanda-backup_server package 
-should be installed on the Amanda server, i.e. the machine attached 
-to backup media (such as a tape drive or disk drives) where backups 
-will be written.  The amanda-backup_server package includes Amanda client.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-
-
-%description backup_client
-Amanda is the leading Open-Source Backup and Archiving software.
-
-This package contains the Amanda client.  The amanda-backup_client package  
-needs to be installed on every system that is being backed up.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-# --- Directory setup ---
-
-# Configure directories:
-%define PREFIX          /usr
-%define EPREFIX         %{PREFIX}
-%define BINDIR          %{EPREFIX}/bin
-%define SBINDIR         %{EPREFIX}/sbin
-%define LIBEXECDIR      %{EPREFIX}/libexec
-%define AMLIBEXECDIR    %{LIBEXECDIR}/amanda
-%define DATADIR         %{PREFIX}/share
-%define SYSCONFDIR      /etc
-%define LOCALSTATEDIR   /var
-%define AMANDAHOMEDIR   %{LOCALSTATEDIR}/lib/amanda
-%ifarch x86_64
-%define LIBDIR          %{EPREFIX}/lib64
-%else
-%define LIBDIR          %{EPREFIX}/lib
-%endif
-%define AMLIBDIR        %{LIBDIR}/amanda
-%define INCLUDEDIR      %{PREFIX}/include
-%define MANDIR          %{DATADIR}/man
-%define LOGDIR          /var/log/amanda
-%define PERLSITELIB     %(eval "`perl -V:installsitelib`"; echo $installsitelib)
-
-# Installation directories:
-%define ROOT_SBINDIR            %{buildroot}/%{SBINDIR}
-%define ROOT_LIBEXECDIR         %{buildroot}/%{LIBEXECDIR}
-%define ROOT_DATADIR            %{buildroot}/%{DATADIR}
-%define ROOT_LOCALSTATEDIR      %{buildroot}/%{LOCALSTATEDIR}
-%define ROOT_SYSCONFDIR         %{buildroot}/%{SYSCONFDIR}
-%define ROOT_AMANDAHOMEDIR      %{buildroot}/%{AMANDAHOMEDIR}
-%define ROOT_LIBDIR             %{buildroot}/%{LIBDIR}
-%define ROOT_MANDIR             %{buildroot}/%{MANDIR}
-%define ROOT_LOGDIR             %{buildroot}/%{LOGDIR}
-
-# --- Unpack ---
-
-%prep
-%setup -q
-# --- Configure and compile ---
-
-%build
-%define config_user %{amanda_user}
-%define config_group %{amanda_group}
-
-%if  %{disttag} == rhel && %{distver} == 3
-./configure \
-        CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
-        --quiet \
-        --prefix=%{PREFIX} \
-        --sysconfdir=%{SYSCONFDIR} \
-        --sharedstatedir=%{LOCALSTATEDIR} \
-        --localstatedir=%{LOCALSTATEDIR} \
-        --libdir=%{LIBDIR} \
-        --includedir=%{INCLUDEDIR} \
-        --with-gnuplot=/usr/bin/gnuplot \
-        --with-gnutar=/bin/tar \
-        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
-        --with-index-server=localhost \
-        --with-tape-server=localhost \
-        --with-user=%{config_user} \
-        --with-group=%{config_group} \
-        --with-owner=%{packer} \
-        --with-fqdn \
-        --with-bsd-security \
-        --with-bsdtcp-security \
-        --with-bsdudp-security \
-        --with-ssh-security \
-        --with-udpportrange=%{udpportrange} \
-        --with-tcpportrange=%{tcpportrange} \
-        --with-low-tcpportrange=%{low_tcpportrange} \
-        --with-debugging=%{LOGDIR} \
-        --with-assertions \
-        --disable-installperms \
-        --without-ipv6 
-%else
-# This confusing macro results in PKG_CONFIG_PATH=some/path if some/path
-# was set on the command line, or by the platform detection bits.
-./configure \
-        %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
-        CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
-        --quiet \
-        --prefix=%{PREFIX} \
-        --sysconfdir=%{SYSCONFDIR} \
-        --sharedstatedir=%{LOCALSTATEDIR} \
-        --localstatedir=%{LOCALSTATEDIR} \
-        --libdir=%{LIBDIR} \
-        --includedir=%{INCLUDEDIR} \
-        --with-star=/usr/bin/star \
-        --with-gnuplot=/usr/bin/gnuplot \
-        --with-gnutar=/bin/tar \
-        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
-        --with-index-server=localhost \
-        --with-tape-server=localhost \
-        --with-user=%{config_user} \
-        --with-group=%{config_group} \
-        --with-owner=%{packer} \
-        --with-fqdn \
-        --with-bsd-security \
-        --with-bsdtcp-security \
-        --with-bsdudp-security \
-        --with-ssh-security \
-        --with-udpportrange=%{udpportrange} \
-        --with-tcpportrange=%{tcpportrange} \
-        --with-low-tcpportrange=%{low_tcpportrange} \
-        --with-debugging=%{LOGDIR} \
-        --with-assertions \
-        --disable-installperms
-%endif
-
-make
-
-# --- Install to buildroot ---
-
-%install
-if [ "%{buildroot}" != "/" ]; then
-        if [ -d "%{buildroot}" ] ; then
-                rm -rf %{buildroot}
-        fi
-else
-        echo "BuildRoot was somehow set to / !"
-        exit -1
-fi
-
-make -j1 DESTDIR=%{buildroot} install
-
-rm -rf %{ROOT_DATADIR}/amanda
-rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient
-mkdir %{buildroot}/{etc,var/log}
-mkdir %{ROOT_LOCALSTATEDIR}/amanda 
-mkdir %{ROOT_SYSCONFDIR}/amanda
-mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists
-mkdir %{ROOT_LOGDIR}
-
-echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release
-
-# --- Clean up buildroot ---
-
-%clean
-if [ "%{buildroot}" != "/" ]; then
-        if [ -d "%{buildroot}" ] ; then
-                rm -rf %{buildroot}
-        fi
-else
-        echo "BuildRoot was somehow set to / !"
-        exit -1
-fi
-
-# --- Pre/post (un)installation scripts ---
-
-%pre
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  make sure it is corrected before start using amanda  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-%post
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE}
-/sbin/ldconfig >>${TMPFILE} 2>&1
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
-                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
-                if [ -f /etc/xinetd.d/amandaclient ] ; then
-                        rm /etc/xinetd.d/amandaclient
-                fi
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE} 1>&2
-                        cat ${TMPFILE} >>${INSTALL_ERR}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
-        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        if [ -x /sbin/restorecon ] ; then
-              /sbin/restorecon %{LOCALSTATEDIR}/amanda/amandates  >>${TMPFILE} 2>&1
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation for amdump
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amdump"
-COMMENT="%{amanda_user}@server"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun
-/sbin/ldconfig
-%pre backup_server
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-%post backup_server
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
-/sbin/ldconfig
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
-                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
-                if [ -f /etc/xinetd.d/amandaclient ] ; then
-                        rm /etc/xinetd.d/amandaclient
-                fi
-
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE} 1>&2
-                        cat ${TMPFILE} >>${INSTALL_ERR}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
-        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts to server
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install amanda client configuration file
-echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
-if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
-        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-fi
-chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# install am_passphrase file to server
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then
-        echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
-        touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-        phrase=`echo "amandabackup" | md5sum | awk '{print $1}'`
-        echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase
-
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-        chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# SSH RSA key generation on server for amdump
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amdump"
-COMMENT="%{amanda_user}@server"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}" >>${TMPFILE} 2>&1
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun backup_server
-/sbin/ldconfig
-%pre backup_client
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-%post backup_client
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
-/sbin/ldconfig
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaclient ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
-
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
-        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts to client
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-                if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then
-                        echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-                fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install amanda client configuration file
-echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
-if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
-        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-fi
-chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun backup_client
-/sbin/ldconfig
-
-# --- Files to install ---
-
-%files backup_client
-%defattr(0755,%{amanda_user},%{amanda_group})
-%{SYSCONFDIR}/amanda
-%{AMANDAHOMEDIR}
-%{AMLIBEXECDIR}
-%{AMLIBDIR}
-%{AMLIBEXECDIR}/amanda-sh-lib.sh
-%{LOCALSTATEDIR}/amanda
-%defattr(4750,root,disk)
-%{AMLIBEXECDIR}/calcsize
-%{AMLIBEXECDIR}/killpgrp
-%{AMLIBEXECDIR}/rundump
-%{AMLIBEXECDIR}/runtar
-%defattr(0750,%{amanda_user},%{amanda_group})
-%{LOGDIR}
-%{SBINDIR}/amaespipe
-%{SBINDIR}/amcryp*
-%{SBINDIR}/amgpgcrypt
-%{SBINDIR}/amoldrecover
-%{SBINDIR}/amrecover
-%defattr(0644,%{amanda_user},%{amanda_group})
-%docdir %{MANDIR}
-%{MANDIR}/man5/amanda.conf.5.gz
-%{MANDIR}/man5/amanda-client.conf.5.gz
-%{MANDIR}/man8/amanda.8.gz
-%{MANDIR}/man8/amcheckdump.8.gz
-%{MANDIR}/man8/amrecover.8.gz
-%{AMLIBEXECDIR}/amcat.awk
-%{AMANDAHOMEDIR}/amanda-release
-%{AMANDAHOMEDIR}/example/xinetd.amandaclient
-%{AMANDAHOMEDIR}/example/amanda-client.conf
-
-%files backup_server
-%defattr(0755,%{amanda_user},%{amanda_group})
-%{SYSCONFDIR}/amanda
-%{AMLIBEXECDIR}
-%{AMLIBDIR}
-%{PERLSITELIB}/Amanda
-%{PERLSITELIB}/auto/Amanda
-%{AMANDAHOMEDIR}
-%{LOCALSTATEDIR}/amanda
-%{SBINDIR}/amaddclient
-%{SBINDIR}/amadmin
-%{SBINDIR}/amcheckdb
-%{SBINDIR}/amcheckdump
-%{SBINDIR}/amcleanup
-%{SBINDIR}/amdd
-%{SBINDIR}/amdevcheck
-%{SBINDIR}/amdump
-%{SBINDIR}/amfetchdump
-%{SBINDIR}/amflush
-%{SBINDIR}/amgetconf
-%{SBINDIR}/amlabel
-%{SBINDIR}/ammt
-%{SBINDIR}/amoverview
-%{SBINDIR}/amplot
-%{SBINDIR}/amreport
-%{SBINDIR}/amrestore
-%{SBINDIR}/amrmtape
-%{SBINDIR}/amserverconfig
-%{SBINDIR}/amstatus
-%{SBINDIR}/amtape
-%{SBINDIR}/amtapetype
-%{SBINDIR}/amtoc
-%{SBINDIR}/amverify
-%{SBINDIR}/amverifyrun
-%{AMLIBEXECDIR}/amanda-sh-lib.sh
-%defattr(4750,root,disk)
-%{AMLIBEXECDIR}/calcsize
-%{AMLIBEXECDIR}/killpgrp
-%{AMLIBEXECDIR}/rundump
-%{AMLIBEXECDIR}/runtar
-%{AMLIBEXECDIR}/dumper
-%{AMLIBEXECDIR}/planner
-%{SBINDIR}/amcheck
-%defattr(0750,%{amanda_user},%{amanda_group})
-%{LOGDIR}
-%{SBINDIR}/amaespipe
-%{SBINDIR}/amcrypt
-%{SBINDIR}/amcrypt-ossl
-%{SBINDIR}/amcrypt-ossl-asym
-%{SBINDIR}/amcryptsimple
-%{SBINDIR}/amgpgcrypt
-%{SBINDIR}/amoldrecover
-%{SBINDIR}/amrecover
-%defattr(0644,%{amanda_user},%{amanda_group})
-%{AMLIBEXECDIR}/amcat.awk
-%{AMLIBEXECDIR}/amplot.awk
-%{AMLIBEXECDIR}/amplot.g
-%{AMLIBEXECDIR}/amplot.gp
-%docdir %{MANDIR}
-%{MANDIR}/man5/amanda.conf.5.gz
-%{MANDIR}/man5/amanda-client.conf.5.gz
-%{MANDIR}/man8/amaddclient.8.gz
-%{MANDIR}/man8/amadmin.8.gz
-%{MANDIR}/man8/amanda.8.gz
-%{MANDIR}/man8/amcheck.8.gz
-%{MANDIR}/man8/amcheckdb.8.gz
-%{MANDIR}/man8/amcheckdump.8.gz
-%{MANDIR}/man8/amcleanup.8.gz
-%{MANDIR}/man8/amdd.8.gz
-%{MANDIR}/man8/amdump.8.gz
-%{MANDIR}/man8/amfetchdump.8.gz
-%{MANDIR}/man8/amflush.8.gz
-%{MANDIR}/man8/amgetconf.8.gz
-%{MANDIR}/man8/amlabel.8.gz
-%{MANDIR}/man8/ammt.8.gz
-%{MANDIR}/man8/amoverview.8.gz
-%{MANDIR}/man8/amplot.8.gz
-%{MANDIR}/man8/amrecover.8.gz
-%{MANDIR}/man8/amreport.8.gz
-%{MANDIR}/man8/amrestore.8.gz
-%{MANDIR}/man8/amrmtape.8.gz
-%{MANDIR}/man8/amserverconfig.8.gz
-%{MANDIR}/man8/amstatus.8.gz
-%{MANDIR}/man8/amtape.8.gz
-%{MANDIR}/man8/amtapetype.8.gz
-%{MANDIR}/man8/amtoc.8.gz
-%{MANDIR}/man8/amverify.8.gz
-%{MANDIR}/man8/amverifyrun.8.gz
-%{MANDIR}/man8/amcrypt.8.gz
-%{MANDIR}/man8/amcrypt-ossl.8.gz
-%{MANDIR}/man8/amcrypt-ossl-asym.8.gz
-%{MANDIR}/man8/amcryptsimple.8.gz
-%{MANDIR}/man8/amgpgcrypt.8.gz
-%{MANDIR}/man8/amaespipe.8.gz
-%{MANDIR}/man8/amdevcheck.8.gz
-%{AMANDAHOMEDIR}/amanda-release
-%{AMANDAHOMEDIR}/example/amanda-client.conf
-%{AMANDAHOMEDIR}/example/xinetd.amandaserver
-
-# --- ChangeLog
-
-%changelog
-* Fri May 02 2008 Dan Locks <dwlocks at zmanda dot com>
-- Changed instances of ${ to %%{ where applicable
-* Tue Mar 11 2008 Dan Locks <dwlocks at zmanda dot com>
-- fixed many rpmlint complaints
-- added --quiet to configure statements
-- moved PERLSITELIB to definitions section
-* Wed Feb 13 2008 Dan Locks <dwlocks at zmanda dot com>
-- added an environment check for PKG_CONFIG_PATH
-- added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment 
-  var is used if provided)
-* Fri Feb 01 2008 Dan Locks <dwlocks at zmanda dot com>
-- Removed amplot executable and manpages from client installation
-- Added amcheckdump.8 manpage
-- Fixed %%{LOCALSTATEDIR}/amanda dir creation.
-* Wed Jan 23 2008  Dan Locks <dwlocks at zmanda dot com>
-- Change %%{SYSCONFDIR}/amanda/amandates to %%{LOCALSTATEDIR}/amanda/amandates,
-  and added %%{LOCALSTATEDIR}/amanda to the files lists.
-* Mon Jan 14 2008  Dan Locks <dwlocks at zmanda dot com>
-- Updates for perlified amanda, file location moves, gpg setup.
-* Tue Nov  13 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added SYSCONFDIR to client rpm
-- Set xinetd and amanda-client.conf configuration files as part of postinstall
-* Thu Nov  8 2007 Dan Locks <dwlocks at zmanda dot com>
-- Added Linux distribution detection
-* Wed Nov 7 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added amserverconfig, amaddclient, amgpgcrypt, amcryptsimple and libamdevice.
-- Added amanda configuration template files
-* Fri Sep 21 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Remove libamserver, libamtape from client rpm
-* Wed Sep 19 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added Fedora 7
-* Tue Jun 26 2007 Kevin Till <ktill at zmanda dot com>
-- set debug log to /var/log/amanda
-* Fri Jan 12 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added label templates
-* Thu Dec 07 2006 Paddy Sreenivasan <paddy at zmanda dot com>
-- Application API changes
-* Fri Jun 16 2006 Kevin Till <ktill at zmanda dot com>
-- make install will install necessary example files. 
-  No need to "cp"
-* Wed Jun 07 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added amoldrecover and amanda-client.conf man page.
-* Thu Jun 01 2006 Kevin Till <ktill at zmanda dot com> -
-- Added amcrypt-ossl, amcrypt-ossl-asym by Ben Slusky.
-* Thu May 18 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added SLES10, RHEL3 build options.
-* Tue May 09 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added amanda-release file to amandabackup home directory.
-- Installation message logging cleanup.
-* Thu Apr 27 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Removed dependency on tar version.
-- Moved log directory creation after backup user creation.
-* Wed Apr 19 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added informative message to note the location of pre- and post-
-- install script logs files.
-* Mon Apr 17 2006 Chris Lee <cmlee at zmanda dot com> -
-- Reworked installation message logging and reporting.
-* Fri Apr 14 2006 Chris Lee <cmlee at zmanda dot com> -
-- Changed behavior for creating required localhost entries in the
-- amandahosts file to check for these entries even when the file
-- already exists.
-* Wed Apr 12 2006 Chris Lee <cmlee at zmanda dot com> -
-- Removed pre-install check for "disk" group.  This group should exist
-- by default on almost all modern distributions.
-* Tue Apr 11 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added amandahosts entry for "localhost" without domain.
-* Fri Apr 07 2006 Chris Lee <cmlee at zmanda dot com> -
-- Changed default entries in .amandahosts to use "localdomain" instead
-- of "localnet".
-- Updated amanda_version and release.
-* Mon Apr 03 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added example amanda.conf to files.
-* Thu Mar 16 2006 Chris Lee <cmlee at zmanda dot com> -
-- Corrected an issue with pre-install scripts wrt bug #218.
-- Corrected an issue with post-install scripts and added testing .profile 
-- in amandabackup's home directory for setting environment variables wrt
-- bug #220.
-* Mon Mar 13 2006 Chris Lee <cmlee at zmanda dot com> -
-- Corrected a syntactical error with setting ownership of amandates file
-- wrt bug #216.
-* Wed Mar 08 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added pre-install scripts to verify proper ownership of
-- amandabackup home directory.
-* Thu Feb 2 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Require xinetd. Require termcap and initscripts for Fedora and Redhat.
-* Mon Jan 09 2006 Chris Lee <cmlee at zmanda dot com> -
-- Pre/post install scripts updated:
-- o Resolved an issue where an empty amandates file was installed
--   even if the file already existed on the system.
-- o If .amandahosts does not exist a default is now created.
-- The Amanda user account has been changed to 'amandabackup' for
-- additional security.
-* Tue Jan 03 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Removed amandates from files list.
-* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected dependency for awk to "/bin/awk".
-* Thu Dec 29 2005 Kevin Till <ktill at zmanda dot com> -
-- add man pages for amcrypt and amaespipe
-* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
-- Updated dependancy info to depend on tar >= 1.15.
-- Included dependancies from top-level package in backup_client and
-- backup_server packages.
-- Reorganized files lists for readability (alphabetically).
-- Updated backup_client files list to include some missing files per
-- bug #129.
-- Updated pre- and post-install to handle potential issue when
-- /var/log/amanda exists and is a file rather than a directory.
-- Corrected permissions for /var/log/amanda in pre-install scripts
-- per bug #78 and 13 December change.
-* Thu Dec 22 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added amaespipe and amcrypt
-- Added sles9 build definitions
-* Tue Dec 13 2005 Chris Lee <cmlee at zmanda dot com> -
-- Changed permissions for /var/log/amanda, removing set group id bit.
-- Added /etc/amandates to backup_client package.
-* Thu Dec 08 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected an issue with detection of existing 'amanda' user account.
-- Corrected ownership of setuid executables per Bug #66.
-- Moved the gnutar and noop files to the backup_client package (where
-- they sould be).
-- Removed amqde from files list.
-- Added logging features to pre- and post-install scripts.
-* Wed Dec 07 2005 Chris Lee <cmlee at zmanda dot com> -
-- Changed a number of directory and file permissions from amanda:root
-- to amanda:disk in response to Bug #57.
-* Fri Dec 02 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected SYSCONFDIR path definition.  Closes Bug #58.
-* Mon Nov 28 2005 Chris Lee <cmlee at zmanda dot com> -
-- Really fixed user creation preinstall scripts.
-* Wed Nov 23 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Updated package description.
-- Changed Group for packages.
-* Tue Nov 22 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected dependancy packaging issue with amanda libraries.
-- Fixed creation of amanda user on systems which it does not exist.
-- Corrected Group definition for SuSE.
-- Updated descriptions to include amanda-libs package.
-- Updated release number to 2.
-* Tue Nov 08 2005 Chris Lee <cmlee at zmanda dot com> -
-- Permissions changes: now using user=amanda, group=disk
-* Sun Oct 30 2005 Chris Lee <cmlee at zmanda dot com> -
-- Parameters to configure options --with-user and --with-group changed
-- such that when test_build is set to '1' the username of the user who
-- runs rpmbuild is used for both values.  If test_build is set to '0'
-- then root is used for both values.
-- The release field was also changed to automatically reflect the
-- distribution and distribution release version for which the RPM was
-- built.
-* Tue Oct 18 2005 Chris Lee <cmlee at zmanda dot com> - 
-- Initial RPM SPEC file created.
-
diff --git a/packaging/rpm/amanda.spec.rej b/packaging/rpm/amanda.spec.rej
deleted file mode 100644 (file)
index 3bcd640..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-***************
-*** 122,128 ****
-  # --- Definitions ---
-  
-  # Define amanda_version if it is not already defined.
-- %{!?amanda_version: %define amanda_version 2.6.0}
-  %{!?amanda_release: %define amanda_release 2}
-  %define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
-  %define amanda_user amandabackup
---- 122,128 ----
-  # --- Definitions ---
-  
-  # Define amanda_version if it is not already defined.
-+ %{!?amanda_version: %define amanda_version 2.6.0p1}
-  %{!?amanda_release: %define amanda_release 2}
-  %define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
-  %define amanda_user amandabackup
index ec5010dc5e0a65f1ce16a0ed367c0ac1c607b799..6361d140ae15049bcedbeb51152a5f57bf1676ec 100755 (executable)
@@ -6,7 +6,7 @@ set -x
 # Buildbot exports some useful env variables.
 # Check for $AMVER.  I couldn't come up with a good way to detect it.
 if [ -z $AMVER ]; then
-    AMVER=amanda-2.6.0p1
+    AMVER=amanda-2.6.0p2
 fi
 # Check for AMTARBALL variable.
 if [ -z $AMTARBALL ]; then 
@@ -48,3 +48,5 @@ cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec
 # this is useful for changing %amanda_release or %amanda_version
 rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \
              ${AMPKGDIR}/rpm/SPECS/amanda.spec 
+cp rpm/RPMS/*/*.rpm . || exit 1
+cp rpm/SRPMS/*.rpm . || exit 1
diff --git a/packaging/rpm/buildpkg.orig b/packaging/rpm/buildpkg.orig
deleted file mode 100755 (executable)
index ec5010d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-# Buildpkg script for producing RPM packages. Does not require root access.
-
-# This is useful for debugging
-set -x
-# Buildbot exports some useful env variables.
-# Check for $AMVER.  I couldn't come up with a good way to detect it.
-if [ -z $AMVER ]; then
-    AMVER=amanda-2.6.0p1
-fi
-# Check for AMTARBALL variable.
-if [ -z $AMTARBALL ]; then 
-    AMTARBALL=$AMVER.tar.gz
-fi
-
-# Check for AMTARBALL file, if it's not there, create it.
-if [ ! -f ${AMTARBALL} ]; then
-    mkdir ${AMVER}
-    cp -Rfp * ${AMVER}/
-    tar -cf ${AMTARBALL} -z ${AMVER}
-    rm -rf ${AMVER}
-fi
-
-# Check for the packaging dirs.
-if [ -z $AMPKGDIR ]; then
-    AMPKGDIR=${PWD}
-fi
-if [ ! -d ${AMPKGDIR} ]; then
-    mkdir ${AMPKGDIR}
-fi
-cd ${AMPKGDIR}
-
-if [ -d rpm ]; then
-    rm -rf rpm
-fi
-mkdir rpm
-mkdir rpm/SOURCES
-mkdir rpm/SRPMS
-mkdir rpm/SPECS
-mkdir rpm/BUILD
-mkdir rpm/RPMS
-
-# Make a copy of the tarball with the name that rpmbuild expects
-cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz
-cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec
-# Rpmbuild requires absolute paths.  annoying.  If you need to change the 
-# default value of some rpm.spec variable, just pass extra --define options.
-# this is useful for changing %amanda_release or %amanda_version
-rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \
-             ${AMPKGDIR}/rpm/SPECS/amanda.spec 
diff --git a/packaging/rpm/buildpkg.rej b/packaging/rpm/buildpkg.rej
deleted file mode 100644 (file)
index be33dd1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-***************
-*** 6,12 ****
-  # Buildbot exports some useful env variables.
-  # Check for $AMVER.  I couldn't come up with a good way to detect it.
-  if [ -z $AMVER ]; then
--     AMVER=amanda-2.6.0
-  fi
-  # Check for AMTARBALL variable.
-  if [ -z $AMTARBALL ]; then 
---- 6,12 ----
-  # Buildbot exports some useful env variables.
-  # Check for $AMVER.  I couldn't come up with a good way to detect it.
-  if [ -z $AMVER ]; then
-+     AMVER=amanda-2.6.0p1
-  fi
-  # Check for AMTARBALL variable.
-  if [ -z $AMTARBALL ]; then 
index 6b8b012178a519b0d9465f0979a9a83d7073bde0..bfad1bff77fa642ef4ab349060c4f3dfbe78bc84 100644 (file)
@@ -161,6 +161,8 @@ exhausted.  C<slot_callback> gets three arguments: a slot number, a
 device name for that slot, and a boolean value which is true if the
 changer successfully loaded the slot.
 
+=back
+
 =cut
 
 sub reset {
index 9f9bae0bc61e5862cadbbe0523924f75afcc816e..fa99ed1c2023d58e1589954f9330ca892e1e93ac 100644 (file)
@@ -122,7 +122,7 @@ Amanda::Cmdline - utilities for handling command lines
 
   my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
                            $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
-  
+
 =head1 API STATUS
 
 Will change.
index b6dec0266eb5eb28eab5fd5529479fcc08ce9a1c..953edabafe35ef0aa84003c0197b8a082ce4ba60 100644 (file)
@@ -42,7 +42,7 @@ Amanda::Cmdline - utilities for handling command lines
 
   my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
                            $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
-  
+
 =head1 API STATUS
 
 Will change.
index c428b5a5e2d83c031b0923a25b3043e937fc8818..b254c923cbab11e5306b141017dbeee779915f01 100644 (file)
@@ -292,7 +292,7 @@ Amanda::Config - access to Amanda configuration parameters
 
   print "tape device is ", getconf($CNF_TAPEDEV), "\n";
 
-This API closely parallels the C API.  See L<conffile.h> for details
+This API closely parallels the C API.  See F<conffile.h> for details
 on the functions and constants available here.
 
 =head1 API STATUS
@@ -350,7 +350,7 @@ C<get_config_filename()>, respectively.
 
 Most Amanda applications accept the command-line option C<-o>
 to "overwrite" configuration values in C<amanda.conf>.  In Perl
-applications, these options should be parsed with L<Getopt::Long>, with
+applications, these options should be parsed with L<Getopt::Long|Getopt::Long>, with
 the action being a call to C<add_config_overwrite_opt>.  For example:
 
   my $config_overwrites = new_config_overwrites($#ARGV+1);
@@ -402,17 +402,23 @@ Each subsection type has the following functions:
 
 =over
 
-=item C<lookup_TYP($subsec_name)>, which returns an opaque object
+=item C<lookup_TYP($subsec_name)>
+
+which returns an opaque object
 (C<$ss>) representing the subsection, or C<undef> if no subsection
 with that name exists;
 
-=item C<TYP_name($ss)>, returning the name of the subsection;
+=item C<TYP_name($ss)>
+
+returning the name of the subsection;
+
+=item C<TYP_getconf($ss, $cnf)>
 
-=item C<TYP_getconf($ss, $cnf)>, which fetches a parameter value from
-C<$ss>; and
+which fetches a parameter value from C<$ss>; and
 
-=item C<TYP_seen($ss, $cnf)>, which returns a true value if <$cnf>
-was seen in the subsection.
+=item C<TYP_seen($ss, $cnf)>
+
+which returns a true value if <$cnf> was seen in the subsection.
 
 =back
 
@@ -420,13 +426,25 @@ The subsections are:
 
 =over
 
-=item C<tapetype>, with constants beginning with C<$TAPETYPE_>,
+=item C<tapetype>
+
+with constants beginning with C<$TAPETYPE_>
+
+=item C<dumptype>
+
+with constants beginning with C<$DUMPTYPE_>
+
+=item C<holdingdisk>
+
+with constants beginning with C<$HOLDING_>
+
+=item C<application>
 
-=item C<dumptype>, with constants beginning with C<$DUMPTYPE_>,
+with constants beginning with C<$APPLICATION_>
 
-=item C<interface>, with constants beginning with C<$INTER_>, and
+=item C<script>
 
-=item C<holdingdisk>, with constants beginning with C<$HOLDING_>.
+with constants beginning with C<$PP_SCRIPT_>
 
 =back
 
index 6573f1b52570568e75ace46f255632fbc381d979..ddeab5ed986896767c140d86138c6cb783d1847f 100644 (file)
@@ -40,7 +40,7 @@ Amanda::Config - access to Amanda configuration parameters
 
   print "tape device is ", getconf($CNF_TAPEDEV), "\n";
 
-This API closely parallels the C API.  See L<conffile.h> for details
+This API closely parallels the C API.  See F<conffile.h> for details
 on the functions and constants available here.
 
 =head1 API STATUS
@@ -98,7 +98,7 @@ C<get_config_filename()>, respectively.
 
 Most Amanda applications accept the command-line option C<-o>
 to "overwrite" configuration values in C<amanda.conf>.  In Perl
-applications, these options should be parsed with L<Getopt::Long>, with
+applications, these options should be parsed with L<Getopt::Long|Getopt::Long>, with
 the action being a call to C<add_config_overwrite_opt>.  For example:
 
   my $config_overwrites = new_config_overwrites($#ARGV+1);
@@ -150,17 +150,23 @@ Each subsection type has the following functions:
 
 =over
 
-=item C<lookup_TYP($subsec_name)>, which returns an opaque object
+=item C<lookup_TYP($subsec_name)>
+
+which returns an opaque object
 (C<$ss>) representing the subsection, or C<undef> if no subsection
 with that name exists;
 
-=item C<TYP_name($ss)>, returning the name of the subsection;
+=item C<TYP_name($ss)>
+
+returning the name of the subsection;
+
+=item C<TYP_getconf($ss, $cnf)>
 
-=item C<TYP_getconf($ss, $cnf)>, which fetches a parameter value from
-C<$ss>; and
+which fetches a parameter value from C<$ss>; and
 
-=item C<TYP_seen($ss, $cnf)>, which returns a true value if <$cnf>
-was seen in the subsection.
+=item C<TYP_seen($ss, $cnf)>
+
+which returns a true value if <$cnf> was seen in the subsection.
 
 =back
 
@@ -168,13 +174,25 @@ The subsections are:
 
 =over
 
-=item C<tapetype>, with constants beginning with C<$TAPETYPE_>,
+=item C<tapetype>
+
+with constants beginning with C<$TAPETYPE_>
+
+=item C<dumptype>
+
+with constants beginning with C<$DUMPTYPE_>
+
+=item C<holdingdisk>
+
+with constants beginning with C<$HOLDING_>
+
+=item C<application>
 
-=item C<dumptype>, with constants beginning with C<$DUMPTYPE_>,
+with constants beginning with C<$APPLICATION_>
 
-=item C<interface>, with constants beginning with C<$INTER_>, and
+=item C<script>
 
-=item C<holdingdisk>, with constants beginning with C<$HOLDING_>.
+with constants beginning with C<$PP_SCRIPT_>
 
 =back
 
index e0ffa811fd4e9e29f3ee7c742c2715731062ddcb..5549f1160c7f077e7ecefd074d982c05fdc01e84 100644 (file)
@@ -203,7 +203,7 @@ Amanda::Device - interact with Amanda data-storage devices
       print "Label on $device_name is '$dev->volume_label'\n";
   }
   
-See L<http://wiki.zmanda.com/index.php/Device_API> for details on how Devices are used.
+See http://wiki.zmanda.com/index.php/Device_API for details on how Devices are used.
 
 =head1 API STATUS
 
@@ -247,7 +247,7 @@ See the wiki for descriptions of these functions
 
 =item C<start_file($jobinfo)>
 
-where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes)
+where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes>)
 
 =item C<write_min_size()>
 
index c8e2a51cd26b51a894a560bf2b29a98e0cba0017..73aac3137fd8f920a5d43d2e6664e4e909dfe4b3 100644 (file)
@@ -46,7 +46,7 @@ Amanda::Device - interact with Amanda data-storage devices
       print "Label on $device_name is '$dev->volume_label'\n";
   }
   
-See L<http://wiki.zmanda.com/index.php/Device_API> for details on how Devices are used.
+See http://wiki.zmanda.com/index.php/Device_API for details on how Devices are used.
 
 =head1 API STATUS
 
@@ -90,7 +90,7 @@ See the wiki for descriptions of these functions
 
 =item C<start_file($jobinfo)>
 
-where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes)
+where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes>)
 
 =item C<write_min_size()>
 
index ebea270aaf48d7a556479ec0538743774e97cf24..4bec9e9c52465eaa9efc958c79ba9b06b322ad41 100644 (file)
@@ -251,7 +251,8 @@ Functions in this section extract information from logfiles.
 =item C<find_log()>
 
 Return a list of logfiles for active tapes.  The tapelist must be loaded before
-this function is called (see L<Amanda::Tapelist>).
+this function is called (see L<Amanda::Tapefile>, and note that this module will be
+renamed to L<Amanda::Tapelist> in Amanda-2.6.1).
 
 =item C<search_logfile($label, $datestamp, $logfile, $add_missing_disks)>
 
@@ -268,6 +269,8 @@ C<$level> is given as a string, since it is a match expression.
 
 All of these functions can be imported by name.
 
+=back
+
 =cut
 
 push @EXPORT_OK, qw(open_logfile get_logline close_logfile);
index be5c14515fdb6ee9f52f675332ac3622633ddce6..cab431a0773637bae288395fdd1dd82f2a44f911 100644 (file)
@@ -135,7 +135,8 @@ Functions in this section extract information from logfiles.
 =item C<find_log()>
 
 Return a list of logfiles for active tapes.  The tapelist must be loaded before
-this function is called (see L<Amanda::Tapelist>).
+this function is called (see L<Amanda::Tapefile>, and note that this module will be
+renamed to L<Amanda::Tapelist> in Amanda-2.6.1).
 
 =item C<search_logfile($label, $datestamp, $logfile, $add_missing_disks)>
 
@@ -152,6 +153,8 @@ C<$level> is given as a string, since it is a match expression.
 
 All of these functions can be imported by name.
 
+=back
+
 =cut
 %}
 
index 612ed55c8448d50ff47295297c85b5d4be2f7239..da8196b54dc15731c36e1e01fd8eb6ae01188a20 100644 (file)
@@ -58,4 +58,15 @@ package Amanda::Tapefile;
 
 @EXPORT_OK = ();
 %EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Tapefile - temporary hack
+
+=head1 HACK?
+
+Yeah, this is just here to make Amanda::Logfile usable.  This module
+wil become Amanda::Tapelist in the next release.
+
+=cut
 1;
index 32b5c30340db05b1c32dff9a3245a1c66112cd9e..858e98e0060de6f78fca63cb3ec152b338dfebb3 100644 (file)
 #include "tapefile.h"
 %}
 
+%perlcode %{
+=head1 NAME
+
+Amanda::Tapefile - temporary hack
+
+=head1 HACK?
+
+Yeah, this is just here to make Amanda::Logfile usable.  This module
+wil become Amanda::Tapelist in the next release.
+
+=cut
+%}
 /* This is just a hack to get Amanda::Logfile working! */
 
 int read_tapelist(char *tapefile);
index 732e80adc3986a6b540c5321fefc2f97b879a4c4..a40c05b0b54969614f3b13a01d2bcbff33e42ca7 100644 (file)
@@ -92,38 +92,49 @@ Application initialization generally looks like this:
 
 =item C<setup_application($name, $type, $context)>
 
-Set up the operating environment for an application, without requiring
-any configuration.
+Set up the operating environment for an application, without requiring any
+configuration.
+
+C<$name> is the name of the application, used in log messages, etc.  C<$type>
+is usualy one of "server" or "client".  It specifies the subdirectory in which
+debug logfiles will be created.  C<$context> indicates the usual manner in
+which this application is invoked; one of C<"cmdline"> for a user-invoked
+command-line utility (e.g., C<amadmin>) which should send human-readable error
+messages to stderr; C<"daemon"> for a program started by C<amandad>, e.g.,
+C<sendbackup>; or C<"scriptutil"> for a small program used from shell scripts,
+e.g., C<amgetconf>
+
+Based on C<$type> and C<$context>, this function does the following:
 
 =over
 
-=item C<$name> is the name of the application, used in log messages, etc.
+=item *
 
-=item C<$type> is one of "server" or "client".
+sets up debug logging;
 
-=item C<$context> is one of "cmdline" for a user-invoked command-line
-utility (e.g., C<amadmin>) or "daemon" for a program started by
-C<amandad>.  (TODO: daemon is not supported yet)
+=item *
 
-=back
+configures internationalization
 
-Based on C<$type> and C<$context>, this function does the following:
+=item *
 
-=over
+sets the umask;
 
-=item sets up debug logging;
+=item *
 
-=item configures internationalization
+sets the current working directory to the debug or temporary directory;
 
-=item sets the umask;
+=item *
 
-=item sets the current working directory to the debug or temporary directory;
+closes any unnecessary file descriptors as a security meaasure;
 
-=item closes any unnecessary file descriptors as a security meaasure;
+=item *
 
-=item ignores C<SIGPIPE>; and
+ignores C<SIGPIPE>; and
 
-=item sets the appropriate target for error messages.
+=item *
+
+sets the appropriate target for error messages.
 
 =back
 
@@ -194,7 +205,7 @@ sub finish_setup {
     check_running_as($running_as);
 }
 
-=item safe_env
+=item C<safe_env()>
 
 Return a "safe" environment hash.  For non-setuid programs, this means filtering out any
 localization variables.
@@ -271,4 +282,8 @@ sub check_std_fds {
     fcntl(STDOUT, F_GETFD, 0) or critical("Standard output is not open");
     fcntl(STDERR, F_GETFD, 0) or critical("Standard error is not open");
 }
+
+=back
+
+=cut
 1;
index e67a471d7e3f1526c3fbf1705493707975662380..e38a2e597957965ff95df69bbd97b5c145eb7a96 100644 (file)
@@ -55,38 +55,49 @@ Application initialization generally looks like this:
 
 =item C<setup_application($name, $type, $context)>
 
-Set up the operating environment for an application, without requiring
-any configuration.
+Set up the operating environment for an application, without requiring any
+configuration.
+
+C<$name> is the name of the application, used in log messages, etc.  C<$type>
+is usualy one of "server" or "client".  It specifies the subdirectory in which
+debug logfiles will be created.  C<$context> indicates the usual manner in
+which this application is invoked; one of C<"cmdline"> for a user-invoked
+command-line utility (e.g., C<amadmin>) which should send human-readable error
+messages to stderr; C<"daemon"> for a program started by C<amandad>, e.g.,
+C<sendbackup>; or C<"scriptutil"> for a small program used from shell scripts,
+e.g., C<amgetconf>
+
+Based on C<$type> and C<$context>, this function does the following:
 
 =over
 
-=item C<$name> is the name of the application, used in log messages, etc.
+=item *
 
-=item C<$type> is one of "server" or "client".
+sets up debug logging;
 
-=item C<$context> is one of "cmdline" for a user-invoked command-line
-utility (e.g., C<amadmin>) or "daemon" for a program started by
-C<amandad>.  (TODO: daemon is not supported yet)
+=item *
 
-=back
+configures internationalization
 
-Based on C<$type> and C<$context>, this function does the following:
+=item *
 
-=over
+sets the umask;
 
-=item sets up debug logging;
+=item *
 
-=item configures internationalization
+sets the current working directory to the debug or temporary directory;
 
-=item sets the umask;
+=item *
 
-=item sets the current working directory to the debug or temporary directory;
+closes any unnecessary file descriptors as a security meaasure;
 
-=item closes any unnecessary file descriptors as a security meaasure;
+=item *
 
-=item ignores C<SIGPIPE>; and
+ignores C<SIGPIPE>; and
 
-=item sets the appropriate target for error messages.
+=item *
+
+sets the appropriate target for error messages.
 
 =back
 
@@ -157,7 +168,7 @@ sub finish_setup {
     check_running_as($running_as);
 }
 
-=item safe_env
+=item C<safe_env()>
 
 Return a "safe" environment hash.  For non-setuid programs, this means filtering out any
 localization variables.
@@ -224,4 +235,8 @@ sub check_std_fds {
     fcntl(STDOUT, F_GETFD, 0) or critical("Standard output is not open");
     fcntl(STDERR, F_GETFD, 0) or critical("Standard error is not open");
 }
+
+=back
+
+=cut
 %}
index a4da56c51b0c8b31ac2676423c0357c51eaebf2a..026f067403cd14b4bfe04ce6a5540ca0a87c59eb 100644 (file)
@@ -50,6 +50,25 @@ libamglue_la_SOURCES = \
 libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
 EXTRA_DIST += $(libamglue_la_SOURCES)
 
+##
+## HTML Generation
+##
+
+# This isn't a very robust implementation, as it's only meant to make the HTML
+# available online as part of the automated compilation process.  It assumes
+# that all perl modules were built (not just server or client), and that the
+# build directory does not contain any "junk".
+
+# HTML_SOURCE_FILES should contain the .pm files from which the HTML should
+# be geneated.  This is just the concatenation of foo_DATA for all $(foodir)
+# into which perl modules are installed.
+HTML_SOURCE_FILES=
+html: make_html amperl.css $(HTML_SOURCE_FILES)
+       rm -rf html-tmp/ && mkdir html-tmp/
+       cp amperl.css html-tmp/
+       $(PERL) make_html html-tmp/ $(HTML_SOURCE_FILES)
+       cd html-tmp/ && tar -zcf $(abs_builddir)/html.tar.gz .
+       rm -rf html-tmp/
 ##
 ## SWIG-generated packages
 ##
@@ -94,6 +113,7 @@ SWIG_OPTIONS=-perl5 -proxy -DSWIG_TYPE_TABLE=SWIG_TYPES_Amanda -I$(srcdir)
 
 Amandadir=$(amperldir)/Amanda
 Amanda_DATA =
+HTML_SOURCE_FILES += $(Amanda_DATA)
 
 if WANT_SERVER
 # PACKAGE: Amanda::Device
index e4ad8bd4dd0af14a312c44a512edc63117144bf3..a4fbb1672b65ff375478fedcab9b44bb74cb09ff 100644 (file)
@@ -181,6 +181,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
@@ -833,6 +834,16 @@ libamglue_la_SOURCES = \
 
 libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
 
+# This isn't a very robust implementation, as it's only meant to make the HTML
+# available online as part of the automated compilation process.  It assumes
+# that all perl modules were built (not just server or client), and that the
+# build directory does not contain any "junk".
+
+# HTML_SOURCE_FILES should contain the .pm files from which the HTML should
+# be geneated.  This is just the concatenation of foo_DATA for all $(foodir)
+# into which perl modules are installed.
+HTML_SOURCE_FILES = $(Amanda_DATA)
+
 # Tell libtool to not bother versioning the libs we build, since perl won't
 # pay attention to such things, anyway.
 
@@ -1504,8 +1515,6 @@ dvi: dvi-am
 
 dvi-am:
 
-html: html-am
-
 info: info-am
 
 info-am:
@@ -1662,6 +1671,12 @@ dist-scripts:
        done; \
        true
 dist-hook: dist-scripts
+html: make_html amperl.css $(HTML_SOURCE_FILES)
+       rm -rf html-tmp/ && mkdir html-tmp/
+       cp amperl.css html-tmp/
+       $(PERL) make_html html-tmp/ $(HTML_SOURCE_FILES)
+       cd html-tmp/ && tar -zcf $(abs_builddir)/html.tar.gz .
+       rm -rf html-tmp/
 
 # Suffix rules.  These are parallel-build compatible, but may cause
 # strange behavior if there are other .c files in this directory.  The
index 75bc1a562140e7b6a81459bab4e0720bf5e27af9..73128e6a62519b0cc3c37e65539146a8513fccc8 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "amglue.h"
+#include "stdint.h"
 
 /*
  * C -> Perl
index f1089da9d5f309dab72b376810502a2decfec537..8409cec4080a20f482863c4a58c3c2b307afc57d 100644 (file)
@@ -77,6 +77,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 62ae5bb9640ce780283e2f87a70014738fe3cf55..1494a1a076bd3679a1c5743a03a78c1f8a84f70a 100644 (file)
@@ -125,6 +125,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index ded5beb93bdf57d71d21844b583fdde11e799493..f092f9d6b7184089b76245f4f0f1e031384f94f0 100644 (file)
@@ -126,6 +126,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 73338545b7b9ca72a5eeb30c96ff384ca9150dec..b83b8e0d0f248a8f6781d6e698ce2f1c1fc18ae0 100644 (file)
@@ -186,7 +186,7 @@ void
 check_security_buffer(
     char *     buffer)
 {
-    socklen_t i;
+    socklen_t_equiv i;
     struct sockaddr_in addr;
     char *s, *fp, ch;
     char *errstr = NULL;
@@ -222,7 +222,7 @@ check_security_buffer(
        /*NOTREACHED*/
     }
     skip_whitespace(s, ch);
-    if (!check_security((struct sockaddr_storage *)&addr, s-1, 0, &errstr)) {
+    if (!check_security((sockaddr_union *)&addr, s-1, 0, &errstr)) {
        error(_("security check failed: %s"), errstr);
        /*NOTREACHED*/
     }
@@ -236,7 +236,7 @@ main(
     char *buf = NULL;
     int data_sock = -1;
     in_port_t data_port = (in_port_t)-1;
-    socklen_t socklen;
+    socklen_t_equiv socklen;
     struct sockaddr_in addr;
     GSList *dumpspecs;
     tapelist_t *tapes = NULL;
index 1d8a134f85cb8eb944757647a82997e9177501f8..4533c0b1dd727b6f3cba73e0115727a13f667670 100644 (file)
@@ -218,6 +218,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \
index 10d8dea4c342454568b41579646d1a8a73ba7f0f..9acacbc87238be1ea4347959a36025cb4b687be4 100644 (file)
@@ -120,9 +120,9 @@ static const struct {
     { "due", due,
        T_(" [<hostname> [<disks>]* ]*\t # Show due date.") },
     { "balance", balance,
-       T_(" [-days <num>]\t\t # Show nightly dump size balance.") },
+       T_(" [--days <num>]\t\t # Show nightly dump size balance.") },
     { "tape", tape,
-       T_(" [-days <num>]\t\t # Show which tape is due next.") },
+       T_(" [--days <num>]\t\t # Show which tape is due next.") },
     { "bumpsize", bumpsize,
        T_("\t\t\t # Show current bump thresholds.") },
     { "export", export_db,
@@ -765,9 +765,12 @@ tape(
     int                argc,
     char **    argv)
 {
-    tape_t *tp, *lasttp;
-    int runtapes, i, j;
-    int nb_days = 1;
+    int     nb_days = 1;
+    int     runtapes;
+    tape_t *tp;
+    int     i, j;
+    int     skip;
+    int     nb_new_tape;
 
     if(argc > 4 && strcmp(argv[3],"--days") == 0) {
        nb_days = atoi(argv[4]);
@@ -781,54 +784,41 @@ tape(
 
     runtapes = getconf_int(CNF_RUNTAPES);
     tp = lookup_last_reusable_tape(0);
+    skip = 0;
 
     for ( j=0 ; j < nb_days ; j++ ) {
+       nb_new_tape=0;
        for ( i=0 ; i < runtapes ; i++ ) {
            if(i==0)
-               g_printf(_("The next Amanda run should go onto "));
-           else
-               g_printf("                                   ");
+               g_fprintf(stdout, _("The next Amanda run should go onto "));
            if(tp != NULL) {
-               g_printf(_("tape %s or a new tape.\n"), tp->label);
+               if (nb_new_tape > 0) {
+                   if (nb_new_tape == 1)
+                       g_fprintf(stdout, _("1 new tape.\n"));
+                   else
+                       g_fprintf(stdout, _("%d new tapes.\n"), nb_new_tape);
+                   g_fprintf(stdout, "                                   ");
+                   nb_new_tape = 0;
+               }
+               g_fprintf(stdout, _("tape %s or a new tape.\n"), tp->label);
+               if (i < runtapes-1)
+                   g_fprintf(stdout, "                                   ");
            } else {
-               if (runtapes - i == 1)
-                   g_printf(_("1 new tape.\n"));
-               else
-                   g_printf(_("%d new tapes.\n"), runtapes - i);
-               i = runtapes;
+               nb_new_tape++;
            }
-       
-           tp = lookup_last_reusable_tape(i + 1);
-       }
-    }
-    lasttp = lookup_tapepos(lookup_nb_tape());
-    i = runtapes;
-    if(lasttp && i > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-       int c = 0;
-       while(lasttp && i > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-           c++;
-           lasttp = lasttp->prev;
-           i--;
-       }
-       lasttp = lookup_tapepos(lookup_nb_tape());
-       i = runtapes;
-       if(c == 1) {
-           g_printf(_("The next new tape already labelled is: %s.\n"),
-                  lasttp->label);
+           skip++;
+
+           tp = lookup_last_reusable_tape(skip);
        }
-       else {
-           g_printf(_("The next %d new tapes already labelled are: %s"), c,
-                  lasttp->label);
-           lasttp = lasttp->prev;
-           c--;
-           while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-               g_printf(", %s", lasttp->label);
-               lasttp = lasttp->prev;
-               c--;
-           }
-           g_printf(".\n");
+       if (nb_new_tape > 0) {
+           if (nb_new_tape == 1)
+               g_fprintf(stdout, _("1 new tape.\n"));
+           else
+               g_fprintf(stdout, _("%d new tapes.\n"), nb_new_tape);
        }
     }
+
+    print_new_tapes(stdout, nb_days * runtapes);
 }
 
 /* ----------------------------------------------- */
index 29ef093282c0ad4a51b344a67fdbee8332eaad84..920da30290a0ef15417bd307b0d48c5f108e0440 100644 (file)
@@ -1106,8 +1106,8 @@ main(
     char *s;
     int ch;
     char *cmd_undo, cmd_undo_ch;
-    socklen_t socklen;
-    struct sockaddr_storage his_addr;
+    socklen_t_equiv socklen;
+    sockaddr_union his_addr;
     char *arg = NULL;
     char *cmd;
     size_t len;
@@ -1364,7 +1364,7 @@ main(
        if (!user_validated && strcmp(cmd, "SECURITY") == 0 && arg) {
            user_validated = amindexd_debug ||
                                check_security(
-                                       (struct sockaddr_storage *)&his_addr,
+                                       (sockaddr_union *)&his_addr,
                                        arg, 0, &errstr);
            if(user_validated) {
                reply(200, _("Access OK"));
index ea81c624de7bb8e2a60a8fd4000e5cd974a2b445..5e6c1ef45c7619ec9bb761fe871494d8714a5e5f 100644 (file)
@@ -757,7 +757,7 @@ databuf_flush(
 
        file.type = save_type;
        strncpy(file.cont_filename, new_filename, SIZEOF(file.cont_filename));
-       file.cont_filename[SIZEOF(file.cont_filename)] = '\0';
+       file.cont_filename[SIZEOF(file.cont_filename)-1] = '\0';
        if(write_tapeheader(db->fd, &file)) {
            errstr = squotef(_("write_tapeheader file \"%s\": %s"),
                             db->filename,
index ef877f3fa22eef37016fd1b5ea98f11ffefc5c6e..e9504edceb4597029173eafb477fcf734914603a 100644 (file)
@@ -480,10 +480,12 @@ main(
     while(!empty(directq) && taper > 0) {
        diskp = dequeue_disk(&directq);
        if (diskp->to_holdingdisk == HOLD_REQUIRED) {
+           char *qname = quote_string(diskp->name);
            log_add(L_FAIL, _("%s %s %s %d [%s]"),
-               diskp->host->hostname, diskp->name, sched(diskp)->datestamp,
+               diskp->host->hostname, qname, sched(diskp)->datestamp,
                sched(diskp)->level,
                _("can't dump required holdingdisk"));
+           amfree(qname);
        }
        else if (!degraded_mode) {
            taper_state |= TAPER_STATE_DUMP_TO_TAPE;
@@ -491,13 +493,16 @@ main(
            event_loop(0);
            taper_state &= !TAPER_STATE_DUMP_TO_TAPE;
        }
-       else
+       else {
+           char *qname = quote_string(diskp->name);
            log_add(L_FAIL, _("%s %s %s %d [%s]"),
-               diskp->host->hostname, diskp->name, sched(diskp)->datestamp,
+               diskp->host->hostname, qname, sched(diskp)->datestamp,
                sched(diskp)->level,
                diskp->to_holdingdisk == HOLD_AUTO ?
                    _("no more holding disk space") :
                    _("can't dump no-hold disk in degraded mode"));
+           amfree(qname);
+       }
     }
 
     /* fill up the tape or start new one for taperflush */
@@ -1029,9 +1034,11 @@ start_some_dumps(
            if(cmd != PORT) {
                assignedhd_t **h=NULL;
                int activehd;
+               char *qname = quote_string(diskp->name);
 
                g_printf(_("driver: did not get PORT from %s for %s:%s\n"),
-                      chunker->name, diskp->host->hostname, diskp->name);
+                      chunker->name, diskp->host->hostname, qname);
+               amfree(qname);
                fflush(stdout);
 
                deallocate_bandwidth(diskp->host->netif, sched(diskp)->est_kps);
@@ -1291,8 +1298,10 @@ handle_taper_result(
             if (!taper_dumper)
                 free_serial(result_argv[2]);
 
+           qname = quote_string(dp->name);
            g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
-                  walltime_str(curclock()), dp->host->hostname, dp->name);
+                  walltime_str(curclock()), dp->host->hostname, qname);
+           amfree(qname);
            fflush(stdout);
 
            if (strcmp(result_argv[3], "INPUT-ERROR") == 0) {
@@ -1394,8 +1403,10 @@ handle_taper_result(
             dp = serial2disk(result_argv[2]);
            if (!taper_dumper)
                free_serial(result_argv[2]);
+           qname = quote_string(dp->name);
             g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
-                   walltime_str(curclock()), dp->host->hostname, dp->name);
+                   walltime_str(curclock()), dp->host->hostname, qname);
+           amfree(qname);
             fflush(stdout);
             log_add(L_WARNING, _("Taper  error: %s"), result_argv[3]);
            taper_tape_error = stralloc(result_argv[3]);
@@ -1455,6 +1466,8 @@ static void
 file_taper_result(
     disk_t *dp)
 {
+    char *qname = quote_string(dp->name);
+
     if (taper_result == DONE) {
        update_info_taper(dp, taper_first_label, taper_first_fileno,
                          sched(dp)->level);
@@ -1464,14 +1477,14 @@ file_taper_result(
 
     if (taper_input_error) {
        g_printf("driver: taper failed %s %s: %s\n",
-                  dp->host->hostname, dp->name, taper_input_error);
+                  dp->host->hostname, qname, taper_input_error);
        if (strcmp(sched(dp)->datestamp, driver_timestamp) == 0) {
            if(sched(dp)->taper_attempted >= 2) {
                log_add(L_FAIL, _("%s %s %s %d [too many taper retries after holding disk error: %s]"),
-                   dp->host->hostname, dp->name, sched(dp)->datestamp,
+                   dp->host->hostname, qname, sched(dp)->datestamp,
                    sched(dp)->level, taper_input_error);
                g_printf("driver: taper failed %s %s, too many taper retry after holding disk error\n",
-                  dp->host->hostname, dp->name);
+                  dp->host->hostname, qname);
                amfree(sched(dp)->destname);
                amfree(sched(dp)->dumpdate);
                amfree(sched(dp)->degr_dumpdate);
@@ -1479,10 +1492,10 @@ file_taper_result(
                amfree(dp->up);
            } else {
                log_add(L_INFO, _("%s %s %s %d [Will retry dump because of holding disk error: %s]"),
-                       dp->host->hostname, dp->name, sched(dp)->datestamp,
+                       dp->host->hostname, qname, sched(dp)->datestamp,
                        sched(dp)->level, taper_input_error);
                g_printf("driver: taper will retry %s %s because of holding disk error\n",
-                       dp->host->hostname, dp->name);
+                       dp->host->hostname, qname);
                if (dp->to_holdingdisk != HOLD_REQUIRED) {
                    dp->to_holdingdisk = HOLD_NEVER;
                    sched(dp)->dump_attempted -= 1;
@@ -1505,10 +1518,10 @@ file_taper_result(
     } else if (taper_tape_error) {
        if(sched(dp)->taper_attempted >= 2) {
            log_add(L_FAIL, _("%s %s %s %d [too many taper retries]"),
-                   dp->host->hostname, dp->name, sched(dp)->datestamp,
+                   dp->host->hostname, qname, sched(dp)->datestamp,
                    sched(dp)->level);
            g_printf("driver: taper failed %s %s, too many taper retry\n",
-                  dp->host->hostname, dp->name);
+                  dp->host->hostname, qname);
            amfree(sched(dp)->destname);
            amfree(sched(dp)->dumpdate);
            amfree(sched(dp)->degr_dumpdate);
@@ -1516,7 +1529,7 @@ file_taper_result(
            amfree(dp->up);
        } else {
            g_printf("driver: taper will retry %s %s\n",
-                  dp->host->hostname, dp->name);
+                  dp->host->hostname, qname);
            /* Re-insert into taper queue. */
            headqueue_disk(&tapeq, dp);
        }
@@ -1529,6 +1542,8 @@ file_taper_result(
        amfree(dp->up);
     }
 
+    amfree(qname);
+
     taper_busy = 0;
     taper_input_error = NULL;
     taper_tape_error = NULL;
@@ -1757,12 +1772,14 @@ handle_dumper_result(
             * case for cleanup.
             */
            if(sched(dp)->dump_attempted) {
+               char *qname = quote_string(dp->name);
                log_add(L_FAIL, _("%s %s %s %d [too many dumper retry: %s]"),
-                   dp->host->hostname, dp->name, sched(dp)->datestamp,
+                   dp->host->hostname, qname, sched(dp)->datestamp,
                    sched(dp)->level, result_argv[3]);
                g_printf(_("driver: dump failed %s %s %s, too many dumper retry: %s\n"),
-                       result_argv[2], dp->host->hostname, dp->name,
+                       result_argv[2], dp->host->hostname, qname,
                        result_argv[3]);
+               amfree(qname);
            }
            /* FALLTHROUGH */
        case FAILED: /* FAILED <handle> <errstr> */
index 17497f897e5c6eed0dd25ab4d09334d9b5cd6cc9..6f0e248678157a65224dff3e8d92f3fdd760acf1 100644 (file)
@@ -1002,9 +1002,10 @@ output_stats(void)
 static void
 output_tapeinfo(void)
 {
-    tape_t *tp, *lasttp;
+    tape_t *tp;
     int run_tapes;
     int skip = 0;
+    int i, nb_new_tape;
 
     if (last_run_tapes > 0) {
        if(amflush_run)
@@ -1068,53 +1069,36 @@ output_tapeinfo(void)
     else if(run_tapes > 1)
        g_fprintf(mailf, _("The next %d tapes Amanda expects to use are: "),
                run_tapes);
-    
-    while(run_tapes > 0) {
+
+    nb_new_tape = 0;
+    for (i=0 ; i < run_tapes ; i++) {
        if(tp != NULL) {
+           if (nb_new_tape > 0) {
+               if (nb_new_tape == 1)
+                   g_fprintf(mailf, _("1 new tape, "));
+               else
+                   g_fprintf(mailf, _("%d new tapes, "), nb_new_tape);
+               nb_new_tape = 0;
+           }
            g_fprintf(mailf, "%s", tp->label);
+           if (i < run_tapes-1) fputs(", ", mailf);
        } else {
-           if (run_tapes == 1)
-               g_fprintf(mailf, _("a new tape"));
-           else
-               g_fprintf(mailf, _("%d new tapes"), run_tapes);
-           run_tapes = 1;
+           nb_new_tape++;
        }
-
-       if(run_tapes > 1) fputs(", ", mailf);
-
-       run_tapes -= 1;
        skip++;
+
        tp = lookup_last_reusable_tape(skip);
     }
+    if (nb_new_tape > 0) {
+       if (nb_new_tape == 1)
+           g_fprintf(mailf, _("1 new tape"));
+       else
+           g_fprintf(mailf, _("%d new tapes"), nb_new_tape);
+    }
     fputs(".\n", mailf);
 
-    lasttp = lookup_tapepos(lookup_nb_tape());
     run_tapes = getconf_int(CNF_RUNTAPES);
-    if(lasttp && run_tapes > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-       int c = 0;
-       while(lasttp && run_tapes > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-           c++;
-           lasttp = lasttp->prev;
-           run_tapes--;
-       }
-       lasttp = lookup_tapepos(lookup_nb_tape());
-       if(c == 1) {
-           g_fprintf(mailf, _("The next new tape already labelled is: %s.\n"),
-                   lasttp->label);
-       }
-       else {
-           g_fprintf(mailf, _("The next %d new tapes already labelled are: %s"), c,
-                   lasttp->label);
-           lasttp = lasttp->prev;
-           c--;
-           while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-               g_fprintf(mailf, ", %s", lasttp->label);
-               lasttp = lasttp->prev;
-               c--;
-           }
-           g_fprintf(mailf, ".\n");
-       }
-    }
+    print_new_tapes(mailf, run_tapes);
 }
 
 /* ----- */
@@ -2386,7 +2370,12 @@ handle_success(
 
     i = level > 0;
 
-    if(origkb < 0.0) {
+    if (origkb < 0.0 && (curprog == P_CHUNKER || curprog == P_TAPER) &&
+       isnormal(repdata->dumper.outsize)) {
+       /* take origkb from DUMPER line */
+       origkb = repdata->dumper.outsize;
+    } else if (origkb < 0.0) {
+       /* take origkb from infofile, needed for amflush */
        info_t inf;
        struct tm *tm;
        int Idatestamp;
@@ -2441,6 +2430,8 @@ handle_success(
        if(!isnormal(repdata->chunker.outsize) && isnormal(repdata->dumper.outsize)) { /* dump to tape */
            stats[i].outsize += kbytes;
            if (abs(kbytes - origkb) >= 32) {
+               /* server compressed */
+               stats[i].corigsize += origkb;
                stats[i].coutsize += kbytes;
            }
        }
@@ -2450,10 +2441,13 @@ handle_success(
     if(curprog == P_DUMPER) {
        stats[i].dumper_time += sec;
        if (abs(kbytes - origkb) < 32) {
+           /* not client compressed */
            sp->origsize = kbytes;
        }
        else {
+           /* client compressed */
            stats[i].corigsize += sp->origsize;
+           stats[i].coutsize += kbytes;
        }
        dumpdisks[level] +=1;
        stats[i].dumpdisks +=1;
@@ -2464,6 +2458,8 @@ handle_success(
        sp->outsize = kbytes;
        stats[i].outsize += kbytes;
        if (abs(kbytes - origkb) >= 32) {
+           /* server compressed */
+           stats[i].corigsize += origkb;
            stats[i].coutsize += kbytes;
        }
     }
index ce120d06647ed2e0ae3016d93aea93a23b0d0b89..9a9cf3d5f4498b9ec0f0d53c5ebee516d680e1e5 100644 (file)
@@ -443,3 +443,49 @@ stamp2time(
 
     return mktime(tm);
 }
+
+void
+print_new_tapes(
+    FILE *output,
+    int   nb)
+{
+    tape_t *lasttp, *iter;
+
+    /* Find latest reusable new tape */
+    lasttp = lookup_tapepos(lookup_nb_tape());
+    while (lasttp && lasttp->reuse == 0)
+       lasttp = lasttp->prev;
+
+    if(lasttp && nb > 0 && strcmp(lasttp->datestamp,"0") == 0) {
+       int c = 0;
+       iter = lasttp;
+       /* count the number of tapes we *actually* used */
+       while(iter && nb > 0 && strcmp(iter->datestamp,"0") == 0) {
+           if (iter->reuse) {
+               c++;
+               nb--;
+           }
+           iter = iter->prev;
+       }
+
+       if(c == 1) {
+           g_fprintf(output,
+                     _("The next new tape already labelled is: %s.\n"),
+                     lasttp->label);
+       } else {
+           g_fprintf(output,
+                     _("The next %d new tapes already labelled are: %s"),
+                     c, lasttp->label);
+           iter = lasttp->prev;
+           c--;
+           while(iter && c > 0 && strcmp(iter->datestamp,"0") == 0) {
+               if (iter->reuse) {
+                   g_fprintf(output, ", %s", iter->label);
+                   c--;
+               }
+               iter = iter->prev;
+           }
+           g_fprintf(output, ".\n");
+       }
+    }
+}
index 6d8fdb97c9e0c1802279788d76a67a8499a483a2..a90da570fe15da8cbd501ac5bab109440b7c4ec6 100644 (file)
@@ -55,5 +55,6 @@ tape_t *add_tapelabel(char *datestamp, char *label);
 int reusable_tape(tape_t *tp);
 
 int guess_runs_from_tapelist(void);
+void print_new_tapes(FILE *output, int nb);
 
 #endif /* !TAPEFILE_H */
index 4b54430c2ee4add5766afc24ae42360d268eebba..d5b72af25578559da2f06619a78911551d6060ce 100644 (file)
@@ -394,6 +394,39 @@ static gboolean check_volume_changed(Device * device,
     return FALSE;
 }
 
+static void
+update_tapelist(
+    taper_state_t *state)
+{
+    char *tapelist_name = NULL;
+    char *tapelist_name_old = NULL;
+
+    tapelist_name = config_dir_relative(getconf_str(CNF_TAPELIST));
+    if (state->cur_tape == 0) {
+       tapelist_name_old = stralloc2(tapelist_name, ".yesterday");
+    } else {
+       char cur_str[NUM_STR_SIZE];
+       g_snprintf(cur_str, SIZEOF(cur_str), "%d", state->cur_tape - 1);
+       tapelist_name_old = vstralloc(tapelist_name,
+                                     ".today.", cur_str, NULL);
+    }
+
+    if (write_tapelist(tapelist_name_old)) {
+       error("could not write tapelist: %s", strerror(errno));
+       /*NOTREACHED*/
+    }
+    amfree(tapelist_name_old);
+
+    remove_tapelabel(state->device->volume_label);
+    add_tapelabel(state->driver_start_time,
+                  state->device->volume_label);
+    if (write_tapelist(tapelist_name)) {
+       error("could not write tapelist: %s", strerror(errno));
+       /*NOTREACHED*/
+    }
+    amfree(tapelist_name);
+}
+
 /* Find and label a new tape, if one is not already open. Returns TRUE
  * if a tape could be written. */
 static gboolean find_and_label_new_tape(taper_state_t * state,
@@ -410,10 +443,11 @@ static gboolean find_and_label_new_tape(taper_state_t * state,
 }
 
 static gboolean label_new_tape(taper_state_t * state, dump_info_t * dump_info) {
-    char *tapelist_name;
-    char *tapelist_name_old;
-    char * old_volume_name;
-    char * old_volume_time;
+    char *old_volume_name = NULL;
+    char *old_volume_time = NULL;
+    tape_search_request_t request;
+    gboolean search_result;
+    ReadLabelStatusFlags status;
 
     /* If we got here, it means that we have found a tape to label and
      * have gotten permission from the driver to write it. But we
@@ -422,104 +456,54 @@ static gboolean label_new_tape(taper_state_t * state, dump_info_t * dump_info) {
 
     state->device = device_open(state->next_tape_device);
     amfree(state->next_tape_device);
-    if (state->device == NULL) {
-        amfree(state->next_tape_label);
-        return FALSE;
-    }
-    
+    if (state->device == NULL)
+       goto skip_volume;
+
     device_set_startup_properties_from_config(state->device);
-    device_read_label(state->device);
+
+    /* if we have an error, and are sure it isn't just an unlabeled volume,
+     * then skip this volume */
+    status = device_read_label(state->device);
+    if ((status & ~READ_LABEL_STATUS_VOLUME_UNLABELED) &&
+       !(status & READ_LABEL_STATUS_VOLUME_UNLABELED))
+       goto skip_volume;
+
     old_volume_name = g_strdup(state->device->volume_label);
     old_volume_time = g_strdup(state->device->volume_time);
-    
+
     if (!device_start(state->device, ACCESS_WRITE, state->next_tape_label,
                       state->driver_start_time)) {
         gboolean tape_used;
+
         /* Something broke, see if we can tell if the volume was erased or
          * not. */
         g_fprintf(stderr, "taper: Error writing label %s to device %s.\n",
                 state->next_tape_label, state->device->device_name);
-        device_finish(state->device);
-        device_read_label(state->device);
+
+        if (!device_finish(state->device))
+           goto request_new_volume;
+
+       /* This time, if we can't read the label, assume we've overwritten
+        * the volume or otherwise corrupted it */
+       status = device_read_label(state->device);
+       if ((status & ~READ_LABEL_STATUS_VOLUME_UNLABELED) &&
+           !(status & READ_LABEL_STATUS_VOLUME_UNLABELED))
+           goto request_new_volume;
+
         tape_used = check_volume_changed(state->device, old_volume_name, 
                                          old_volume_time);
-        g_object_unref(state->device);
-        state->device = NULL;
-        amfree(state->next_tape_label);
-        /* If the volume was written, we tell the driver and then immediately
-         * try again. */
         if (tape_used) {
-            putresult(NEW_TAPE, "%s %s\n", dump_info->handle,
-                     state->device->volume_label);
-            if (old_volume_name) {
-                log_add(L_WARNING, "Problem writing label to volume %s, "
-                        "volume may be erased.\n", old_volume_name);
-            } else {
-                log_add(L_WARNING, "Problem writing label %s to new volume, "
-                        "volume may be erased.\n", state->next_tape_label);
-            }
-            amfree(old_volume_name);
-            amfree(old_volume_time);
-            return find_and_label_new_tape(state, dump_info);
+           goto request_new_volume;
         } else {
-            /* Otherwise, we grab a new tape without talking to the driver
-             * again. */
-            tape_search_request_t request;
-            gboolean search_result;
-            if (old_volume_name) {
-                log_add(L_WARNING, "Problem writing label to volume %s, "
-                        "old volume data intact\n", old_volume_name);
-            } else {
-                log_add(L_WARNING, "Problem writing label %s to new volume, "
-                        "old volume data intact\n", state->next_tape_label);
-            }
-            amfree(old_volume_name);
-            amfree(old_volume_time);
-            request.state = state;
-            request.prolong = TRUE;
-            request.errmsg = NULL;
-            search_result = GPOINTER_TO_INT(tape_search_thread(&request));
-            if (search_result) {
-                amfree(request.errmsg);
-                return label_new_tape(state, dump_info);
-            } else {
-                /* Problem finding a new tape! */
-                log_taper_scan_errmsg(request.errmsg);
-                putresult(NO_NEW_TAPE, "%s\n", dump_info->handle);
-                return FALSE;
-            }
+           goto skip_volume;
         }
-    } else {
-       amfree(old_volume_name);
-       amfree(old_volume_time);
     }
 
+    amfree(old_volume_name);
+    amfree(old_volume_time);
     amfree(state->next_tape_label);
 
-    tapelist_name = config_dir_relative(getconf_str(CNF_TAPELIST));
-    if (state->cur_tape == 0) {
-       tapelist_name_old = stralloc2(tapelist_name, ".yesterday");
-    } else {
-       char cur_str[NUM_STR_SIZE];
-       g_snprintf(cur_str, SIZEOF(cur_str), "%d", state->cur_tape - 1);
-       tapelist_name_old = vstralloc(tapelist_name,
-                                     ".today.", cur_str, NULL);
-    }
-
-    if (write_tapelist(tapelist_name_old)) {
-       error("could not write tapelist: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-    amfree(tapelist_name_old);
-
-    remove_tapelabel(state->device->volume_label);
-    add_tapelabel(state->driver_start_time,
-                  state->device->volume_label);
-    if (write_tapelist(tapelist_name)) {
-       error("could not write tapelist: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-    amfree(tapelist_name);
+    update_tapelist(state);
     state->cur_tape++;
 
     log_add(L_START, "datestamp %s label %s tape %d",
@@ -529,6 +513,66 @@ static gboolean label_new_tape(taper_state_t * state, dump_info_t * dump_info) {
              state->device->volume_label);
 
     return TRUE;
+
+request_new_volume:
+    /* Tell the driver we overwrote this volume, even if it was empty, and request
+     * a new volume. */
+    if (state->device) {
+        g_object_unref(state->device);
+        state->device = NULL;
+    }
+
+    putresult(NEW_TAPE, "%s %s\n", dump_info->handle,
+             state->next_tape_label);
+    if (old_volume_name) {
+       log_add(L_WARNING, "Problem writing label '%s' to volume %s, "
+               "volume may be erased.\n",
+               state->next_tape_label, old_volume_name);
+    } else {
+       log_add(L_WARNING, "Problem writing label '%s' to new volume, "
+               "volume may be erased.\n", state->next_tape_label);
+    }
+
+    amfree(state->next_tape_label);
+    amfree(old_volume_name);
+    amfree(old_volume_time);
+
+    return find_and_label_new_tape(state, dump_info);
+
+skip_volume:
+    /* grab a new volume without talking to the driver again -- we do this if we're
+     * confident we didn't overwrite the last tape we got. */
+    if (state->device) {
+        g_object_unref(state->device);
+        state->device = NULL;
+    }
+
+    if (old_volume_name) {
+       log_add(L_WARNING, "Problem writing label '%s' to volume '%s', "
+               "old volume data intact\n",
+               state->next_tape_label, old_volume_name);
+    } else {
+       log_add(L_WARNING, "Problem writing label '%s' to new volume, "
+               "old volume data intact\n", state->next_tape_label);
+    }
+
+    amfree(state->next_tape_label);
+    amfree(old_volume_name);
+    amfree(old_volume_time);
+
+    request.state = state;
+    request.prolong = TRUE;
+    request.errmsg = NULL;
+    search_result = GPOINTER_TO_INT(tape_search_thread(&request));
+    if (search_result) {
+       amfree(request.errmsg);
+       return label_new_tape(state, dump_info);
+    } else {
+       /* Problem finding a new tape! */
+       log_taper_scan_errmsg(request.errmsg);
+       putresult(NO_NEW_TAPE, "%s\n", dump_info->handle);
+       return FALSE;
+    }
 }
 
 /* Find out if the dump is PARTIAL or not, and set the proper driver
index 456e0c340c8962cf9c8181d36a85b0bb2c6842b7..4a0c8acb5886a8c08ccd54b543eb5c6940ca2de2 100644 (file)
@@ -86,6 +86,7 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
        $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
        $(top_srcdir)/config/amanda/swig.m4 \