summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-14 16:30:35 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-14 16:35:30 +0000
commite0d6e0fa55054b7eacf58c511abff710fef5712f (patch)
tree9f665e1f061c9d2fcd9a51c722c44a13f4a8036e /src
parentadb8ec96f2918fa7b39722ead6b2fe949fc3a7c5 (diff)
core: execute: validate syslog level and facility
Diffstat (limited to 'src')
-rw-r--r--src/core/dbus-execute.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index b87192a9ae..8b1f830476 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -888,6 +888,9 @@ int bus_exec_context_set_transient_property(
if (r < 0)
return r;
+ if (!log_level_is_valid(level))
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Log level value out of range");
+
if (mode != UNIT_CHECK) {
c->syslog_priority = (c->syslog_priority & LOG_FACMASK) | level;
unit_write_drop_in_private_format(u, mode, name, "SyslogLevel=%i\n", level);
@@ -901,6 +904,9 @@ int bus_exec_context_set_transient_property(
if (r < 0)
return r;
+ if (!log_facility_unshifted_is_valid(facility))
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Log facility value out of range");
+
if (mode != UNIT_CHECK) {
c->syslog_priority = (facility << 3) | LOG_PRI(c->syslog_priority);
unit_write_drop_in_private_format(u, mode, name, "SyslogFacility=%i\n", facility);