#undef HAVE_STRERROR_R
#undef HAVE_GETHOSTBYNAME_R
+#undef HAVE_STRTOLL
#undef HAVE_INET_PTON
#undef HAVE_SOCKLEN_T
#undef HAVE_GETOPT_LONG
+#undef HAVE_STRTOLL
#undef HAVE_INET_PTON
#undef HAVE_SOCKLEN_T
strncmp \
strncpy \
vfprintf \
- strtoll \
,,
[echo 'configure: cannot find needed function.'; exit 1]
)
AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
+AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
AC_CHECK_FUNCS(chflags)
scripts/fd \
scripts/Makefile \
scripts/logrotate \
- scripts/bacula.desktop \
scripts/bacula.desktop.gnome1 \
scripts/bacula.desktop.gnome2 \
doc/Makefile \
strncmp \
strncpy \
vfprintf \
- strtoll \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7596: checking for $ac_func" >&5
+echo "configure:7595: 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 7601 "configure"
+#line 7600 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:7624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7623: \"$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
for ac_func in fchdir
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7654: checking for $ac_func" >&5
+echo "configure:7653: 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 7659 "configure"
+#line 7658 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:7682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7681: \"$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
fi
done
+for ac_func in strtoll
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:7711: 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 7716 "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:7739: \"$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_STRTOLL 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
for ac_func in chflags
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7713: checking for $ac_func" >&5
+echo "configure:7770: 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 7718 "configure"
+#line 7775 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:7741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7798: \"$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
for ac_func in snprintf vsnprintf gethostid getdomainname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7769: checking for $ac_func" >&5
+echo "configure:7826: 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 7774 "configure"
+#line 7831 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:7797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7854: \"$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
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:7825: checking for $ac_func" >&5
+echo "configure:7882: 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 7830 "configure"
+#line 7887 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:7853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7910: \"$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
# 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:7880: checking for gethostbyname_r" >&5
+echo "configure:7937: 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 7885 "configure"
+#line 7942 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname_r(); below. */
; return 0; }
EOF
-if { (eval echo configure:7908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7965: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6
-echo "configure:7926: checking for gethostbyname_r in -lnsl" >&5
+echo "configure:7983: 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
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7934 "configure"
+#line 7991 "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
gethostbyname_r()
; return 0; }
EOF
-if { (eval echo configure:7945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8002: \"$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
fi
echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6
-echo "configure:7973: checking for gethostbyname_r in -lresolv" >&5
+echo "configure:8030: 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
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7981 "configure"
+#line 8038 "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
gethostbyname_r()
; return 0; }
EOF
-if { (eval echo configure:7992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8049: \"$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
# Find where sockets are (especially for Solaris)
echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:8025: checking for socket" >&5
+echo "configure:8082: 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 8030 "configure"
+#line 8087 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket(); below. */
; return 0; }
EOF
-if { (eval echo configure:8053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8110: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6
-echo "configure:8071: checking for socket in -lxnet" >&5
+echo "configure:8128: 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
ac_save_LIBS="$LIBS"
LIBS="-lxnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8079 "configure"
+#line 8136 "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
socket()
; return 0; }
EOF
-if { (eval echo configure:8090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8147: \"$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
fi
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:8118: checking for socket in -lsocket" >&5
+echo "configure:8175: 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
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8126 "configure"
+#line 8183 "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
socket()
; return 0; }
EOF
-if { (eval echo configure:8137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8194: \"$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
fi
echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:8165: checking for socket in -linet" >&5
+echo "configure:8222: 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
ac_save_LIBS="$LIBS"
LIBS="-linet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8173 "configure"
+#line 8230 "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
socket()
; return 0; }
EOF
-if { (eval echo configure:8184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8241: \"$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
for ac_func in inet_pton
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8217: checking for $ac_func" >&5
+echo "configure:8274: 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 8222 "configure"
+#line 8279 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:8245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8302: \"$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 $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:8274: checking for strftime" >&5
+echo "configure:8331: 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 8279 "configure"
+#line 8336 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strftime(); below. */
; return 0; }
EOF
-if { (eval echo configure:8302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8359: \"$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
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:8324: checking for strftime in -lintl" >&5
+echo "configure:8381: 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
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8332 "configure"
+#line 8389 "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
strftime()
; return 0; }
EOF
-if { (eval echo configure:8343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8400: \"$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
fi
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:8370: checking for vprintf" >&5
+echo "configure:8427: 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 8375 "configure"
+#line 8432 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
; return 0; }
EOF
-if { (eval echo configure:8398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8455: \"$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
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:8422: checking for _doprnt" >&5
+echo "configure:8479: 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 8427 "configure"
+#line 8484 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
; return 0; }
EOF
-if { (eval echo configure:8450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8507: \"$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
# 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:8477: checking for working alloca.h" >&5
+echo "configure:8534: 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 8482 "configure"
+#line 8539 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8546: \"$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
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8510: checking for alloca" >&5
+echo "configure:8567: 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 8515 "configure"
+#line 8572 "configure"
#include "confdefs.h"
#ifdef __GNUC__
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8600: \"$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
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8575: checking whether alloca needs Cray hooks" >&5
+echo "configure:8632: 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 8580 "configure"
+#line 8637 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
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:8605: checking for $ac_func" >&5
+echo "configure:8662: 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 8610 "configure"
+#line 8667 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:8633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8690: \"$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
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8660: checking stack direction for C alloca" >&5
+echo "configure:8717: 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
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8668 "configure"
+#line 8725 "configure"
#include "confdefs.h"
find_stack_direction ()
{
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8744: \"$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
# 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:8710: checking for getmntent in -lsun" >&5
+echo "configure:8767: 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
ac_save_LIBS="$LIBS"
LIBS="-lsun $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8718 "configure"
+#line 8775 "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
getmntent()
; return 0; }
EOF
-if { (eval echo configure:8729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8786: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6
-echo "configure:8748: checking for getmntent in -lseq" >&5
+echo "configure:8805: 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
ac_save_LIBS="$LIBS"
LIBS="-lseq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8756 "configure"
+#line 8813 "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
getmntent()
; return 0; }
EOF
-if { (eval echo configure:8767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8824: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6
-echo "configure:8786: checking for getmntent in -lgen" >&5
+echo "configure:8843: 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
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8794 "configure"
+#line 8851 "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
getmntent()
; return 0; }
EOF
-if { (eval echo configure:8805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8862: \"$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
fi
echo $ac_n "checking for getmntent""... $ac_c" 1>&6
-echo "configure:8830: checking for getmntent" >&5
+echo "configure:8887: 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 8835 "configure"
+#line 8892 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getmntent(); below. */
; return 0; }
EOF
-if { (eval echo configure:8858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8915: \"$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
fi
echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
-echo "configure:8881: checking whether closedir returns void" >&5
+echo "configure:8938: 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
ac_cv_func_closedir_void=yes
else
cat > conftest.$ac_ext <<EOF
-#line 8889 "configure"
+#line 8946 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
-if { (eval echo configure:8895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8952: \"$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
fi
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8918: checking whether setpgrp takes no argument" >&5
+echo "configure:8975: 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
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 8926 "configure"
+#line 8983 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
}
EOF
-if { (eval echo configure:8946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9003: \"$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
fi
echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8969: checking for working fnmatch" >&5
+echo "configure:9026: 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
ac_cv_func_fnmatch_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 8980 "configure"
+#line 9037 "configure"
#include "confdefs.h"
main() { exit (fnmatch ("a*", "abc", 0) != 0); }
EOF
-if { (eval echo configure:8984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9041: \"$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
echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:9009: checking for setlocale in -lxpg4" >&5
+echo "configure:9066: 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
ac_save_LIBS="$LIBS"
LIBS="-lxpg4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9017 "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
setlocale()
; return 0; }
EOF
-if { (eval echo configure:9028: \"$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
echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6
-echo "configure:9051: checking for getpwnam in -lsun" >&5
+echo "configure:9108: 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
ac_save_LIBS="$LIBS"
LIBS="-lsun $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9059 "configure"
+#line 9116 "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
getpwnam()
; return 0; }
EOF
-if { (eval echo configure:9070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9127: \"$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
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9102: checking for $ac_hdr" >&5
+echo "configure:9159: 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 9107 "configure"
+#line 9164 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9169: \"$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*
done
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:9139: checking for deflate in -lz" >&5
+echo "configure:9196: 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
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9147 "configure"
+#line 9204 "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
deflate()
; return 0; }
EOF
-if { (eval echo configure:9158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9215: \"$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
PTHREAD_LIB=""
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:9189: checking for pthread_create in -lpthread" >&5
+echo "configure:9246: 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
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9197 "configure"
+#line 9254 "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
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:9208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9265: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:9227: checking for pthread_create in -lpthreads" >&5
+echo "configure:9284: 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
ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9235 "configure"
+#line 9292 "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
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:9246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9303: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:9265: checking for pthread_create in -lc_r" >&5
+echo "configure:9322: 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
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9273 "configure"
+#line 9330 "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
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:9284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9341: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:9303: checking for pthread_create" >&5
+echo "configure:9360: 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 9308 "configure"
+#line 9365 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_create(); below. */
; return 0; }
EOF
-if { (eval echo configure:9331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9388: \"$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
scripts/fd \
scripts/Makefile \
scripts/logrotate \
- scripts/bacula.desktop \
scripts/bacula.desktop.gnome1 \
scripts/bacula.desktop.gnome2 \
doc/Makefile \
scripts/fd \
scripts/Makefile \
scripts/logrotate \
- scripts/bacula.desktop \
scripts/bacula.desktop.gnome1 \
scripts/bacula.desktop.gnome2 \
doc/Makefile \
- Implement MTIOCERRSTAT on FreeBSD to clear tape error conditions.
-- BSD (probably) does not have strtoll()
-- BSD does not have ioctl() MTEOM
-- BSD defines a number of MT_xxx variables which conflict
- with those defined by Bacula.
+- BSDI
+ cut: illegal option -- b
+ usage: cut -c list [file1 ...]
+ cut -f list [-s] [-d delim] [file ...]
+ cut: illegal option -- b
+ usage: cut -c list [file1 ...]
+ cut -f list [-s] [-d delim] [file ...]
+
- Add Progress command that periodically reports the progress of
- The following Re-read last block at EOT failed. ERR=block.c:523 Read zero bytes on device /dev/nrsa0.
undef-sd: block.c:523 Read zero bytes on device /dev/nrsa0.
apparently masks the standard EOM message.
+- BSD (probably) does not have strtoll()
+- BSD does not have ioctl() MTEOM
+- BSD defines a number of MT_xxx variables which conflict
+ with those defined by Bacula.
+
return 1;
}
- binit(&ff_pkt->bfd, jcr->use_win_backup_api);
+ binit(&ff_pkt->bfd);
/* Open any file with data that we intend to save */
if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) &&
jcr = new_jcr(sizeof(JCR), filed_free_jcr); /* create JCR */
jcr->dir_bsock = dir;
jcr->ff = init_find_files();
- jcr->use_win_backup_api = 0;
jcr->start_time = time(NULL);
jcr->last_fname = get_pool_memory(PM_FNAME);
jcr->last_fname[0] = 0;
}
jcr->sd_auth_key = bstrdup(sd_auth_key);
free_pool_memory(sd_auth_key);
- if (jcr->use_win_backup_api) {
- get_backup_privileges(jcr, 1 /* ignore_errors */);
- }
+ get_backup_privileges(jcr, 1 /* ignore_errors */);
Dmsg2(120, "JobId=%d Auth=%s\n", jcr->JobId, jcr->sd_auth_key);
return bnet_fsend(dir, OKjob);
}
wherelen = strlen(jcr->where);
- binit(&bfd, jcr->use_win_backup_api);
+ binit(&bfd);
sd = jcr->store_bsock;
set_jcr_job_status(jcr, JS_Running);
Dmsg1(30, "Outfile=%s\n", ofile);
extract = FALSE;
stat = create_file(jcr, fname, ofile, lname, type,
- stream, &statp, attribsEx, &bfd, jcr->replace,
- jcr->use_win_backup_api);
+ stream, &statp, attribsEx, &bfd,
+ jcr->replace);
switch (stat) {
case CF_ERROR:
case CF_SKIP:
return 1;
}
- binit(&bfd, jcr->use_win_backup_api);
+ binit(&bfd);
if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) &&
ff_pkt->statp.st_size > 0) ||
Copyright (2000) Kern E. Sibbald
*/
+#define HAVE_CYGWIN 1
+
#include <unistd.h>
#include <lmcons.h>
#include <ctype.h>
#include "winservice.h"
#include <signal.h>
#include <pthread.h>
+#include "../../findlib/winapi.h"
extern int BaculaMain(int argc, char **argv);
extern int terminate_filed(int sig);
extern DWORD g_error;
extern BOOL ReportStatus(DWORD state, DWORD exitcode, DWORD waithint);
-
+/* Globals */
HINSTANCE hAppInstance;
const char *szAppName = "Bacula";
DWORD mainthreadId;
// DWORD dwThreadID;
pthread_t tid;
+ HINSTANCE hLib = LoadLibrary("KERNEL32.DLL");
+ if (hLib) {
+ p_GetFileAttributesEx = (t_GetFileAttributesEx)
+ GetProcAddress(hLib, "GetFileFileAttributesExA");
+ p_SetProcessShutdownParameters = (t_SetProcessShutdownParameters)
+ GetProcAddress(hLib, "SetProcessShutdownParameters");
+ p_BackupRead = (t_BackupRead)
+ GetProcAddress(hLib, "BackupRead");
+ p_BackupWrite = (t_BackupWrite)
+ GetProcAddress(hLib, "BackupWrite");
+ FreeLibrary(hLib);
+ }
+ hLib = LoadLibrary("ADVAPI32.DLL");
+ if (hLib) {
+ p_OpenProcessToken = (t_OpenProcessToken)
+ GetProcAddress(hLib, "OpenProcessToken");
+ p_AdjustTokenPrivileges = (t_AdjustTokenPrivileges)
+ GetProcAddress(hLib, "AdjustTokenPrivileges");
+ p_LookupPrivilegeValue = (t_LookupPrivilegeValue)
+ GetProcAddress(hLib, "LookupPrivilegeValueA");
+ FreeLibrary(hLib);
+ }
+
+
// Set this process to be the last application to be shut down.
SetProcessShutdownParameters(0x100, 0);
#include "winbacula.h"
#include "winservice.h"
#include "wintray.h"
+
void set_service_description(SC_HANDLE hSCManager, SC_HANDLE hService,
LPSTR lpDesc);
-
// OS-SPECIFIC ROUTINES
// Create an instance of the bacService class to cause the static fields to be
// initialised properly
-extern int NoGetFileAttributesEx; /* set if function no avail -- Win95 */
-
bacService init;
DWORD g_platform_id;
} else {
g_platform_id = osversioninfo.dwPlatformId;
}
+#ifdef xxx
+ /* Rewritten to lookup entry point */
if (osversioninfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
osversioninfo.dwMinorVersion == 0) {
/* Running Win95 so no GetFileAttributesEx available */
NoGetFileAttributesEx = 1;
}
+#endif
}
BOOL
bacService::ShowProperties()
{
-#ifdef properties_implemented
- // Post to the Bacula menu window
- if (!PostToBacula(MENU_PROPERTIES_SHOW, 0, 0)) {
- MessageBox(NULL, "No existing instance of Bacula could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
- return FALSE;
- }
-#endif
return TRUE;
}
BOOL
bacService::ShowDefaultProperties()
{
-#ifdef properties_implemented
- // Post to the Bacula menu window
- if (!PostToBacula(MENU_DEFAULT_PROPERTIES_SHOW, 0, 0)) {
- MessageBox(NULL, "No existing instance of Bacula could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
- return FALSE;
- }
-
-#endif
return TRUE;
}
// ROUTINE TO PROCESS AN INCOMING INSTANCE OF THE ABOVE MESSAGE
BOOL
bacService::ProcessUserHelperMessage(WPARAM wParam, LPARAM lParam) {
- // - Check the platform type
- if (!IsWinNT() || !bacService::RunningAsService()) {
- return TRUE;
- }
-
- // - Close the HKEY_CURRENT_USER key, to force NT to reload it for the new user
- // NB: Note that this is _really_ dodgy if ANY other thread is accessing the key!
- if (RegCloseKey(HKEY_CURRENT_USER) != ERROR_SUCCESS) {
- return FALSE;
- }
-
- // - Revert to our own identity
- RevertToSelf();
- g_impersonating_user = FALSE;
-
- // - Open the specified process
- HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, (DWORD)lParam);
- if (processHandle == NULL) {
- return FALSE;
- }
-
- // - Get the token for the given process
- HANDLE userToken = NULL;
- if (!OpenProcessToken(processHandle, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE, &userToken)) {
- CloseHandle(processHandle);
- return FALSE;
- }
- CloseHandle(processHandle);
-
- // - Set this thread to impersonate them
- if (!ImpersonateLoggedOnUser(userToken)) {
- CloseHandle(userToken);
- return FALSE;
- }
- CloseHandle(userToken);
-
- g_impersonating_user = TRUE;
return TRUE;
}
// How to run as a service depends upon the OS being used
switch (g_platform_id) {
- // Windows 95/98
+ // Windows 95/98/Me
case VER_PLATFORM_WIN32_WINDOWS:
{
// Obtain a handle to the kernel library
}
- // Windows NT
+ // Windows NT, Win2K, WinXP
case VER_PLATFORM_WIN32_NT:
{
// Create a service entry table
SERVICE_TABLE_ENTRY dispatchTable[] = {
- {BAC_SERVICENAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain},
- {NULL, NULL}
+ {BAC_SERVICENAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain},
+ {NULL, NULL}
};
// Call the service control dispatcher with our entry table
// report the status to the service control manager.
//
if (!ReportStatus(
- SERVICE_RUNNING, // service state
- NO_ERROR, // exit code
- 0)) { // wait hint
+ SERVICE_RUNNING, // service state
+ NO_ERROR, // exit code
+ 0)) { // wait hint
MessageBox(NULL, "Report Service failure", "Bacula Service", MB_OK);
- log_error_message("ReportStatus RUNNING failed");
+ log_error_message("ReportStatus RUNNING failed");
return 0;
}
// How to add the Bacula service depends upon the OS
switch (g_platform_id) {
- // Windows 95/98
+ // Windows 95/98/Me
case VER_PLATFORM_WIN32_WINDOWS:
// Locate the RunService registry entry
HKEY runservices;
MB_ICONINFORMATION | MB_OK);
break;
- // Windows NT
+ // Windows NT, Win2K, WinXP
case VER_PLATFORM_WIN32_NT:
SC_HANDLE hservice;
SC_HANDLE hsrvmanager;
}
set_service_description(hsrvmanager,hservice,
-"Provides file backup and restore services. Bacula -- the Network Backup Solution.");
+"Provides file backup and restore services. Bacula -- the network backup solution.");
CloseServiceHandle(hsrvmanager);
CloseServiceHandle(hservice);
// How to remove the Bacula service depends upon the OS
switch (g_platform_id) {
- // Windows 95/98
+ // Windows 95/98/Me
case VER_PLATFORM_WIN32_WINDOWS:
// Locate the RunService registry entry
HKEY runservices;
MessageBox(NULL, "The Bacula service has been removed", szAppName, MB_ICONINFORMATION | MB_OK);
break;
- // Windows NT
+ // Windows NT, Win2K, WinXP
case VER_PLATFORM_WIN32_NT:
SC_HANDLE hservice;
SC_HANDLE hsrvmanager;
// Try to stop the Bacula service
if (ControlService(hservice, SERVICE_CONTROL_STOP, &status)) {
while(QueryServiceStatus(hservice, &status)) {
- if (status.dwCurrentState == SERVICE_STOP_PENDING) {
- Sleep(1000);
- } else {
- break;
- }
+ if (status.dwCurrentState == SERVICE_STOP_PENDING) {
+ Sleep(1000);
+ } else {
+ break;
+ }
}
if (status.dwCurrentState != SERVICE_STOPPED) {
break;
default:
- // Control code not recognised
- break;
-
+ // Control code not recognised
+ break;
}
// Tell the control manager what we're up to.
// Get the error code
g_error = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- g_error,
- 0,
- (LPTSTR)&msg,
- 0,
- NULL);
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ g_error,
+ 0,
+ (LPTSTR)&msg,
+ 0,
+ NULL);
// Use event logging to log the error
heventsrc = RegisterEventSource(NULL, BAC_SERVICENAME);
sprintf(msgbuff, "\n\n%s error: %ld at %s:%d",
- BAC_SERVICENAME, g_error, fname, lineno);
+ BAC_SERVICENAME, g_error, fname, lineno);
strings[0] = msgbuff;
strings[1] = message;
strings[2] = msg;
}
LocalFree(msg);
}
+typedef BOOL (*WinAPI)(SC_HANDLE, DWORD, LPVOID);
-/* ================== Not yet implemented ===================== */
void set_service_description(SC_HANDLE hSCManager, SC_HANDLE hService,
LPSTR lpDesc)
{
LPQUERY_SERVICE_LOCK_STATUS lpqslsBuf;
SERVICE_DESCRIPTION sdBuf;
DWORD dwBytesNeeded;
+ WinAPI ChangeServiceDescription;
+ HINSTANCE hLib = LoadLibrary("ADVAPI32.DLL");
+ if (!hLib) {
+ return;
+ }
+ ChangeServiceDescription = (WinAPI)GetProcAddress(hLib,
+ "ChangeServiceConfig2A");
+ FreeLibrary(hLib);
+ if (!ChangeServiceDescription) {
+ return;
+ }
+
// Need to acquire database lock before reconfiguring.
-
sclLock = LockServiceDatabase(hSCManager);
// If the database cannot be locked, report the details.
-
if (sclLock == NULL) {
- // Exit if the database is not locked by another process.
+ // Exit if the database is not locked by another process.
+ if (GetLastError() != ERROR_SERVICE_DATABASE_LOCKED) {
+ log_error_message("LockServiceDatabase");
+ return;
+ }
- if (GetLastError() != ERROR_SERVICE_DATABASE_LOCKED) {
- log_error_message("LockServiceDatabase");
- return;
- }
-
- // Allocate a buffer to get details about the lock.
- lpqslsBuf = (LPQUERY_SERVICE_LOCK_STATUS)LocalAlloc(
+ // Allocate a buffer to get details about the lock.
+ lpqslsBuf = (LPQUERY_SERVICE_LOCK_STATUS)LocalAlloc(
LPTR, sizeof(QUERY_SERVICE_LOCK_STATUS)+256);
- if (lpqslsBuf == NULL) {
- log_error_message("LocalAlloc");
- return;
- }
-
- // Get and print the lock status information.
+ if (lpqslsBuf == NULL) {
+ log_error_message("LocalAlloc");
+ return;
+ }
- if (!QueryServiceLockStatus(
- hSCManager,
- lpqslsBuf,
- sizeof(QUERY_SERVICE_LOCK_STATUS)+256,
- &dwBytesNeeded)) {
- log_error_message("QueryServiceLockStatus");
- }
+ // Get and print the lock status information.
+ if (!QueryServiceLockStatus(
+ hSCManager,
+ lpqslsBuf,
+ sizeof(QUERY_SERVICE_LOCK_STATUS)+256,
+ &dwBytesNeeded)) {
+ log_error_message("QueryServiceLockStatus");
+ }
- if (lpqslsBuf->fIsLocked) {
- printf("Locked by: %s, duration: %ld seconds\n",
+ if (lpqslsBuf->fIsLocked) {
+ printf("Locked by: %s, duration: %ld seconds\n",
lpqslsBuf->lpLockOwner,
lpqslsBuf->dwLockDuration);
- } else {
- printf("No longer locked\n");
- }
+ } else {
+ printf("No longer locked\n");
+ }
- LocalFree(lpqslsBuf);
- log_error_message("Could not lock database");
- return;
+ LocalFree(lpqslsBuf);
+ log_error_message("Could not lock database");
+ return;
}
// The database is locked, so it is safe to make changes.
sdBuf.lpDescription = lpDesc;
- if(!ChangeServiceConfig2(
- hService, // handle to service
- SERVICE_CONFIG_DESCRIPTION, // change: description
- &sdBuf) ) { // value: new description
+ if(!ChangeServiceDescription(
+ hService, // handle to service
+ SERVICE_CONFIG_DESCRIPTION, // change: description
+ &sdBuf) ) { // value: new description
log_error_message("ChangeServiceConfig2");
} else {
- printf("ChangeServiceConfig2 SUCCESS\n");
+ printf("ChangeServiceConfig2 SUCCESS\n");
}
// Release the database lock.
#
LIBSRCS = find.c match.c find_one.c attibs.c create_file.c \
- bfile.c get_priv.c makepath.c save-cwd.c
+ bfile.c get_priv.c makepath.c save-cwd.c winapi.c
LIBOBJS = find.o match.o find_one.o attribs.o create_file.o \
- bfile.o get_priv.o makepath.o save-cwd.o
+ bfile.o get_priv.o makepath.o save-cwd.o winapi.o
.SUFFIXES: .c .o
.PHONY:
#ifdef HAVE_CYGWIN
-int NoGetFileAttributesEx = 0;
-
int encode_attribsEx(void *jcr, char *attribsEx, FF_PKT *ff_pkt)
{
char *p = attribsEx;
attribsEx[0] = 0; /* no extended attributes */
- if (NoGetFileAttributesEx) {
+ if (!p_GetFileAttributesEx) {
return STREAM_UNIX_ATTRIBUTES;
}
unix_name_to_win32(&ff_pkt->sys_fname, ff_pkt->fname);
- if (!GetFileAttributesEx(ff_pkt->sys_fname, GetFileExInfoStandard,
+ if (!p_GetFileAttributesEx(ff_pkt->sys_fname, GetFileExInfoStandard,
(LPVOID)&atts)) {
win_error(jcr, "GetFileAttributesEx:", ff_pkt->sys_fname);
return STREAM_WIN32_ATTRIBUTES;
extern "C" HANDLE get_osfhandle(int fd);
-void binit(BFILE *bfd, int use_win_api)
+void binit(BFILE *bfd)
{
bfd->fid = -1;
bfd->mode = BF_CLOSED;
- bfd->use_win_api = use_win_api;
+ bfd->use_win_api = p_BackupRead && p_BackupWrite;
bfd->errmsg = NULL;
bfd->lpContext = NULL;
bfd->lerror = 0;
}
if (bfd->mode == BF_READ) {
BYTE buf[10];
- if (!bfd->lpContext && !BackupRead(bfd->fh,
+ if (!bfd->lpContext && !p_BackupRead(bfd->fh,
buf, /* buffer */
(DWORD)0, /* bytes to read */
&bfd->rw_bytes, /* bytes read */
}
} else {
BYTE buf[10];
- if (!bfd->lpContext && !BackupWrite(bfd->fh,
+ if (!bfd->lpContext && !p_BackupWrite(bfd->fh,
buf, /* buffer */
(DWORD)0, /* bytes to read */
&bfd->rw_bytes, /* bytes written */
}
bfd->rw_bytes = 0;
- if (!BackupRead(bfd->fh,
+ if (!p_BackupRead(bfd->fh,
(BYTE *)buf,
count,
&bfd->rw_bytes,
}
bfd->rw_bytes = 0;
- if (!BackupWrite(bfd->fh,
+ if (!p_BackupWrite(bfd->fh,
(BYTE *)buf,
count,
&bfd->rw_bytes,
*
* ===============================================================
*/
-void binit(BFILE *bfd, int use_win_api)
+void binit(BFILE *bfd)
{
bfd->fid = -1;
}
*/
int create_file(void *jcr, char *fname, char *ofile, char *lname,
int type, int stream, struct stat *statp,
- char *attribsEx, BFILE *ofd, int replace, int win_io)
+ char *attribsEx, BFILE *ofd, int replace)
{
int new_mode, parent_mode, mode;
uid_t uid;
gid_t gid;
int pnl;
- binit(ofd, win_io);
+ binit(ofd);
new_mode = statp->st_mode;
Dmsg2(300, "newmode=%x file=%s\n", new_mode, ofile);
parent_mode = S_IWUSR | S_IXUSR | new_mode;
/*
* Status codes returned by create_file()
*/
-#define CF_SKIP 1 /* skip file (not newer or something) */
-#define CF_ERROR 2 /* error creating file */
-#define CF_EXTRACT 3 /* file created, data to extract */
-#define CF_CREATED 4 /* file created, no data to extract */
+#define CF_SKIP 1 /* skip file (not newer or something) */
+#define CF_ERROR 2 /* error creating file */
+#define CF_EXTRACT 3 /* file created, data to extract */
+#define CF_CREATED 4 /* file created, no data to extract */
/*
* NOTE!!! These go on the tape, so don't change them. If
* need be, add to them.
*/
-#define FT_LNKSAVED 1 /* hard link to file already saved */
-#define FT_REGE 2 /* Regular file but empty */
-#define FT_REG 3 /* Regular file */
-#define FT_LNK 4 /* Soft Link */
-#define FT_DIR 5 /* Directory */
-#define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */
-#define FT_NOACCESS 7 /* Not able to access */
-#define FT_NOFOLLOW 8 /* Could not follow link */
-#define FT_NOSTAT 9 /* Could not stat file */
-#define FT_NOCHG 10 /* Incremental option, file not changed */
-#define FT_DIRNOCHG 11 /* Incremental option, directory not changed */
-#define FT_ISARCH 12 /* Trying to save archive file */
-#define FT_NORECURSE 13 /* No recursion into directory */
-#define FT_NOFSCHG 14 /* Different file system, prohibited */
-#define FT_NOOPEN 15 /* Could not open directory */
-#define FT_RAW 16 /* Raw block device */
-#define FT_FIFO 17 /* Raw fifo device */
+#define FT_LNKSAVED 1 /* hard link to file already saved */
+#define FT_REGE 2 /* Regular file but empty */
+#define FT_REG 3 /* Regular file */
+#define FT_LNK 4 /* Soft Link */
+#define FT_DIR 5 /* Directory */
+#define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */
+#define FT_NOACCESS 7 /* Not able to access */
+#define FT_NOFOLLOW 8 /* Could not follow link */
+#define FT_NOSTAT 9 /* Could not stat file */
+#define FT_NOCHG 10 /* Incremental option, file not changed */
+#define FT_DIRNOCHG 11 /* Incremental option, directory not changed */
+#define FT_ISARCH 12 /* Trying to save archive file */
+#define FT_NORECURSE 13 /* No recursion into directory */
+#define FT_NOFSCHG 14 /* Different file system, prohibited */
+#define FT_NOOPEN 15 /* Could not open directory */
+#define FT_RAW 16 /* Raw block device */
+#define FT_FIFO 17 /* Raw fifo device */
/* Options saved in "flag" of ff packet */
-#define FO_MD5 0x001 /* Do MD5 checksum */
-#define FO_GZIP 0x002 /* Do Zlib compression */
-#define FO_NO_RECURSION 0x004 /* no recursion in directories */
-#define FO_MULTIFS 0x008 /* multiple file systems */
-#define FO_SPARSE 0x010 /* do sparse file checking */
-#define FO_IF_NEWER 0x020 /* replace if newer */
-#define FO_NOREPLACE 0x040 /* never replace */
-#define FO_READFIFO 0x080 /* read data from fifo */
-#define FO_SHA1 0x100 /* Do SHA1 checksum */
+#define FO_MD5 0x001 /* Do MD5 checksum */
+#define FO_GZIP 0x002 /* Do Zlib compression */
+#define FO_NO_RECURSION 0x004 /* no recursion in directories */
+#define FO_MULTIFS 0x008 /* multiple file systems */
+#define FO_SPARSE 0x010 /* do sparse file checking */
+#define FO_IF_NEWER 0x020 /* replace if newer */
+#define FO_NOREPLACE 0x040 /* never replace */
+#define FO_READFIFO 0x080 /* read data from fifo */
+#define FO_SHA1 0x100 /* Do SHA1 checksum */
/*
* Options saved in "options" of include list
#define OPT_compute_MD5 0x01 /* compute MD5 of file's data */
#define OPT_GZIP_compression 0x02 /* use GZIP compression */
#define OPT_no_recursion 0x04 /* no recursion in directories */
-#define OPT_multifs 0x08 /* multiple file systems */
-#define OPT_sparse 0x10 /* do sparse file checking */
+#define OPT_multifs 0x08 /* multiple file systems */
+#define OPT_sparse 0x10 /* do sparse file checking */
#define OPT_replace_if_newer 0x20 /* replace file if newer */
#define OPT_never_replace 0x40 /* never replace */
-#define OPT_read_fifo 0x80 /* read data from fifo (named pipe) */
+#define OPT_read_fifo 0x80 /* read data from fifo (named pipe) */
#define OPT_compute_SHA1 0x100 /* compute SHA1 of file's data */
struct s_included_file {
struct s_included_file *next;
- int options; /* backup options */
- int level; /* compression level */
- int len; /* length of fname */
- int pattern; /* set if pattern */
- char VerifyOpts[20]; /* Options for verify */
+ int options; /* backup options */
+ int level; /* compression level */
+ int len; /* length of fname */
+ int pattern; /* set if pattern */
+ char VerifyOpts[20]; /* Options for verify */
char fname[1];
};
#ifdef HAVE_CYGWIN
#include <windows.h>
+#include "winapi.h"
#define BF_CLOSED 0
-#define BF_READ 1 /* BackupRead */
-#define BF_WRITE 2 /* BackupWrite */
+#define BF_READ 1 /* BackupRead */
+#define BF_WRITE 2 /* BackupWrite */
/* Basic low level I/O file packet */
typedef struct s_bfile {
- int use_win_api; /* set if using WinAPI */
- int mode; /* set if file is open */
- HANDLE fh; /* Win32 file handle */
- int fid; /* fd if doing Unix style */
- LPVOID lpContext; /* BackupRead/Write context */
- POOLMEM *errmsg; /* error message buffer */
- DWORD rw_bytes; /* Bytes read or written */
- DWORD lerror; /* Last error code */
+ int use_win_api; /* set if using WinAPI */
+ int mode; /* set if file is open */
+ HANDLE fh; /* Win32 file handle */
+ int fid; /* fd if doing Unix style */
+ LPVOID lpContext; /* BackupRead/Write context */
+ POOLMEM *errmsg; /* error message buffer */
+ DWORD rw_bytes; /* Bytes read or written */
+ DWORD lerror; /* Last error code */
} BFILE;
#else
/* Basic low level I/O file packet */
typedef struct s_bfile {
- int fid; /* file id on Unix */
+ int fid; /* file id on Unix */
} BFILE;
#endif
* first argument to the find_files callback subroutine.
*/
typedef struct s_ff {
- char *fname; /* filename */
- char *link; /* link if file linked */
- POOLMEM *sys_fname; /* system filename */
- struct stat statp; /* stat packet */
- uint32_t FileIndex; /* FileIndex of this file */
- uint32_t LinkFI; /* FileIndex of main hard linked file */
- struct f_link *linked; /* Set if we are hard linked */
- int type; /* FT_ type from above */
- int flags; /* control flags */
- int ff_errno; /* errno */
- int incremental; /* do incremental save */
- BFILE bfd; /* Bacula file descriptor */
- time_t save_time; /* start of incremental time */
- int mtime_only; /* incremental on mtime_only */
- int dereference; /* follow links */
- int GZIP_level; /* compression level */
- int atime_preserve; /* preserve access times */
- int null_output_device; /* using null output device */
+ char *fname; /* filename */
+ char *link; /* link if file linked */
+ POOLMEM *sys_fname; /* system filename */
+ struct stat statp; /* stat packet */
+ uint32_t FileIndex; /* FileIndex of this file */
+ uint32_t LinkFI; /* FileIndex of main hard linked file */
+ struct f_link *linked; /* Set if we are hard linked */
+ int type; /* FT_ type from above */
+ int flags; /* control flags */
+ int ff_errno; /* errno */
+ int incremental; /* do incremental save */
+ BFILE bfd; /* Bacula file descriptor */
+ time_t save_time; /* start of incremental time */
+ int mtime_only; /* incremental on mtime_only */
+ int dereference; /* follow links */
+ int GZIP_level; /* compression level */
+ int atime_preserve; /* preserve access times */
+ int null_output_device; /* using null output device */
char VerifyOpts[20];
struct s_included_file *included_files_list;
struct s_excluded_file *excluded_files_list;
struct s_excluded_file *excluded_paths_list;
- struct f_link *linklist; /* hard linked files */
+ struct f_link *linklist; /* hard linked files */
} FF_PKT;
*/
/* from attribs.c */
-void encode_stat (char *buf, struct stat *statp, uint32_t LinkFI);
-void decode_stat (char *buf, struct stat *statp, uint32_t *LinkFI);
-int encode_attribsEx (void *jcr, char *attribsEx, FF_PKT *ff_pkt);
+void encode_stat (char *buf, struct stat *statp, uint32_t LinkFI);
+void decode_stat (char *buf, struct stat *statp, uint32_t *LinkFI);
+int encode_attribsEx (void *jcr, char *attribsEx, FF_PKT *ff_pkt);
int set_attributes(void *jcr, char *fname, char *ofile, char *lname,
- int type, int stream, struct stat *statp,
- char *attribsEx, BFILE *ofd);
+ int type, int stream, struct stat *statp,
+ char *attribsEx, BFILE *ofd);
/* from create_file.c */
int create_file(void *jcr, char *fname, char *ofile, char *lname,
- int type, int stream, struct stat *statp,
- char *attribsEx, BFILE *ofd, int replace, int win_io);
+ int type, int stream, struct stat *statp,
+ char *attribsEx, BFILE *ofd, int replace);
/* From find.c */
FF_PKT *init_find_files();
int file_is_excluded(FF_PKT *ff, char *file);
int file_is_included(FF_PKT *ff, char *file);
struct s_included_file *get_next_included_file(FF_PKT *ff,
- struct s_included_file *inc);
+ struct s_included_file *inc);
/* From find_one.c */
int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt),
- void *pkt, char *p, dev_t parent_device, int top_level);
+ void *pkt, char *p, dev_t parent_device, int top_level);
int term_find_one(FF_PKT *ff);
/* from 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);
+ int parent_mode, uid_t owner, gid_t group,
+ int preserve_existing, char *verbose_fmt_string);
/* from file_io.c */
ssize_t bread(BFILE *bfd, void *buf, size_t count);
-int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode);
-int bclose(BFILE *bfd);
+int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode);
+int bclose(BFILE *bfd);
ssize_t bread(BFILE *bfd, void *buf, size_t count);
ssize_t bwrite(BFILE *bfd, void *buf, size_t count);
-off_t blseek(BFILE *bfd, off_t offset, int whence);
-int is_bopen(BFILE *bfd);
-void binit(BFILE *bfd, int use_win_api);
-char *berror(BFILE *bfd);
+off_t blseek(BFILE *bfd, off_t offset, int whence);
+int is_bopen(BFILE *bfd);
+void binit(BFILE *bfd);
+char *berror(BFILE *bfd);
--- /dev/null
+/*
+ * Windows APIs that are different for each system.
+ * We use pointers to the entry points so that a
+ * single binary will run on all Windows systems.
+ *
+ * Kern Sibbald MMIII
+ */
+/*
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+#include "bacula.h"
+#include "find.h"
+
+#ifdef HAVE_CYGWIN
+
+/* API Pointers */
+
+t_OpenProcessToken p_OpenProcessToken = NULL;
+t_AdjustTokenPrivileges p_AdjustTokenPrivileges = NULL;
+t_LookupPrivilegeValue p_LookupPrivilegeValue = NULL;
+
+t_GetFileAttributesEx p_GetFileAttributesEx = NULL;
+t_BackupRead p_BackupRead = NULL;
+t_BackupWrite p_BackupWrite = NULL;
+t_SetProcessShutdownParameters p_SetProcessShutdownParameters = NULL;
+
+#endif
--- /dev/null
+/*
+ * Windows APIs that are different for each system.
+ * We use pointers to the entry points so that a
+ * single binary will run on all Windows systems.
+ *
+ * Kern Sibbald MMIII
+ */
+/*
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+#ifndef __WINAPI_H
+#define __WINAPI_H
+
+#ifdef HAVE_CYGWIN
+/* In ADVAPI32.DLL */
+typedef BOOL (*t_OpenProcessToken)(HANDLE, DWORD, PHANDLE);
+typedef BOOL (*t_AdjustTokenPrivileges)(HANDLE, BOOL,
+ PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
+typedef BOOL (*t_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID);
+
+extern t_OpenProcessToken p_OpenProcessToken;
+extern t_AdjustTokenPrivileges p_AdjustTokenPrivileges;
+extern t_LookupPrivilegeValue p_LookupPrivilegeValue;
+
+/* In KERNEL32.DLL */
+typedef BOOL (*t_GetFileAttributesEx)(LPCTSTR, GET_FILEEX_INFO_LEVELS,
+ LPVOID);
+typedef BOOL (*t_SetProcessShutdownParameters)(DWORD, DWORD);
+typedef BOOL (*t_BackupRead)(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
+typedef BOOL (*t_BackupWrite)(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
+
+extern t_GetFileAttributesEx p_GetFileAttributesEx;
+extern t_SetProcessShutdownParameters p_SetProcessShutdownParameters;
+extern t_BackupRead p_BackupRead;
+extern t_BackupWrite p_BackupWrite;
+
+#endif
+
+#endif /* __WINAPI_H */
uint32_t EndFile;
uint32_t StartBlock;
uint32_t EndBlock;
- int use_win_backup_api; /* set to use native Win API */
pthread_t heartbeat_id; /* id of heartbeat thread */
BSOCK *hb_bsock; /* duped SD socket */
#endif /* FILE_DAEMON */
*/
/* base64.c */
-void base64_init (void);
-int to_base64 (intmax_t value, char *where);
-int from_base64 (intmax_t *value, char *where);
-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);
+int bin_to_base64 (char *buf, char *bin, int len);
/* bmisc.c */
-char *bstrncpy (char *dest, const char *src, int maxlen);
-char *bstrncat (char *dest, const char *src, int maxlen);
-void *b_malloc (char *file, int line, size_t size);
+char *bstrncpy (char *dest, const char *src, int maxlen);
+char *bstrncat (char *dest, const 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 drop (char *uid, char *gid);
-int bmicrosleep (time_t sec, long msec);
+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 drop (char *uid, char *gid);
+int bmicrosleep (time_t sec, long msec);
#ifndef HAVE_STRTOLL
-long long int stroll(const char *ptr, char **endptr, int base);
+long long int strtoll(const char *ptr, char **endptr, int base);
#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);
-int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
-int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need);
-BSOCK * bnet_connect (void *jcr, int retry_interval,
- int max_retry_time, char *name, char *host, char *service,
- int port, int verbose);
-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_wait_data_intr (BSOCK *bsock, int sec);
-int bnet_despool (BSOCK *bsock);
-int is_bnet_stop (BSOCK *bsock);
-int is_bnet_error (BSOCK *bsock);
-void bnet_suppress_error_messages(BSOCK *bsock, int flag);
+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);
+int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
+int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need);
+BSOCK * bnet_connect (void *jcr, int retry_interval,
+ int max_retry_time, char *name, char *host, char *service,
+ int port, int verbose);
+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_wait_data_intr (BSOCK *bsock, int sec);
+int bnet_despool (BSOCK *bsock);
+int is_bnet_stop (BSOCK *bsock);
+int is_bnet_error (BSOCK *bsock);
+void bnet_suppress_error_messages(BSOCK *bsock, int flag);
/* bget_msg.c */
-int bget_msg(BSOCK *sock);
+int bget_msg(BSOCK *sock);
/* cram-md5.c */
int cram_md5_get_auth(BSOCK *bs, char *password, int ssl_need);
int cram_md5_auth(BSOCK *bs, char *password, int ssl_need);
void hmac_md5(uint8_t* text, int text_len, uint8_t* key,
- int key_len, uint8_t *hmac);
+ int key_len, uint8_t *hmac);
/* crc32.c */
uint32_t bcrc32(uint8_t *buf, int len);
/* daemon.c */
-void daemon_start ();
+void daemon_start ();
/* edit.c */
-uint64_t str_to_uint64(char *str);
-int64_t str_to_int64(char *str);
-char * edit_uint64_with_commas (uint64_t val, char *buf);
-char * add_commas (char *val, char *buf);
-char * edit_uint64 (uint64_t val, char *buf);
-int duration_to_utime (char *str, utime_t *value);
-int size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
-char *edit_utime (utime_t val, char *buf);
-int is_a_number (const char *num);
-int is_an_integer (const char *n);
+uint64_t str_to_uint64(char *str);
+int64_t str_to_int64(char *str);
+char * edit_uint64_with_commas (uint64_t val, char *buf);
+char * add_commas (char *val, char *buf);
+char * edit_uint64 (uint64_t val, char *buf);
+int duration_to_utime (char *str, utime_t *value);
+int size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
+char *edit_utime (utime_t val, char *buf);
+int is_a_number (const char *num);
+int is_an_integer (const char *n);
/* 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);
/* 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(char *bind_addr, 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(char *bind_addr, 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);
-int do_shell_expansion (char *name);
-int is_buf_zero (char *buf, int len);
-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);
-BPIPE * open_bpipe(char *prog, int wait, char *mode);
-int close_wpipe(BPIPE *bpipe);
-int close_bpipe(BPIPE *bpipe);
-POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to);
+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);
+int do_shell_expansion (char *name);
+int is_buf_zero (char *buf, int len);
+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);
+BPIPE * open_bpipe(char *prog, int wait, char *mode);
+int close_wpipe(BPIPE *bpipe);
+int close_bpipe(BPIPE *bpipe);
+POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to);
void parse_command_args(POOLMEM *cmd, POOLMEM *args, int *argc,
- char **argk, char **argv);
+ char **argk, char **argv);
char *next_arg(char **s);
memset(ff, 0, sizeof(FF_PKT));
init_include_exclude_files(ff);
- binit(&bfd, 0);
+ binit(&bfd);
while ((ch = getopt(argc, argv, "b:c:d:e:i:?")) != -1) {
switch (ch) {
extract = FALSE;
stat = create_file(jcr, fname, ofile, lname, type, stream,
- &statp, attribsEx, &bfd, REPLACE_ALWAYS, 0);
+ &statp, attribsEx, &bfd, REPLACE_ALWAYS);
switch (stat) {
case CF_ERROR:
case CF_SKIP:
}
return 0;
}
+#ifdef MTEOM
if (dev_cap(dev, CAP_EOM)) {
mt_com.mt_op = MTEOM;
mt_com.mt_count = 1;
* Rewind then use FSF until EOT reached
*/
} else {
+#else
+ {
+#endif
if (!rewind_dev(dev)) {
return 0;
}
msg = "WTWEOF";
dev->capabilities &= ~CAP_EOF; /* turn off feature */
break;
+#ifdef MTEOM
case MTEOM:
msg = "WTEOM";
dev->capabilities &= ~CAP_EOM; /* turn off feature */
break;
+#endif
case MTFSF:
msg = "MTFSF";
dev->capabilities &= ~CAP_FSF; /* turn off feature */