diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-01-18 23:56:19 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2015-01-18 23:56:19 +0100 |
commit | 314808cea4d7655b881ce7b1204efa476e7b8fbb (patch) | |
tree | a5389b4f96b4649ba2e7c02c95cf186c53651f68 /src/libsystemd | |
parent | 90b99192ad5b7674585996e2b801679989f8a8a7 (diff) |
bus: drop systemd.kdbus_attach_flags_mask= cmdline
There is no reason to provide our own attach_flags_mask. We can simply
rely on kdbus.attach_flags_mask= which is read by the kernel *and* kmod.
If it's set, we assume the user wants to override our setting, so we
simply skip setting it.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index bd829459de..e73a5077b5 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -1741,30 +1741,21 @@ int bus_kernel_fix_attach_mask(void) { /* By default we don't want any kdbus metadata fields to be * suppressed, hence we reset the kernel mask for it to - * (uint64_t) -1. This is overridable via a kernel command - * line option, however. */ + * (uint64_t) -1. If the module argument was overwritten by + * the kernel cmdline, we leave it as is. */ - r = get_proc_cmdline_key("systemd.kdbus_attach_flags_mask=", &mask); + r = get_proc_cmdline_key("kdbus.attach_flags_mask=", &mask); if (r < 0) return log_warning_errno(r, "Failed to read kernel command line: %m"); - if (mask) { - const char *p = mask; - - if (startswith(p, "0x")) - p += 2; - - if (sscanf(p, "%" PRIx64, &m) != 1) - log_warning("Couldn't parse systemd.kdbus_attach_flags_mask= kernel command line parameter."); + if (r == 0) { + sprintf(buf, "0x%" PRIx64 "\n", m); + r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf); + if (r < 0) + return log_full_errno(IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to write kdbus attach mask: %m"); } - sprintf(buf, "0x%" PRIx64 "\n", m); - r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf); - if (r < 0) - return log_full_errno( - IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, - "Failed to write kdbus attach mask: %m"); - return 0; } |