aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:23:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:23:44 -0400
commit4836e3007882984279ca63d3c42bf0b14616eb78 (patch)
tree28bf22726964e068b825491d71a141eefedbe5f8 /fs/ecryptfs/inode.c
parent5c7c204aeca51ccfad63caab4fcdc5d8026c0fd8 (diff)
parent4e1e018ecc6f7bfd10fc75b3ff9715cc8164e0a2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (39 commits) [PATCH] fix RLIM_NOFILE handling [PATCH] get rid of corner case in dup3() entirely [PATCH] remove remaining namei_{32,64}.h crap [PATCH] get rid of indirect users of namei.h [PATCH] get rid of __user_path_lookup_open [PATCH] f_count may wrap around [PATCH] dup3 fix [PATCH] don't pass nameidata to __ncp_lookup_validate() [PATCH] don't pass nameidata to gfs2_lookupi() [PATCH] new (local) helper: user_path_parent() [PATCH] sanitize __user_walk_fd() et.al. [PATCH] preparation to __user_walk_fd cleanup [PATCH] kill nameidata passing to permission(), rename to inode_permission() [PATCH] take noexec checks to very few callers that care Re: [PATCH 3/6] vfs: open_exec cleanup [patch 4/4] vfs: immutable inode checking cleanup [patch 3/4] fat: dont call notify_change [patch 2/4] vfs: utimes cleanup [patch 1/4] vfs: utimes: move owner check into inode_change_ok() [PATCH] vfs: use kstrdup() and check failing allocation ...
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index d755455e3bff..89209f00f9c7 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -465,7 +465,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
465 int rc; 465 int rc;
466 struct dentry *lower_dentry; 466 struct dentry *lower_dentry;
467 struct dentry *lower_dir_dentry; 467 struct dentry *lower_dir_dentry;
468 umode_t mode;
469 char *encoded_symname; 468 char *encoded_symname;
470 int encoded_symlen; 469 int encoded_symlen;
471 struct ecryptfs_crypt_stat *crypt_stat = NULL; 470 struct ecryptfs_crypt_stat *crypt_stat = NULL;
@@ -473,7 +472,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
473 lower_dentry = ecryptfs_dentry_to_lower(dentry); 472 lower_dentry = ecryptfs_dentry_to_lower(dentry);
474 dget(lower_dentry); 473 dget(lower_dentry);
475 lower_dir_dentry = lock_parent(lower_dentry); 474 lower_dir_dentry = lock_parent(lower_dentry);
476 mode = S_IALLUGO;
477 encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname, 475 encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
478 strlen(symname), 476 strlen(symname),
479 &encoded_symname); 477 &encoded_symname);
@@ -482,7 +480,7 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
482 goto out_lock; 480 goto out_lock;
483 } 481 }
484 rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry, 482 rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
485 encoded_symname, mode); 483 encoded_symname);
486 kfree(encoded_symname); 484 kfree(encoded_symname);
487 if (rc || !lower_dentry->d_inode) 485 if (rc || !lower_dentry->d_inode)
488 goto out_lock; 486 goto out_lock;
@@ -830,22 +828,9 @@ out:
830} 828}
831 829
832static int 830static int
833ecryptfs_permission(struct inode *inode, int mask, struct nameidata *nd) 831ecryptfs_permission(struct inode *inode, int mask)
834{ 832{
835 int rc; 833 return inode_permission(ecryptfs_inode_to_lower(inode), mask);
836
837 if (nd) {
838 struct vfsmount *vfsmnt_save = nd->path.mnt;
839 struct dentry *dentry_save = nd->path.dentry;
840
841 nd->path.mnt = ecryptfs_dentry_to_lower_mnt(nd->path.dentry);
842 nd->path.dentry = ecryptfs_dentry_to_lower(nd->path.dentry);
843 rc = permission(ecryptfs_inode_to_lower(inode), mask, nd);
844 nd->path.mnt = vfsmnt_save;
845 nd->path.dentry = dentry_save;
846 } else
847 rc = permission(ecryptfs_inode_to_lower(inode), mask, NULL);
848 return rc;
849} 834}
850 835
851/** 836/**