lkml.org 
[lkml]   [1997]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectPATCH: under pre-patch-2.1.45, open("xxx",O_WRONLY|O_CREAT,0444) gives EACCES
From
Date
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]
\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.068 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site