Verified Commit c2e6dda4 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

bugfix: unlinkat couldn't remove link

when unlinkat was called with a link we were removing the target and not
the link itself
parent c9731c65
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ int hook_unlinkat(int dirfd, const char * cpath, int flags) {
    }

    std::string resolved;
    auto rstatus = CTX->relativize_fd_path(dirfd, cpath, resolved);
    auto rstatus = CTX->relativize_fd_path(dirfd, cpath, resolved, false);
    switch(rstatus) {
        case RelativizeStatus::fd_unknown:
            return syscall_no_intercept(SYS_unlinkat, dirfd, cpath, flags);