Re: patch: ext2 flags handling

Juan Carlos Castro y Castro (jcastro@appi.com.br)
Fri, 03 Sep 1999 14:53:46 -0300


This is a multi-part message in MIME format.
--------------B7C53F4AE0480E1BD93B0A73
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

"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----------------

--------------B7C53F4AE0480E1BD93B0A73
Content-Type: text/x-vcard; charset=us-ascii;
name="jcastro.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Juan Carlos Castro y Castro
Content-Disposition: attachment;
filename="jcastro.vcf"

begin:vcard
n:Castro;Juan
tel;work:55 (21) 540-9100
x-mozilla-html:FALSE
url:http://www.appi.com.br/jcastro
org:APPI Informática Ltda.;Desenvolvimento
adr:;;Av. Ataulfo de Paiva, 135/1410;Rio de Janeiro;RJ;22449-900;Brazil
version:2.1
email;internet:jcastro@appi.com.br
title:Consultor
note:One man alone cannot fight the future. USE LINUX!
x-mozilla-cpt:;28896
fn:Juan Carlos Castro y Castro
end:vcard

--------------B7C53F4AE0480E1BD93B0A73--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/