|
@@ -496,11 +496,11 @@ int check_syslog_permissions(int type, bool from_file)
|
|
* already done the capabilities checks at open time.
|
|
* already done the capabilities checks at open time.
|
|
*/
|
|
*/
|
|
if (from_file && type != SYSLOG_ACTION_OPEN)
|
|
if (from_file && type != SYSLOG_ACTION_OPEN)
|
|
- return 0;
|
|
|
|
|
|
+ goto ok;
|
|
|
|
|
|
if (syslog_action_restricted(type)) {
|
|
if (syslog_action_restricted(type)) {
|
|
if (capable(CAP_SYSLOG))
|
|
if (capable(CAP_SYSLOG))
|
|
- return 0;
|
|
|
|
|
|
+ goto ok;
|
|
/*
|
|
/*
|
|
* For historical reasons, accept CAP_SYS_ADMIN too, with
|
|
* For historical reasons, accept CAP_SYS_ADMIN too, with
|
|
* a warning.
|
|
* a warning.
|
|
@@ -510,10 +510,11 @@ int check_syslog_permissions(int type, bool from_file)
|
|
"CAP_SYS_ADMIN but no CAP_SYSLOG "
|
|
"CAP_SYS_ADMIN but no CAP_SYSLOG "
|
|
"(deprecated).\n",
|
|
"(deprecated).\n",
|
|
current->comm, task_pid_nr(current));
|
|
current->comm, task_pid_nr(current));
|
|
- return 0;
|
|
|
|
|
|
+ goto ok;
|
|
}
|
|
}
|
|
return -EPERM;
|
|
return -EPERM;
|
|
}
|
|
}
|
|
|
|
+ok:
|
|
return security_syslog(type);
|
|
return security_syslog(type);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1299,10 +1300,6 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
|
|
if (error)
|
|
if (error)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
- error = security_syslog(type);
|
|
|
|
- if (error)
|
|
|
|
- return error;
|
|
|
|
-
|
|
|
|
switch (type) {
|
|
switch (type) {
|
|
case SYSLOG_ACTION_CLOSE: /* Close log */
|
|
case SYSLOG_ACTION_CLOSE: /* Close log */
|
|
break;
|
|
break;
|