From: Alex Kelly Date: Thu, 13 Sep 2012 01:01:28 +0000 (+1000) Subject: fs: amended coredump-related sysctl functions X-Git-Tag: next-20120920~2^2~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7c851c6799c82993bb79fa1c4034e60e2d37ecf0;p=karo-tx-linux.git fs: amended coredump-related sysctl functions This fixes an error introduced in the coredump-header patch in the coredump removal patch I submitted earlier. It should be squashed into that patch series so that the Kconfig option to remove coredump doesn't cause compile-time errors. Signed-off-by: Alex Kelly Reviewed-by: Josh Triplett Cc: Serge Hallyn Cc: Kees Cook Signed-off-by: Andrew Morton --- diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 41132300ea33..c2a2f8084bad 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -179,8 +179,10 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); +#ifdef CONFIG_COREDUMP static int proc_dostring_coredump(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); +#endif #ifdef CONFIG_MAGIC_SYSRQ /* Note: sysrq code uses it's own private copy */ @@ -2040,12 +2042,14 @@ int proc_dointvec_minmax(struct ctl_table *table, int write, static void validate_coredump_safety(void) { +#ifdef CONFIG_COREDUMP if (suid_dumpable == SUID_DUMPABLE_SAFE && core_pattern[0] != '/' && core_pattern[0] != '|') { printk(KERN_WARNING "Unsafe core_pattern used with "\ "suid_dumpable=2. Pipe handler or fully qualified "\ "core dump path required.\n"); } +#endif } static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, @@ -2057,6 +2061,7 @@ static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, return error; } +#ifdef CONFIG_COREDUMP static int proc_dostring_coredump(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { @@ -2065,6 +2070,7 @@ static int proc_dostring_coredump(struct ctl_table *table, int write, validate_coredump_safety(); return error; } +#endif static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, void __user *buffer,