diff --git a/CMakeLists.txt b/CMakeLists.txt index adb9ab48..23d97c7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,20 +7,6 @@ cmake_policy(SET CMP0065 OLD) # - try if setting CRYPTOPP_NATIVE_ARCH=ON and adding -march=native to the compile commands for cryfs source files makes a difference # -> if yes, offer a cmake option to enable both of these -#set(ANDROID_ABI arm64-v8a) -#set(ANDROID_NDK /ndk/23.1.7779620/) -#set(ANDROID_PLATFORM android-21) -#set(ANDROID_TOOLCHAIN clang) -# -#set(CMAKE_SYSTEM_NAME Android) -#set(CMAKE_SYSTEM_VERSION 21) -#set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) -#set(CMAKE_ANDROID_NDK ${ANDROID_NDK}) -#set(CMAKE_ANDROID_STL_TYPE c++_static) -# -#set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake) -#set(ANDROID TRUE) # Current toolchain file doesn't set this variable which is needed by spdlog - project(cryfs) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake-utils) @@ -56,7 +42,5 @@ if(MSVC) add_definitions(/bigobj) endif() -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - add_subdirectory(vendor EXCLUDE_FROM_ALL) add_subdirectory(src) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 136e9255..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -image: -- Visual Studio 2019 - -platform: -- x64 - -configuration: - - Release - -build_script: - - cmd: echo Appveyor CI is disabled since we now have Github Actions diff --git a/archive.sh b/archive.sh deleted file mode 100755 index 4a31c4d2..00000000 --- a/archive.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -TAG=$1 -GPGHOMEDIR=$2 - -git archive --format=tgz "$1" > "cryfs-$1.tar.gz" -gpg --homedir "$GPGHOMEDIR" --armor --detach-sign "cryfs-$1.tar.gz" - -git archive --format=tar "$1" | xz -9 > "cryfs-$1.tar.xz" -gpg --homedir "$GPGHOMEDIR" --armor --detach-sign "cryfs-$1.tar.xz" diff --git a/conanfile.py b/conanfile.py deleted file mode 100644 index 567c8678..00000000 --- a/conanfile.py +++ /dev/null @@ -1,46 +0,0 @@ -from conans import ConanFile, CMake - -class CryFSConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - requires = [ - "range-v3/0.11.0", - "spdlog/1.8.5", - "boost/1.75.0", - ] - generators = "cmake" - default_options = { - "boost:system_no_deprecated": True, - "boost:asio_no_deprecated": True, - "boost:filesystem_no_deprecated": True, - "boost:without_atomic": False, # needed by boost thread - "boost:without_chrono": False, # needed by CryFS - "boost:without_container": False, # needed by boost thread - "boost:without_context": True, - "boost:without_contract": True, - "boost:without_coroutine": True, - "boost:without_date_time": False, # needed by boost thread - "boost:without_exception": False, # needed by boost thread - "boost:without_fiber": True, - "boost:without_filesystem": False, # needed by CryFS - "boost:without_graph": True, - "boost:without_graph_parallel": True, - "boost:without_iostreams": True, - "boost:without_json": True, - "boost:without_locale": True, - "boost:without_log": True, - "boost:without_math": True, - "boost:without_mpi": True, - "boost:without_nowide": True, - "boost:without_program_options": False, # needed by CryFS - "boost:without_python": True, - "boost:without_random": True, - "boost:without_regex": True, - "boost:without_serialization": False, # needed by boost date_time - "boost:without_stacktrace": True, - "boost:without_system": False, # needed by CryFS - "boost:without_test": True, - "boost:without_thread": False, # needed by CryFS - "boost:without_timer": True, - "boost:without_type_erasure": True, - "boost:without_wave": True, - } diff --git a/run-clang-tidy.sh b/run-clang-tidy.sh deleted file mode 100755 index 61bca456..00000000 --- a/run-clang-tidy.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Note: Call this from a cmake build directory (e.g. cmake/) for out-of-source builds -# Examples: -# mkdir cmake && cd cmake && ../run-clang-tidy.sh -# mkdir cmake && cd cmake && ../run-clang-tidy.sh -fix -# mkdir cmake && cd cmake && ../run-clang-tidy.sh -export-fixes fixes.yaml - -set -e - -CXX=clang++-11 -CC=clang-11 -SCRIPT=run-clang-tidy-11.py - -export NUMCORES=`nproc` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi -echo Using ${NUMCORES} cores - -# Run cmake in current working directory, but on source that is in the same directory as this script file -cmake -DBUILD_TESTING=on -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_C_COMPILER=${CC} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "${0%/*}" - -# Filter all third party code from the compilation database -cat compile_commands.json|jq "map(select(.file | test(\"^$(realpath ${0%/*})/(src|test)/.*$\")))" > compile_commands2.json -rm compile_commands.json -mv compile_commands2.json compile_commands.json - -${SCRIPT} -j${NUMCORES} -quiet -header-filter "$(realpath ${0%/*})/(src|test)/.*" $@ diff --git a/run-iwyu.sh b/run-iwyu.sh deleted file mode 100755 index 50478862..00000000 --- a/run-iwyu.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# Note: Call this from a cmake build directory (e.g. cmake/) for out-of-source builds -# Examples: -# mkdir cmake && cd cmake && ../run-iwqu.sh -# mkdir cmake && cd cmake && ../run-iwqu.sh -fix - -set -e - -export NUMCORES=`nproc` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi -echo Using ${NUMCORES} cores - -# Run cmake in current working directory, but on source that is in the same directory as this script file -cmake -DBUILD_TESTING=on -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "${0%/*}" - -# Filter all third party code from the compilation database -cat compile_commands.json|jq "map(select(.file | test(\"^$(realpath ${0%/*})/(src|test)/.*$\")))" > compile_commands2.json -rm compile_commands.json -mv compile_commands2.json compile_commands.json - -if [ "$1" = "-fix" ]; then - TMPFILE=/tmp/iwyu.`cat /dev/urandom | tr -cd 'a-f0-9' | head -c 8`.out - - function cleanup { - rm ${TMPFILE} - } - trap cleanup EXIT - - iwyu_tool -j${NUMCORES} -p. ${@:2} | tee ${TMPFILE} - fix_include < ${TMPFILE} -else - iwyu_tool -j${NUMCORES} -p. $@ -fi diff --git a/src/cpp-utils/CMakeLists.txt b/src/cpp-utils/CMakeLists.txt index bcb3fb14..beb99fe0 100644 --- a/src/cpp-utils/CMakeLists.txt +++ b/src/cpp-utils/CMakeLists.txt @@ -72,7 +72,6 @@ else() endif() endif() -add_dependencies(${PROJECT_NAME} spdlog) find_package(Threads REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT}) diff --git a/src/cryfs-cli/program_options/ProgramOptions.cpp b/src/cryfs-cli/program_options/ProgramOptions.cpp index c5039ea4..672da5f3 100644 --- a/src/cryfs-cli/program_options/ProgramOptions.cpp +++ b/src/cryfs-cli/program_options/ProgramOptions.cpp @@ -11,7 +11,7 @@ namespace bf = boost::filesystem; ProgramOptions::ProgramOptions(bf::path baseDir, optional configFile, boost::filesystem::path localStateDir, - bool allowFilesystemUpgrade, bool allowReplacedFilesystem, + bool allowFilesystemUpgrade, bool allowReplacedFilesystem, bool createMissingBasedir, optional cipher, optional blocksizeBytes, diff --git a/src/fspp/fuse/CMakeLists.txt b/src/fspp/fuse/CMakeLists.txt index c563f749..29f72a4b 100644 --- a/src/fspp/fuse/CMakeLists.txt +++ b/src/fspp/fuse/CMakeLists.txt @@ -35,9 +35,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(FILES "${DOKAN_LIB_PATH}/dokan1.dll" "${DOKAN_LIB_PATH}/dokanfuse1.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}" ) - -else() # Linux and macOS - find_package(PkgConfig REQUIRED) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/src/fspp/fuse/Fuse.cpp b/src/fspp/fuse/Fuse.cpp index 41bc1ee2..5c2c1980 100644 --- a/src/fspp/fuse/Fuse.cpp +++ b/src/fspp/fuse/Fuse.cpp @@ -56,7 +56,7 @@ public: } // Remove the following line, if you don't want to output each fuse operation on the console -#define FSPP_LOG 1 +//#define FSPP_LOG 1 Fuse::~Fuse() { for(char *arg : _argv) { @@ -67,7 +67,7 @@ Fuse::~Fuse() { } Fuse::Fuse(std::function ()> init, std::string fstype, boost::optional fsname) - :_init(std::move(init)), _fs(make_shared()), _mountdir(), _running(false), _fstype(std::move(fstype)), _fsname(std::move(fsname)) { + :_init(std::move(init)), _fs(make_shared()), _running(false), _fstype(std::move(fstype)), _fsname(std::move(fsname)) { ASSERT(static_cast(_init), "Invalid init given"); } diff --git a/src/fspp/fuse/Fuse.h b/src/fspp/fuse/Fuse.h index e71b7d4c..7fc8f87a 100644 --- a/src/fspp/fuse/Fuse.h +++ b/src/fspp/fuse/Fuse.h @@ -28,13 +28,9 @@ public: explicit Fuse(std::function ()> init, std::string fstype, boost::optional fsname); ~Fuse(); - void runInBackground(const boost::filesystem::path &mountdir, std::vector fuseOptions); - void runInForeground(const boost::filesystem::path &mountdir, std::vector fuseOptions); bool running() const; void stop(); - static void unmount(const boost::filesystem::path &mountdir, bool force = false); - int getattr(const boost::filesystem::path &path, fspp::fuse::STAT *stbuf); int fgetattr(const boost::filesystem::path &path, fspp::fuse::STAT *stbuf, uint64_t fh); int readlink(const boost::filesystem::path &path, char *buf, size_t size); @@ -68,16 +64,13 @@ private: static void _logUnknownException(); static char *_create_c_string(const std::string &str); static void _removeAndWarnIfExists(std::vector *fuseOptions, const std::string &option); - void _run(const boost::filesystem::path &mountdir, std::vector fuseOptions); static bool _has_option(const std::vector &vec, const std::string &key); static bool _has_entry_with_prefix(const std::string &prefix, const std::vector &vec); - std::vector _build_argv(const boost::filesystem::path &mountdir, const std::vector &fuseOptions); void _add_fuse_option_if_not_exists(std::vector *argv, const std::string &key, const std::string &value); void _createContext(const std::vector &fuseOptions); std::function ()> _init; std::shared_ptr _fs; - boost::filesystem::path _mountdir; std::vector _argv; std::atomic _running; std::string _fstype; diff --git a/src/fspp/fuse/jni.cpp b/src/fspp/fuse/jni.cpp index b810eed7..3214036e 100644 --- a/src/fspp/fuse/jni.cpp +++ b/src/fspp/fuse/jni.cpp @@ -141,7 +141,7 @@ extern "C" jint cryfs_readdir(JNIEnv* env, jlong fusePtr, jstring jpath, void* d helper.path = boost::filesystem::path(path); helper.data = data; helper.filler = filler; - + int result = fuse->readdir(path, &helper, readDir); env->ReleaseStringUTFChars(jpath, path);