diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
commit | 78c388aed2b7184182c08428db1de6c872d815f5 (patch) | |
tree | 4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /net/socket.c | |
parent | eb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff) |
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/socket.c b/net/socket.c index 118a7276b..e53d74252 100644 --- a/net/socket.c +++ b/net/socket.c @@ -55,17 +55,9 @@ */ #include <linux/config.h> -#include <linux/signal.h> -#include <linux/errno.h> -#include <linux/sched.h> #include <linux/mm.h> -#include <linux/smp.h> #include <linux/smp_lock.h> -#include <linux/kernel.h> -#include <linux/major.h> -#include <linux/stat.h> #include <linux/socket.h> -#include <linux/fcntl.h> #include <linux/file.h> #include <linux/net.h> #include <linux/interrupt.h> @@ -80,20 +72,17 @@ #include <linux/kmod.h> #endif -#include <asm/system.h> #include <asm/uaccess.h> #include <linux/inet.h> #include <net/ip.h> -#include <net/protocol.h> +#include <net/sock.h> #include <net/rarp.h> #include <net/tcp.h> #include <net/udp.h> -#include <linux/skbuff.h> -#include <net/sock.h> #include <net/scm.h> - +static int sock_no_open(struct inode *irrelevant, struct file *dontcare); static long long sock_lseek(struct file *file, long long offset, int whence); static ssize_t sock_read(struct file *file, char *buf, size_t size, loff_t *ppos); @@ -121,7 +110,7 @@ static struct file_operations socket_file_ops = { sock_poll, sock_ioctl, NULL, /* mmap */ - NULL, /* no special open code... */ + sock_no_open, /* special open code to disallow open via /proc */ NULL, /* flush */ sock_close, NULL, /* no fsync */ @@ -305,6 +294,17 @@ struct socket *sock_alloc(void) return sock; } +/* + * In theory you can't get an open on this inode, but /proc provides + * a back door. Remember to keep it shut otherwise you'll let the + * creepy crawlies in. + */ + +static int sock_no_open(struct inode *irrelevant, struct file *dontcare) +{ + return -ENXIO; +} + void sock_release(struct socket *sock) { if (sock->state != SS_UNCONNECTED) |