aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/xattr.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-02-14 20:23:22 -0800
committerJens Axboe <axboe@suse.de>2003-02-14 20:23:22 -0800
commitc2e7eeb03b115bdb638e3f9618400013f74591d8 (patch)
treec3440985753b440134626cadb2c43b4d4f293c0d /fs/ext2/xattr.c
parentf83b53c5b5a6f9f3685aff895bb50a86b4702287 (diff)
downloadhistory-c2e7eeb03b115bdb638e3f9618400013f74591d8.tar.gz
[PATCH] xattr: trusted extended attributes
Patch from Andreas Gruenbacher <agruen@suse.de> This patch adds trusted extended attributes. Trusted extended attributes are visible and accessible only to processes that have the CAP_SYS_ADMIN capability. Attributes in this class are used to implement mechanisms in user space (i.e., outside the kernel) which keep information in extended attributes to which ordinary processes have no access. HSM is an example.
Diffstat (limited to 'fs/ext2/xattr.c')
-rw-r--r--fs/ext2/xattr.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index f11beeae819d1c..72fd8b2c4b54b1 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -1093,27 +1093,35 @@ init_ext2_xattr(void)
{
int err;
- err = ext2_xattr_register(EXT2_XATTR_INDEX_USER, &ext2_xattr_user_handler);
+ err = ext2_xattr_register(EXT2_XATTR_INDEX_USER,
+ &ext2_xattr_user_handler);
if (err)
return err;
+ err = ext2_xattr_register(EXT2_XATTR_INDEX_TRUSTED,
+ &ext2_xattr_trusted_handler);
+ if (err)
+ goto out;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
err = init_ext2_acl();
if (err)
- goto out;
+ goto out1;
#endif
ext2_xattr_cache = mb_cache_create("ext2_xattr", NULL,
sizeof(struct mb_cache_entry) +
sizeof(struct mb_cache_entry_index), 1, 6);
if (!ext2_xattr_cache) {
err = -ENOMEM;
- goto out1;
+ goto out2;
}
return 0;
-out1:
+out2:
#ifdef CONFIG_EXT2_FS_POSIX_ACL
exit_ext2_acl();
-out:
+out1:
#endif
+ ext2_xattr_unregister(EXT2_XATTR_INDEX_TRUSTED,
+ &ext2_xattr_trusted_handler);
+out:
ext2_xattr_unregister(EXT2_XATTR_INDEX_USER,
&ext2_xattr_user_handler);
return err;
@@ -1126,5 +1134,8 @@ exit_ext2_xattr(void)
#ifdef CONFIG_EXT2_FS_POSIX_ACL
exit_ext2_acl();
#endif
- ext2_xattr_unregister(EXT2_XATTR_INDEX_USER, &ext2_xattr_user_handler);
+ ext2_xattr_unregister(EXT2_XATTR_INDEX_TRUSTED,
+ &ext2_xattr_trusted_handler);
+ ext2_xattr_unregister(EXT2_XATTR_INDEX_USER,
+ &ext2_xattr_user_handler);
}