diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /fs/befs | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/befs')
-rw-r--r-- | fs/befs/Kconfig | 26 | ||||
-rw-r--r-- | fs/befs/linuxvfs.c | 5 |
2 files changed, 30 insertions, 1 deletions
diff --git a/fs/befs/Kconfig b/fs/befs/Kconfig new file mode 100644 index 000000000000..7835d30f211f --- /dev/null +++ b/fs/befs/Kconfig | |||
@@ -0,0 +1,26 @@ | |||
1 | config BEFS_FS | ||
2 | tristate "BeOS file system (BeFS) support (read only) (EXPERIMENTAL)" | ||
3 | depends on BLOCK && EXPERIMENTAL | ||
4 | select NLS | ||
5 | help | ||
6 | The BeOS File System (BeFS) is the native file system of Be, Inc's | ||
7 | BeOS. Notable features include support for arbitrary attributes | ||
8 | on files and directories, and database-like indices on selected | ||
9 | attributes. (Also note that this driver doesn't make those features | ||
10 | available at this time). It is a 64 bit filesystem, so it supports | ||
11 | extremely large volumes and files. | ||
12 | |||
13 | If you use this filesystem, you should also say Y to at least one | ||
14 | of the NLS (native language support) options below. | ||
15 | |||
16 | If you don't know what this is about, say N. | ||
17 | |||
18 | To compile this as a module, choose M here: the module will be | ||
19 | called befs. | ||
20 | |||
21 | config BEFS_DEBUG | ||
22 | bool "Debug BeFS" | ||
23 | depends on BEFS_FS | ||
24 | help | ||
25 | If you say Y here, you can use the 'debug' mount option to enable | ||
26 | debugging output from the driver. | ||
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index b6dfee37c7b7..d06cb023ad02 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -378,7 +378,8 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) | |||
378 | inode->i_size = 0; | 378 | inode->i_size = 0; |
379 | inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; | 379 | inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; |
380 | strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink, | 380 | strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink, |
381 | BEFS_SYMLINK_LEN); | 381 | BEFS_SYMLINK_LEN - 1); |
382 | befs_ino->i_data.symlink[BEFS_SYMLINK_LEN - 1] = '\0'; | ||
382 | } else { | 383 | } else { |
383 | int num_blks; | 384 | int num_blks; |
384 | 385 | ||
@@ -477,6 +478,8 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
477 | kfree(link); | 478 | kfree(link); |
478 | befs_error(sb, "Failed to read entire long symlink"); | 479 | befs_error(sb, "Failed to read entire long symlink"); |
479 | link = ERR_PTR(-EIO); | 480 | link = ERR_PTR(-EIO); |
481 | } else { | ||
482 | link[len - 1] = '\0'; | ||
480 | } | 483 | } |
481 | } else { | 484 | } else { |
482 | link = befs_ino->i_data.symlink; | 485 | link = befs_ino->i_data.symlink; |