Commit c5eaab1d authored by Carmeli Tamir's avatar Carmeli Tamir Committed by James Morris

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: default avatarCarmeli Tamir <carmeli.tamir@gmail.com>
Signed-off-by: default avatarJames Morris <jamorris@linux.microsoft.com>
parent d1c5947e
...@@ -920,7 +920,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name, ...@@ -920,7 +920,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
/* Ignore non-security xattrs */ /* Ignore non-security xattrs */
if (strncmp(name, XATTR_SECURITY_PREFIX, if (strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) != 0) XATTR_SECURITY_PREFIX_LEN) != 0)
return 0; return 0;
/* /*
...@@ -952,7 +952,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name) ...@@ -952,7 +952,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
/* Ignore non-security xattrs */ /* Ignore non-security xattrs */
if (strncmp(name, XATTR_SECURITY_PREFIX, if (strncmp(name, XATTR_SECURITY_PREFIX,
sizeof(XATTR_SECURITY_PREFIX) - 1) != 0) XATTR_SECURITY_PREFIX_LEN) != 0)
return 0; return 0;
if (strcmp(name, XATTR_NAME_CAPS) == 0) { if (strcmp(name, XATTR_NAME_CAPS) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment