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. ...
This commit is contained in:
+10
-8
@@ -711,28 +711,30 @@ static struct sock *unix_find_other(struct net *net,
|
||||
int type, unsigned hash, int *error)
|
||||
{
|
||||
struct sock *u;
|
||||
struct nameidata nd;
|
||||
struct path path;
|
||||
int err = 0;
|
||||
|
||||
if (sunname->sun_path[0]) {
|
||||
err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);
|
||||
struct inode *inode;
|
||||
err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
|
||||
if (err)
|
||||
goto fail;
|
||||
err = vfs_permission(&nd, MAY_WRITE);
|
||||
inode = path.dentry->d_inode;
|
||||
err = inode_permission(inode, MAY_WRITE);
|
||||
if (err)
|
||||
goto put_fail;
|
||||
|
||||
err = -ECONNREFUSED;
|
||||
if (!S_ISSOCK(nd.path.dentry->d_inode->i_mode))
|
||||
if (!S_ISSOCK(inode->i_mode))
|
||||
goto put_fail;
|
||||
u = unix_find_socket_byinode(net, nd.path.dentry->d_inode);
|
||||
u = unix_find_socket_byinode(net, inode);
|
||||
if (!u)
|
||||
goto put_fail;
|
||||
|
||||
if (u->sk_type == type)
|
||||
touch_atime(nd.path.mnt, nd.path.dentry);
|
||||
touch_atime(path.mnt, path.dentry);
|
||||
|
||||
path_put(&nd.path);
|
||||
path_put(&path);
|
||||
|
||||
err=-EPROTOTYPE;
|
||||
if (u->sk_type != type) {
|
||||
@@ -753,7 +755,7 @@ static struct sock *unix_find_other(struct net *net,
|
||||
return u;
|
||||
|
||||
put_fail:
|
||||
path_put(&nd.path);
|
||||
path_put(&path);
|
||||
fail:
|
||||
*error=err;
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user