]> git.sur5r.net Git - bacula/bacula/commitdiff
Win32 fixes -- see kes10Oct02
authorKern Sibbald <kern@sibbald.com>
Thu, 10 Oct 2002 16:59:40 +0000 (16:59 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 10 Oct 2002 16:59:40 +0000 (16:59 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@169 91ce42f0-d328-0410-95d8-f526ca767f89

16 files changed:
bacula/autoconf/acconfig.h
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/src/baconfig.h
bacula/src/cats/sql_get.c
bacula/src/dird/bacula-dir.conf.in
bacula/src/dird/job.c
bacula/src/dird/ua_restore.c
bacula/src/dird/ua_run.c
bacula/src/filed/restore.c
bacula/src/lib/bnet_server.c
bacula/src/lib/message.c
bacula/src/lib/tree.c
bacula/src/lib/tree.h
bacula/src/version.h

index 8da8849a36f15907c7ab6808b86b3068f48a2025..250f8b7a8fffdf860c5d38b0706cf14531b48bbb 100644 (file)
 #undef HAVE_READDIR_R
 #undef HAVE_STRERROR_R
 #undef HAVE_GETHOSTBYNAME_R
+
+#undef HAVE_INET_PTON
index 93eedae3857f295ad006fe62bd4893362572c1d3..ac49e7547078a9f621dcf5722211985a26f4827c 100644 (file)
 /* Define if you have the getpid function.  */
 #undef HAVE_GETPID
 
+/* Define if you have the inet_pton function.  */
+#undef HAVE_INET_PTON
+
 /* Define if you have the lchown function.  */
 #undef HAVE_LCHOWN
 
 
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES
-
index 07661c5466b179d6bc0b861343144ac222810d9b..2a86c7028678d0099b3568b5dd43e5fd8675d4ae 100644 (file)
@@ -972,6 +972,7 @@ AC_CHECK_FUNC(socket,
     AC_CHECK_LIB(socket,socket)
     AC_CHECK_LIB(inet,socket))
 
+AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
 
 AC_FUNC_STRFTIME
 AC_FUNC_VPRINTF
index 151cafb71c89a1a43c799019cafd8874be71c614..f909a8e4fcae774ef6a4ee85bb79197e0a6f3de4 100755 (executable)
@@ -8049,14 +8049,72 @@ fi
 fi
 
 
+for ac_func in inet_pton
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8056: 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 8061 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8084: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ cat >> confdefs.h <<\EOF
+#define HAVE_INET_PTON 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:8055: checking for strftime" >&5
+echo "configure:8113: 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 8060 "configure"
+#line 8118 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -8079,7 +8137,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8141: \"$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
@@ -8101,7 +8159,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:8105: checking for strftime in -lintl" >&5
+echo "configure:8163: 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
@@ -8109,7 +8167,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8113 "configure"
+#line 8171 "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
@@ -8120,7 +8178,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8182: \"$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
@@ -8147,12 +8205,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:8151: checking for vprintf" >&5
+echo "configure:8209: 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 8156 "configure"
+#line 8214 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -8175,7 +8233,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8237: \"$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
@@ -8199,12 +8257,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:8203: checking for _doprnt" >&5
+echo "configure:8261: 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 8208 "configure"
+#line 8266 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -8227,7 +8285,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8289: \"$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
@@ -8254,19 +8312,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:8258: checking for working alloca.h" >&5
+echo "configure:8316: 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 8263 "configure"
+#line 8321 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8328: \"$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
@@ -8287,12 +8345,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8291: checking for alloca" >&5
+echo "configure:8349: 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 8296 "configure"
+#line 8354 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8320,7 +8378,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8382: \"$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
@@ -8352,12 +8410,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8356: checking whether alloca needs Cray hooks" >&5
+echo "configure:8414: 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 8361 "configure"
+#line 8419 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8382,12 +8440,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:8386: checking for $ac_func" >&5
+echo "configure:8444: 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 8391 "configure"
+#line 8449 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8410,7 +8468,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8472: \"$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
@@ -8437,7 +8495,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8441: checking stack direction for C alloca" >&5
+echo "configure:8499: 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
@@ -8445,7 +8503,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 8449 "configure"
+#line 8507 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8464,7 +8522,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8526: \"$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
@@ -8487,7 +8545,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:8491: checking for getmntent in -lsun" >&5
+echo "configure:8549: 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
@@ -8495,7 +8553,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8499 "configure"
+#line 8557 "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
@@ -8506,7 +8564,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8568: \"$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
@@ -8525,7 +8583,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:8529: checking for getmntent in -lseq" >&5
+echo "configure:8587: 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
@@ -8533,7 +8591,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lseq  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8537 "configure"
+#line 8595 "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
@@ -8544,7 +8602,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8606: \"$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
@@ -8563,7 +8621,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:8567: checking for getmntent in -lgen" >&5
+echo "configure:8625: 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
@@ -8571,7 +8629,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8575 "configure"
+#line 8633 "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
@@ -8582,7 +8640,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8644: \"$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
@@ -8607,12 +8665,12 @@ fi
 fi
 
 echo $ac_n "checking for getmntent""... $ac_c" 1>&6
-echo "configure:8611: checking for getmntent" >&5
+echo "configure:8669: 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 8616 "configure"
+#line 8674 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getmntent(); below.  */
@@ -8635,7 +8693,7 @@ getmntent();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8697: \"$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
@@ -8658,7 +8716,7 @@ else
 fi
 
 echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
-echo "configure:8662: checking whether closedir returns void" >&5
+echo "configure:8720: 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
@@ -8666,13 +8724,13 @@ else
   ac_cv_func_closedir_void=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8670 "configure"
+#line 8728 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_header_dirent>
 int closedir(); main() { exit(closedir(opendir(".")) != 0); }
 EOF
-if { (eval echo configure:8676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8734: \"$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
@@ -8695,7 +8753,7 @@ EOF
 fi
 
 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8699: checking whether setpgrp takes no argument" >&5
+echo "configure:8757: 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
@@ -8703,7 +8761,7 @@ else
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 8707 "configure"
+#line 8765 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -8723,7 +8781,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:8727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8785: \"$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
@@ -8746,7 +8804,7 @@ EOF
 
 fi
                      echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8750: checking for working fnmatch" >&5
+echo "configure:8808: 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
@@ -8757,11 +8815,11 @@ if test "$cross_compiling" = yes; then
   ac_cv_func_fnmatch_works=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8761 "configure"
+#line 8819 "configure"
 #include "confdefs.h"
 main() { exit (fnmatch ("a*", "abc", 0) != 0); }
 EOF
-if { (eval echo configure:8765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8823: \"$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
@@ -8786,7 +8844,7 @@ fi
 
 
 echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:8790: checking for setlocale in -lxpg4" >&5
+echo "configure:8848: 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
@@ -8794,7 +8852,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxpg4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8798 "configure"
+#line 8856 "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
@@ -8805,7 +8863,7 @@ int main() {
 setlocale()
 ; return 0; }
 EOF
-if { (eval echo configure:8809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8867: \"$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
@@ -8828,7 +8886,7 @@ fi
 
 
 echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6
-echo "configure:8832: checking for getpwnam in -lsun" >&5
+echo "configure:8890: 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
@@ -8836,7 +8894,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8840 "configure"
+#line 8898 "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
@@ -8847,7 +8905,7 @@ int main() {
 getpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:8851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8909: \"$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
@@ -8879,17 +8937,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:8883: checking for $ac_hdr" >&5
+echo "configure:8941: 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 8888 "configure"
+#line 8946 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8951: \"$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*
@@ -8916,7 +8974,7 @@ fi
 done
 
 echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:8920: checking for deflate in -lz" >&5
+echo "configure:8978: 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
@@ -8924,7 +8982,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8928 "configure"
+#line 8986 "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
@@ -8935,7 +8993,7 @@ int main() {
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8997: \"$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
@@ -8966,7 +9024,7 @@ fi
 
 PTHREAD_LIB=""
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:8970: checking for pthread_create in -lpthread" >&5
+echo "configure:9028: 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
@@ -8974,7 +9032,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8978 "configure"
+#line 9036 "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
@@ -8985,7 +9043,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9047: \"$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
@@ -9004,7 +9062,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:9008: checking for pthread_create in -lpthreads" >&5
+echo "configure:9066: 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
@@ -9012,7 +9070,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9016 "configure"
+#line 9074 "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
@@ -9023,7 +9081,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9085: \"$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
@@ -9042,7 +9100,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:9046: checking for pthread_create in -lc_r" >&5
+echo "configure:9104: 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
@@ -9050,7 +9108,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9054 "configure"
+#line 9112 "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
@@ -9061,7 +9119,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:9065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9123: \"$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
@@ -9080,12 +9138,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:9084: checking for pthread_create" >&5
+echo "configure:9142: 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 9089 "configure"
+#line 9147 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create(); below.  */
@@ -9108,7 +9166,7 @@ pthread_create();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9170: \"$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
index a76333b92feb3771ca74d753ded06a398cd11430..e03d0c1ee8b9512429422bd28ea698aa37500b11 100644 (file)
@@ -333,4 +333,11 @@ extern int thr_setconcurrency(int);
 #define ALIGN_SIZE (sizeof(double))
 #define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
 
+
+/* Added by KES to deal with Win32 systems */
+#ifndef S_ISWIN32
+#define S_ISWIN32 020000
+#endif
+
+
 #endif /* _BACONFIG_H */
index eb021b400004c0b154305e654bec9fdf237a4611..336387748759595464700fcc5d67bdea8660b31e 100644 (file)
@@ -128,16 +128,16 @@ int db_get_file_attributes_record(B_DB *mdb, char *fname, FILE_DBR *fdbr)
       pnl = 1;
    }
 
-   Dmsg1(100, "spath=%s\n", spath);
-   Dmsg1(100, "file=%s\n", file);
+   Dmsg1(400, "spath=%s\n", spath);
+   Dmsg1(400, "file=%s\n", file);
 
    db_escape_string(buf, file, fnl);
    fdbr->FilenameId = db_get_filename_record(mdb, buf);
-   Dmsg2(100, "db_get_filename_record FilenameId=%u file=%s\n", fdbr->FilenameId, buf);
+   Dmsg2(400, "db_get_filename_record FilenameId=%u file=%s\n", fdbr->FilenameId, buf);
 
    db_escape_string(buf, spath, pnl);
    fdbr->PathId = db_get_path_record(mdb, buf);
-   Dmsg2(100, "db_get_path_record PathId=%u path=%s\n", fdbr->PathId, buf);
+   Dmsg2(400, "db_get_path_record PathId=%u path=%s\n", fdbr->PathId, buf);
 
    stat = db_get_file_record(mdb, fdbr);
 
@@ -192,6 +192,9 @@ File.FilenameId=%u", fdbr->JobId, fdbr->PathId, fdbr->FilenameId);
            fdbr->MD5[sizeof(fdbr->MD5)] = 0;
            stat = 1;
         }
+      } else {
+         Mmsg2(&mdb->errmsg, _("File record not found for PathId=%u FilenameId=%u\n"),
+           fdbr->PathId, fdbr->FilenameId);
       }
       sql_free_result(mdb);
    }
@@ -236,6 +239,8 @@ static int db_get_filename_record(B_DB *mdb, char *fname)
               FilenameId = 0;
            }
         }
+      } else {
+         Mmsg1(&mdb->errmsg, _("Filename record: %s not found.\n"), fname);
       }
       sql_free_result(mdb);
    }
@@ -294,6 +299,8 @@ static int db_get_path_record(B_DB *mdb, char *path)
               }
            }
         }
