Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106005
b: refs/heads/master
c: 4ecb900
h: refs/heads/master
i:
  106003: 7975c88
v: v3
  • Loading branch information
Stephen Hemminger authored and Linus Torvalds committed Jul 25, 2008
1 parent 7716721 commit df8006a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 99541c23cd32bacf1a591ca537a7c0cb9053ad7e
refs/heads/master: 4ecb90090c84210a8bd2a9d7a5906e616735873c
14 changes: 14 additions & 0 deletions trunk/net/sysctl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df8006a

Please sign in to comment.