Patch from Vitaliy Gusev <[EMAIL PROTECTED]>
Fix syslog issues for LTP testscase. Problem was that LTP test calls syslog(2) 
with wrong arguments  and waiting
for a error but syslog() returns zero.

Fixes: http://bugzilla.openvz.org/show_bug.cgi?id=584

-- 
Vitaliy Gusev

--- linux-2.6.18.i686/kernel/printk.c.orig      2007-06-01 12:15:27.000000000 
+0400
+++ linux-2.6.18.i686/kernel/printk.c   2007-06-01 12:36:50.000000000 +0400
@@ -234,9 +234,9 @@ int do_syslog(int type, char __user *buf
        int do_clear = 0;
        char c;
        int error = 0;
+       int is_super = ve_is_super(get_exec_env());
 
-       if (!ve_is_super(get_exec_env()) &&
-                       (type == 6 || type == 7 || type == 8))
+       if (!is_super && (type == 6 || type == 7))
                goto out;
 
        error = security_syslog(type);
@@ -350,6 +350,10 @@ int do_syslog(int type, char __user *buf
                error = -EINVAL;
                if (len < 1 || len > 8)
                        goto out;
+               else if (!is_super) {
+                       error = 0;
+                       goto out;
+               }
                if (len < minimum_console_loglevel)
                        len = minimum_console_loglevel;
                console_loglevel = len;
_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to