All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Cc: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [PATCH] Smack: fix for /smack/access output, use string instead of byte
Date: Mon, 10 Oct 2011 17:21:28 -0700	[thread overview]
Message-ID: <4E938C08.2070801@schaufler-ca.com> (raw)
In-Reply-To: <1318246168-26660-1-git-send-email-jarkko.sakkinen@intel.com>

On 10/10/2011 4:29 AM, Jarkko Sakkinen wrote:
> Small fix for the output of access SmackFS file. Use string
> is instead of byte. Makes it easier to extend API if it is
> needed.
>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>

Applied to git://gitorious.org/smack-next/kernel.git

> ---
>  security/smack/smackfs.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index 54f6e18..5498c4a 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -1497,6 +1497,7 @@ static ssize_t smk_write_access(struct file *file, const char __user *buf,
>  {
>  	struct smack_rule rule;
>  	char *data;
> +	int res;
>  
>  	if (!capable(CAP_MAC_ADMIN))
>  		return -EPERM;
> @@ -1508,8 +1509,10 @@ static ssize_t smk_write_access(struct file *file, const char __user *buf,
>  	if (count < SMK_LOADLEN || smk_parse_rule(data, &rule))
>  		return -EINVAL;
>  
> -	data[0] = smk_access(rule.smk_subject, rule.smk_object,
> -			     rule.smk_access, NULL) == 0;
> +	res = smk_access(rule.smk_subject, rule.smk_object, rule.smk_access,
> +			  NULL);
> +	data[0] = res == 0 ? '1' : '0';
> +	data[1] = '\0';
>  
>  	simple_transaction_set(file, 1);
>  	return SMK_LOADLEN;


      reply	other threads:[~2011-10-11  0:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 11:29 [PATCH] Smack: fix for /smack/access output, use string instead of byte Jarkko Sakkinen
2011-10-11  0:21 ` Casey Schaufler [this message]

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=4E938C08.2070801@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=jarkko.sakkinen@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.