+      } else { 
+         Mmsg1(&mdb->errmsg, _("Path record: %s not found.\n"), path);
       }
       sql_free_result(mdb);
    }
index 5bebcb041134c6710736eee5bcfa3149f0ba7433..fbed8024614b09f22c4a8faeb7a3c6d54d04ee6f 100644 (file)
@@ -45,7 +45,7 @@ Job {
   Storage = DLTDrive
   Messages = Standard
   Pool = Default
-  Where = /tmp
+  Where = /tmp/bacula-restores
 }
 
 
index ebf9bac1b4b65c4f390d4c993e8d2170e26ac731..c5556aaf1a1d3d6a46402b962ea7b6ac2a9394b1 100644 (file)
@@ -274,17 +274,18 @@ void create_unique_job_name(JCR *jcr, char *base_name)
     * thus unique Job Name 
     */
    P(mutex);                         /* lock creation of jobs */
-   time(&now);
+   now = time(NULL);
    while (now == last_start_time) {
       sleep(1);
-      time(&now);
+      now = time(NULL);
    }
    last_start_time = now;
    V(mutex);                         /* allow creation of jobs */
    jcr->start_time = now;
    /* Form Unique JobName */
    localtime_r(&now, &tm);
-   strftime(dt, sizeof(dt), "%Y-%m-%d.%H:%M:%S", &tm); 
+   /* Use only characters that are permitted in Windows filenames */
+   strftime(dt, sizeof(dt), "%Y-%m-%d_%H.%M.%S", &tm); 
    strncpy(name, base_name, sizeof(name));
    name[sizeof(name)-22] = 0;         /* truncate if too long */
    sprintf(jcr->Job, "%s.%s", name, dt); /* add date & time */
