lkml.org 
[lkml]   [1997]   [Jul]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectPATCH: under pre-patch-2.1.45, open("xxx",O_WRONLY|O_CREAT,0444) gives EACCES
From(Kevin Buhr)
Date09 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]
\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2008