sys-fs/cryfs: drop 0.10.3-r1

Bug: https://bugs.gentoo.org/935420
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2024-08-30 16:40:57 +02:00
parent 4af6e9991a
commit c3eb169950
7 changed files with 0 additions and 879 deletions
-1
View File
@@ -1,2 +1 @@
DIST cryfs-0.10.3.tar.xz 7908228 BLAKE2B e1c816bd2ceb125573f5385c6ddb316a600275f0b907d89d3ab32f2050f1a0874ebbfd3db7b452b41d20dcbdd01bf59210a0a96c5bfee079ce222307d4c55596 SHA512 a1325c79cb253219bb092fd68399d6ec68aaf3d78bc95608582ab0c239dfaa0361416531cd1051661e4699b1e79867547710ea55d23e5697ebd4421c937d5b87
DIST cryfs-0.11.4.tar.gz 10420508 BLAKE2B 3b096180f204b90774c2dee5a8bbfa2305fad62fdb86cfa03e802d6a01f3d7a01005c411a16cc3693f2c858e1be9313ba42ab2883daae993220049b34622e391 SHA512 a1aa9377cb0881f08f536f4b2116b27aeef71739e6a1362b209f38f1b54a9ae9e11a2a47ceaa28dcabd74d1ac57f0c92e3d1d8060eabeef4e7efd3d62cc7feea
-123
View File
@@ -1,123 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{10..12} )
inherit cmake flag-o-matic linux-info python-any-r1
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/cryfs/cryfs"
else
SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
S="${WORKDIR}"
fi
DESCRIPTION="Encrypted FUSE filesystem that conceals metadata"
HOMEPAGE="https://www.cryfs.org/"
LICENSE="LGPL-3 MIT"
SLOT="0"
IUSE="debug test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-libs/boost:=
>=dev-libs/crypto++-8.2.0:=
net-misc/curl:=
>=sys-fs/fuse-2.8.6:0
dev-libs/openssl:=
"
DEPEND="
${RDEPEND}
test? ( dev-cpp/gtest )
"
BDEPEND="
${PYTHON_DEPS}
$(python_gen_any_dep '
dev-python/versioneer[${PYTHON_USEDEP}]
')
"
PATCHES=(
# TODO upstream:
"${FILESDIR}/${PN}-0.10.2-unbundle-libs.patch"
"${FILESDIR}/${PN}-0.10.2-install-targets.patch"
"${FILESDIR}/${PN}-0.10.3-gcc13.patch"
# From upstream
"${FILESDIR}/${PN}-0.10.3-gcc11.patch"
"${FILESDIR}/${PN}-0.10.3-fix-build-with-boost-1-77.patch"
)
python_check_deps() {
python_has_version "dev-python/versioneer[${PYTHON_USEDEP}]"
}
pkg_setup() {
local CONFIG_CHECK="~FUSE_FS"
local WARNING_FUSE_FS="CONFIG_FUSE_FS is required for cryfs support."
check_extra_config
python-any-r1_pkg_setup
}
src_prepare() {
cmake_src_prepare
# don't install compressed manpage
cmake_comment_add_subdirectory doc
# We use the package instead for >=py3.12 compat, bug #908997
rm src/gitversion/versioneer.py || die
# remove tests that require internet access to comply with Gentoo policy
sed -e "/CurlHttpClientTest.cpp/d" -e "/FakeHttpClientTest.cpp/d" \
-i test/cpp-utils/CMakeLists.txt || die
# /dev/fuse access denied
sed -e "/CliTest_IntegrityCheck/d" \
-i test/cryfs-cli/CMakeLists.txt || die
}
src_configure() {
# ODR violations (bug #880563)
filter-lto
local mycmakeargs=(
-DBoost_USE_STATIC_LIBS=OFF
-DCRYFS_UPDATE_CHECKS=OFF
-DBUILD_SHARED_LIBS=OFF
-DUSE_SYSTEM_LIBS=ON
-DBUILD_TESTING=$(usex test)
)
use debug || append-flags -DNDEBUG
# bug 907096
use elibc_musl && append-flags -D_LARGEFILE64_SOURCE
cmake_src_configure
}
src_test() {
local TMPDIR="${T}"
local tests_failed=()
# fspp fuse tests hang, bug # 699044
for i in gitversion cpp-utils parallelaccessstore blockstore blobstore cryfs cryfs-cli ; do
"${BUILD_DIR}"/test/${i}/${i}-test || tests_failed+=( "${i}" )
done
if [[ -n ${tests_failed[@]} ]] ; then
eerror "The following tests failed:"
eerror "${tests_failed[@]}"
die "At least one test failed"
fi
}
src_install() {
cmake_src_install
doman doc/man/cryfs.1
}
@@ -1,38 +0,0 @@
https://github.com/cryfs/cryfs/pull/396
From 18503b00bd16d95dd2cf8a9047446f8be7289082 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sun, 16 Jun 2019 19:35:49 +0200
Subject: [PATCH 3/3] Don't limit install on Release/Debug/RelWithDebInfo
CONFIGURATIONS
---
src/cryfs-cli/CMakeLists.txt | 1 -
src/cryfs-unmount/CMakeLists.txt | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/cryfs-cli/CMakeLists.txt b/src/cryfs-cli/CMakeLists.txt
index 90edb227..e8c03916 100644
--- a/src/cryfs-cli/CMakeLists.txt
+++ b/src/cryfs-cli/CMakeLists.txt
@@ -27,6 +27,5 @@ target_enable_style_warnings(${PROJECT_NAME}_bin)
target_activate_cpp14(${PROJECT_NAME}_bin)
install(TARGETS ${PROJECT_NAME}_bin
- CONFIGURATIONS Debug Release RelWithDebInfo
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
diff --git a/src/cryfs-unmount/CMakeLists.txt b/src/cryfs-unmount/CMakeLists.txt
index 0a246a7f..c5f096ab 100644
--- a/src/cryfs-unmount/CMakeLists.txt
+++ b/src/cryfs-unmount/CMakeLists.txt
@@ -19,6 +19,5 @@ target_enable_style_warnings(${PROJECT_NAME}_bin)
target_activate_cpp14(${PROJECT_NAME}_bin)
install(TARGETS ${PROJECT_NAME}_bin
- CONFIGURATIONS Debug Release RelWithDebInfo
- DESTINATION ${CMAKE_INSTALL_BINDIR}
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
)
--
2.22.0
@@ -1,409 +0,0 @@
From b78c249ce3e048d481d11347c98a86e6669ff5bb Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sun, 16 Jun 2019 10:59:46 +0200
Subject: [PATCH 1/3] Add USE_SYSTEM_LIBS option to build without bundled libs
headers: s/vendor_cryptopp/cryptopp/
Only gtest and crypto++ are being unbundled. In release/0.10 branch,
bundled spdlog version is too old for Gentoo to satisfy with system-lib.
---
CMakeLists.txt | 15 ++++++++++++++-
.../compressing/compressors/Gzip.cpp | 2 +-
src/cpp-utils/CMakeLists.txt | 6 +++++-
src/cpp-utils/crypto/cryptopp_byte.h | 2 +-
src/cpp-utils/crypto/hash/Hash.cpp | 2 +-
src/cpp-utils/crypto/kdf/Scrypt.cpp | 2 +-
src/cpp-utils/crypto/symmetric/CFB_Cipher.h | 2 +-
src/cpp-utils/crypto/symmetric/GCM_Cipher.h | 2 +-
src/cpp-utils/crypto/symmetric/ciphers.h | 10 +++++-----
src/cpp-utils/data/Data.cpp | 2 +-
src/cpp-utils/data/FixedSizeData.h | 2 +-
src/cpp-utils/random/OSRandomGenerator.h | 2 +-
src/cpp-utils/random/RandomGeneratorThread.h | 2 +-
src/cryfs/localstate/BasedirMetadata.cpp | 2 +-
test/blobstore/CMakeLists.txt | 2 +-
test/blockstore/CMakeLists.txt | 2 +-
test/cpp-utils/CMakeLists.txt | 2 +-
test/cryfs-cli/CMakeLists.txt | 2 +-
test/cryfs/CMakeLists.txt | 2 +-
test/cryfs/config/CompatibilityTest.cpp | 2 +-
test/fspp/CMakeLists.txt | 2 +-
test/gitversion/CMakeLists.txt | 2 +-
test/my-gtest-main/CMakeLists.txt | 2 +-
test/parallelaccessstore/CMakeLists.txt | 2 +-
24 files changed, 45 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fdbff715..9797d1ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ require_clang_version(4.0)
option(BUILD_TESTING "build test cases" OFF)
option(CRYFS_UPDATE_CHECKS "let cryfs check for updates and security vulnerabilities" ON)
option(DISABLE_OPENMP "allow building without OpenMP libraries. This will cause performance degradations." OFF)
+option(USE_SYSTEM_LIBS "build with system libs instead of bundled libs" OFF)
# The following options are helpful for development and/or CI
option(USE_WERROR "build with -Werror flag")
@@ -48,7 +49,19 @@ if(MSVC)
add_definitions(/bigobj)
endif()
-add_subdirectory(vendor EXCLUDE_FROM_ALL)
+if(USE_SYSTEM_LIBS)
+ include(FindPkgConfig)
+ pkg_check_modules(CRYPTOPP REQUIRED libcryptopp>=8.2)
+ add_subdirectory(vendor/spdlog EXCLUDE_FROM_ALL)
+ if(BUILD_TESTING)
+ find_package(GTest CONFIG REQUIRED)
+ set(GOOGLETEST_LIBS GTest::gtest GTest::gmock)
+ endif()
+else()
+ add_subdirectory(vendor EXCLUDE_FROM_ALL)
+ set(GOOGLETEST_LIBS googletest)
+endif()
+
add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(test)
diff --git a/src/blockstore/implementations/compressing/compressors/Gzip.cpp b/src/blockstore/implementations/compressing/compressors/Gzip.cpp
index 67b7f49a..64f13e97 100644
--- a/src/blockstore/implementations/compressing/compressors/Gzip.cpp
+++ b/src/blockstore/implementations/compressing/compressors/Gzip.cpp
@@ -1,6 +1,6 @@
#include "cpp-utils/crypto/cryptopp_byte.h"
#include "Gzip.h"
-#include <vendor_cryptopp/gzip.h>
+#include <cryptopp/gzip.h>
using cpputils::Data;
diff --git a/src/cpp-utils/CMakeLists.txt b/src/cpp-utils/CMakeLists.txt
index f66f99f8..b57e02ba 100644
--- a/src/cpp-utils/CMakeLists.txt
+++ b/src/cpp-utils/CMakeLists.txt
@@ -89,7 +89,11 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_DL_LIBS})
-target_link_libraries(${PROJECT_NAME} PUBLIC spdlog cryptopp)
+if(USE_SYSTEM_LIBS)
+ target_link_libraries(${PROJECT_NAME} PUBLIC spdlog ${CRYPTOPP_LIBRARIES})
+else()
+ target_link_libraries(${PROJECT_NAME} PUBLIC spdlog cryptopp)
+endif()
target_add_boost(${PROJECT_NAME} filesystem system thread chrono)
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/src/cpp-utils/crypto/cryptopp_byte.h b/src/cpp-utils/crypto/cryptopp_byte.h
index e00cf7cf..363990e9 100644
--- a/src/cpp-utils/crypto/cryptopp_byte.h
+++ b/src/cpp-utils/crypto/cryptopp_byte.h
@@ -2,7 +2,7 @@
#ifndef _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H
#define _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H
-#include <vendor_cryptopp/cryptlib.h>
+#include <cryptopp/cryptlib.h>
// If we're running an older CryptoPP version, CryptoPP::byte isn't defined yet.
// Define it. Refer to "byte" type in the global namespace (placed by CryptoPP).
diff --git a/src/cpp-utils/crypto/hash/Hash.cpp b/src/cpp-utils/crypto/hash/Hash.cpp
index 696cdeaf..e07d28da 100644
--- a/src/cpp-utils/crypto/hash/Hash.cpp
+++ b/src/cpp-utils/crypto/hash/Hash.cpp
@@ -1,6 +1,6 @@
#include "Hash.h"
#include <cpp-utils/random/Random.h>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
using cpputils::Random;
using CryptoPP::SHA512;
diff --git a/src/cpp-utils/crypto/kdf/Scrypt.cpp b/src/cpp-utils/crypto/kdf/Scrypt.cpp
index f97d6940..e26db8db 100644
--- a/src/cpp-utils/crypto/kdf/Scrypt.cpp
+++ b/src/cpp-utils/crypto/kdf/Scrypt.cpp
@@ -1,5 +1,5 @@
#include "Scrypt.h"
-#include <vendor_cryptopp/scrypt.h>
+#include <cryptopp/scrypt.h>
using std::string;
diff --git a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
index 217111d9..0ea6355c 100644
--- a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
+++ b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
@@ -7,7 +7,7 @@
#include "../../data/Data.h"
#include "../../random/Random.h"
#include <boost/optional.hpp>
-#include <vendor_cryptopp/modes.h>
+#include <cryptopp/modes.h>
#include "Cipher.h"
#include "EncryptionKey.h"
diff --git a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
index 87404c8f..385f399f 100644
--- a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
+++ b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
@@ -6,7 +6,7 @@
#include "../../data/FixedSizeData.h"
#include "../../data/Data.h"
#include "../../random/Random.h"
-#include <vendor_cryptopp/gcm.h>
+#include <cryptopp/gcm.h>
#include "Cipher.h"
#include "EncryptionKey.h"
diff --git a/src/cpp-utils/crypto/symmetric/ciphers.h b/src/cpp-utils/crypto/symmetric/ciphers.h
index 7a8f8d45..61a6a25a 100644
--- a/src/cpp-utils/crypto/symmetric/ciphers.h
+++ b/src/cpp-utils/crypto/symmetric/ciphers.h
@@ -2,11 +2,11 @@
#ifndef MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
#define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
-#include <vendor_cryptopp/aes.h>
-#include <vendor_cryptopp/twofish.h>
-#include <vendor_cryptopp/serpent.h>
-#include <vendor_cryptopp/cast.h>
-#include <vendor_cryptopp/mars.h>
+#include <cryptopp/aes.h>
+#include <cryptopp/twofish.h>
+#include <cryptopp/serpent.h>
+#include <cryptopp/cast.h>
+#include <cryptopp/mars.h>
#include "GCM_Cipher.h"
#include "CFB_Cipher.h"
diff --git a/src/cpp-utils/data/Data.cpp b/src/cpp-utils/data/Data.cpp
index c8a3a25b..3a6d41eb 100644
--- a/src/cpp-utils/data/Data.cpp
+++ b/src/cpp-utils/data/Data.cpp
@@ -1,6 +1,6 @@
#include "Data.h"
#include <stdexcept>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <cpp-utils/crypto/cryptopp_byte.h>
using std::istream;
diff --git a/src/cpp-utils/data/FixedSizeData.h b/src/cpp-utils/data/FixedSizeData.h
index 832a96ee..e45127a4 100644
--- a/src/cpp-utils/data/FixedSizeData.h
+++ b/src/cpp-utils/data/FixedSizeData.h
@@ -2,7 +2,7 @@
#ifndef MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
#define MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <string>
#include <cstring>
#include "../assert/assert.h"
diff --git a/src/cpp-utils/random/OSRandomGenerator.h b/src/cpp-utils/random/OSRandomGenerator.h
index 18a8002d..8c8dc6f5 100644
--- a/src/cpp-utils/random/OSRandomGenerator.h
+++ b/src/cpp-utils/random/OSRandomGenerator.h
@@ -4,7 +4,7 @@
#include "cpp-utils/crypto/cryptopp_byte.h"
#include "RandomGenerator.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
class OSRandomGenerator final : public RandomGenerator {
diff --git a/src/cpp-utils/random/RandomGeneratorThread.h b/src/cpp-utils/random/RandomGeneratorThread.h
index 593750ed..103c00d7 100644
--- a/src/cpp-utils/random/RandomGeneratorThread.h
+++ b/src/cpp-utils/random/RandomGeneratorThread.h
@@ -4,7 +4,7 @@
#include "../thread/LoopThread.h"
#include "ThreadsafeRandomDataBuffer.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
//TODO Test
diff --git a/src/cryfs/localstate/BasedirMetadata.cpp b/src/cryfs/localstate/BasedirMetadata.cpp
index d32ced93..3de2d3ad 100644
--- a/src/cryfs/localstate/BasedirMetadata.cpp
+++ b/src/cryfs/localstate/BasedirMetadata.cpp
@@ -1,7 +1,7 @@
#include "BasedirMetadata.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
#include <boost/filesystem/operations.hpp>
#include "LocalStateDir.h"
#include <cpp-utils/logging/logging.h>
diff --git a/test/blobstore/CMakeLists.txt b/test/blobstore/CMakeLists.txt
index 05e98b8d..342d5626 100644
--- a/test/blobstore/CMakeLists.txt
+++ b/test/blobstore/CMakeLists.txt
@@ -27,7 +27,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest blobstore)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} blobstore)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/blockstore/CMakeLists.txt b/test/blockstore/CMakeLists.txt
index ca63acce..6dc5f505 100644
--- a/test/blockstore/CMakeLists.txt
+++ b/test/blockstore/CMakeLists.txt
@@ -42,7 +42,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest blockstore)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} blockstore)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/cpp-utils/CMakeLists.txt b/test/cpp-utils/CMakeLists.txt
index 02cc9d5d..55f367eb 100644
--- a/test/cpp-utils/CMakeLists.txt
+++ b/test/cpp-utils/CMakeLists.txt
@@ -70,7 +70,7 @@ target_activate_cpp14(${PROJECT_NAME}_exit_signal)
target_link_libraries(${PROJECT_NAME}_exit_signal cpp-utils)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest cpp-utils)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} cpp-utils)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_exit_status ${PROJECT_NAME}_exit_signal)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/test/cryfs-cli/CMakeLists.txt b/test/cryfs-cli/CMakeLists.txt
index 2d0b38c5..76fd75bc 100644
--- a/test/cryfs-cli/CMakeLists.txt
+++ b/test/cryfs-cli/CMakeLists.txt
@@ -16,7 +16,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest cryfs-cli cryfs-unmount fspp-fuse)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} cryfs-cli cryfs-unmount fspp-fuse)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/cryfs/CMakeLists.txt b/test/cryfs/CMakeLists.txt
index 77a025f4..71c74310 100644
--- a/test/cryfs/CMakeLists.txt
+++ b/test/cryfs/CMakeLists.txt
@@ -24,7 +24,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest cryfs)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} cryfs)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/cryfs/config/CompatibilityTest.cpp b/test/cryfs/config/CompatibilityTest.cpp
index 36c1871c..a1d5f22b 100644
--- a/test/cryfs/config/CompatibilityTest.cpp
+++ b/test/cryfs/config/CompatibilityTest.cpp
@@ -3,7 +3,7 @@
#include <vector>
#include <boost/filesystem.hpp>
#include <cpp-utils/data/Data.h>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <cpp-utils/crypto/symmetric/ciphers.h>
#include <cpp-utils/tempfile/TempFile.h>
#include <cryfs/config/CryConfigFile.h>
diff --git a/test/fspp/CMakeLists.txt b/test/fspp/CMakeLists.txt
index dabff1f1..c3949206 100644
--- a/test/fspp/CMakeLists.txt
+++ b/test/fspp/CMakeLists.txt
@@ -102,7 +102,7 @@ set(SOURCES
testutils/OpenFileHandle.cpp testutils/OpenFileHandle.h)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest fspp-interface fspp-fuse)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} fspp-interface fspp-fuse)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/gitversion/CMakeLists.txt b/test/gitversion/CMakeLists.txt
index 51a5ccc1..396289fa 100644
--- a/test/gitversion/CMakeLists.txt
+++ b/test/gitversion/CMakeLists.txt
@@ -6,7 +6,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest gitversion)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} gitversion)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
diff --git a/test/my-gtest-main/CMakeLists.txt b/test/my-gtest-main/CMakeLists.txt
index 1d1e7e08..de4fd107 100644
--- a/test/my-gtest-main/CMakeLists.txt
+++ b/test/my-gtest-main/CMakeLists.txt
@@ -5,7 +5,7 @@ set(SOURCES
)
add_library(${PROJECT_NAME} STATIC ${SOURCES})
-target_link_libraries(${PROJECT_NAME} PUBLIC googletest cpp-utils)
+target_link_libraries(${PROJECT_NAME} PUBLIC ${GOOGLETEST_LIBS} cpp-utils)
target_add_boost(${PROJECT_NAME} filesystem system)
target_include_directories(${PROJECT_NAME} PUBLIC .)
diff --git a/test/parallelaccessstore/CMakeLists.txt b/test/parallelaccessstore/CMakeLists.txt
index 16170d17..97379304 100644
--- a/test/parallelaccessstore/CMakeLists.txt
+++ b/test/parallelaccessstore/CMakeLists.txt
@@ -6,7 +6,7 @@ set(SOURCES
)
add_executable(${PROJECT_NAME} ${SOURCES})
-target_link_libraries(${PROJECT_NAME} my-gtest-main googletest parallelaccessstore)
+target_link_libraries(${PROJECT_NAME} my-gtest-main ${GOOGLETEST_LIBS} parallelaccessstore)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
target_enable_style_warnings(${PROJECT_NAME})
--
2.22.0
From 6d5b1dd6f040dbdf3e330962a174c91281b19472 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sun, 16 Jun 2019 15:17:16 +0200
Subject: [PATCH 2/3] Use FeatureSummary
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9797d1ee..9e37b2e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ project(cryfs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake-utils)
include(utils)
+include(FeatureSummary)
require_gcc_version(5.0)
require_clang_version(4.0)
@@ -66,3 +67,5 @@ add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(test)
add_subdirectory(cpack)
+
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
--
2.22.0
@@ -1,26 +0,0 @@
https://github.com/cryfs/cryfs/pull/395
From dcc072d51d0bbb56c9d8709214ce49f8bd6de73c Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 13 Aug 2021 18:46:55 +0100
Subject: [PATCH] Add missing memory.h include for std::shared_ptr
---
src/fspp/fuse/Fuse.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/fspp/fuse/Fuse.h b/src/fspp/fuse/Fuse.h
index 0b384d8..2ed98da 100644
--- a/src/fspp/fuse/Fuse.h
+++ b/src/fspp/fuse/Fuse.h
@@ -11,6 +11,7 @@
#include <boost/optional.hpp>
#include <cpp-utils/macros.h>
#include <atomic>
+#include <memory>
#include "stat_compatibility.h"
namespace fspp {
--
2.32.0
-271
View File
@@ -1,271 +0,0 @@
https://github.com/cryfs/cryfs/commit/27587ea1acec5f939a31217f1c43953378f18821.patch
https://bugs.gentoo.org/786459
From 27587ea1acec5f939a31217f1c43953378f18821 Mon Sep 17 00:00:00 2001
From: Sebastian Messmer <messmer@cryfs.org>
Date: Sat, 8 May 2021 14:44:27 -0700
Subject: [PATCH] Fixed an issue when compiling with GCC 11, see
https://github.com/cryfs/cryfs/issues/389
---
--- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h
+++ b/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h
@@ -67,7 +67,7 @@ class DataNodeView final {
static DataNodeView create(blockstore::BlockStore *blockStore, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) {
ASSERT(data.size() <= layout.datasizeBytes(), "Data is too large for node");
- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data));
+ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data));
ASSERT(serialized.size() == layout.blocksizeBytes(), "Wrong block size");
auto block = blockStore->create(serialized);
return DataNodeView(std::move(block));
@@ -75,7 +75,7 @@ class DataNodeView final {
static DataNodeView initialize(cpputils::unique_ref<blockstore::Block> block, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) {
ASSERT(data.size() <= DataNodeLayout(block->size()).datasizeBytes(), "Data is too large for node");
- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data));
+ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data));
ASSERT(serialized.size() == block->size(), "Block has wrong size");
block->write(serialized.data(), 0, serialized.size());
return DataNodeView(std::move(block));
@@ -83,7 +83,7 @@ class DataNodeView final {
static DataNodeView overwrite(blockstore::BlockStore *blockStore, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, const blockstore::BlockId &blockId, cpputils::Data data) {
ASSERT(data.size() <= layout.datasizeBytes(), "Data is too large for node");
- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data));
+ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data));
auto block = blockStore->overwrite(blockId, std::move(serialized));
return DataNodeView(std::move(block));
}
@@ -143,7 +143,7 @@ class DataNodeView final {
}
private:
- static cpputils::Data _serialize(const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) {
+ static cpputils::Data serialize_(const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) {
cpputils::Data result(layout.blocksizeBytes());
cpputils::serialize<uint16_t>(result.dataOffset(layout.FORMAT_VERSION_OFFSET_BYTES), formatVersion);
cpputils::serialize<uint8_t>(result.dataOffset(layout.DEPTH_OFFSET_BYTES), depth);
--- a/src/cryfs/filesystem/fsblobstore/utils/DirEntry.cpp
+++ b/src/cryfs/filesystem/fsblobstore/utils/DirEntry.cpp
@@ -11,55 +11,55 @@ namespace cryfs {
namespace {
template<typename DataType>
- size_t _serialize(void* dst, const DataType& obj) {
+ size_t serialize_(void* dst, const DataType& obj) {
cpputils::serialize<DataType>(dst, obj);
return sizeof(DataType);
}
template<typename DataType>
- DataType _deserialize(const char** src) {
+ DataType deserialize_(const char** src) {
DataType result = cpputils::deserialize<DataType>(*src);
*src += sizeof(DataType);
return result;
}
- constexpr size_t _serializedTimeValueSize() {
+ constexpr size_t serializedTimeValueSize_() {
return sizeof(uint64_t) + sizeof(uint32_t);
}
- unsigned int _serializeTimeValue(uint8_t *dest, timespec value) {
+ unsigned int serializeTimeValue_(uint8_t *dest, timespec value) {
unsigned int offset = 0;
- offset += _serialize<uint64_t>(dest + offset, value.tv_sec);
- offset += _serialize<uint32_t>(dest + offset, value.tv_nsec);
- ASSERT(offset == _serializedTimeValueSize(), "serialized to wrong size");
+ offset += serialize_<uint64_t>(dest + offset, value.tv_sec);
+ offset += serialize_<uint32_t>(dest + offset, value.tv_nsec);
+ ASSERT(offset == serializedTimeValueSize_(), "serialized to wrong size");
return offset;
}
- timespec _deserializeTimeValue(const char **pos) {
+ timespec deserializeTimeValue_(const char **pos) {
timespec value{};
- value.tv_sec = _deserialize<uint64_t>(pos);
- value.tv_nsec = _deserialize<uint32_t>(pos);
+ value.tv_sec = deserialize_<uint64_t>(pos);
+ value.tv_nsec = deserialize_<uint32_t>(pos);
return value;
}
- unsigned int _serializeString(uint8_t *dest, const string &value) {
+ unsigned int serializeString_(uint8_t *dest, const string &value) {
std::memcpy(dest, value.c_str(), value.size()+1);
return value.size() + 1;
}
- string _deserializeString(const char **pos) {
+ string deserializeString_(const char **pos) {
size_t length = strlen(*pos);
string value(*pos, length);
*pos += length + 1;
return value;
}
- unsigned int _serializeBlockId(uint8_t *dest, const BlockId &blockId) {
+ unsigned int serializeBlockId_(uint8_t *dest, const BlockId &blockId) {
blockId.ToBinary(dest);
return blockId.BINARY_LENGTH;
}
- BlockId _deserializeBlockId(const char **pos) {
+ BlockId deserializeBlockId_(const char **pos) {
BlockId blockId = BlockId::FromBinary(*pos);
*pos += BlockId::BINARY_LENGTH;
return blockId;
@@ -75,35 +75,35 @@ namespace cryfs {
_mode.hasDirFlag()) + ", " + std::to_string(_mode.hasSymlinkFlag()) + ", " + std::to_string(static_cast<uint8_t>(_type))
);
unsigned int offset = 0;
- offset += _serialize<uint8_t>(dest + offset, static_cast<uint8_t>(_type));
- offset += _serialize<uint32_t>(dest + offset, _mode.value());
- offset += _serialize<uint32_t>(dest + offset, _uid.value());
- offset += _serialize<uint32_t>(dest + offset, _gid.value());
- offset += _serializeTimeValue(dest + offset, _lastAccessTime);
- offset += _serializeTimeValue(dest + offset, _lastModificationTime);
- offset += _serializeTimeValue(dest + offset, _lastMetadataChangeTime);
- offset += _serializeString(dest + offset, _name);
- offset += _serializeBlockId(dest + offset, _blockId);
+ offset += serialize_<uint8_t>(dest + offset, static_cast<uint8_t>(_type));
+ offset += serialize_<uint32_t>(dest + offset, _mode.value());
+ offset += serialize_<uint32_t>(dest + offset, _uid.value());
+ offset += serialize_<uint32_t>(dest + offset, _gid.value());
+ offset += serializeTimeValue_(dest + offset, _lastAccessTime);
+ offset += serializeTimeValue_(dest + offset, _lastModificationTime);
+ offset += serializeTimeValue_(dest + offset, _lastMetadataChangeTime);
+ offset += serializeString_(dest + offset, _name);
+ offset += serializeBlockId_(dest + offset, _blockId);
ASSERT(offset == serializedSize(), "Didn't write correct number of elements");
}
const char *DirEntry::deserializeAndAddToVector(const char *pos, vector<DirEntry> *result) {
- fspp::Dir::EntryType type = static_cast<fspp::Dir::EntryType>(_deserialize<uint8_t>(&pos));
- fspp::mode_t mode = fspp::mode_t(_deserialize<uint32_t>(&pos));
- fspp::uid_t uid = fspp::uid_t(_deserialize<uint32_t>(&pos));
- fspp::gid_t gid = fspp::gid_t(_deserialize<uint32_t>(&pos));
- timespec lastAccessTime = _deserializeTimeValue(&pos);
- timespec lastModificationTime = _deserializeTimeValue(&pos);
- timespec lastMetadataChangeTime = _deserializeTimeValue(&pos);
- string name = _deserializeString(&pos);
- BlockId blockId = _deserializeBlockId(&pos);
+ fspp::Dir::EntryType type = static_cast<fspp::Dir::EntryType>(deserialize_<uint8_t>(&pos));
+ fspp::mode_t mode = fspp::mode_t(deserialize_<uint32_t>(&pos));
+ fspp::uid_t uid = fspp::uid_t(deserialize_<uint32_t>(&pos));
+ fspp::gid_t gid = fspp::gid_t(deserialize_<uint32_t>(&pos));
+ timespec lastAccessTime = deserializeTimeValue_(&pos);
+ timespec lastModificationTime = deserializeTimeValue_(&pos);
+ timespec lastMetadataChangeTime = deserializeTimeValue_(&pos);
+ string name = deserializeString_(&pos);
+ BlockId blockId = deserializeBlockId_(&pos);
result->emplace_back(type, name, blockId, mode, uid, gid, lastAccessTime, lastModificationTime, lastMetadataChangeTime);
return pos;
}
size_t DirEntry::serializedSize() const {
- return 1 + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + 3*_serializedTimeValueSize() + (
+ return 1 + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + 3*serializedTimeValueSize_() + (
_name.size() + 1) + _blockId.BINARY_LENGTH;
}
}
--- a/src/cryfs/localstate/LocalStateMetadata.cpp
+++ b/src/cryfs/localstate/LocalStateMetadata.cpp
@@ -30,10 +30,10 @@ LocalStateMetadata::LocalStateMetadata(uint32_t myClientId, Hash encryptionKeyHa
LocalStateMetadata LocalStateMetadata::loadOrGenerate(const bf::path &statePath, const Data& encryptionKey, bool allowReplacedFilesystem) {
auto metadataFile = statePath / "metadata";
- auto loaded = _load(metadataFile);
+ auto loaded = load_(metadataFile);
if (loaded == none) {
// If it couldn't be loaded, generate a new client id.
- return _generate(metadataFile, encryptionKey);
+ return generate_(metadataFile, encryptionKey);
}
if (!allowReplacedFilesystem && loaded->_encryptionKeyHash.digest != cpputils::hash::hash(encryptionKey, loaded->_encryptionKeyHash.salt).digest) {
@@ -42,22 +42,22 @@ LocalStateMetadata LocalStateMetadata::loadOrGenerate(const bf::path &statePath,
return *loaded;
}
-optional<LocalStateMetadata> LocalStateMetadata::_load(const bf::path &metadataFilePath) {
+optional<LocalStateMetadata> LocalStateMetadata::load_(const bf::path &metadataFilePath) {
ifstream file(metadataFilePath.string());
if (!file.good()) {
// State file doesn't exist
return none;
}
- return _deserialize(file);
+ return deserialize_(file);
}
-void LocalStateMetadata::_save(const bf::path &metadataFilePath) const {
+void LocalStateMetadata::save_(const bf::path &metadataFilePath) const {
ofstream file(metadataFilePath.string(), std::ios::trunc);
- _serialize(file);
+ serialize_(file);
}
namespace {
-uint32_t _generateClientId() {
+uint32_t generateClientId_() {
uint32_t result;
do {
result = cpputils::deserialize<uint32_t>(Random::PseudoRandom().getFixedSize<sizeof(uint32_t)>().data());
@@ -82,8 +82,8 @@ optional<uint32_t> _tryLoadClientIdFromLegacyFile(const bf::path &metadataFilePa
#endif
}
-LocalStateMetadata LocalStateMetadata::_generate(const bf::path &metadataFilePath, const Data& encryptionKey) {
- uint32_t myClientId = _generateClientId();
+LocalStateMetadata LocalStateMetadata::generate_(const bf::path &metadataFilePath, const Data& encryptionKey) {
+ uint32_t myClientId = generateClientId_();
#ifndef CRYFS_NO_COMPATIBILITY
// In the old format, this was stored in a "myClientId" file. If that file exists, load it from there.
optional<uint32_t> legacy = _tryLoadClientIdFromLegacyFile(metadataFilePath);
@@ -93,11 +93,11 @@ LocalStateMetadata LocalStateMetadata::_generate(const bf::path &metadataFilePat
#endif
LocalStateMetadata result(myClientId, cpputils::hash::hash(encryptionKey, cpputils::hash::generateSalt()));
- result._save(metadataFilePath);
+ result.save_(metadataFilePath);
return result;
}
-void LocalStateMetadata::_serialize(ostream& stream) const {
+void LocalStateMetadata::serialize_(ostream& stream) const {
ptree pt;
pt.put<uint32_t>("myClientId", myClientId());
pt.put<string>("encryptionKey.salt", _encryptionKeyHash.salt.ToString());
@@ -106,7 +106,7 @@ void LocalStateMetadata::_serialize(ostream& stream) const {
write_json(stream, pt);
}
-LocalStateMetadata LocalStateMetadata::_deserialize(istream& stream) {
+LocalStateMetadata LocalStateMetadata::deserialize_(istream& stream) {
try {
ptree pt;
read_json(stream, pt);
--- a/src/cryfs/localstate/LocalStateMetadata.h
+++ b/src/cryfs/localstate/LocalStateMetadata.h
@@ -20,11 +20,11 @@ class LocalStateMetadata final {
const uint32_t _myClientId;
const cpputils::hash::Hash _encryptionKeyHash;
- static boost::optional<LocalStateMetadata> _load(const boost::filesystem::path &metadataFilePath);
- static LocalStateMetadata _deserialize(std::istream& stream);
- static LocalStateMetadata _generate(const boost::filesystem::path &metadataFilePath, const cpputils::Data& encryptionKey);
- void _save(const boost::filesystem::path &metadataFilePath) const;
- void _serialize(std::ostream& stream) const;
+ static boost::optional<LocalStateMetadata> load_(const boost::filesystem::path &metadataFilePath);
+ static LocalStateMetadata deserialize_(std::istream& stream);
+ static LocalStateMetadata generate_(const boost::filesystem::path &metadataFilePath, const cpputils::Data& encryptionKey);
+ void save_(const boost::filesystem::path &metadataFilePath) const;
+ void serialize_(std::ostream& stream) const;
LocalStateMetadata(uint32_t myClientId, cpputils::hash::Hash encryptionKey);
};
@@ -1,11 +0,0 @@
https://bugs.gentoo.org/890847
--- a/src/cpp-utils/thread/LeftRight.h
+++ b/src/cpp-utils/thread/LeftRight.h
@@ -2,6 +2,7 @@
#include <functional>
#include <mutex>
#include <thread>
+#include <stdexcept>
#include <cpp-utils/macros.h>
#include <array>