• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/kernel/

Lines Matching refs:table

9 static int sysctl_depth(struct ctl_table *table)
15 for (tmp = table; tmp->parent; tmp = tmp->parent)
21 static struct ctl_table *sysctl_parent(struct ctl_table *table, int n)
25 for (i = 0; table && i < n; i++)
26 table = table->parent;
28 return table;
32 static void sysctl_print_path(struct ctl_table *table)
36 depth = sysctl_depth(table);
37 if (table->procname) {
39 tmp = sysctl_parent(table, i);
47 struct ctl_table *table)
53 depth = sysctl_depth(table);
60 test = sysctl_parent(table, cur_depth);
86 static void set_fail(const char **fail, struct ctl_table *table, const char *str)
89 printk(KERN_ERR "sysctl table check failed: ");
90 sysctl_print_path(table);
98 struct ctl_table *table, const char **fail)
102 ref = sysctl_check_lookup(namespaces, table);
103 if (ref && (ref != table))
104 set_fail(fail, table, "Sysctl already exists");
107 int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
110 for (; table->procname; table++) {
113 if (table->parent) {
114 if (table->procname && !table->parent->procname)
115 set_fail(&fail, table, "Parent without procname");
117 if (!table->procname)
118 set_fail(&fail, table, "No procname");
119 if (table->child) {
120 if (table->data)
121 set_fail(&fail, table, "Directory with data?");
122 if (table->maxlen)
123 set_fail(&fail, table, "Directory with maxlen?");
124 if ((table->mode & (S_IRUGO|S_IXUGO)) != table->mode)
125 set_fail(&fail, table, "Writable sysctl directory");
126 if (table->proc_handler)
127 set_fail(&fail, table, "Directory with proc_handler");
128 if (table->extra1)
129 set_fail(&fail, table, "Directory with extra1");
130 if (table->extra2)
131 set_fail(&fail, table, "Directory with extra2");
133 if ((table->proc_handler == proc_dostring) ||
134 (table->proc_handler == proc_dointvec) ||
135 (table->proc_handler == proc_dointvec_minmax) ||
136 (table->proc_handler == proc_dointvec_jiffies) ||
137 (table->proc_handler == proc_dointvec_userhz_jiffies) ||
138 (table->proc_handler == proc_dointvec_ms_jiffies) ||
139 (table->proc_handler == proc_doulongvec_minmax) ||
140 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
141 if (!table->data)
142 set_fail(&fail, table, "No data");
143 if (!table->maxlen)
144 set_fail(&fail, table, "No maxlen");
147 if (table->procname && !table->proc_handler)
148 set_fail(&fail, table, "No proc_handler");
150 sysctl_check_leaf(namespaces, table, &fail);
152 if (table->mode > 0777)
153 set_fail(&fail, table, "bogus .mode");
155 set_fail(&fail, table, NULL);
158 if (table->child)
159 error |= sysctl_check_table(namespaces, table->child);