Verified Commit 28db5904 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Daemon: root directory must be relative

Now that we use only relative path on daemon side,
also the initial creation of the root directory should be
use a relative path.
parent 53dd8d27
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ bool init_environment() {
    ADAFS_DATA->blocks_state(MDATA_USE_BLOCKS);
    // Create metadentry for root directory
    try {
        create_metadentry(ADAFS_DATA->mountdir(), S_IFDIR | 777);
        create_metadentry("/", S_IFDIR | 777);
    } catch (const std::exception& e ) {
        ADAFS_DATA->spdlogger()->error("{}() Unable to write root metadentry to KV store: {}", __func__, e.what());
        return false;
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ bool is_absolute_path(const std::string& path) {
}

bool has_trailing_slash(const std::string& path) {
    return (path.back() == PSP);
    return (path.size() > 1) && (path.back() == PSP);
}

/* Make an absolute path relative to a root path