patch-2.1.129 linux/kernel/printk.c

Next file: linux/kernel/signal.c
Previous file: linux/kernel/acct.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.128/linux/kernel/printk.c linux/kernel/printk.c
@@ -105,7 +105,7 @@
 
 
 /*
- * Commands to sys_syslog:
+ * Commands to do_syslog:
  *
  * 	0 -- Close the log.  Currently a NOP.
  * 	1 -- Open the log. Currently a NOP.
@@ -117,7 +117,7 @@
  * 	7 -- Enable printk's to console
  *	8 -- Set level of messages printed to console
  */
-asmlinkage int sys_syslog(int type, char * buf, int len)
+int do_syslog(int type, char * buf, int len)
 {
 	unsigned long i, j, count, flags;
 	int do_clear = 0;
@@ -125,8 +125,6 @@
 	int error = -EPERM;
 
 	lock_kernel();
-	if ((type != 3) && !capable(CAP_SYS_ADMIN))
-		goto out;
 	error = 0;
 	switch (type) {
 	case 0:		/* Close log */
@@ -227,6 +225,14 @@
 	unlock_kernel();
 	return error;
 }
+
+asmlinkage int sys_syslog(int type, char * buf, int len)
+{
+	if ((type != 3) && !capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	return do_syslog(type, buf, len);
+}
+
 
 spinlock_t console_lock;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov