lkml.org 
[lkml]   [1999]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: patch: ext2 flags handling
"Stephen C. Tweedie" wrote:

> Hi,
>
> On Fri, 3 Sep 1999 17:13:56 +0200, Jes Sorensen <Jes.Sorensen@cern.ch>
> said:
>
> > Hi
> > There is a bug in the ext2 flags handling it seems. The xor trick it
> > uses doesn't work since ATTR_FLAG_APPEND != EXT_APPEND_FL and
> > ATTR_FLAG_IMMUTABLE != EXT2_IMMUTABLE_FL.
>
> > This one is actually from Andreas (credit where credit is due).
>
> Required for 2.2.11+ as well.

Use this instead for 2.2.12 (didn't test on 2.2.11) - only line numbers change. Either
that or edit by hand.

-------------cut here----------------
--- linux-2.2.12-orig/fs/ext2/inode.c Mon Aug 9 16:04:57 1999
+++ linux/fs/ext2/inode.c Fri Sep 3 14:42:43 1999
@@ -709,10 +709,11 @@
retval = -EPERM;
if (iattr->ia_valid & ATTR_ATTR_FLAG)
{
- if((!(iattr->ia_attr_flags & ATTR_FLAG_APPEND) !=
- !(inode->u.ext2_i.i_flags & EXT2_APPEND_FL)) ||
- (!(iattr->ia_attr_flags & ATTR_FLAG_IMMUTABLE) !=
- !(inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL))) {
+ if (iattr->ia_valid & ATTR_ATTR_FLAG &&
+ ((!(iattr->ia_attr_flags & ATTR_FLAG_APPEND) !=
+ !(inode->u.ext2_i.i_flags & EXT2_APPEND_FL)) ||
+ (!(iattr->ia_attr_flags & ATTR_FLAG_IMMUTABLE) !=
+ !(inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)))) {
if (!capable(CAP_LINUX_IMMUTABLE))
goto out;
}
-------------cut here----------------
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.041 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site