diff options
author | Daniel De Graaf <danield@iastate.edu> | 2006-08-22 03:30:55 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:55:23 -0400 |
commit | b93ff78317c0b8f42830e2bb13dd8df596232528 (patch) | |
tree | 1a37f733e793463c196f31aebe03e2b5058c991f | |
parent | a468701db58a8b3e08e3f55fa6ac66db42014922 (diff) |
[NETFILTER]: ipt_recent: add module parameter for changing ownership of /proc/net/ipt_recent/*
Signed-off-by: Daniel De Graaf <danield@iastate.edu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/ipt_recent.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 61a2139f9cfd..682c0946201e 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -35,14 +35,20 @@ static unsigned int ip_list_tot = 100; | |||
35 | static unsigned int ip_pkt_list_tot = 20; | 35 | static unsigned int ip_pkt_list_tot = 20; |
36 | static unsigned int ip_list_hash_size = 0; | 36 | static unsigned int ip_list_hash_size = 0; |
37 | static unsigned int ip_list_perms = 0644; | 37 | static unsigned int ip_list_perms = 0644; |
38 | static unsigned int ip_list_uid = 0; | ||
39 | static unsigned int ip_list_gid = 0; | ||
38 | module_param(ip_list_tot, uint, 0400); | 40 | module_param(ip_list_tot, uint, 0400); |
39 | module_param(ip_pkt_list_tot, uint, 0400); | 41 | module_param(ip_pkt_list_tot, uint, 0400); |
40 | module_param(ip_list_hash_size, uint, 0400); | 42 | module_param(ip_list_hash_size, uint, 0400); |
41 | module_param(ip_list_perms, uint, 0400); | 43 | module_param(ip_list_perms, uint, 0400); |
44 | module_param(ip_list_uid, uint, 0400); | ||
45 | module_param(ip_list_gid, uint, 0400); | ||
42 | MODULE_PARM_DESC(ip_list_tot, "number of IPs to remember per list"); | 46 | MODULE_PARM_DESC(ip_list_tot, "number of IPs to remember per list"); |
43 | MODULE_PARM_DESC(ip_pkt_list_tot, "number of packets per IP to remember (max. 255)"); | 47 | MODULE_PARM_DESC(ip_pkt_list_tot, "number of packets per IP to remember (max. 255)"); |
44 | MODULE_PARM_DESC(ip_list_hash_size, "size of hash table used to look up IPs"); | 48 | MODULE_PARM_DESC(ip_list_hash_size, "size of hash table used to look up IPs"); |
45 | MODULE_PARM_DESC(ip_list_perms, "permissions on /proc/net/ipt_recent/* files"); | 49 | MODULE_PARM_DESC(ip_list_perms, "permissions on /proc/net/ipt_recent/* files"); |
50 | MODULE_PARM_DESC(ip_list_uid,"owner of /proc/net/ipt_recent/* files"); | ||
51 | MODULE_PARM_DESC(ip_list_gid,"owning group of /proc/net/ipt_recent/* files"); | ||
46 | 52 | ||
47 | 53 | ||
48 | struct recent_entry { | 54 | struct recent_entry { |
@@ -274,6 +280,8 @@ ipt_recent_checkentry(const char *tablename, const void *ip, | |||
274 | goto out; | 280 | goto out; |
275 | } | 281 | } |
276 | t->proc->proc_fops = &recent_fops; | 282 | t->proc->proc_fops = &recent_fops; |
283 | t->proc->uid = ip_list_uid; | ||
284 | t->proc->gid = ip_list_gid; | ||
277 | t->proc->data = t; | 285 | t->proc->data = t; |
278 | #endif | 286 | #endif |
279 | spin_lock_bh(&recent_lock); | 287 | spin_lock_bh(&recent_lock); |