From db6107d643eabdcf0da4aad68abff8145a98369b Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Tue, 23 Nov 2004 14:54:35 +0000 Subject: [PATCH] PL3118 and PL3131 fix: provide new option "--barrier" to showattr and setattr to set the barrier bit. Also use the correct ext2 attribute bits if possible; immulink changed from bit 15 to bit 27 in 2.6.x. Also provide bit clearing options such as those provided in 0.30.196 (i.e. "--!immutable" or "--~immutable", remember to backslash the ! and ~ characters on the command line). This program sucks. The 0.30.196 version isn't much better. We should just hack e2fsprogs chattr. --- src/showattr.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/showattr.c b/src/showattr.c index c9d1055..1d7783e 100644 --- a/src/showattr.c +++ b/src/showattr.c @@ -33,9 +33,13 @@ // Patch to help compile this utility on unpatched kernel source -#ifndef EXT2_IMMUTABLE_FILE_FL - #define EXT2_IMMUTABLE_FILE_FL 0x00000010 - #define EXT2_IMMUTABLE_LINK_FL 0x00008000 +#ifndef EXT2_IUNLINK_FL +/* Set both bits for backward compatibility */ +#define EXT2_IUNLINK_FL 0x08008000 +#endif + +#ifndef EXT2_BARRIER_FL +#define EXT2_BARRIER_FL 0x04000000 #endif /* @@ -108,22 +112,36 @@ int main (int argc, char *argv[]) } } }else if (strstr(argv[0],"setattr")!=NULL){ - long flags = 0; + long flags, add_flags = 0, remove_flags = 0; int i; ret = 0; for (i=1; i