Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292287
b: refs/heads/master
c: a9bf8e9
h: refs/heads/master
i:
  292285: 164232d
  292283: a6f99ce
  292279: 5541e28
  292271: 54b8344
  292255: f78b5f6
  292223: 8e37959
v: v3
  • Loading branch information
Kees Cook authored and John Johansen committed Feb 27, 2012
1 parent 08a5b90 commit a9cc0ae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e74abcf3359d0130e99a6511ac484a3ea9e6e988
refs/heads/master: a9bf8e9fd561ba9ff1f0f2a1d96e439fcedaaaa4
10 changes: 10 additions & 0 deletions trunk/security/apparmor/apparmorfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ static int aa_fs_seq_show(struct seq_file *seq, void *v)
case AA_FS_TYPE_BOOLEAN:
seq_printf(seq, "%s\n", fs_file->v.boolean ? "yes" : "no");
break;
case AA_FS_TYPE_STRING:
seq_printf(seq, "%s\n", fs_file->v.string);
break;
case AA_FS_TYPE_U64:
seq_printf(seq, "%#08lx\n", fs_file->v.u64);
break;
Expand All @@ -180,6 +183,12 @@ const struct file_operations aa_fs_seq_file_ops = {

/** Base file system setup **/

static struct aa_fs_entry aa_fs_entry_file[] = {
AA_FS_FILE_STRING("mask", "create read write exec append mmap_exec " \
"link lock"),
{ }
};

static struct aa_fs_entry aa_fs_entry_domain[] = {
AA_FS_FILE_BOOLEAN("change_hat", 1),
AA_FS_FILE_BOOLEAN("change_hatv", 1),
Expand All @@ -190,6 +199,7 @@ static struct aa_fs_entry aa_fs_entry_domain[] = {

static struct aa_fs_entry aa_fs_entry_features[] = {
AA_FS_DIR("domain", aa_fs_entry_domain),
AA_FS_DIR("file", aa_fs_entry_file),
AA_FS_FILE_U64("capability", VFS_CAP_FLAGS_MASK),
{ }
};
Expand Down
6 changes: 6 additions & 0 deletions trunk/security/apparmor/include/apparmorfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

enum aa_fs_type {
AA_FS_TYPE_BOOLEAN,
AA_FS_TYPE_STRING,
AA_FS_TYPE_U64,
AA_FS_TYPE_FOPS,
AA_FS_TYPE_DIR,
Expand All @@ -31,6 +32,7 @@ struct aa_fs_entry {
enum aa_fs_type v_type;
union {
bool boolean;
char *string;
unsigned long u64;
struct aa_fs_entry *files;
} v;
Expand All @@ -43,6 +45,10 @@ extern const struct file_operations aa_fs_seq_file_ops;
{ .name = (_name), .mode = 0444, \
.v_type = AA_FS_TYPE_BOOLEAN, .v.boolean = (_value), \
.file_ops = &aa_fs_seq_file_ops }
#define AA_FS_FILE_STRING(_name, _value) \
{ .name = (_name), .mode = 0444, \
.v_type = AA_FS_TYPE_STRING, .v.string = (_value), \
.file_ops = &aa_fs_seq_file_ops }
#define AA_FS_FILE_U64(_name, _value) \
{ .name = (_name), .mode = 0444, \
.v_type = AA_FS_TYPE_U64, .v.u64 = (_value), \
Expand Down

0 comments on commit a9cc0ae

Please sign in to comment.