Skip to contentSkip to conversation

sysctl: fix false positives when PROC_SYSCTL=n

PATCH In review Alexey Dobriyan 2 participants 2 messages Oct 16, 2009 3 messages not in the archive Proc sysctl

lore
Share & tools
lore
#3 lore raw

PATCH 1/1 sysctl: fix false positives when PROC_SYSCTL=n

In reply to a message not in the archive

Having ->procname but not ->proc_handler is valid when PROC_SYSCTL=n, people use such combination to reduce ifdefs with non-standard handlers.

http://bugzilla.kernel.org/show_bug.cgi?id=14408

---

 kernel/sysctl_check.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sysctl_check.c +1 -1
@@ -1521,7 +1521,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
 			if (!table->ctl_name && table->strategy)
 				set_fail(&fail, table, "Strategy without ctl_name");
 #endif
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_PROC_SYSCTL
 			if (table->procname && !table->proc_handler)
 				set_fail(&fail, table, "No proc_handler");
 #endif
Acked-by on v1 1/1
#4 lore raw
Quoted 4 lines · Alexey Dobriyan

Having ->procname but not ->proc_handler is valid when PROC_SYSCTL=n, people use such combination to reduce ifdefs with non-standard handlers.

http://bugzilla.kernel.org/show_bug.cgi?id=14408

It looks like I messed up when I wrote sysctl_check.c and used the wrong ifdef. Silly me. Especially since I had added PROC_SYSCTL earlier.

Eric

Quoted 17 lines

---

 kernel/sysctl_check.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sysctl_check.c +1 -1
@@ -1521,7 +1521,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
 			if (!table->ctl_name && table->strategy)
 				set_fail(&fail, table, "Strategy without ctl_name");
 #endif
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_PROC_SYSCTL
 			if (table->procname && !table->proc_handler)
 				set_fail(&fail, table, "No proc_handler");
 #endif