index 6fc2cb3b853366b4236d1ccb8d3ff22203bb4ff3..807efa13db37b380a0c8b891e4678623fafb1b0a 100644 (file)
@@ -132,6 +132,7 @@ int restorecmd(UAContext *ua, char *cmd)
    JOB *restore_job = NULL;
    int restore_jobs = 0;
    NAME_LIST name_list;
+   uint32_t selected_files = 0;
 
    if (!open_db(ua)) {
       return 0;
@@ -219,6 +220,7 @@ int restorecmd(UAContext *ua, char *cmd)
       if (node->extract) {
          Dmsg2(400, "type=%d FI=%d\n", node->type, node->FileIndex);
         add_findex(bsr, node->JobId, node->FileIndex);
+        selected_files++;
       }
    }
 
@@ -232,6 +234,7 @@ int restorecmd(UAContext *ua, char *cmd)
       }
 //    print_bsr(ua, bsr);
       write_bsr_file(ua, bsr);
+      bsendmsg(ua, _("\n%u files selected to restore.\n\n"), selected_files);
    } else {
       bsendmsg(ua, _("No files selected to restore.\n"));
    }
@@ -832,7 +835,11 @@ static int insert_tree_handler(void *ctx, int num_fields, char **row)
 
    strip_trailing_junk(row[1]);
    if (*row[1] == 0) {
-      type = TN_DIR;
+      if (*row[0] != '/') {           /* Must be Win32 directory */
+        type = TN_DIR_NLS;
+      } else {
+        type = TN_DIR;
+      }
    } else {
       type = TN_FILE;
    }
