have_zlib=yes
fi
+#
+# Check for ACL libraries
+#
have_acl=no
AC_CHECK_HEADER(sys/acl.h)
AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
- [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"])]
+ [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
+ [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
+ )]
)
if test $have_acl = yes; then
AC_DEFINE(HAVE_ACL)
dnl Check for pthread libraries
PTHREAD_LIB=""
AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
- [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
- [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
- [AC_CHECK_FUNC(pthread_create)]
- )]
- )]
+ [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
+ [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
+ [AC_CHECK_FUNC(pthread_create)]
+ )]
+ )]
)
AC_SUBST(FDLIBS)
have_zlib=yes
fi
+#
+# Check for ACL libraries
+#
have_acl=no
if test "${ac_cv_header_sys_acl_h+set}" = set; then
echo "$as_me:$LINENO: checking for sys/acl.h" >&5
echo "${ECHO_T}$ac_cv_lib_acl_acl_get_file" >&6
if test $ac_cv_lib_acl_acl_get_file = yes; then
have_acl=yes; FDLIBS="-lacl $FDLIBS"
+else
+ echo "$as_me:$LINENO: checking for acltotext in -lsec" >&5
+echo $ECHO_N "checking for acltotext in -lsec... $ECHO_C" >&6
+if test "${ac_cv_lib_sec_acltotext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsec $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char acltotext ();
+int
+main ()
+{
+acltotext ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_sec_acltotext=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_sec_acltotext=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_sec_acltotext" >&5
+echo "${ECHO_T}$ac_cv_lib_sec_acltotext" >&6
+if test $ac_cv_lib_sec_acltotext = yes; then
+ have_acl=yes; FDLIBS="-lsec $FDLIBS"
+fi
+
+
fi
General:
Changes to 1.38.1:
+13Oct05
+- Turn off API debug output unless debug set to avoid confusing
+ the user.
+- Add Solaris ACL detection in configure.in as supplied by
+ Attila Fulop.
12Oct05
- Implement "autochanger drives" protocol so that Dir knows
how many drives an autochanger has.
General:
Changes to 1.39.0:
+13Oct05
+- Remove the USE_WIN32STREAMEXTRACTION #defines (always on)
+ and correct a few minor problems to make it build on Linux.
+10Oct05
- Remove delete of CVS from all Makefiles
- Fix seg fault when clicking on Add button in wx-console
restore panel. Bug #470.
attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
- if (!is_stream_supported(attr->data_stream)) {
+ if (!is_restore_stream_supported(attr->data_stream)) {
if (!non_support_data++) {
Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
stream_to_ascii(attr->data_stream));
Dmsg2(30, "Write %u bytes, total before write=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1));
}
-#ifdef USE_WIN32STREAMEXTRACTION
if (flags & FO_WIN32DECOMP) {
if (!processWin32BackupAPIBlock(bfd, wbuf, wsize)) {
berrno be;
jcr->last_fname, be.strerror(bfd->berrno));
return -1;
}
- }
- else
-#endif
- if (bwrite(bfd, wbuf, wsize) != (ssize_t)wsize) {
+ } else if (bwrite(bfd, wbuf, wsize) != (ssize_t)wsize) {
berrno be;
Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"),
jcr->last_fname, be.strerror(bfd->berrno));
dt, num_jobs_run, num_jobs_run == 1 ? "" : "s");
sendit(msg, len, arg);
#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
- if (/*debug_level > 0*/ true) {
+ if (debug_level > 0) {
if (!privs) {
privs = enable_backup_privileges(NULL, 1);
}
}
}
-#ifdef USE_WIN32STREAMEXTRACTION
void int64_LE2BE(int64_t* pBE, const int64_t v)
{
/* convert little endian to big endian */
if (htonl(1) != 1L) { /* no work if on little endian machine */
- memcpy(pBE, &v, sizeof(int64_t));
+ memcpy(pBE, &v, sizeof(int64_t));
} else {
- int i;
- uint8_t rv[sizeof(int64_t)];
- uint8_t *pv = (uint8_t *) &v;
-
- for (i = 0; i < 8; i++) {
- rv[i] = pv[7 - i];
- }
- memcpy(pBE, &rv, sizeof(int64_t));
+ int i;
+ uint8_t rv[sizeof(int64_t)];
+ uint8_t *pv = (uint8_t *) &v;
+
+ for (i = 0; i < 8; i++) {
+ rv[i] = pv[7 - i];
+ }
+ memcpy(pBE, &rv, sizeof(int64_t));
}
}
{
/* convert little endian to big endian */
if (htonl(1) != 1L) { /* no work if on little endian machine */
- memcpy(pBE, &v, sizeof(int32_t));
+ memcpy(pBE, &v, sizeof(int32_t));
} else {
- int i;
- uint8_t rv[sizeof(int32_t)];
- uint8_t *pv = (uint8_t *) &v;
-
- for (i = 0; i < 4; i++) {
- rv[i] = pv[3 - i];
- }
- memcpy(pBE, &rv, sizeof(int32_t));
+ int i;
+ uint8_t rv[sizeof(int32_t)];
+ uint8_t *pv = (uint8_t *) &v;
+
+ for (i = 0; i < 4; i++) {
+ rv[i] = pv[3 - i];
+ }
+ memcpy(pBE, &rv, sizeof(int32_t));
}
}
-BOOL processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, size_t dwSize)
+bool processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, ssize_t dwSize)
{
/* pByte contains the buffer
dwSize the len to be processed. function assumes to be
*/
PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT* pContext = &(bfd->win32DecompContext);
- bool bContinue = FALSE;
+ bool bContinue = false;
int64_t dwDataOffset = 0;
int64_t dwDataLen;
do {
if (pContext->liNextHeader >= dwSize) {
dwDataLen = dwSize-dwDataOffset;
- bContinue = FALSE; /* 1 iteration is enough */
+ bContinue = false; /* 1 iteration is enough */
}
else {
dwDataLen = pContext->liNextHeader-dwDataOffset;
/* flush */
/* copy block of real DATA */
if (pContext->bIsInData) {
- if (bwrite(bfd, ((LPBYTE)pBuffer)+dwDataOffset, dwDataLen) != (ssize_t)dwDataLen)
- return FALSE;
+ if (bwrite(bfd, ((char *)pBuffer)+dwDataOffset, dwDataLen) != (ssize_t)dwDataLen)
+ return false;
}
if (pContext->liNextHeader < dwSize) {/* is a header in this block ? */
/* header (or rest of header) is completely available
in current block
*/
- bHeaderIsComplete = TRUE;
+ bHeaderIsComplete = true;
else {
/* header will continue in next block */
- bHeaderIsComplete = FALSE;
+ bHeaderIsComplete = false;
dwHeaderPartLen = dwSize-dwOffsetSource;
}
/* copy the available portion of header to persistent copy */
- memcpy (((LPBYTE) &pContext->header_stream)+dwOffsetTarget, ((LPBYTE) pBuffer)+dwOffsetSource, dwHeaderPartLen);
+ memcpy(((char *)&pContext->header_stream)+dwOffsetTarget, ((char *)pBuffer)+dwOffsetSource, dwHeaderPartLen);
/* recalculate position of next header */
if (bHeaderIsComplete) {
int64_LE2BE (&(pContext->liNextHeader), pContext->header_stream.Size);
pContext->liNextHeader += dwDataOffset;
- pContext->bIsInData = pContext->header_stream.dwStreamId == BACKUP_DATA;
+ pContext->bIsInData = pContext->header_stream.dwStreamId == WIN32_BACKUP_DATA;
if (dwDataOffset == dwSize)
- bContinue = FALSE;
+ bContinue = false;
}
else {
/* stop and continue with next block */
- bContinue = FALSE;
- pContext->bIsInData = FALSE;
+ bContinue = false;
+ pContext->bIsInData = false;
}
}
} while (bContinue);
return TRUE;
}
-#endif
/*
* Return true if we support the stream
* false if we do not support the stream
+ *
+ * This code is running under Win32, so we
+ * do not need #ifdef on MACOS ...
*/
-bool is_stream_supported(int stream)
+bool is_restore_stream_supported(int stream)
{
- /* With Win32 backup on this machine */
switch (stream) {
- case STREAM_WIN32_DATA:
-#ifdef HAVE_ZLIB
- case STREAM_WIN32_GZIP_DATA:
-#endif
-#ifdef USE_WIN32STREAMEXTRACTION
- return true;
-#else
- return have_win32_api();
-#endif
/* Streams known not to be supported */
#ifndef HAVE_LIBZ
#ifdef HAVE_LIBZ
case STREAM_GZIP_DATA:
case STREAM_SPARSE_GZIP_DATA:
+ case STREAM_WIN32_GZIP_DATA:
#endif
+ case STREAM_WIN32_DATA:
case STREAM_UNIX_ATTRIBUTES:
case STREAM_FILE_DATA:
case STREAM_MD5_SIGNATURE:
}
bfd->errmsg = NULL;
bfd->lpContext = NULL;
-#ifdef USE_WIN32STREAMEXTRACTION
- bfd->win32DecompContext.bIsInData = FALSE;
+ bfd->win32DecompContext.bIsInData = false;
bfd->win32DecompContext.liNextHeader = 0;
-#endif
free_pool_memory(win32_fname_wchar);
free_pool_memory(win32_fname);
return bfd->mode == BF_CLOSED ? -1 : 1;
}
-
-bool is_stream_supported(int stream)
+/*
+ * This code is running on a non-Win32 machine
+ */
+bool is_restore_stream_supported(int stream)
{
/* No Win32 backup on this machine */
switch (stream) {
case STREAM_SPARSE_GZIP_DATA:
case STREAM_WIN32_GZIP_DATA:
#endif
-#ifndef USE_WIN32STREAMEXTRACTION
- case STREAM_WIN32_DATA:
-#endif
#ifndef HAVE_DARWIN_OS
case STREAM_MACOS_FORK_DATA:
case STREAM_HFSPLUS_ATTRIBUTES:
#ifdef HAVE_LIBZ
case STREAM_GZIP_DATA:
case STREAM_SPARSE_GZIP_DATA:
-#endif
-#ifdef USE_WIN32STREAMEXTRACTION
- case STREAM_WIN32_DATA:
-# ifdef HAVE_LIBZ
case STREAM_WIN32_GZIP_DATA:
-# endif
#endif
+ case STREAM_WIN32_DATA:
case STREAM_UNIX_ATTRIBUTES:
case STREAM_FILE_DATA:
case STREAM_MD5_SIGNATURE:
Dmsg1(400, "Open file %d\n", bfd->fid);
errno = bfd->berrno;
-#ifdef USE_WIN32STREAMEXTRACTION
- bfd->win32DecompContext.bIsInData = FALSE;
+ bfd->win32DecompContext.bIsInData = false;
bfd->win32DecompContext.liNextHeader = 0;
-#endif
return bfd->fid;
}
};
#endif
-#ifdef USE_WIN32STREAMEXTRACTION
/* this should physically correspond to WIN32_STREAM_ID
* from winbase.h on Win32. We didn't inlcude cStreamName
* as we don't use it and don't need it for a correct struct size.
*/
+#define WIN32_BACKUP_DATA 1
+
typedef struct _BWIN32_STREAM_ID {
int32_t dwStreamId;
int32_t dwStreamAttributes;
bool bIsInData;
BWIN32_STREAM_ID header_stream;
} PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT;
-#endif
/* =======================================================
*
char *prog; /* reader/writer program if any */
JCR *jcr; /* jcr for editing job codes */
Python_IO pio; /* Python I/O routines */
-#ifdef USE_WIN32STREAMEXTRACTION
PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */
int use_backup_decomp; /* set if using BackupRead Stream Decomposition */
-#endif
};
HANDLE bget_handle(BFILE *bfd);
char *prog; /* reader/writer program if any */
JCR *jcr; /* jcr for editing job codes */
Python_IO pio; /* Python I/O routines */
-#ifdef USE_WIN32STREAMEXTRACTION
PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */
int use_backup_decomp; /* set if using BackupRead Stream Decomposition */
-#endif
};
#endif
bool set_prog(BFILE *bfd, char *prog, JCR *jcr);
bool have_win32_api();
bool is_portable_backup(BFILE *bfd);
-bool is_stream_supported(int stream);
+bool is_restore_stream_supported(int stream);
bool is_win32_stream(int stream);
char *xberror(BFILE *bfd); /* DO NOT USE -- use berrno class */
int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode);
off_t blseek(BFILE *bfd, off_t offset, int whence);
const char *stream_to_ascii(int stream);
-#ifdef USE_WIN32STREAMEXTRACTION
-BOOL processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, size_t dwSize);
-#endif
+bool processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, ssize_t dwSize);
#endif /* __BFILE_H */
#undef VERSION
#define VERSION "1.39.0"
-#define BDATE "12 November 2005"
-#define LSMDATE "12Nov05"
+#define BDATE "13 November 2005"
+#define LSMDATE "13Nov05"
/* Debug flags */
#undef DEBUG