From 9cb77c87afa3aa4c0f8ca68b8f637fb4043d1b44 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 21 Sep 2022 17:27:15 +0200 Subject: [PATCH] libmount: add MOUNT_ATTR_NOSYMFOLLOW Signed-off-by: Karel Zak --- include/mount-api-utils.h | 12 ++++++++---- libmount/src/optlist.c | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/mount-api-utils.h b/include/mount-api-utils.h index db2df949db..4e2f23fc8a 100644 --- a/include/mount-api-utils.h +++ b/include/mount-api-utils.h @@ -74,10 +74,6 @@ static inline int move_mount(int from_dfd, const char *from_pathname, int to_dfd # define MOUNT_ATTR_NOEXEC 0x00000008 #endif -#ifndef MOUNT_ATTR_NODIRATIME -# define MOUNT_ATTR_NODIRATIME 0x00000080 -#endif - #ifndef MOUNT_ATTR__ATIME # define MOUNT_ATTR__ATIME 0x00000070 #endif @@ -94,10 +90,18 @@ static inline int move_mount(int from_dfd, const char *from_pathname, int to_dfd # define MOUNT_ATTR_STRICTATIME 0x00000020 #endif +#ifndef MOUNT_ATTR_NODIRATIME +# define MOUNT_ATTR_NODIRATIME 0x00000080 +#endif + #ifndef MOUNT_ATTR_IDMAP # define MOUNT_ATTR_IDMAP 0x00100000 #endif +#ifndef MOUNT_ATTR_NOSYMFOLLOW +# define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 +#endif + #ifndef HAVE_STRUCT_MOUNT_ATTR # include struct mount_attr { diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index 1171237967..6531d5b46e 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -777,6 +777,8 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *attrs) *attrs |= MOUNT_ATTR_NOATIME; if (flags & MS_STRICTATIME) *attrs |= MOUNT_ATTR_STRICTATIME; + if (flags & MS_NOSYMFOLLOW) + *attrs |= MOUNT_ATTR_NOSYMFOLLOW; #endif return 0; } -- 2.47.2