lkml.org 
[lkml]   [2016]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] security: use XATTR_*_PREFIX_LEN instead sizeof(...)
Date
use the definition in include/uapi/linux/xattr.h

igned-off-by: Toralf Förster <toralf.foerster@gmx.de>
---
security/commoncap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 1832cf7..907a3ef 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -658,7 +658,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,
}

if (!strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) &&
+ XATTR_SECURITY_PREFIX_LEN) &&
!capable(CAP_SYS_ADMIN))
return -EPERM;
return 0;
@@ -684,7 +684,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)
}

if (!strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) &&
+ XATTR_SECURITY_PREFIX_LEN) &&
!capable(CAP_SYS_ADMIN))
return -EPERM;
return 0;
--
2.4.10


\
 
 \ /
  Last update: 2016-01-03 21:41    [W:0.060 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site