summaryrefslogtreecommitdiffstats
path: root/net/sysctl_net.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-26 11:26:19 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-26 11:26:19 +0200
commit88bef5a4074e0568cf54df410f41065c06694d8a (patch)
treebc4d59f57ce315bcb16dad5491ab9983ab122d8a /net/sysctl_net.c
parent054a3fd824705543322d787893de9f3755151517 (diff)
parent024e8ac04453b3525448c31ef39848cf675ba6db (diff)
downloadlinux-88bef5a4074e0568cf54df410f41065c06694d8a.tar.gz
linux-88bef5a4074e0568cf54df410f41065c06694d8a.tar.bz2
linux-88bef5a4074e0568cf54df410f41065c06694d8a.zip
Merge branch 'linus' into x86/urgent
Diffstat (limited to 'net/sysctl_net.c')
-rw-r--r--net/sysctl_net.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 007c1a6708ee..63ada437fc2f 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -35,8 +35,22 @@ net_ctl_header_lookup(struct ctl_table_root *root, struct nsproxy *namespaces)
return &namespaces->net_ns->sysctl_table_headers;
}
+/* Return standard mode bits for table entry. */
+static int net_ctl_permissions(struct ctl_table_root *root,
+ struct nsproxy *nsproxy,
+ struct ctl_table *table)
+{
+ /* Allow network administrator to have same access as root. */
+ if (capable(CAP_NET_ADMIN)) {
+ int mode = (table->mode >> 6) & 7;
+ return (mode << 6) | (mode << 3) | mode;
+ }
+ return table->mode;
+}
+
static struct ctl_table_root net_sysctl_root = {
.lookup = net_ctl_header_lookup,
+ .permissions = net_ctl_permissions,
};
static LIST_HEAD(net_sysctl_ro_tables);