> > Current behavior is inconsistent with documentation:
> > open(..., O_DIRECTORY|O_CREAT) succeeds if file didn't exist, and
> > returned descriptor does not refer to a directory.
> >
> > No other error value quite fits this case:
> >
> > ENOTDIR - the file doesn't exist, so this is slightly misleading
> > ENOENT - yes, but we asked for an O_CREAT so why wasn't it created
> >
> > But EINVAL - invalid combination of flags, is quite good IMO.
> >
>
> We could be a bit screwed here. If there are any apps out there which are
> using this combination, we just broke them. Essentially the patch is
> assuming that nobody is currently using O_CREAT|O_DIRECTORY, but one day in
> the future someone will do that.
Well yes. But I don't think anybody is using it, and if so they are
clearly breaking the rules in man open(2):
O_DIRECTORY
If pathname is not a directory, cause the open to fail. This
flag is Linux‐specific, and was added in kernel version 2.1.126,
to avoid denial‐of‐service problems if opendir(3) is called on a
FIFO or tape device, but should not be used outside of the
implementation of opendir.
So if someone uses this outside of opendir() and uses it to create a
non-directory, I think they deserve to be screwed.
Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|