diff --git a/appveyor.yml b/appveyor.yml index c3a3bb699..b4857fdc6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -108,5 +108,4 @@ deploy: on: branch: - master - - s3_support_merge diff --git a/bin/bbstored/bbstored-certs.in b/bin/bbstored/bbstored-certs.in index 855607488..00085662d 100755 --- a/bin/bbstored/bbstored-certs.in +++ b/bin/bbstored/bbstored-certs.in @@ -288,7 +288,7 @@ sub get_csr_common_name my $subject; while() { - $subject = $1 if m/Subject:.+?CN=([-\.\w]+)/ + $subject = $1 if m/Subject:.+?CN\s?=\s?([-\.\w]+)/; } close CSRTEXT; diff --git a/infrastructure/cmake/windows/CMakeLists.txt b/infrastructure/cmake/windows/CMakeLists.txt index 893f2bbf0..1539323ae 100644 --- a/infrastructure/cmake/windows/CMakeLists.txt +++ b/infrastructure/cmake/windows/CMakeLists.txt @@ -108,9 +108,11 @@ ExternalProject_Add(boost URL "http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_UNDERSCORES}.tar.bz2" URL_HASH ${BOOST_HASH} # DOWNLOAD_NO_PROGRESS 1 - CONFIGURE_COMMAND "" # none needed - BUILD_COMMAND ${CMAKE_COMMAND} -E echo "No build step needed" # none needed - INSTALL_COMMAND "" # none needed + # Disable automatic updating (untarring) as it's slow and not necessary + UPDATE_DISCONNECTED 1 + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "No configure step needed" + BUILD_COMMAND ${CMAKE_COMMAND} -E echo "No build step needed" + INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No install step needed" ) if(BOXBACKUP_VERSION) @@ -127,6 +129,7 @@ ExternalProject_Add(boxbackup -DPCRE_ROOT=${install_dir} -DBOOST_ROOT=${CMAKE_BINARY_DIR}/Source/boost -DBOX_SUPPORT_READLINE=OFF + -DCMAKE_INSTALL_PREFIX=${install_dir} -DAPPVEYOR_MODE=1 -DDEBUG=${DEBUG} ${boxbackup_cmake_args} diff --git a/infrastructure/m4/boxbackup_tests.m4 b/infrastructure/m4/boxbackup_tests.m4 index caebd34e0..9c3e6d8e1 100644 --- a/infrastructure/m4/boxbackup_tests.m4 +++ b/infrastructure/m4/boxbackup_tests.m4 @@ -258,6 +258,7 @@ AC_CHECK_DECLS([INFTIM],,, [[#include ]]) AC_CHECK_DECLS([SO_PEERCRED],,, [[#include ]]) AC_CHECK_DECLS([IPPROTO_TCP],,, [[#include ]]) AC_CHECK_DECLS([SOL_TCP,TCP_INFO,TCP_CONNECTION_INFO],,, [[#include ]]) +AC_CHECK_DECLS([SYS_open, SYS_openat],,, [[#include ]]) if test -n "$have_sys_socket_h"; then AC_CHECK_DECLS([SO_SNDBUF],,, [[#include ]]) diff --git a/lib/bbackupd/BackupDaemon.cpp b/lib/bbackupd/BackupDaemon.cpp index 5d800de29..5556ca333 100644 --- a/lib/bbackupd/BackupDaemon.cpp +++ b/lib/bbackupd/BackupDaemon.cpp @@ -922,8 +922,6 @@ std::auto_ptr BackupDaemon::GetNewContext // it, let it be destroyed and close the connection. std::auto_ptr BackupDaemon::RunSyncNow() { - Timers::AssertInitialised(); - // Delete the serialised store object file, // so that we don't try to reload it after a // partially completed backup diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index 78fbeadcc..4f8c989e6 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -120,26 +120,6 @@ void Timers::Cleanup(bool throw_exception_if_not_initialised) spTimers = NULL; } -// -------------------------------------------------------------------------- -// -// Function -// Name: static void Timers::AssertInitialised() -// Purpose: Throw an assertion error if timers are not ready -// NOW. It's a common mistake (for me) when writing -// tests to forget to initialise timers first. -// Created: 15/05/2014 -// -// -------------------------------------------------------------------------- - -void Timers::AssertInitialised() -{ - if (!spTimers) - { - THROW_EXCEPTION(CommonException, TimersNotInitialised); - } - ASSERT(spTimers); -} - // -------------------------------------------------------------------------- // // Function @@ -340,7 +320,6 @@ void Timers::Reschedule() // -------------------------------------------------------------------------- void Timers::SignalHandler(int unused) { - // ASSERT(spTimers); Timers::RequestReschedule(); } diff --git a/lib/common/Timer.h b/lib/common/Timer.h index 68592aaa8..172332034 100644 --- a/lib/common/Timer.h +++ b/lib/common/Timer.h @@ -44,7 +44,6 @@ class Timers public: static void Init(); static void Cleanup(bool throw_exception_if_not_initialised = true); - static void AssertInitialised(); static void Add (Timer& rTimer); static void Remove(Timer& rTimer); static void RequestReschedule(); diff --git a/lib/intercept/intercept.cpp b/lib/intercept/intercept.cpp index 85c3d7e9b..ad9fc55aa 100644 --- a/lib/intercept/intercept.cpp +++ b/lib/intercept/intercept.cpp @@ -242,6 +242,10 @@ extern "C" int open(const char *path, int flags, ...) #endif // DEFINE_ONLY_OPEN64 { + // Some newer architectures don't have an open() syscall, but use openat() instead. + // In these cases we will need to call sys_openat() instead of sys_open(). + // https://chromium.googlesource.com/linux-syscall-support/ + if(intercept_count > 0) { if(intercept_filename != NULL && @@ -264,6 +268,8 @@ extern "C" int #ifdef PLATFORM_NO_SYSCALL int r = TEST_open(path, flags, mode); +#elif HAVE_DECL_SYS_OPENAT && !HAVE_DECL_SYS_OPEN + int r = syscall(SYS_openat, AT_FDCWD, path, flags, mode); #else int r = syscall(SYS_open, path, flags, mode); #endif diff --git a/lib/intercept/intercept.h b/lib/intercept/intercept.h index 168176bf9..8a025d884 100644 --- a/lib/intercept/intercept.h +++ b/lib/intercept/intercept.h @@ -66,5 +66,14 @@ void intercept_setup_stat_post_hook (lstat_post_hook_t hookfn); void intercept_clear_setup(); +// Some newer architectures don't have an open() syscall, but use openat() instead. +// In these cases we define SYS_open (which is otherwise undefined) to equal SYS_openat +// (which is defined) so that everywhere else we can call intercept_setup_error(SYS_open) +// without caring about the difference. +// https://chromium.googlesource.com/linux-syscall-support/ +#if !HAVE_DECL_SYS_OPEN && HAVE_DECL_SYS_OPENAT +# define SYS_open SYS_openat +#endif + #endif // !PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE #endif // !INTERCEPT_H diff --git a/test/common/testcommon.cpp b/test/common/testcommon.cpp index 5b036c496..5f82764f6 100644 --- a/test/common/testcommon.cpp +++ b/test/common/testcommon.cpp @@ -445,16 +445,18 @@ bool test_timers() // throws an assertion failure. Can only do this in debug mode #ifndef BOX_RELEASE_BUILD { + TEST_CHECK_THROWS(Timers::Cleanup(), CommonException, + AssertFailed); + Timer tim(0, "tim"); TEST_CHECK_THROWS(Timers::Add(tim), CommonException, AssertFailed); Timers::Remove(tim); - } - #endif - // TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed); - #ifndef BOX_RELEASE_BUILD - TEST_CHECK_THROWS(Timers::Cleanup(), CommonException, + TEST_CHECK_THROWS(Timer t1(900, "t1"), CommonException, AssertFailed); + + // TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed); + } #endif // Check that we can initialise the timers diff --git a/test/raidfile/testraidfile.cpp b/test/raidfile/testraidfile.cpp index 56b970186..be0ad1901 100644 --- a/test/raidfile/testraidfile.cpp +++ b/test/raidfile/testraidfile.cpp @@ -25,6 +25,7 @@ #include "RaidFileException.h" #include "RaidFileRead.h" #include "Guards.h" +#include "intercept.h" #include "MemLeakFindOn.h" @@ -37,13 +38,6 @@ #define TRF_CAN_INTERCEPT #endif -#ifdef TRF_CAN_INTERCEPT -// function in intercept.cpp for setting up errors -void intercept_setup_error(const char *filename, unsigned int errorafter, int errortoreturn, int syscalltoerror); -bool intercept_triggered(); -void intercept_clear_setup(); -#endif - // Nice random data for testing written files class R250 { public: