Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43768
b: refs/heads/master
c: c4b8b76
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Dec 8, 2006
1 parent b761b81 commit 05ae26a
Show file tree
Hide file tree
Showing 2 changed files with 33 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: cf9f151c7257683f489df85f94baf408d1d5694a
refs/heads/master: c4b8b769fa9051838d2772886ecd0ee2a926ddc3
37 changes: 32 additions & 5 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ static int parse_table(int __user *, int, void __user *, size_t __user *,
static int proc_do_uts_string(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos);

static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context);

#ifdef CONFIG_PROC_SYSCTL
static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos);
Expand Down Expand Up @@ -258,7 +262,7 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(init_uts_ns.name.sysname),
.mode = 0444,
.proc_handler = &proc_do_uts_string,
.strategy = &sysctl_string,
.strategy = &sysctl_uts_string,
},
{
.ctl_name = KERN_OSRELEASE,
Expand All @@ -267,7 +271,7 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(init_uts_ns.name.release),
.mode = 0444,
.proc_handler = &proc_do_uts_string,
.strategy = &sysctl_string,
.strategy = &sysctl_uts_string,
},
{
.ctl_name = KERN_VERSION,
Expand All @@ -276,7 +280,7 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(init_uts_ns.name.version),
.mode = 0444,
.proc_handler = &proc_do_uts_string,
.strategy = &sysctl_string,
.strategy = &sysctl_uts_string,
},
{
.ctl_name = KERN_NODENAME,
Expand All @@ -285,7 +289,7 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(init_uts_ns.name.nodename),
.mode = 0644,
.proc_handler = &proc_do_uts_string,
.strategy = &sysctl_string,
.strategy = &sysctl_uts_string,
},
{
.ctl_name = KERN_DOMAINNAME,
Expand All @@ -294,7 +298,7 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(init_uts_ns.name.domainname),
.mode = 0644,
.proc_handler = &proc_do_uts_string,
.strategy = &sysctl_string,
.strategy = &sysctl_uts_string,
},
{
.ctl_name = KERN_PANIC,
Expand Down Expand Up @@ -2598,6 +2602,23 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
return 1;
}


/* The generic string strategy routine: */
static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
{
struct ctl_table uts_table;
int r, write;
write = newval && newlen;
memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write);
r = sysctl_string(&uts_table, name, nlen,
oldval, oldlenp, newval, newlen, context);
put_uts(table, write, uts_table.data);
return r;
}

#else /* CONFIG_SYSCTL_SYSCALL */


Expand Down Expand Up @@ -2662,6 +2683,12 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
return -ENOSYS;
}

static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void **context)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL_SYSCALL */

/*
Expand Down

0 comments on commit 05ae26a

Please sign in to comment.