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

we don't support open call with O_DIRECTORY

In the case the open call has been called with the O_DIRECTORY flag the
ENOTSUP (Operation not supported) will be returned.
parent be1baa34
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -13,6 +13,13 @@ int open(const char* path, int flags, ...) {
    init_passthrough_if_needed();
    CTX->log()->trace("{}() called with path {}", __func__, path);
    mode_t mode = 0;

    if(flags & O_DIRECTORY){
        CTX->log()->error("{}() called with `O_DIRECTORY` flag on {}", __func__, path);
        errno = ENOTSUP;
        return -1;
    }

    if (flags & O_CREAT) {
        va_list vl;
        va_start(vl, flags);