Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48388
b: refs/heads/master
c: 1ff007e
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Feb 14, 2007
1 parent 140095c commit 035e5a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 805b5d5e063e7fde5e2eb724e3f4cb18e47cab19
refs/heads/master: 1ff007eb8e8c7c44e9a384a67d0fdd0fd06ba811
2 changes: 2 additions & 0 deletions trunk/include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,10 @@ enum
#include <linux/list.h>

/* For the /proc/sys support */
struct ctl_table;
extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev);
extern void sysctl_head_finish(struct ctl_table_header *prev);
extern int sysctl_perm(struct ctl_table *table, int op);

extern void sysctl_init(void);

Expand Down
10 changes: 5 additions & 5 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
#endif /* CONFIG_SYSCTL_SYSCALL */

/*
* ctl_perm does NOT grant the superuser all rights automatically, because
* sysctl_perm does NOT grant the superuser all rights automatically, because
* some sysctl variables are readonly even to root.
*/

Expand All @@ -1172,7 +1172,7 @@ static int test_perm(int mode, int op)
return -EACCES;
}

static inline int ctl_perm(ctl_table *table, int op)
int sysctl_perm(ctl_table *table, int op)
{
int error;
error = security_sysctl(table, op);
Expand All @@ -1199,7 +1199,7 @@ static int parse_table(int __user *name, int nlen,
if (n == table->ctl_name) {
int error;
if (table->child) {
if (ctl_perm(table, 001))
if (sysctl_perm(table, 001))
return -EPERM;
name++;
nlen--;
Expand Down Expand Up @@ -1228,7 +1228,7 @@ int do_sysctl_strategy (ctl_table *table,
op |= 004;
if (newval)
op |= 002;
if (ctl_perm(table, op))
if (sysctl_perm(table, op))
return -EPERM;

if (table->strategy) {
Expand Down Expand Up @@ -1498,7 +1498,7 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf,
goto out;
error = -EPERM;
op = (write ? 002 : 004);
if (ctl_perm(table, op))
if (sysctl_perm(table, op))
goto out;

/* careful: calling conventions are nasty here */
Expand Down

0 comments on commit 035e5a8

Please sign in to comment.