]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #15297 from poettering/homed-no-fallocate
authorAnita Zhang <the.anitazha@gmail.com>
Fri, 3 Apr 2020 22:49:43 +0000 (15:49 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Apr 2020 22:49:43 +0000 (15:49 -0700)
homed: fall back to ftruncate() if fallocate() is not supported on ba…

42 files changed:
TODO
man/networkctl.xml
man/rules/meson.build
man/sd-bus.xml
man/sd_bus_call_method.xml
man/sd_bus_message_set_destination.xml
man/sd_bus_reply_method_error.xml
man/sd_bus_reply_method_return.xml
man/systemd.network.xml
presets/90-systemd.preset
src/basic/capability-util.c
src/basic/string-util.c
src/basic/string-util.h
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd/libsystemd.sym
src/libsystemd/sd-bus/bus-convenience.c
src/libsystemd/sd-bus/sd-bus.c
src/network/networkctl.c
src/network/networkd-can.c
src/network/networkd-can.h
src/network/networkd-dhcp-common.c
src/network/networkd-dhcp-common.h
src/network/networkd-dhcp6.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h
src/resolve/resolved-etc-hosts.c
src/resolve/resolved-manager.c
src/resolve/resolved-manager.h
src/shared/dissect-image.c
src/systemd/sd-bus.h
src/systemd/sd-dhcp6-client.h
src/test/test-strv.c
src/udev/net/link-config.c
test/fuzz/fuzz-network-parser/directives.network
test/test-functions
test/units/testsuite-46.service
units/meson.build
units/systemd-homed.service.in
units/systemd-repart.service.in
units/systemd-userdbd.service.in
units/systemd-userdbd.socket

diff --git a/TODO b/TODO
index e944245a57b4aa69a1c2ff58053e136e08c441e1..ef204dfed05ea3607ca17e0dd79f9a8d3aff1c77 100644 (file)
--- a/TODO
+++ b/TODO
@@ -19,6 +19,10 @@ Janitorial Clean-ups:
 
 Features:
 
+* drop sd_bus_message_set_priority() from sd-bus API and documentation as much
+  as we can, it's a kdbus left-over and unlikely to come back on AF_UNIX, since
+  it's not really implementable there.
+
 * cryptsetup/homed: also support FIDO2 HMAC password logic for unlocking
   devices. (see: https://github.com/mjec/fido2-hmac-secret)
 
@@ -113,7 +117,8 @@ Features:
 
 * systemd-repart: allow config of partition uuid
 
-* userdb: allow username prefix searches in varlink API
+* userdb: allow username prefix searches in varlink API, allow realname and
+  realname substr searches in varlink API
 
 * userdb: allow existence checks
 
@@ -860,6 +865,7 @@ Features:
     make assumptions about their slice anymore.
   - follow PropertiesChanged state more closely, to deal with quick logouts and
     relogins
+  - (optionally?) spawn seat-manager@$SEAT.service whenever a seat shows up that as CanGraphical set
 
 * journal:
   - consider introducing implicit _TTY= + _PPID= + _EUID= + _EGID= + _FSUID= + _FSGID= fields
index 4906f7a330bb7895d59da4035cf8688526bd4051..a6bc61a44fc17919a758293697311d2996438b73 100644 (file)
@@ -259,6 +259,20 @@ s - Service VLAN, m - Two-port MAC Relay (TPMR)
         <listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para></listitem>
       </varlistentry>
 
+       <varlistentry>
+        <term>
+          <command>up</command>
+        </term>
+        <listitem><para>Bring devices up. Takes interface name or index number.</para></listitem>
+      </varlistentry>
+
+       <varlistentry>
+        <term>
+          <command>down</command>
+        </term>
+        <listitem><para>Bring devices down. Takes interface name or index number.</para></listitem>
+      </varlistentry>
+
        <varlistentry>
         <term>
           <command>renew</command>
index 5620ba1e5bf626eebfcc5c57fddb73097cb234ff..9cdfe5d2919820aa50315254c8c97589c2428385 100644 (file)
@@ -291,9 +291,7 @@ manpages = [
    'sd_bus_message_get_interface',
    'sd_bus_message_get_member',
    'sd_bus_message_get_path',
-   'sd_bus_message_get_priority',
    'sd_bus_message_get_sender',
-   'sd_bus_message_set_priority',
    'sd_bus_message_set_sender'],
   ''],
  ['sd_bus_message_set_expect_reply',
index a5f493b2cee38d3965bc0b798e2f8db4345fa83b..4f1d8355d685675428655879e3a2e5185622262e 100644 (file)
@@ -70,7 +70,6 @@
 <citerefentry><refentrytitle>sd_bus_message_dump</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_get_cookie</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>sd_bus_message_get_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_get_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_get_signature</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_get_type</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@@ -84,7 +83,6 @@
 <citerefentry><refentrytitle>sd_bus_message_rewind</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_seal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_set_destination</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>sd_bus_message_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_set_expect_reply</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sd_bus_message_skip</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
index de29ac961057d8399862fc2c2bd834bbf8b13df3..870a78035a902fa2f9e95f8036bc23f2bca2a846 100644 (file)
@@ -18,7 +18,9 @@
 
   <refnamediv>
     <refname>sd_bus_call_method</refname>
+    <refname>sd_bus_call_methodv</refname>
     <refname>sd_bus_call_method_async</refname>
+    <refname>sd_bus_call_method_asyncv</refname>
 
     <refpurpose>Initialize a bus message object and invoke the corresponding D-Bus method call
     </refpurpose>
         <paramdef>...</paramdef>
       </funcprototype>
 
+      <funcprototype>
+        <funcdef>int <function>sd_bus_call_methodv</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>const char *<parameter>destination</parameter></paramdef>
+        <paramdef>const char *<parameter>path</parameter></paramdef>
+        <paramdef>const char *<parameter>interface</parameter></paramdef>
+        <paramdef>const char *<parameter>member</parameter></paramdef>
+        <paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
+        <paramdef>sd_bus_message **<parameter>reply</parameter></paramdef>
+        <paramdef>const char *<parameter>types</parameter></paramdef>
+        <paramdef>va_list <parameter>ap</parameter></paramdef>
+      </funcprototype>
+
       <funcprototype>
         <funcdef>int <function>sd_bus_call_method_async</function></funcdef>
         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
         <paramdef>const char *<parameter>types</parameter></paramdef>
         <paramdef>...</paramdef>
       </funcprototype>
+
+      <funcprototype>
+        <funcdef>int <function>sd_bus_call_method_asyncv</function></funcdef>
+        <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+        <paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
+        <paramdef>const char *<parameter>destination</parameter></paramdef>
+        <paramdef>const char *<parameter>path</parameter></paramdef>
+        <paramdef>const char *<parameter>interface</parameter></paramdef>
+        <paramdef>const char *<parameter>member</parameter></paramdef>
+        <paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef>
+        <paramdef>void *<parameter>userdata</parameter></paramdef>
+        <paramdef>const char *<parameter>types</parameter></paramdef>
+        <paramdef>va_list <parameter>ap</parameter></paramdef>
+      </funcprototype>
     </funcsynopsis>
   </refsynopsisdiv>
 
index 126778fc3cec8ef1ef3c822a7bf2dfa96be2cbfb..51da5ff3b89e4a81da4153e3ca33e85fc6c2ba14 100644 (file)
@@ -19,8 +19,6 @@
     <refname>sd_bus_message_get_path</refname>
     <refname>sd_bus_message_get_interface</refname>
     <refname>sd_bus_message_get_member</refname>
-    <refname>sd_bus_message_set_priority</refname>
-    <refname>sd_bus_message_get_priority</refname>
     <refname>sd_bus_message_set_sender</refname>
     <refname>sd_bus_message_get_sender</refname>
 
         <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
       </funcprototype>
 
-      <funcprototype>
-        <funcdef>int <function>sd_bus_message_set_priority</function></funcdef>
-        <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
-        <paramdef>int64_t <parameter>priority</parameter></paramdef>
-      </funcprototype>
-
-      <funcprototype>
-        <funcdef>int <function>sd_bus_message_get_priority</function></funcdef>
-        <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
-        <paramdef>int64_t *<parameter>priority</parameter></paramdef>
-      </funcprototype>
-
       <funcprototype>
         <funcdef>int <function>sd_bus_message_set_sender</function></funcdef>
         <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
     <citerefentry><refentrytitle>sd_bus_message_set_destination</refentrytitle><manvolnum>3</manvolnum></citerefentry>
     for more discussion of those values.</para>
 
-    <para><function>sd_bus_message_set_priority()</function> and
-    <function>sd_bus_message_get_priority()</function> modify and query a message's priority
-    respectively. sd-bus currently doesn't make use of a message's priority.</para>
-
     <para><function>sd_bus_message_set_sender()</function> sets the sender service name for the specified bus message
     object. The specified name must be a valid unique or well-known service name. This function is useful only for
     messages to send on direct connections as for connections to bus brokers the broker will fill in the destination
         <varlistentry>
           <term><constant>-EPERM</constant></term>
 
-          <listitem><para>For <function>sd_bus_message_set_destination()</function>,
-          <function>sd_bus_message_set_sender()</function> and
-          <function>sd_bus_message_set_priority()</function>, the message is already sealed.</para>
+          <listitem><para>For <function>sd_bus_message_set_destination()</function> and
+          <function>sd_bus_message_set_sender()</function>, the message is already sealed.</para>
           </listitem>
         </varlistentry>
 
index a1062ce2a902ab4de2b3622dea84d4a492ba00f7..0a85557ec6e82e8bdcf6cc205b43d0e3801212b0 100644 (file)
   <refnamediv>
     <refname>sd_bus_reply_method_error</refname>
     <refname>sd_bus_reply_method_errorf</refname>
+    <refname>sd_bus_reply_method_errorfv</refname>
     <refname>sd_bus_reply_method_errno</refname>
     <refname>sd_bus_reply_method_errnof</refname>
+    <refname>sd_bus_reply_method_errnofv</refname>
 
     <refpurpose>Reply with an error to a D-Bus method call</refpurpose>
   </refnamediv>
         <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
         <paramdef>const char *<parameter>name</parameter></paramdef>
         <paramdef>const char *<parameter>format</parameter></paramdef>
-        <paramdef>…</paramdef>
+        <paramdef>...</paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int sd_bus_reply_method_errorfv</funcdef>
+        <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
+        <paramdef>const char *<parameter>name</parameter></paramdef>
+        <paramdef>const char *<parameter>format</parameter></paramdef>
+        <paramdef>va_list <parameter>ap</parameter></paramdef>
       </funcprototype>
 
       <funcprototype>
         <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
         <paramdef>int <parameter>error</parameter></paramdef>
         <paramdef>const char *<parameter>format</parameter></paramdef>
-        <paramdef>…</paramdef>
+        <paramdef>...</paramdef>
+      </funcprototype>
+
+      <funcprototype>
+        <funcdef>int sd_bus_reply_method_errnofv</funcdef>
+        <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
+        <paramdef>int <parameter>error</parameter></paramdef>
+        <paramdef>const char *<parameter>format</parameter></paramdef>
+        <paramdef>va_list <parameter>ap</parameter></paramdef>
       </funcprototype>
     </funcsynopsis>
   </refsynopsisdiv>
index 8669730d0f517212387705f7520e6e3ab488a83c..a6052c61fd89af2bdd7e765abc6bedfe4e5ed578 100644 (file)
@@ -18,6 +18,7 @@
 
   <refnamediv>
     <refname>sd_bus_reply_method_return</refname>
+    <refname>sd_bus_reply_method_returnv</refname>
 
     <refpurpose>Reply to a D-Bus method call</refpurpose>
   </refnamediv>
         <paramdef>const char *<parameter>types</parameter></paramdef>
         <paramdef>...</paramdef>
       </funcprototype>
+
+      <funcprototype>
+        <funcdef>int sd_bus_reply_method_returnv</funcdef>
+        <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
+        <paramdef>const char *<parameter>types</parameter></paramdef>
+        <paramdef>va_list <parameter>ap</parameter></paramdef>
+      </funcprototype>
     </funcsynopsis>
   </refsynopsisdiv>
 
index bb6c35f9babf49e4a7a9b3f6f8df59cc8e55e08f..d2cdb59f461636df053fea19e3a536b17b5d5b76 100644 (file)
           </listitem>
         </varlistentry>
 
+        <varlistentry>
+          <term><varname>MUDURL=</varname></term>
+          <listitem>
+            <para>When configured, the Manufacturer Usage Descriptions (MUD) URL will be sent to the DHCPV6 server.
+            Takes an URL of length up to 255 characters. A superficial verification that the string is a valid URL
+            will be performed. DHCPv6 clients are intended to have at most one MUD URL associated with them. See
+            <ulink url="https://tools.ietf.org/html/rfc8520">RFC 8520</ulink>.</para>
+          </listitem>
+        </varlistentry>
+
         <varlistentry>
           <term><varname>ForceDHCPv6PDOtherInformation=</varname></term>
           <listitem>
           <term><varname>BitRate=</varname></term>
           <listitem>
             <para>The bitrate of CAN device in bits per second. The usual SI prefixes (K, M) with the base of 1000 can
-            be used here.</para>
+            be used here. Takes a number in the range 1..4294967295.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
             <literal>87.5%</literal>) or permille (e.g. <literal>875‰</literal>).</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><varname>DataBitRate=</varname></term>
+          <term><varname>DataSamplePoint=</varname></term>
+          <listitem>
+            <para>The bitrate and sample point for the data phase, if CAN-FD is used. These settings are
+            analogous to the <varname>BitRate=</varname> and <varname>SamplePoint=</varname> keys.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>FDMode=</varname></term>
+          <listitem>
+            <para>Takes a boolean. When <literal>yes</literal>, CAN-FD mode is enabled for the interface.
+            Note, that a bitrate and optional sample point should also be set for the CAN-FD data phase using
+            the <varname>DataBitRate=</varname> and <varname>DataSamplePoint=</varname> keys.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>FDNonISO=</varname></term>
+          <listitem>
+            <para>Takes a boolean. When <literal>yes</literal>, non-ISO CAN-FD mode is enabled for the
+            interface. When unset, the kernel's default will be used.</para>
+          </listitem>
+        </varlistentry>
         <varlistentry>
           <term><varname>RestartSec=</varname></term>
           <listitem>
index dc9d02f0b937ac7cb145e79915154ed441d46667..6beedf79e7fd88a634ce1370111b2ccacc42c3a7 100644 (file)
@@ -19,6 +19,8 @@ enable getty@.service
 enable systemd-timesyncd.service
 enable systemd-networkd.service
 enable systemd-resolved.service
+enable systemd-homed.service
+enable systemd-userdbd.socket
 
 disable console-getty.service
 disable debug-shell.service
index caffda62af870b5d3e627b83a83e950b25dd1d34..9dbebfa1678d205b2d7e4f2637e7f15bc9640f44 100644 (file)
@@ -107,11 +107,13 @@ int capability_ambient_set_apply(uint64_t set, bool also_inherit) {
         unsigned long i;
         int r;
 
+        /* Add the capabilities to the ambient set (an possibly also the inheritable set) */
+
         /* Check that we can use PR_CAP_AMBIENT or quit early. */
         if (!ambient_capabilities_supported())
-                return 0;
-
-        /* Add the capabilities to the ambient set. */
+                return (set & all_capabilities()) == 0 ?
+                        0 : -EOPNOTSUPP; /* if actually no ambient caps are to be set, be silent,
+                                          * otherwise fail recognizably */
 
         if (also_inherit) {
                 caps = cap_get_proc();
index 8f812d7cbe07ebdb31e3dd581796c8144327b68b..9983aa826e69cc68dfdfa1fc952bf52c1ab340ab 100644 (file)
@@ -113,7 +113,7 @@ static size_t strcspn_escaped(const char *s, const char *reject) {
         bool escaped = false;
         int n;
 
-        for (n=0; s[n]; n++) {
+        for (n = 0; s[n] != '\0'; n++) {
                 if (escaped)
                         escaped = false;
                 else if (s[n] == '\\')
@@ -122,50 +122,62 @@ static size_t strcspn_escaped(const char *s, const char *reject) {
                         break;
         }
 
-        /* if s ends in \, return index of previous char */
-        return n - escaped;
+        return n;
 }
 
 /* Split a string into words. */
-const char* split(const char **state, size_t *l, const char *separator, SplitFlags flags) {
+const char* split(
+                const char **state,
+                size_t *l,
+                const char *separator,
+                SplitFlags flags) {
+
         const char *current;
 
+        assert(state);
+        assert(l);
+
+        if (!separator)
+                separator = WHITESPACE;
+
         current = *state;
 
-        if (!*current) {
-                assert(**state == '\0');
+        if (*current == '\0') /* already at the end? */
                 return NULL;
-        }
 
-        current += strspn(current, separator);
-        if (!*current) {
+        current += strspn(current, separator); /* skip leading separators */
+        if (*current == '\0') { /* at the end now? */
                 *state = current;
                 return NULL;
         }
 
-        if (flags & SPLIT_QUOTES && strchr("\'\"", *current)) {
-                char quotechars[2] = {*current, '\0'};
-
-                *l = strcspn_escaped(current + 1, quotechars);
-                if (current[*l + 1] == '\0' || current[*l + 1] != quotechars[0] ||
-                    (current[*l + 2] && !strchr(separator, current[*l + 2]))) {
-                        /* right quote missing or garbage at the end */
-                        if (flags & SPLIT_RELAX) {
-                                *state = current + *l + 1 + (current[*l + 1] != '\0');
-                                return current + 1;
+        if (FLAGS_SET(flags, SPLIT_QUOTES)) {
+
+                if (strchr(QUOTES, *current)) {
+                        /* We are looking at a quote */
+                        *l = strcspn_escaped(current + 1, CHAR_TO_STR(*current));
+                        if (current[*l + 1] != *current ||
+                            (current[*l + 2] != 0 && !strchr(separator, current[*l + 2]))) {
+                                /* right quote missing or garbage at the end */
+                                if (FLAGS_SET(flags, SPLIT_RELAX)) {
+                                        *state = current + *l + 1 + (current[*l + 1] != '\0');
+                                        return current + 1;
+                                }
+                                *state = current;
+                                return NULL;
                         }
-                        *state = current;
-                        return NULL;
-                }
-                *state = current++ + *l + 2;
-        } else if (flags & SPLIT_QUOTES) {
-                *l = strcspn_escaped(current, separator);
-                if (current[*l] && !strchr(separator, current[*l]) && !(flags & SPLIT_RELAX)) {
-                        /* unfinished escape */
-                        *state = current;
-                        return NULL;
+                        *state = current++ + *l + 2;
+
+                } else {
+                        /* We are looking at a something that is not a quote */
+                        *l = strcspn_escaped(current, separator);
+                        if (current[*l] && !strchr(separator, current[*l]) && !FLAGS_SET(flags, SPLIT_RELAX)) {
+                                /* unfinished escape */
+                                *state = current;
+                                return NULL;
+                        }
+                        *state = current + *l;
                 }
-                *state = current + *l;
         } else {
                 *l = strcspn(current, separator);
                 *state = current + *l;
index f98fbddddadd411afdecaa5d2fed636c8ffb6dd9..2a344b996f9953fd76b890a29ff032c243fc1c95 100644 (file)
@@ -112,8 +112,10 @@ typedef enum SplitFlags {
         SPLIT_RELAX                      = 0x01 << 1,
 } SplitFlags;
 
+/* Smelly. Do not use this anymore. Use extract_first_word() instead! */
 const char* split(const char **state, size_t *l, const char *separator, SplitFlags flags);
 
+/* Similar, don't use this anymore */
 #define FOREACH_WORD(word, length, s, state)                            \
         _FOREACH_WORD(word, length, s, WHITESPACE, 0, state)
 
index eac2e725cce7b4a8e66ff595f2a2301ef9237361..3f6caedfdfa44dadc924907bfd71cba022bc1449 100644 (file)
@@ -25,6 +25,7 @@
 #include "socket-util.h"
 #include "string-table.h"
 #include "util.h"
+#include "web-util.h"
 
 #define MAX_MAC_ADDR_LEN INFINIBAND_ALEN
 
@@ -65,6 +66,7 @@ struct sd_dhcp6_client {
         size_t req_opts_allocated;
         size_t req_opts_len;
         char *fqdn;
+        char *mudurl;
         sd_event_source *receive_message;
         usec_t retransmit_time;
         uint8_t retransmit_count;
@@ -363,6 +365,17 @@ int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, uint16_t option)
         return 0;
 }
 
+int sd_dhcp6_client_set_request_mud_url(sd_dhcp6_client *client, char *mudurl) {
+
+        assert_return(client, -EINVAL);
+        assert_return(client->state == DHCP6_STATE_STOPPED, -EBUSY);
+        assert_return(mudurl, -EINVAL);
+        assert_return(strlen(mudurl) <= 255, -EINVAL);
+        assert_return(http_url_is_valid(mudurl), -EINVAL);
+
+        return free_and_strdup(&client->mudurl, mudurl);
+}
+
 int sd_dhcp6_client_get_prefix_delegation(sd_dhcp6_client *client, int *delegation) {
         assert_return(client, -EINVAL);
         assert_return(delegation, -EINVAL);
@@ -484,6 +497,14 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
         case DHCP6_STATE_INFORMATION_REQUEST:
                 message->type = DHCP6_INFORMATION_REQUEST;
 
+                if (client->mudurl) {
+                        r = dhcp6_option_append(&opt, &optlen,
+                                                SD_DHCP6_OPTION_MUD_URL, strlen(client->mudurl),
+                                                client->mudurl);
+                        if (r < 0)
+                                return r;
+                }
+
                 break;
 
         case DHCP6_STATE_SOLICITATION:
@@ -507,6 +528,14 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
                                 return r;
                 }
 
+                if (client->mudurl) {
+                        r = dhcp6_option_append(&opt, &optlen,
+                                                SD_DHCP6_OPTION_MUD_URL, strlen(client->mudurl),
+                                                client->mudurl);
+                        if (r < 0)
+                                return r;
+                }
+
                 if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
                         r = dhcp6_option_append_pd(opt, optlen, &client->ia_pd, &client->hint_pd_prefix);
                         if (r < 0)
@@ -545,6 +574,14 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
                                 return r;
                 }
 
+                if (client->mudurl) {
+                        r = dhcp6_option_append(&opt, &optlen,
+                                                SD_DHCP6_OPTION_MUD_URL, strlen(client->mudurl),
+                                                client->mudurl);
+                        if (r < 0)
+                                return r;
+                }
+
                 if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
                         r = dhcp6_option_append_pd(opt, optlen, &client->lease->pd, NULL);
                         if (r < 0)
@@ -571,6 +608,14 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
                                 return r;
                 }
 
+                if (client->mudurl) {
+                        r = dhcp6_option_append(&opt, &optlen,
+                                                SD_DHCP6_OPTION_MUD_URL, strlen(client->mudurl),
+                                                client->mudurl);
+                        if (r < 0)
+                                return r;
+                }
+
                 if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
                         r = dhcp6_option_append_pd(opt, optlen, &client->lease->pd, NULL);
                         if (r < 0)
@@ -1521,6 +1566,7 @@ static sd_dhcp6_client *dhcp6_client_free(sd_dhcp6_client *client) {
 
         free(client->req_opts);
         free(client->fqdn);
+        free(client->mudurl);
         return mfree(client);
 }
 
index 2c1bcab576f16a4079b97d20697b80349ea8d00a..1cfe355089671dfc9c97f9eb77e6483653478925 100644 (file)
@@ -700,6 +700,13 @@ global:
 
 LIBSYSTEMD_246 {
 global:
+        sd_bus_call_methodv;
+        sd_bus_call_method_asyncv;
+        sd_bus_emit_signalv;
+        sd_bus_reply_method_errnofv;
+        sd_bus_reply_method_errorfv;
+        sd_bus_reply_method_returnv;
+        sd_bus_set_propertyv;
         sd_path_lookup;
         sd_path_lookup_strv;
 } LIBSYSTEMD_245;
index 89547a252d6701c8c8836c1aa17717d2f60c3e59..a5672a831ff8401bc75d3b73282e1fb66d655a0e 100644 (file)
 #include "bus-util.h"
 #include "string-util.h"
 
-_public_ int sd_bus_emit_signal(
+_public_ int sd_bus_emit_signalv(
                 sd_bus *bus,
                 const char *path,
                 const char *interface,
                 const char *member,
-                const char *types, ...) {
+                const char *types, va_list ap) {
 
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         int r;
@@ -32,11 +32,7 @@ _public_ int sd_bus_emit_signal(
                 return r;
 
         if (!isempty(types)) {
-                va_list ap;
-
-                va_start(ap, types);
                 r = sd_bus_message_appendv(m, types, ap);
-                va_end(ap);
                 if (r < 0)
                         return r;
         }
@@ -44,7 +40,24 @@ _public_ int sd_bus_emit_signal(
         return sd_bus_send(bus, m, NULL);
 }
 
-_public_ int sd_bus_call_method_async(
+_public_ int sd_bus_emit_signal(
+                sd_bus *bus,
+                const char *path,
+                const char *interface,
+                const char *member,
+                const char *types, ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, types);
+        r = sd_bus_emit_signalv(bus, path, interface, member, types, ap);
+        va_end(ap);
+
+        return r;
+}
+
+_public_ int sd_bus_call_method_asyncv(
                 sd_bus *bus,
                 sd_bus_slot **slot,
                 const char *destination,
@@ -53,7 +66,7 @@ _public_ int sd_bus_call_method_async(
                 const char *member,
                 sd_bus_message_handler_t callback,
                 void *userdata,
-                const char *types, ...) {
+                const char *types, va_list ap) {
 
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         int r;
@@ -70,11 +83,7 @@ _public_ int sd_bus_call_method_async(
                 return r;
 
         if (!isempty(types)) {
-                va_list ap;
-
-                va_start(ap, types);
                 r = sd_bus_message_appendv(m, types, ap);
-                va_end(ap);
                 if (r < 0)
                         return r;
         }
@@ -82,7 +91,28 @@ _public_ int sd_bus_call_method_async(
         return sd_bus_call_async(bus, slot, m, callback, userdata, 0);
 }
 
-_public_ int sd_bus_call_method(
+_public_ int sd_bus_call_method_async(
+                sd_bus *bus,
+                sd_bus_slot **slot,
+                const char *destination,
+                const char *path,
+                const char *interface,
+                const char *member,
+                sd_bus_message_handler_t callback,
+                void *userdata,
+                const char *types, ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, types);
+        r = sd_bus_call_method_asyncv(bus, slot, destination, path, interface, member, callback, userdata, types, ap);
+        va_end(ap);
+
+        return r;
+}
+
+_public_ int sd_bus_call_methodv(
                 sd_bus *bus,
                 const char *destination,
                 const char *path,
@@ -90,7 +120,7 @@ _public_ int sd_bus_call_method(
                 const char *member,
                 sd_bus_error *error,
                 sd_bus_message **reply,
-                const char *types, ...) {
+                const char *types, va_list ap) {
 
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         int r;
@@ -109,11 +139,7 @@ _public_ int sd_bus_call_method(
                 goto fail;
 
         if (!isempty(types)) {
-                va_list ap;
-
-                va_start(ap, types);
                 r = sd_bus_message_appendv(m, types, ap);
-                va_end(ap);
                 if (r < 0)
                         goto fail;
         }
@@ -124,10 +150,30 @@ fail:
         return sd_bus_error_set_errno(error, r);
 }
 
-_public_ int sd_bus_reply_method_return(
-                sd_bus_message *call,
+_public_ int sd_bus_call_method(
+                sd_bus *bus,
+                const char *destination,
+                const char *path,
+                const char *interface,
+                const char *member,
+                sd_bus_error *error,
+                sd_bus_message **reply,
                 const char *types, ...) {
 
+        va_list ap;
+        int r;
+
+        va_start(ap, types);
+        r = sd_bus_call_methodv(bus, destination, path, interface, member, error, reply, types, ap);
+        va_end(ap);
+
+        return r;
+}
+
+_public_ int sd_bus_reply_method_returnv(
+                sd_bus_message *call,
+                const char *types, va_list ap) {
+
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         int r;
 
@@ -148,11 +194,7 @@ _public_ int sd_bus_reply_method_return(
                 return r;
 
         if (!isempty(types)) {
-                va_list ap;
-
-                va_start(ap, types);
                 r = sd_bus_message_appendv(m, types, ap);
-                va_end(ap);
                 if (r < 0)
                         return r;
         }
@@ -160,6 +202,20 @@ _public_ int sd_bus_reply_method_return(
         return sd_bus_send(call->bus, m, NULL);
 }
 
+_public_ int sd_bus_reply_method_return(
+                sd_bus_message *call,
+                const char *types, ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, types);
+        r = sd_bus_reply_method_returnv(call, types, ap);
+        va_end(ap);
+
+        return r;
+}
+
 _public_ int sd_bus_reply_method_error(
                 sd_bus_message *call,
                 const sd_bus_error *e) {
@@ -187,14 +243,13 @@ _public_ int sd_bus_reply_method_error(
         return sd_bus_send(call->bus, m, NULL);
 }
 
-_public_ int sd_bus_reply_method_errorf(
+_public_ int sd_bus_reply_method_errorfv(
                 sd_bus_message *call,
                 const char *name,
                 const char *format,
-                ...) {
+                va_list ap) {
 
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
-        va_list ap;
 
         assert_return(call, -EINVAL);
         assert_return(call->sealed, -EPERM);
@@ -208,13 +263,27 @@ _public_ int sd_bus_reply_method_errorf(
         if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
                 return 0;
 
-        va_start(ap, format);
         bus_error_setfv(&error, name, format, ap);
-        va_end(ap);
 
         return sd_bus_reply_method_error(call, &error);
 }
 
+_public_ int sd_bus_reply_method_errorf(
+                sd_bus_message *call,
+                const char *name,
+                const char *format,
+                ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, format);
+        r = sd_bus_reply_method_errorfv(call, name, format, ap);
+        va_end(ap);
+
+        return r;
+}
+
 _public_ int sd_bus_reply_method_errno(
                 sd_bus_message *call,
                 int error,
@@ -242,14 +311,13 @@ _public_ int sd_bus_reply_method_errno(
         return sd_bus_reply_method_error(call, &berror);
 }
 
-_public_ int sd_bus_reply_method_errnof(
+_public_ int sd_bus_reply_method_errnofv(
                 sd_bus_message *call,
                 int error,
                 const char *format,
-                ...) {
+                va_list ap) {
 
         _cleanup_(sd_bus_error_free) sd_bus_error berror = SD_BUS_ERROR_NULL;
-        va_list ap;
 
         assert_return(call, -EINVAL);
         assert_return(call->sealed, -EPERM);
@@ -263,13 +331,27 @@ _public_ int sd_bus_reply_method_errnof(
         if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
                 return 0;
 
-        va_start(ap, format);
         sd_bus_error_set_errnofv(&berror, error, format, ap);
-        va_end(ap);
 
         return sd_bus_reply_method_error(call, &berror);
 }
 
+_public_ int sd_bus_reply_method_errnof(
+                sd_bus_message *call,
+                int error,
+                const char *format,
+                ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, format);
+        r = sd_bus_reply_method_errnofv(call, error, format, ap);
+        va_end(ap);
+
+        return r;
+}
+
 _public_ int sd_bus_get_property(
                 sd_bus *bus,
                 const char *destination,
@@ -452,17 +534,16 @@ fail:
         return sd_bus_error_set_errno(error, r);
 }
 
-_public_ int sd_bus_set_property(
+_public_ int sd_bus_set_propertyv(
                 sd_bus *bus,
                 const char *destination,
                 const char *path,
                 const char *interface,
                 const char *member,
                 sd_bus_error *error,
-                const char *type, ...) {
+                const char *type, va_list ap) {
 
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
-        va_list ap;
         int r;
 
         bus_assert_return(bus, -EINVAL, error);
@@ -489,9 +570,7 @@ _public_ int sd_bus_set_property(
         if (r < 0)
                 goto fail;
 
-        va_start(ap, type);
         r = sd_bus_message_appendv(m, type, ap);
-        va_end(ap);
         if (r < 0)
                 goto fail;
 
@@ -505,6 +584,25 @@ fail:
         return sd_bus_error_set_errno(error, r);
 }
 
+_public_ int sd_bus_set_property(
+                sd_bus *bus,
+                const char *destination,
+                const char *path,
+                const char *interface,
+                const char *member,
+                sd_bus_error *error,
+                const char *type, ...) {
+
+        va_list ap;
+        int r;
+
+        va_start(ap, type);
+        r = sd_bus_set_propertyv(bus, destination, path, interface, member, error, type, ap);
+        va_end(ap);
+
+        return r;
+}
+
 _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_bus_creds **creds) {
         sd_bus_creds *c;
 
index 5cbd01594c536cf7acefccdae9c49047c65a771e..78e18e3b94c536893746230484c290f4d4d3b253 100644 (file)
@@ -1833,7 +1833,7 @@ static int dispatch_wqueue(sd_bus *bus) {
         return ret;
 }
 
-static int bus_read_message(sd_bus *bus, bool hint_priority, int64_t priority) {
+static int bus_read_message(sd_bus *bus) {
         assert(bus);
 
         return bus_socket_read_message(bus);
@@ -1860,17 +1860,13 @@ static void rqueue_drop_one(sd_bus *bus, size_t i) {
         bus->rqueue_size--;
 }
 
-static int dispatch_rqueue(sd_bus *bus, bool hint_priority, int64_t priority, sd_bus_message **m) {
+static int dispatch_rqueue(sd_bus *bus, sd_bus_message **m) {
         int r, ret = 0;
 
         assert(bus);
         assert(m);
         assert(IN_SET(bus->state, BUS_RUNNING, BUS_HELLO));
 
-        /* Note that the priority logic is only available on kdbus,
-         * where the rqueue is unused. We check the rqueue here
-         * anyway, because it's simple... */
-
         for (;;) {
                 if (bus->rqueue_size > 0) {
                         /* Dispatch a queued message */
@@ -1880,7 +1876,7 @@ static int dispatch_rqueue(sd_bus *bus, bool hint_priority, int64_t priority, sd
                 }
 
                 /* Try to read a new message */
-                r = bus_read_message(bus, hint_priority, priority);
+                r = bus_read_message(bus);
                 if (r < 0)
                         return r;
                 if (r == 0) {
@@ -2237,7 +2233,7 @@ _public_ int sd_bus_call(
                         i++;
                 }
 
-                r = bus_read_message(bus, false, 0);
+                r = bus_read_message(bus);
                 if (r < 0) {
                         if (ERRNO_IS_DISCONNECT(r)) {
                                 bus_enter_closing(bus);
@@ -2776,7 +2772,7 @@ static int dispatch_track(sd_bus *bus) {
         return 1;
 }
 
-static int process_running(sd_bus *bus, bool hint_priority, int64_t priority, sd_bus_message **ret) {
+static int process_running(sd_bus *bus, sd_bus_message **ret) {
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         int r;
 
@@ -2795,7 +2791,7 @@ static int process_running(sd_bus *bus, bool hint_priority, int64_t priority, sd
         if (r != 0)
                 goto null_message;
 
-        r = dispatch_rqueue(bus, hint_priority, priority, &m);
+        r = dispatch_rqueue(bus, &m);
         if (r < 0)
                 return r;
         if (!m)
@@ -2981,7 +2977,7 @@ finish:
         return r;
 }
 
-static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priority, sd_bus_message **ret) {
+static int bus_process_internal(sd_bus *bus, sd_bus_message **ret) {
         int r;
 
         /* Returns 0 when we didn't do anything. This should cause the
@@ -3021,7 +3017,7 @@ static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priorit
 
         case BUS_RUNNING:
         case BUS_HELLO:
-                r = process_running(bus, hint_priority, priority, ret);
+                r = process_running(bus, ret);
                 if (r >= 0)
                         return r;
 
@@ -3048,11 +3044,11 @@ static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priorit
 }
 
 _public_ int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
-        return bus_process_internal(bus, false, 0, ret);
+        return bus_process_internal(bus, ret);
 }
 
 _public_ int sd_bus_process_priority(sd_bus *bus, int64_t priority, sd_bus_message **ret) {
-        return bus_process_internal(bus, true, priority, ret);
+        return bus_process_internal(bus, ret);
 }
 
 static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) {
index 58f79b3754cbf3096026de4d567fbd2356d3ce95..952fd555785ec94bad38f12db96ef1e702341494 100644 (file)
@@ -2184,6 +2184,69 @@ static int link_delete_send_message(sd_netlink *rtnl, int index) {
         return 0;
 }
 
+static int link_up_down_send_message(sd_netlink *rtnl, char *command, int index) {
+        _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
+        int r;
+
+        assert(rtnl);
+
+        r = sd_rtnl_message_new_link(rtnl, &req, RTM_SETLINK, index);
+        if (r < 0)
+                return rtnl_log_create_error(r);
+
+        if (streq(command, "up"))
+                r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
+        else
+                r = sd_rtnl_message_link_set_flags(req, 0, IFF_UP);
+        if (r < 0)
+                return log_error_errno(r, "Could not set link flags: %m");
+
+        r = sd_netlink_call(rtnl, req, 0, NULL);
+        if (r < 0)
+                return r;
+
+        return 0;
+}
+
+static int link_up_down(int argc, char *argv[], void *userdata) {
+        _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
+        _cleanup_set_free_ Set *indexes = NULL;
+        int index, r, i;
+        Iterator j;
+        void *p;
+
+        r = sd_netlink_open(&rtnl);
+        if (r < 0)
+                return log_error_errno(r, "Failed to connect to netlink: %m");
+
+        indexes = set_new(NULL);
+        if (!indexes)
+                return log_oom();
+
+        for (i = 1; i < argc; i++) {
+                index = resolve_interface_or_warn(&rtnl, argv[i]);
+                if (index < 0)
+                        return index;
+
+                r = set_put(indexes, INT_TO_PTR(index));
+                if (r < 0)
+                        return log_oom();
+        }
+
+        SET_FOREACH(p, indexes, j) {
+                index = PTR_TO_INT(p);
+                r = link_up_down_send_message(rtnl, argv[0], index);
+                if (r < 0) {
+                        char ifname[IF_NAMESIZE + 1];
+
+                        return log_error_errno(r, "Failed to %s interface %s: %m",
+                                               argv[1], format_ifname_full(index, ifname, FORMAT_IFNAME_IFINDEX));
+                }
+        }
+
+        return r;
+}
+
 static int link_delete(int argc, char *argv[], void *userdata) {
         _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
         _cleanup_set_free_ Set *indexes = NULL;
@@ -2392,6 +2455,8 @@ static int help(void) {
                "  lldp [PATTERN...]      Show LLDP neighbors\n"
                "  label                  Show current address label entries in the kernel\n"
                "  delete DEVICES...      Delete virtual netdevs\n"
+               "  up DEVICES...          Bring devices up\n"
+               "  down DEVICES...        Bring devices down\n"
                "  renew DEVICES...       Renew dynamic configurations\n"
                "  forcerenew DEVICES...  Trigger DHCP reconfiguration of all connected clients\n"
                "  reconfigure DEVICES... Reconfigure interfaces\n"
@@ -2494,6 +2559,8 @@ static int networkctl_main(int argc, char *argv[]) {
                 { "lldp",        VERB_ANY, VERB_ANY, 0,            link_lldp_status    },
                 { "label",       VERB_ANY, VERB_ANY, 0,            list_address_labels },
                 { "delete",      2,        VERB_ANY, 0,            link_delete         },
+                { "up",          2,        VERB_ANY, 0,            link_up_down        },
+                { "down",        2,        VERB_ANY, 0,            link_up_down        },
                 { "renew",       2,        VERB_ANY, 0,            link_renew          },
                 { "forcerenew",  2,        VERB_ANY, 0,            link_force_renew    },
                 { "reconfigure", 2,        VERB_ANY, 0,            verb_reconfigure    },
index 18533843e30c9226078dc766432bf3ecf6f76faa..fdd99a3a18955a9f2eb2e85038a5bd3cc7e71bdc 100644 (file)
@@ -7,10 +7,51 @@
 #include "networkd-can.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
+#include "parse-util.h"
 #include "string-util.h"
 
 #define CAN_TERMINATION_OHM_VALUE 120
 
+int config_parse_can_bitrate(
+                const char* unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        uint32_t *br = data;
+        uint64_t sz;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = parse_size(rvalue, 1000, &sz);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Failed to parse can bitrate '%s', ignoring: %m", rvalue);
+                return 0;
+        }
+
+        /* Linux uses __u32 for bitrates, so the value should not exceed that. */
+        if (sz <= 0 || sz > UINT32_MAX) {
+                log_syntax(unit, LOG_ERR, filename, line, 0,
+                           "Bit rate out of permitted range 1...4294967295");
+                return 0;
+        }
+
+        *br = (uint32_t) sz;
+
+        return 0;
+}
+
 static int link_up_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
         int r;
 
@@ -103,11 +144,6 @@ static int link_set_can(Link *link) {
                         .sample_point = link->network->can_sample_point,
                 };
 
-                if (link->network->can_bitrate > UINT32_MAX) {
-                        log_link_error(link, "bitrate (%" PRIu64 ") too big.", link->network->can_bitrate);
-                        return -ERANGE;
-                }
-
                 log_link_debug(link, "Setting bitrate = %d bit/s", bt.bitrate);
                 if (link->network->can_sample_point > 0)
                         log_link_debug(link, "Setting sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point % 10);
@@ -119,6 +155,35 @@ static int link_set_can(Link *link) {
                         return log_link_error_errno(link, r, "Could not append IFLA_CAN_BITTIMING attribute: %m");
         }
 
+        if (link->network->can_data_bitrate > 0 || link->network->can_data_sample_point > 0) {
+                struct can_bittiming bt = {
+                        .bitrate = link->network->can_data_bitrate,
+                        .sample_point = link->network->can_data_sample_point,
+                };
+
+                log_link_debug(link, "Setting data bitrate = %d bit/s", bt.bitrate);
+                if (link->network->can_data_sample_point > 0)
+                        log_link_debug(link, "Setting data sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point % 10);
+                else
+                        log_link_debug(link, "Using default data sample point");
+
+                r = sd_netlink_message_append_data(m, IFLA_CAN_DATA_BITTIMING, &bt, sizeof(bt));
+                if (r < 0)
+                        return log_link_error_errno(link, r, "Could not append IFLA_CAN_DATA_BITTIMING attribute: %m");
+        }
+
+        if (link->network->can_fd_mode >= 0) {
+                cm.mask |= CAN_CTRLMODE_FD;
+                SET_FLAG(cm.flags, CAN_CTRLMODE_FD, link->network->can_fd_mode > 0);
+                log_link_debug(link, "%sabling FD mode", link->network->can_fd_mode > 0 ? "En" : "Dis");
+        }
+
+        if (link->network->can_non_iso >= 0) {
+                cm.mask |= CAN_CTRLMODE_FD_NON_ISO;
+                SET_FLAG(cm.flags, CAN_CTRLMODE_FD_NON_ISO, link->network->can_non_iso > 0);
+                log_link_debug(link, "%sabling FD non-ISO mode", link->network->can_non_iso > 0 ? "En" : "Dis");
+        }
+
         if (link->network->can_restart_us > 0) {
                 char time_string[FORMAT_TIMESPAN_MAX];
                 uint64_t restart_ms;
index c744bdfea72c9a8c3108df4535be357180f31b72..30e99b189d3def7491bf873991c6b0ce1d076de9 100644 (file)
@@ -1,6 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
+#include "conf-parser.h"
+
 typedef struct Link Link;
 
 int link_configure_can(Link *link);
+
+CONFIG_PARSER_PROTOTYPE(config_parse_can_bitrate);
index 8664d8cdc0d43782def4aa85ac2f7060e7c7ab6e..0473aba6159eeba5e4a440507f19ef369e082d11 100644 (file)
@@ -8,6 +8,7 @@
 #include "parse-util.h"
 #include "string-table.h"
 #include "strv.h"
+#include "web-util.h"
 
 int config_parse_dhcp(
                 const char* unit,
@@ -265,6 +266,48 @@ int config_parse_dhcp6_pd_hint(
         return 0;
 }
 
+int config_parse_dhcp6_mud_url(
+                const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        _cleanup_free_ char *unescaped = NULL;
+        Network *network = data;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+
+        if (isempty(rvalue)) {
+                network->dhcp6_mudurl = mfree(network->dhcp6_mudurl);
+                return 0;
+        }
+
+        r = cunescape(rvalue, 0, &unescaped);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Failed to Failed to unescape MUD URL, ignoring: %s", rvalue);
+                return 0;
+        }
+
+        if (!http_url_is_valid(unescaped) || strlen(unescaped) > 255) {
+                log_syntax(unit, LOG_ERR, filename, line, 0,
+                           "Failed to parse MUD URL '%s', ignoring: %m", rvalue);
+
+                return 0;
+        }
+
+        return free_and_replace(network->dhcp6_mudurl, unescaped);
+}
+
 int config_parse_dhcp_send_option(
                 const char *unit,
                 const char *filename,
index 1d6ddbb8cc0b07c6775d5178adb5dd896f22b86e..ca86016ef2a7209b649230e442bb2fc906dcd5d5 100644 (file)
@@ -48,4 +48,5 @@ CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_use_sip);
 CONFIG_PARSER_PROTOTYPE(config_parse_iaid);
 CONFIG_PARSER_PROTOTYPE(config_parse_section_route_table);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_pd_hint);
+CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_mud_url);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_send_option);
index 7304270c60b1e97bcad6e5b77dddc339aac5c1bf..3580498e3512cb0b8b53728b8420d9a0ac0943bf 100644 (file)
@@ -676,6 +676,12 @@ int dhcp6_configure(Link *link) {
                         return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set request flag for rapid commit: %m");
         }
 
+        if (link->network->dhcp6_mudurl) {
+                r = sd_dhcp6_client_set_request_mud_url(client, link->network->dhcp6_mudurl);
+                if (r < 0)
+                        return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set MUD URL: %m");
+        }
+
         r = sd_dhcp6_client_set_callback(client, dhcp6_handler, link);
         if (r < 0)
                 return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set callback: %m");
index 18ba23bfc8bcb6af4497bfe8447c94bd8295396f..fe6adc4089a298cd0d924719427801ff95b91953 100644 (file)
@@ -6,6 +6,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
 #include "conf-parser.h"
 #include "netem.h"
 #include "network-internal.h"
+#include "networkd-can.h"
 #include "networkd-conf.h"
 #include "networkd-dhcp-common.h"
 #include "networkd-dhcp-server.h"
@@ -190,6 +191,7 @@ DHCPv4.RouteMTUBytes,                        config_parse_mtu,
 DHCPv6.UseDNS,                               config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_dns)
 DHCPv6.UseNTP,                               config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_ntp)
 DHCPv6.RapidCommit,                          config_parse_bool,                                        0,                             offsetof(Network, rapid_commit)
+DHCPv6.MUDURL,                               config_parse_dhcp6_mud_url,                               0,                             0
 DHCPv6.ForceDHCPv6PDOtherInformation,        config_parse_bool,                                        0,                             offsetof(Network, dhcp6_force_pd_other_information)
 DHCPv6.PrefixDelegationHint,                 config_parse_dhcp6_pd_hint,                               0,                             0
 DHCPv6.WithoutRA,                            config_parse_bool,                                        0,                             offsetof(Network, dhcp6_without_ra)
@@ -257,8 +259,12 @@ IPv6Prefix.PreferredLifetimeSec,             config_parse_prefix_lifetime,
 IPv6Prefix.Assign,                           config_parse_prefix_assign,                               0,                             0
 IPv6RoutePrefix.Route,                       config_parse_route_prefix,                                0,                             0
 IPv6RoutePrefix.LifetimeSec,                 config_parse_route_prefix_lifetime,                       0,                             0
-CAN.BitRate,                                 config_parse_si_uint64,                                   0,                             offsetof(Network, can_bitrate)
+CAN.BitRate,                                 config_parse_can_bitrate,                                 0,                             offsetof(Network, can_bitrate)
 CAN.SamplePoint,                             config_parse_permille,                                    0,                             offsetof(Network, can_sample_point)
+CAN.DataBitRate,                             config_parse_can_bitrate,                                 0,                             offsetof(Network, can_data_bitrate)
+CAN.DataSamplePoint,                         config_parse_permille,                                    0,                             offsetof(Network, can_data_sample_point)
+CAN.FDMode,                                  config_parse_tristate,                                    0,                             offsetof(Network, can_fd_mode)
+CAN.FDNonISO,                                config_parse_tristate,                                    0,                             offsetof(Network, can_non_iso)
 CAN.RestartSec,                              config_parse_sec,                                         0,                             offsetof(Network, can_restart_us)
 CAN.TripleSampling,                          config_parse_tristate,                                    0,                             offsetof(Network, can_triple_sampling)
 CAN.Termination,                             config_parse_tristate,                                    0,                             offsetof(Network, can_termination)
index 6afe29d53bf911c1e41b7cf3b05832480e07b7e9..f46b91e724392a1395e0167482cfe04c076aae42 100644 (file)
@@ -646,6 +646,7 @@ static Network *network_free(Network *network) {
         set_free(network->dhcp_black_listed_ip);
         set_free(network->dhcp_request_options);
         free(network->mac);
+        free(network->dhcp6_mudurl);
 
         if (network->dhcp_acd)
                 sd_ipv4acd_unref(network->dhcp_acd);
index 66ee01d7f3fbaac34461fb0ce5d3628238807956..e6182327e103398984958d8f3522f14f3f025715 100644 (file)
@@ -131,6 +131,7 @@ struct Network {
         bool dhcp6_use_ntp;
         bool dhcp6_without_ra;
         uint8_t dhcp6_pd_length;
+        char *dhcp6_mudurl;
         struct in6_addr dhcp6_pd_address;
 
         /* DHCP Server Support */
@@ -205,12 +206,16 @@ struct Network {
         uint32_t br_untagged_bitmap[BRIDGE_VLAN_BITMAP_LEN];
 
         /* CAN support */
-        uint64_t can_bitrate;
+        uint32_t can_bitrate;
         unsigned can_sample_point;
+        uint32_t can_data_bitrate;
+        unsigned can_data_sample_point;
         usec_t can_restart_us;
         int can_triple_sampling;
         int can_termination;
         int can_listen_only;
+        int can_fd_mode;
+        int can_non_iso;
 
         AddressFamily ip_forward;
         bool ip_masquerade;
index e6bf20db54f54210e5e1649dc38b85ea657d18eb..c2839d425ad256e6eac44fbeb8e7b16a74e2fe6b 100644 (file)
@@ -37,6 +37,8 @@ void etc_hosts_free(EtcHosts *hosts) {
 void manager_etc_hosts_flush(Manager *m) {
         etc_hosts_free(&m->etc_hosts);
         m->etc_hosts_mtime = USEC_INFINITY;
+        m->etc_hosts_ino = 0;
+        m->etc_hosts_dev = 0;
 }
 
 static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) {
@@ -224,8 +226,9 @@ static int manager_etc_hosts_read(Manager *m) {
                         return 0;
                 }
 
-                /* Did the mtime change? If not, there's no point in re-reading the file. */
-                if (timespec_load(&st.st_mtim) == m->etc_hosts_mtime)
+                /* Did the mtime or ino/dev change? If not, there's no point in re-reading the file. */
+                if (timespec_load(&st.st_mtim) == m->etc_hosts_mtime &&
+                    st.st_ino == m->etc_hosts_ino && st.st_dev == m->etc_hosts_dev)
                         return 0;
         }
 
@@ -249,6 +252,8 @@ static int manager_etc_hosts_read(Manager *m) {
                 return r;
 
         m->etc_hosts_mtime = timespec_load(&st.st_mtim);
+        m->etc_hosts_ino = st.st_ino;
+        m->etc_hosts_dev = st.st_dev;
         m->etc_hosts_last = ts;
 
         return 1;
index 4f72077720b1ca8aad518d482759bdf961f7a56d..df25907a4c5c45ee702183c7481237da2cbc57f5 100644 (file)
@@ -591,6 +591,8 @@ int manager_new(Manager **ret) {
                 .need_builtin_fallbacks = true,
                 .etc_hosts_last = USEC_INFINITY,
                 .etc_hosts_mtime = USEC_INFINITY,
+                .etc_hosts_ino = 0,
+                .etc_hosts_dev = 0,
                 .read_etc_hosts = true,
         };
 
index 7f7d3a6b9c6df65047c702463e4ee28ebcd47e86..446f258b49ba63dd99de01944e6caf31dedde2fa 100644 (file)
@@ -127,6 +127,8 @@ struct Manager {
         /* Data from /etc/hosts */
         EtcHosts etc_hosts;
         usec_t etc_hosts_last, etc_hosts_mtime;
+        ino_t etc_hosts_ino;
+        dev_t etc_hosts_dev;
         bool read_etc_hosts;
 
         /* Local DNS stub on 127.0.0.53:53 */
index f914473a1d36c9e9e8c7a77f5b3b5aa0dd4c7002..23ad6b06cfa9f06ef307fc1798ff9c21d41765fd 100644 (file)
@@ -1188,6 +1188,8 @@ static int decrypt_partition(
         if (r < 0)
                 return log_debug_errno(r, "Failed to initialize dm-crypt: %m");
 
+        crypt_set_log_callback(cd, cryptsetup_log_glue, NULL);
+
         r = crypt_load(cd, CRYPT_LUKS, NULL);
         if (r < 0)
                 return log_debug_errno(r, "Failed to load LUKS metadata: %m");
@@ -1246,6 +1248,8 @@ static int verity_partition(
         if (r < 0)
                 return r;
 
+        crypt_set_log_callback(cd, cryptsetup_log_glue, NULL);
+
         r = crypt_load(cd, CRYPT_VERITY, NULL);
         if (r < 0)
                 return r;
index 8e4866671c6a7de6c303cc9a63e600500a6bd1ba..cd307dbd566e3b8ed9fe9704e301e8706a23bf66 100644 (file)
@@ -204,7 +204,7 @@ int sd_bus_get_fd(sd_bus *bus);
 int sd_bus_get_events(sd_bus *bus);
 int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec);
 int sd_bus_process(sd_bus *bus, sd_bus_message **r);
-int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r);
+int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r) _sd_deprecated_; /* deprecated */
 int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec);
 int sd_bus_flush(sd_bus *bus);
 int sd_bus_enqueue_for_read(sd_bus *bus, sd_bus_message *m);
@@ -272,7 +272,7 @@ int sd_bus_message_seal(sd_bus_message *m, uint64_t cookie, uint64_t timeout_use
 int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type);
 int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie);
 int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie);
-int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority);
+int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) _sd_deprecated_; /* deprecated */
 
 int sd_bus_message_get_expect_reply(sd_bus_message *m);
 int sd_bus_message_get_auto_start(sd_bus_message *m);
@@ -306,7 +306,7 @@ int sd_bus_message_set_allow_interactive_authorization(sd_bus_message *m, int b)
 
 int sd_bus_message_set_destination(sd_bus_message *m, const char *destination);
 int sd_bus_message_set_sender(sd_bus_message *m, const char *sender);
-int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority);
+int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) _sd_deprecated_; /* deprecated */
 
 int sd_bus_message_append(sd_bus_message *m, const char *types, ...);
 int sd_bus_message_appendv(sd_bus_message *m, const char *types, va_list ap);
@@ -352,20 +352,27 @@ int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machin
 
 /* Convenience calls */
 
+int sd_bus_call_methodv(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, sd_bus_message **reply, const char *types, va_list ap);
 int sd_bus_call_method(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, sd_bus_message **reply, const char *types, ...);
+int sd_bus_call_method_asyncv(sd_bus *bus, sd_bus_slot **slot, const char *destination, const char *path, const char *interface, const char *member, sd_bus_message_handler_t callback, void *userdata, const char *types, va_list ap);
 int sd_bus_call_method_async(sd_bus *bus, sd_bus_slot **slot, const char *destination, const char *path, const char *interface, const char *member, sd_bus_message_handler_t callback, void *userdata, const char *types, ...);
 int sd_bus_get_property(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, sd_bus_message **reply, const char *type);
 int sd_bus_get_property_trivial(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char type, void *ret_ptr);
 int sd_bus_get_property_string(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char **ret); /* free the result! */
 int sd_bus_get_property_strv(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char ***ret); /* free the result! */
+int sd_bus_set_propertyv(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, const char *type, va_list ap);
 int sd_bus_set_property(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, const char *type, ...);
 
+int sd_bus_reply_method_returnv(sd_bus_message *call, const char *types, va_list ap);
 int sd_bus_reply_method_return(sd_bus_message *call, const char *types, ...);
 int sd_bus_reply_method_error(sd_bus_message *call, const sd_bus_error *e);
+int sd_bus_reply_method_errorfv(sd_bus_message *call, const char *name, const char *format, va_list ap) _sd_printf_(3, 0);
 int sd_bus_reply_method_errorf(sd_bus_message *call, const char *name, const char *format, ...) _sd_printf_(3, 4);
 int sd_bus_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *e);
+int sd_bus_reply_method_errnofv(sd_bus_message *call, int error, const char *format, va_list ap) _sd_printf_(3, 0);
 int sd_bus_reply_method_errnof(sd_bus_message *call, int error, const char *format, ...) _sd_printf_(3, 4);
 
+int sd_bus_emit_signalv(sd_bus *bus, const char *path, const char *interface, const char *member, const char *types, va_list ap);
 int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface, const char *member, const char *types, ...);
 
 int sd_bus_emit_properties_changed_strv(sd_bus *bus, const char *path, const char *interface, char **names);
index be34d43e748153f4bb1c37e10b1c56fcf6aa0bd1..42d4ec752c3c9afd4076b0abad1c9f0fae7084a4 100644 (file)
@@ -73,6 +73,7 @@ enum {
         SD_DHCP6_OPTION_FQDN                       = 39,  /* RFC 4704 */
 
         SD_DHCP6_OPTION_NTP_SERVER                 = 56,  /* RFC 5908 */
+        SD_DHCP6_OPTION_MUD_URL                    = 112, /* RFC 8250 */
 
         /* option codes 89-142 are unassigned */
         /* option codes 144-65535 are unassigned */
@@ -120,6 +121,9 @@ int sd_dhcp6_client_get_information_request(
 int sd_dhcp6_client_set_request_option(
                 sd_dhcp6_client *client,
                 uint16_t option);
+int sd_dhcp6_client_set_request_mud_url(
+                sd_dhcp6_client *client,
+                char *mudurl);
 int sd_dhcp6_client_set_prefix_delegation_hint(
                 sd_dhcp6_client *client,
                 uint8_t prefixlen,
index 68c128cf80d1370f568cbc8a484d39dcc7b5ef0e..5473e983bd843ad11c2880cf614e51837ad331a6 100644 (file)
@@ -307,6 +307,12 @@ static void test_strv_split(void) {
         l = strv_split_full("    'one'  \"  two\t three \"' four  five", NULL, SPLIT_QUOTES | SPLIT_RELAX);
         assert_se(l);
         assert_se(strv_equal(l, (char**) input_table_quoted));
+
+        strv_free_erase(l);
+
+        l = strv_split_full("\\", NULL, SPLIT_QUOTES | SPLIT_RELAX);
+        assert_se(l);
+        assert_se(strv_equal(l, STRV_MAKE("\\")));
 }
 
 static void test_strv_split_empty(void) {
index 71946c9ecc75e50c5d9821d68071ab2fdb5ed043..48039511fa69bc5d778f30e7c1f1cfa1c364cad7 100644 (file)
@@ -498,7 +498,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
 
         if (config->alternative_names_policy)
                 for (NamePolicy *p = config->alternative_names_policy; *p != _NAMEPOLICY_INVALID; p++) {
-                        const char *n;
+                        const char *n = NULL;
 
                         switch (*p) {
                         case NAMEPOLICY_DATABASE:
index 01b1b50ff6a26bea7eb25f122613590cf935ea24..672c2a96652cff810b2418c4154af2d2b12c506c 100644 (file)
@@ -111,6 +111,7 @@ RapidCommit=
 ForceDHCPv6PDOtherInformation=
 PrefixDelegationHint=
 WithoutRA=
+MUDURL=
 [Route]
 Destination=
 Protocol=
@@ -201,6 +202,10 @@ PVID=
 [CAN]
 SamplePoint=
 BitRate=
+DataSamplePoint=
+DataBitRate=
+FDMode=
+FDNonISO=
 RestartSec=
 TripleSampling=
 Termination=
index ead815f2fab148e6d932eb4a9d3fd5c458ae9c65..fbdc92c96eeeb33c857b6c7b8fdf13871566f06f 100644 (file)
@@ -1964,7 +1964,7 @@ test_setup() {
     if [ ${TEST_REQUIRE_INSTALL_TESTS} -ne 0 ] && \
             type -P meson >/dev/null && \
             [[ "$(meson configure $BUILD_DIR | grep install-tests | awk '{ print $2 }')" != "true" ]]; then
-        dfatal "Needs to be built with -Dinstall-tests=true"
+        dfatal "$BUILD_DIR needs to be built with -Dinstall-tests=true"
         exit 1
     fi
 
index da359cbb23a0c9948154b13cf2fe29ac89bd1b28..7698f35979d9a60cbbc4a6383d94520ded35adab 100644 (file)
@@ -1,7 +1,9 @@
 [Unit]
 Description=TEST-46-HOMED
-Before=getty-pre.target
 Wants=getty-pre.target
+Before=getty-pre.target
+Wants=systemd-homed.service
+After=systemd-homed.service
 
 [Service]
 ExecStartPre=rm -f /failed /testok
index ea91f0cc9ea7df63e5e75d6a7e096e06ffd7d46f..ba3abc29ea535017ce49f8cb4437c0db984fb6d0 100644 (file)
@@ -139,8 +139,7 @@ units = [
          'sysinit.target.wants/'],
         ['systemd-udevd-kernel.socket',         '',
          'sockets.target.wants/'],
-        ['systemd-userdbd.socket',              'ENABLE_USERDB',
-         'sockets.target.wants/'],
+        ['systemd-userdbd.socket',              'ENABLE_USERDB'],
         ['time-set.target',                     ''],
         ['time-sync.target',                    ''],
         ['timers.target',                       ''],
@@ -201,8 +200,7 @@ in_units = [
         ['systemd-portabled.service',            'ENABLE_PORTABLED',
          'dbus-org.freedesktop.portable1.service'],
         ['systemd-userdbd.service',              'ENABLE_USERDB'],
-        ['systemd-homed.service',                'ENABLE_HOMED',
-         'multi-user.target.wants/ dbus-org.freedesktop.home1.service'],
+        ['systemd-homed.service',                'ENABLE_HOMED'],
         ['systemd-quotacheck.service',           'ENABLE_QUOTACHECK'],
         ['systemd-random-seed.service',          'ENABLE_RANDOMSEED',
          'sysinit.target.wants/'],
index 6490f48a15691575c9a04d2a8d830f80798a37a7..91dabee03456159a58582752ba2788153f86fa58 100644 (file)
@@ -34,3 +34,7 @@ SystemCallArchitectures=native
 SystemCallErrorNumber=EPERM
 SystemCallFilter=@system-service @mount
 @SERVICE_WATCHDOG@
+
+[Install]
+WantedBy=multi-user.target
+Alias=dbus-org.freedesktop.home1.service
index 7ce6aefd29fdb9dde76c05d0be064ccb97d99673..9393a64f001f8bfa70503e5f16d79b16e5d22bcf 100644 (file)
@@ -15,11 +15,15 @@ Conflicts=shutdown.target
 After=sysroot.mount
 Before=initrd-root-fs.target shutdown.target
 ConditionVirtualization=!container
+ConditionDirectoryNotEmpty=|/usr/lib/repart.d
+ConditionDirectoryNotEmpty=|/usr/local/lib/repart.d
+ConditionDirectoryNotEmpty=|/etc/repart.d
+ConditionDirectoryNotEmpty=|/run/repart.d
 
 [Service]
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootbindir@/systemd-repart --dry-run=no
 
-# The tool returns 77 if there's no GPT partition table pre-existing
+# The tool returns 77 if there's no existing GPT partition table
 SuccessExitStatus=77
index e30ed2109ed5f85fab2a6352a892bb3a4ecd7569..3b7670537305c66e663aa41d5e5a561e4e7f1ceb 100644 (file)
@@ -39,3 +39,6 @@ SystemCallErrorNumber=EPERM
 SystemCallFilter=@system-service
 Type=notify
 @SERVICE_WATCHDOG@
+
+[Install]
+Also=systemd-userdbd.socket
index 1c749ea1d2321b160ec54489ff1da333827ce163..2b4bb7a87a5ee446e6ab322b9053a97c16a5cc91 100644 (file)
@@ -17,3 +17,6 @@ Before=sockets.target
 ListenStream=/run/systemd/userdb/io.systemd.Multiplexer
 Symlinks=/run/systemd/userdb/io.systemd.NameServiceSwitch
 SocketMode=0666
+
+[Install]
+WantedBy=sockets.target