lkml.org 
[lkml]   [2000]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectAF_UNIX sockets problem (+ solution patch)
Hi,

I just noticed that since 2.3.50 it is not possible
to create an AF_UNIX socket as "normal" user.

You have to be superuser to "bind" the socket to
a file/inode.

The reason is the change in "linux/fs/namei.c" and
the recently introduced routine "vfs_mknod(...)".

This routine allows to create a socket only if
CAP_MKNOD is set.

a possible patch/fix:

-----------------snip ------------------------------------
--- linux/fs/namei_old.c Thu Mar 9 16:29:33 2000
+++ linux/fs/namei.c Thu Mar 9 16:11:37 2000
@@ -745,7 +745,7 @@

mode &= ~current->fs->umask;

- if (!S_ISFIFO(mode) && !capable(CAP_MKNOD))
+ if (!S_ISFIFO(mode) && !S_ISSOCK(mode) && !capable(CAP_MKNOD))
goto exit_lock;

error = may_create(dir, dentry);
----------------snip--------------------------------------
With this patch everyone can create AF_UNIX sockets
(and I think this is the wanted behaviour, isn't it ?)

so long
Ingo


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.022 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site