]> git.sur5r.net Git - bacula/bacula/commitdiff
Autochanger for read + 64 bit addrs + Session key, see kes14Sep02
authorKern Sibbald <kern@sibbald.com>
Sat, 14 Sep 2002 14:51:04 +0000 (14:51 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 14 Sep 2002 14:51:04 +0000 (14:51 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@150 91ce42f0-d328-0410-95d8-f526ca767f89

46 files changed:
bacula/.cvsignore
bacula/Makefile.in
bacula/autoconf/Make.common.in
bacula/autoconf/aclocal.m4
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/baconfig.h
bacula/src/cats/.cvsignore
bacula/src/cats/sql_get.c
bacula/src/console/console.c
bacula/src/console/console_conf.c
bacula/src/dird/authenticate.c
bacula/src/dird/backup.c
bacula/src/dird/catreq.c
bacula/src/dird/dird.c
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/msgchan.c
bacula/src/dird/sql_cmds.c
bacula/src/dird/ua_restore.c
bacula/src/filed/authenticate.c
bacula/src/filed/filed_conf.c
bacula/src/lib/parse_conf.c
bacula/src/lib/protos.h
bacula/src/lib/signal.c
bacula/src/lib/util.c
bacula/src/stored/Makefile.in
bacula/src/stored/acquire.c
bacula/src/stored/askdir.c
bacula/src/stored/authenticate.c
bacula/src/stored/bextract.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/bsr.h
bacula/src/stored/dev.c
bacula/src/stored/device.c
bacula/src/stored/dircmd.c
bacula/src/stored/job.c
bacula/src/stored/mount.c
bacula/src/stored/parse_bsr.c
bacula/src/stored/protos.h
bacula/src/stored/read.c
bacula/src/stored/stored_conf.c
bacula/src/version.h

index 2c7887258ad4e2c91f32d80fcd1dd17e46a5e23c..3b02f711dc905be8e11e63030d884b8ccbbad2df 100644 (file)
@@ -32,3 +32,5 @@ startit
 startmysql
 stopit
 stopmysql
+console.log
+console.sum
index 9cc7c3b3c2e59954e76da60b99bb9cfc379b6d13..a625f74472b309d0ea15f8d6042fae91809b73e2 100755 (executable)
@@ -142,7 +142,8 @@ clean:
        @for I in ${subdirs}; \
          do (cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1); done
        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
-       @$(RMF) *~ 1 2 3 core core.*
+       @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
+
 
 # distclean goal is for making a clean source tree, but if you have run
 # configure from a different directory, then doesn't destroy all your
@@ -157,7 +158,7 @@ distclean:
        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
        @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
        @$(RMF) console gconsole
-       @$(RMF) *~ 1 2 3 core core.*
+       @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
        @$(RMF) working/*
 
 distdirs:
@@ -172,6 +173,13 @@ distcopy:
 
 distrib: configure autoconf/config.h.in distdirs distcopy
 
+test:
+       $(CP) ./autoconf/config.guess .
+       runtest
+       $(RMF) config.guess
+       cat console.sum
+
+
 tar.gz:  ../$(VERNAME).tar.gz
 ../$(VERNAME).tar.gz:
        (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz)
index c4967df87c3000e2001fb11d34848ccf42e55a43..431c35ee129774ec822124eb55be68b639f27ed6 100644 (file)
@@ -1,4 +1,4 @@
-# autoconf/Make.common.in        -*- Makefile -*-
+# autoconf/Make.common.in       -*- Makefile -*-
 # release date (man), LSM date, version number/name, current maintainer
 DATE="@DATE@"
 LSMDATE=@LSMDATE@
@@ -57,6 +57,7 @@ INSTALL_SCRIPT = @INSTALL@ -m 755
 CFLAGS = @CFLAGS@ 
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
+TTOOL_LDFLAGS = @TTOOL_LDFLAGS@
 #DEFS = @DEFS@
 LIBS = @LIBS@
 DINCLUDE = @DINCLUDE@
index 8d3b1a8b0699b5d19a3ffad72bd898a4af43e925..eb9a23e9c1a1d16d6406bfce6456be8a546342c7 100644 (file)
 dnl
-dnl If available, use support for large files unless the user specified
-dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables (<eggert@twinsun.com>
-dnl via GNU patch 2.5)
-dnl
-AC_DEFUN(LARGE_FILE_SUPPORT,
-[AC_MSG_CHECKING(whether large file support needs explicit enabling)
-ac_getconfs=''
-ac_result=yes
-ac_set=''
-ac_shellvars='CPPFLAGS LDFLAGS LIBS'
-for ac_shellvar in $ac_shellvars; do
-  case $ac_shellvar in
-  CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;;
-  *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;;
-  esac
-  eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
-  (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
-  ac_getconf=`getconf $ac_lfsvar`
-  ac_getconf64=`getconf $ac_lfs64var`
-  ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64
-  eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64"
-done
-case "$ac_result$ac_getconfs" in
-yes) ac_result=no ;;
-esac
-case "$ac_result$ac_set" in
-yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
-esac
-AC_MSG_RESULT($ac_result)
-case $ac_result in
-yes)
-  for ac_shellvar in $ac_shellvars; do
-    eval $ac_shellvar=\$ac_test_$ac_shellvar
-  done ;;
-esac
-])
+dnl =========  Large File Support ==============
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
+AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
+  [AC_CACHE_CHECK([for $1 value to request large file support],
+     ac_cv_sys_largefile_$1,
+     [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
+        ac_cv_sys_largefile_$1=no
+        ifelse($1, CFLAGS,
+          [case "$host_os" in
+           # IRIX 6.2 and later require cc -n32.
+changequote(, )dnl
+           irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
+changequote([, ])dnl
+             if test "$GCC" != yes; then
+               ac_cv_sys_largefile_CFLAGS=-n32
+             fi
+             ac_save_CC="$CC"
+             CC="$CC $ac_cv_sys_largefile_CFLAGS"
+             AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
+             CC="$ac_save_CC"
+           esac])
+      }])])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
+AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
+  [case $2 in
+   no) ;;
+   ?*)
+     case "[$]$1" in
+     '') $1=$2 ;;
+     *) $1=[$]$1' '$2 ;;
+     esac ;;
+   esac])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
+AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+  [AC_CACHE_CHECK([for $1], $2,
+     [$2=no
+changequote(, )dnl
+      $4
+      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+        case "$ac_flag" in
+        -D$1)
+          $2=1 ;;
+        -D$1=*)
+          $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+        esac
+      done
+changequote([, ])dnl
+      ])
+   if test "[$]$2" != no; then
+     AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
+   fi])
+
+AC_DEFUN(AC_SYS_LARGEFILE,
+  [AC_REQUIRE([AC_CANONICAL_HOST])
+   AC_ARG_ENABLE(largefile,
+     [  --disable-largefile     omit support for large files])
+   if test "$enable_largefile" != no; then
+     AC_CHECK_TOOL(GETCONF, getconf)
+     AC_SYS_LARGEFILE_FLAGS(CFLAGS)
+     AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
+     AC_SYS_LARGEFILE_FLAGS(LIBS)
+
+     for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+       case "$ac_flag" in
+       no) ;;
+       -D_FILE_OFFSET_BITS=*) ;;
+       -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
+       -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
+       -D?* | -I?*)
+         AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
+       *)
+         AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
+       esac
+     done
+     AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
+     AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
+     AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
+       ac_cv_sys_file_offset_bits,
+       [Number of bits in a file offset, on hosts where this is settable.],
+       [case "$host_os" in
+        # HP-UX 10.20 and later
+        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+          ac_cv_sys_file_offset_bits=64 ;;
+        esac])
+     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
+       ac_cv_sys_largefile_source,
+       [Define to make fseeko etc. visible, on some hosts.],
+       [case "$host_os" in
+        # HP-UX 10.20 and later
+        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+          ac_cv_sys_largefile_source=1 ;;
+        esac])
+     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+       ac_cv_sys_large_files,
+       [Define for large files, on AIX-style hosts.],
+       [case "$host_os" in
+        # AIX 4.2 and later
+        aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+          ac_cv_sys_large_files=1 ;;
+        esac])
+   fi
+  ])
+dnl ==========================================================
 
 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
 AC_DEFUN(SIGNAL_CHECK,
@@ -291,7 +370,7 @@ Which one DBMS do you want to use (please select only one):
                 fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
-    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient"
+    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
     SQL_BINDIR=$MYSQL_BINDIR
 
     AC_DEFINE(HAVE_MYSQL)
index 4c171b0b98c8f03d5cdf497be7800206ebc9018c..93eedae3857f295ad006fe62bd4893362572c1d3 100644 (file)
 /* Define if you have the getcwd function.  */
 #undef HAVE_GETCWD
 
+/* Define if you have the getdomainname function.  */
+#undef HAVE_GETDOMAINNAME
+
 /* Define if you have the gethostbyname_r function.  */
 #undef HAVE_GETHOSTBYNAME_R
 
+/* Define if you have the gethostid function.  */
+#undef HAVE_GETHOSTID
+
 /* Define if you have the gethostname function.  */
 #undef HAVE_GETHOSTNAME
 
 
 /* Define if you have the xnet library (-lxnet).  */
 #undef HAVE_LIBXNET
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to make fseeko etc. visible, on some hosts. */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
index 77dab536cfc2ba4f495ca2f6719422c2cfdf4923..3d0b9808578146ca8c9ad99193925609e1427656 100644 (file)
@@ -12,7 +12,7 @@ AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
 
 dnl require a recent autoconf
-AC_PREREQ(2.12)
+AC_PREREQ(2.13)
 
 
 dnl search for true and false programs.
@@ -139,6 +139,9 @@ fi
 support_mysql=no
 support_sqlite=no
 support_smartalloc=yes
+support_readline=yes
+support_gnome=no
+support_static_tools=yes
 cats=
 db_name=Internal
 DB_NAME=bdb
@@ -155,7 +158,6 @@ AC_ARG_ENABLE(everything,
 # -------------------------------------------
 # gnome (default off)
 # -------------------------------------------
-support_gnome=no
 AC_ARG_ENABLE(gnome,
   [  --enable-gnome    enable build of gnome-console GUI                     *],
   [if test x$enableval = xyes; then
@@ -183,12 +185,27 @@ if test x$support_smartalloc = xyes; then
    AC_DEFINE(SMARTALLOC)
 fi
 
+# -------------------------------------------
+# static-tools (default on)
+# -------------------------------------------
+AC_ARG_ENABLE(static-tools,
+   [  --enable-static-tools    enable static tape tools                           *],
+   [if test x$enableval = xno; then
+     support_static_tools=no
+   fi])
+
+TTOOL_LDFLAGS=
+if test x$support_static_tools = xyes; then
+   TTOOL_LDFLAGS="-static"
+fi
+AC_SUBST(TTOOL_LDFLAGS)
+
+
 
 
 # ---------------------------------------------------
 # Check for readline support/directory (default on)
 # ---------------------------------------------------
-support_readline=yes
 # this allows you to turn it completely off
 AC_ARG_ENABLE(readline,
   [  --disable-readline      disable readline support ],
@@ -572,7 +589,8 @@ AC_ARG_WITH(dir-password,
 
 if test "x$dir_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
+      key=`./randpass 33`
    else
       key=`openssl rand -base64 33`
    fi
@@ -591,7 +609,8 @@ AC_ARG_WITH(fd-password,
 
 if test "x$fd_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
+      key=`./randpass 37`
    else
       key=`openssl rand -base64 33`
    fi
@@ -610,7 +629,8 @@ AC_ARG_WITH(sd-password,
 
 if test "x$sd_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
+      key=`./randpass 41`
    else
       key=`openssl rand -base64 33`
    fi
@@ -659,9 +679,9 @@ fi
 
 dnl A few others 
 AC_EXEEXT
-dnl # AC_SYS_LARGEFILE must modify aclocal.m4
-dnl LARGE_FILE_SUPPORT
-  
+
+dnl See if we can use 64 bit file addresses
+AC_SYS_LARGEFILE
 
 
 AC_PATH_XTRA
@@ -931,7 +951,7 @@ AC_CHECK_FUNCS( \
 
 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
 
-AC_CHECK_FUNCS(snprintf vsnprintf)
+AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
 
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
@@ -1073,6 +1093,7 @@ freebsd)
            platforms/freebsd/bacula-sd \
            platforms/freebsd/bacula-dir"
        hostname=`hostname -s`
+       ac_cv_sys_largefile_CFLAGS="yes"
   ;;
 hpux)
        DISTVER=`uname -r`
@@ -1212,6 +1233,8 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/create_bdb_database \
           src/cats/make_bdb_tables \
           src/cats/drop_bdb_tables \
+          src/cats/make_bacula_tables \
+          src/cats/drop_bacula_tables \
           src/findlib/Makefile \
           src/tools/Makefile \
           $PFILES ],  
@@ -1250,6 +1273,7 @@ Configuration on `date`:
   Compiler flags:            ${CFLAGS} 
   Linker flags:              ${LDFLAGS}
   Libraries:                 ${LIBS}
+  Statically Linked Tools:    ${support_static_tools}
   Database found:            ${have_db}
   Database type:             ${db_name}
   Database lib:              ${DB_LIBS}
@@ -1263,6 +1287,7 @@ Configuration on `date`:
   Working directory          ${working_dir}
   SQL binaries Directory      ${SQL_BINDIR}
 
+  Large file support:        $ac_cv_sys_largefile_CFLAGS
   readline support:          ${got_readline} ${PRTREADLINE_SRC}
   cweb support:              ${got_cweb} ${CWEB_SRC}
   TCP Wrappers support:       ${TCPW_MSG}
index eafb9befd7c8158a1e50a9f05bfe2b42671a77e2..8dfefa01adfd89b3bda734e04e7ad59731c92e57 100755 (executable)
@@ -23,6 +23,8 @@ ac_help="$ac_help
   --with-gnome            Specify prefix for GNOME files"
 ac_help="$ac_help
   --enable-smartalloc     enable smartalloc debugging support             *"
+ac_help="$ac_help
+  --enable-static-tools    enable static tape tools                       *"
 ac_help="$ac_help
   --disable-readline      disable readline support "
 ac_help="$ac_help
@@ -71,6 +73,8 @@ Which one DBMS do you want to use (please select only one):
   --with-sqlite[=DIR]     Include SQLite support.  DIR is the SQLite base
                           install directory, default is to search through
                           a number of common places for the SQLite files."
+ac_help="$ac_help
+  --disable-largefile     omit support for large files"
 ac_help="$ac_help
   --with-x                use the X Window System"
 
@@ -617,7 +621,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:621: checking for $ac_word" >&5
+echo "configure:625: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TRUEPRG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -658,7 +662,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:662: checking for $ac_word" >&5
+echo "configure:666: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_FALSEPRG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -702,7 +706,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:706: checking host system type" >&5
+echo "configure:710: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -733,7 +737,7 @@ echo "configuring for bacula $VERSION ($DATE)"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:737: checking for $ac_word" >&5
+echo "configure:741: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -763,7 +767,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:767: checking for $ac_word" >&5
+echo "configure:771: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -814,7 +818,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:818: checking for $ac_word" >&5
+echo "configure:822: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -846,7 +850,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:854: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -857,12 +861,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 861 "configure"
+#line 865 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -888,12 +892,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:892: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:896: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:897: checking whether we are using GNU C" >&5
+echo "configure:901: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -902,7 +906,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -921,7 +925,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:925: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:929: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -957,7 +961,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:961: checking for $ac_word" >&5
+echo "configure:965: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -989,7 +993,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:993: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:997: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1000,12 +1004,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1004 "configure"
+#line 1008 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1031,12 +1035,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1035: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1039: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1040: checking whether we are using GNU C++" >&5
+echo "configure:1044: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1045,7 +1049,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -1064,7 +1068,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1068: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1072: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1105,7 +1109,7 @@ for ac_declaration in \
    'void exit (int);'
 do
   cat > conftest.$ac_ext <<EOF
-#line 1109 "configure"
+#line 1113 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -1113,7 +1117,7 @@ int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:1117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -1123,14 +1127,14 @@ else
 fi
 rm -f conftest*
   cat > conftest.$ac_ext <<EOF
-#line 1127 "configure"
+#line 1131 "configure"
 #include "confdefs.h"
 $ac_declaration
 int main() {
 exit (42);
 ; return 0; }
 EOF
-if { (eval echo configure:1134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   break
 else
@@ -1148,10 +1152,10 @@ fi
 
 if test "x$CC" != xcc; then
   echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:1152: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:1156: checking whether $CC and cc understand -c and -o together" >&5
 else
   echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1155: checking whether cc understands -c and -o together" >&5
+echo "configure:1159: checking whether cc understands -c and -o together" >&5
 fi
 set dummy $CC; ac_cc="`echo $2 |
                       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
@@ -1163,16 +1167,16 @@ else
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
 ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:1167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-   test -f conftest.o && { (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+   test -f conftest.o && { (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
 then
   eval ac_cv_prog_cc_${ac_cc}_c_o=yes
   if test "x$CC" != xcc; then
     # Test first that cc exists at all.
-    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
       ac_try='cc -c conftest.c -o conftest.o 1>&5'
-      if { (eval echo configure:1175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
-        test -f conftest.o && { (eval echo configure:1176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+      if { (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+        test -f conftest.o && { (eval echo configure:1180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
       then
         # cc works too.
         :
@@ -1198,7 +1202,7 @@ EOF
 
 fi
                        echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1202: checking how to run the C preprocessor" >&5
+echo "configure:1206: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1213,13 +1217,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1217 "configure"
+#line 1221 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1230,13 +1234,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1234 "configure"
+#line 1238 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1247,13 +1251,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1251 "configure"
+#line 1255 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1279,13 +1283,13 @@ echo "$ac_t""$CPP" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1283: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1287: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 1289 "configure"
+#line 1293 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -1303,7 +1307,7 @@ rm -f conftest*
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 1307 "configure"
+#line 1311 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -1344,7 +1348,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1348: checking for a BSD compatible install" >&5
+echo "configure:1352: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1399,7 +1403,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1403: checking for $ac_word" >&5
+echo "configure:1407: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1429,7 +1433,7 @@ fi
 # Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1433: checking for $ac_word" >&5
+echo "configure:1437: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1465,7 +1469,7 @@ fi
 # Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1469: checking for $ac_word" >&5
+echo "configure:1473: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1501,7 +1505,7 @@ fi
 # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1505: checking for $ac_word" >&5
+echo "configure:1509: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1537,7 +1541,7 @@ fi
 # Extract the first word of "sed", so it can be a program name with args.
 set dummy sed; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1541: checking for $ac_word" >&5
+echo "configure:1545: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1573,7 +1577,7 @@ fi
 # Extract the first word of "awk", so it can be a program name with args.
 set dummy awk; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1577: checking for $ac_word" >&5
+echo "configure:1581: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1609,7 +1613,7 @@ fi
 # Extract the first word of "echo", so it can be a program name with args.
 set dummy echo; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1613: checking for $ac_word" >&5
+echo "configure:1617: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ECHO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1645,7 +1649,7 @@ fi
 # Extract the first word of "cmp", so it can be a program name with args.
 set dummy cmp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1649: checking for $ac_word" >&5
+echo "configure:1653: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1681,7 +1685,7 @@ fi
 # Extract the first word of "tbl", so it can be a program name with args.
 set dummy tbl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1685: checking for $ac_word" >&5
+echo "configure:1689: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TBL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1717,7 +1721,7 @@ fi
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1721: checking for $ac_word" >&5
+echo "configure:1725: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1753,7 +1757,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1757: checking for $ac_word" >&5
+echo "configure:1761: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1789,7 +1793,7 @@ fi
 # Extract the first word of "openssl", so it can be a program name with args.
 set dummy openssl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1793: checking for $ac_word" >&5
+echo "configure:1797: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_OPENSSL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1837,14 +1841,14 @@ MAKE_SHELL=/bin/sh
 
 
 echo $ac_n "checking for Operating System""... $ac_c" 1>&6
-echo "configure:1841: checking for Operating System" >&5
+echo "configure:1845: checking for Operating System" >&5
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1843: checking for Cygwin environment" >&5
+echo "configure:1847: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1848 "configure"
+#line 1852 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1855,7 +1859,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:1859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -2174,7 +2178,7 @@ echo "$ac_t""" "" 1>&6
 # -----------------------------------------------------------
 # ----------------------------------------------------------
 echo $ac_n "checking for Operating System Distribution""... $ac_c" 1>&6
-echo "configure:2178: checking for Operating System Distribution" >&5
+echo "configure:2182: checking for Operating System Distribution" >&5
 if test "x$DISTNAME" != "x"
 then
         echo "distname set to $DISTNAME"
@@ -2291,7 +2295,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2295: checking for $ac_word" >&5
+echo "configure:2299: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2340,6 +2344,9 @@ fi
 support_mysql=no
 support_sqlite=no
 support_smartalloc=yes
+support_readline=yes
+support_gnome=no
+support_static_tools=yes
 cats=
 db_name=Internal
 DB_NAME=bdb
@@ -2356,7 +2363,6 @@ fi
 # -------------------------------------------
 # gnome (default off)
 # -------------------------------------------
-support_gnome=no
 # Check whether --enable-gnome or --disable-gnome was given.
 if test "${enable_gnome+set}" = set; then
   enableval="$enable_gnome"
@@ -2423,7 +2429,7 @@ fi
             # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2427: checking for $ac_word" >&5
+echo "configure:2433: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2460,7 +2466,7 @@ fi
               no_gnome_config="yes"
             else
               echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6
-echo "configure:2464: checking if $GNOME_CONFIG works" >&5
+echo "configure:2470: checking if $GNOME_CONFIG works" >&5
               if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
                 echo "$ac_t""yes" 1>&6
                 
@@ -2468,7 +2474,7 @@ echo "configure:2464: checking if $GNOME_CONFIG works" >&5
         # Extract the first word of "orbit-config", so it can be a program name with args.
 set dummy orbit-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2472: checking for $ac_word" >&5
+echo "configure:2478: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2504,7 +2510,7 @@ fi
         # Extract the first word of "orbit-idl", so it can be a program name with args.
 set dummy orbit-idl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2508: checking for $ac_word" >&5
+echo "configure:2514: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_IDL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2538,7 +2544,7 @@ else
 fi
 
         echo $ac_n "checking for working ORBit environment""... $ac_c" 1>&6
-echo "configure:2542: checking for working ORBit environment" >&5
+echo "configure:2548: checking for working ORBit environment" >&5
 if eval "test \"`echo '$''{'gnome_cv_orbit_found'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2574,7 +2580,7 @@ fi
         fi
 
         echo $ac_n "checking for gnorba libraries""... $ac_c" 1>&6
-echo "configure:2578: checking for gnorba libraries" >&5
+echo "configure:2584: checking for gnorba libraries" >&5
 if eval "test \"`echo '$''{'gnome_cv_gnorba_found'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2638,7 +2644,7 @@ fi
         
             if test "$no_gnome_config" = "yes"; then
               echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6
-echo "configure:2642: checking for gnomeConf.sh file in $gnome_prefix" >&5
+echo "configure:2648: checking for gnomeConf.sh file in $gnome_prefix" >&5
               if test -f $gnome_prefix/gnomeConf.sh; then
                 echo "$ac_t""found" 1>&6
                 echo "loading gnome configuration from" \
@@ -2658,7 +2664,7 @@ echo "configure:2642: checking for gnomeConf.sh file in $gnome_prefix" >&5
           n=""
           for i in $n; do
             echo $ac_n "checking extra library \"$i\"""... $ac_c" 1>&6
-echo "configure:2662: checking extra library \"$i\"" >&5
+echo "configure:2668: checking extra library \"$i\"" >&5
             case $i in 
               applets)
                 
@@ -2705,12 +2711,30 @@ EOF
 
 fi
 
+# -------------------------------------------
+# static-tools (default on)
+# -------------------------------------------
+# Check whether --enable-static-tools or --disable-static-tools was given.
+if test "${enable_static_tools+set}" = set; then
+  enableval="$enable_static_tools"
+  if test x$enableval = xno; then
+     support_static_tools=no
+   fi
+fi
+
+
+TTOOL_LDFLAGS=
+if test x$support_static_tools = xyes; then
+   TTOOL_LDFLAGS="-static"
+fi
+
+
+
 
 
 # ---------------------------------------------------
 # Check for readline support/directory (default on)
 # ---------------------------------------------------
-support_readline=yes
 # this allows you to turn it completely off
 # Check whether --enable-readline or --disable-readline was given.
 if test "${enable_readline+set}" = set; then
@@ -2739,17 +2763,17 @@ if test "${with_readline+set}" = set; then
          fi
          ac_safe=`echo "$with_readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $with_readline/readline.h""... $ac_c" 1>&6
-echo "configure:2743: checking for $with_readline/readline.h" >&5
+echo "configure:2767: checking for $with_readline/readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2748 "configure"
+#line 2772 "configure"
 #include "confdefs.h"
 #include <$with_readline/readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2788,17 +2812,17 @@ else
        # check for standard readline library
        ac_safe=`echo "/usr/include/readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/include/readline/readline.h""... $ac_c" 1>&6
-echo "configure:2792: checking for /usr/include/readline/readline.h" >&5
+echo "configure:2816: checking for /usr/include/readline/readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
+#line 2821 "configure"
 #include "confdefs.h"
 #include </usr/include/readline/readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2855,12 +2879,12 @@ MAKE_SHELL=/bin/sh
 
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:2859: checking whether stat file-mode macros are broken" >&5
+echo "configure:2883: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2864 "configure"
+#line 2888 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2915,12 +2939,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2919: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2943: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2924 "configure"
+#line 2948 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -2928,7 +2952,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2953,7 +2977,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2957: checking for opendir in -ldir" >&5
+echo "configure:2981: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2961,7 +2985,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2965 "configure"
+#line 2989 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2972,7 +2996,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2994,7 +3018,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2998: checking for opendir in -lx" >&5
+echo "configure:3022: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3002,7 +3026,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3006 "configure"
+#line 3030 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3013,7 +3037,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3039,12 +3063,12 @@ fi
 for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat lchown
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3043: checking for $ac_func" >&5
+echo "configure:3067: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3048 "configure"
+#line 3072 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3067,7 +3091,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3097,12 +3121,12 @@ done
 #    EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
 
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:3101: checking for getopt_long" >&5
+echo "configure:3125: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3106 "configure"
+#line 3130 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -3125,7 +3149,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -3150,7 +3174,7 @@ fi
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:3154: checking for working strcoll" >&5
+echo "configure:3178: checking for working strcoll" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3158,7 +3182,7 @@ else
   ac_cv_func_strcoll_works=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3162 "configure"
+#line 3186 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -3168,7 +3192,7 @@ main ()
        strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -3196,17 +3220,17 @@ for ac_hdr in varargs.h \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3200: checking for $ac_hdr" >&5
+echo "configure:3224: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3205 "configure"
+#line 3229 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3258,17 +3282,17 @@ if test "${with_gmp+set}" = set; then
        fi
        ac_safe=`echo "$with_gmp/gmp.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $with_gmp/gmp.h""... $ac_c" 1>&6
-echo "configure:3262: checking for $with_gmp/gmp.h" >&5
+echo "configure:3286: checking for $with_gmp/gmp.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3267 "configure"
+#line 3291 "configure"
 #include "confdefs.h"
 #include <$with_gmp/gmp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3307,17 +3331,17 @@ else
     # check for standard gmp library
     ac_safe=`echo "/usr/include/gmp.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/include/gmp.h""... $ac_c" 1>&6
-echo "configure:3311: checking for /usr/include/gmp.h" >&5
+echo "configure:3335: checking for /usr/include/gmp.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3316 "configure"
+#line 3340 "configure"
 #include "confdefs.h"
 #include </usr/include/gmp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3395,17 +3419,17 @@ if test "${with_cweb+set}" = set; then
        fi
        ac_safe=`echo "$with_cweb/cweb.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $with_cweb/cweb.h""... $ac_c" 1>&6
-echo "configure:3399: checking for $with_cweb/cweb.h" >&5
+echo "configure:3423: checking for $with_cweb/cweb.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3404 "configure"
+#line 3428 "configure"
 #include "confdefs.h"
 #include <$with_cweb/cweb.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3444,17 +3468,17 @@ else
     # check for standard cweb library
     ac_safe=`echo "/usr/include/cweb.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/include/cweb.h""... $ac_c" 1>&6
-echo "configure:3448: checking for /usr/include/cweb.h" >&5
+echo "configure:3472: checking for /usr/include/cweb.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3453 "configure"
+#line 3477 "configure"
 #include "confdefs.h"
 #include </usr/include/cweb.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3525,9 +3549,9 @@ if test "${with_tcp_wrappers+set}" = set; then
        saved_LIBS="$LIBS"
        LIBS="$LIBS -lwrap -lnsl"
        echo $ac_n "checking for libwrap""... $ac_c" 1>&6
-echo "configure:3529: checking for libwrap" >&5
+echo "configure:3553: checking for libwrap" >&5
        cat > conftest.$ac_ext <<EOF
-#line 3531 "configure"
+#line 3555 "configure"
 #include "confdefs.h"
  #include <tcpd.h>
             int deny_severity = 0;
@@ -3537,7 +3561,7 @@ int main() {
  hosts_access(req); 
 ; return 0; }
 EOF
-if { (eval echo configure:3541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
            echo "$ac_t""yes" 1>&6
@@ -3737,7 +3761,8 @@ fi
 
 if test "x$dir_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
+      key=`./randpass 33`
    else
       key=`openssl rand -base64 33`
    fi
@@ -3759,7 +3784,8 @@ fi
 
 if test "x$fd_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
+      key=`./randpass 37`
    else
       key=`openssl rand -base64 33`
    fi
@@ -3781,7 +3807,8 @@ fi
 
 if test "x$sd_password" = "x" ; then
    if test "x$OPENSSL" = "xnone" ; then
-      key=`date | uuencode 1 | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
+#     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
+      key=`./randpass 41`
    else
       key=`openssl rand -base64 33`
    fi
@@ -3802,7 +3829,7 @@ fi
 
 have_db=no
 echo $ac_n "checking for MySQL support""... $ac_c" 1>&6
-echo "configure:3806: checking for MySQL support" >&5
+echo "configure:3833: checking for MySQL support" >&5
 # Check whether --with-mysql or --without-mysql was given.
 if test "${with_mysql+set}" = set; then
   withval="$with_mysql"
@@ -3848,7 +3875,7 @@ if test "${with_mysql+set}" = set; then
                 fi
         fi
     SQL_INCLUDE=-I$MYSQL_INCDIR
-    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient"
+    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
     SQL_BINDIR=$MYSQL_BINDIR
 
     cat >> confdefs.h <<\EOF
@@ -3959,7 +3986,7 @@ fi
 
 have_db=no
 echo $ac_n "checking for SQLite support""... $ac_c" 1>&6
-echo "configure:3963: checking for SQLite support" >&5
+echo "configure:3990: checking for SQLite support" >&5
 # Check whether --with-sqlite or --without-sqlite was given.
 if test "${with_sqlite+set}" = set; then
   withval="$with_sqlite"
@@ -4035,19 +4062,19 @@ fi
 
 
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4039: checking for mingw32 environment" >&5
+echo "configure:4066: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4044 "configure"
+#line 4071 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:4051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -4066,7 +4093,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4070: checking for executable suffix" >&5
+echo "configure:4097: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4076,7 +4103,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -4096,6 +4123,264 @@ test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
 echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:4129: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+
+   # Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval="$enable_largefile"
+  :
+fi
+
+   if test "$enable_largefile" != no; then
+     # Extract the first word of "${ac_tool_prefix}getconf", so it can be a program name with args.
+set dummy ${ac_tool_prefix}getconf; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4163: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_GETCONF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$GETCONF"; then
+  ac_cv_prog_GETCONF="$GETCONF" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_GETCONF="${ac_tool_prefix}getconf"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_GETCONF" && ac_cv_prog_GETCONF="getconf"
+fi
+fi
+GETCONF="$ac_cv_prog_GETCONF"
+if test -n "$GETCONF"; then
+  echo "$ac_t""$GETCONF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+     echo $ac_n "checking for CFLAGS value to request large file support""... $ac_c" 1>&6
+echo "configure:4193: checking for CFLAGS value to request large file support" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_largefile_CFLAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_largefile_CFLAGS=`($GETCONF LFS_CFLAGS) 2>/dev/null` || {
+        ac_cv_sys_largefile_CFLAGS=no
+        case "$host_os" in
+           # IRIX 6.2 and later require cc -n32.
+           irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
+             if test "$GCC" != yes; then
+               ac_cv_sys_largefile_CFLAGS=-n32
+             fi
+             ac_save_CC="$CC"
+             CC="$CC $ac_cv_sys_largefile_CFLAGS"
+             cat > conftest.$ac_ext <<EOF
+#line 4208 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_sys_largefile_CFLAGS=no
+fi
+rm -f conftest*
+             CC="$ac_save_CC"
+           esac
+      }
+fi
+
+echo "$ac_t""$ac_cv_sys_largefile_CFLAGS" 1>&6
+     echo $ac_n "checking for LDFLAGS value to request large file support""... $ac_c" 1>&6
+echo "configure:4231: checking for LDFLAGS value to request large file support" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_largefile_LDFLAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_largefile_LDFLAGS=`($GETCONF LFS_LDFLAGS) 2>/dev/null` || {
+        ac_cv_sys_largefile_LDFLAGS=no
+        
+      }
+fi
+
+echo "$ac_t""$ac_cv_sys_largefile_LDFLAGS" 1>&6
+     echo $ac_n "checking for LIBS value to request large file support""... $ac_c" 1>&6
+echo "configure:4243: checking for LIBS value to request large file support" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_largefile_LIBS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_largefile_LIBS=`($GETCONF LFS_LIBS) 2>/dev/null` || {
+        ac_cv_sys_largefile_LIBS=no
+        
+      }
+fi
+
+echo "$ac_t""$ac_cv_sys_largefile_LIBS" 1>&6
+
+     for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+       case "$ac_flag" in
+       no) ;;
+       -D_FILE_OFFSET_BITS=*) ;;
+       -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
+       -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
+       -D?* | -I?*)
+         case "$ac_flag" in
+   no) ;;
+   ?*)
+     case "$CPPFLAGS" in
+     '') CPPFLAGS="$ac_flag" ;;
+     *) CPPFLAGS=$CPPFLAGS' '"$ac_flag" ;;
+     esac ;;
+   esac ;;
+       *)
+         case "$ac_flag" in
+   no) ;;
+   ?*)
+     case "$CFLAGS" in
+     '') CFLAGS="$ac_flag" ;;
+     *) CFLAGS=$CFLAGS' '"$ac_flag" ;;
+     esac ;;
+   esac ;;
+       esac
+     done
+     case "$ac_cv_sys_largefile_LDFLAGS" in
+   no) ;;
+   ?*)
+     case "$LDFLAGS" in
+     '') LDFLAGS="$ac_cv_sys_largefile_LDFLAGS" ;;
+     *) LDFLAGS=$LDFLAGS' '"$ac_cv_sys_largefile_LDFLAGS" ;;
+     esac ;;
+   esac
+     case "$ac_cv_sys_largefile_LIBS" in
+   no) ;;
+   ?*)
+     case "$LIBS" in
+     '') LIBS="$ac_cv_sys_largefile_LIBS" ;;
+     *) LIBS=$LIBS' '"$ac_cv_sys_largefile_LIBS" ;;
+     esac ;;
+   esac
+     echo $ac_n "checking for _FILE_OFFSET_BITS""... $ac_c" 1>&6
+echo "configure:4298: checking for _FILE_OFFSET_BITS" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_file_offset_bits=no
+      case "$host_os" in
+        # HP-UX 10.20 and later
+        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+          ac_cv_sys_file_offset_bits=64 ;;
+        esac
+      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+        case "$ac_flag" in
+        -D_FILE_OFFSET_BITS)
+          ac_cv_sys_file_offset_bits=1 ;;
+        -D_FILE_OFFSET_BITS=*)
+          ac_cv_sys_file_offset_bits=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+        esac
+      done
+      
+fi
+
+echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6
+   if test "$ac_cv_sys_file_offset_bits" != no; then
+     cat >> confdefs.h <<EOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+EOF
+
+   fi
+     echo $ac_n "checking for _LARGEFILE_SOURCE""... $ac_c" 1>&6
+echo "configure:4327: checking for _LARGEFILE_SOURCE" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_largefile_source=no
+      case "$host_os" in
+        # HP-UX 10.20 and later
+        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+          ac_cv_sys_largefile_source=1 ;;
+        esac
+      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+        case "$ac_flag" in
+        -D_LARGEFILE_SOURCE)
+          ac_cv_sys_largefile_source=1 ;;
+        -D_LARGEFILE_SOURCE=*)
+          ac_cv_sys_largefile_source=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+        esac
+      done
+      
+fi
+
+echo "$ac_t""$ac_cv_sys_largefile_source" 1>&6
+   if test "$ac_cv_sys_largefile_source" != no; then
+     cat >> confdefs.h <<EOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+EOF
+
+   fi
+     echo $ac_n "checking for _LARGE_FILES""... $ac_c" 1>&6
+echo "configure:4356: checking for _LARGE_FILES" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_sys_large_files=no
+      case "$host_os" in
+        # AIX 4.2 and later
+        aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+          ac_cv_sys_large_files=1 ;;
+        esac
+      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+        case "$ac_flag" in
+        -D_LARGE_FILES)
+          ac_cv_sys_large_files=1 ;;
+        -D_LARGE_FILES=*)
+          ac_cv_sys_large_files=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+        esac
+      done
+      
+fi
+
+echo "$ac_t""$ac_cv_sys_large_files" 1>&6
+   if test "$ac_cv_sys_large_files" != no; then
+     cat >> confdefs.h <<EOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+EOF
+
+   fi
+   fi
   
 
 
@@ -4104,7 +4389,7 @@ ac_exeext=$EXEEXT
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4108: checking for X" >&5
+echo "configure:4393: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4166,12 +4451,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4170 "configure"
+#line 4455 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4240,14 +4525,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4244 "configure"
+#line 4529 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4353,17 +4638,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:4357: checking whether -R must be followed by a space" >&5
+echo "configure:4642: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4360 "configure"
+#line 4645 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4379,14 +4664,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 4383 "configure"
+#line 4668 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4418,7 +4703,7 @@ rm -f conftest*
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4422: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4707: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4426,7 +4711,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4430 "configure"
+#line 4715 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4437,7 +4722,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4459,7 +4744,7 @@ fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:4463: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4748: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4467,7 +4752,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4471 "configure"
+#line 4756 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4478,7 +4763,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4507,12 +4792,12 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4511: checking for gethostbyname" >&5
+echo "configure:4796: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4516 "configure"
+#line 4801 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4535,7 +4820,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4556,7 +4841,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4560: checking for gethostbyname in -lnsl" >&5
+echo "configure:4845: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4564,7 +4849,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4568 "configure"
+#line 4853 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4575,7 +4860,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4605,12 +4890,12 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4609: checking for connect" >&5
+echo "configure:4894: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4614 "configure"
+#line 4899 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4633,7 +4918,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4654,7 +4939,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:4658: checking for connect in -lsocket" >&5
+echo "configure:4943: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4662,7 +4947,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4666 "configure"
+#line 4951 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4673,7 +4958,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4697,12 +4982,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:4701: checking for remove" >&5
+echo "configure:4986: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4706 "configure"
+#line 4991 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4725,7 +5010,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -4746,7 +5031,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4750: checking for remove in -lposix" >&5
+echo "configure:5035: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4754,7 +5039,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4758 "configure"
+#line 5043 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4765,7 +5050,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:4769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4789,12 +5074,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:4793: checking for shmat" >&5
+echo "configure:5078: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4798 "configure"
+#line 5083 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -4817,7 +5102,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -4838,7 +5123,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:4842: checking for shmat in -lipc" >&5
+echo "configure:5127: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4846,7 +5131,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4850 "configure"
+#line 5135 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4857,7 +5142,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:4861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4890,7 +5175,7 @@ fi
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:4894: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:5179: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4898,7 +5183,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4902 "configure"
+#line 5187 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4909,7 +5194,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4954,17 +5239,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4958: checking for $ac_hdr" >&5
+echo "configure:5243: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4963 "configure"
+#line 5248 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4991,12 +5276,12 @@ fi
 done
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4995: checking for ANSI C header files" >&5
+echo "configure:5280: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5000 "configure"
+#line 5285 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -5004,7 +5289,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5021,7 +5306,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 5025 "configure"
+#line 5310 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -5039,7 +5324,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 5043 "configure"
+#line 5328 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -5060,7 +5345,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 5064 "configure"
+#line 5349 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -5071,7 +5356,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:5075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -5095,19 +5380,19 @@ EOF
 fi
 
 echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6
-echo "configure:5099: checking whether sys/types.h defines makedev" >&5
+echo "configure:5384: checking whether sys/types.h defines makedev" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5104 "configure"
+#line 5389 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 return makedev(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:5111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_sys_types_h_makedev=yes
 else
@@ -5125,17 +5410,17 @@ echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6
-echo "configure:5129: checking for sys/mkdev.h" >&5
+echo "configure:5414: checking for sys/mkdev.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5134 "configure"
+#line 5419 "configure"
 #include "confdefs.h"
 #include <sys/mkdev.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5163,17 +5448,17 @@ fi
   if test $ac_cv_header_sys_mkdev_h = no; then
 ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6
-echo "configure:5167: checking for sys/sysmacros.h" >&5
+echo "configure:5452: checking for sys/sysmacros.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5172 "configure"
+#line 5457 "configure"
 #include "confdefs.h"
 #include <sys/sysmacros.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5205,12 +5490,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:5209: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5494: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5214 "configure"
+#line 5499 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -5218,7 +5503,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -5243,7 +5528,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:5247: checking for opendir in -ldir" >&5
+echo "configure:5532: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5251,7 +5536,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5255 "configure"
+#line 5540 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5262,7 +5547,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5284,7 +5569,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5288: checking for opendir in -lx" >&5
+echo "configure:5573: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5292,7 +5577,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5296 "configure"
+#line 5581 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5303,7 +5588,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5326,12 +5611,12 @@ fi
 fi
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:5330: checking whether stat file-mode macros are broken" >&5
+echo "configure:5615: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5335 "configure"
+#line 5620 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5382,12 +5667,12 @@ EOF
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:5386: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:5671: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5391 "configure"
+#line 5676 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -5403,7 +5688,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:5407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -5424,12 +5709,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5428: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5713: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5433 "configure"
+#line 5718 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -5438,7 +5723,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:5442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -5459,12 +5744,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:5463: checking for st_blksize in struct stat" >&5
+echo "configure:5748: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5468 "configure"
+#line 5753 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5472,7 +5757,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -5493,12 +5778,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:5497: checking for st_blocks in struct stat" >&5
+echo "configure:5782: checking for st_blocks in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5502 "configure"
+#line 5787 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5506,7 +5791,7 @@ int main() {
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:5510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -5529,12 +5814,12 @@ else
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5533: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5818: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5538 "configure"
+#line 5823 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -5542,7 +5827,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:5546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -5563,12 +5848,12 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5567: checking for tm_zone in struct tm" >&5
+echo "configure:5852: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5572 "configure"
+#line 5857 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -5576,7 +5861,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -5596,12 +5881,12 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5600: checking for tzname" >&5
+echo "configure:5885: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5605 "configure"
+#line 5890 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -5611,7 +5896,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:5615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -5638,12 +5923,12 @@ fi
 # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine.
 
 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
-echo "configure:5642: checking for utime.h" >&5
+echo "configure:5927: checking for utime.h" >&5
 if eval "test \"`echo '$''{'tar_cv_header_utime_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5647 "configure"
+#line 5932 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5652,7 +5937,7 @@ int main() {
 struct utimbuf foo
 ; return 0; }
 EOF
-if { (eval echo configure:5656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   tar_cv_header_utime_h=yes
 else
@@ -5671,12 +5956,12 @@ EOF
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5675: checking for working const" >&5
+echo "configure:5960: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5680 "configure"
+#line 5965 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -5725,7 +6010,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -5748,17 +6033,17 @@ fi
 
 
 echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6
-echo "configure:5752: checking how to get filesystem type" >&5
+echo "configure:6037: checking how to get filesystem type" >&5
 fstype=no
 # The order of these tests is important.
 cat > conftest.$ac_ext <<EOF
-#line 5756 "configure"
+#line 6041 "configure"
 #include "confdefs.h"
 #include <sys/statvfs.h>
 #include <sys/fstyp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5774,13 +6059,13 @@ fi
 rm -f conftest*
 if test $fstype = no; then
 cat > conftest.$ac_ext <<EOF
-#line 5778 "configure"
+#line 6063 "configure"
 #include "confdefs.h"
 #include <sys/statfs.h>
 #include <sys/fstyp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5797,13 +6082,13 @@ rm -f conftest*
 fi
 if test $fstype = no; then
 cat > conftest.$ac_ext <<EOF
-#line 5801 "configure"
+#line 6086 "configure"
 #include "confdefs.h"
 #include <sys/statfs.h>
 #include <sys/vmount.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5820,12 +6105,12 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5824 "configure"
+#line 6109 "configure"
 #include "confdefs.h"
 #include <mntent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5842,7 +6127,7 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5846 "configure"
+#line 6131 "configure"
 #include "confdefs.h"
 #include <sys/mount.h>
 EOF
@@ -5859,13 +6144,13 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5863 "configure"
+#line 6148 "configure"
 #include "confdefs.h"
 #include <sys/mount.h>
 #include <sys/fs_types.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5883,12 +6168,12 @@ fi
 echo "$ac_t""$fstype" 1>&6
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5887: checking return type of signal handlers" >&5
+echo "configure:6172: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5892 "configure"
+#line 6177 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -5905,7 +6190,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:5909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -5925,13 +6210,13 @@ EOF
 
 
 echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:5929: checking for type of signal functions" >&5
+echo "configure:6214: checking for type of signal functions" >&5
 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 5935 "configure"
+#line 6220 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
@@ -5944,7 +6229,7 @@ int main() {
   
 ; return 0; }
 EOF
-if { (eval echo configure:5948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   bash_cv_signal_vintage=posix
 else
@@ -5953,7 +6238,7 @@ else
   rm -rf conftest*
   
     cat > conftest.$ac_ext <<EOF
-#line 5957 "configure"
+#line 6242 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
@@ -5963,7 +6248,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   bash_cv_signal_vintage=4.2bsd
 else
@@ -5972,7 +6257,7 @@ else
   rm -rf conftest*
   
       cat > conftest.$ac_ext <<EOF
-#line 5976 "configure"
+#line 6261 "configure"
 #include "confdefs.h"
 
         #include <signal.h>
@@ -5985,7 +6270,7 @@ int main() {
         
 ; return 0; }
 EOF
-if { (eval echo configure:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   bash_cv_signal_vintage=svr3
 else
@@ -6024,12 +6309,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:6028: checking for mode_t" >&5
+echo "configure:6313: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6033 "configure"
+#line 6318 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6057,12 +6342,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:6061: checking for uid_t in sys/types.h" >&5
+echo "configure:6346: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6066 "configure"
+#line 6351 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -6091,12 +6376,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:6095: checking for size_t" >&5
+echo "configure:6380: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6100 "configure"
+#line 6385 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6124,12 +6409,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6128: checking for pid_t" >&5
+echo "configure:6413: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6133 "configure"
+#line 6418 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6157,12 +6442,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:6161: checking for off_t" >&5
+echo "configure:6446: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6166 "configure"
+#line 6451 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6190,12 +6475,12 @@ EOF
 fi
 
 echo $ac_n "checking for ino_t""... $ac_c" 1>&6
-echo "configure:6194: checking for ino_t" >&5
+echo "configure:6479: checking for ino_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6199 "configure"
+#line 6484 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6223,12 +6508,12 @@ EOF
 fi
 
 echo $ac_n "checking for dev_t""... $ac_c" 1>&6
-echo "configure:6227: checking for dev_t" >&5
+echo "configure:6512: checking for dev_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6232 "configure"
+#line 6517 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6256,12 +6541,12 @@ EOF
 fi
 
 echo $ac_n "checking for daddr_t""... $ac_c" 1>&6
-echo "configure:6260: checking for daddr_t" >&5
+echo "configure:6545: checking for daddr_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_daddr_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6265 "configure"
+#line 6550 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6289,12 +6574,12 @@ EOF
 fi
 
 echo $ac_n "checking for major_t""... $ac_c" 1>&6
-echo "configure:6293: checking for major_t" >&5
+echo "configure:6578: checking for major_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_major_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6298 "configure"
+#line 6583 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6322,12 +6607,12 @@ EOF
 fi
 
 echo $ac_n "checking for minor_t""... $ac_c" 1>&6
-echo "configure:6326: checking for minor_t" >&5
+echo "configure:6611: checking for minor_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_minor_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6331 "configure"
+#line 6616 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6355,12 +6640,12 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:6359: checking for ssize_t" >&5
+echo "configure:6644: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6364 "configure"
+#line 6649 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6388,12 +6673,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:6392: checking for st_blocks in struct stat" >&5
+echo "configure:6677: checking for st_blocks in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6397 "configure"
+#line 6682 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -6401,7 +6686,7 @@ int main() {
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:6405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -6424,12 +6709,12 @@ else
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:6428: checking for st_rdev in struct stat" >&5
+echo "configure:6713: checking for st_rdev in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6433 "configure"
+#line 6718 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -6437,7 +6722,7 @@ int main() {
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:6441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -6458,12 +6743,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:6462: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:6747: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6467 "configure"
+#line 6752 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -6471,7 +6756,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:6475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -6492,12 +6777,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6496: checking for working const" >&5
+echo "configure:6781: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6501 "configure"
+#line 6786 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -6546,7 +6831,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -6569,7 +6854,7 @@ fi
 
 
 echo $ac_n "checking size of char""... $ac_c" 1>&6
-echo "configure:6573: checking size of char" >&5
+echo "configure:6858: checking size of char" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6577,7 +6862,7 @@ else
   ac_cv_sizeof_char=1
 else
   cat > conftest.$ac_ext <<EOF
-#line 6581 "configure"
+#line 6866 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6588,7 +6873,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_char=`cat conftestval`
 else
@@ -6608,7 +6893,7 @@ EOF
 
 
 echo $ac_n "checking size of short int""... $ac_c" 1>&6
-echo "configure:6612: checking size of short int" >&5
+echo "configure:6897: checking size of short int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6616,7 +6901,7 @@ else
   ac_cv_sizeof_short_int=2
 else
   cat > conftest.$ac_ext <<EOF
-#line 6620 "configure"
+#line 6905 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6627,7 +6912,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short_int=`cat conftestval`
 else
@@ -6647,7 +6932,7 @@ EOF
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:6651: checking size of int" >&5
+echo "configure:6936: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6655,7 +6940,7 @@ else
   ac_cv_sizeof_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6659 "configure"
+#line 6944 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6666,7 +6951,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -6686,7 +6971,7 @@ EOF
 
 
 echo $ac_n "checking size of long int""... $ac_c" 1>&6
-echo "configure:6690: checking size of long int" >&5
+echo "configure:6975: checking size of long int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6694,7 +6979,7 @@ else
   ac_cv_sizeof_long_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6698 "configure"
+#line 6983 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6705,7 +6990,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_int=`cat conftestval`
 else
@@ -6725,7 +7010,7 @@ EOF
 
 
 echo $ac_n "checking size of long long int""... $ac_c" 1>&6
-echo "configure:6729: checking size of long long int" >&5
+echo "configure:7014: checking size of long long int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6733,7 +7018,7 @@ else
   ac_cv_sizeof_long_long_int=8
 else
   cat > conftest.$ac_ext <<EOF
-#line 6737 "configure"
+#line 7022 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6744,7 +7029,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long_int=`cat conftestval`
 else
@@ -6764,7 +7049,7 @@ EOF
 
 
 echo $ac_n "checking size of int *""... $ac_c" 1>&6
-echo "configure:6768: checking size of int *" >&5
+echo "configure:7053: checking size of int *" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6772,7 +7057,7 @@ else
   ac_cv_sizeof_int_p=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6776 "configure"
+#line 7061 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6783,7 +7068,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int_p=`cat conftestval`
 else
@@ -6805,20 +7090,20 @@ EOF
 
 # Check for sys/types.h types
 echo $ac_n "checking for u_int type""... $ac_c" 1>&6
-echo "configure:6809: checking for u_int type" >&5
+echo "configure:7094: checking for u_int type" >&5
 if eval "test \"`echo '$''{'ac_cv_have_u_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6815 "configure"
+#line 7100 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_int a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_int="yes" 
 else
@@ -6842,20 +7127,20 @@ EOF
 fi
 
 echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6
-echo "configure:6846: checking for intmax_t type" >&5
+echo "configure:7131: checking for intmax_t type" >&5
 if eval "test \"`echo '$''{'ac_cv_have_intmax_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 6852 "configure"
+#line 7137 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intmax_t="yes" 
 else
@@ -6864,14 +7149,14 @@ else
   rm -rf conftest*
    
         cat > conftest.$ac_ext <<EOF
-#line 6868 "configure"
+#line 7153 "configure"
 #include "confdefs.h"
  #include <stdint.h> 
 int main() {
  intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intmax_t="yes" 
 else
@@ -6901,20 +7186,20 @@ fi
 
 
 echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6
-echo "configure:6905: checking for u_intmax_t type" >&5
+echo "configure:7190: checking for u_intmax_t type" >&5
 if eval "test \"`echo '$''{'ac_cv_have_u_intmax_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 6911 "configure"
+#line 7196 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intmax_t="yes" 
 else
@@ -6923,14 +7208,14 @@ else
   rm -rf conftest*
    
         cat > conftest.$ac_ext <<EOF
-#line 6927 "configure"
+#line 7212 "configure"
 #include "confdefs.h"
  #include <stdint.h> 
 int main() {
  u_intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intmax_t="yes" 
 else
@@ -6959,20 +7244,20 @@ fi
 
 
 echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6
-echo "configure:6963: checking for intXX_t types" >&5
+echo "configure:7248: checking for intXX_t types" >&5
 if eval "test \"`echo '$''{'ac_cv_have_intxx_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 6969 "configure"
+#line 7254 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  int8_t a; int16_t b; int32_t c; a = b = c = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intxx_t="yes" 
 else
@@ -6996,20 +7281,20 @@ EOF
 fi
        
 echo $ac_n "checking for int64_t type""... $ac_c" 1>&6
-echo "configure:7000: checking for int64_t type" >&5
+echo "configure:7285: checking for int64_t type" >&5
 if eval "test \"`echo '$''{'ac_cv_have_int64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 7006 "configure"
+#line 7291 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  int64_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:7013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_int64_t="yes" 
 else
@@ -7033,20 +7318,20 @@ EOF
 fi
        
 echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6
-echo "configure:7037: checking for u_intXX_t types" >&5
+echo "configure:7322: checking for u_intXX_t types" >&5
 if eval "test \"`echo '$''{'ac_cv_have_u_intxx_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 7043 "configure"
+#line 7328 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:7050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intxx_t="yes" 
 else
@@ -7070,20 +7355,20 @@ EOF
 fi
 
 echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6
-echo "configure:7074: checking for u_int64_t types" >&5
+echo "configure:7359: checking for u_int64_t types" >&5
 if eval "test \"`echo '$''{'ac_cv_have_u_int64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
    cat > conftest.$ac_ext <<EOF
-#line 7080 "configure"
+#line 7365 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_int64_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:7087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_int64_t="yes" 
 else
@@ -7110,9 +7395,9 @@ if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
 then
    echo $ac_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h""... $ac_c" 1>&6
-echo "configure:7114: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
+echo "configure:7399: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
    cat > conftest.$ac_ext <<EOF
-#line 7116 "configure"
+#line 7401 "configure"
 #include "confdefs.h"
  #include <sys/bitypes.h>  
 int main() {
@@ -7121,7 +7406,7 @@ int main() {
        a = b = c = e = f = g = 1;  
 ; return 0; }
 EOF
-if { (eval echo configure:7125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    cat >> confdefs.h <<\EOF
 #define HAVE_U_INTXX_T 1
@@ -7148,13 +7433,13 @@ fi
 
 if test -z "$have_u_intxx_t" ; then
    echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6
-echo "configure:7152: checking for uintXX_t types" >&5
+echo "configure:7437: checking for uintXX_t types" >&5
 if eval "test \"`echo '$''{'ac_cv_have_uintxx_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 7158 "configure"
+#line 7443 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
@@ -7162,7 +7447,7 @@ int main() {
           uint32_t c; a = b = c = 1; 
 ; return 0; }
 EOF
-if { (eval echo configure:7166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_uintxx_t="yes" 
 else
@@ -7202,12 +7487,12 @@ for ac_func in \
        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7206: checking for $ac_func" >&5
+echo "configure:7491: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7211 "configure"
+#line 7496 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7230,7 +7515,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7260,12 +7545,12 @@ done
 for ac_func in fchdir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7264: checking for $ac_func" >&5
+echo "configure:7549: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7269 "configure"
+#line 7554 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7288,7 +7573,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7316,15 +7601,15 @@ fi
 done
 
 
-for ac_func in snprintf vsnprintf
+for ac_func in snprintf vsnprintf gethostid getdomainname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7323: checking for $ac_func" >&5
+echo "configure:7608: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7328 "configure"
+#line 7613 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7347,7 +7632,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7375,12 +7660,12 @@ done
 for ac_func in localtime_r readdir_r strerror_r gethostbyname_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7379: checking for $ac_func" >&5
+echo "configure:7664: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7384 "configure"
+#line 7669 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7403,7 +7688,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7430,12 +7715,12 @@ done
 
 # If resolver functions are not in libc check for -lnsl or -lresolv.
 echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6
-echo "configure:7434: checking for gethostbyname_r" >&5
+echo "configure:7719: checking for gethostbyname_r" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7439 "configure"
+#line 7724 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname_r(); below.  */
@@ -7458,7 +7743,7 @@ gethostbyname_r();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname_r=yes"
 else
@@ -7476,7 +7761,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6
-echo "configure:7480: checking for gethostbyname_r in -lnsl" >&5
+echo "configure:7765: checking for gethostbyname_r in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname_r | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7484,7 +7769,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7488 "configure"
+#line 7773 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7495,7 +7780,7 @@ int main() {
 gethostbyname_r()
 ; return 0; }
 EOF
-if { (eval echo configure:7499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7523,7 +7808,7 @@ else
 fi
 
     echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6
-echo "configure:7527: checking for gethostbyname_r in -lresolv" >&5
+echo "configure:7812: checking for gethostbyname_r in -lresolv" >&5
 ac_lib_var=`echo resolv'_'gethostbyname_r | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7531,7 +7816,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7535 "configure"
+#line 7820 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7542,7 +7827,7 @@ int main() {
 gethostbyname_r()
 ; return 0; }
 EOF
-if { (eval echo configure:7546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7575,12 +7860,12 @@ fi
 
 # Find where sockets are (especially for Solaris)
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:7579: checking for socket" >&5
+echo "configure:7864: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7584 "configure"
+#line 7869 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -7603,7 +7888,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -7621,7 +7906,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6
-echo "configure:7625: checking for socket in -lxnet" >&5
+echo "configure:7910: checking for socket in -lxnet" >&5
 ac_lib_var=`echo xnet'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7629,7 +7914,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7633 "configure"
+#line 7918 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7640,7 +7925,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7668,7 +7953,7 @@ else
 fi
 
     echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:7672: checking for socket in -lsocket" >&5
+echo "configure:7957: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7676,7 +7961,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7680 "configure"
+#line 7965 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7687,7 +7972,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7715,7 +8000,7 @@ else
 fi
 
     echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:7719: checking for socket in -linet" >&5
+echo "configure:8004: checking for socket in -linet" >&5
 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7723,7 +8008,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7727 "configure"
+#line 8012 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7734,7 +8019,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7766,12 +8051,12 @@ fi
 
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:7770: checking for strftime" >&5
+echo "configure:8055: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7775 "configure"
+#line 8060 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -7794,7 +8079,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -7816,7 +8101,7 @@ else
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:7820: checking for strftime in -lintl" >&5
+echo "configure:8105: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7824,7 +8109,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7828 "configure"
+#line 8113 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7835,7 +8120,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:7839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7862,12 +8147,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7866: checking for vprintf" >&5
+echo "configure:8151: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7871 "configure"
+#line 8156 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -7890,7 +8175,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -7914,12 +8199,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7918: checking for _doprnt" >&5
+echo "configure:8203: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7923 "configure"
+#line 8208 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -7942,7 +8227,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -7969,19 +8254,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:7973: checking for working alloca.h" >&5
+echo "configure:8258: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7978 "configure"
+#line 8263 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:7985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -8002,12 +8287,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8006: checking for alloca" >&5
+echo "configure:8291: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8011 "configure"
+#line 8296 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8035,7 +8320,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -8067,12 +8352,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8071: checking whether alloca needs Cray hooks" >&5
+echo "configure:8356: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8076 "configure"
+#line 8361 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8097,12 +8382,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8101: checking for $ac_func" >&5
+echo "configure:8386: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8106 "configure"
+#line 8391 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8125,7 +8410,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8152,7 +8437,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8156: checking stack direction for C alloca" >&5
+echo "configure:8441: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8160,7 +8445,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 8164 "configure"
+#line 8449 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8179,7 +8464,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -8202,7 +8487,7 @@ fi
 
 # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
 echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6
-echo "configure:8206: checking for getmntent in -lsun" >&5
+echo "configure:8491: checking for getmntent in -lsun" >&5
 ac_lib_var=`echo sun'_'getmntent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8210,7 +8495,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8214 "configure"
+#line 8499 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8221,7 +8506,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8240,7 +8525,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6
-echo "configure:8244: checking for getmntent in -lseq" >&5
+echo "configure:8529: checking for getmntent in -lseq" >&5
 ac_lib_var=`echo seq'_'getmntent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8248,7 +8533,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lseq  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8252 "configure"
+#line 8537 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8259,7 +8544,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8278,7 +8563,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6
-echo "configure:8282: checking for getmntent in -lgen" >&5
+echo "configure:8567: checking for getmntent in -lgen" >&5
 ac_lib_var=`echo gen'_'getmntent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8286,7 +8571,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8290 "configure"
+#line 8575 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8297,7 +8582,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8322,12 +8607,12 @@ fi
 fi
 
 echo $ac_n "checking for getmntent""... $ac_c" 1>&6
-echo "configure:8326: checking for getmntent" >&5
+echo "configure:8611: checking for getmntent" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getmntent'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8331 "configure"
+#line 8616 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getmntent(); below.  */
@@ -8350,7 +8635,7 @@ getmntent();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getmntent=yes"
 else
@@ -8373,7 +8658,7 @@ else
 fi
 
 echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
-echo "configure:8377: checking whether closedir returns void" >&5
+echo "configure:8662: checking whether closedir returns void" >&5
 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8381,13 +8666,13 @@ else
   ac_cv_func_closedir_void=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8385 "configure"
+#line 8670 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_header_dirent>
 int closedir(); main() { exit(closedir(opendir(".")) != 0); }
 EOF
-if { (eval echo configure:8391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_closedir_void=no
 else
@@ -8410,7 +8695,7 @@ EOF
 fi
 
 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8414: checking whether setpgrp takes no argument" >&5
+echo "configure:8699: checking whether setpgrp takes no argument" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8418,7 +8703,7 @@ else
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 8422 "configure"
+#line 8707 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -8438,7 +8723,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:8442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setpgrp_void=no
 else
@@ -8461,7 +8746,7 @@ EOF
 
 fi
                      echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8465: checking for working fnmatch" >&5
+echo "configure:8750: checking for working fnmatch" >&5
 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8472,11 +8757,11 @@ if test "$cross_compiling" = yes; then
   ac_cv_func_fnmatch_works=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8476 "configure"
+#line 8761 "configure"
 #include "confdefs.h"
 main() { exit (fnmatch ("a*", "abc", 0) != 0); }
 EOF
-if { (eval echo configure:8480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_fnmatch_works=yes
 else
@@ -8501,7 +8786,7 @@ fi
 
 
 echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:8505: checking for setlocale in -lxpg4" >&5
+echo "configure:8790: checking for setlocale in -lxpg4" >&5
 ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8509,7 +8794,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxpg4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8513 "configure"
+#line 8798 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8520,7 +8805,7 @@ int main() {
 setlocale()
 ; return 0; }
 EOF
-if { (eval echo configure:8524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8543,7 +8828,7 @@ fi
 
 
 echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6
-echo "configure:8547: checking for getpwnam in -lsun" >&5
+echo "configure:8832: checking for getpwnam in -lsun" >&5
 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8551,7 +8836,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8555 "configure"
+#line 8840 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8562,7 +8847,7 @@ int main() {
 getpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8594,17 +8879,17 @@ for ac_hdr in zlib.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8598: checking for $ac_hdr" >&5
+echo "configure:8883: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8603 "configure"
+#line 8888 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8631,7 +8916,7 @@ fi
 done
 
 echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:8635: checking for deflate in -lz" >&5
+echo "configure:8920: checking for deflate in -lz" >&5
 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8639,7 +8924,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8643 "configure"
+#line 8928 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8650,7 +8935,7 @@ int main() {
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8681,7 +8966,7 @@ fi
 
 PTHREAD_LIB=""
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:8685: checking for pthread_create in -lpthread" >&5
+echo "configure:8970: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8689,7 +8974,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8693 "configure"
+#line 8978 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8700,7 +8985,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8719,7 +9004,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:8723: checking for pthread_create in -lpthreads" >&5
+echo "configure:9008: checking for pthread_create in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8727,7 +9012,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8731 "configure"
+#line 9016 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8738,7 +9023,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8757,7 +9042,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:8761: checking for pthread_create in -lc_r" >&5
+echo "configure:9046: checking for pthread_create in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8765,7 +9050,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8769 "configure"
+#line 9054 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8776,7 +9061,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8795,12 +9080,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:8799: checking for pthread_create" >&5
+echo "configure:9084: checking for pthread_create" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8804 "configure"
+#line 9089 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create(); below.  */
@@ -8823,7 +9108,7 @@ pthread_create();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_create=yes"
 else
@@ -8941,6 +9226,7 @@ freebsd)
            platforms/freebsd/bacula-sd \
            platforms/freebsd/bacula-dir"
        hostname=`hostname -s`
+       ac_cv_sys_largefile_CFLAGS="yes"
   ;;
 hpux)
        DISTVER=`uname -r`
@@ -9186,6 +9472,8 @@ trap 'rm -fr `echo "autoconf/Make.common \
           src/cats/create_bdb_database \
           src/cats/make_bdb_tables \
           src/cats/drop_bdb_tables \
+          src/cats/make_bacula_tables \
+          src/cats/drop_bacula_tables \
           src/findlib/Makefile \
           src/tools/Makefile \
           $PFILES  src/config.h:autoconf/config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
@@ -9301,6 +9589,7 @@ s%@GNOME_APPLETS_LIBS@%$GNOME_APPLETS_LIBS%g
 s%@GNOME_DOCKLETS_LIBS@%$GNOME_DOCKLETS_LIBS%g
 s%@GNOME_CAPPLET_LIBS@%$GNOME_CAPPLET_LIBS%g
 s%@GNOME_DIR@%$GNOME_DIR%g
+s%@TTOOL_LDFLAGS@%$TTOOL_LDFLAGS%g
 s%@CONS_INC@%$CONS_INC%g
 s%@CONS_LIBS@%$CONS_LIBS%g
 s%@CONS_LDFLAGS@%$CONS_LDFLAGS%g
@@ -9333,6 +9622,12 @@ s%@SQL_BINDIR@%$SQL_BINDIR%g
 s%@cats@%$cats%g
 s%@DB_NAME@%$DB_NAME%g
 s%@EXEEXT@%$EXEEXT%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@GETCONF@%$GETCONF%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
@@ -9434,6 +9729,8 @@ CONFIG_FILES=\${CONFIG_FILES-"autoconf/Make.common \
           src/cats/create_bdb_database \
           src/cats/make_bdb_tables \
           src/cats/drop_bdb_tables \
+          src/cats/make_bacula_tables \
+          src/cats/drop_bacula_tables \
           src/findlib/Makefile \
           src/tools/Makefile \
           $PFILES "}
@@ -9648,6 +9945,7 @@ Configuration on `date`:
   Compiler flags:            ${CFLAGS} 
   Linker flags:              ${LDFLAGS}
   Libraries:                 ${LIBS}
+  Statically Linked Tools:    ${support_static_tools}
   Database found:            ${have_db}
   Database type:             ${db_name}
   Database lib:              ${DB_LIBS}
@@ -9661,6 +9959,7 @@ Configuration on `date`:
   Working directory          ${working_dir}
   SQL binaries Directory      ${SQL_BINDIR}
 
+  Large file support:        $ac_cv_sys_largefile_CFLAGS
   readline support:          ${got_readline} ${PRTREADLINE_SRC}
   cweb support:              ${got_cweb} ${CWEB_SRC}
   TCP Wrappers support:       ${TCPW_MSG}
index 435568580192e3ec037733cf12d05c45d2345a72..7762d0458cb757f18e8bac6eef315ad51c3a719f 100644 (file)
@@ -1,5 +1,5 @@
                  Kern's ToDo List
-                  04 September 2002
+                 14 September 2002
 
 Irix conversion notes:
 - no uuencode
@@ -25,15 +25,14 @@ From Chuck:
 --should be able to specify e.g. --with-sqlite=/opt/local and have it find
   lib, bin, sbin for itself
   I tried this and it didn't find sqlite.h
---sd.conf password does not match dir.conf storage password
 =======
 
-- Apparently Description records are not freed. Storage daemon
-  Device reported orphaned buffer 45 bytes probably for a Description.
+- Take another stab at 64 bit file addresses
+- When Marking a file in Restore that is a hard link, also
+  mark the link so that the data will be reloaded.
+- Restore program that errors in SD due to no tape reports
+  OK incorrectly in output.
 - Write updated bootstrap after every Job.
-- Correct Warning: Volume name mismatch. Wanted test2 got test1
-  when reading a tape and want the next one.
-- Implement autochanger for restore. ARRRGGG! I forgot!
 - Make BSR accept count (total files to be restored).
 - Make BSR return next_block when it knows record is not
   in block, done when count is reached, and possibly other
@@ -586,4 +585,9 @@ Done: (see kernsdone for more)
 - When we are at EOM, we must ask each job to write JobMedia
   record (update_volume_info).
 - Create all pools when Director starts
-
+- Correct Warning: Volume name mismatch. Wanted test2 got test1
+  when reading a tape and want the next one.
+- Implement autochanger for restore. ARRRGGG! I forgot!
+- sd.conf password does not match dir.conf storage password
+- Apparently Description records are not freed. Storage daemon
+  Device reported orphaned buffer 45 bytes probably for a Description.
index 1a4543fe8dab5b159da42b33d7d8e730b647bc6d..d7d61ed4c179abd3ab38b5daa01a69e6683131f1 100644 (file)
@@ -323,6 +323,12 @@ extern int thr_setconcurrency(int);
 #define socklen_t int
 #endif
 
+#ifdef HAVE_CYGWIN
+/* They don't really have it */
+#undef HAVE_GETDOMAINNAME
+#endif
+
 #define ALIGN_SIZE (sizeof(double))
 #define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
 
index fb95ca7280556347094f0bcc21f9f5cfc5f5da08..0120ba162a1eb4290f4c768bbd3ba90840b8d847 100644 (file)
@@ -15,3 +15,5 @@ make_mysql_tables
 make_sqlite_tables
 mysql
 sqlite
+make_bacula_tables
+drop_bacula_tables
index 83e6025ab66b24fd1d5b4f96c878af094a42f0de..0c1ad39002442614e3f437bc6bfecddd3b7ac1fc 100644 (file)
@@ -546,7 +546,6 @@ int db_get_fileset_record(B_DB *mdb, FILESET_DBR *fsr)
         char ed1[30];
          Mmsg1(&mdb->errmsg, _("Got %s FileSets expected only one!\n"), 
            edit_uint64(mdb->num_rows, ed1));
-         Jmsg(mdb->jcr, M_ERROR, 0, "%s", mdb->errmsg);
         sql_data_seek(mdb, mdb->num_rows-1);
       }
       if ((row = sql_fetch_row(mdb)) == NULL) {
index 49b8beb2f14b2f856975d82d6d5564fb6dcd619f..3cae3d559939803983d21120e8eacd26ea1980ae 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <termios.h>
 #include "bacula.h"
 #include "console_conf.h"
 #include "jcr.h"
-
+#include <termios.h>
 /* Imported functions */
 int authenticate_director(JCR *jcr, DIRRES *director);
 
index 575cd0fa34d81f07e7a41baaee7e36d7bc2e94a2..98028b87e1a81708eb950f2c9597876ecb7fae75 100644 (file)
@@ -147,10 +147,12 @@ void free_resource(int type)
 
    /* common stuff -- free the resource name */
    nres = (RES *)res->res_dir.hdr.next;
-   if (res->res_dir.hdr.name)
+   if (res->res_dir.hdr.name) {
       free(res->res_dir.hdr.name);
-   if (res->res_dir.hdr.desc)
+   }
+   if (res->res_dir.hdr.desc) {
       free(res->res_dir.hdr.desc);
+   }
 
    switch (type) {
       case R_CONSOLE:
index 456004df8b6b509b82d58b3a9de6c5bdff2e1b78..1ce4f0a05c9e3a6ce7fbcdc875c65d3b458817eb 100644 (file)
@@ -55,11 +55,14 @@ static char Dir_sorry[]  = N_("1999 You are not authorized.\n");
 int authenticate_storage_daemon(JCR *jcr)
 {
    BSOCK *sd = jcr->store_bsock;
+   char dirname[MAX_NAME_LENGTH];
 
    /* 
     * Send my name to the Storage daemon then do authentication
     */
-   if (!bnet_fsend(sd, hello, director->hdr.name)) {
+   strcpy(dirname, director->hdr.name);
+   bash_spaces(dirname);
+   if (!bnet_fsend(sd, hello, dirname)) {
       Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to Storage daemon. ERR=%s\n"), bnet_strerror(sd));
       return 0;
    }
@@ -88,10 +91,13 @@ int authenticate_storage_daemon(JCR *jcr)
 int authenticate_file_daemon(JCR *jcr)
 {
    BSOCK *fd = jcr->file_bsock;
+   char dirname[MAX_NAME_LENGTH];
 
    /* 
     * Send my name to the File daemon then do authentication
     */
+   strcpy(dirname, director->hdr.name);
+   bash_spaces(dirname);
    if (!bnet_fsend(fd, hello, director->hdr.name)) {
       Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), bnet_strerror(fd));
       return 0;
index b101b46d116e2eb6a534e38f536ecd015094bae3..48aa2f9a60a6c8a6392d7131094947b53c4a65a3 100644 (file)
@@ -297,6 +297,7 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since)
    int msg_type;
    MEDIA_DBR mr;
    double kbps;
+   btime_t RunTime;
 
    Dmsg0(100, "Enter backup_cleanup()\n");
    memset(&mr, 0, sizeof(mr));
@@ -343,7 +344,11 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since)
    }
    bstrftime(sdt, sizeof(sdt), jcr->jr.StartTime);
    bstrftime(edt, sizeof(edt), jcr->jr.EndTime);
-   kbps = (double)jcr->jr.JobBytes / (1000 * (jcr->jr.EndTime - jcr->jr.StartTime));
+   RunTime = jcr->jr.EndTime - jcr->jr.StartTime;
+   if (RunTime <= 0) {
+      RunTime = 1;
+   }
+   kbps = (double)jcr->jr.JobBytes / (1000 * RunTime);
    if (!db_get_job_volume_names(jcr->db, jcr->jr.JobId, &jcr->VolumeName)) {
       jcr->VolumeName[0] = 0;        /* none */
    }
@@ -381,5 +386,33 @@ Termination:            %s\n\n"),
        edit_uint64_with_commas(mr.VolBytes, ec3),
        term_msg);
 
+
+   /* Now update the bootstrap file if any */
+   if (jcr->job->WriteBootstrap) {
+      FILE *fd;
+      int got_pipe = 0;
+      char *fname = jcr->job->WriteBootstrap;
+
+      if (*fname == '|') {
+        fname++;
+        got_pipe = 1;
+         fd = popen(fname, "w");
+      } else {
+         fd = fopen(fname, jcr->JobLevel==L_FULL?"w+":"a+");
+      }
+      if (!fd) {
+         Jmsg(jcr, M_ERROR, 0, _("Could not open WriteBootstrap file:\n"
+              "%s: ERR=%s\n"), fname, strerror(errno));
+        return;
+      }
+      fprintf(fd, "Volume=\"%s\"\n", jcr->VolumeName);
+      fprintf(fd, "VolSessionId=%u\n", jcr->VolSessionId);
+      fprintf(fd, "VolSessionTime=%u\n", jcr->VolSessionTime);
+      if (got_pipe) {
+        pclose(fd);
+      } else {
+        fclose(fd);
+      }
+   }
    Dmsg0(100, "Leave backup_cleanup()\n");
 }
index 60697cafa40268c1699ef52219823cef865d89ca..2aaae00f78ef6faf337fe775c0b7b471dba75674 100644 (file)
@@ -42,7 +42,7 @@
 
 /* Requests from the Storage daemon */
 static char Find_media[] = "CatReq Job=%127s FindMedia=%d\n";
-static char Get_Vol_Info[] = "CatReq Job=%127s GetVolInfo VolName=%127s\n";
+static char Get_Vol_Info[] = "CatReq Job=%127s GetVolInfo VolName=%127s write=%d\n";
 
 static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s\
  VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
@@ -69,7 +69,7 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
    MEDIA_DBR mr; 
    JOBMEDIA_DBR jm;
    char Job[MAX_NAME_LENGTH];
-   int index, ok, relabel;
+   int index, ok, relabel, writing;
    char *omsg;
 
    memset(&mr, 0, sizeof(mr));
@@ -121,24 +121,32 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
    /* 
     * Request to find specific Volume information
     */
-   } else if (sscanf(bs->msg, Get_Vol_Info, &Job, &mr.VolumeName) == 2) {
+   } else if (sscanf(bs->msg, Get_Vol_Info, &Job, &mr.VolumeName, &writing) == 3) {
       Dmsg1(120, "CatReq GetVolInfo Vol=%s\n", mr.VolumeName);
       /*
        * Find the Volume
        */
       unbash_spaces(mr.VolumeName);
       if (db_get_media_record(jcr->db, &mr)) {
+        int VolSuitable = 0;
         jcr->MediaId = mr.MediaId;
          Dmsg1(120, "VolumeInfo MediaId=%d\n", jcr->MediaId);
         strcpy(jcr->VolumeName, mr.VolumeName);
-        /* 
-         * Make sure this volume is suitable for this job, i.e.
-         *  it is either Append or Recycle and Media Type matches.
-         */
-        if (mr.PoolId == jcr->PoolId && 
-             (strcmp(mr.VolStatus, "Append") == 0 ||
-              strcmp(mr.VolStatus, "Recycle") == 0) &&
-            strcmp(mr.MediaType, jcr->store->media_type) == 0) {
+        if (!writing) {
+           VolSuitable = 1;          /* accept anything for read */
+        } else {
+           /* 
+            * Make sure this volume is suitable for this job, i.e.
+            *  it is either Append or Recycle and Media Type matches.
+            */
+           if (mr.PoolId == jcr->PoolId && 
+                (strcmp(mr.VolStatus, "Append") == 0 ||
+                 strcmp(mr.VolStatus, "Recycle") == 0 ||
+                strcmp(mr.MediaType, jcr->store->media_type) == 0)) {
+              VolSuitable = 1;
+           }
+        }
+        if (VolSuitable) {
            /*
             * Send Find Media response to Storage daemon 
             */
@@ -147,8 +155,8 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
               mr.VolFiles, mr.VolBlocks, mr.VolBytes, mr.VolMounts, mr.VolErrors,
               mr.VolWrites, mr.VolMaxBytes, mr.VolCapacityBytes,
               mr.VolStatus, mr.Slot);
-            Dmsg4(100, "get_media_record PoolId=%d wanted %d, Status=%s, \
-MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.MediaType);
+            Dmsg5(200, "get_media_record PoolId=%d wanted %d, Status=%s, Slot=%d \
+MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType);
         } else { 
            /* Not suitable volume */
             bnet_fsend(bs, "1998 Volume not appropriate.\n");
index 5099207b4c11c451d371e5506b633eeb5996e53c..26eed34c9707d2ba2a7cc2c5ce68ff0bde11db56 100644 (file)
@@ -355,14 +355,15 @@ Without that I don't know who I am :-(\n"), configfile);
                            catalog->db_password);
         if (!db_open_database(db)) {
             Jmsg(NULL, M_FATAL,  0, "%s", db_strerror(db));
+        } else {
+           /* If a pool is defined for this job, create the pool DB       
+            *  record if it is not already created. 
+            */
+           if (job->pool) {
+              create_pool(db, job->pool);
+           }
+           db_close_database(db);
         }
-        /* If a pool is defined for this job, create the pool DB       
-         *  record if it is not already created. 
-         */
-        if (job->pool) {
-           create_pool(db, job->pool);
-        }
-        db_close_database(db);
       } else {
         if (job->client) {
             Jmsg(NULL, M_FATAL, 0, _("No Catalog resource defined for client %s\n"), 
index ae3166494c240056336c6139809ded03f11a4db2..2b9c2f781d17452c13cee1f45ca84b7c679ff760 100644 (file)
@@ -181,6 +181,7 @@ static struct res_items job_items[] = {
    {"runbeforejob", store_str,  ITEM(res_job.RunBeforeJob), 0, 0, 0},
    {"runafterjob",  store_str,  ITEM(res_job.RunAfterJob),  0, 0, 0},
    {"spoolattributes", store_yesno, ITEM(res_job.SpoolAttributes), 1, ITEM_DEFAULT, 0},
+   {"writebootstrap", store_dir, ITEM(res_job.WriteBootstrap), 0, 0, 0},
    {NULL, NULL, NULL, 0, 0, 0} 
 };
 
@@ -486,6 +487,9 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ...
         if (res->res_job.RunAfterJob) {
             sendit(sock, "  --> RunAfter=%s\n", NPRT(res->res_job.RunAfterJob));
         }
+        if (res->res_job.WriteBootstrap) {
+            sendit(sock, "  --> WriteBootstrap=%s\n", NPRT(res->res_job.WriteBootstrap));
+        }
         if (res->res_job.storage) {
             sendit(sock, "  --> ");
            dump_resource(-R_STORAGE, (RES *)res->res_job.storage, sendit, sock);
@@ -713,6 +717,9 @@ void free_resource(int type)
         if (res->res_job.RestoreBootstrap) {
            free(res->res_job.RestoreBootstrap);
         }
+        if (res->res_job.WriteBootstrap) {
+           free(res->res_job.WriteBootstrap);
+        }
         if (res->res_job.RunBeforeJob) {
            free(res->res_job.RunBeforeJob);
         }
index 3f5f98e769a00cbb4f0800622ab20f9c940b3802..67a9fb8d15d9418224ddce018a121c36d6bfc860 100644 (file)
 /*
  * Resource codes -- they must be sequential for indexing   
  */
-#define R_FIRST                       1001
-
-#define R_DIRECTOR                    1001
-#define R_CLIENT                      1002
-#define R_JOB                         1003
-#define R_STORAGE                     1004
-#define R_CATALOG                     1005
-#define R_SCHEDULE                    1006
-#define R_FILESET                     1007
-#define R_GROUP                       1008
-#define R_POOL                        1009
-#define R_MSGS                        1010
-#define R_COUNTER                     1011
-
-#define R_LAST                        R_COUNTER
+#define R_FIRST                      1001
+
+#define R_DIRECTOR                   1001
+#define R_CLIENT                     1002
+#define R_JOB                        1003
+#define R_STORAGE                    1004
+#define R_CATALOG                    1005
+#define R_SCHEDULE                   1006
+#define R_FILESET                    1007
+#define R_GROUP                      1008
+#define R_POOL                       1009
+#define R_MSGS                       1010
+#define R_COUNTER                    1011
+
+#define R_LAST                       R_COUNTER
 
 /*
  * Some resource attributes
  */
-#define R_NAME                        1020
-#define R_ADDRESS                     1021
-#define R_PASSWORD                    1022
-#define R_TYPE                        1023
-#define R_BACKUP                      1024
+#define R_NAME                       1020
+#define R_ADDRESS                    1021
+#define R_PASSWORD                   1022
+#define R_TYPE                       1023
+#define R_BACKUP                     1024
 
 
 /* Used for certain KeyWord tables */
-struct s_kw {       
+struct s_kw {      
    char *name;
-   int token;   
+   int token;  
 };
 
 /* Job Level keyword structure */
 struct s_jl {
-   char *level_name;                  /* level keyword */
-   int  level;                        /* level */
-   int  job_type;                     /* JobType permitting this level */
+   char *level_name;                 /* level keyword */
+   int level;                        /* level */
+   int job_type;                     /* JobType permitting this level */
 };
 
 /* Job Type keyword structure */
@@ -78,21 +78,21 @@ struct s_jt {
 /* Definition of the contents of each Resource */
 
 /* 
- *   Director Resource  
+ *   Director Resource 
  *
  */
 struct s_res_dir {
-   RES   hdr;
-   int   DIRport;                     /* where we listen -- UA port server port */
-   char *password;                    /* Password for UA access */
-   char *query_file;                  /* SQL query file */
-   char *working_directory;           /* WorkingDirectory */
-   char *pid_directory;               /* PidDirectory */
-   char *subsys_directory;            /* SubsysDirectory */
+   RES  hdr;
+   int  DIRport;                     /* where we listen -- UA port server port */
+   char *password;                   /* Password for UA access */
+   char *query_file;                 /* SQL query file */
+   char *working_directory;          /* WorkingDirectory */
+   char *pid_directory;              /* PidDirectory */
+   char *subsys_directory;           /* SubsysDirectory */
    struct s_res_msgs *messages;       /* Daemon message handler */
-   int   MaxConcurrentJobs;
-   btime_t FDConnectTimeout;          /* timeout for connect in seconds */
-   btime_t SDConnectTimeout;          /* timeout in seconds */
+   int  MaxConcurrentJobs;
+   btime_t FDConnectTimeout;         /* timeout for connect in seconds */
+   btime_t SDConnectTimeout;         /* timeout in seconds */
 };
 typedef struct s_res_dir DIRRES;
 
@@ -101,12 +101,12 @@ typedef struct s_res_dir DIRRES;
  *
  */
 struct s_res_client {
-   RES   hdr;
+   RES  hdr;
 
-   int   FDport;                      /* Where File daemon listens */
-   int   AutoPrune;                   /* Do automatic pruning? */
-   btime_t FileRetention;             /* file retention period in seconds */
-   btime_t JobRetention;              /* job retention period in seconds */
+   int  FDport;                      /* Where File daemon listens */
+   int  AutoPrune;                   /* Do automatic pruning? */
+   btime_t FileRetention;            /* file retention period in seconds */
+   btime_t JobRetention;             /* job retention period in seconds */
    char *address;
    char *password;
    struct s_res_cat    *catalog;       /* Catalog resource */
@@ -118,15 +118,15 @@ typedef struct s_res_client CLIENT;
  * 
  */
 struct s_res_store {
-   RES   hdr;
+   RES  hdr;
 
-   int   SDport;                      /* port where Directors connect */
-   int   SDDport;                     /* data port for File daemon */
+   int  SDport;                      /* port where Directors connect */
+   int  SDDport;                     /* data port for File daemon */
    char *address;
    char *password;
    char *media_type;
    char *dev_name;   
-   int  autochanger;                  /* set if autochanger */
+   int autochanger;                  /* set if autochanger */
 };
 typedef struct s_res_store STORE;
 
@@ -135,9 +135,9 @@ typedef struct s_res_store STORE;
  *
  */
 struct s_res_cat {
-   RES   hdr;
+   RES  hdr;
 
-   int   DBport;                      /* Port -- not yet implemented */
+   int  DBport;                      /* Port -- not yet implemented */
    char *address;
    char *db_password;
    char *db_user;
@@ -150,29 +150,30 @@ typedef struct s_res_cat CAT;
  *
  */
 struct s_res_job {
-   RES   hdr;
-
-   int   JobType;                     /* job type (backup, verify, restore */
-   int   level;                       /* default backup/verify level */
-   int   RestoreJobId;                /* What -- JobId to restore */
-   char *RestoreWhere;                /* Where on disk to restore -- directory */
-   char *RestoreBootstrap;            /* Bootstrap file */
-   char *RunBeforeJob;                /* Run program before Job */
-   char *RunAfterJob;                 /* Run program after Job */
-   int   RestoreOptions;              /* How (overwrite, ..) */
-   btime_t MaxRunTime;                /* max run time in seconds */
-   btime_t MaxStartDelay;             /* max start delay in seconds */
-   int PruneJobs;                     /* Force pruning of Jobs */
-   int PruneFiles;                    /* Force pruning of Files */
-   int PruneVolumes;                  /* Force pruning of Volumes */
-   int SpoolAttributes;               /* Set to spool attributes in SD */
+   RES  hdr;
+
+   int  JobType;                     /* job type (backup, verify, restore */
+   int  level;                       /* default backup/verify level */
+   int  RestoreJobId;                /* What -- JobId to restore */
+   char *RestoreWhere;               /* Where on disk to restore -- directory */
+   char *RestoreBootstrap;           /* Bootstrap file */
+   char *RunBeforeJob;               /* Run program before Job */
+   char *RunAfterJob;                /* Run program after Job */
+   char *WriteBootstrap;             /* Where to write bootstrap Job updates */
+   int  RestoreOptions;              /* How (overwrite, ..) */
+   btime_t MaxRunTime;               /* max run time in seconds */
+   btime_t MaxStartDelay;            /* max start delay in seconds */
+   int PruneJobs;                    /* Force pruning of Jobs */
+   int PruneFiles;                   /* Force pruning of Files */
+   int PruneVolumes;                 /* Force pruning of Volumes */
+   int SpoolAttributes;              /* Set to spool attributes in SD */
 
    struct s_res_msgs   *messages;     /* How and where to send messages */
    struct s_res_sch    *schedule;     /* When -- Automatic schedule */
    struct s_res_client *client;       /* Who to backup */
    struct s_res_fs     *fileset;      /* What to backup -- Fileset */
    struct s_res_store  *storage;      /* Where is device -- Storage daemon */
-   struct s_res_pool   *pool;         /* Where is media -- Media Pool */
+   struct s_res_pool   *pool;        /* Where is media -- Media Pool */
 };
 typedef struct s_res_job JOB;
 
@@ -181,7 +182,7 @@ typedef struct s_res_job JOB;
  *
  */
 struct s_res_fs {
-   RES   hdr;
+   RES  hdr;
 
    char **include_array;
    int num_includes;
@@ -189,8 +190,8 @@ struct s_res_fs {
    char **exclude_array;
    int num_excludes;
    int exclude_size;
-   int have_MD5;                      /* set if MD5 initialized */
-   struct MD5Context md5c;            /* MD5 of include/exclude */
+   int have_MD5;                     /* set if MD5 initialized */
+   struct MD5Context md5c;           /* MD5 of include/exclude */
 };
 typedef struct s_res_fs FILESET;
  
@@ -200,7 +201,7 @@ typedef struct s_res_fs FILESET;
  *
  */
 struct s_res_sch {
-   RES   hdr;
+   RES  hdr;
 
    struct s_run *run;
 };
@@ -211,7 +212,7 @@ typedef struct s_res_sch SCHED;
  *
  */
 struct s_res_group {
-   RES   hdr;
+   RES  hdr;
 };
 typedef struct s_res_group GROUP;
 
@@ -219,12 +220,12 @@ typedef struct s_res_group GROUP;
  *   Counter Resource
  */
 struct s_res_counter {
-   RES   hdr;
+   RES  hdr;
 
-   int32_t MinValue;                  /* Minimum value */
-   int32_t MaxValue;                  /* Maximum value */
-   int     Global;                    /* global/local */
-   char  *WrapCounter;                /* Wrap counter name */
+   int32_t MinValue;                 /* Minimum value */
+   int32_t MaxValue;                 /* Maximum value */
+   int    Global;                    /* global/local */
+   char  *WrapCounter;               /* Wrap counter name */
 };
 typedef struct s_res_counter COUNTER;
 
@@ -233,19 +234,19 @@ typedef struct s_res_counter COUNTER;
  *
  */
 struct s_res_pool {
-   RES   hdr;
+   RES  hdr;
 
    struct s_res_counter counter;      /* Counter resources */
-   char *pool_type;                   /* Pool type */
-   char *label_format;                /* Label format string */
-   int   use_catalog;                 /* maintain catalog for media */
-   int   catalog_files;               /* maintain file entries in catalog */
-   int   use_volume_once;             /* write on volume only once */
-   int   accept_any_volume;           /* accept any volume */
-   int   max_volumes;                 /* max number of volumes */
-   btime_t VolRetention;              /* volume retention period in seconds */
-   int   AutoPrune;                   /* default for pool auto prune */
-   int   Recycle;                     /* default for media recycle yes/no */
+   char *pool_type;                  /* Pool type */
+   char *label_format;               /* Label format string */
+   int  use_catalog;                 /* maintain catalog for media */
+   int  catalog_files;               /* maintain file entries in catalog */
+   int  use_volume_once;             /* write on volume only once */
+   int  accept_any_volume;           /* accept any volume */
+   int  max_volumes;                 /* max number of volumes */
+   btime_t VolRetention;             /* volume retention period in seconds */
+   int  AutoPrune;                   /* default for pool auto prune */
+   int  Recycle;                     /* default for media recycle yes/no */
 };
 typedef struct s_res_pool POOL;
 
@@ -254,16 +255,16 @@ typedef struct s_res_pool POOL;
  * resource structure definitions.
  */
 union u_res {
-   struct s_res_dir     res_dir;
-   struct s_res_client  res_client;
-   struct s_res_store   res_store;
-   struct s_res_cat     res_cat;
-   struct s_res_job     res_job;
-   struct s_res_fs      res_fs;
-   struct s_res_sch     res_sch;
-   struct s_res_group   res_group;
-   struct s_res_pool    res_pool;
-   struct s_res_msgs    res_msgs;
+   struct s_res_dir    res_dir;
+   struct s_res_client res_client;
+   struct s_res_store  res_store;
+   struct s_res_cat    res_cat;
+   struct s_res_job    res_job;
+   struct s_res_fs     res_fs;
+   struct s_res_sch    res_sch;
+   struct s_res_group  res_group;
+   struct s_res_pool   res_pool;
+   struct s_res_msgs   res_msgs;
    struct s_res_counter res_counter;
    RES hdr;
 };
@@ -273,17 +274,17 @@ typedef union u_res URES;
 
 /* Run structure contained in Schedule Resource */
 struct s_run {
-   struct s_run *next;                /* points to next run record */
-   int level;                         /* level override */
+   struct s_run *next;               /* points to next run record */
+   int level;                        /* level override */
    int job_type;  
-   POOL *pool;                        /* Pool override */
-   STORE *storage;                    /* Storage override */
-   MSGS *msgs;                        /* Messages override */
+   POOL *pool;                       /* Pool override */
+   STORE *storage;                   /* Storage override */
+   MSGS *msgs;                       /* Messages override */
    char *since;
    int level_no;
-   int minute;                        /* minute to run job */
-   time_t last_run;                   /* last time run */
-   time_t next_run;                   /* next time to run */
+   int minute;                       /* minute to run job */
+   time_t last_run;                  /* last time run */
+   time_t next_run;                  /* next time to run */
    char hour[nbytes_for_bits(24)];    /* bit set for each hour */
    char mday[nbytes_for_bits(31)];    /* bit set for each day of month */
    char month[nbytes_for_bits(12)];   /* bit set for each month */
index 814410d2c6eb9b01d38f010eebff5f533b357b00..54303a5d20f81f1487e7b5961a96869bf4f3ac89 100644 (file)
@@ -93,7 +93,7 @@ int start_storage_daemon_job(JCR *jcr)
    int status;
    STORE *storage;
    BSOCK *sd;
-   char auth_key[100];               /* max 17 chars */
+   char auth_key[100];
    char *device_name, *pool_name, *pool_type, *media_type;
    int device_name_len, pool_name_len, pool_type_len, media_type_len;
 
index 069a2336f2ffe85f60505d8da9e5caaacb9ecf37..f2ebc13a9910519f87414d690b4afd57e71d0093 100644 (file)
@@ -120,7 +120,7 @@ char *uar_list_jobs =
    "SELECT JobId,Client.Name as Client,StartTime,Type as "
    "JobType,JobFiles,JobBytes "
    "FROM Client,Job WHERE Client.ClientId=Job.ClientId AND JobStatus='T' "
-   "LIMIT 20";
+   "AND Type='B' LIMIT 20";
 
 #ifdef HAVE_MYSQL
 /*  MYSQL IS NOT STANDARD SQL !!!!! */
index be073043d2c5f4c104139b2bc6a9ae26fbc8c3fe..6fc2cb3b853366b4236d1ccb8d3ff22203bb4ff3 100644 (file)
@@ -538,7 +538,7 @@ static void user_select_files(TREE_CTX *tree)
    bsendmsg(tree->ua, _( 
       "\nYou are now entering file selection mode where you add and\n"
       "remove files to be restored. All files are initially added.\n"
-      "Enter done to leave this mode.\n\n"));
+      "Enter \"done\" to leave this mode.\n\n"));
    /*
     * Enter interactive command handler allowing selection
     *  of individual files.
@@ -955,6 +955,7 @@ extern char *getgroup(gid_t gid);
 static void ls_output(char *buf, char *fname, struct stat *statp)
 {
    char *p, *f;
+   char ec1[30];
    int n;
 
    p = encode_mode(statp->st_mode, buf);
@@ -962,7 +963,7 @@ static void ls_output(char *buf, char *fname, struct stat *statp)
    p += n;
    n = sprintf(p, "%-8.8s %-8.8s", getuser(statp->st_uid), getgroup(statp->st_gid));
    p += n;
-   n = sprintf(p, "%8ld  ", statp->st_size);
+   n = sprintf(p, "%8.8s  ", edit_uint64(statp->st_size, ec1));
    p += n;
    p = encode_time(statp->st_ctime, p);
    *p++ = ' ';
@@ -1150,7 +1151,7 @@ static void get_storage_from_mediatype(UAContext *ua, NAME_LIST *name_list, JobI
    start_prompt(ua, _("The defined Storage resources are:\n"));
    LockRes();
    while ((store = (STORE *)GetNextRes(R_STORAGE, (RES *)store))) {
-      if (strcmp(store->hdr.name, name_list->name[0]) == 0) {
+      if (strcmp(store->media_type, name_list->name[0]) == 0) {
         add_prompt(ua, store->hdr.name);
       }
    }
index 8c99fdeb4278901c093bc8ad52771c03a8fce17d..aed54ac44cb8c86c03ab8320f1373430c87e73bf 100644 (file)
@@ -38,31 +38,32 @@ static char Dir_sorry[] = "2999 No go\n";
  */
 static int authenticate(int rcode, BSOCK *bs)
 {
-   char *name;
+   POOLMEM *dirname;
    DIRRES *director;
 
    if (rcode != R_DIRECTOR) {
       Emsg1(M_FATAL, 0, _("I only authenticate directors, not %d\n"), rcode);
       return 0;
    }
-   name = (char *) get_pool_memory(PM_MESSAGE);
-   name = (char *) check_pool_memory_size(name, bs->msglen);
+   dirname = get_pool_memory(PM_MESSAGE);
+   dirname = check_pool_memory_size(dirname, bs->msglen);
 
-   if (sscanf(bs->msg, "Hello Director %s calling\n", name) != 1) {
-      free_pool_memory(name);
+   if (sscanf(bs->msg, "Hello Director %s calling\n", dirname) != 1) {
+      free_pool_memory(dirname);
       Emsg1(M_FATAL, 0, _("Bad Hello command from Director: %s"), bs->msg);
       return 0;
    }
    director = NULL;
+   unbash_spaces(dirname);
    LockRes();
    while ((director=(DIRRES *)GetNextRes(rcode, (RES *)director))) {
-      if (strcmp(director->hdr.name, name) == 0)
+      if (strcmp(director->hdr.name, dirname) == 0)
         break;
    }
    UnlockRes();
    if (!director) {
-      Emsg1(M_FATAL, 0, _("Connection from unknown Director %s rejected.\n"), name);
-      free_pool_memory(name);
+      Emsg1(M_FATAL, 0, _("Connection from unknown Director %s rejected.\n"), dirname);
+      free_pool_memory(dirname);
       return 0;
    }
    if (!cram_md5_auth(bs, director->password) ||
@@ -70,7 +71,7 @@ static int authenticate(int rcode, BSOCK *bs)
       Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"));
       director = NULL;
    }
-   free_pool_memory(name);
+   free_pool_memory(dirname);
    return (director != NULL);
 }
 
index 52e0a39149632a8f48aeb9e6ef17b985bc42cee9..3bb886ff950411ea913543ee0479d3446fb3b3f8 100644 (file)
@@ -165,10 +165,12 @@ void free_resource(int type)
 
    /* common stuff -- free the resource name */
    nres = (RES *)res->res_dir.hdr.next;
-   if (res->res_dir.hdr.name)
+   if (res->res_dir.hdr.name) {
       free(res->res_dir.hdr.name);
-   if (res->res_dir.hdr.desc)
+   }
+   if (res->res_dir.hdr.desc) {
       free(res->res_dir.hdr.desc);
+   }
 
    switch (type) {
       case R_DIRECTOR:
index 99c1598e74584326857dad9edc58fd54fd74d2e0..a0453f647af3289a2cc4cd7eb68a9da8c661d2ea 100755 (executable)
@@ -357,12 +357,18 @@ void store_str(LEX *lc, struct res_items *item, int index, int pass)
    set_bit(index, res_all.hdr.item_present);
 }
 
-/* Store a directory name at specified address */
+/*
+ * Store a directory name at specified address. Note, we do
+ *   shell expansion except if the string begins with a vertical
+ *   bar (i.e. it will likely be passed to the shell later).
+ */
 void store_dir(LEX *lc, struct res_items *item, int index, int pass)
 {
    lex_get_token(lc, T_STRING);
    if (pass == 1) {
-      do_shell_expansion(lc->str);
+      if (lc->str[0] != '|') {
+        do_shell_expansion(lc->str);
+      }
       *(item->value) = bstrdup(lc->str);
    }
    scan_to_eol(lc);
index 2475840870e9c4a6fd074415774efdff465d7dc1..5ee1231389eecf17b50d036dedc152f0e0ebfbd7 100644 (file)
  */
 
 /* base64.c */
-void      base64_init            (void);
-int       to_base64              (intmax_t value, char *where);
-int       from_base64            (intmax_t *value, char *where);
-void      encode_stat            (char *buf, struct stat *statp);
-void      decode_stat            (char *buf, struct stat *statp);
-int       bin_to_base64          (char *buf, char *bin, int len);
+void     base64_init            (void);
+int      to_base64              (intmax_t value, char *where);
+int      from_base64            (intmax_t *value, char *where);
+void     encode_stat            (char *buf, struct stat *statp);
+void     decode_stat            (char *buf, struct stat *statp);
+int      bin_to_base64          (char *buf, char *bin, int len);
 
 /* bmisc.c */
-char     *bstrncpy               (char *dest, char *src, int maxlen);
-void     *b_malloc               (char *file, int line, size_t size);
+char    *bstrncpy               (char *dest, char *src, int maxlen);
+void    *b_malloc               (char *file, int line, size_t size);
 #ifndef DEBUG
-void     *bmalloc                (size_t size);
+void    *bmalloc                (size_t size);
 #endif
-void     *brealloc               (void *buf, size_t size);
-void     *bcalloc                (size_t size1, size_t size2);
-int       bsnprintf              (char *str, size_t size, const  char  *format, ...);
-int       bvsnprintf             (char *str, size_t size, const char  *format, va_list ap);
-int       pool_sprintf           (char *pool_buf, char *fmt, ...);
-void      create_pid_file        (char *dir, char *progname, int port);
-int       delete_pid_file        (char *dir, char *progname, int port);
+void    *brealloc               (void *buf, size_t size);
+void    *bcalloc                (size_t size1, size_t size2);
+int      bsnprintf              (char *str, size_t size, const  char  *format, ...);
+int      bvsnprintf             (char *str, size_t size, const char  *format, va_list ap);
+int      pool_sprintf           (char *pool_buf, char *fmt, ...);
+void     create_pid_file        (char *dir, char *progname, int port);
+int      delete_pid_file        (char *dir, char *progname, int port);
 #ifndef HAVE_STRERROR_R
-int       strerror_r             (int errnum, char *buf, size_t bufsiz);
+int      strerror_r             (int errnum, char *buf, size_t bufsiz);
 #endif
 
 
 /* bnet.c */
-int32_t    bnet_recv             (BSOCK *bsock);
-int        bnet_send             (BSOCK *bsock);
-int        bnet_fsend              (BSOCK *bs, char *fmt, ...);
-int        bnet_set_buffer_size    (BSOCK *bs, uint32_t size, int rw);
-int        bnet_sig                (BSOCK *bs, int sig);
-BSOCK *    bnet_connect            (void *jcr, int retry_interval,
-               int max_retry_time, char *name, char *host, char *service, 
-               int port, int verbose);
-int        bnet_wait_data         (BSOCK *bsock, int sec);
-void       bnet_close            (BSOCK *bsock);
-BSOCK *    init_bsock            (void *jcr, int sockfd, char *who, char *ip, int port);
-BSOCK *    dup_bsock             (BSOCK *bsock);
-void       term_bsock            (BSOCK *bsock);
-char *     bnet_strerror         (BSOCK *bsock);
-char *     bnet_sig_to_ascii     (BSOCK *bsock);
-int        bnet_wait_data        (BSOCK *bsock, int sec);
-int        bnet_despool          (BSOCK *bsock);
+int32_t    bnet_recv            (BSOCK *bsock);
+int       bnet_send             (BSOCK *bsock);
+int       bnet_fsend              (BSOCK *bs, char *fmt, ...);
+int       bnet_set_buffer_size    (BSOCK *bs, uint32_t size, int rw);
+int       bnet_sig                (BSOCK *bs, int sig);
+BSOCK *    bnet_connect           (void *jcr, int retry_interval,
+              int max_retry_time, char *name, char *host, char *service, 
+              int port, int verbose);
+int       bnet_wait_data         (BSOCK *bsock, int sec);
+void      bnet_close            (BSOCK *bsock);
+BSOCK *    init_bsock           (void *jcr, int sockfd, char *who, char *ip, int port);
+BSOCK *    dup_bsock            (BSOCK *bsock);
+void      term_bsock            (BSOCK *bsock);
+char *    bnet_strerror         (BSOCK *bsock);
+char *    bnet_sig_to_ascii     (BSOCK *bsock);
+int       bnet_wait_data        (BSOCK *bsock, int sec);
+int       bnet_despool          (BSOCK *bsock);
 
 
 /* cram-md5.c */
 int cram_md5_get_auth(BSOCK *bs, char *password);
 int cram_md5_auth(BSOCK *bs, char *password);
 void hmac_md5(uint8_t* text, int text_len, uint8_t*  key,
-              int key_len, uint8_t *hmac);
+             int key_len, uint8_t *hmac);
 
 /* create_file.c */
 int create_file(void *jcr, char *fname, char *ofile, char *lname,
-                       int type, struct stat *statp, int *ofd);
+                      int type, struct stat *statp, int *ofd);
 int set_statp(void *jcr, char *fname, char *ofile, char *lname, int type, 
-                       struct stat *statp);
+                      struct stat *statp);
 
 
 /* crc32.c */
 uint32_t bcrc32(uint8_t *buf, int len);
 
 /* daemon.c */
-void     daemon_start            ();
+void    daemon_start            ();
 
 /* lex.c */
-LEX *     lex_close_file         (LEX *lf);
-LEX *     lex_open_file          (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error);
-int       lex_get_char           (LEX *lf);
-void      lex_unget_char         (LEX *lf);
-char *    lex_tok_to_str         (int token);
-int       lex_get_token          (LEX *lf, int expect);
+LEX *    lex_close_file         (LEX *lf);
+LEX *    lex_open_file          (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error);
+int      lex_get_char           (LEX *lf);
+void     lex_unget_char         (LEX *lf);
+char *   lex_tok_to_str         (int token);
+int      lex_get_token          (LEX *lf, int expect);
 
 /* makepath.c */
 int make_path(
-           void *jcr,
-           const char *argpath,
-           int mode,
-           int parent_mode,
-           uid_t owner,
-           gid_t group,
-           int preserve_existing,
-           char *verbose_fmt_string);
+          void *jcr,
+          const char *argpath,
+          int mode,
+          int parent_mode,
+          uid_t owner,
+          gid_t group,
+          int preserve_existing,
+          char *verbose_fmt_string);
 
 
 /* message.c */
-void       my_name_is            (int argc, char *argv[], char *name);
-void       init_msg              (void *jcr, MSGS *msg);
-void       term_msg              (void);
-void       close_msg             (void *jcr);
-void       add_msg_dest          (MSGS *msg, int dest, int type, char *where, char *dest_code);
-void       rem_msg_dest          (MSGS *msg, int dest, int type, char *where);
-void       Jmsg                  (void *jcr, int type, int level, char *fmt, ...);
-void       dispatch_message      (void *jcr, int type, int level, char *buf);
-void       init_console_msg      (char *wd);
-void       free_msgs_res         (MSGS *msgs);
-int        open_spool_file       (void *jcr, BSOCK *bs);
-int        close_spool_file      (void *vjcr, BSOCK *bs);
+void      my_name_is            (int argc, char *argv[], char *name);
+void      init_msg              (void *jcr, MSGS *msg);
+void      term_msg              (void);
+void      close_msg             (void *jcr);
+void      add_msg_dest          (MSGS *msg, int dest, int type, char *where, char *dest_code);
+void      rem_msg_dest          (MSGS *msg, int dest, int type, char *where);
+void      Jmsg                  (void *jcr, int type, int level, char *fmt, ...);
+void      dispatch_message      (void *jcr, int type, int level, char *buf);
+void      init_console_msg      (char *wd);
+void      free_msgs_res         (MSGS *msgs);
+int       open_spool_file       (void *jcr, BSOCK *bs);
+int       close_spool_file      (void *vjcr, BSOCK *bs);
 
 
 /* bnet_server.c */
-void       bnet_thread_server(int port, int max_clients, workq_t *client_wq, 
-                   void handle_client_request(void *bsock));
-void             bnet_server             (int port, void handle_client_request(BSOCK *bsock));
-int              net_connect             (int port);
-BSOCK *          bnet_bind               (int port);
-BSOCK *          bnet_accept             (BSOCK *bsock, char *who);
+void      bnet_thread_server(int port, int max_clients, workq_t *client_wq, 
+                  void handle_client_request(void *bsock));
+void            bnet_server             (int port, void handle_client_request(BSOCK *bsock));
+int             net_connect             (int port);
+BSOCK *         bnet_bind               (int port);
+BSOCK *         bnet_accept             (BSOCK *bsock, char *who);
 
 /* signal.c */
-void             init_signals             (void terminate(int sig));
-void             init_stack_dump          (void);
+void            init_signals             (void terminate(int sig));
+void            init_stack_dump          (void);
 
 /* util.c */
-void             lcase                   (char *str);
-void             bash_spaces             (char *str);
-void             unbash_spaces           (char *str);
-void             strip_trailing_junk     (char *str);
-void             strip_trailing_slashes  (char *dir);
-int              skip_spaces             (char **msg);
-int              skip_nonspaces          (char **msg);
-int              fstrsch                 (char *a, char *b);
-char *           encode_time             (time_t time, char *buf);
-char *           encode_mode             (mode_t mode, char *buf);
-char *           edit_uint64_with_commas   (uint64_t val, char *buf);
-char *           add_commas              (char *val, char *buf);
-char *           edit_uint64             (uint64_t val, char *buf);
-int              do_shell_expansion      (char *name);
-int              is_a_number             (const char *num);
-int              string_to_btime         (char *str, btime_t *value);
-char             *edit_btime             (btime_t val, char *buf);
-void             jobstatus_to_ascii      (int JobStatus, char *msg, int maxlen);
-void             pm_strcat               (POOLMEM **pm, char *str);
-void             pm_strcpy               (POOLMEM **pm, char *str);
-int              run_program             (char *prog, int wait, POOLMEM *results);
-char *           job_type_to_str         (int type);
-char *           job_status_to_str       (int stat);
-char *           job_level_to_str        (int level);
+void            lcase                   (char *str);
+void            bash_spaces             (char *str);
+void            unbash_spaces           (char *str);
+void            strip_trailing_junk     (char *str);
+void            strip_trailing_slashes  (char *dir);
+int             skip_spaces             (char **msg);
+int             skip_nonspaces          (char **msg);
+int             fstrsch                 (char *a, char *b);
+char *          encode_time             (time_t time, char *buf);
+char *          encode_mode             (mode_t mode, char *buf);
+char *          edit_uint64_with_commas   (uint64_t val, char *buf);
+char *          add_commas              (char *val, char *buf);
+char *          edit_uint64             (uint64_t val, char *buf);
+int             do_shell_expansion      (char *name);
+int             is_a_number             (const char *num);
+int             string_to_btime         (char *str, btime_t *value);
+char            *edit_btime             (btime_t val, char *buf);
+void            jobstatus_to_ascii      (int JobStatus, char *msg, int maxlen);
+void            pm_strcat               (POOLMEM **pm, char *str);
+void            pm_strcpy               (POOLMEM **pm, char *str);
+int             run_program             (char *prog, int wait, POOLMEM *results);
+char *          job_type_to_str         (int type);
+char *          job_status_to_str       (int stat);
+char *          job_level_to_str        (int level);
+void            makeSessionKey          (char *key, char *seed, int mode);
 
 
 
index 4829836110fc8aacc684a536696be9c28a5ebdd7..4839121d440052752753d6caa08e20ce1a8d71e2 100644 (file)
@@ -251,7 +251,7 @@ void init_signals(void terminate(int sig))
    sigaction(SIGXCPU,  &sigdefault, NULL);
    sigaction(SIGXFSZ,  &sigdefault, NULL);
 
-   sigaction(SIGHUP,   &sighandle, NULL);
+   sigaction(SIGHUP,   &sigignore, NULL);
    sigaction(SIGQUIT,  &sighandle, NULL);   
    sigaction(SIGILL,   &sighandle, NULL);    
    sigaction(SIGTRAP,  &sighandle, NULL);   
index 724575a508719f03c4cd3109e297e523f36c0872..c8f65699abda086051e7255fa95f8f7323567ea6 100644 (file)
@@ -761,3 +761,75 @@ static void build_argc_argv(char *cmd, int *bargc, char *bargv[], int max_argv)
    }
    *bargc = argc;
 }
+
+/*  MAKESESSIONKEY  -- Generate session key with optional start
+                       key.  If mode is TRUE, the key will be
+                       translated to a string, otherwise it is
+                       returned as 16 binary bytes.
+
+    from SpeakFreely by John Walker */
+
+void makeSessionKey(char *key, char *seed, int mode)
+{
+     int j, k;
+     struct MD5Context md5c;
+     unsigned char md5key[16], md5key1[16];
+     char s[1024];
+
+     s[0] = 0;
+     if (seed != NULL) {
+       strcat(s, seed);
+     }
+
+     /* The following creates a seed for the session key generator
+       based on a collection of volatile and environment-specific
+       information unlikely to be vulnerable (as a whole) to an
+        exhaustive search attack.  If one of these items isn't
+       available on your machine, replace it with something
+       equivalent or, if you like, just delete it. */
+
+     sprintf(s + strlen(s), "%lu", (unsigned long) getpid());
+     sprintf(s + strlen(s), "%lu", (unsigned long) getppid());
+     getcwd(s + strlen(s), 256);
+     sprintf(s + strlen(s), "%lu", (unsigned long) clock());
+     sprintf(s + strlen(s), "%lu", (unsigned long) time(NULL));
+#ifdef Solaris
+     sysinfo(SI_HW_SERIAL,s + strlen(s), 12);
+#endif
+#ifdef HAVE_GETHOSTID
+     sprintf(s + strlen(s), "%lu", (unsigned long) gethostid());
+#endif
+#ifdef HAVE_GETDOMAINNAME
+     getdomainname(s + strlen(s), 256);
+#endif
+     gethostname(s + strlen(s), 256);
+     sprintf(s + strlen(s), "%u", (unsigned)getuid());
+     sprintf(s + strlen(s), "%u", (unsigned)getgid());
+     MD5Init(&md5c);
+     MD5Update(&md5c, (unsigned char *)s, strlen(s));
+     MD5Final(md5key, &md5c);
+     sprintf(s + strlen(s), "%lu", (unsigned long) ((time(NULL) + 65121) ^ 0x375F));
+     MD5Init(&md5c);
+     MD5Update(&md5c, (unsigned char *)s, strlen(s));
+     MD5Final(md5key1, &md5c);
+#define nextrand    (md5key[j] ^ md5key1[j])
+     if (mode) {
+       for (j = k = 0; j < 16; j++) {
+           unsigned char rb = nextrand;
+
+#define Rad16(x) ((x) + 'A')
+           key[k++] = Rad16((rb >> 4) & 0xF);
+           key[k++] = Rad16(rb & 0xF);
+#undef Rad16
+           if (j & 1) {
+                 key[k++] = '-';
+           }
+       }
+       key[--k] = 0;
+     } else {
+       for (j = 0; j < 16; j++) {
+           key[j] = nextrand;
+       }
+     }
+}
+#undef nextrand
index 330dd0211ed94a7780f2b8be86116dcc6fc7f462..56b285d7dfafcf185b0831e84e567fb0f84709da 100644 (file)
@@ -80,16 +80,16 @@ bacula-sd: $(SVROBJS) ../lib/libbac.a
 #       $(CXX) $(LDFLAGS) -L../lib -L../cats  -o $@ $(POOLOBJS) -lsql $(LIBS) $(DLIB) -lbac -lm
 
 btape: $(TAPEOBJS) ../lib/libbac.a ../cats/libsql.a
-       $(CXX) $(LDFLAGS) -L../lib -L../cats  -o $@ $(TAPEOBJS) -lsql $(LIBS) $(DLIB) -lbac -lm
+       $(CXX) $(TTOOL_LDFLSGS) $(LDFLAGS) -L../lib -L../cats  -o $@ $(TAPEOBJS) -lsql $(LIBS) $(DLIB) -lbac -lm
 
 bls:   ../findlib/libfind.a $(BLSOBJS) ../lib/libbac.a
-       $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(LIBS) $(DLIB) -lbac -lfind -lm
+       $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(LIBS) $(DLIB) -lbac -lfind -lm
 
 bextract: ../findlib/libfind.a $(BEXTOBJS) ../lib/libbac.a
-       $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(LIBS) $(DLIB) $(FDLIBS) -lbac -lfind -lm
+       $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(LIBS) $(DLIB) $(FDLIBS) -lbac -lfind -lm
 
 bscan: ../findlib/libfind.a $(SCNOBJS) ../cats/libsql.a
-       $(CXX) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) -lsql $(LIBS) $(DB_LIBS) $(FDLIBS) -lbac -lfind -lm
+       $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) -lsql $(LIBS) $(DB_LIBS) $(FDLIBS) -lbac -lfind -lm
 
 
 
index 65aefaa607193bafe153620ff21eade489ec0755..3d9dc37c51acf78976ec722947f84abab6f4e479 100644 (file)
  */
 int acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
 {
-   int stat;
+   int stat = 0;
+   int tape_previously_mounted;
 
    lock_device(dev);
-   if (dev->state & ST_READ || dev->num_writers > 0) {
-      Jmsg(jcr, M_FATAL, 0, _("Device %s is busy.\n"), dev_name(dev));
-      new_unlock_device(dev);
-      unlock_device(dev);
-      return 0;
-   }
-   dev->state &= ~ST_LABEL;          /* force reread of label */
    block_device(dev, BST_DOING_ACQUIRE);
    unlock_device(dev);
-   stat = ready_dev_for_read(jcr, dev, block); 
+
+   tape_previously_mounted = (dev->state & ST_READ) || (dev->state & ST_APPEND);
+
+   if (dev->state & ST_READ || dev->num_writers > 0) {
+      Jmsg1(jcr, M_FATAL, 0, _("Device %s is busy. Job cancelled.\n"), dev_name(dev));
+      goto get_out;
+   }
+
+   for (;;) {
+      if (job_cancelled(jcr)) {
+         Mmsg0(&dev->errmsg, _("Job cancelled.\n"));
+        goto get_out;                /* error return */
+      }
+      /*
+       * This code ensures that the device is ready for
+       * reading. If it is a file, it opens it.
+       * If it is a tape, it checks the volume name 
+       */
+      for ( ; !(dev->state & ST_OPENED); ) {
+          Dmsg1(120, "bstored: open vol=%s\n", jcr->VolumeName);
+         if (open_dev(dev, jcr->VolumeName, READ_ONLY) < 0) {
+             Jmsg(jcr, M_FATAL, 0, _("Open device %s volume %s failed, ERR=%s\n"), 
+                dev_name(dev), jcr->VolumeName, strerror_dev(dev));
+            goto get_out;
+         }
+          Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
+      }
+      /* ***FIXME*** this is probably not necessary */
+      dev->state &= ~ST_LABEL;          /* force reread of label */
+      Dmsg0(200, "calling read-vol-label\n");
+      switch (read_dev_volume_label(jcr, dev, block)) {
+        case VOL_OK:
+           break;                    /* got it */
+        case VOL_IO_ERROR:
+           /*
+            * Send error message generated by read_dev_volume_label()
+            *  only we really had a tape mounted. This supresses superfluous
+            *  error messages when nothing is mounted.
+            */
+           if (tape_previously_mounted) {
+               Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
+           }
+           goto default_path;
+        default:
+            Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
+default_path:
+           tape_previously_mounted = 0;
+            Dmsg0(200, "dir_get_volume_info\n");
+           dir_get_volume_info(jcr, 0);
+            Dmsg2(200, "calling autoload Vol=%s Slot=%d\n",
+              jcr->VolumeName, jcr->VolCatInfo.Slot);                         
+           if (autoload_device(jcr, dev, 0)) {
+              continue;
+           }
+           /* Mount a specific volume and no other */
+            Dmsg0(200, "calling dir_ask_sysop\n");
+           if (!dir_ask_sysop_to_mount_volume(jcr, dev)) {
+              goto get_out;          /* error return */
+           }
+           continue;                 /* try reading again */
+      }
+      break;
+   }
+
+   dev->state |= ST_READ;
+   attach_jcr_to_device(dev, jcr);    /* attach jcr to device */
+   stat = 1;                         /* good return */
+
+get_out:
    P(dev->mutex); 
    unblock_device(dev);
    V(dev->mutex);
@@ -69,8 +131,11 @@ int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
 {
    int release = 0;
    int do_mount = 0;
+   int stat = 0;
 
    lock_device(dev);
+   block_device(dev, BST_DOING_ACQUIRE);
+   unlock_device(dev);
    Dmsg1(190, "acquire_append device is %s\n", dev_is_tape(dev)?"tape":"disk");
 
 
@@ -86,13 +151,12 @@ int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
        */
       strcpy(jcr->VolumeName, dev->VolHdr.VolName);
       if (((dev->capabilities & CAP_ANONVOLS) &&
-           !dir_get_volume_info(jcr)) ||
+           !dir_get_volume_info(jcr, 1)) ||
          (!dir_find_next_appendable_volume(jcr) || 
            strcmp(dev->VolHdr.VolName, jcr->VolumeName) != 0)) { /* wrong tape mounted */
         if (dev->num_writers != 0) {
             Jmsg(jcr, M_FATAL, 0, _("Device %s is busy writing with another Volume.\n"), dev_name(dev));
-           unlock_device(dev);
-           return 0;
+           goto get_out;
         }
         /* Wrong tape mounted, release it, then fall through to get correct one */
         release = 1;
@@ -102,26 +166,18 @@ int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       /* Not already in append mode, so mount the device */
       if (dev->state & ST_READ) {
          Jmsg(jcr, M_FATAL, 0, _("Device %s is busy reading.\n"), dev_name(dev));
-        unlock_device(dev);
-        return 0;
+        goto get_out;
       } 
       ASSERT(dev->num_writers == 0);
       do_mount = 1;
    }
 
    if (do_mount) {
-      block_device(dev, BST_DOING_ACQUIRE);
-      unlock_device(dev);
       if (!mount_next_write_volume(jcr, dev, block, release)) {
          Jmsg(jcr, M_FATAL, 0, _("Could not ready device %s for append.\n"),
            dev_name(dev));
-        P(dev->mutex);
-        unblock_device(dev);
-        unlock_device(dev);
-        return 0;
+        goto get_out;
       }
-      P(dev->mutex);
-      unblock_device(dev);
    }
 
    dev->num_writers++;
@@ -133,8 +189,13 @@ int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       jcr->NumVolumes = 1;
    }
    attach_jcr_to_device(dev, jcr);    /* attach jcr to device */
-   unlock_device(dev);
-   return 1;                         /* got it */
+   stat = 1;                         /* good return */
+
+get_out:
+   P(dev->mutex); 
+   unblock_device(dev);
+   V(dev->mutex);
+   return stat;
 }
 
 /*
@@ -144,7 +205,7 @@ int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
  */
 int release_device(JCR *jcr, DEVICE *dev)
 {
-   P(dev->mutex);
+   lock_device(dev);
    Dmsg1(100, "release_device device is %s\n", dev_is_tape(dev)?"tape":"disk");
    if (dev->state & ST_READ) {
       dev->state &= ~ST_READ;        /* clear read bit */
@@ -184,61 +245,6 @@ int release_device(JCR *jcr, DEVICE *dev)
       Jmsg1(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s not in use.\n"), dev_name(dev));
    }
    detach_jcr_from_device(dev, jcr);
-   V(dev->mutex);
-   new_unlock_device(dev);
+   unlock_device(dev);
    return 1;
 }
-
-
-
-/*
- * This routine ensures that the device is ready for
- * reading. If it is a file, it opens it.
- * If it is a tape, it checks the volume name 
- *
- *  Returns 0 on failure
- *  Returns 1 on success
- */
-int ready_dev_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
-{
-   if (!(dev->state & ST_OPENED)) {
-       Dmsg1(120, "bstored: open vol=%s\n", jcr->VolumeName);
-       if (open_dev(dev, jcr->VolumeName, READ_ONLY) < 0) {
-          Jmsg(jcr, M_FATAL, 0, _("Open device %s volume %s failed, ERR=%s\n"), 
-             dev_name(dev), jcr->VolumeName, strerror_dev(dev));
-         return 0;
-       }
-       Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
-   }
-
-   for (;;) {
-      if (job_cancelled(jcr)) {
-         Mmsg0(&dev->errmsg, _("Job cancelled.\n"));
-        return 0;
-      }
-      if (!rewind_dev(dev)) {
-         Jmsg2(jcr, M_WARNING, 0, _("Rewind error on device %s. ERR=%s\n"), 
-              dev_name(dev), strerror_dev(dev));
-      }
-      switch (read_dev_volume_label(jcr, dev, block)) {
-        case VOL_OK:
-           break;                    /* got it */
-        default:
-           /* Send error message generated by read_dev_volume_label() */
-            Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
-           if (!rewind_dev(dev)) {
-               Jmsg2(jcr, M_WARNING, 0, _("Rewind error on device %s. ERR=%s\n"), 
-                    dev_name(dev), strerror_dev(dev));
-           }
-           /* Mount a specific volume and no other */
-           if (!dir_ask_sysop_to_mount_volume(jcr, dev)) {
-              return 0;              /* error return */
-           }
-           continue;                 /* try reading again */
-      }
-      break;
-   }
-
-   dev->state |= ST_READ;
-   return 1; 
-}
index bd452a7cb74dedc6a6984beace3f8bbf2ef4f159..c7eb7e43ab32856e12f2ed08702b444e6bb20c0b 100644 (file)
@@ -31,7 +31,7 @@
 
 /* Requests sent to the Director */
 static char Find_media[]    = "CatReq Job=%s FindMedia=%d\n";
-static char Get_Vol_Info[] = "CatReq Job=%s GetVolInfo VolName=%s\n";
+static char Get_Vol_Info[] = "CatReq Job=%s GetVolInfo VolName=%s write=%d\n";
 
 static char Update_media[] = "CatReq Job=%s UpdateMedia VolName=%s\
  VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
@@ -78,7 +78,7 @@ static int do_request_volume_info(JCR *jcr)
 
     jcr->VolumeName[0] = 0;          /* No volume */
     if (bnet_recv(dir) <= 0) {
-       Dmsg0(130, "getvolname error bnet_recv\n");
+       Dmsg0(200, "getvolname error bnet_recv\n");
        return 0;
     }
     if (sscanf(dir->msg, OK_media, vol->VolCatName, 
@@ -88,13 +88,13 @@ static int do_request_volume_info(JCR *jcr)
               &vol->VolCatWrites, &vol->VolCatMaxBytes, 
               &vol->VolCatCapacityBytes, vol->VolCatStatus,
               &vol->Slot) != 12) {
-       Dmsg1(130, "Bad response from Dir: %s\n", dir->msg);
+       Dmsg1(200, "Bad response from Dir: %s\n", dir->msg);
        return 0;
     }
     unbash_spaces(vol->VolCatName);
     strcpy(jcr->VolumeName, vol->VolCatName); /* set desired VolumeName */
     
-    Dmsg2(130, "do_reqest_vol_info got slot=%d Volume=%s\n", 
+    Dmsg2(200, "do_reqest_vol_info got slot=%d Volume=%s\n", 
        vol->Slot, vol->VolCatName);
     return 1;
 }
@@ -110,14 +110,14 @@ static int do_request_volume_info(JCR *jcr)
  *
  *         Volume information returned in jcr
  */
-int dir_get_volume_info(JCR *jcr)
+int dir_get_volume_info(JCR *jcr, int writing)
 {
     BSOCK *dir = jcr->dir_bsock;
 
     strcpy(jcr->VolCatInfo.VolCatName, jcr->VolumeName);
     Dmsg1(200, "dir_get_volume_info=%s\n", jcr->VolCatInfo.VolCatName);
     bash_spaces(jcr->VolCatInfo.VolCatName);
-    bnet_fsend(dir, Get_Vol_Info, jcr->Job, jcr->VolCatInfo.VolCatName);
+    bnet_fsend(dir, Get_Vol_Info, jcr->Job, jcr->VolCatInfo.VolCatName, writing);
     return do_request_volume_info(jcr);
 }
 
@@ -283,7 +283,9 @@ int dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev)
         } else {
             msg = "Please mount";
         }
-         Jmsg(jcr, M_MOUNT, 0, _("%s Volume \"%s\" on Storage Device \"%s\" for Job %s\n"),
+        Jmsg(jcr, M_MOUNT, 0, _(
+"%s Volume \"%s\" on Storage Device \"%s\" for Job %s\n"
+"Use \"mount\" command to release Job.\n"),
              msg, jcr->VolumeName, jcr->dev_name, jcr->Job);
          Dmsg3(190, "Mount %s on %s for Job %s\n",
                jcr->VolumeName, jcr->dev_name, jcr->Job);
@@ -291,10 +293,14 @@ int dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev)
         jstat = JS_WaitMedia;
         Jmsg(jcr, M_MOUNT, 0, _(
 "Job %s waiting. Cannot find any appendable volumes.\n\
-Please use the \"label\"  command to create new Volumes for:\n\
-   Storage Device \"%s\" with Pool \"%s\" and Media type \"%s\".\n\
-Use \"mount\" to resume the job.\n"),
-             jcr->Job, jcr->dev_name, jcr->pool_name, jcr->media_type);
+Please use the \"label\"  command to create a new Volume for:\n\
+    Storage:      %s\n\
+    Media type:   %s\n\
+    Pool:         %s\n"),
+             jcr->Job, 
+             jcr->dev_name, 
+             jcr->media_type,
+             jcr->pool_name);
       }
       /*
        * Wait then send message again
index 1709705960e3f3c6379dc17cef1c60d827e5e92c..90926e0889ffd43457d1fc7cb2ac784a1b6ef65c 100644 (file)
@@ -39,29 +39,30 @@ static char OK_hello[]  = "3000 OK Hello\n";
  */
 static int authenticate(int rcode, BSOCK *bs)
 {
-   POOLMEM *name;
+   POOLMEM *dirname;
    DIRRES *director = NULL;
 
    if (rcode != R_DIRECTOR) {
       Emsg1(M_FATAL, 0, _("I only authenticate Directors, not %d\n"), rcode);
       return 0;
    }
-   name = get_pool_memory(PM_MESSAGE);
-   name = check_pool_memory_size(name, bs->msglen);
+   dirname = get_pool_memory(PM_MESSAGE);
+   dirname = check_pool_memory_size(dirname, bs->msglen);
 
-   if (sscanf(bs->msg, "Hello Director %127s calling\n", name) != 1) {
+   if (sscanf(bs->msg, "Hello Director %127s calling\n", dirname) != 1) {
       Emsg1(M_FATAL, 0, _("Bad Hello command from Director: %s\n"), bs->msg);
       return 0;
    }
    director = NULL;
+   unbash_spaces(dirname);
    LockRes();
    while ((director=(DIRRES *)GetNextRes(rcode, (RES *)director))) {
-      if (strcmp(director->hdr.name, name) == 0)
+      if (strcmp(director->hdr.name, dirname) == 0)
         break;
    }
    UnlockRes();
    if (!director) {
-      Emsg1(M_FATAL, 0, _("Connection from unknown Director %s rejected.\n"), name);
+      Emsg1(M_FATAL, 0, _("Connection from unknown Director %s rejected.\n"), dirname);
       goto bail_out;
    }
    if (!cram_md5_auth(bs, director->password) ||
@@ -69,11 +70,11 @@ static int authenticate(int rcode, BSOCK *bs)
       Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"));
       goto bail_out;
    }
-   free_pool_memory(name);
+   free_pool_memory(dirname);
    return 1;
 
 bail_out:
-   free_pool_memory(name);
+   free_pool_memory(dirname);
    return 0;
 }
 
index 3d7ffa0f481d4e5f66a368d4a2230206723dc315..00dd57a9873b6bd9c5475fc716982f6172ea45ac 100644 (file)
@@ -47,7 +47,6 @@ static JCR *jcr;
 static FF_PKT my_ff;
 static FF_PKT *ff = &my_ff;
 static BSR *bsr = NULL;
-static DEV_BLOCK *block;
 static int extract = FALSE;
 static long record_file_index;
 static long total = 0;
@@ -387,7 +386,7 @@ static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
 
 
 /* Dummies to replace askdir.c */
-int    dir_get_volume_info(JCR *jcr) { return 1;}
+int    dir_get_volume_info(JCR *jcr, int writing) { return 1;}
 int    dir_find_next_appendable_volume(JCR *jcr) { return 1;}
 int    dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
 int    dir_create_jobmedia_record(JCR *jcr) { return 1; }
index 11373023cbdd4e26b1c332dbd6e05af00532996d..aa2bc563dc1395823d5b55979ddd89a0ffb1f4f2 100644 (file)
@@ -89,6 +89,7 @@ int main (int argc, char *argv[])
       switch (ch) {
          case 'b':
            bsr = parse_bsr(NULL, optarg);
+//         dump_bsr(bsr);
            break;
 
          case 'd':                    /* debug level */
@@ -377,7 +378,7 @@ static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sess
 
 
 /* Dummies to replace askdir.c */
-int    dir_get_volume_info(JCR *jcr) { return 1;}
+int    dir_get_volume_info(JCR *jcr, int writing) { return 1;}
 int    dir_find_next_appendable_volume(JCR *jcr) { return 1;}
 int    dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
 int    dir_create_jobmedia_record(JCR *jcr) { return 1; }
index 56f83ff40b3d35ace95f977d50a7b0b5c73c52ea..2a7aaf381451b4fc2e85c7f5546ee2851a829ebb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Program to scan a Bacula tape and compare it with
+ *  Program to scan a Bacula Volume and compare it with
  *    the catalog and optionally synchronize the catalog
  *    with the tape.
  *
 #include "findlib/find.h"
 #include "cats/cats.h"
 
+/* Forward referenced functions */
 static void do_scan(char *fname);
-
-
+static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec);
+static void create_file_attributes_record(B_DB *db, char *fname, char *lname, int type,
+                              char *ap, DEV_RECORD *rec);
+static void create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl);
+static void create_pool_record(B_DB *db, POOL_DBR *pr);
+static void create_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *label);
+static void update_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *elabel, 
+                             DEV_RECORD *rec);
+static void create_client_record(B_DB *db, CLIENT_DBR *cr);
+static void create_fileset_record(B_DB *db, FILESET_DBR *fsr);
+static void create_jobmedia_record(B_DB *db, JOBMEDIA_DBR *jmr, SESSION_LABEL *elabel);
+
+
+/* Global variables */
 static DEVICE *dev = NULL;
 static B_DB *db;
 static JCR *jcr;
 static BSR *bsr;
+static struct stat statp;
+static int type;
+static long record_file_index;
+static POOLMEM *fname;                      /* original file name */
+static POOLMEM *ofile;                      /* output name with prefix */
+static POOLMEM *lname;                      /* link name */
+static MEDIA_DBR mr;
+static POOL_DBR pr;
+static JOB_DBR jr;
+static CLIENT_DBR cr;
+static JOBMEDIA_DBR jmr;
+static FILESET_DBR fsr;
+static ATTR_DBR ar;
+static SESSION_LABEL label;
+static SESSION_LABEL elabel;
+static uint32_t FirstIndex = 0;
+static uint32_t LastIndex = 0;
+
+static char *db_name = "bacula";
+static char *db_user = "bacula";
+static char *db_password = "";
+static char *wd = "/tmp";
+static int verbose = 0;
+static int update_db = 0;
 
 static void usage()
 {
    fprintf(stderr,
 "\nVersion: " VERSION " (" DATE ")\n\n"
 "Usage: bscan [-d debug_level] <bacula-archive>\n"
-"       -dnn            set debug level to nn\n"
-"       -?              print this message\n\n");
+"       -b bootstrap      specify a bootstrap file\n"
+"       -dnn              set debug level to nn\n"
+"       -n name           specify the database name (default bacula)\n"
+"       -u user           specify database user name (default bacula)\n"
+"       -p password       specify database password (default none)\n"
+"       -s                synchronize or store in database\n"
+"       -v                verbose\n"
+"       -w dir            specify working directory (default /tmp)\n"
+"       -?                print this message\n\n");
    exit(1);
 }
 
@@ -60,7 +104,7 @@ int main (int argc, char *argv[])
    init_msg(NULL, NULL);
 
 
-   while ((ch = getopt(argc, argv, "b:d:?")) != -1) {
+   while ((ch = getopt(argc, argv, "b:d:n:p:u:vw:?")) != -1) {
       switch (ch) {
          case 'b':
            bsr = parse_bsr(NULL, optarg);
@@ -71,6 +115,30 @@ int main (int argc, char *argv[])
               debug_level = 1; 
            break;
 
+         case 'n':
+           db_name = optarg;
+           break;
+
+         case 'u':
+           db_user = optarg;
+           break;
+
+         case 'p':
+           db_password = optarg;
+           break;
+
+         case 's':
+           update_db = 1;
+           break;
+
+         case 'v':
+           verbose++;
+           break;
+
+         case 'w':
+           wd = optarg;
+           break;
+
          case '?':
         default:
            usage();
@@ -85,10 +153,11 @@ int main (int argc, char *argv[])
       usage();
    }
 
+   working_directory = wd;
+
    jcr = setup_jcr("bscan", argv[0], bsr);
 
-   /* *** FIXME **** need to put in corect db, user, and password */
-   if ((db=db_init_database(NULL, "bacula", "bacula", "")) == NULL) {
+   if ((db=db_init_database(NULL, db_name, db_user, db_password)) == NULL) {
       Emsg0(M_ABORT, 0, "Could not init Bacula database\n");
    }
    if (!db_open_database(db)) {
@@ -106,17 +175,6 @@ int main (int argc, char *argv[])
 
 static void do_scan(char *devname)            
 {
-   struct stat statp;
-   int type;
-   long record_file_index;
-   DEV_RECORD *rec;
-   DEV_BLOCK *block;
-   POOLMEM *fname;                      /* original file name */
-   POOLMEM *ofile;                      /* output name with prefix */
-   POOLMEM *lname;                      /* link name */
-   MEDIA_DBR mr;
-   POOL_DBR pr;
-   JOB_DBR jr;
 
    dev = setup_to_read_device(jcr);
    if (!dev) { 
@@ -127,240 +185,378 @@ static void do_scan(char *devname)
    ofile = get_pool_memory(PM_FNAME);
    lname = get_pool_memory(PM_FNAME);
 
-   block = new_block(dev);
-   
-   rec = new_record();
-   free_pool_memory(rec->data);
-   rec->data = get_memory(70000);
-
+   memset(&ar, 0, sizeof(ar));
    memset(&mr, 0, sizeof(mr));
    memset(&pr, 0, sizeof(pr));
+   memset(&jr, 0, sizeof(jr));
+   memset(&cr, 0, sizeof(cr));
+   memset(&jmr, 0, sizeof(jmr));
+   memset(&fsr, 0, sizeof(fsr));
 
-   for ( ;; ) {
-      if (!read_block_from_device(dev, block)) {
-        uint32_t status;
-        if (dev->state & ST_EOT) {
-           if (!mount_next_read_volume(jcr, dev, block)) {
-              break;
-           }
-           continue;
-        }
-        if (dev->state & ST_EOF) {
-           continue;                 /* try again */
-        }
-        if (dev->state & ST_SHORT) {
-           continue;
-        }
-         Pmsg0(0, "Read Record got a bad record\n");
-        status_dev(dev, &status);
-         Dmsg1(20, "Device status: %x\n", status);
-        if (status & MT_EOD)
-            Emsg0(M_ABORT, 0, "Unexpected End of Data\n");
-        else if (status & MT_EOT)
-            Emsg0(M_ABORT, 0, "Unexpected End of Tape\n");
-        else if (status & MT_EOF)
-            Emsg0(M_ABORT, 0, "Unexpected End of File\n");
-        else if (status & MT_DR_OPEN)
-            Emsg0(M_ABORT, 0, "Tape Door is Open\n");
-        else if (!(status & MT_ONLINE))
-            Emsg0(M_ABORT, 0, "Unexpected Tape is Off-line\n");
-        else
-            Emsg3(M_ABORT, 0, "Read error %d on Record Header %s: %s\n", 
-              status, dev_name(dev), strerror(errno));
-      }
-
-      for (rec->state=0; !is_block_empty(rec); ) {
-           SESSION_LABEL label, elabel;
-        if (!read_record_from_block(block, rec)) {
-           break;
-        }
-
+   read_records(jcr, dev, record_cb, mount_next_read_volume);
+   release_device(jcr, dev);
 
-        /* This is no longer used */
-        if (rec->VolSessionId == 0 && rec->VolSessionTime == 0) {
-            Emsg0(M_ERROR, 0, "Zero header record. This shouldn't happen.\n");
-           break;                       /* END OF FILE */
-        }
+   free_pool_memory(fname);
+   free_pool_memory(ofile);
+   free_pool_memory(lname);
+   term_dev(dev);
+}
 
-        /* 
-         * Check for Start or End of Session Record 
-         *
-         */
-        if (rec->FileIndex < 0) {
+static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
+{
+   /* 
+    * Check for Start or End of Session Record 
+    *
+    */
+   if (rec->FileIndex < 0) {
+
+      if (verbose > 1) {
+        dump_label_record(dev, rec, 1);
+      }
+      switch (rec->FileIndex) {
+        case PRE_LABEL:
+            Pmsg0(000, "Volume is prelabeled. This tape cannot be scanned.\n");
+           return;
+           break;
+        case VOL_LABEL:
+           unser_volume_label(dev, rec);
+           /* Check Pool info */
+           strcpy(pr.Name, dev->VolHdr.PoolName);
+           strcpy(pr.PoolType, dev->VolHdr.PoolType);
+           if (!db_get_pool_record(db, &pr)) {
+               Pmsg1(000, "VOL_LABEL: Pool record not found for Pool: %s\n",
+                 pr.Name);
+              create_pool_record(db, &pr);
+              return;
+           } else if (verbose) {
+               Pmsg1(000, "Pool record for %s found in DB.\n", pr.Name);
+           }
+           if (strcmp(pr.PoolType, dev->VolHdr.PoolType) != 0) {
+               Pmsg2(000, "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n",
+                 pr.PoolType, dev->VolHdr.PoolType);
+              return;
+           } else if (verbose) {
+               Pmsg1(000, "Pool type \"%s\" is OK.\n", pr.PoolType);
+           }
 
-           if (debug_level > 1) {
-              dump_label_record(dev, rec, 1);
+           /* Check Media Info */
+           strcpy(mr.VolumeName, dev->VolHdr.VolName);
+           mr.PoolId = pr.PoolId;
+           if (!db_get_media_record(db, &mr)) {
+               Pmsg1(000, "VOL_LABEL: Media record not found for Volume: %s\n",
+                 mr.VolumeName);
+              strcpy(mr.MediaType, dev->VolHdr.MediaType);
+              create_media_record(db, &mr, &dev->VolHdr);
+              return;
+           } else if (verbose) {
+               Pmsg1(000, "Media record for %s found in DB.\n", mr.VolumeName);
            }
-           switch (rec->FileIndex) {
-              case PRE_LABEL:
-                  Pmsg0(000, "Volume is prelabeled. This tape cannot be scanned.\n");
-                 return;
-                 break;
-              case VOL_LABEL:
-                 unser_volume_label(dev, rec);
-                 strcpy(mr.VolumeName, dev->VolHdr.VolName);
-                 if (!db_get_media_record(db, &mr)) {
-                     Pmsg1(000, "VOL_LABEL: Media record not found for Volume: %s\n",
-                       mr.VolumeName);
-                    continue;
-                 }
-                 if (strcmp(mr.MediaType, dev->VolHdr.MediaType) != 0) {
-                     Pmsg2(000, "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n",
-                       mr.MediaType, dev->VolHdr.MediaType);
-                    continue;
-                 }
-                 strcpy(pr.Name, dev->VolHdr.PoolName);
-                 if (!db_get_pool_record(db, &pr)) {
-                     Pmsg1(000, "VOL_LABEL: Pool record not found for Pool: %s\n",
-                       pr.Name);
-                    continue;
-                 }
-                 if (strcmp(pr.PoolType, dev->VolHdr.PoolType) != 0) {
-                     Pmsg2(000, "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n",
-                       pr.PoolType, dev->VolHdr.PoolType);
-                    continue;
-                 }
-                  Pmsg1(000, "VOL_LABEL: OK for Volume: %s\n", mr.VolumeName);
-                 break;
-              case SOS_LABEL:
-                 unser_session_label(&label, rec);
-                 memset(&jr, 0, sizeof(jr));
-                 jr.JobId = label.JobId;
-                 if (!db_get_job_record(db, &jr)) {
-                     Pmsg1(000, "SOS_LABEL: Job record not found for JobId: %d\n",
-                       jr.JobId);
-                    continue;
-                 }
-                 if (rec->VolSessionId != jr.VolSessionId) {
-                     Pmsg2(000, "SOS_LABEL: VolSessId mismatch. DB=%d Vol=%d\n",
-                       jr.VolSessionId, rec->VolSessionId);
-                    continue;
-                 }
-                 if (rec->VolSessionTime != jr.VolSessionTime) {
-                     Pmsg2(000, "SOS_LABEL: VolSessTime mismatch. DB=%d Vol=%d\n",
-                       jr.VolSessionTime, rec->VolSessionTime);
-                    continue;
-                 }
-                 if (jr.PoolId != pr.PoolId) {
-                     Pmsg2(000, "SOS_LABEL: PoolId mismatch. DB=%d Vol=%d\n",
-                       jr.PoolId, pr.PoolId);
-                    continue;
-                 }
-                 break;
-              case EOS_LABEL:
-                 unser_session_label(&elabel, rec);
-                 if (elabel.JobId != label.JobId) {
-                     Pmsg2(000, "EOS_LABEL: Start/End JobId mismatch. Start=%d End=%d\n",
-                       label.JobId, elabel.JobId);
-                    continue;
-                 }
-                 if (elabel.JobFiles != jr.JobFiles) {
-                     Pmsg2(000, "EOS_LABEL: JobFiles mismatch. DB=%d EOS=%d\n",
-                       jr.JobFiles, elabel.JobFiles);
-                    continue;
-                 }                                 
-                 if (elabel.JobBytes != jr.JobBytes) {
-                     Pmsg2(000, "EOS_LABEL: JobBytes mismatch. DB=%d EOS=%d\n",
-                       jr.JobBytes, elabel.JobBytes);
-                    continue;
-                 }                                 
-                  Pmsg1(000, "EOS_LABEL: OK for JobId=%d\n", elabel.JobId);
-                 break;
-              case EOM_LABEL:
-                 break;
-              default:
-                 break;
+           if (strcmp(mr.MediaType, dev->VolHdr.MediaType) != 0) {
+               Pmsg2(000, "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n",
+                 mr.MediaType, dev->VolHdr.MediaType);
+              return;
+           } else if (verbose) {
+               Pmsg1(000, "Media type \"%s\" is OK.\n", mr.MediaType);
            }
-           continue;
-        }
-
-        /* Is this the file we want? */
-        if (bsr && !match_bsr(bsr, rec, &dev->VolHdr, &label)) {
-           rec->remainder = 0;
-           continue;
-        }
-        if (is_partial_record(rec)) {
+            Pmsg1(000, "VOL_LABEL: OK for Volume: %s\n", mr.VolumeName);
            break;
-        }
-
-        /* File Attributes stream */
-        if (rec->Stream == STREAM_UNIX_ATTRIBUTES) {
-           char *ap, *lp, *fp;
-
-           if (sizeof_pool_memory(fname) < rec->data_len) {
-              fname = realloc_pool_memory(fname, rec->data_len + 1);
+        case SOS_LABEL:
+           unser_session_label(&label, rec);
+           FirstIndex = LastIndex = 0;
+           memset(&jr, 0, sizeof(jr));
+           jr.JobId = label.JobId;
+           if (!db_get_job_record(db, &jr)) {
+               Pmsg1(000, "SOS_LABEL: Job record not found for JobId: %d\n",
+                 jr.JobId);
+              create_job_record(db, &jr, &label);
+              jr.PoolId = pr.PoolId;
+              jr.VolSessionId = rec->VolSessionId;
+              jr.VolSessionTime = rec->VolSessionTime;
+              return;
            }
-           if (sizeof_pool_memory(lname) < rec->data_len) {
-              lname = realloc_pool_memory(lname, rec->data_len + 1);
+           if (rec->VolSessionId != jr.VolSessionId) {
+               Pmsg3(000, "SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n",
+                 jr.JobId,
+                 jr.VolSessionId, rec->VolSessionId);
+              return;
            }
-           *fname = 0;
-           *lname = 0;
-
-           /*              
-            * An Attributes record consists of:
-            *    File_index
-            *    Type   (FT_types)
-            *    Filename
-            *    Attributes
-            *    Link name (if file linked i.e. FT_LNK)
-            *
-            */
-            sscanf(rec->data, "%ld %d", &record_file_index, &type);
-           if (record_file_index != rec->FileIndex)
-               Emsg2(M_ERROR_TERM, 0, "Record header file index %ld not equal record index %ld\n",
-                 rec->FileIndex, record_file_index);
-           ap = rec->data;
-            while (*ap++ != ' ')         /* skip record file index */
-              ;
-            while (*ap++ != ' ')         /* skip type */
-              ;
-           /* Save filename and position to attributes */
-           fp = fname;
-           while (*ap != 0) {
-              *fp++  = *ap++;
+           if (rec->VolSessionTime != jr.VolSessionTime) {
+               Pmsg3(000, "SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n",
+                 jr.JobId,
+                 jr.VolSessionTime, rec->VolSessionTime);
+              return;
            }
-           *fp = *ap++;                 /* terminate filename & point to attribs */
-
-           /* Skip through attributes to link name */
-           if (type == FT_LNK) {
-              lp = ap;
-              while (*lp++ != 0) {
-                 ;
-              }
-               strcat(lname, lp);        /* "save" link name */
-           } else {
-              *lname = 0;
+           if (jr.PoolId != pr.PoolId) {
+               Pmsg3(000, "SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n",
+                 jr.JobId,
+                 jr.PoolId, pr.PoolId);
+              return;
            }
+           break;
+        case EOS_LABEL:
+           unser_session_label(&elabel, rec);
+
+           /* Create Client record */
+           strcpy(cr.Name, label.ClientName);
+           create_client_record(db, &cr);
+           jr.ClientId = cr.ClientId;
+
+           /* Create FileSet record */
+           strcpy(fsr.FileSet, label.FileSetName);
+           create_fileset_record(db, &fsr);
+           jr.FileSetId = fsr.FileSetId;
+
+           /* Update Job record */
+           update_job_record(db, &jr, &elabel, rec);
+
+           /* Create JobMedia record */
+           jmr.JobId = jr.JobId;
+           jmr.MediaId = mr.MediaId;
+           create_jobmedia_record(db, &jmr, &elabel);
+           if (elabel.JobId != label.JobId) {
+               Pmsg2(000, "EOS_LABEL: Start/End JobId mismatch. Start=%d End=%d\n",
+                 label.JobId, elabel.JobId);
+              return;
+           }
+           if (elabel.JobFiles != jr.JobFiles) {
+               Pmsg3(000, "EOS_LABEL: JobFiles mismatch for JobId=%u. DB=%d EOS=%d\n",
+                 elabel.JobId,
+                 jr.JobFiles, elabel.JobFiles);
+              return;
+           }                                 
+           if (elabel.JobBytes != jr.JobBytes) {
+               Pmsg3(000, "EOS_LABEL: JobBytes mismatch for JobId=%u. DB=%d EOS=%d\n",
+                 elabel.JobId,
+                 jr.JobBytes, elabel.JobBytes);
+              return;
+           }                                 
+            Pmsg1(000, "EOS_LABEL: OK for JobId=%d\n", elabel.JobId);
+           break;
+        case EOM_LABEL:
+           break;
+        default:
+           break;
+      }
+      return;
+   }
 
-           decode_stat(ap, &statp);
 
-           if (debug_level > 1) {
-              print_ls_output(fname, lname, type, &statp);   
-           }
+   /* File Attributes stream */
+   if (rec->Stream == STREAM_UNIX_ATTRIBUTES) {
+      char *ap, *lp, *fp;
 
-        /* Data stream and extracting */
-        } else if (rec->Stream == STREAM_FILE_DATA) {
+      if (sizeof_pool_memory(fname) < rec->data_len) {
+        fname = realloc_pool_memory(fname, rec->data_len + 1);
+      }
+      if (sizeof_pool_memory(lname) < rec->data_len) {
+        lname = realloc_pool_memory(lname, rec->data_len + 1);
+      }
+      *fname = 0;
+      *lname = 0;
+
+      /*             
+       * An Attributes record consists of:
+       *    File_index
+       *    Type   (FT_types)
+       *    Filename
+       *    Attributes
+       *    Link name (if file linked i.e. FT_LNK)
+       *
+       */
+      sscanf(rec->data, "%ld %d", &record_file_index, &type);
+      if (record_file_index != rec->FileIndex)
+         Emsg2(M_ERROR_TERM, 0, "Record header file index %ld not equal record index %ld\n",
+           rec->FileIndex, record_file_index);
+      ap = rec->data;
+      while (*ap++ != ' ')         /* skip record file index */
+        ;
+      while (*ap++ != ' ')         /* skip type */
+        ;
+      /* Save filename and position to attributes */
+      fp = fname;
+      while (*ap != 0) {
+        *fp++  = *ap++;
+      }
+      *fp = *ap++;                /* terminate filename & point to attribs */
 
-        } else if (rec->Stream != STREAM_MD5_SIGNATURE) {
-            Pmsg2(0, "None of above!!! stream=%d data=%s\n", rec->Stream, rec->data);
-        }
+      /* Skip through attributes to link name */
+      lp = ap;
+      while (*lp++ != 0) {
+        ;
       }
-   }
+      strcat(lname, lp);        /* "save" link name */
 
-   release_device(jcr, dev);
 
-   free_pool_memory(fname);
-   free_pool_memory(ofile);
-   free_pool_memory(lname);
-   term_dev(dev);
-   free_block(block);
-   free_record(rec);
+      if (verbose > 1) {
+        decode_stat(ap, &statp);
+        print_ls_output(fname, lname, type, &statp);   
+      }
+      create_file_attributes_record(db, fname, lname, type, ap, rec);
+      if (FirstIndex == 0) {
+        FirstIndex = rec->FileIndex;
+      }
+      LastIndex = rec->FileIndex;
+
+   /* Data stream and extracting */
+   } else if (rec->Stream == STREAM_FILE_DATA) {
+
+   } else if (rec->Stream != STREAM_MD5_SIGNATURE) {
+      Pmsg2(0, "None of above!!! stream=%d data=%s\n", rec->Stream, rec->data);
+   }
+   
    return;
 }
 
+static void create_file_attributes_record(B_DB *db, char *fname, char *lname, int type,
+                              char *ap, DEV_RECORD *rec)
+{
+   if (!update_db) {
+      return;
+   }
+   ar.fname = fname;
+   ar.link = lname;
+   ar.ClientId = cr.ClientId;
+   ar.JobId = jr.JobId;
+   ar.Stream = rec->Stream;
+   ar.FileIndex = rec->FileIndex;
+   ar.attr = ap;
+   if (!db_create_file_attributes_record(db, &ar)) {
+      Pmsg1(0, _("Could not create File Attributes record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
+static void create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl)
+{
+   struct date_time dt;
+   struct tm tm;
+   if (!update_db) {
+      return;
+   }
+   strcpy(mr->VolStatus, "Full");
+   mr->VolRetention = 355 * 3600 * 24; /* 1 year */
+   dt.julian_day_number = vl->write_date;
+   dt.julian_day_fraction = vl->write_time;
+   tm_decode(&dt, &tm);
+   mr->FirstWritten = mktime(&tm);
+   dt.julian_day_number = vl->label_date;
+   dt.julian_day_fraction = vl->label_time;
+   tm_decode(&dt, &tm);
+   mr->LabelDate = mktime(&tm);
+   if (!db_create_media_record(db, mr)) {
+      Pmsg1(0, _("Could not create media record. ERR=%s\n"), db_strerror(db));
+   }
+   if (!db_update_media_record(db, mr)) {
+      Pmsg1(0, _("Could not update media record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
+static void create_pool_record(B_DB *db, POOL_DBR *pr)
+{
+   if (!update_db) {
+      return;
+   }
+   pr->NumVols++;
+   pr->UseCatalog = 1;
+   pr->VolRetention = 355 * 3600 * 24; /* 1 year */
+   if (!db_create_pool_record(db, pr)) {
+      Pmsg1(0, _("Could not create pool record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
+
+static void create_client_record(B_DB *db, CLIENT_DBR *cr)
+{
+   if (!update_db) {
+      return;
+   }
+   if (!db_create_client_record(db, cr)) {
+      Pmsg1(0, _("Could not create Client record. ERR=%s\n"), db_strerror(db));
+   }
+}
+
+static void create_fileset_record(B_DB *db, FILESET_DBR *fsr)
+{
+   if (!update_db) {
+      return;
+   }
+   if (!db_create_fileset_record(db, fsr)) {
+      Pmsg1(0, _("Could not create FileSet record. ERR=%s\n"), db_strerror(db));
+   }
+}
+
+static void create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label)
+{
+   struct date_time dt;
+   struct tm tm;
+
+   if (!update_db) {
+      return;
+   }
+   jr->JobId = label->JobId;
+   jr->Type = label->JobType;
+   jr->Level = label->JobLevel;
+   strcpy(jr->Name, label->JobName);
+   strcpy(jr->Job, label->Job);
+   dt.julian_day_number = label->write_date;
+   dt.julian_day_fraction = label->write_time;
+   tm_decode(&dt, &tm);
+   jr->SchedTime = mktime(&tm);
+   jr->StartTime = jr->SchedTime;
+   jr->JobTDate = (btime_t)jr->SchedTime;
+   if (!db_create_job_record(db, jr)) {
+      Pmsg1(0, _("Could not create job record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
+static void update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
+                             DEV_RECORD *rec)
+{
+   struct date_time dt;
+   struct tm tm;
+
+   if (!update_db) {
+      return;
+   }
+   dt.julian_day_number = elabel->write_date;
+   dt.julian_day_fraction = elabel->write_time;
+   tm_decode(&dt, &tm);
+   jr->JobStatus = JS_Terminated;
+   jr->EndTime = mktime(&tm);
+   jr->JobFiles = elabel->JobFiles;
+   jr->JobBytes = elabel->JobBytes;
+   jr->VolSessionId = rec->VolSessionId;
+   jr->VolSessionTime = rec->VolSessionTime;
+   if (!db_create_job_record(db, jr)) {
+      Pmsg1(0, _("Could not create job record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
+static void create_jobmedia_record(B_DB *db, JOBMEDIA_DBR *jmr, SESSION_LABEL *elabel)
+{
+   if (!update_db) {
+      return;
+   }
+   jmr->FirstIndex = FirstIndex;
+   jmr->LastIndex = LastIndex;
+   jmr->StartFile = elabel->start_file;
+   jmr->EndFile = elabel->end_file;
+   jmr->StartBlock = elabel->start_block;
+   jmr->EndBlock = elabel->end_block;
+   if (!db_create_jobmedia_record(db, jmr)) {
+      Pmsg1(0, _("Could not create JobMedia record. ERR=%s\n"), db_strerror(db));
+   }
+
+}
+
 
 /* Dummies to replace askdir.c */
-int    dir_get_volume_info(JCR *jcr) { return 1;}
+int    dir_get_volume_info(JCR *jcr, int writing) { return 1;}
 int    dir_find_next_appendable_volume(JCR *jcr) { return 1;}
 int    dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
 int    dir_create_jobmedia_record(JCR *jcr) { return 1; }
index 7b231a6c663e424e43cda0d7ccc43764928e3a7d..b28b39d36f05c58f507c23255ceeba7af011306f 100644 (file)
@@ -46,10 +46,10 @@ typedef struct s_vol_list VOL_LIST;
 
 /*
  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * !!!                                              !!!
- * !!!  All records must have a pointer to          !!!
- * !!!  the next item as the first item defined.    !!!
- * !!!                                              !!!
+ * !!!                                               !!!
+ * !!!   All records must have a pointer to          !!!
+ * !!!   the next item as the first item defined.    !!!
+ * !!!                                               !!!
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
 
@@ -78,15 +78,15 @@ typedef struct s_bsr_sesstime {
 
 typedef struct s_bsr_volfile {
    struct s_bsr_volfile *next;
-   uint32_t sfile;                   /* start file */
-   uint32_t efile;                   /* end file */
+   uint32_t sfile;                    /* start file */
+   uint32_t efile;                    /* end file */
    int found;
 } BSR_VOLFILE;
 
 typedef struct s_bsr_findex {
    struct s_bsr_findex *next;
-   int32_t findex;                   /* start file index */
-   int32_t findex2;                  /* end file index */
+   int32_t findex;                    /* start file index */
+   int32_t findex2;                   /* end file index */
    int found;
 } BSR_FINDEX;
 
@@ -115,26 +115,27 @@ typedef struct s_bsr_job {
 
 typedef struct s_bsr_stream {
    struct s_bsr_stream *next;
-   int32_t stream;                   /* stream desired */
+   int32_t stream;                    /* stream desired */
    int found;
 } BSR_STREAM;
 
 typedef struct s_bsr {
-   struct s_bsr *next;               /* pointer to next one */
-   int          done;                /* set when everything found */
-   BSR_VOLUME  *volume;
-   int32_t      Slot;                /* Slot */
-   BSR_VOLFILE *volfile;
+   struct s_bsr *next;                /* pointer to next one */
+   int           done;                /* set when everything found */
+   BSR_VOLUME   *volume;
+   int32_t       Slot;                /* Slot */
+   int32_t       count;               /* count of files to restore this volume */
+   BSR_VOLFILE  *volfile;
    BSR_SESSTIME *sesstime;
-   BSR_SESSID  *sessid;
-   BSR_JOBID   *JobId;
-   BSR_JOB     *job;
-   BSR_CLIENT  *client;
-   BSR_FINDEX  *FileIndex;
-   BSR_JOBTYPE *JobType;
+   BSR_SESSID   *sessid;
+   BSR_JOBID    *JobId;
+   BSR_JOB      *job;
+   BSR_CLIENT   *client;
+   BSR_FINDEX   *FileIndex;
+   BSR_JOBTYPE  *JobType;
    BSR_JOBLEVEL *JobLevel;
-   BSR_STREAM  *stream;
-// FF_PKT *ff;                       /* include/exclude */
+   BSR_STREAM   *stream;
+// FF_PKT *ff;                        /* include/exclude */
 } BSR;
 
 
index 80c6315de248a7267a9048fd0fe473ca38cee15c..d1e480785958c2d922912a125f296a346a7e7bd2 100644 (file)
@@ -404,7 +404,7 @@ int update_pos_dev(DEVICE *dev)
 #ifdef xxxx
    struct mtget mt_stat;
 #endif
-   int32_t pos;
+   int64_t pos;
    int stat = 0;
 
    if (dev->fd < 0) {
index 063fcf72274ff001f5707a8f872cb8ff1151ce69..6d41843e64c93009334a1778ff8982042f4a8065 100644 (file)
@@ -269,6 +269,8 @@ void _block_device(char *file, int line, DEVICE *dev, int state)
    dev->no_wait_id = pthread_self();  /* allow us to continue */
 }
 
+
+
 /*
  * Unblock the device, and wake up anyone who went to sleep.
  */
index 482f7f78033be08696f828ceaa7f45c76d3a27c0..c125a2c1effcdd8a7c935f4beb2c62e2a40120ab 100644 (file)
@@ -6,6 +6,11 @@
  *    subcommands that are handled
  *    in job.c.  
  *
+ *    N.B. in this file, in general we must use P(dev->mutex) rather
+ *     than lock_device(dev) so that we can examine the blocked
+ *      state rather than blocking ourselves. In some "safe" cases,
+ *     we can do things to a blocked device. CAREFUL!!!!
+ *
  *    File daemon commands are handled in fdcmd.c
  *
  *     Kern Sibbald, May MMI
@@ -62,7 +67,8 @@ static int cancel_cmd(JCR *cjcr);
 static int mount_cmd(JCR *jcr);
 static int unmount_cmd(JCR *jcr);
 static int status_cmd(JCR *sjcr);
-static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *vname, char *poolname);
+static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *vname, char *poolname, 
+                              int Slot);
 
 struct s_cmds {
    char *cmd;
@@ -259,53 +265,20 @@ static int label_cmd(JCR *jcr)
         jcr->device = device;
         dev = device->dev;
 
-/* *****FIXME***** add autochanger code */
-
-#ifdef NEW_LOCK
-        P(dev->lock.mutex);
-        if (!(dev->state & ST_OPENED)) {
-           label_it = TRUE;
-        } else if (dev->dev_blocked && 
-                   dev->dev_blocked != BST_DOING_ACQUIRE) {  /* device blocked? */
-           label_it = TRUE;
-        } else if (dev->state & ST_READ || dev->num_writers) {
-           if (dev->state & ST_READ) {
-                bnet_fsend(dir, _("3901 Device %s is busy with 1 reader.\n"),
-                  dev_name(dev));
-           } else {
-                bnet_fsend(dir, _("3902 Device %s is busy with %d writer(s).\n"),
-                  dev_name(dev), dev->num_writers);
-           }
-        } else {                     /* device not being used */
-           label_it = TRUE;
-        }
-        if (label_it) {
-           new_steal_device_lock(dev, &hold, BST_WRITING_LABEL);
-           if (!(dev->state & ST_OPENED)) {
-              if (open_dev(dev, volname, READ_WRITE) < 0) {
-                  bnet_fsend(dir, _("3994 Connot open device: %s\n"), strerror_dev(dev));
-              } else {
-                 label_volume_if_ok(jcr, dev, volname, poolname);
-                 force_close_dev(dev);
-              }
-           } else {
-              label_volume_if_ok(jcr, dev, volname, poolname);
-           }
-           new_return_device_lock(dev, &hold);
-        }
-        V(dev->lock.mutex);
-#else
-        P(dev->mutex);
+        P(dev->mutex);               /* Use P to avoid indefinite block */
         if (!(dev->state & ST_OPENED)) {
            if (open_dev(dev, volname, READ_WRITE) < 0) {
                bnet_fsend(dir, _("3994 Connot open device: %s\n"), strerror_dev(dev));
            } else {
-              label_volume_if_ok(jcr, dev, volname, poolname);
+              label_volume_if_ok(jcr, dev, volname, poolname, slot);
               force_close_dev(dev);
            }
+         /* Under certain "safe" conditions, we can steal the lock */
         } else if (dev->dev_blocked && 
-                   dev->dev_blocked != BST_DOING_ACQUIRE) {  /* device blocked? */
-           label_volume_if_ok(jcr, dev, volname, poolname);
+                   (dev->dev_blocked == BST_UNMOUNTED ||
+                    dev->dev_blocked == BST_WAITING_FOR_SYSOP ||
+                    dev->dev_blocked == BST_UNMOUNTED_WAITING_FOR_SYSOP)) {
+           label_volume_if_ok(jcr, dev, volname, poolname, slot);
         } else if (dev->state & ST_READ || dev->num_writers) {
            if (dev->state & ST_READ) {
                 bnet_fsend(dir, _("3901 Device %s is busy with 1 reader.\n"),
@@ -315,10 +288,9 @@ static int label_cmd(JCR *jcr)
                   dev_name(dev), dev->num_writers);
            }
         } else {                     /* device not being used */
-           label_volume_if_ok(jcr, dev, volname, poolname);
+           label_volume_if_ok(jcr, dev, volname, poolname, slot);
         }
         V(dev->mutex);
-#endif
       } else {
          bnet_fsend(dir, _("3999 Device %s not found\n"), dname);
       }
@@ -341,7 +313,8 @@ static int label_cmd(JCR *jcr)
  *
  *  Enter with the mutex set
  */
-static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *vname, char *poolname)
+static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *vname, char *poolname,
+                              int slot) 
 {
    BSOCK *dir = jcr->dir_bsock;
    DEV_BLOCK *block;
@@ -350,7 +323,11 @@ static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *vname, char *poolnam
    steal_device_lock(dev, &hold, BST_WRITING_LABEL);
    
    strcpy(jcr->VolumeName, vname);
+   jcr->VolCatInfo.Slot = slot;
+   autoload_device(jcr, dev, 0);      /* autoload if possible */
    block = new_block(dev);
+
+   /* See what we have for a Volume */
    switch (read_dev_volume_label(jcr, dev, block)) {               
       case VOL_NAME_ERROR:
       case VOL_VERSION_ERROR:
@@ -441,7 +418,7 @@ static int mount_cmd(JCR *jcr)
       if (found) {
         jcr->device = device;
         dev = device->dev;
-        P(dev->mutex);
+        P(dev->mutex);               /* Use P to avoid indefinite block */
         switch (dev->dev_blocked) {         /* device blocked? */
            DEV_BLOCK *block;
            case BST_WAITING_FOR_SYSOP:
@@ -465,7 +442,6 @@ static int mount_cmd(JCR *jcr)
               if (dev->dev_blocked == BST_UNMOUNTED) {
                   Dmsg0(90, "Unmounted unblocking device\n");
                  read_label(jcr, dev);
-                 new_unlock_device(dev);
                  unblock_device(dev);
               } else {
                   Dmsg0(90, "Unmounted waiting for mount attempt to wake thread\n");
@@ -565,7 +541,7 @@ static int unmount_cmd(JCR *jcr)
       if (found) {
         jcr->device = device;
         dev = device->dev;
-        P(dev->mutex);
+        P(dev->mutex);               /* Use P to avoid indefinite block */
         if (!(dev->state & ST_OPENED)) {
             Dmsg0(90, "Device already unmounted\n");
             bnet_fsend(dir, _("3901 Device %s is already unmounted.\n"), dev_name(dev));
@@ -601,7 +577,6 @@ static int unmount_cmd(JCR *jcr)
 
         } else {                     /* device not being used */
             Dmsg0(90, "Device not in use, unmounting\n");
-           new_lock_device_state(dev, BST_UNMOUNTED);
            block_device(dev, BST_UNMOUNTED);
            if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
               offline_dev(dev);
index 1181641bed46df5f0af078df8fe216eb3a5dbbcc..c97203f7be19f32861889f2702269442e2ec1984 100644 (file)
@@ -125,9 +125,12 @@ int job_cmd(JCR *jcr)
    /*
     * Pass back an authorization key for the File daemon
     */
+#ifdef Old_way_not_so_good
    gettimeofday(&tv, &tz);
    srandom(tv.tv_usec + tv.tv_sec);
    sprintf(auth_key, "%ld", (long)random());
+#endif
+   makeSessionKey(auth_key, NULL, 1);
    bnet_fsend(dir, OKjob, jcr->VolSessionId, jcr->VolSessionTime, auth_key);
    Dmsg1(110, ">dird: %s", dir->msg);
    jcr->sd_auth_key = bstrdup(auth_key);
@@ -149,6 +152,10 @@ int job_cmd(JCR *jcr)
 
 
    Dmsg1(200, "%s waiting on job_start_wait\n", jcr->Job);
+   /* Wait for the File daemon to contact us to start the Job,
+    *  when he does, we will be released, unless the 30 minutes
+    *  expires.
+    */
    P(jcr->mutex);
    for ( ;!job_cancelled(jcr); ) {
       errstat = pthread_cond_timedwait(&jcr->job_start_wait, &jcr->mutex, &timeout);
index 94f5858149fe5953d7607ce3ef078540641a2bf9..aac5c57d5b48311a725b076050ec47715ac77371 100644 (file)
@@ -124,72 +124,10 @@ mount_next_vol:
 
    jcr->VolFirstFile = jcr->JobFiles; /* first update of Vol FileIndex */
    for ( ;; ) {
-      int slot = jcr->VolCatInfo.Slot;
-       
-      /*
-       * Handle autoloaders here.  If we cannot autoload it, we
-       *  will fall through to ask the sysop.
-       */
-      if (dev->capabilities && CAP_AUTOCHANGER && slot <= 0) {
-        if (dir_find_next_appendable_volume(jcr)) {
-           slot = jcr->VolCatInfo.Slot; 
-        }
+      autochanger = autoload_device(jcr, dev, 1);
+      if (autochanger) {
+        ask = 0;                     /* if autochange no need to ask sysop */
       }
-      Dmsg1(100, "Want changer slot=%d\n", slot);
-
-      if (slot > 0 && jcr->device->changer_name && jcr->device->changer_command) {
-        uint32_t timeout = jcr->device->max_changer_wait;
-        POOLMEM *changer, *results;
-        int status, loaded;
-
-        results = get_pool_memory(PM_MESSAGE);
-        changer = get_pool_memory(PM_FNAME);
-        /* Find out what is loaded */
-        changer = edit_device_codes(jcr, changer, jcr->device->changer_command, 
-                      "loaded");
-        status = run_program(changer, timeout, results);
-        if (status == 0) {
-           loaded = atoi(results);
-        } else {
-           loaded = -1;              /* force unload */
-        }
-         Dmsg1(100, "loaded=%s\n", results);
-
-        /* If bad status or tape we want is not loaded, load it. */
-        if (status != 0 || loaded != slot) { 
-           if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
-              offline_dev(dev);
-           }
-           /* We are going to load a new tape, so close the device */
-           force_close_dev(dev);
-           if (loaded != 0) {        /* must unload drive */
-               Dmsg0(100, "Doing changer unload.\n");
-               Jmsg(jcr, M_INFO, 0, _("Issuing autochanger \"unload\" command.\n"));
-              changer = edit_device_codes(jcr, changer, 
-                           jcr->device->changer_command, "unload");
-              status = run_program(changer, timeout, NULL);
-               Dmsg1(100, "unload status=%d\n", status);
-           }
-           /*
-            * Load the desired cassette    
-            */
-            Dmsg1(100, "Doing changer load slot %d\n", slot);
-            Jmsg(jcr, M_INFO, 0, _("Issuing autochanger \"load slot %d\" command.\n"),
-              slot);
-           changer = edit_device_codes(jcr, changer, 
-                         jcr->device->changer_command, "load");
-           status = run_program(changer, timeout, NULL);
-            Dmsg2(100, "load slot %d status=%d\n", slot, status);
-        }
-        free_pool_memory(changer);
-        free_pool_memory(results);
-         Dmsg1(100, "After changer, status=%d\n", status);
-        if (status == 0) {           /* did we succeed? */
-           ask = 0;                  /* yes, got vol, no need to ask sysop */
-           autochanger = 1;          /* tape loaded by changer */
-        }
-      }
-
 
       if (ask && !dir_ask_sysop_to_mount_next_volume(jcr, dev)) {
         return 0;              /* error return */
@@ -224,7 +162,7 @@ read_volume:
             Dmsg1(500, "Vol NAME Error Name=%s\n", jcr->VolumeName);
            /* Check if we can accept this as an anonymous volume */
            strcpy(jcr->VolumeName, dev->VolHdr.VolName);
-           if (!dev->capabilities & CAP_ANONVOLS || !dir_get_volume_info(jcr)) {
+           if (!dev->capabilities & CAP_ANONVOLS || !dir_get_volume_info(jcr, 1)) {
               goto mount_next_vol;
            }
             Dmsg1(200, "want new name=%s\n", jcr->VolumeName);
@@ -248,7 +186,7 @@ read_volume:
            /* NOTE! Fall-through wanted. */
         default:
            /* Send error message */
-            Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
+            Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
            if (autochanger) {
                Jmsg(jcr, M_ERROR, 0, _("Autochanger Volume %s not found in slot %d.\n\
     Setting slot to zero in catalog.\n"),
@@ -402,6 +340,87 @@ int mount_next_read_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
    return 0;
 }
 
+/*
+ * Called here to do an autoload using the autochanger, if
+ *  configured, and if a Slot has been defined for this Volume.
+ *  On success this routine loads the indicated tape, but the
+ *  label is not read, so it must be verified.
+ *
+ *  Returns: 1 on success
+ *          0 on failure
+ */
+int autoload_device(JCR *jcr, DEVICE *dev, int writing)
+{
+   int slot = jcr->VolCatInfo.Slot;
+   int rtn_stat = 0;
+     
+   /*
+    * Handle autoloaders here. If we cannot autoload it, we
+    *  will return FALSE to ask the sysop.
+    */
+   if (writing && dev->capabilities && CAP_AUTOCHANGER && slot <= 0) {
+      if (dir_find_next_appendable_volume(jcr)) {
+        slot = jcr->VolCatInfo.Slot; 
+      }
+   }
+   Dmsg1(100, "Want changer slot=%d\n", slot);
+
+   if (slot > 0 && jcr->device->changer_name && jcr->device->changer_command) {
+      uint32_t timeout = jcr->device->max_changer_wait;
+      POOLMEM *changer, *results;
+      int status, loaded;
+
+      results = get_pool_memory(PM_MESSAGE);
+      changer = get_pool_memory(PM_FNAME);
+
+      /* Find out what is loaded, zero means device is unloaded */
+      changer = edit_device_codes(jcr, changer, jcr->device->changer_command, 
+                   "loaded");
+      status = run_program(changer, timeout, results);
+      if (status == 0) {
+        loaded = atoi(results);
+      } else {
+        loaded = -1;              /* force unload */
+      }
+      Dmsg1(100, "loaded=%s\n", results);
+
+      /* If bad status or tape we want is not loaded, load it. */
+      if (status != 0 || loaded != slot) { 
+        if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
+           offline_dev(dev);
+        }
+        /* We are going to load a new tape, so close the device */
+        force_close_dev(dev);
+        if (loaded != 0) {        /* must unload drive */
+            Dmsg0(100, "Doing changer unload.\n");
+            Jmsg(jcr, M_INFO, 0, _("Issuing autochanger \"unload\" command.\n"));
+           changer = edit_device_codes(jcr, changer, 
+                        jcr->device->changer_command, "unload");
+           status = run_program(changer, timeout, NULL);
+            Dmsg1(100, "unload status=%d\n", status);
+        }
+        /*
+         * Load the desired cassette    
+         */
+         Dmsg1(100, "Doing changer load slot %d\n", slot);
+         Jmsg(jcr, M_INFO, 0, _("Issuing autochanger \"load slot %d\" command.\n"),
+           slot);
+        changer = edit_device_codes(jcr, changer, 
+                      jcr->device->changer_command, "load");
+        status = run_program(changer, timeout, NULL);
+         Dmsg2(100, "load slot %d status=%d\n", slot, status);
+      }
+      free_pool_memory(changer);
+      free_pool_memory(results);
+      Dmsg1(100, "After changer, status=%d\n", status);
+      if (status == 0) {          /* did we succeed? */
+        rtn_stat = 1;             /* tape loaded by changer */
+      }
+   }
+   return rtn_stat;
+}
+
+
 
 /*
  * Edit codes into ChangerCommand
index ca141da4b9e2e44c91aa48d9a8a5d6120f6366df..f0dc3a62e2f6496173cec43d19458430eb0270af 100755 (executable)
@@ -35,6 +35,7 @@ static BSR *store_vol(LEX *lc, BSR *bsr);
 static BSR *store_client(LEX *lc, BSR *bsr);
 static BSR *store_job(LEX *lc, BSR *bsr);
 static BSR *store_jobid(LEX *lc, BSR *bsr);
+static BSR *store_count(LEX *lc, BSR *bsr);
 static BSR *store_jobtype(LEX *lc, BSR *bsr);
 static BSR *store_joblevel(LEX *lc, BSR *bsr);
 static BSR *store_findex(LEX *lc, BSR *bsr);
@@ -59,6 +60,7 @@ struct kw_items items[] = {
    {"client", store_client},
    {"job", store_job},
    {"jobid", store_jobid},
+   {"count", store_count},
    {"fileindex", store_findex},
    {"jobtype", store_jobtype},
    {"joblevel", store_joblevel},
@@ -173,6 +175,10 @@ static BSR *store_vol(LEX *lc, BSR *bsr)
    if (token == T_ERROR) {
       return NULL;
    }
+   if (bsr->volume) {
+      bsr->next = new_bsr();
+      bsr = bsr->next;
+   }
    /* This may actually be more than one volume separated by a |  
     * If so, separate them.
     */
@@ -324,6 +330,21 @@ static BSR *store_jobid(LEX *lc, BSR *bsr)
    return bsr;
 }
 
+
+static BSR *store_count(LEX *lc, BSR *bsr)
+{
+   int token;
+
+   token = lex_get_token(lc, T_PINT32);
+   if (token == T_ERROR) {
+      return NULL;
+   }
+   bsr->count = lc->pint32_val;
+   scan_to_eol(lc);
+   return bsr;
+}
+
+
 static BSR *store_jobtype(LEX *lc, BSR *bsr)
 {
    /* *****FIXME****** */
@@ -596,6 +617,12 @@ void dump_bsr(BSR *bsr)
    dump_jobid(bsr->JobId);
    dump_job(bsr->job);
    dump_findex(bsr->FileIndex);
+   if (bsr->Slot) {
+      Dmsg1(-1, "Slot        : %u\n", bsr->Slot);
+   }
+   if (bsr->count) {
+      Dmsg1(-1, "count       : %u\n", bsr->count);
+   }
    if (bsr->next) {
       Dmsg0(-1, "\n");
       dump_bsr(bsr->next);
index b55b162737357141bb179e7ed667a6763b6835ef..9272d43bd32102aa9e92f9dec8e37d7ec228a840 100644 (file)
 uint32_t new_VolSessionId();
 
 /* From acquire.c */
-int     acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int     acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int     ready_dev_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int     release_device(JCR *jcr, DEVICE *dev);
+int      acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int      acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int      release_device(JCR *jcr, DEVICE *dev);
 
 /* From askdir.c */
-int    dir_get_volume_info(JCR *jcr);
-int    dir_find_next_appendable_volume(JCR *jcr);
-int    dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel);
-int    dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev);
-int    dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev);
-int    dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec);
-int    dir_send_job_status(JCR *jcr);
-int    dir_create_jobmedia_record(JCR *jcr);
+int     dir_get_volume_info(JCR *jcr, int writing);
+int     dir_find_next_appendable_volume(JCR *jcr);
+int     dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel);
+int     dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev);
+int     dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev);
+int     dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec);
+int     dir_send_job_status(JCR *jcr);
+int     dir_create_jobmedia_record(JCR *jcr);
 
 /* authenticate.c */
-int    authenticate_director(JCR *jcr);
-int    authenticate_filed(JCR *jcr);
+int     authenticate_director(JCR *jcr);
+int     authenticate_filed(JCR *jcr);
 
 /* From block.c */
-void   dump_block(DEV_BLOCK *b, char *msg);
+void    dump_block(DEV_BLOCK *b, char *msg);
 DEV_BLOCK *new_block(DEVICE *dev);
-void   init_block_write(DEV_BLOCK *block);
-void   empty_block(DEV_BLOCK *block);
-void   free_block(DEV_BLOCK *block);
-int    write_block_to_device(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int    write_block_to_dev(DEVICE *dev, DEV_BLOCK *block);
-int    read_block_from_device(DEVICE *dev, DEV_BLOCK *block);
-int    read_block_from_dev(DEVICE *dev, DEV_BLOCK *block);
+void    init_block_write(DEV_BLOCK *block);
+void    empty_block(DEV_BLOCK *block);
+void    free_block(DEV_BLOCK *block);
+int     write_block_to_device(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int     write_block_to_dev(DEVICE *dev, DEV_BLOCK *block);
+int     read_block_from_device(DEVICE *dev, DEV_BLOCK *block);
+int     read_block_from_dev(DEVICE *dev, DEV_BLOCK *block);
 
 /* From butil.c */
 void print_ls_output(char *fname, char *link, int type, struct stat *statp);
@@ -66,44 +65,44 @@ void display_error_status(DEVICE *dev);
 
 
 /* From dev.c */
-DEVICE *init_dev(DEVICE *dev, char *device);
-int     open_dev(DEVICE *dev, char *VolName, int mode);
-void    close_dev(DEVICE *dev);
-void    force_close_dev(DEVICE *dev);
-int     truncate_dev(DEVICE *dev);
-void    term_dev(DEVICE *dev);
-char *  strerror_dev(DEVICE *dev);
-void    clrerror_dev(DEVICE *dev, int func);
-int     update_pos_dev(DEVICE *dev);
-int     rewind_dev(DEVICE *dev);
-int     load_dev(DEVICE *dev);
-int     offline_dev(DEVICE *dev);
-int     flush_dev(DEVICE *dev);
-int     weof_dev(DEVICE *dev, int num);
-int     write_block(DEVICE *dev);
-int     write_dev(DEVICE *dev, char *buf, size_t len);
-int     read_dev(DEVICE *dev, char *buf, size_t len);
-int     status_dev(DEVICE *dev, uint32_t *status);
-int     eod_dev(DEVICE *dev);
-int     fsf_dev(DEVICE *dev, int num);
-int     fsr_dev(DEVICE *dev, int num);
-int     bsf_dev(DEVICE *dev, int num);
-int     bsr_dev(DEVICE *dev, int num);
-void    attach_jcr_to_device(DEVICE *dev, JCR *jcr);
-void    detach_jcr_from_device(DEVICE *dev, JCR *jcr);
-JCR    *next_attached_jcr(DEVICE *dev, JCR *jcr);
+DEVICE  *init_dev(DEVICE *dev, char *device);
+int      open_dev(DEVICE *dev, char *VolName, int mode);
+void     close_dev(DEVICE *dev);
+void     force_close_dev(DEVICE *dev);
+int      truncate_dev(DEVICE *dev);
+void     term_dev(DEVICE *dev);
+char *   strerror_dev(DEVICE *dev);
+void     clrerror_dev(DEVICE *dev, int func);
+int      update_pos_dev(DEVICE *dev);
+int      rewind_dev(DEVICE *dev);
+int      load_dev(DEVICE *dev);
+int      offline_dev(DEVICE *dev);
+int      flush_dev(DEVICE *dev);
+int      weof_dev(DEVICE *dev, int num);
+int      write_block(DEVICE *dev);
+int      write_dev(DEVICE *dev, char *buf, size_t len);
+int      read_dev(DEVICE *dev, char *buf, size_t len);
+int      status_dev(DEVICE *dev, uint32_t *status);
+int      eod_dev(DEVICE *dev);
+int      fsf_dev(DEVICE *dev, int num);
+int      fsr_dev(DEVICE *dev, int num);
+int      bsf_dev(DEVICE *dev, int num);
+int      bsr_dev(DEVICE *dev, int num);
+void     attach_jcr_to_device(DEVICE *dev, JCR *jcr);
+void     detach_jcr_from_device(DEVICE *dev, JCR *jcr);
+JCR     *next_attached_jcr(DEVICE *dev, JCR *jcr);
 
 
 /* Get info about device */
-char *  dev_name(DEVICE *dev);
-char *  dev_vol_name(DEVICE *dev);
+char *   dev_name(DEVICE *dev);
+char *   dev_vol_name(DEVICE *dev);
 uint32_t dev_block(DEVICE *dev);
 uint32_t dev_file(DEVICE *dev);
-int     dev_is_tape(DEVICE *dev);
+int      dev_is_tape(DEVICE *dev);
 
 /* From device.c */
-int     open_device(DEVICE *dev);
-int     fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int      open_device(DEVICE *dev);
+int      fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
 void _lock_device(char *file, int line, DEVICE *dev);
 void _unlock_device(char *file, int line, DEVICE *dev);
 void _block_device(char *file, int line, DEVICE *dev, int state);
@@ -119,38 +118,39 @@ void  new_steal_device_lock(DEVICE *dev, brwsteal_t *hold, int state);
 void  new_return_device_lock(DEVICE *dev, brwsteal_t *hold);
 
 /* From dircmd.c */
-void    connection_request(void *arg); 
+void     connection_request(void *arg); 
 
 
 /* From fd_cmds.c */
-void    run_job(JCR *jcr);
+void     run_job(JCR *jcr);
 
 /* From fdmsg.c */
-int     bget_msg(BSOCK *sock);
+int      bget_msg(BSOCK *sock);
 
 /* From job.c */
-void    stored_free_jcr(JCR *jcr);
-void    connection_from_filed(void *arg);     
-void    handle_filed_connection(BSOCK *fd, char *job_name);
+void     stored_free_jcr(JCR *jcr);
+void     connection_from_filed(void *arg);     
+void     handle_filed_connection(BSOCK *fd, char *job_name);
 
 /* From label.c */
-int     read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-void    create_session_label(JCR *jcr, DEV_RECORD *rec, int label);
-int     write_volume_label_to_dev(JCR *jcr, DEVRES *device, char *VolName, char *PoolName);
-int     write_session_label(JCR *jcr, DEV_BLOCK *block, int label);
-int     write_volume_label_to_block(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-void    dump_volume_label(DEVICE *dev);
-void    dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose);
-int     unser_volume_label(DEVICE *dev, DEV_RECORD *rec);
-int     unser_session_label(SESSION_LABEL *label, DEV_RECORD *rec);
+int      read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+void     create_session_label(JCR *jcr, DEV_RECORD *rec, int label);
+int      write_volume_label_to_dev(JCR *jcr, DEVRES *device, char *VolName, char *PoolName);
+int      write_session_label(JCR *jcr, DEV_BLOCK *block, int label);
+int      write_volume_label_to_block(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+void     dump_volume_label(DEVICE *dev);
+void     dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose);
+int      unser_volume_label(DEVICE *dev, DEV_RECORD *rec);
+int      unser_session_label(SESSION_LABEL *label, DEV_RECORD *rec);
 
 /* From match_bsr.c */
 int match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, 
-             SESSION_LABEL *sesrec);
+              SESSION_LABEL *sesrec);
 
 /* From mount.c */
-int     mount_next_write_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release);
-int     mount_next_read_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int      mount_next_write_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release);
+int      mount_next_read_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int      autoload_device(JCR *jcr, DEVICE *dev, int writing);
 
 
 /* From parse_bsr.c */
@@ -165,11 +165,11 @@ extern void create_vol_list(JCR *jcr);
 /* From record.c */
 char   *FI_to_ascii(int fi);
 char   *stream_to_ascii(int stream);
-int    write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
-int    can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
-int    read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec); 
+int     write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
+int     can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
+int     read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec); 
 DEV_RECORD *new_record();
-void   free_record(DEV_RECORD *rec);
+void    free_record(DEV_RECORD *rec);
 
 /* From read_record.c */
 int read_records(JCR *jcr,  DEVICE *dev, 
index f4fa27b31d1ac8a5d426ff1f9e74567241b2c3bc..ac93ddf5a043e76fc2fb91d107cf4b288233d2d7 100644 (file)
@@ -82,8 +82,17 @@ int do_read_data(JCR *jcr)
    block = new_block(dev);
 
    create_vol_list(jcr);
+   if (jcr->NumVolumes == 0) {
+      Jmsg(jcr, M_FATAL, 0, _("No Volume names found for restore.\n"));
+      free_block(block);
+      free_vol_list(jcr);
+      return 0;
+   }
+
+   Dmsg2(200, "Found %d volumes names to restore. First=%s\n", jcr->NumVolumes, 
+      jcr->VolList->VolumeName);
 
-   Dmsg1(20, "Found %d volumes names to restore.\n", jcr->NumVolumes);
+   pm_strcpy(&jcr->VolumeName, jcr->VolList->VolumeName);
 
    /* 
     * Ready device for reading, and read records
index e3759ecb78bb92a9fa3e0eced8aea3d2ef4e580f..8eed0fa90709b023b99d87db6bbeb8bb316822e8 100644 (file)
@@ -235,8 +235,13 @@ void free_resource(int type)
 
    /* common stuff -- free the resource name */
    nres = (URES *)res->res_dir.hdr.next;
-   if (res->res_dir.hdr.name)
+   if (res->res_dir.hdr.name) {
       free(res->res_dir.hdr.name);
+   }
+   if (res->res_dir.hdr.desc) {
+      free(res->res_dir.hdr.desc);
+   }
+
 
    switch (type) {
       case R_DIRECTOR:
index b6dd8bc8b9197c5619dfce4ed03b82733ea702fe..61e381ecffd085b21e2152c8e43a44f789e5c1bc 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.26"
 #define VSTRING "1"
-#define DATE    "05 September 2002"
-#define LSMDATE "05Sep02"
+#define DATE    "14 September 2002"
+#define LSMDATE "14Sep02"
 
 /* Debug flags */
 #define DEBUG 1