Messages in this thread |  | | | Subject | PATCH: under pre-patch-2.1.45, open("xxx",O_WRONLY|O_CREAT,0444) gives EACCES | | From | (Kevin Buhr) | | Date | 09 Jul 1997 17:24:03 -0500 |
Linus:
Under "pre-patch-2.1.45" (and vanilla 2.1.44), the "open_namei" code
in "linux/fs/namei.c" is broken for O_CREAT-ing files. If a new,
regular file is actually created, the current code continues to do a
bunch of pointless checks, including an overzealous permission check.
As a result, a call like:
open("zork", O_WRONLY|O_CREAT, 0444);
fails with an EACCES error (because the code mistakenly thinks that an
*existing* file without write permissions is being opened for
writing).
In particular, this breaks my "procmail"'s locking scheme.
The enclosed patch fixes the problem by short-circuiting the
unnecessary checks, the way the old "namei.c" did.
Kevin <buhr@stat.wisc.edu>
[unhandled content-type:application/octet-stream] |  |