Merge tag 'upstream/3.3.2'
authorBdale Garbee <bdale@gag.com>
Mon, 8 Oct 2012 23:48:35 +0000 (17:48 -0600)
committerBdale Garbee <bdale@gag.com>
Mon, 8 Oct 2012 23:48:35 +0000 (17:48 -0600)
Upstream version 3.3.2

Conflicts:
common-src/glib-util.c
perl/Amanda/Header.pm

1  2 
client-src/selfcheck.c
common-src/glib-util.c
debian/patches/series
man/amanda.conf.5
man/disklist.5
man/xml-source/amanda.conf.5.xml
man/xml-source/disklist.5.xml
server-src/diskfile.h

diff --combined client-src/selfcheck.c
index 04e824896688bf2586de692426d52b30e5a26a1a,8cd7b539361b8f7d7fe9c004e0694950e8c75133..746093b571367d0f70803533ddd781cc1eaefdc0
@@@ -95,7 -95,7 +95,7 @@@ main
      dle_t *dle;
      int level;
      GSList *errlist;
-     level_t *alevel;
+     am_level_t *alevel;
  
      if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) {
        printf("selfcheck-%s\n", VERSION);
        if (ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
            goto err;                           /* bad level */
        }
-       alevel = g_new0(level_t, 1);
+       alevel = g_new0(am_level_t, 1);
        alevel->level = level;
        dle->levellist = g_slist_append(dle->levellist, alevel);
        skip_integer(s, ch);
@@@ -1137,8 -1137,8 +1137,8 @@@ check_overall(void
        check_file(COMPRESS_PATH, X_OK);
  
      if (need_dump || need_xfsdump ) {
 -      if (check_file_exist("/etc/dumpdates")) {
 -          check_file("/etc/dumpdates",
 +      if (check_file_exist("/var/lib/dumpdates")) {
 +          check_file("/var/lib/dumpdates",
  #ifdef USE_RUNDUMP
                       F_OK
  #else
        } else {
  #ifndef USE_RUNDUMP
            if (access("/etc", R_OK|W_OK) == -1) {
 -              g_printf(_("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n"), strerror(errno));
 +              g_printf(_("ERROR [dump will not be able to create the /var/lib/dumpdates file: %s]\n"), strerror(errno));
            }
  #endif
        }
      }
  
      if (need_vdump) {
 -      if (check_file_exist("/etc/vdumpdates")) {
 -            check_file("/etc/vdumpdates", F_OK);
 +      if (check_file_exist("/var/lib/vdumpdates")) {
 +            check_file("/var/lib/vdumpdates", F_OK);
        }
      }
  
      check_space(AMANDA_DBGDIR, (off_t)64);    /* for amandad i/o */
  #endif
  
 +    check_space("/var/lib", (off_t)64);               /* for /var/lib/dumpdates writing */
      check_space("/etc", (off_t)64);           /* for /etc/dumpdates writing */
      }
  }
diff --combined common-src/glib-util.c
index 99f55f7aa8a91824fbb2d9202dc4fcc2fa1b9f3e,9fd8ced967bae8b91086e4c752a751523834c371..a20d7459d0992af0b5db590a8906b167c32f13c0
@@@ -1,5 -1,5 +1,5 @@@
  /*
-  * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+  * Copyright (c) 2007-2012 Zmanda, Inc.  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
  
  #ifdef HAVE_LIBCURL
  #include <curl/curl.h>
- #endif
+ #ifdef LIBCURL_USE_OPENSSL
+ #include <openssl/crypto.h>
+ static GMutex **openssl_mutex_array;
+ static void openssl_lock_callback(int mode, int type, const char *file, int line)
+ {
+     (void)file;
+     (void)line;
+     if (mode & CRYPTO_LOCK) {
+       g_mutex_lock(openssl_mutex_array[type]);
+     }
+     else {
+       g_mutex_unlock(openssl_mutex_array[type]);
+     }
+ }
+ static void
+ init_ssl(void)
+ {
+     int i;
+     openssl_mutex_array = g_new0(GMutex *, CRYPTO_num_locks());
+     for (i=0; i<CRYPTO_num_locks(); i++) {
+       openssl_mutex_array[i] = g_mutex_new();
+     }
+     CRYPTO_set_locking_callback(openssl_lock_callback);
+ }
+ #else /* LIBCURL_USE_OPENSSL */
+ #if defined LIBCURL_USE_GNUTLS
+ #include <gcrypt.h>
+ #include <errno.h>
+ GCRY_THREAD_OPTION_PTHREAD_IMPL;
+ static void
+ init_ssl(void)
+ {
+   gcry_control(GCRYCTL_SET_THREAD_CBS);
+ }
+ #else /* LIBCURL_USE_GNUTLS  */
+ static void
+ init_ssl(void)
+ {
+ }
+ #endif        /* LIBCURL_USE_GNUTLS  */
+ #endif  /* LIBCURL_USE_OPENSSL */
+ #else /* HAVE_LIBCURL */
+ static void
+ init_ssl(void)
+ {
+ }
+ #endif /* HAVE_LIBCURL */
  
  void
  glib_init(void) {
      if (did_glib_init) return;
      did_glib_init = TRUE;
  
 -    /* set up libcurl (this must happen before threading 
 -     * is initialized) */
 +    /* set up libcurl */
  #ifdef HAVE_LIBCURL
+ # ifdef G_THREADS_ENABLED
+ #  if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31))
+     g_assert(!g_thread_supported()); /* assert threads aren't initialized yet */
+ #  endif
+ # endif
      g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0);
  #endif
  
      /* Initialize glib's type system.  On glib >= 2.24, this will initialize
       * threads, so it must be done after curl is initialized. */
      g_type_init();
+     /* And set up glib's threads */
+ #if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
+     if (!g_thread_supported())
+       g_thread_init(NULL);
+ #endif
+     /* initialize ssl */
+     init_ssl();
  }
  
  typedef enum {
diff --combined debian/patches/series
index 9394693638ce5fd0481649662c1f41cab13491e1,0000000000000000000000000000000000000000..de4e07db022f340c8d55b7a7998a0ba178f61748
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,3 @@@
- VTAPES-access.diff
 +dumpdates-path
 +glib-2.32.patch
 +kfreebsd-ftbfs.diff
diff --combined man/amanda.conf.5
index a412d96eadf4f42fe54e9f304538fc86d0acba68,d71edaeabe2212fa2c12b068f3141e6cb929c429..a909f2047ffec4bf161f7ea602c8fca6c35223fd
@@@ -2,12 -2,12 +2,12 @@@
  .\"     Title: amanda.conf
  .\"    Author: James da Silva <jds@amanda.org>
  .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
- .\"      Date: 02/21/2012
+ .\"      Date: 07/25/2012
  .\"    Manual: File formats and conventions
- .\"    Source: Amanda 3.3.1
+ .\"    Source: Amanda 3.3.2
  .\"  Language: English
  .\"
- .TH "AMANDA\&.CONF" "5" "02/21/2012" "Amanda 3\&.3\&.1" "File formats and conventions"
+ .TH "AMANDA\&.CONF" "5" "07/25/2012" "Amanda 3\&.3\&.2" "File formats and conventions"
  .\" -----------------------------------------------------------------
  .\" * Define some portability stuff
  .\" -----------------------------------------------------------------
@@@ -887,7 -887,7 +887,7 @@@ setting\&
  .PP
  \fBcolumnspec\fR \fIstring\fR
  .RS 4
- default: "HostName=0:12:12,Disk=1:11:11,Level=1:1:1,OrigKB=1:\-7:0,OutKB=1:\-7:0,Compress=1:\-6:1,DumpTime=1:\-7:7,Dumprate=1:\-6:1,TapeTime=1:\-6:6,TapeRate=1:\-6:1"
+ default: "HostName=0:\-12:12,Disk=1:\-11:11,Level=1:\-1:1,OrigKB=1:\-7:0,OutKB=1:\-7:0,Compress=1:\-6:1,DumpTime=1:\-7:7,Dumprate=1:\-6:1,TapeTime=1:\-6:6,TapeRate=1:\-6:1"
  .sp
  Defines the width of columns
  \fBamreport\fR
@@@ -1130,6 -1130,11 +1130,11 @@@ The error messages that appear in amrec
  .sp
  Recovery limits can be refined on a per\-DLE basis using the dumptype parameter of the same name\&. Note that the default value will apply to any dumpfiles for disks which no longer appear in the disklist; thus leaving the global parameter at its default value but setting it for all DLEs is not sufficient to maintain secure backups\&.
  .RE
+ .PP
+ \fBtmpdir\fR \fIstring\fR
+ .RS 4
+ Default: none (system default)\&. Set it to a directory with lots of free space if sort in amindexd fail with \*(AqNo space left on device\*(Aq\&.
+ .RE
  .SH "HOLDINGDISK SECTION"
  .PP
  The
@@@ -1650,6 -1655,12 +1655,12 @@@ Default
  \fI10000\fR\&. The maximum number of day for a promotion, set it 0 if you don\*(Aqt want promotion, set it to 1 or 2 if your disks get overpromoted\&.
  .RE
  .PP
+ \fBmax\-warnings\fR \fIint\fR
+ .RS 4
+ Default:
+ \fI20\fR\&. The maximum number of error lines in the report for a dle\&. A value of \*(Aq0\*(Aq means unlimited\&. This is useful to reduce the size of the log file and the size of the report\&. All errors are put in separate files if a dle have more errors\&.
+ .RE
+ .PP
  \fBpriority\fR [ \fBlow\fR | \fBmedium\fR | \fBhigh\fR ]
  .RS 4
  Default:
@@@ -1702,8 -1713,8 +1713,8 @@@ keyword append the values to the list o
  \fBrecord\fR \fIboolean\fR
  .RS 4
  Default:
 -\fByes\fR\&. Whether to ask the backup program to update its database (e\&.g\&.
 -/etc/dumpdates
 +\fIyes\fR\&. Whether to ask the backup program to update its database (e\&.g\&.
 +/var/lib/dumpdates
  for DUMP or
  /usr/local/var/amanda/gnutar\-lists
  for GNUTAR) of time stamps\&. This is normally enabled for daily backups and turned off for periodic archival runs\&.
@@@ -2443,7 -2454,7 +2454,7 @@@ Default: not set\&. A comment string de
  \fBplugin\fR \fIstring\fR
  .RS 4
  No default\&. Must be set to the name of the taperscan module\&. See
- <man></man>
+ \fBamanda-taperscan\fR(7)
  for a list of defined taperscan modules\&.
  .RE
  .PP
diff --combined man/disklist.5
index 915248b571aa86444ba0dda491174017c0990a46,83d9687ff7efcb67392753f4661e418ab7f9ee84..6200b136465ded1387d9d1e35ae5482ceee72a25
@@@ -2,12 -2,12 +2,12 @@@
  .\"     Title: disklist
  .\"    Author: James da Silva <jds@amanda.org>
  .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
- .\"      Date: 02/21/2012
+ .\"      Date: 07/25/2012
  .\"    Manual: File formats and conventions
- .\"    Source: Amanda 3.3.1
+ .\"    Source: Amanda 3.3.2
  .\"  Language: English
  .\"
- .TH "DISKLIST" "5" "02/21/2012" "Amanda 3\&.3\&.1" "File formats and conventions"
+ .TH "DISKLIST" "5" "07/25/2012" "Amanda 3\&.3\&.2" "File formats and conventions"
  .\" -----------------------------------------------------------------
  .\" * Define some portability stuff
  .\" -----------------------------------------------------------------
@@@ -33,7 -33,19 +33,19 @@@ disklist \- List of partitions to back 
  .PP
  The
  \fIdisklist\fR
- file determines which disks will be backed up by Amanda\&. The file usually contains one line per disk:
+ file determines which disks will be backed up by Amanda\&. The file contains
+ \fBincludefile\fR
+ directive or disklist entry (\fBDLE\fR)\&.
+ .PP
+ \fBincludefile\fR \fIstring\fR
+ .RS 4
+ Default:
+ \fIno default\fR\&. The name of a disklist file to include within the current file\&. Useful for sharing disklist among several configurations\&. Relative pathnames are relative to the configuration directory\&.
+ .RE
+ .PP
+ A
+ \fBDLE\fR
+ usually contains one line per disk:
  .nf
  \fIhostname diskname\fR [\fIdiskdevice\fR] \fIdumptype\fR [\fIspindle\fR [\fIinterface\fR] ]
  .fi
@@@ -98,7 -110,7 +110,7 @@@ defined in th
  \fBamanda\&.conf\fR
  file\&.
  \fIDumptype\fRs specify backup related parameters, such as whether to compress the backups, whether to record backup results in
 -/etc/dumpdates, the disk\*(Aqs relative priority, etc\&.
 +/var/lib/dumpdates, the disk\*(Aqs relative priority, etc\&.
  .RE
  .PP
  \fIspindle\fR
index cb33c5fefa9ca15a2c9c9262c2e0b87b9b4fdd9e,e8d1fc091597c716e6024c9657eb25e279cf27d4..f986fb476ac4d3f8bd732c4541178c943f9159dd
@@@ -1159,7 -1159,7 +1159,7 @@@ is the same as the <amkeyword>amrecover
    <varlistentry>
    <term><amkeyword>columnspec</amkeyword> <amtype>string</amtype></term>
    <listitem>
- <para> default: "HostName=0:12:12,Disk=1:11:11,Level=1:1:1,OrigKB=1:-7:0,OutKB=1:-7:0,Compress=1:-6:1,DumpTime=1:-7:7,Dumprate=1:-6:1,TapeTime=1:-6:6,TapeRate=1:-6:1"</para>
+ <para> default: "HostName=0:-12:12,Disk=1:-11:11,Level=1:-1:1,OrigKB=1:-7:0,OutKB=1:-7:0,Compress=1:-6:1,DumpTime=1:-7:7,Dumprate=1:-6:1,TapeTime=1:-6:6,TapeRate=1:-6:1"</para>
  <para>Defines the width of columns <emphasis remap='B'>amreport</emphasis>
  should use.
  <emphasis remap='I'>String</emphasis>
@@@ -1465,6 -1465,13 +1465,13 @@@ Range is inclusive.</para
    </listitem>
    </varlistentry>
  
+   <varlistentry>
+   <term><amkeyword>tmpdir</amkeyword> <amtype>string</amtype></term>
+   <listitem>
+ <para>Default: none (system default).  Set it to a directory with lots of free
+ space if sort in amindexd fail with 'No space left on device'.</para>
+   </listitem>
+   </varlistentry>
  </variablelist>
  </refsect1>
  
@@@ -2114,6 -2121,17 +2121,17 @@@ See also the main section parameter <am
  <amdefault>10000</amdefault>.
  The maximum number of day for a promotion, set it 0 if you don't want
  promotion, set it to 1 or 2 if your disks get overpromoted.</para>
+   </listitem>
+   </varlistentry>
+   <varlistentry>
+   <term><amkeyword>max-warnings</amkeyword> <amtype>int</amtype></term>
+   <listitem>
+ <para>Default:
+ <amdefault>20</amdefault>.
+ The maximum number of error lines in the report for a dle. A value of '0'
+ means unlimited. This is useful to reduce the size of the log file and the
+ size of the report. All errors are put in separate files if a dle have more
+ errors.</para>
    </listitem>
    </varlistentry>
    <varlistentry>
@@@ -2182,8 -2200,8 +2200,8 @@@ the property to set, and the others con
    <term><amkeyword>record</amkeyword> <amtype>boolean</amtype></term>
    <listitem>
  <para>Default:
 -<amkeyword>yes</amkeyword>.
 -Whether to ask the backup program to update its database (e.g. <filename>/etc/dumpdates</filename>
 +<emphasis remap='I'>yes</emphasis>.
 +Whether to ask the backup program to update its database (e.g. <filename>/var/lib/dumpdates</filename>
  for DUMP or <filename>/usr/local/var/amanda/gnutar-lists</filename> for GNUTAR) of time stamps.
  This is normally enabled for daily backups and turned off for periodic archival runs.</para>
    </listitem>
@@@ -3081,7 -3099,7 +3099,7 @@@ A comment string describing this tapers
    <varlistentry>
    <term><amkeyword>plugin</amkeyword> <amtype>string</amtype></term>
    <listitem>
- <para>No default. Must be set to the name of the taperscan module.  See <man name="amanda-taperscan" vol="7" /> for a list of defined taperscan modules.</para>
+ <para>No default. Must be set to the name of the taperscan module.  See <manref name="amanda-taperscan" vol="7" /> for a list of defined taperscan modules.</para>
    </listitem>
    </varlistentry>
    <varlistentry>
index a4bd049c5751d1ada7b961fbd726ea88bfb3d467,80c0c96e02f9962e9d3a058caf929792e9c580f6..352e09c6ce47a941749769f75d89dcb845673fa6
  <refsect1><title>DESCRIPTION</title>
  <para>The
  <emphasis remap='I'>disklist</emphasis>
- file determines which disks will be backed up by Amanda.
- The file usually contains one line per disk:</para>
+ file determines which disks will be backed up by Amanda. The file contains
+ <amkeyword>includefile</amkeyword> directive or disklist entry
+ (<amkeyword>DLE</amkeyword>).</para>
+ <variablelist remap='TP'>
+   <varlistentry>
+   <term><amkeyword>includefile</amkeyword> <amtype>string</amtype></term>
+   <listitem>
+ <para>Default:
+ <amdefault>no default</amdefault>.
+ The name of a disklist file to include within the current file.
+ Useful for sharing disklist among several configurations.
+ Relative pathnames are relative to the configuration directory.
+ </para>
+   </listitem>
+   </varlistentry>
+ </variablelist>
+ <para>A <amkeyword>DLE</amkeyword> usually contains one line per disk:</para>
  
  <programlisting>
  <emphasis>hostname diskname</emphasis> [<emphasis>diskdevice</emphasis>] <emphasis>dumptype</emphasis> [<emphasis>spindle</emphasis> [<emphasis>interface</emphasis>] ]
@@@ -112,7 -129,7 +129,7 @@@ file
  specify backup related parameters,
  such as whether to compress the backups,
  whether to record backup results in
 -<filename>/etc/dumpdates</filename>, the disk's relative priority, etc.</para>
 +<filename>/var/lib/dumpdates</filename>, the disk's relative priority, etc.</para>
    </listitem>
    </varlistentry>
    <varlistentry>
diff --combined server-src/diskfile.h
index 9fae30e2a5237cb084e6e2931018754e16eda0c6,f4b930e6481c49c136e20a8269a9118f145b1933..c2d7d073a8b71660a01d2d7f0dda47f9ae714ce2
@@@ -79,14 -79,15 +79,15 @@@ typedef struct disk_s 
      char      *client_username;       /* username to connect on the client */
      char      *client_port;           /* port to connect on the client */
      char      *ssh_keys;              /* ssh_key file to use */
-     sl_t      *exclude_file;          /* file exclude spec */
-     sl_t      *exclude_list;          /* exclude list */
-     sl_t      *include_file;          /* file include spec */
-     sl_t      *include_list;          /* include list */
+     am_sl_t   *exclude_file;          /* file exclude spec */
+     am_sl_t   *exclude_list;          /* exclude list */
+     am_sl_t   *include_file;          /* file include spec */
+     am_sl_t   *include_list;          /* include list */
      int               exclude_optional;       /* exclude list are optional */
      int               include_optional;       /* include list are optional */
      int               priority;               /* priority of disk */
      int               allow_split;
+     int         max_warnings;
      off_t     splitsize;
      off_t     tape_splitsize;         /* size of dumpfile chunks on tape */
      char      *split_diskbuffer;      /* place where we can buffer PORT-WRITE dumps other than RAM */
      char      *clnt_decrypt_opt;      /* client-side decryption option parameter to use */
      double    comprate[2];            /* default compression rates */
      /* flag options */
 -    int               record;                 /* record dump in /etc/dumpdates ? */
 +    int               record;                 /* record dump in /var/lib/dumpdates ? */
      int               skip_incr;              /* incs done externally ? */
      int               skip_full;              /* fulls done externally ? */
      int               to_holdingdisk;         /* use holding disk ? */