diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-06-16 00:24:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 00:24:54 +0200 |
commit | ad64e3e8d649949a33be6daae6e9821e694b37c2 (patch) | |
tree | 68de3ae762b0c33013e767021801dce8c096207c /src/shared | |
parent | e7848266dae240abe64aba1b1086ba8025ae50ad (diff) | |
parent | a5f19be8b1e3c2bff9b84f0484a84aa716ab2524 (diff) | |
download | systemd-ad64e3e8d649949a33be6daae6e9821e694b37c2.tar.gz |
Merge pull request #19942 from wat-ze-hex/socket-bind-ip-proto-2021-06-10v249-rc1
dbus: extend SocktBind{Allow|Deny}= with ip proto
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bus-unit-util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 54d04aae50..4c9fb305e4 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -866,11 +866,12 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons if (STR_IN_SET(field, "SocketBindAllow", "SocketBindDeny")) { if (isempty(eq)) - r = sd_bus_message_append(m, "(sv)", field, "a(iqq)", 0); + r = sd_bus_message_append(m, "(sv)", field, "a(iiqq)", 0); else { + /* No ip protocol specified for now. */ + int32_t family = AF_UNSPEC, ip_protocol = 0; const char *address_family, *user_port; _cleanup_free_ char *word = NULL; - int family = AF_UNSPEC; r = extract_first_word(&eq, &word, ":", 0); if (r == -ENOMEM) @@ -888,7 +889,7 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons user_port = eq ? eq : word; if (streq(user_port, "any")) { - r = sd_bus_message_append(m, "(sv)", field, "a(iqq)", 1, family, 0, 0); + r = sd_bus_message_append(m, "(sv)", field, "a(iiqq)", 1, family, ip_protocol, 0, 0); if (r < 0) return bus_log_create_error(r); } else { @@ -901,7 +902,7 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons return log_error_errno(r, "Invalid port or port range: %s", user_port); r = sd_bus_message_append( - m, "(sv)", field, "a(iqq)", 1, family, port_max - port_min + 1, port_min); + m, "(sv)", field, "a(iiqq)", 1, family, ip_protocol, port_max - port_min + 1, port_min); } } if (r < 0) |