diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 13:22:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 13:22:40 -0400 |
commit | 5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (patch) | |
tree | af19ed28db83e8f52690872ac99336da1cf2fd3b /net/unix/af_unix.c | |
parent | 5b34653963de7a6d0d8c783527457d68fddc60fb (diff) | |
parent | fd217f4d70172c526478f2bc76859e909fdfa674 (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: (46 commits)
[PATCH] fs: add a sanity check in d_free
[PATCH] i_version: remount support
[patch] vfs: make security_inode_setattr() calling consistent
[patch 1/3] FS_MBCACHE: don't needlessly make it built-in
[PATCH] move executable checking into ->permission()
[PATCH] fs/dcache.c: update comment of d_validate()
[RFC PATCH] touch_mnt_namespace when the mount flags change
[PATCH] reiserfs: add missing llseek method
[PATCH] fix ->llseek for more directories
[PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent
[PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup
[PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate()
[PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper
[PATCH vfs-2.6 2/6] vfs: add d_ancestor()
[PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT()
[PATCH] get rid of on-stack dentry in udf
[PATCH 2/2] anondev: switch to IDA
[PATCH 1/2] anondev: init IDR statically
[JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup()
[PATCH] Optimise NFS readdir hack slightly.
...
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index c647aab8d41..dc504d308ec 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -711,28 +711,30 @@ static struct sock *unix_find_other(struct net *net, | |||
711 | int type, unsigned hash, int *error) | 711 | int type, unsigned hash, int *error) |
712 | { | 712 | { |
713 | struct sock *u; | 713 | struct sock *u; |
714 | struct nameidata nd; | 714 | struct path path; |
715 | int err = 0; | 715 | int err = 0; |
716 | 716 | ||
717 | if (sunname->sun_path[0]) { | 717 | if (sunname->sun_path[0]) { |
718 | err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd); | 718 | struct inode *inode; |
719 | err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path); | ||
719 | if (err) | 720 | if (err) |
720 | goto fail; | 721 | goto fail; |
721 | err = vfs_permission(&nd, MAY_WRITE); | 722 | inode = path.dentry->d_inode; |
723 | err = inode_permission(inode, MAY_WRITE); | ||
722 | if (err) | 724 | if (err) |
723 | goto put_fail; | 725 | goto put_fail; |
724 | 726 | ||
725 | err = -ECONNREFUSED; | 727 | err = -ECONNREFUSED; |
726 | if (!S_ISSOCK(nd.path.dentry->d_inode->i_mode)) | 728 | if (!S_ISSOCK(inode->i_mode)) |
727 | goto put_fail; | 729 | goto put_fail; |
728 | u = unix_find_socket_byinode(net, nd.path.dentry->d_inode); | 730 | u = unix_find_socket_byinode(net, inode); |
729 | if (!u) | 731 | if (!u) |
730 | goto put_fail; | 732 | goto put_fail; |
731 | 733 | ||
732 | if (u->sk_type == type) | 734 | if (u->sk_type == type) |
733 | touch_atime(nd.path.mnt, nd.path.dentry); | 735 | touch_atime(path.mnt, path.dentry); |
734 | 736 | ||
735 | path_put(&nd.path); | 737 | path_put(&path); |
736 | 738 | ||
737 | err=-EPROTOTYPE; | 739 | err=-EPROTOTYPE; |
738 | if (u->sk_type != type) { | 740 | if (u->sk_type != type) { |
@@ -753,7 +755,7 @@ static struct sock *unix_find_other(struct net *net, | |||
753 | return u; | 755 | return u; |
754 | 756 | ||
755 | put_fail: | 757 | put_fail: |
756 | path_put(&nd.path); | 758 | path_put(&path); |
757 | fail: | 759 | fail: |
758 | *error=err; | 760 | *error=err; |
759 | return NULL; | 761 | return NULL; |