@@ -843,7 +850,7 @@ static int insert_tree_handler(void *ctx, int num_fields, char **row)
       node = new_tree_node(tree->root, type);
       tree->avail_node = node;
    }
-   Dmsg2(400, "FI=%d fname=%s\n", node->FileIndex, fname);
+   Dmsg3(200, "FI=%d type=%d fname=%s\n", node->FileIndex, type, fname);
    new_node = insert_tree_node(fname, node, tree->root, NULL);
    /* Note, if node already exists, save new one for next time */
    if (new_node != node) {
@@ -958,6 +965,8 @@ static void ls_output(char *buf, char *fname, struct stat *statp)
    char ec1[30];
    int n;
 
+// Dmsg2(000, "%s mode=0%o\n", fname, statp->st_mode);
+
    p = encode_mode(statp->st_mode, buf);
    n = sprintf(p, "  %2d ", (uint32_t)statp->st_nlink);
    p += n;
@@ -997,6 +1006,10 @@ static int dircmd(UAContext *ua, TREE_CTX *tree)
            decode_stat(fdbr.LStat, &statp); /* decode stat pkt */
            ls_output(buf, cwd, &statp);
             bsendmsg(ua, "%s\n", buf);
+        } else {
+           /* Something went wrong getting attributes -- print name */
+            bsendmsg(ua, "%s%s%s\n", node->extract?"*":"", node->fname,
+               (node->type==TN_DIR||node->type==TN_NEWDIR)?"/":"");
         }
       }
    }
