Commit 38c81322 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Arnaldo Carvalho de Melo

o X25: fix permission bogosity in create_proc_entry usage

Thanks to Al Viro for reviewing this, this also fixes the
example that made me do this copy'n'paste brain fart.
parent 45f0e972
......@@ -61,9 +61,6 @@ typedef struct wan_stat_entry
#ifdef CONFIG_PROC_FS
/* Proc filesystem interface */
static int router_proc_perms(struct inode *, int);
/* Miscellaneous */
/*
......@@ -79,11 +76,6 @@ static int router_proc_perms(struct inode *, int);
* Generic /proc/net/router/<file> file and inode operations
*/
static struct inode_operations router_inode =
{
.permission = router_proc_perms,
};
/*
* /proc/net/router
*/
......@@ -98,15 +90,6 @@ static struct proc_dir_entry *proc_router;
/****** Proc filesystem entry points ****************************************/
/*
* Verify access rights.
*/
static int router_proc_perms (struct inode* inode, int op)
{
return 0;
}
/*
* Iterator
*/
......@@ -320,16 +303,14 @@ int __init wanrouter_proc_init (void)
if (!proc_router)
goto fail;
p = create_proc_entry("config",0,proc_router);
p = create_proc_entry("config", S_IRUGO, proc_router);
if (!p)
goto fail_config;
p->proc_fops = &config_fops;
p->proc_iops = &router_inode;
p = create_proc_entry("status",0,proc_router);
p = create_proc_entry("status", S_IRUGO, proc_router);
if (!p)
goto fail_stat;
p->proc_fops = &status_fops;
p->proc_iops = &router_inode;
return 0;
fail_stat:
remove_proc_entry("config", proc_router);
......@@ -359,11 +340,10 @@ int wanrouter_proc_add (wan_device_t* wandev)
if (wandev->magic != ROUTER_MAGIC)
return -EINVAL;
wandev->dent = create_proc_entry(wandev->name, 0, proc_router);
wandev->dent = create_proc_entry(wandev->name, S_IRUGO, proc_router);
if (!wandev->dent)
return -ENOMEM;
wandev->dent->proc_fops = &wandev_fops;
wandev->dent->proc_iops = &router_inode;
wandev->dent->data = wandev;
return 0;
}
......
......@@ -202,15 +202,6 @@ static struct file_operations x25_seq_route_fops = {
.release = seq_release,
};
static int x25_proc_perms(struct inode* inode, int op)
{
return 0;
}
static struct inode_operations x25_seq_inode = {
.permission = x25_proc_perms,
};
static struct proc_dir_entry *x25_proc_dir;
int __init x25_proc_init(void)
......@@ -222,17 +213,15 @@ int __init x25_proc_init(void)
if (!x25_proc_dir)
goto out;
p = create_proc_entry("route", 0, x25_proc_dir);
p = create_proc_entry("route", S_IRUGO, x25_proc_dir);
if (!p)
goto out_route;
p->proc_fops = &x25_seq_route_fops;
p->proc_iops = &x25_seq_inode;
p = create_proc_entry("socket", 0, x25_proc_dir);
p = create_proc_entry("socket", S_IRUGO, x25_proc_dir);
if (!p)
goto out_socket;
p->proc_fops = &x25_seq_socket_fops;
p->proc_iops = &x25_seq_inode;
rc = 0;
out:
return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment