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 06:44:52AM -0700, Arthur Williams wrote:

> util-linux explicitly
> acknowledges it. From their sys-utils/flock.c: "Linux doesn't like O_CREAT
> on a directory, even
> though it should be a no-op;"

So does *BSD, while we are at it.  Out of curiosity - which more or less
recent Unices do *not* behave that way?

> And to their point, the man page for open
> does seem to imply that:
>      O_CREAT
>               If pathname does not exist, create it as a regular file.
> 
> But I can also see how it isn't completely clear since it doesn't
> explicitly state what happens when
> the file already exists. If this patch is to be rejected, would it be best
> to
> update the man pages/docs to explain the effect and justification for the
> current behavior?

*shrug*

Quote POSIX in errors section, perhaps?



[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