Re: ! O_CREAT

From: Alexander Viro (viro@math.psu.edu)
Date: Fri May 12 2000 - 03:36:22 EST


On Fri, 12 May 2000, Rogier Wolff wrote:

>
> Hi,
>
> linux-2.3.99pre7-something doesn't provide the right behaviour when a
> file is opened without O_CREAT: It creates a file even if you didn't
> ask for it. (I have an application that normally complains that its
> output file doesn't exist, and I usually run it without first creating
> the output file, just to make sure I'm not overwriting anything...)

Testcase? I mean, line from strace output. It should never happen -
open_namei() explicitly goes around the creation code without O_CREAT.
        if (!(flag & O_CREAT)) {
                if (path_init(pathname, lookup_flags(flag), nd))
                        error = path_walk(pathname, nd);
                if (error)
                        return error;

                dentry = nd->dentry;
        } else {
                [... possibly create the thing...]
        }
        [... common path - no attempts to create anything]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:20 EST