• Home
  • Raw
  • Download

Lines Matching refs:table

1241 static int sysctl_depth(struct ctl_table *table)  in sysctl_depth()  argument
1247 for (tmp = table; tmp->parent; tmp = tmp->parent) in sysctl_depth()
1253 static struct ctl_table *sysctl_parent(struct ctl_table *table, int n) in sysctl_parent() argument
1257 for (i = 0; table && i < n; i++) in sysctl_parent()
1258 table = table->parent; in sysctl_parent()
1260 return table; in sysctl_parent()
1263 static const struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table) in sysctl_binary_lookup() argument
1269 cur_depth = sysctl_depth(table); in sysctl_binary_lookup()
1273 test = sysctl_parent(table, cur_depth); in sysctl_binary_lookup()
1305 static void sysctl_print_path(struct ctl_table *table) in sysctl_print_path() argument
1309 depth = sysctl_depth(table); in sysctl_print_path()
1310 if (table->procname) { in sysctl_print_path()
1312 tmp = sysctl_parent(table, i); in sysctl_print_path()
1317 if (table->ctl_name) { in sysctl_print_path()
1319 tmp = sysctl_parent(table, i); in sysctl_print_path()
1325 static void sysctl_repair_table(struct ctl_table *table) in sysctl_repair_table() argument
1332 if (table->ctl_name && table->procname && in sysctl_repair_table()
1333 (table->proc_handler == proc_dointvec) && in sysctl_repair_table()
1334 (!table->strategy)) { in sysctl_repair_table()
1335 table->strategy = sysctl_data; in sysctl_repair_table()
1340 struct ctl_table *table) in sysctl_check_lookup() argument
1346 depth = sysctl_depth(table); in sysctl_check_lookup()
1353 test = sysctl_parent(table, cur_depth); in sysctl_check_lookup()
1383 static void set_fail(const char **fail, struct ctl_table *table, const char *str) in set_fail() argument
1387 sysctl_print_path(table); in set_fail()
1395 struct ctl_table *table) in sysctl_check_dir() argument
1401 ref = sysctl_check_lookup(namespaces, table); in sysctl_check_dir()
1404 if ((!table->procname && !ref->procname) || in sysctl_check_dir()
1405 (table->procname && ref->procname && in sysctl_check_dir()
1406 (strcmp(table->procname, ref->procname) == 0))) in sysctl_check_dir()
1409 if ((!table->ctl_name && !ref->ctl_name) || in sysctl_check_dir()
1410 (table->ctl_name && ref->ctl_name && in sysctl_check_dir()
1411 (table->ctl_name == ref->ctl_name))) in sysctl_check_dir()
1416 sysctl_print_path(table); in sysctl_check_dir()
1427 struct ctl_table *table, const char **fail) in sysctl_check_leaf() argument
1431 ref = sysctl_check_lookup(namespaces, table); in sysctl_check_leaf()
1432 if (ref && (ref != table)) in sysctl_check_leaf()
1433 set_fail(fail, table, "Sysctl already exists"); in sysctl_check_leaf()
1436 static void sysctl_check_bin_path(struct ctl_table *table, const char **fail) in sysctl_check_bin_path() argument
1440 ref = sysctl_binary_lookup(table); in sysctl_check_bin_path()
1441 if (table->ctl_name && !ref) in sysctl_check_bin_path()
1442 set_fail(fail, table, "Unknown sysctl binary path"); in sysctl_check_bin_path()
1445 (!table->procname || in sysctl_check_bin_path()
1446 (strcmp(table->procname, ref->procname) != 0))) in sysctl_check_bin_path()
1447 set_fail(fail, table, "procname does not match binary path procname"); in sysctl_check_bin_path()
1449 if (ref->ctl_name && table->ctl_name && in sysctl_check_bin_path()
1450 (table->ctl_name != ref->ctl_name)) in sysctl_check_bin_path()
1451 set_fail(fail, table, "ctl_name does not match binary path ctl_name"); in sysctl_check_bin_path()
1455 int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) in sysctl_check_table() argument
1458 for (; table->ctl_name || table->procname; table++) { in sysctl_check_table()
1461 sysctl_repair_table(table); in sysctl_check_table()
1462 if (table->parent) { in sysctl_check_table()
1463 if (table->procname && !table->parent->procname) in sysctl_check_table()
1464 set_fail(&fail, table, "Parent without procname"); in sysctl_check_table()
1465 if (table->ctl_name && !table->parent->ctl_name) in sysctl_check_table()
1466 set_fail(&fail, table, "Parent without ctl_name"); in sysctl_check_table()
1468 if (!table->procname) in sysctl_check_table()
1469 set_fail(&fail, table, "No procname"); in sysctl_check_table()
1470 if (table->child) { in sysctl_check_table()
1471 if (table->data) in sysctl_check_table()
1472 set_fail(&fail, table, "Directory with data?"); in sysctl_check_table()
1473 if (table->maxlen) in sysctl_check_table()
1474 set_fail(&fail, table, "Directory with maxlen?"); in sysctl_check_table()
1475 if ((table->mode & (S_IRUGO|S_IXUGO)) != table->mode) in sysctl_check_table()
1476 set_fail(&fail, table, "Writable sysctl directory"); in sysctl_check_table()
1477 if (table->proc_handler) in sysctl_check_table()
1478 set_fail(&fail, table, "Directory with proc_handler"); in sysctl_check_table()
1479 if (table->strategy) in sysctl_check_table()
1480 set_fail(&fail, table, "Directory with strategy"); in sysctl_check_table()
1481 if (table->extra1) in sysctl_check_table()
1482 set_fail(&fail, table, "Directory with extra1"); in sysctl_check_table()
1483 if (table->extra2) in sysctl_check_table()
1484 set_fail(&fail, table, "Directory with extra2"); in sysctl_check_table()
1485 if (sysctl_check_dir(namespaces, table)) in sysctl_check_table()
1486 set_fail(&fail, table, "Inconsistent directory names"); in sysctl_check_table()
1488 if ((table->strategy == sysctl_data) || in sysctl_check_table()
1489 (table->strategy == sysctl_string) || in sysctl_check_table()
1490 (table->strategy == sysctl_intvec) || in sysctl_check_table()
1491 (table->strategy == sysctl_jiffies) || in sysctl_check_table()
1492 (table->strategy == sysctl_ms_jiffies) || in sysctl_check_table()
1493 (table->proc_handler == proc_dostring) || in sysctl_check_table()
1494 (table->proc_handler == proc_dointvec) || in sysctl_check_table()
1495 (table->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1496 (table->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1497 (table->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1498 (table->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1499 (table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1500 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1501 if (!table->data) in sysctl_check_table()
1502 set_fail(&fail, table, "No data"); in sysctl_check_table()
1503 if (!table->maxlen) in sysctl_check_table()
1504 set_fail(&fail, table, "No maxlen"); in sysctl_check_table()
1506 if ((table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1507 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1508 if (table->maxlen > sizeof (unsigned long)) { in sysctl_check_table()
1509 if (!table->extra1) in sysctl_check_table()
1510 set_fail(&fail, table, "No min"); in sysctl_check_table()
1511 if (!table->extra2) in sysctl_check_table()
1512 set_fail(&fail, table, "No max"); in sysctl_check_table()
1516 if (table->ctl_name && !table->strategy) in sysctl_check_table()
1517 set_fail(&fail, table, "Missing strategy"); in sysctl_check_table()
1520 if (!table->ctl_name && table->strategy) in sysctl_check_table()
1521 set_fail(&fail, table, "Strategy without ctl_name"); in sysctl_check_table()
1524 if (table->procname && !table->proc_handler) in sysctl_check_table()
1525 set_fail(&fail, table, "No proc_handler"); in sysctl_check_table()
1528 if (!table->procname && table->proc_handler) in sysctl_check_table()
1529 set_fail(&fail, table, "proc_handler without procname"); in sysctl_check_table()
1531 sysctl_check_leaf(namespaces, table, &fail); in sysctl_check_table()
1533 sysctl_check_bin_path(table, &fail); in sysctl_check_table()
1534 if (table->mode > 0777) in sysctl_check_table()
1535 set_fail(&fail, table, "bogus .mode"); in sysctl_check_table()
1537 set_fail(&fail, table, NULL); in sysctl_check_table()
1540 if (table->child) in sysctl_check_table()
1541 error |= sysctl_check_table(namespaces, table->child); in sysctl_check_table()