Skip to content

Commit c5eaab1

Browse files
carmeli-tamirJames Morris
authored andcommitted
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>
1 parent d1c5947 commit c5eaab1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎security/commoncap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
920920

921921
/* Ignore non-security xattrs */
922922
if (strncmp(name, XATTR_SECURITY_PREFIX,
923-
sizeof(XATTR_SECURITY_PREFIX) - 1) != 0)
923+
XATTR_SECURITY_PREFIX_LEN) != 0)
924924
return 0;
925925

926926
/*
@@ -952,7 +952,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
952952

953953
/* Ignore non-security xattrs */
954954
if (strncmp(name, XATTR_SECURITY_PREFIX,
955-
sizeof(XATTR_SECURITY_PREFIX) - 1) != 0)
955+
XATTR_SECURITY_PREFIX_LEN) != 0)
956956
return 0;
957957

958958
if (strcmp(name, XATTR_NAME_CAPS) == 0) {

0 commit comments

Comments
 (0)