@@ -1017,6 +1030,11 @@ static int helpcmd(UAContext *ua, TREE_CTX *tree)
    return 1;
 }
 
+/*
+ * Change directories. Note, if the user specifies x: and it fails,
+ *   we assume it is a Win32 absolute cd rather than relative and
+ *   try a second time with /x: ...  Win32 kludge.
+ */
 static int cdcmd(UAContext *ua, TREE_CTX *tree) 
 {
    TREE_NODE *node;
@@ -1027,7 +1045,17 @@ static int cdcmd(UAContext *ua, TREE_CTX *tree)
    }
    node = tree_cwd(ua->argk[1], tree->root, tree->node);
    if (!node) {
-      bsendmsg(ua, _("Invalid path given.\n"));
+      /* Try once more if Win32 drive -- make absolute */
+      if (ua->argk[1][1] == ':') {  /* win32 drive */
+         strcpy(cwd, "/");
+        strcat(cwd, ua->argk[1]);
+        node = tree_cwd(cwd, tree->root, tree->node);
+      }
+      if (!node) {
+         bsendmsg(ua, _("Invalid path given.\n"));
+      } else {
+        tree->node = node;
+      }
    } else {
       tree->node = node;
    }
index 63afffc465f60855952b53b0be686641ed3c721e..8703957cb78146d4e3486fff3a19af923fc80915 100644 (file)
@@ -481,18 +481,17 @@ JobId:      %s\n"),
         goto try_again;
       case 6:
         /* Where */
-         if (!get_cmd(ua, _("Please enter path prefix (where) for restore: "))) {
+         if (!get_cmd(ua, _("Please enter path prefix for restore (/ for none): "))) {
            break;
         }
-        /* ***FIXME*** allow drive:/ for Windows */
-         if (ua->cmd[0] != 0 && ua->cmd[0] != '/') {
-            bsendmsg(ua, _("Prefix must be null or begin with a /\n"));
-        } else {
-           if (jcr->RestoreWhere) {
-              free(jcr->RestoreWhere);
-           }
-           jcr->RestoreWhere = bstrdup(ua->cmd);
-        }  
+        if (jcr->RestoreWhere) {
+           free(jcr->RestoreWhere);
+           jcr->RestoreWhere = NULL;
+        }
+         if (ua->cmd[0] == '/' && ua->cmd[1] == 0) {
+           ua->cmd[0] = 0;
+        }
+        jcr->RestoreWhere = bstrdup(ua->cmd);
         goto try_again;
       case 7:
         /* JobId */
index 9ee8f9fd9e474d91510011fa6fe2c782c0fb1514..14f9c775012460068aaf84ae9393196c1cbb143a 100644 (file)
@@ -179,42 +179,48 @@ void do_restore(JCR *jcr)
         }
 
         decode_stat(ap, &statp);
+        /* 
+         *   ***FIXME***  add REAL Win32 code to backup.c
+         * Temp kludge so that low level routines (set_statp) know
+         *   we are dealing with a Win32 system.
+         */
+#ifdef HAVE_CYGWIN
+           statp.st_mode |= S_ISWIN32;
+#endif
         /*
          * Prepend the where directory so that the
          * files are put where the user wants.
          *
          * We do a little jig here to handle Win32 files with
-         * a drive letter.  
-         *   If where is null and we are running on a win32 client,
-         *      change nothing.
-         *   Otherwise, if the second character of the filename is a
-         *   colon (:), change it into a slash (/) -- this creates
-         *   a reasonable pathname on most systems.
+         *   a drive letter -- we simply strip the drive: from
+         *   every filename if a prefix is supplied.
+         *     
          */
-        if (jcr->where[0] == 0 && win32_client) {
+        if (jcr->where[0] == 0) {
            strcpy(ofile, fname);
            strcpy(lname, lp);
         } else {
-           strcpy(ofile, jcr->where);
-            if (fname[1] == ':') {
-               fname[1] = '/';
-              strcat(ofile, fname);
-               fname[1] = ':';
+           char *fn;
+           strcpy(ofile, jcr->where);  /* copy prefix */
+            if (win32_client && fname[1] == ':') {
+              fn = fname+2;          /* skip over drive: */
            } else {
-              strcat(ofile, fname);
+              fn = fname;            /* take whole name */
+           }
+           /* Ensure where is terminated with a slash */
+            if (jcr->where[wherelen-1] != '/' && fn[0] != '/') {
+               strcat(ofile, "/");
            }
+           strcat(ofile, fn);        /* copy rest of name */
            /* Fixup link name */
            if (type == FT_LNK || type == FT_LNKSAVED) {
                if (lp[0] == '/') {      /* if absolute path */
                  strcpy(lname, jcr->where);
               }       
-               /* ***FIXME**** we shouldn't have links on Windoz */
-               if (lp[1] == ':') {
-                  lp[1] = '/';
-                 strcat(lname, lp);
-                  lp[1] = ':';
+               if (win32_client && lp[1] == ':') {
+                 strcat(lname, lp+2); /* copy rest of name */
               } else {
-                 strcat(lname, lp);
+                 strcat(lname, lp);   /* On Unix systems we take everything */
               }
            }
         }
index 1841e0f69d542574fa98e7c919f51cd4fd49355f..d61521b16286c32a30b7b3eae6d947de8eee5896 100644 (file)
@@ -78,7 +78,11 @@ bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_w
     */
    bind_ip.s_addr = htonl(INADDR_ANY);
    if (bind_addr && bind_addr[0]) {
+#ifdef HAVE_INET_PTON
       if (inet_pton(AF_INET, bind_addr, &bind_ip) <= 0) {
+#else
+      if (inet_aton(bind_addr, &bind_ip) <= 0) {
+#endif
          Emsg1(M_WARNING, 0, _("Invalid bind address: %s, using INADDR_ANY\n"),
            bind_addr);
         bind_ip.s_addr = htonl(INADDR_ANY);
index 1f746a32d79992fc016a78f8d3ba8c1bcbbc52d3..aa0083a5c81afaa2ac08a393693b46e0d2a1134d 100755 (executable)
@@ -357,9 +357,9 @@ static char *edit_job_codes(JCR *jcr, char *omsg, char *imsg, char *to)
         add[1] = 0;
         str = add;
       }
-      Dmsg1(200, "add_str %s\n", str);
+      Dmsg1(1200, "add_str %s\n", str);
       pm_strcat(&omsg, str);
-      Dmsg1(200, "omsg=%s\n", omsg);
+      Dmsg1(1200, "omsg=%s\n", omsg);
    }
    return omsg;
 }
index f89214cdb99f9bbb1be11f2fe273a4de8a3e96de..959529e155acc5b50e2285280bbdaea8a362734b 100755 (executable)
@@ -171,6 +171,7 @@ TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, TREE_ROOT *root, TREE_N
       fname = path;
       if (!parent) {
         parent = (TREE_NODE *)root;
+        node->type = TN_DIR_NLS;
       }
       Dmsg1(100, "No / found: %s\n", path);
    }
@@ -203,6 +204,7 @@ TREE_NODE *make_tree_path(char *path, TREE_ROOT *root)
 {
    TREE_NODE *parent, *sibling, *node;
    char *fname, *p;
+   int type = TN_NEWDIR;
 
    Dmsg1(100, "make_tree_path: %s\n", path);
    if (*path == 0) {
@@ -218,6 +220,7 @@ TREE_NODE *make_tree_path(char *path, TREE_ROOT *root)
    } else {
       fname = path;
       parent = (TREE_NODE *)root;
+      type = TN_DIR_NLS;
    }
    /* Is it already a sibling? */
    for (sibling=parent->child; sibling; sibling=sibling->sibling) {
@@ -228,7 +231,7 @@ TREE_NODE *make_tree_path(char *path, TREE_ROOT *root)
       }
    }
    /* Must add */
-   node = new_tree_node(root, TN_NEWDIR);
+   node = new_tree_node(root, type);
    append_tree_node(fname, node, root, parent);
    Dmsg1(100, "make_tree_path: add parent=%s\n", node->fname);
    return node;
@@ -286,6 +289,7 @@ void print_tree(char *path, TREE_NODE *tree)
       return;
    }
    switch (tree->type) {
+   case TN_DIR_NLS:
    case TN_DIR:
    case TN_NEWDIR:  
       termchr = "/";
@@ -300,17 +304,15 @@ void print_tree(char *path, TREE_NODE *tree)
    switch (tree->type) {
    case TN_FILE:
       break;
+   case TN_NEWDIR:
    case TN_DIR:
+   case TN_DIR_NLS:
       sprintf(buf, "%s/%s", path, tree->fname);
       print_tree(buf, tree->child);
       break;
    case TN_ROOT:
       print_tree(path, tree->child);
       break;
-   case TN_NEWDIR:  
-      sprintf(buf, "%s/%s", path, tree->fname);
-      print_tree(buf, tree->child);
-      break;
    default:
       Pmsg1(000, "Unknown node type %d\n", tree->type);
    }
@@ -325,6 +327,14 @@ int tree_getpath(TREE_NODE *node, char *buf, int buf_size)
       return 1;
    }
    tree_getpath(node->parent, buf, buf_size);
+   /* 
+    * Fixup for Win32. If we have a Win32 directory and 
+    *   there is only a / in the buffer, remove it since
+    *    win32 names don't generally start with /
+    */
+   if (node->type == TN_DIR_NLS && buf[0] == '/' && buf[1] == 0) {
+      buf[0] = 0;   
+   }
    strcat(buf, node->fname);
    if (node->type != TN_FILE) {
       strcat(buf, "/");
index 7ad9668b456ec35c759fa4f612da55be71e9011b..8e9bfdaa0be5a2bca97b28ea8726738fcb86fede 100644 (file)
@@ -66,7 +66,8 @@ typedef struct s_tree_root TREE_ROOT;
 #define TN_ROOT    1                  /* root node */
 #define TN_NEWDIR  2                  /* created directory to fill path */
 #define TN_DIR     3                  /* directory entry */
-#define TN_FILE    4                  /* file entry */
+#define TN_DIR_NLS 4                  /* directory -- no leading slash -- win32 */
+#define TN_FILE    5                  /* file entry */
 
 TREE_ROOT *new_tree(int count);
 TREE_NODE *new_tree_node(TREE_ROOT *root, int type);
index ef79285da55eb12b131a174f00a564f8f12a4f0c..d68602ab23a40495eb2a93bc97c087e33a6c006b 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.26"
 #define VSTRING "1"
-#define DATE    "8 October 2002"
-#define LSMDATE "08Oct02"
+#define DATE    "10 October 2002"
+#define LSMDATE "10Oct02"
 
 /* Debug flags */
 #define DEBUG 1