diff options
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 36a29fbdc0..a5d6edbba9 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1497,7 +1497,29 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen "RootDirectory", "SyslogIdentifier")) r = sd_bus_message_append(m, "v", "s", eq); - else if (streq(field, "DeviceAllow")) { + else if (streq(field, "SyslogLevel")) { + int level; + + level = log_level_from_string(eq); + if (level < 0) { + log_error("Failed to parse %s value %s.", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "i", level); + + } else if (streq(field, "SyslogFacility")) { + int facility; + + facility = log_facility_unshifted_from_string(eq); + if (facility < 0) { + log_error("Failed to parse %s value %s.", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "i", facility); + + } else if (streq(field, "DeviceAllow")) { if (isempty(eq)) r = sd_bus_message_append(m, "v", "a(ss)", 0); @@ -1633,7 +1655,16 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen } r = sd_bus_message_append(m, "v", "t", u); + } else if (streq(field, "TimerSlackNSec")) { + nsec_t n; + r = parse_nsec(eq, &n); + if (r < 0) { + log_error("Failed to parse %s value %s", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "t", n); } else { log_error("Unknown assignment %s.", assignment); return -EINVAL; @@ -2163,7 +2194,7 @@ int bus_property_get_rlimit( struct rlimit buf = {}; int z; - z = rlimit_from_string(startswith(property, "Default") ? property + 7 : property); + z = rlimit_from_string(strstr(property, "Limit")); assert(z >= 0); getrlimit(z, &buf); |