mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
sysctl: Add ctl_table chains into cstring paths
For any component of table passed to __register_sysctl_paths that actually serves as a path, add that to the cstring path that is passed to __register_sysctl_table. The result is that for most calls to __register_sysctl_paths we only pass a table to __register_sysctl_table that contains no child directories. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
parent
6e9d516415
commit
ec6a52668d
1 changed files with 9 additions and 0 deletions
|
@ -1076,6 +1076,7 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||||
struct nsproxy *namespaces,
|
struct nsproxy *namespaces,
|
||||||
const struct ctl_path *path, struct ctl_table *table)
|
const struct ctl_path *path, struct ctl_table *table)
|
||||||
{
|
{
|
||||||
|
struct ctl_table *ctl_table_arg = table;
|
||||||
struct ctl_table_header *header = NULL;
|
struct ctl_table_header *header = NULL;
|
||||||
const struct ctl_path *component;
|
const struct ctl_path *component;
|
||||||
char *new_path, *pos;
|
char *new_path, *pos;
|
||||||
|
@ -1090,7 +1091,15 @@ struct ctl_table_header *__register_sysctl_paths(
|
||||||
if (!pos)
|
if (!pos)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
while (table->procname && table->child && !table[1].procname) {
|
||||||
|
pos = append_path(new_path, pos, table->procname);
|
||||||
|
if (!pos)
|
||||||
|
goto out;
|
||||||
|
table = table->child;
|
||||||
|
}
|
||||||
header = __register_sysctl_table(root, namespaces, new_path, table);
|
header = __register_sysctl_table(root, namespaces, new_path, table);
|
||||||
|
if (header)
|
||||||
|
header->ctl_table_arg = ctl_table_arg;
|
||||||
out:
|
out:
|
||||||
kfree(new_path);
|
kfree(new_path);
|
||||||
return header;
|
return header;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue