Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264566
b: refs/heads/master
c: f8859d9
h: refs/heads/master
v: v3
  • Loading branch information
Jarkko Sakkinen authored and Casey Schaufler committed Oct 12, 2011
1 parent 1bf20ea commit f798625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84088ba239293abb24260c6c36d86e8775b6707f
refs/heads/master: f8859d98c1d1e73393285fb9dd57007839956247
7 changes: 5 additions & 2 deletions trunk/security/smack/smackfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit f798625

Please sign in to comment.