[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#636501: WARNING: at kernel/printk.c:293 do_syslog+0x74/0x38f()



Gergely Nagy wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:

>> It looks like intended behavior.  I guess the syslogd should be using
>> CAP_SYSLOG these days.
>
> That is correct, even though I personally find the warning stupid and
> only annoying users.

I agree, especially since it's a normal condition when using a new
kernel with old userspace.  But people writing userspace tools deserve
a hint that they are doing something discouraged.  How about something
like this?

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 kernel/printk.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git i/kernel/printk.c w/kernel/printk.c
index 37dff342..db64c951 100644
--- i/kernel/printk.c
+++ w/kernel/printk.c
@@ -318,7 +318,8 @@ static int check_syslog_permissions(int type, bool from_file)
 			return 0;
 		/* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
 		if (capable(CAP_SYS_ADMIN)) {
-			WARN_ONCE(1, "Attempt to access syslog with CAP_SYS_ADMIN "
+			printk_once(KERN_WARNING
+				 "Attempt to access syslog with CAP_SYS_ADMIN "
 				 "but no CAP_SYSLOG (deprecated).\n");
 			return 0;
 		}
-- 



Reply to: