mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: linux-security-module@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Toralf Förster" <toralf.foerster@gmx.de>
Subject: [PATCH 2/2] security: use XATTR_*_PREFIX_LEN instead sizeof(...)
Date: Sun,  3 Jan 2016 21:04:24 +0100	[thread overview]
Message-ID: <1451851464-29550-1-git-send-email-toralf.foerster@gmx.de> (raw)

use the definition in include/uapi/linux/xattr.h

Signed-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


             reply	other threads:[~2016-01-03 20:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 20:04 Toralf Förster [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-03 19:56 [PATCH 1/2] ext4: " Toralf Förster
2016-01-03 19:56 ` [PATCH 2/2] security: " Toralf Förster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451851464-29550-1-git-send-email-toralf.foerster@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®