summaryrefslogtreecommitdiff
path: root/security/commoncap.c
diff options
context:
space:
mode:
authorCarmeli Tamir <carmeli.tamir@gmail.com>2019-07-06 11:07:38 -0400
committerJames Morris <jamorris@linux.microsoft.com>2019-07-07 14:55:54 +1200
commitc5eaab1d131d0a6272df7d55a971a67400d63f56 (patch)
tree52ff65f3ec93ff57884e7a4ed9846df87c28c4e9 /security/commoncap.c
parentd1c5947ec6789b7d72cd7365f4e37ec326dbd9b6 (diff)
downloadlwn-c5eaab1d131d0a6272df7d55a971a67400d63f56.tar.gz
lwn-c5eaab1d131d0a6272df7d55a971a67400d63f56.zip
security/commoncap: Use xattr security prefix len
Using the existing defined XATTR_SECURITY_PREFIX_LEN instead of sizeof(XATTR_SECURITY_PREFIX) - 1. Pretty simple cleanup. Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com> Signed-off-by: James Morris <jamorris@linux.microsoft.com>
Diffstat (limited to 'security/commoncap.c')
-rw-r--r--security/commoncap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index afd9679ca866..1156178a0c52 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -920,7 +920,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
/* Ignore non-security xattrs */
if (strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) != 0)
+ XATTR_SECURITY_PREFIX_LEN) != 0)
return 0;
/*
@@ -952,7 +952,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
/* Ignore non-security xattrs */
if (strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) != 0)
+ XATTR_SECURITY_PREFIX_LEN) != 0)
return 0;
if (strcmp(name, XATTR_NAME_CAPS) == 0) {