History

fanotify: deprecate uapi FAN_ALL_* constants

We do not want to add new bits to the FAN_ALL_* uapi constants because they have been exposed to userspace. If there are programs out there using these constants, those programs could break if re-compiled with modified FAN_ALL_* constants and run on an old kernel. We deprecate the uapi constants FAN_ALL_* and define new FANOTIFY_* constants for internal use to replace them. New feature bits will be added only to the new constants.

Amir Goldstein committed 8 years ago

Commit 23c9dee1 parent a72fd225 files · +71 −24Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/fanotify.h+9−9
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #define FAN_CLASS_NOTIF 0x00000000
3232 #define FAN_CLASS_CONTENT 0x00000004
3333 #define FAN_CLASS_PRE_CONTENT 0x00000008
34+
35+/* Deprecated - do not use this in programs and do not add new flags here! */
3436 #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
3537 FAN_CLASS_PRE_CONTENT)
3638
@@ -38,6 +40,7 @@ · 1 unmodified line
3840 #define FAN_UNLIMITED_MARKS 0x00000020
3941 #define FAN_ENABLE_AUDIT 0x00000040
4042
43+/* Deprecated - do not use this in programs and do not add new flags here! */
4144 #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
4245 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
4346 FAN_UNLIMITED_MARKS)
@@ -57,23 +60,18 @@ · 13 unmodified lines
5760 #define FAN_MARK_INODE 0x00000000
5861 #define FAN_MARK_MOUNT 0x00000010
5962 #define FAN_MARK_FILESYSTEM 0x00000100
60−#define FAN_MARK_TYPE_MASK (FAN_MARK_INODE | FAN_MARK_MOUNT | \
61− FAN_MARK_FILESYSTEM)
6263
64+/* Deprecated - do not use this in programs and do not add new flags here! */
6365 #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
6466 FAN_MARK_REMOVE |\
6567 FAN_MARK_DONT_FOLLOW |\
6668 FAN_MARK_ONLYDIR |\
69+ FAN_MARK_MOUNT |\
6770 FAN_MARK_IGNORED_MASK |\
6871 FAN_MARK_IGNORED_SURV_MODIFY |\
69− FAN_MARK_FLUSH|\
70− FAN_MARK_TYPE_MASK)
72+ FAN_MARK_FLUSH)
7173
72−/*
73− * All of the events - we build the list by hand so that we can add flags in
74− * the future and not break backward compatibility. Apps will get only the
75− * events that they originally wanted. Be sure to add new events here!
76− */
74+/* Deprecated - do not use this in programs and do not add new flags here! */
7775 #define FAN_ALL_EVENTS (FAN_ACCESS |\
7876 FAN_MODIFY |\
7977 FAN_CLOSE |\
@@ -82,9 +80,11 @@ · 2 unmodified lines
8280 /*
8381 * All events which require a permission response from userspace
8482 */
83+/* Deprecated - do not use this in programs and do not add new flags here! */
8584 #define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
8685 FAN_ACCESS_PERM)
8786
87+/* Deprecated - do not use this in programs and do not add new flags here! */
8888 #define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
8989 FAN_ALL_PERM_EVENTS |\
9090 FAN_Q_OVERFLOW)