diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
commit | 36b8d186e6cc8e32cb5227f5645a58e1bc0af190 (patch) | |
tree | 1000ad26e189e6ff2c53fb7eeff605f59c7ad94e /fs/gfs2 | |
parent | cd85b557414fe4cd44ea6608825e96612a5fe2b2 (diff) | |
parent | c45ed235abf1b0b6666417e3c394f18717976acd (diff) |
Merge branch 'next' of git://selinuxproject.org/~jmorris/linux-security
* 'next' of git://selinuxproject.org/~jmorris/linux-security: (95 commits)
TOMOYO: Fix incomplete read after seek.
Smack: allow to access /smack/access as normal user
TOMOYO: Fix unused kernel config option.
Smack: fix: invalid length set for the result of /smack/access
Smack: compilation fix
Smack: fix for /smack/access output, use string instead of byte
Smack: domain transition protections (v3)
Smack: Provide information for UDS getsockopt(SO_PEERCRED)
Smack: Clean up comments
Smack: Repair processing of fcntl
Smack: Rule list lookup performance
Smack: check permissions from user space (v2)
TOMOYO: Fix quota and garbage collector.
TOMOYO: Remove redundant tasklist_lock.
TOMOYO: Fix domain transition failure warning.
TOMOYO: Remove tomoyo_policy_memory_lock spinlock.
TOMOYO: Simplify garbage collector.
TOMOYO: Fix make namespacecheck warnings.
target: check hex2bin result
encrypted-keys: check hex2bin result
...
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/inode.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 900cf986aadc..6525b804d5ec 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -624,31 +624,29 @@ fail: | |||
624 | return error; | 624 | return error; |
625 | } | 625 | } |
626 | 626 | ||
627 | static int gfs2_security_init(struct gfs2_inode *dip, struct gfs2_inode *ip, | 627 | int gfs2_initxattrs(struct inode *inode, const struct xattr *xattr_array, |
628 | const struct qstr *qstr) | 628 | void *fs_info) |
629 | { | 629 | { |
630 | int err; | 630 | const struct xattr *xattr; |
631 | size_t len; | 631 | int err = 0; |
632 | void *value; | 632 | |
633 | char *name; | 633 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { |
634 | 634 | err = __gfs2_xattr_set(inode, xattr->name, xattr->value, | |
635 | err = security_inode_init_security(&ip->i_inode, &dip->i_inode, qstr, | 635 | xattr->value_len, 0, |
636 | &name, &value, &len); | 636 | GFS2_EATYPE_SECURITY); |
637 | 637 | if (err < 0) | |
638 | if (err) { | 638 | break; |
639 | if (err == -EOPNOTSUPP) | ||
640 | return 0; | ||
641 | return err; | ||
642 | } | 639 | } |
643 | |||
644 | err = __gfs2_xattr_set(&ip->i_inode, name, value, len, 0, | ||
645 | GFS2_EATYPE_SECURITY); | ||
646 | kfree(value); | ||
647 | kfree(name); | ||
648 | |||
649 | return err; | 640 | return err; |
650 | } | 641 | } |
651 | 642 | ||
643 | static int gfs2_security_init(struct gfs2_inode *dip, struct gfs2_inode *ip, | ||
644 | const struct qstr *qstr) | ||
645 | { | ||
646 | return security_inode_init_security(&ip->i_inode, &dip->i_inode, qstr, | ||
647 | &gfs2_initxattrs, NULL); | ||
648 | } | ||
649 | |||
652 | /** | 650 | /** |
653 | * gfs2_create_inode - Create a new inode | 651 | * gfs2_create_inode - Create a new inode |
654 | * @dir: The parent directory | 652 | * @dir: The parent directory |