The chattr command cannot add the -s attribute to the file normally. When you
enter "chattr +s testfile",
the content of --help will be displayed directly.
The reason is that commit 83dff7f43154cd41e4d2e5831060a2d2ddc6596e ("lsattr:
support more ext2 flags")
changed the enumeration variable order, resulting in an error in the offset
obtained in e2fs_lib.h.
Solution 1: Change the offset
The chattr command cannot add the -s attribute to the file normally.
Fixes: 83dff7f43154cd41e4d2e5831060a2d2ddc6596e ("lsattr: support more ext2
flags")
Signed-off-by: ITcxk <[email protected]>
---
e2fsprogs/e2fs_lib.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/e2fsprogs/e2fs_lib.h b/e2fsprogs/e2fs_lib.h
index bab447a94..c6b90d389 100644
--- a/e2fsprogs/e2fs_lib.h
+++ b/e2fsprogs/e2fs_lib.h
@@ -21,11 +21,11 @@ extern const char e2attr_flags_sname[];
/* If you plan to ENABLE_COMPRESSION, see e2fs_lib.c and chattr.c - */
/* make sure that chattr doesn't accept bad options! */
#ifdef ENABLE_COMPRESSION
-#define e2attr_flags_value_chattr (&e2attr_flags_value[5])
-#define e2attr_flags_sname_chattr (&e2attr_flags_sname[5])
+#define e2attr_flags_value_chattr (&e2attr_flags_value[3])
+#define e2attr_flags_sname_chattr (&e2attr_flags_sname[3])
#else
-#define e2attr_flags_value_chattr (&e2attr_flags_value[1])
-#define e2attr_flags_sname_chattr (&e2attr_flags_sname[1])
+#define e2attr_flags_value_chattr (&e2attr_flags_value[0])
+#define e2attr_flags_sname_chattr (&e2attr_flags_sname[0])
#endif
POP_SAVED_FUNCTION_VISIBILITY
--
2.37.0 (Apple Git-136)
Solution 2: Replace the devil's numbers
The chattr command cannot add the -s attribute to the file normally.
Fixes: 83dff7f43154cd41e4d2e5831060a2d2ddc6596e ("lsattr: support more ext2
flags")
Signed-off-by: ITcxk <[email protected]>
---
e2fsprogs/e2fs_lib.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/e2fsprogs/e2fs_lib.h b/e2fsprogs/e2fs_lib.h
index bab447a94..c6b90d389 100644
--- a/e2fsprogs/e2fs_lib.h
+++ b/e2fsprogs/e2fs_lib.h
@@ -21,11 +21,11 @@ extern const char e2attr_flags_sname[];
/* If you plan to ENABLE_COMPRESSION, see e2fs_lib.c and chattr.c - */
/* make sure that chattr doesn't accept bad options! */
#ifdef ENABLE_COMPRESSION
-#define e2attr_flags_value_chattr (&e2attr_flags_value[5])
-#define e2attr_flags_sname_chattr (&e2attr_flags_sname[5])
+#define e2attr_flags_value_chattr (&EXT2_SECRM_FL)
+#define e2attr_flags_sname_chattr (&EXT2_SECRM_FL)
#else
-#define e2attr_flags_value_chattr (&e2attr_flags_value[1])
-#define e2attr_flags_sname_chattr (&e2attr_flags_sname[1])
+#define e2attr_flags_value_chattr (&EXT2_SECRM_FL)
+#define e2attr_flags_sname_chattr (&EXT2_SECRM_FL)
#endif
POP_SAVED_FUNCTION_VISIBILITY
--
2.37.0_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox