diff --git a/src/client/hooks.cpp b/src/client/hooks.cpp index 004a60f4f258afb09979ea79a2854c6834c24f6c..7fdabf78faabc0f1c9880dd1c284ffea804857fd 100644 --- a/src/client/hooks.cpp +++ b/src/client/hooks.cpp @@ -203,11 +203,6 @@ hook_fstatat(int dirfd, const char* cpath, struct stat* buf, int flags) { LOG(DEBUG, "{}() called with path: \"{}\", fd: {}, buf: {}, flags: {}", __func__, cpath, dirfd, fmt::ptr(buf), flags); - if(flags & AT_EMPTY_PATH) { - LOG(ERROR, "{}() AT_EMPTY_PATH flag not supported", __func__); - return -ENOTSUP; - } - std::string resolved; auto rstatus = CTX->relativize_fd_path(dirfd, cpath, resolved); switch(rstatus) { diff --git a/src/client/preload_context.cpp b/src/client/preload_context.cpp index f076360b345cfd41aa970aea5bd8564d90ab6e90..f31d6f7cdf910d105de79429fe5d3f9fc1c78b4f 100644 --- a/src/client/preload_context.cpp +++ b/src/client/preload_context.cpp @@ -199,7 +199,7 @@ PreloadContext::relativize_fd_path(int dirfd, const char* raw_path, std::string path; - if(raw_path[0] != gkfs::path::separator) { + if(raw_path != nullptr && raw_path[0] != gkfs::path::separator) { // path is relative if(dirfd == AT_FDCWD) { // path is relative to cwd @@ -243,7 +243,7 @@ PreloadContext::relativize_path(const char* raw_path, std::string path; - if(raw_path[0] != gkfs::path::separator) { + if(raw_path != nullptr && raw_path[0] != gkfs::path::separator) { /* Path is not absolute, we need to prepend CWD; * First reserve enough space to minimize memory copy */ @@ -251,6 +251,7 @@ PreloadContext::relativize_path(const char* raw_path, } else { path = raw_path; } + return gkfs::path::resolve(path, relative_path, resolve_last_link); }