immulink changed from bit 15 to bit 27 in 2.6.x.
static vector<EXCLDIR> excldirs;
-static int ext2flags = EXT2_IMMUTABLE_FILE_FL | EXT2_IMMUTABLE_LINK_FL;
+static int ext2flags = EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL;
static struct {
int nblink;
int nbcopy;
}else if (strcmp(arg,"--noflags")==0){
ext2flags = 0;
}else if (strcmp(arg,"--immutable")==0){
- ext2flags |= EXT2_IMMUTABLE_FILE_FL;
+ ext2flags |= EXT2_IMMUTABLE_FL;
}else if (strcmp(arg,"--immutable-mayunlink")==0){
- ext2flags |= EXT2_IMMUTABLE_LINK_FL;
+ ext2flags |= EXT2_IUNLINK_FL;
}else if (strcmp(arg,"--excldir")==0){
i++;
excldirs.push_back (EXCLDIR(argv[i]));
static bool undo = false;
-static int ext2flags = EXT2_IMMUTABLE_FILE_FL | EXT2_IMMUTABLE_LINK_FL;
+static int ext2flags = EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL;
struct EXCLDIR{
string prefix;
int len;
}else if (strcmp(arg,"--noflags")==0){
ext2flags = 0;
}else if (strcmp(arg,"--immutable")==0){
- ext2flags |= EXT2_IMMUTABLE_FILE_FL;
+ ext2flags |= EXT2_IMMUTABLE_FL;
}else if (strcmp(arg,"--immutable-mayunlink")==0){
- ext2flags |= EXT2_IMMUTABLE_LINK_FL;
+ ext2flags |= EXT2_IUNLINK_FL;
}else if (strcmp(arg,"--excldir")==0){
i++;
//excldirs[excldirs.size()] = EXCLDIR(argv[i]);
extern bool testmode;
// 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_IMMUTABLE_FL
+#define EXT2_IMMUTABLE_FL 0x00000010
+#endif
+
+#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