Compare commits
9 Commits
v2.0.6-rel
...
v2.1.0-rc-
Author | SHA1 | Date | |
---|---|---|---|
4cf339cfc4 | |||
6fe23f270a | |||
c85fe76a48 | |||
4508b6d908 | |||
c74a70ce13 | |||
f5e88e44bf | |||
f11f92ba55 | |||
14d0173bd3 | |||
5b56c73528 |
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## v2.1.0-rc
|
||||
|
||||
### Issues
|
||||
|
||||
### Changes from v2.0.6-release
|
||||
|
||||
* Fixed `.` and `..` incorrectly being reported as files in remote Linux mounts
|
||||
|
||||
## v2.0.6-release
|
||||
|
||||
### Issues
|
||||
|
@@ -453,7 +453,7 @@ in the `dist/` directory
|
||||
* [spdlog](https://github.com/gabime/spdlog)
|
||||
* [SQLite](https://www.sqlite.org)
|
||||
* [stduuid](https://github.com/mariusbancila/stduuid)
|
||||
* [Storj](https://storj.io/)
|
||||
* [Storj](https://www.storj.io/)
|
||||
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
||||
* [zlib](https://zlib.net/)
|
||||
|
||||
|
@@ -9,10 +9,10 @@ PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
|
||||
PROJECT_DESC="Mount utility for Sia and S3"
|
||||
|
||||
PROJECT_MAJOR_VERSION=2
|
||||
PROJECT_MINOR_VERSION=0
|
||||
PROJECT_REVISION_VERSION=6
|
||||
PROJECT_RELEASE_NUM=1
|
||||
PROJECT_RELEASE_ITER=release
|
||||
PROJECT_MINOR_VERSION=1
|
||||
PROJECT_REVISION_VERSION=0
|
||||
PROJECT_RELEASE_NUM=0
|
||||
PROJECT_RELEASE_ITER=rc
|
||||
|
||||
PROJECT_APP_LIST=(${PROJECT_NAME})
|
||||
|
||||
|
@@ -19,6 +19,7 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#include <memory>
|
||||
#if !defined(_WIN32)
|
||||
|
||||
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
||||
@@ -102,7 +103,7 @@ void remote_fuse_drive::destroy_impl(void *ptr) {
|
||||
}
|
||||
|
||||
if (remote_instance_) {
|
||||
const auto res = remote_instance_->fuse_destroy();
|
||||
auto res = remote_instance_->fuse_destroy();
|
||||
if (res != 0) {
|
||||
utils::error::raise_error(function_name,
|
||||
"remote fuse_destroy() failed|err|" +
|
||||
@@ -128,8 +129,8 @@ auto remote_fuse_drive::fgetattr_impl(std::string api_path,
|
||||
remote::stat r_stat{};
|
||||
auto directory = false;
|
||||
|
||||
const auto res = remote_instance_->fuse_fgetattr(api_path.c_str(), r_stat,
|
||||
directory, f_info->fh);
|
||||
auto res = remote_instance_->fuse_fgetattr(api_path.c_str(), r_stat,
|
||||
directory, f_info->fh);
|
||||
if (res == 0) {
|
||||
populate_stat(r_stat, directory, *unix_st);
|
||||
}
|
||||
@@ -191,7 +192,7 @@ auto remote_fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st)
|
||||
bool directory = false;
|
||||
remote::stat r_stat{};
|
||||
|
||||
const auto res =
|
||||
auto res =
|
||||
remote_instance_->fuse_getattr(api_path.c_str(), r_stat, directory);
|
||||
if (res == 0) {
|
||||
populate_stat(r_stat, directory, *unix_st);
|
||||
@@ -208,9 +209,9 @@ api_error remote_fuse_drive::getxtimes_impl(std::string api_path,
|
||||
return utils::to_api_error(-EFAULT);
|
||||
}
|
||||
|
||||
remote::file_time repertory_bkuptime = 0u;
|
||||
remote::file_time repertory_crtime = 0u;
|
||||
const auto res = remote_instance_->fuse_getxtimes(
|
||||
remote::file_time repertory_bkuptime{0U};
|
||||
remote::file_time repertory_crtime{0U};
|
||||
auto res = remote_instance_->fuse_getxtimes(
|
||||
api_path.c_str(), repertory_bkuptime, repertory_crtime);
|
||||
if (res == 0) {
|
||||
bkuptime->tv_nsec =
|
||||
@@ -381,7 +382,7 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
||||
fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset,
|
||||
struct fuse_file_info *f_info,
|
||||
fuse_readdir_flags /*flags*/)
|
||||
fuse_readdir_flags /* flags */)
|
||||
-> api_error {
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
||||
@@ -390,20 +391,42 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
||||
struct fuse_file_info *f_info)
|
||||
-> api_error {
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
|
||||
std::string item_path;
|
||||
int res = 0;
|
||||
int res{0};
|
||||
while ((res = remote_instance_->fuse_readdir(
|
||||
api_path.c_str(), static_cast<remote::file_offset>(offset),
|
||||
f_info->fh, item_path)) == 0) {
|
||||
if ((item_path != ".") && (item_path != "..")) {
|
||||
std::unique_ptr<struct stat> p_stat{nullptr};
|
||||
int stat_res{0};
|
||||
if ((item_path == ".") || (item_path == "..")) {
|
||||
p_stat = std::make_unique<struct stat>();
|
||||
std::memset(p_stat.get(), 0, sizeof(struct stat));
|
||||
if (item_path == ".") {
|
||||
stat_res =
|
||||
stat(utils::path::combine(get_mount_location(), {api_path}).c_str(),
|
||||
p_stat.get());
|
||||
} else {
|
||||
stat_res =
|
||||
stat(utils::path::get_parent_path(
|
||||
utils::path::combine(get_mount_location(), {api_path}))
|
||||
.c_str(),
|
||||
p_stat.get());
|
||||
}
|
||||
|
||||
if (stat_res != 0) {
|
||||
res = stat_res;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
item_path = utils::path::strip_to_file_name(item_path);
|
||||
}
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
if (fuse_fill_dir(buf, item_path.c_str(), nullptr, ++offset,
|
||||
static_cast<fuse_fill_dir_flags>(0)) != 0) {
|
||||
if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset,
|
||||
FUSE_FILL_DIR_PLUS) != 0) {
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
if (fuse_fill_dir(buf, item_path.c_str(), nullptr, ++offset) != 0) {
|
||||
if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset) != 0) {
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
break;
|
||||
}
|
||||
@@ -592,7 +615,7 @@ auto remote_fuse_drive::write_impl(std::string api_path, const char *buffer,
|
||||
size_t write_size, off_t write_offset,
|
||||
struct fuse_file_info *f_info,
|
||||
std::size_t &bytes_written) -> api_error {
|
||||
const auto res = remote_instance_->fuse_write(
|
||||
auto res = remote_instance_->fuse_write(
|
||||
api_path.c_str(), buffer, write_size,
|
||||
static_cast<remote::file_offset>(write_offset), f_info->fh);
|
||||
if (res >= 0) {
|
||||
|
@@ -50,8 +50,17 @@
|
||||
#endif // defined(PROJECT_ENABLE_CURL)
|
||||
|
||||
namespace {
|
||||
#if defined(PROJECT_ENABLE_CURL)
|
||||
bool curl_initialized{false};
|
||||
#endif // defined(PROJECT_ENABLE_CURL)
|
||||
|
||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||
bool spdlog_initialized{false};
|
||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||
|
||||
#if defined(PROJECT_ENABLE_SQLITE)
|
||||
bool sqlite3_initialized{false};
|
||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||
} // namespace
|
||||
|
||||
namespace repertory {
|
||||
@@ -72,9 +81,12 @@ auto project_initialize() -> bool {
|
||||
}
|
||||
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
||||
|
||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||
spdlog::drop_all();
|
||||
spdlog::flush_every(std::chrono::seconds(5));
|
||||
spdlog::set_pattern("%Y-%m-%d|%T.%e|%^%l%$|%v");
|
||||
spdlog_initialized = true;
|
||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||
|
||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||
if (sodium_init() == -1) {
|
||||
@@ -116,15 +128,22 @@ void project_cleanup() {
|
||||
#if defined(PROJECT_ENABLE_CURL)
|
||||
if (curl_initialized) {
|
||||
curl_shared::cleanup();
|
||||
curl_initialized = false;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_CURL)
|
||||
|
||||
#if defined(PROJECT_ENABLE_SQLITE)
|
||||
if (sqlite3_initialized) {
|
||||
sqlite3_shutdown();
|
||||
sqlite3_initialized = false;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||
|
||||
spdlog::shutdown();
|
||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||
if (spdlog_initialized) {
|
||||
spdlog::shutdown();
|
||||
spdlog_initialized = false;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||
}
|
||||
} // namespace repertory
|
||||
|
@@ -37,7 +37,6 @@ auto main(int argc, char **argv) -> int {
|
||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
|
||||
if (not repertory::project_initialize()) {
|
||||
std::cerr << "fatal: failed to initialize repertory" << std::endl;
|
||||
repertory::project_cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^5.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
Reference in New Issue
Block a user