diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
| commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
| tree | 50c101806f4d3b6585222dda060559eb4f3e005a /fs/ext3/xattr_user.c | |
| parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
| parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/ext3/xattr_user.c')
| -rw-r--r-- | fs/ext3/xattr_user.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/fs/ext3/xattr_user.c b/fs/ext3/xattr_user.c index e907cae7a07c..a85a0a17c4fd 100644 --- a/fs/ext3/xattr_user.c +++ b/fs/ext3/xattr_user.c | |||
| @@ -37,16 +37,10 @@ static int | |||
| 37 | ext3_xattr_user_get(struct inode *inode, const char *name, | 37 | ext3_xattr_user_get(struct inode *inode, const char *name, |
| 38 | void *buffer, size_t size) | 38 | void *buffer, size_t size) |
| 39 | { | 39 | { |
| 40 | int error; | ||
| 41 | |||
| 42 | if (strcmp(name, "") == 0) | 40 | if (strcmp(name, "") == 0) |
| 43 | return -EINVAL; | 41 | return -EINVAL; |
| 44 | if (!test_opt(inode->i_sb, XATTR_USER)) | 42 | if (!test_opt(inode->i_sb, XATTR_USER)) |
| 45 | return -EOPNOTSUPP; | 43 | return -EOPNOTSUPP; |
| 46 | error = permission(inode, MAY_READ, NULL); | ||
| 47 | if (error) | ||
| 48 | return error; | ||
| 49 | |||
| 50 | return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size); | 44 | return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size); |
| 51 | } | 45 | } |
| 52 | 46 | ||
| @@ -54,19 +48,10 @@ static int | |||
| 54 | ext3_xattr_user_set(struct inode *inode, const char *name, | 48 | ext3_xattr_user_set(struct inode *inode, const char *name, |
| 55 | const void *value, size_t size, int flags) | 49 | const void *value, size_t size, int flags) |
| 56 | { | 50 | { |
| 57 | int error; | ||
| 58 | |||
| 59 | if (strcmp(name, "") == 0) | 51 | if (strcmp(name, "") == 0) |
| 60 | return -EINVAL; | 52 | return -EINVAL; |
| 61 | if (!test_opt(inode->i_sb, XATTR_USER)) | 53 | if (!test_opt(inode->i_sb, XATTR_USER)) |
| 62 | return -EOPNOTSUPP; | 54 | return -EOPNOTSUPP; |
| 63 | if ( !S_ISREG(inode->i_mode) && | ||
| 64 | (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) | ||
| 65 | return -EPERM; | ||
| 66 | error = permission(inode, MAY_WRITE, NULL); | ||
| 67 | if (error) | ||
| 68 | return error; | ||
| 69 | |||
| 70 | return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name, | 55 | return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name, |
| 71 | value, size, flags); | 56 | value, size, flags); |
| 72 | } | 57 | } |
