aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/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/ext3/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/ext3/xattr.c')
-rw-r--r--fs/ext3/xattr.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 7c1c40f687b6e2..0ab7a4ee0c62ce 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -1133,27 +1133,35 @@ init_ext3_xattr(void)
{
int err;
- err = ext3_xattr_register(EXT3_XATTR_INDEX_USER, &ext3_xattr_user_handler);
+ err = ext3_xattr_register(EXT3_XATTR_INDEX_USER,
+ &ext3_xattr_user_handler);
if (err)
return err;
+ err = ext3_xattr_register(EXT3_XATTR_INDEX_TRUSTED,
+ &ext3_xattr_trusted_handler);
+ if (err)
+ goto out;
#ifdef CONFIG_EXT3_FS_POSIX_ACL
err = init_ext3_acl();
if (err)
- goto out;
+ goto out1;
#endif
ext3_xattr_cache = mb_cache_create("ext3_xattr", NULL,
sizeof(struct mb_cache_entry) +
sizeof(struct mb_cache_entry_index), 1, 6);
if (!ext3_xattr_cache) {
err = -ENOMEM;
- goto out1;
+ goto out2;
}
return 0;
-out1:
+out2:
#ifdef CONFIG_EXT3_FS_POSIX_ACL
exit_ext3_acl();
-out:
+out1:
#endif
+ ext3_xattr_unregister(EXT3_XATTR_INDEX_TRUSTED,
+ &ext3_xattr_trusted_handler);
+out:
ext3_xattr_unregister(EXT3_XATTR_INDEX_USER,
&ext3_xattr_user_handler);
return err;
@@ -1168,5 +1176,8 @@ exit_ext3_xattr(void)
#ifdef CONFIG_EXT3_FS_POSIX_ACL
exit_ext3_acl();
#endif
- ext3_xattr_unregister(EXT3_XATTR_INDEX_USER, &ext3_xattr_user_handler);
+ ext3_xattr_unregister(EXT3_XATTR_INDEX_TRUSTED,
+ &ext3_xattr_trusted_handler);
+ ext3_xattr_unregister(EXT3_XATTR_INDEX_USER,
+ &ext3_xattr_user_handler);
}