* [PATCH 1/3] vfs: Introduce XATTR_SET_MASK
@ 2014-01-20 14:15 Florian Weimer
0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2014-01-20 14:15 UTC (permalink / raw)
To: linux-fsdevel; +Cc: linux-kernel, viro
This will be used to separate the xattr operations from the AT_* flags.
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Florian Weimer <fweimer@redhat.com>
---
fs/xattr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/xattr.c b/fs/xattr.c
index 3377dff..9e44641 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -24,6 +24,8 @@
#include <asm/uaccess.h>
+#define XATTR_SET_MASK (XATTR_CREATE | XATTR_REPLACE)
+
/*
* Check permissions for extended attribute access. This is a bit complicated
* because different namespaces have very different rules.
@@ -327,7 +329,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
void *vvalue = NULL; /* If non-NULL, we used vmalloc() */
char kname[XATTR_NAME_MAX + 1];
- if (flags & ~(XATTR_CREATE|XATTR_REPLACE))
+ if (flags & ~XATTR_SET_MASK)
return -EINVAL;
error = strncpy_from_user(kname, name, sizeof(kname));
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-21 13:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 14:15 [PATCH 1/3] vfs: Introduce XATTR_SET_MASK Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).