Re: [PATCH] fs: Allow open with O_CREAT to succeed if existing dir is specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 19, 2021 at 12:42:14PM +0000, Al Viro wrote:
> On Sat, Jun 19, 2021 at 06:01:48AM -0500, Arthur Williams wrote:
> > Make opening a file with the O_CREAT flag a no-op if the specified file
> > exists even if it exists as a directory. Allows userspace commands, like
> > flock, to open a file and create it if it doesn't exist instead of
> > having to parse errno.
> 
> Not going to happen.  It's a user-visible behaviour, consistent between
> all kinds of Unices, consistent with POSIX and it does make sense.
> 
> NAK.

Agreed.  POSIX states:

[EISDIR]
    The named file is a directory and oflag includes O_WRONLY or O_RDWR, or includes O_CREAT without O_DIRECTORY.

so I would say the POSIX committee considered this situation and
explicitly did not want it to succeed.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux