]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #30844 from keszybz/rename-uid-alloc-range
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Jan 2024 17:51:35 +0000 (18:51 +0100)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2024 17:51:35 +0000 (18:51 +0100)
Rename uid-alloc-range.[ch] files

236 files changed:
.github/workflows/mkosi.yml
TODO
man/systemd-analyze.xml
man/systemd.netdev.xml
man/systemd.system-credentials.xml
mkosi.images/system/mkosi.conf.d/10-ubuntu.conf
shell-completion/bash/systemd-analyze
src/analyze/analyze.c
src/hostname/hostnamed.c
src/libsystemd/sd-id128/id128-util.c
src/network/netdev/wireguard.c
src/nspawn/nspawn.c
src/shared/meson.build
src/shared/varlink-io.systemd.Hostname.c [new file with mode: 0644]
src/shared/varlink-io.systemd.Hostname.h [new file with mode: 0644]
test/test-execute/exec-ambientcapabilities-dynuser.service
test/test-execute/exec-ambientcapabilities-merge-nfsnobody.service
test/test-execute/exec-ambientcapabilities-merge-nobody.service
test/test-execute/exec-ambientcapabilities-merge.service
test/test-execute/exec-ambientcapabilities-nfsnobody.service
test/test-execute/exec-ambientcapabilities-nobody.service
test/test-execute/exec-ambientcapabilities.service
test/test-execute/exec-bindpaths.service
test/test-execute/exec-capabilityboundingset-invert.service
test/test-execute/exec-capabilityboundingset-merge.service
test/test-execute/exec-capabilityboundingset-reset.service
test/test-execute/exec-capabilityboundingset-simple.service
test/test-execute/exec-condition-failed.service
test/test-execute/exec-condition-skip.service
test/test-execute/exec-cpuaffinity1.service
test/test-execute/exec-cpuaffinity2.service
test/test-execute/exec-cpuaffinity3.service
test/test-execute/exec-dynamicuser-fixeduser-adm.service
test/test-execute/exec-dynamicuser-fixeduser-games.service
test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service
test/test-execute/exec-dynamicuser-fixeduser.service
test/test-execute/exec-dynamicuser-runtimedirectory1.service
test/test-execute/exec-dynamicuser-runtimedirectory2.service
test/test-execute/exec-dynamicuser-runtimedirectory3.service
test/test-execute/exec-dynamicuser-statedir-migrate-step1.service
test/test-execute/exec-dynamicuser-statedir-migrate-step2.service
test/test-execute/exec-dynamicuser-supplementarygroups.service
test/test-execute/exec-environment-empty.service
test/test-execute/exec-environment-multiple.service
test/test-execute/exec-environment-no-substitute.service
test/test-execute/exec-environment.service
test/test-execute/exec-environmentfile.service
test/test-execute/exec-execsearchpath-environment-path-set.service
test/test-execute/exec-execsearchpath-environment.service
test/test-execute/exec-execsearchpath-environmentfile-set.service
test/test-execute/exec-execsearchpath-environmentfile.service
test/test-execute/exec-execsearchpath-passenvironment-set.service
test/test-execute/exec-execsearchpath-passenvironment.service
test/test-execute/exec-execsearchpath-unit-specifier.service
test/test-execute/exec-group-nfsnobody.service
test/test-execute/exec-group-nobody.service
test/test-execute/exec-group-nogroup.service
test/test-execute/exec-group.service
test/test-execute/exec-ignoresigpipe-no.service
test/test-execute/exec-ignoresigpipe-yes.service
test/test-execute/exec-inaccessiblepaths-mount-propagation.service
test/test-execute/exec-inaccessiblepaths-sys.service
test/test-execute/exec-ioschedulingclass-best-effort.service
test/test-execute/exec-ioschedulingclass-idle.service
test/test-execute/exec-ioschedulingclass-none.service
test/test-execute/exec-ioschedulingclass-realtime.service
test/test-execute/exec-load-credential.service
test/test-execute/exec-networknamespacepath-privatemounts-no.service
test/test-execute/exec-networknamespacepath-privatemounts-yes.service
test/test-execute/exec-noexecpaths-simple.service
test/test-execute/exec-oomscoreadjust-negative.service
test/test-execute/exec-oomscoreadjust-positive.service
test/test-execute/exec-passenvironment-absent.service
test/test-execute/exec-passenvironment-empty.service
test/test-execute/exec-passenvironment-repeated.service
test/test-execute/exec-passenvironment.service
test/test-execute/exec-personality-aarch64.service
test/test-execute/exec-personality-loongarch64.service
test/test-execute/exec-personality-ppc64.service
test/test-execute/exec-personality-ppc64le.service
test/test-execute/exec-personality-s390.service
test/test-execute/exec-personality-x86-64.service
test/test-execute/exec-personality-x86.service
test/test-execute/exec-privatedevices-bind.service
test/test-execute/exec-privatedevices-disabled-by-prefix.service
test/test-execute/exec-privatedevices-no-capability-mknod.service
test/test-execute/exec-privatedevices-no-capability-sys-rawio.service
test/test-execute/exec-privatedevices-no.service
test/test-execute/exec-privatedevices-yes-capability-mknod.service
test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service
test/test-execute/exec-privatedevices-yes-with-group.service
test/test-execute/exec-privatedevices-yes.service
test/test-execute/exec-privatenetwork-yes-privatemounts-no.service
test/test-execute/exec-privatenetwork-yes-privatemounts-yes.service
test/test-execute/exec-privatetmp-disabled-by-prefix.service
test/test-execute/exec-privatetmp-no.service
test/test-execute/exec-privatetmp-yes.service
test/test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service
test/test-execute/exec-protectkernellogs-no-capabilities.service
test/test-execute/exec-protectkernellogs-yes-capabilities.service
test/test-execute/exec-protectkernelmodules-no-capabilities.service
test/test-execute/exec-protectkernelmodules-yes-capabilities.service
test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service
test/test-execute/exec-readonlypaths-mount-propagation.service
test/test-execute/exec-readonlypaths-simple.service
test/test-execute/exec-readonlypaths-with-bindpaths.service
test/test-execute/exec-readonlypaths.service
test/test-execute/exec-readwritepaths-mount-propagation.service
test/test-execute/exec-runtimedirectory-mode.service
test/test-execute/exec-runtimedirectory-owner-nfsnobody.service
test/test-execute/exec-runtimedirectory-owner-nobody.service
test/test-execute/exec-runtimedirectory-owner-nogroup.service
test/test-execute/exec-runtimedirectory-owner.service
test/test-execute/exec-runtimedirectory.service
test/test-execute/exec-set-credential.service
test/test-execute/exec-specifier-interpolation.service
test/test-execute/exec-standardinput-data.service
test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service
test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service
test/test-execute/exec-supplementarygroups-single-group-user.service
test/test-execute/exec-supplementarygroups-single-group.service
test/test-execute/exec-supplementarygroups.service
test/test-execute/exec-systemcallerrornumber-name.service
test/test-execute/exec-systemcallerrornumber-number.service
test/test-execute/exec-systemcallfilter-failing.service
test/test-execute/exec-systemcallfilter-failing2.service
test/test-execute/exec-systemcallfilter-failing3.service
test/test-execute/exec-systemcallfilter-nonewprivileges-bounding1.service
test/test-execute/exec-systemcallfilter-nonewprivileges-bounding2.service
test/test-execute/exec-systemcallfilter-nonewprivileges-protectclock.service
test/test-execute/exec-systemcallfilter-nonewprivileges.service
test/test-execute/exec-systemcallfilter-not-failing.service
test/test-execute/exec-systemcallfilter-not-failing2.service
test/test-execute/exec-systemcallfilter-not-failing3.service
test/test-execute/exec-systemcallfilter-override-error-action.service
test/test-execute/exec-systemcallfilter-override-error-action2.service
test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service
test/test-execute/exec-systemcallfilter-system-user-nobody.service
test/test-execute/exec-systemcallfilter-system-user.service
test/test-execute/exec-systemcallfilter-with-errno-in-allow-list.service
test/test-execute/exec-systemcallfilter-with-errno-multi.service
test/test-execute/exec-systemcallfilter-with-errno-name.service
test/test-execute/exec-systemcallfilter-with-errno-number.service
test/test-execute/exec-temporaryfilesystem-options.service
test/test-execute/exec-temporaryfilesystem-ro.service
test/test-execute/exec-temporaryfilesystem-usr.service
test/test-execute/exec-umask-0177.service
test/test-execute/exec-umask-default.service
test/test-execute/exec-umask-namespace.service
test/test-execute/exec-unsetenvironment.service
test/test-execute/exec-user-nfsnobody.service
test/test-execute/exec-user-nobody.service
test/test-execute/exec-user.service
test/test-execute/exec-workingdirectory-trailing-dot.service
test/test-execute/exec-workingdirectory.service
test/test-network/conf/25-wireguard-endpoint-peer0-cred.txt [new file with mode: 0644]
test/test-network/conf/25-wireguard-no-peer-private-key-cred.txt [new file with mode: 0644]
test/test-network/conf/25-wireguard-no-peer.netdev
test/test-network/conf/25-wireguard-preshared-key-peer2-cred.txt [new file with mode: 0644]
test/test-network/conf/25-wireguard.netdev
test/test-network/conf/25-wireguard.netdev.d/peer2.conf
test/test-network/systemd-networkd-tests.py
test/testsuite-23.units/testsuite-23-binds-to.service
test/testsuite-23.units/testsuite-23-bound-by.service
test/testsuite-23.units/testsuite-23-fail.service
test/testsuite-23.units/testsuite-23-joins-namespace-of-1.service
test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service
test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service
test/testsuite-23.units/testsuite-23-joins-namespace-of-8.service
test/testsuite-23.units/testsuite-23-namespaced.service
test/testsuite-23.units/testsuite-23-non-namespaced.service
test/testsuite-23.units/testsuite-23-prop-stop-one.service
test/testsuite-23.units/testsuite-23-prop-stop-two.service
test/testsuite-23.units/testsuite-23-retry-fail.service
test/testsuite-23.units/testsuite-23-retry-upheld.service
test/testsuite-23.units/testsuite-23-retry-uphold.service
test/testsuite-23.units/testsuite-23-success.service
test/testsuite-23.units/testsuite-23-upheldby-install.service
test/testsuite-23.units/testsuite-23-uphold.service
test/units/a-conj.service
test/units/a.service
test/units/b.service
test/units/c.service
test/units/d.service
test/units/daughter.service
test/units/dml-discard-empty.service
test/units/dml-discard-set-ml.service
test/units/dml-override-empty.service
test/units/dml-passthrough-empty.service
test/units/dml-passthrough-set-dml.service
test/units/dml-passthrough-set-ml.service
test/units/e.service
test/units/f.service
test/units/g.service
test/units/grandchild.service
test/units/h.service
test/units/i.service
test/units/loopy.service
test/units/loopy2.service
test/units/loopy3.service
test/units/loopy4.service
test/units/nomemleaf.service
test/units/sched_idle_bad.service
test/units/sched_idle_ok.service
test/units/sched_rr_bad.service
test/units/sched_rr_change.service
test/units/sched_rr_ok.service
test/units/son.service
test/units/testsuite-03.sh
test/units/testsuite-07.issue-1981.sh
test/units/testsuite-07.issue-3171.sh
test/units/testsuite-07.poll-limit.sh
test/units/testsuite-23.ExecReload.sh
test/units/testsuite-23.clean-unit.sh
test/units/testsuite-23.start-stop-no-reload.sh
test/units/testsuite-36.sh
test/units/testsuite-38-sleep.service
test/units/testsuite-45.sh
test/units/testsuite-50.sh
test/units/testsuite-59.sh
test/units/testsuite-62-1.service
test/units/testsuite-62-2.service
test/units/testsuite-62-3.service
test/units/testsuite-62-4.service
test/units/testsuite-62-5.service
test/units/testsuite-65.sh
test/units/testsuite-66-deviceisolation.service
test/units/testsuite-69.service
test/units/testsuite-71.sh
test/units/testsuite-74.delta.sh
test/units/testsuite-74.varlinkctl.sh
test/units/unit-with-multiple-dashes.service
units/meson.build
units/systemd-hostnamed.socket [new file with mode: 0644]
units/systemd-networkd.service.in

index 8b32ec82e3251fb7d9d65c1874cc99eb250c110a..f6eddebffb55511e5e624de8d4173dc780940452 100644 (file)
@@ -76,21 +76,31 @@ jobs:
 
     steps:
     - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
-    - uses: systemd/mkosi@bbe715f42911f9660712377a5b39335b9391ae22
+    - uses: systemd/mkosi@dbce89aabda438ba58080366631b2c242e365f21
 
     - name: Configure
       run: |
-        tee mkosi.local.conf <<EOF
+        tee mkosi.local.conf <<EOF
         [Distribution]
         Distribution=${{ matrix.distro }}
         Release=${{ matrix.release }}
-        EOF
 
-        tee mkosi.conf.d/99-ci.conf <<- EOF
         [Content]
         Environment=CI_BUILD=1
                     SLOW_TESTS=true
 
+        [Host]
+        ToolsTree=default
+        ToolsTreeDistribution=fedora
+        QemuVsock=yes
+        # Sometimes we run on a host with /dev/kvm, but it is broken, so explicitly disable it
+        QemuKvm=no
+        Ephemeral=yes
+        EOF
+
+        # These should override the options from mkosi.conf so we put them in a dropin that's ordered later
+        # instead.
+        tee mkosi.conf.d/99-ci.conf <<EOF
         [Host]
         KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
                                systemd.journald.max_level_console=debug
@@ -98,17 +108,13 @@ jobs:
                                udev.log_level=info
                                # Root device can take a long time to appear, so let's bump the timeout.
                                systemd.default_device_timeout_sec=180
-        QemuVsock=yes
-        # Sometimes we run on a host with /dev/kvm, but it is broken, so explicitly disable it
-        QemuKvm=no
-        Ephemeral=yes
         EOF
 
         # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
         # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
 
         mkdir -p mkosi.images/system/mkosi.repart/10-usr.conf.d
-        tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<EOF
+        tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<EOF
         [Partition]
         Format=squashfs
         EOF
@@ -117,7 +123,7 @@ jobs:
         # eventually times out. Override it to just shutdown immediately.
         mkdir -p mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
         mkdir -p mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
-        tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<EOF
+        tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<EOF
         [Unit]
         FailureAction=exit
         [Service]
diff --git a/TODO b/TODO
index f6a76b9a2b9f278ce029427598f75e4e9583582c..130da3e8d06b7e86aeb41e0dfe4585cb33638bd0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -132,6 +132,11 @@ Deprecations and removals:
 
 Features:
 
+* extend the smbios11 logic for passing credentials so that instead of passing
+  the credential data literally it can also just reference an AF_VSOCK CID/port
+  to read them from. This way the data doesn't remain in the SMBIOS blob during
+  runtime, but only in the credentials fs.
+
 * In .link files add support for setting ID_NET_MANAGED_BY= udev field via some
   high-level setting. Possibly also add setting to add arbitrary udev fields.
 
@@ -827,10 +832,6 @@ Features:
   would just use the same public key specified with --public-key= (or the one
   automatically derived from --private-key=).
 
-* push people to use ".sysext.raw" as suffix for sysext DDIs (DDI =
-  discoverable disk images, i.e. the new name for gpt disk images following the
-  discoverable disk spec). [Also: just ".sysext/" for directory-based sysext]
-
 * Add "purpose" flag to partition flags in discoverable partition spec that
   indicate if partition is intended for sysext, for portable service, for
   booting and so on. Then, when dissecting DDI allow specifying a purpose to
@@ -924,8 +925,6 @@ Features:
   should probably also one you can use to get a remote attestation quote.
 
 * Process credentials in:
-  â€¢ networkd/udevd: add a way to define additional .link, .network, .netdev files
-    via the credentials logic.
   â€¢ crypttab-generator: allow defining additional crypttab-like volumes via
     credentials (similar: verity-generator, integrity-generator). Use
     fstab-generator logic as inspiration.
@@ -1324,8 +1323,9 @@ Features:
   - acquire + decrypt creds from pkcs11?
   - make systemd-cryptsetup acquire pw via creds logic
   - make PAMName= acquire pw via creds logic
-  - make macsec/wireguard code in networkd read key via creds logic
-  - make gatwayd/remote read key via creds logic
+  - make macsec code in networkd read key via creds logic (copy logic from
+    wireguard)
+  - make gatewayd/remote read key via creds logic
   - add sd_notify() command for flushing out creds not needed anymore
   - make user manager instances create and use a user-specific key (the one in
     /var/lib is root-only) and add --user switch to systemd-creds to use it
index 41c0e45df63198ee5fd9aa4ec2b11bcc94ab9997..0b5e8ba974fba209a8a9d31862ecb8a54c251ddc 100644 (file)
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="plain">verify</arg>
-      <arg choice="opt" rep="repeat"><replaceable>FILE</replaceable></arg>
+      <arg choice="plain" rep="repeat"><replaceable>FILE</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="plain">security</arg>
-      <arg choice="plain" rep="repeat"><replaceable>UNIT</replaceable></arg>
+      <arg choice="opt" rep="repeat"><replaceable>UNIT</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="plain">fdstore</arg>
-      <arg choice="opt" rep="repeat"><replaceable>UNIT</replaceable></arg>
+      <arg choice="plain" rep="repeat"><replaceable>UNIT</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
@@ -839,7 +839,7 @@ alias.service:7: Unknown key name 'MysteryKey' in section 'Service', ignoring.
     </refsect2>
 
     <refsect2>
-      <title><command>systemd-analyze fdstore <optional><replaceable>UNIT</replaceable>...</optional></command></title>
+      <title><command>systemd-analyze fdstore <replaceable>UNIT</replaceable>...</command></title>
 
       <para>Lists the current contents of the specified service unit's file descriptor store. This shows
       names, inode types, device numbers, inode numbers, paths and open modes of the open file
@@ -868,7 +868,7 @@ stored sock 0:8   4213190 -      socket:[4213190] ro
     </refsect2>
 
     <refsect2>
-      <title><command>systemd-analyze image-policy <optional><replaceable>POLICY</replaceable>…</optional></command></title>
+      <title><command>systemd-analyze image-policy <replaceable>POLICY</replaceable>…</command></title>
 
       <para>This command analyzes the specified image policy string, as per
       <citerefentry><refentrytitle>systemd.image-policy</refentrytitle><manvolnum>7</manvolnum></citerefentry>. The
@@ -1513,6 +1513,7 @@ x86-64      native</programlisting>
       <xi:include href="user-system-options.xml" xpointer="machine" />
 
       <varlistentry>
+        <term><option>-q</option></term>
         <term><option>--quiet</option></term>
 
         <listitem><para>Suppress hints and other non-essential output.</para>
index cd77e725bc49b266aeacb60fdb1408cc55968c0e..bf3b5c21daef51a7eb175f402c45a2b7aa672c0e 100644 (file)
       <varlistentry>
         <term><varname>PrivateKey=</varname></term>
         <listitem>
-          <para>The Base64 encoded private key for the interface. It can be
-          generated using the <command>wg genkey</command> command
+          <para>The Base64 encoded private key for the interface. It can be generated using
+          the <command>wg genkey</command> command
           (see <citerefentry project="wireguard"><refentrytitle>wg</refentrytitle><manvolnum>8</manvolnum></citerefentry>).
-          This option or <varname>PrivateKeyFile=</varname> is mandatory to use WireGuard.
-          Note that because this information is secret, you may want to set
-          the permissions of the .netdev file to be owned by <literal>root:systemd-network</literal>
-          with a <literal>0640</literal> file mode.</para>
+          Specially, if the specified key is prefixed with <literal>@</literal>, it is interpreted as
+          the name of the credential from which the actual key shall be read. <command>systemd-networkd.service</command>
+          automatically imports credentials matching <literal>network.wireguard.*</literal>. For more details
+          on credentials, refer to
+          <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+          A private key is mandatory to use WireGuard. If not set, the credential
+          <literal>network.wireguard.private.<replaceable>netdev</replaceable></literal> is used if exists.
+          I.e. for <filename>50-foobar.netdev</filename>, <literal>network.wireguard.private.50-foobar</literal>
+          is tried.</para>
+
+          <para>Note that because this information is secret, it's strongly recommended to use an (encrypted)
+          credential. Alternatively, you may want to set the permissions of the .netdev file to be owned
+          by <literal>root:systemd-network</literal> with a <literal>0640</literal> file mode.</para>
 
           <xi:include href="version-info.xml" xpointer="v237"/>
         </listitem>
         <listitem>
           <para>Sets a Base64 encoded public key calculated by <command>wg pubkey</command>
           (see <citerefentry project="wireguard"><refentrytitle>wg</refentrytitle><manvolnum>8</manvolnum></citerefentry>)
-          from a private key, and usually transmitted out of band to the
-          author of the configuration file. This option is mandatory for this
-          section.</para>
+          from a private key, and usually transmitted out of band to the author of the configuration file.
+          This option honors the <literal>@</literal> prefix in the same way as the <option>PrivateKey=</option>
+          setting of the <option>[WireGuard]</option> section. This option is mandatory for this section.</para>
 
         <xi:include href="version-info.xml" xpointer="v237"/>
         </listitem>
       <varlistentry>
         <term><varname>PresharedKey=</varname></term>
         <listitem>
-          <para>Optional preshared key for the interface. It can be generated
-          by the <command>wg genpsk</command> command. This option adds an
-          additional layer of symmetric-key cryptography to be mixed into the
-          already existing public-key cryptography, for post-quantum
-          resistance.
-          Note that because this information is secret, you may want to set
-          the permissions of the .netdev file to be owned by <literal>root:systemd-network</literal>
-          with a <literal>0640</literal> file mode.</para>
+          <para>Optional preshared key for the interface. It can be generated by the <command>wg genpsk</command>
+          command. This option adds an additional layer of symmetric-key cryptography to be mixed into the
+          already existing public-key cryptography, for post-quantum resistance.
+          This option honors the <literal>@</literal> prefix in the same way as the <option>PrivateKey=</option>
+          setting of the <option>[WireGuard]</option> section.</para>
+
+          <para>Note that because this information is secret, it's strongly recommended to use an (encrypted)
+          credential. Alternatively, you may want to set the permissions of the .netdev file to be owned
+          by <literal>root:systemd-network</literal> with a <literal>0640</literal> file mode.</para>
 
           <xi:include href="version-info.xml" xpointer="v237"/>
         </listitem>
       <varlistentry>
         <term><varname>Endpoint=</varname></term>
         <listitem>
-          <para>Sets an endpoint IP address or hostname, followed by a colon, and then
-          a port number. IPv6 address must be in the square brackets. For example,
-          <literal>111.222.333.444:51820</literal> for IPv4 and <literal>[1111:2222::3333]:51820</literal>
-          for IPv6 address. This endpoint will be updated automatically once to
-          the most recent source IP address and port of correctly
+          <para>Sets an endpoint IP address or hostname, followed by a colon, and then a port number.
+          IPv6 address must be in the square brackets. For example, <literal>111.222.333.444:51820</literal>
+          for IPv4 and <literal>[1111:2222::3333]:51820</literal> for IPv6 address. This endpoint will be
+          updated automatically once to the most recent source IP address and port of correctly
           authenticated packets from the peer at configuration time.</para>
 
+          <para>This option honors the <literal>@</literal> prefix in the same way as the <option>PrivateKey=</option>
+          setting of the <option>[WireGuard]</option> section.</para>
+
           <xi:include href="version-info.xml" xpointer="v237"/>
         </listitem>
       </varlistentry>
index b2d491fe5813aa49a3a94536f50229ac0733078b..eb4c94c47f1a3ad276ea9fb3497d128c278081c6 100644 (file)
 
           <para>Note that the resulting files are created world-readable, it's hence recommended to not include
           secrets in these credentials, but supply them via separate credentials directly to
-          <filename>systemd-networkd.service</filename>.</para>
+          <filename>systemd-networkd.service</filename>, e.g. <varname>network.wireguard.*</varname>
+          as described below.</para>
+
+          <xi:include href="version-info.xml" xpointer="v256"/>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><varname>network.wireguard.*</varname></term>
+        <listitem>
+          <para>Configures secrets for WireGuard netdevs. Read by
+          <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+          For more information, refer to the <option>[WireGuard]</option> section of
+          <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+          </para>
 
           <xi:include href="version-info.xml" xpointer="v256"/>
         </listitem>
index f58ee7e02e299378ece07b40f845247949784312..b099e79132e7d10e0924309f91fc6cf805e18fc6 100644 (file)
@@ -9,3 +9,6 @@ Packages=
         linux-image-generic
         linux-tools-common
         linux-tools-generic
+# "orphan_file" is enabled by default in recent versions of mkfs.ext4 but not supported by the Jammy kernel
+# so we explicitly disable it.
+Environment=SYSTEMD_REPART_MKFS_OPTIONS_EXT4="-O ^orphan_file"
index d27a6422207bea994e66a59c29b0b5ccc8aff14f..00cb478688d2ffcba22a853a9dae223118432b4f 100644 (file)
@@ -61,7 +61,7 @@ _systemd_analyze() {
 
     local -A OPTS=(
         [STANDALONE]='-h --help --version --system --user --global --order --require --no-pager
-                             --man=no --generators=yes --quiet'
+                             --man=no --generators=yes -q --quiet'
         [ARG]='-H --host -M --machine --fuzz --from-pattern --to-pattern --root'
     )
 
index 6edc412e751b75e6f47da06f7d39206b6d4242b8..14458260c6aa420a40edc3d9805eff7388f8b5e3 100644 (file)
@@ -218,7 +218,7 @@ static int help(int argc, char *argv[], void *userdata) {
                "  dot [UNIT...]              Output dependency graph in %s format\n"
                "  dump [PATTERN...]          Output state serialization of service\n"
                "                             manager\n"
-               "  cat-config                 Show configuration file and drop-ins\n"
+               "  cat-config NAME|PATH...    Show configuration file and drop-ins\n"
                "  unit-files                 List files and symlinks for units\n"
                "  unit-paths                 List load directories for units\n"
                "  exit-status [STATUS...]    List exit status definitions\n"
@@ -238,6 +238,7 @@ static int help(int argc, char *argv[], void *userdata) {
                "  inspect-elf FILE...        Parse and print ELF package metadata\n"
                "  malloc [D-BUS SERVICE...]  Dump malloc stats of a D-Bus service\n"
                "  fdstore SERVICE...         Show file descriptor store contents of service\n"
+               "  image-policy POLICY...     Analyze image policy string\n"
                "  pcrs [PCR...]              Show TPM2 PCRs and their names\n"
                "  srk > FILE                 Write TPM2 SRK to stdout\n"
                "\nOptions:\n"
@@ -362,7 +363,7 @@ static int parse_argv(int argc, char *argv[]) {
         assert(argc >= 0);
         assert(argv);
 
-        while ((c = getopt_long(argc, argv, "hH:M:U:", options, NULL)) >= 0)
+        while ((c = getopt_long(argc, argv, "hH:M:U:q", options, NULL)) >= 0)
                 switch (c) {
 
                 case 'h':
index d629a07d0fbab202dca167454c4406528abcbe5a..f01d771f9bc1e28adcf182d2bcd7ac9902dadcfb 100644 (file)
@@ -38,6 +38,7 @@
 #include "string-table.h"
 #include "strv.h"
 #include "user-util.h"
+#include "varlink-io.systemd.Hostname.h"
 #include "virt.h"
 
 #define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:")
@@ -75,6 +76,9 @@ typedef struct Context {
         struct stat etc_os_release_stat;
         struct stat etc_machine_info_stat;
 
+        sd_event *event;
+        sd_bus *bus;
+        VarlinkServer *varlink_server;
         Hashmap *polkit_registry;
 } Context;
 
@@ -94,6 +98,9 @@ static void context_destroy(Context *c) {
 
         context_reset(c, UINT64_MAX);
         hashmap_free(c->polkit_registry);
+        sd_event_unref(c->event);
+        sd_bus_flush_close_unref(c->bus);
+        varlink_server_unref(c->varlink_server);
 }
 
 static void context_read_etc_hostname(Context *c) {
@@ -1343,34 +1350,19 @@ static int method_get_hardware_serial(sd_bus_message *m, void *userdata, sd_bus_
         return sd_bus_send(NULL, reply, NULL);
 }
 
-static int method_describe(sd_bus_message *m, void *userdata, sd_bus_error *error) {
-        _cleanup_free_ char *hn = NULL, *dhn = NULL, *in = NULL, *text = NULL,
+static int build_describe_response(Context *c, bool privileged, JsonVariant **ret) {
+        _cleanup_free_ char *hn = NULL, *dhn = NULL, *in = NULL,
                 *chassis = NULL, *vendor = NULL, *model = NULL, *serial = NULL, *firmware_version = NULL,
                 *firmware_vendor = NULL;
         usec_t firmware_date = USEC_INFINITY, eol = USEC_INFINITY;
-        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
         _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
         sd_id128_t machine_id, boot_id, product_uuid = SD_ID128_NULL;
         unsigned local_cid = VMADDR_CID_ANY;
-        Context *c = ASSERT_PTR(userdata);
-        bool privileged;
         struct utsname u;
         int r;
 
-        assert(m);
-
-        r = bus_verify_polkit_async(
-                        m,
-                        "org.freedesktop.hostname1.get-description",
-                        /* details= */ NULL,
-                        &c->polkit_registry,
-                        error);
-        if (r == 0)
-                return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
-
-        /* We ignore all authentication errors here, since most data is unprivileged, the one exception being
-         * the product ID which we'll check explicitly. */
-        privileged = r > 0;
+        assert(c);
+        assert(ret);
 
         context_read_etc_hostname(c);
         context_read_machine_info(c);
@@ -1452,11 +1444,42 @@ static int method_describe(sd_bus_message *m, void *userdata, sd_bus_error *erro
                                        JSON_BUILD_PAIR_ID128("BootID", boot_id),
                                        JSON_BUILD_PAIR_CONDITION(!sd_id128_is_null(product_uuid), "ProductUUID", JSON_BUILD_ID128(product_uuid)),
                                        JSON_BUILD_PAIR_CONDITION(sd_id128_is_null(product_uuid), "ProductUUID", JSON_BUILD_NULL),
-                                       JSON_BUILD_PAIR_CONDITION(local_cid != VMADDR_CID_ANY, "VSockCID", JSON_BUILD_UNSIGNED(local_cid))));
-
+                                       JSON_BUILD_PAIR_CONDITION(local_cid != VMADDR_CID_ANY, "VSockCID", JSON_BUILD_UNSIGNED(local_cid)),
+                                       JSON_BUILD_PAIR_CONDITION(local_cid == VMADDR_CID_ANY, "VSockCID", JSON_BUILD_NULL)));
         if (r < 0)
                 return log_error_errno(r, "Failed to build JSON data: %m");
 
+        *ret = TAKE_PTR(v);
+        return 0;
+}
+
+static int method_describe(sd_bus_message *m, void *userdata, sd_bus_error *error) {
+        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
+        _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
+        Context *c = ASSERT_PTR(userdata);
+        _cleanup_free_ char *text = NULL;
+        bool privileged;
+        int r;
+
+        assert(m);
+
+        r = bus_verify_polkit_async(
+                        m,
+                        "org.freedesktop.hostname1.get-description",
+                        /* details= */ NULL,
+                        &c->polkit_registry,
+                        error);
+        if (r == 0)
+                return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
+
+        /* We ignore all authentication errors here, since most data is unprivileged, the one exception being
+         * the product ID which we'll check explicitly. */
+        privileged = r > 0;
+
+        r = build_describe_response(c, privileged, &v);
+        if (r < 0)
+                return r;
+
         r = json_variant_format(v, 0, &text);
         if (r < 0)
                 return log_error_errno(r, "Failed to format JSON data: %m");
@@ -1559,35 +1582,114 @@ static const BusObjectImplementation manager_object = {
         .vtables = BUS_VTABLES(hostname_vtable),
 };
 
-static int connect_bus(Context *c, sd_event *event, sd_bus **ret) {
-        _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
+static int connect_bus(Context *c) {
         int r;
 
         assert(c);
-        assert(event);
-        assert(ret);
+        assert(c->event);
+        assert(!c->bus);
 
-        r = sd_bus_default_system(&bus);
+        r = sd_bus_default_system(&c->bus);
         if (r < 0)
                 return log_error_errno(r, "Failed to get system bus connection: %m");
 
-        r = bus_add_implementation(bus, &manager_object, c);
+        r = bus_add_implementation(c->bus, &manager_object, c);
         if (r < 0)
                 return r;
 
-        r = bus_log_control_api_register(bus);
+        r = bus_log_control_api_register(c->bus);
         if (r < 0)
                 return r;
 
-        r = sd_bus_request_name_async(bus, NULL, "org.freedesktop.hostname1", 0, NULL, NULL);
+        r = sd_bus_request_name_async(c->bus, NULL, "org.freedesktop.hostname1", 0, NULL, NULL);
         if (r < 0)
                 return log_error_errno(r, "Failed to request name: %m");
 
-        r = sd_bus_attach_event(bus, event, 0);
+        r = sd_bus_attach_event(c->bus, c->event, 0);
         if (r < 0)
                 return log_error_errno(r, "Failed to attach bus to event loop: %m");
 
-        *ret = TAKE_PTR(bus);
+        return 0;
+}
+
+static int vl_method_describe(Varlink *link, JsonVariant *parameters, VarlinkMethodFlags flags, void *userdata) {
+        static const JsonDispatch dispatch_table[] = {
+                VARLINK_DISPATCH_POLKIT_FIELD,
+                {}
+        };
+
+        Context *c = ASSERT_PTR(userdata);
+        bool privileged;
+        int r;
+
+        assert(link);
+        assert(parameters);
+
+        r = varlink_dispatch(link, parameters, dispatch_table, /* userdata= */ NULL);
+        if (r != 0)
+                return r;
+
+        r = varlink_verify_polkit_async(
+                        link,
+                        c->bus,
+                        "org.freedesktop.hostname1.get-hardware-serial",
+                        /* details= */ NULL,
+                        /* good_user= */ UID_INVALID,
+                        &c->polkit_registry);
+        if (r == 0)
+                return 0; /* No authorization for now, but the async polkit stuff will call us again when it has it */
+
+        /* We ignore all authentication errors here, since most data is unprivileged, the one exception being
+         * the product ID which we'll check explicitly. */
+        privileged = r > 0;
+
+        if (json_variant_elements(parameters) > 0)
+                return varlink_error_invalid_parameter(link, parameters);
+
+        _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
+        r = build_describe_response(c, privileged, &v);
+        if (r < 0)
+                return r;
+
+        return varlink_reply(link, v);
+}
+
+static int connect_varlink(Context *c) {
+        int r;
+
+        assert(c);
+        assert(c->event);
+        assert(!c->varlink_server);
+
+        r = varlink_server_new(&c->varlink_server, VARLINK_SERVER_ACCOUNT_UID|VARLINK_SERVER_INHERIT_USERDATA);
+        if (r < 0)
+                return log_error_errno(r, "Failed to allocate Varlink server: %m");
+
+        varlink_server_set_userdata(c->varlink_server, c);
+
+        r = varlink_server_add_interface(c->varlink_server, &vl_interface_io_systemd_Hostname);
+        if (r < 0)
+                return log_error_errno(r, "Failed to add Hostname interface to varlink server: %m");
+
+        r = varlink_server_bind_method_many(
+                        c->varlink_server,
+                        "io.systemd.Hostname.Describe", vl_method_describe);
+        if (r < 0)
+                return log_error_errno(r, "Failed to bind Varlink method calls: %m");
+
+        r = varlink_server_attach_event(c->varlink_server, c->event, SD_EVENT_PRIORITY_NORMAL);
+        if (r < 0)
+                return log_error_errno(r, "Failed to attach Varlink server to event loop: %m");
+
+        r = varlink_server_listen_auto(c->varlink_server);
+        if (r < 0)
+                return log_error_errno(r, "Failed to bind to passed Varlink sockets: %m");
+        if (r == 0) {
+                r = varlink_server_listen_address(c->varlink_server, "/run/systemd/io.systemd.Hostname", 0666);
+                if (r < 0)
+                        return log_error_errno(r, "Failed to bind to Varlink socket: %m");
+        }
+
         return 0;
 }
 
@@ -1595,8 +1697,6 @@ static int run(int argc, char *argv[]) {
         _cleanup_(context_destroy) Context context = {
                 .hostname_source = _HOSTNAME_INVALID, /* appropriate value will be set later */
         };
-        _cleanup_(sd_event_unrefp) sd_event *event = NULL;
-        _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
         int r;
 
         log_setup();
@@ -1615,27 +1715,31 @@ static int run(int argc, char *argv[]) {
         if (r < 0)
                 return r;
 
-        assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, -1) >= 0);
-
-        r = sd_event_default(&event);
+        r = sd_event_default(&context.event);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate event loop: %m");
 
-        (void) sd_event_set_watchdog(event, true);
+        (void) sd_event_set_watchdog(context.event, true);
 
-        r = sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
+        r = sd_event_set_signal_exit(context.event, true);
         if (r < 0)
-                return log_error_errno(r, "Failed to install SIGINT handler: %m");
+                return log_error_errno(r, "Failed to install SIGINT/SIGTERM handlers: %m");
 
-        r = sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
+        r = connect_bus(&context);
         if (r < 0)
-                return log_error_errno(r, "Failed to install SIGTERM handler: %m");
+                return r;
 
-        r = connect_bus(&context, event, &bus);
+        r = connect_varlink(&context);
         if (r < 0)
                 return r;
 
-        r = bus_event_loop_with_idle(event, bus, "org.freedesktop.hostname1", DEFAULT_EXIT_USEC, NULL, NULL);
+        r = bus_event_loop_with_idle(
+                        context.event,
+                        context.bus,
+                        "org.freedesktop.hostname1",
+                        DEFAULT_EXIT_USEC,
+                        /* check_idle= */ NULL,
+                        /* userdata= */ NULL);
         if (r < 0)
                 return log_error_errno(r, "Failed to run event loop: %m");
 
index 69fc1bf07e5d52e6596b21c3457b4c1bbaea2439..5808cea7576a9fd827af28c76e202fb4f92cc48a 100644 (file)
@@ -13,6 +13,7 @@
 #include "stdio-util.h"
 #include "string-util.h"
 #include "sync-util.h"
+#include "virt.h"
 
 int id128_from_string_nonzero(const char *s, sd_id128_t *ret) {
         sd_id128_t t;
@@ -223,6 +224,13 @@ int id128_get_product(sd_id128_t *ret) {
         /* Reads the systems product UUID from DMI or devicetree (where it is located on POWER). This is
          * particularly relevant in VM environments, where VM managers typically place a VM uuid there. */
 
+        r = detect_container();
+        if (r < 0)
+                return r;
+        if (r > 0) /* Refuse returning this in containers, as this is not a property of our system then, but
+                    * of the host */
+                return -ENOENT;
+
         r = id128_read("/sys/class/dmi/id/product_uuid", ID128_FORMAT_UUID, &uuid);
         if (r == -ENOENT)
                 r = id128_read("/proc/device-tree/vm,uuid", ID128_FORMAT_UUID, &uuid);
index 4c7d837c412c76609029830888c37707cd8c0ee1..57c3923c1b1764b755ba77c8ce64f010fe8be59c 100644 (file)
@@ -12,6 +12,7 @@
 #include "sd-resolve.h"
 
 #include "alloc-util.h"
+#include "creds-util.h"
 #include "dns-domain.h"
 #include "event-util.h"
 #include "fd-util.h"
@@ -25,6 +26,7 @@
 #include "networkd-util.h"
 #include "parse-helpers.h"
 #include "parse-util.h"
+#include "path-util.h"
 #include "random-util.h"
 #include "resolve-private.h"
 #include "string-util.h"
@@ -480,6 +482,8 @@ static int wireguard_decode_key_and_warn(
                 const char *lvalue) {
 
         _cleanup_(erase_and_freep) void *key = NULL;
+        _cleanup_(erase_and_freep) char *cred = NULL;
+        const char *cred_name;
         size_t len;
         int r;
 
@@ -493,10 +497,22 @@ static int wireguard_decode_key_and_warn(
                 return 0;
         }
 
-        if (!streq(lvalue, "PublicKey"))
+        cred_name = startswith(rvalue, "@");
+        if (cred_name) {
+                r = read_credential(cred_name, (void**) &cred, /* ret_size = */ NULL);
+                if (r == -ENOMEM)
+                        return log_oom();
+                if (r < 0) {
+                        log_syntax(unit, LOG_WARNING, filename, line, r,
+                                   "Failed to read credential for wireguard key (%s=), ignoring assignment: %m",
+                                   lvalue);
+                        return 0;
+                }
+
+        } else if (!streq(lvalue, "PublicKey"))
                 (void) warn_file_is_world_accessible(filename, NULL, unit, line);
 
-        r = unbase64mem_full(rvalue, strlen(rvalue), true, &key, &len);
+        r = unbase64mem_full(cred ?: rvalue, SIZE_MAX, /* secure = */ true, &key, &len);
         if (r == -ENOMEM)
                 return log_oom();
         if (r < 0) {
@@ -721,23 +737,39 @@ int config_parse_wireguard_endpoint(
                 void *data,
                 void *userdata) {
 
-        assert(filename);
-        assert(rvalue);
-        assert(userdata);
-
         Wireguard *w = WIREGUARD(userdata);
         _cleanup_(wireguard_peer_free_or_set_invalidp) WireguardPeer *peer = NULL;
-        _cleanup_free_ char *host = NULL;
-        union in_addr_union addr;
-        const char *p;
+        _cleanup_free_ char *cred = NULL;
+        const char *cred_name, *endpoint;
         uint16_t port;
-        int family, r;
+        int r;
+
+        assert(filename);
+        assert(rvalue);
 
         r = wireguard_peer_new_static(w, filename, section_line, &peer);
         if (r < 0)
                 return log_oom();
 
-        r = in_addr_port_ifindex_name_from_string_auto(rvalue, &family, &addr, &port, NULL, NULL);
+        cred_name = startswith(rvalue, "@");
+        if (cred_name) {
+                r = read_credential(cred_name, (void**) &cred, /* ret_size = */ NULL);
+                if (r == -ENOMEM)
+                        return log_oom();
+                if (r < 0) {
+                        log_syntax(unit, LOG_WARNING, filename, line, r,
+                                   "Failed to read credential for wireguard endpoint, ignoring assignment: %m");
+                        return 0;
+                }
+
+                endpoint = strstrip(cred);
+        } else
+                endpoint = rvalue;
+
+        union in_addr_union addr;
+        int family;
+
+        r = in_addr_port_ifindex_name_from_string_auto(endpoint, &family, &addr, &port, NULL, NULL);
         if (r >= 0) {
                 if (family == AF_INET)
                         peer->endpoint.in = (struct sockaddr_in) {
@@ -761,17 +793,23 @@ int config_parse_wireguard_endpoint(
                 return 0;
         }
 
-        p = strrchr(rvalue, ':');
+        _cleanup_free_ char *host = NULL;
+        const char *p;
+
+        p = strrchr(endpoint, ':');
         if (!p) {
                 log_syntax(unit, LOG_WARNING, filename, line, 0,
                            "Unable to find port of endpoint, ignoring assignment: %s",
-                           rvalue);
+                           rvalue); /* We log the original assignment instead of resolved credential here,
+                                       as the latter might be previously encrypted and we'd expose them in
+                                       unprotected logs otherwise. */
                 return 0;
         }
 
-        host = strndup(rvalue, p - rvalue);
+        host = strndup(endpoint, p - endpoint);
         if (!host)
                 return log_oom();
+        p++;
 
         if (!dns_name_is_valid(host)) {
                 log_syntax(unit, LOG_WARNING, filename, line, 0,
@@ -780,7 +818,6 @@ int config_parse_wireguard_endpoint(
                 return 0;
         }
 
-        p++;
         r = parse_ip_port(p, &port);
         if (r < 0) {
                 log_syntax(unit, LOG_WARNING, filename, line, r,
@@ -1078,6 +1115,55 @@ static int wireguard_peer_verify(WireguardPeer *peer) {
         return 0;
 }
 
+static int wireguard_read_default_key_cred(NetDev *netdev, const char *filename) {
+        Wireguard *w = WIREGUARD(netdev);
+        _cleanup_free_ char *config_name = NULL;
+        int r;
+
+        assert(filename);
+
+        r = path_extract_filename(filename, &config_name);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r,
+                                              "%s: Failed to extract config name, ignoring network device: %m",
+                                              filename);
+
+        char *p = endswith(config_name, ".netdev");
+        if (!p)
+                /* Fuzzer run? Then we just ignore this device. */
+                return log_netdev_error_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
+                                              "%s: Invalid netdev config name, refusing default key lookup.",
+                                              filename);
+        *p = '\0';
+
+        _cleanup_(erase_and_freep) char *cred = NULL;
+
+        r = read_credential(strjoina("network.wireguard.private.", config_name), (void**) &cred, /* ret_size = */ NULL);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r,
+                                              "%s: No private key specified and default key isn't available, "
+                                              "ignoring network device: %m",
+                                              filename);
+
+        _cleanup_(erase_and_freep) void *key = NULL;
+        size_t len;
+
+        r = unbase64mem_full(cred, SIZE_MAX, /* secure = */ true, &key, &len);
+        if (r < 0)
+                return log_netdev_error_errno(netdev, r,
+                                              "%s: No private key specified and default key cannot be parsed, "
+                                              "ignoring network device: %m",
+                                              filename);
+        if (len != WG_KEY_LEN)
+                return log_netdev_error_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
+                                              "%s: No private key specified and default key is invalid. "
+                                              "Ignoring network device.",
+                                              filename);
+
+        memcpy(w->private_key, key, WG_KEY_LEN);
+        return 0;
+}
+
 static int wireguard_verify(NetDev *netdev, const char *filename) {
         Wireguard *w = WIREGUARD(netdev);
         int r;
@@ -1088,10 +1174,11 @@ static int wireguard_verify(NetDev *netdev, const char *filename) {
                                               "Failed to read private key from %s. Ignoring network device.",
                                               w->private_key_file);
 
-        if (eqzero(w->private_key))
-                return log_netdev_error_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
-                                              "%s: Missing PrivateKey= or PrivateKeyFile=, "
-                                              "Ignoring network device.", filename);
+        if (eqzero(w->private_key)) {
+                r = wireguard_read_default_key_cred(netdev, filename);
+                if (r < 0)
+                        return r;
+        }
 
         LIST_FOREACH(peers, peer, w->peers) {
                 if (wireguard_peer_verify(peer) < 0) {
index b5cd00874d8ab03d86a538a90efef1047c1672b3..4df0a0092d21b04396a3f4d423875813379d864a 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#if HAVE_BLKID
-#endif
 #include <errno.h>
 #include <getopt.h>
 #include <linux/fs.h>
index 1b95430f8843f703696c3a488b520515fc89765d..69a60b0f4569fb15c26fa84d7422ef2ddd9fc0fa 100644 (file)
@@ -174,6 +174,7 @@ shared_sources = files(
         'varlink-idl.c',
         'varlink-io.systemd.c',
         'varlink-io.systemd.Credentials.c',
+        'varlink-io.systemd.Hostname.c',
         'varlink-io.systemd.Journal.c',
         'varlink-io.systemd.ManagedOOM.c',
         'varlink-io.systemd.Network.c',
diff --git a/src/shared/varlink-io.systemd.Hostname.c b/src/shared/varlink-io.systemd.Hostname.c
new file mode 100644 (file)
index 0000000..b2c5e03
--- /dev/null
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "varlink-io.systemd.Credentials.h"
+
+static VARLINK_DEFINE_METHOD(
+                Describe,
+                VARLINK_DEFINE_OUTPUT(Hostname, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(StaticHostname, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(PrettyHostname, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(DefaultHostname, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(HostnameSource, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(IconName, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(Chassis, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(Deployment, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(Location, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(KernelName, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(KernelRelease, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(KernelVersion, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(OperatingSystemPrettyName, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(OperatingSystemCPEName, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(OperatingSystemHomeURL, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(OperatingSystemSupportEnd, VARLINK_INT, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(HardwareVendor, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(HardwareModel, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(HardwareSerial, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(FirmwareVersion, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(FirmwareVendor, VARLINK_STRING, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(FirmwareDate, VARLINK_INT, VARLINK_NULLABLE),
+                VARLINK_DEFINE_OUTPUT(MachineID, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(BootID, VARLINK_STRING, 0),
+                VARLINK_DEFINE_OUTPUT(ProductUUID, VARLINK_STRING, VARLINK_NULLABLE));
+
+VARLINK_DEFINE_INTERFACE(
+                io_systemd_Hostname,
+                "io.systemd.Hostname",
+                &vl_method_Describe);
diff --git a/src/shared/varlink-io.systemd.Hostname.h b/src/shared/varlink-io.systemd.Hostname.h
new file mode 100644 (file)
index 0000000..29bb20e
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "varlink-idl.h"
+
+extern const VarlinkInterface vl_interface_io_systemd_Hostname;
index 560628ec9a3210ef0a78a4f877c4f019f364b103..f91164295cfe17e98994ad8bde01b2893eac7e3e 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities (dynamic user)
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002081"'
 Type=oneshot
 AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW
 DynamicUser=yes
index 4960da56bea09e8f18e040d23a5e44a705114da7..a170b3d7b687306754044b801b0a92e8921bbc9d 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=nfsnobody
 AmbientCapabilities=CAP_CHOWN
index 4c72b2eee5e934cc7717ef1b39a16d58ff5ea543..2e21bbc58a9f97427373af99f5e248c9aa311b9f 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=nobody
 AmbientCapabilities=CAP_CHOWN
index 13a5d4577e061fd3c69fea60de047b7d9187f7be..c4bb21b2ace879a50051a9c23173fc91b416e24e 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities (daemon)
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=daemon
 AmbientCapabilities=CAP_CHOWN
index 10cb44012ba288e2ed99c6874f558ac6bbc10c90..0bf91cc98f6dda1852f6cef90e8ef713288feb1d 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=nfsnobody
 AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
index 5400cac9516de38129ced1a7820430ebee93343e..8bd7ac4f90f8f8275d5472f4a92c90926e5c65d2 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=nobody
 AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
index 5336bec3d80c4086876653786d94a37fa917e90e..1bbc7270310dd494e93d4b0b6a37f461cd4a90d7 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for AmbientCapabilities (daemon)
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
+ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb:      0000000000002001"'
 Type=oneshot
 User=daemon
 AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
index bf6968f3c172587ab0370d6f115830030c39c658..12e92e2ac56cb966e79ccf16810588875cfc8933 100644 (file)
@@ -11,7 +11,7 @@ ExecStart=test -f /tmp/thisisasimpletest
 # Also, through /tmp/test-exec-bindreadonlypaths
 ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest
 # The file cannot modify through /tmp/test-exec-bindreadonlypaths
-ExecStart=/bin/sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
+ExecStart=sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
 # Cleanup
 ExecStart=rm /tmp/thisisasimpletest
 BindPaths=/tmp:/tmp/test-exec-bindpaths
index 1b1217e094554eafbb5afe61dd08a9ba10792e30..14f16c6b565f7ff5feaea9b5b97f371d8d422712 100644 (file)
@@ -4,6 +4,6 @@ Description=Test for CapabilityBoundingSet
 
 [Service]
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"'
+ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"'
 Type=oneshot
 CapabilityBoundingSet=~CAP_CHOWN
index 1ed3ccbb25fd78f109f17610b77d9bea42f355ea..d3a23706ee93021b0c6eb061b0bc375513544ec8 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for CapabilityBoundingSet
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"'
+ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"'
 Type=oneshot
 CapabilityBoundingSet=CAP_FOWNER
 CapabilityBoundingSet=CAP_KILL CAP_CHOWN
index 8eb142c64a480b00ec544141228ca04389eb6782..244395165181ca7f81b4603f636b05f3ff3d109d 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for CapabilityBoundingSet
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="'
+ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="'
 Type=oneshot
 CapabilityBoundingSet=CAP_FOWNER CAP_KILL
 CapabilityBoundingSet=
index be5a5e5b87f7b36fd6c73ee91c1dc38bf8524096..3df3e6d9aeb84de297ab31c9e085fb558530009a 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for CapabilityBoundingSet
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"'
+ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"'
 Type=oneshot
 CapabilityBoundingSet=CAP_FOWNER CAP_KILL
index 342219cbeac24432d12eda36f3029773cf0a2b71..eb136fff5d4b05a1447b229aa2687dce2d297c08 100644 (file)
@@ -9,4 +9,4 @@ Type=oneshot
 ExecCondition=/bin/sh -c 'exit 255'
 
 # This should not get run
-ExecStart=/bin/sh -c 'true'
+ExecStart=sh -c 'true'
index b69e16134754b5c2db430451d34a25517628279e..4ee58b9c11f9f896ef72d60843b965afcecca940 100644 (file)
@@ -13,4 +13,4 @@ ExecCondition=/bin/sh -c 'exit 254'
 ExecCondition=/bin/sh -c 'exit 255'
 
 # This should not get run
-ExecStart=/bin/sh -c 'true'
+ExecStart=sh -c 'true'
index 2a8544acb1f403cc9353b404965facdbf44805e8..c0941a55793faf874d3ce6df98b41a99556aad90 100644 (file)
@@ -3,5 +3,5 @@
 Description=Test for CPUAffinity (simple)
 
 [Service]
-ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
+ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
 CPUAffinity=0
index bed48c822fcaf491700c1a4ceac219f082860c03..d699ecc031d840a9cf7a37a0205927a67acb9e4e 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for CPUAffinity (reset)
 
 [Service]
-ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
+ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
 CPUAffinity=0-1 3
 CPUAffinity=
 CPUAffinity=0
index 774cd642cd8dfe3b9eb904b92fb3a3e11debf476..8e8f782ac35f7ed1846596f54b39a2bc25c4e37c 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for CPUAffinity (merge)
 
 [Service]
-ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7'
+ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7'
 CPUAffinity=0,1
 CPUAffinity=1-2
index daaed6c64c2b30f5e8044ea24f408b30883a5a0c..1b7f232cd1394355a7ebb48081365d933aab2140 100644 (file)
@@ -5,8 +5,8 @@ Description=Test DynamicUser with static User= whose uid and gid are different
 
 [Service]
 Type=oneshot
-ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
+ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
 # Multiple ExecStart= lines causes the issue #9702.
-ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
+ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
 DynamicUser=yes
 User=adm
index db8b88efdb910269a398c83763d88f78d1efb89e..b13c23a74d9f6728a83c2a8179235b9aae3dd422 100644 (file)
@@ -5,8 +5,8 @@ Description=Test DynamicUser with static User= whose uid and gid are different
 
 [Service]
 Type=oneshot
-ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
+ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
 # Multiple ExecStart= lines causes the issue #9702.
-ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
+ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
 DynamicUser=yes
 User=games
index bbb1af5fb384d3cbc4124c421625eef3f9dc7224..e494c335510439a2a04957777678f1a5989d5104 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test DynamicUser with User= and SupplementaryGroups=
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
 Type=oneshot
 User=1
 DynamicUser=yes
index c5828c2a933fb1ce7388afd99212335ba3e07018..4ebfc20cde9cc09192cf0a748549417ab6755efa 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test DynamicUser with User=
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
 Type=oneshot
 User=1
 DynamicUser=yes
index 790279ab17ebcbf8319ecaa0c7eea4ab87b7a665..d84a96b4912cbc2e13e75dd75a45766739cdbd86 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
-ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
-ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
+ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
+ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
+ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
 Type=oneshot
 RuntimeDirectory=test-exec_runtimedirectorypreserve
 RuntimeDirectoryPreserve=yes
index 18df74e4471adca4ccfba0d1fb2efb2791b24d4c..d6084b0f5b5caff0665886fcdcc2458beedd11d6 100644 (file)
@@ -3,10 +3,10 @@
 Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes 2nd trial
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
-ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
-ExecStart=/bin/sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
-ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
+ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
+ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
+ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
+ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
 Type=oneshot
 RuntimeDirectory=test-exec_runtimedirectorypreserve
 RuntimeDirectoryPreserve=yes
index 831a808f901871631f3f347c936af4bdfcf63afa..fad194183bbe9c41cc8e02fb89dc0b0b78ce5dd3 100644 (file)
@@ -3,10 +3,10 @@
 Description=Test for RuntimeDirectory with DynamicUser=yes migrated from RuntimeDirectoryPreserve=yes
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
-ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
-ExecStart=/bin/sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
-ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
+ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
+ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
+ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
+ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
 Type=oneshot
 RuntimeDirectory=test-exec_runtimedirectorypreserve
 DynamicUser=yes
index 2a5a1e1ff3caa99cbae6d3e75af1e79de714c9e6..12375afbb5e5a5f073f1a29aa7b1e8939504a4d8 100644 (file)
@@ -11,7 +11,7 @@ ExecStart=test -d %S/test-dynamicuser-migrate
 ExecStart=test -d %S/test-dynamicuser-migrate2/hoge
 ExecStart=touch %S/test-dynamicuser-migrate/yay
 ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay
-ExecStart=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
+ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
 
 Type=oneshot
 DynamicUser=no
index e89f0c5aae1bc676df874233f8d3a9d0afd9e243..6fddd21cad480a1ca4e6cd3d8f3b63cbf88fd10a 100644 (file)
@@ -19,7 +19,7 @@ ExecStart=touch %S/test-dynamicuser-migrate/yay
 ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay
 ExecStart=touch %S/private/test-dynamicuser-migrate/yay
 ExecStart=touch %S/private/test-dynamicuser-migrate2/hoge/yayyay
-ExecStart=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
+ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
 
 Type=oneshot
 DynamicUser=yes
index d601af272e4872597eb2e3ddd6d927defc15bb7a..ac6a0fbc201842ae196a74e4c075aa87571da413 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test DynamicUser with SupplementaryGroups=
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
 Type=oneshot
 DynamicUser=yes
 SupplementaryGroups=1 2
index 6c3118643f257d6c5e3c42ac1ad25b132ae5e7b1..e5af6ffe6830e452b8c28a426ae14c955f206180 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for Environment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"'
+ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"'
 Type=oneshot
 Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
 Environment=
index d9b8d22667f89c89c702aef0df4b5095893aa6ea..4199a46d844a8eccf1ae2f692aa38e8107132b38 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for Environment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar'
 Type=oneshot
 Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
 Environment="VAR3=foobar"
index b5cb2a4445ab525f3539c3f748398572d5beeece..7396576d7d8d9fa26331c0372027457b8ec1f658 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for No Environment Variable Substitution
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\''
+ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\''
 ExecStart=:/bin/sh -x -c 'test "$${VAR1-unset}" != "unset" && test "$${VAR2}" != "word3" && test "$${VAR3-unset}" != \'$word 5 6\''
 Type=oneshot
 Environment="VAR2=word3" "VAR3=$word 5 6"
index 5655be0a22a7594dd26b98a2bbf3795c5be2de8d..7e3cb0ef42a21c6b40b6f6c92df6fe1dc49e2af9 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Environment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"'
 Type=oneshot
 Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
index 4ad5a9bb3b8cf886750e4d7d8de9355c1ccd54ae..3f739fa1e0470a4b5e0488608bdeff5ac4405cfc 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for EnvironmentFile
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
 Type=oneshot
 EnvironmentFile=/tmp/test-exec_environmentfile.conf
index 5969cc6764df0703e6fc6bc399737c6517ea12a7..424c4ac7b6a07e102ed6b9dfd616bbb45e4c40a5 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"'
+ExecStart=sh -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"'
 Type=oneshot
 ExecSearchPath=/tmp:/bin
 Environment="PATH=/usr" VAR1=word3 "VAR2=$word 5 6"
index b0fa6a36e49604e2dbd27a39692487750b64e3af..5c39d9ca63b28fc3c0fb341c0a7d5fbbd1f6c8fd 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"'
 Type=oneshot
 ExecSearchPath=/tmp:/bin
 Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
index 5f55a4b9346944bcbddd1dcc470e6c08b3e7b0ee..8741582231c4b255bb3cdb4334ee4f29da378848 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile sets PATH
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr'
 Type=oneshot
 EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile-set.conf
 ExecSearchPath=/tmp:/bin
index b8335bcf97c276c0be62f9de14c9530d4d595d02..53cede8f1beebe6db3ed8ff7c898c8c58379cd58 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile does not set PATH
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
 Type=oneshot
 ExecSearchPath=/tmp:/bin
 EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile.conf
index a1511616e2c86fb3ac8c517adcf5e00afe2e71a2..2d4e75a0c8b4f8ae269ad432ebff1ba9b0ef163d 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PassEnvironment with ExecSearchPath with PATH set by user
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"'
 Type=oneshot
 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PATH
 ExecSearchPath=/tmp:/bin
index d8a41c1ed790d971211865ccf984c376e8f21643..5bdab471939d5c181b70844313f266d62cd101b6 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PassEnvironment with ExecSearchPath with PATH not set by user
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
 Type=oneshot
 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
 ExecSearchPath=/tmp:/bin
index 30d6b3280d8e601de9ae3c725d4d22259dfb7727..a2037e930df4b999a0fe945d0337dd977373f4df 100644 (file)
@@ -5,4 +5,4 @@ Description=Test for specifiers with exec search path
 [Service]
 Type=oneshot
 ExecSearchPath=/tmp:/bin:/usr/bin:%V
-ExecStart=/bin/sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"'
+ExecStart=sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"'
index a1e59c5d1157edf3b7042478365af7f171dd10d2..aebb1984a190a23146333e95d070b167d4b4b375 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Group
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nfsnobody"'
+ExecStart=sh -x -c 'test "$$(id -n -g)" = "nfsnobody"'
 Type=oneshot
 Group=nfsnobody
index 58dce1e3d640b9061e81b4a40e3df21834699d0d..cf283cb65782e35ccfa88d8af3f0e3762457d548 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Group
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nobody"'
+ExecStart=sh -x -c 'test "$$(id -n -g)" = "nobody"'
 Type=oneshot
 Group=nobody
index 7f167298903a226dda57856eabf060bbbc05dfc5..46c3dd3acf6890dc579b8675230107d4f1086e38 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Group
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nogroup"'
+ExecStart=sh -x -c 'test "$$(id -n -g)" = "nogroup"'
 Type=oneshot
 Group=nogroup
index 9f21557d8260312ff71cf4f3edbbdf27b6e823ee..bd5ac2db3471a59a25ff864572574a8d958b5b52 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Group (daemon)
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "daemon"'
+ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"'
 Type=oneshot
 Group=daemon
index e97248109d49124490c683ccd8ffb2af7eed792f..ce8b25871270a708e759165b69cb30bc783b3ae3 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for IgnoreSIGPIPE=no
 
 [Service]
-ExecStart=/bin/sh -x -c 'kill -PIPE 0'
+ExecStart=sh -x -c 'kill -PIPE 0'
 Type=oneshot
 IgnoreSIGPIPE=no
index ee3aa9a2b3eeddf2de842ebb3634f9ab252af967..a26f53c413e61db57d0a8be66b4af17c30f99e5f 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for IgnoreSIGPIPE=yes
 
 [Service]
-ExecStart=/bin/sh -x -c 'kill -PIPE 0'
+ExecStart=sh -x -c 'kill -PIPE 0'
 Type=oneshot
 IgnoreSIGPIPE=yes
index 520bc539b0a45f73cfc10ae8524922b225edfd5e..8580f5208e8c520068214a4d71801808f20c2a17 100644 (file)
@@ -4,5 +4,5 @@ Description=Test to make sure that InaccessiblePaths= disconnect mount propagati
 
 [Service]
 InaccessiblePaths=-/i-dont-exist
-ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
+ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
 Type=oneshot
index 0d64aa19c833763428cbbd110870aafc29b8e92c..64a570ce4df283e03abea2cef6b0b015bcc9d75e 100644 (file)
@@ -4,5 +4,5 @@ Description=Test to make sure that mount namespace setup works properly with the
 
 [Service]
 InaccessiblePaths=/sys
-ExecStart=/bin/sh -x -c 'test "$$(stat -c %%a /sys)" = "0"'
+ExecStart=sh -x -c 'test "$$(stat -c %%a /sys)" = "0"'
 Type=oneshot
index 3b946b785569d18cb1aae53f036ec5dc727ce928..569183f1737da2b0b72be6e825b21ec897ae7bfd 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for IOSchedulingClass=best-effort
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"'
+ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"'
 Type=oneshot
 IOSchedulingClass=best-effort
index b1e64bbbc167db48b6b651aff0868cf256c67172..93377ea0c07f1394bdeb97ba189181e5df9ed1e9 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for IOSchedulingClass=idle
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"'
+ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"'
 Type=oneshot
 IOSchedulingClass=idle
index 0494d458970c2363c5f240ff0e2233e32011df7e..b8198d16f2b7fe28a59efea9926908336644db9d 100644 (file)
@@ -4,6 +4,6 @@ Description=Test for IOSchedulingClass=none
 
 [Service]
 # Old kernels might report "none" here, new kernels "best-effort".
-ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"'
+ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"'
 Type=oneshot
 IOSchedulingClass=none
index ef8e2eb7f1652c91df59e8080fe18bd177c8b014..a7edb6d012e7529a6c825574babc15ff5570535a 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for IOSchedulingClass=realtime
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"'
+ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"'
 Type=oneshot
 IOSchedulingClass=realtime
index 3a29b6d13dcc5e53e0818abd95af03e6ad50cd29..9da19e6369c640f5c970af5a6b3b2c6374f7ad1f 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for LoadCredential=
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
-ExecStartPost=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
-ExecStop=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
-ExecStopPost=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
+ExecStart=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
+ExecStartPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
+ExecStop=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
+ExecStopPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
 Type=oneshot
 LoadCredential=test-execute.load-credential
index 49277e3d517d455131a21c1e1d8d0499e95e80db..07c0525dcc611cb45a1fb1e1c27a5d88c6021899 100644 (file)
@@ -3,14 +3,14 @@
 Description=Test for NetworkNamespacePath= without mount namespacing
 
 [Service]
-ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
-ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
+ExecStart=sh -x -c '! ip link show dummy-test-exec'
+ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
 # Without mount namespacing, we can access the dummy-test-exec interface through sysfs.
-ExecStart=/bin/sh -x -c 'test -e /sys/class/net/dummy-test-exec'
-ExecStart=/bin/sh -x -c 'ip link show dummy-test-ns'
-ExecStart=/bin/sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
+ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-exec'
+ExecStart=sh -x -c 'ip link show dummy-test-ns'
+ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
 # Without mount namespacing, we cannot access the dummy-test-ns interface through sysfs.
-ExecStart=/bin/sh -x -c 'test ! -e /sys/class/net/dummy-test-ns'
+ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-ns'
 Type=oneshot
 NetworkNamespacePath=/run/netns/test-execute-netns
 PrivateMounts=no
index 078fba8fa2f2915edf71d1f60fbe806b8ee715e8..10bc1923b794be80ec39445fb5fc6baffd9a5323 100644 (file)
@@ -3,14 +3,14 @@
 Description=Test for NetworkNamespacePath= with mount namespacing
 
 [Service]
-ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
-ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
+ExecStart=sh -x -c '! ip link show dummy-test-exec'
+ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
 # With mount namespacing, we cannot access the dummy-test-exec interface through sysfs.
-ExecStart=/bin/sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'
-ExecStart=/bin/sh -x -c 'ip link show dummy-test-ns'
-ExecStart=/bin/sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
+ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'
+ExecStart=sh -x -c 'ip link show dummy-test-ns'
+ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
 # With mount namespacing, we can access the dummy-test-ns interface through sysfs.
-ExecStart=/bin/sh -x -c 'test -e /sys/class/net/dummy-test-ns'
+ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-ns'
 Type=oneshot
 NetworkNamespacePath=/run/netns/test-execute-netns
 # NetworkNamespacePath= implies PrivateMounts=yes
index 5d954da6ace9cb9ad68ef9be14ca44a7002281b6..503be5a770930a85f34583ed57df92a172ed800b 100644 (file)
@@ -7,5 +7,5 @@ Type=oneshot
 # This should work, as we explicitly disable the effect of NoExecPaths=
 ExecStart=+/bin/sh -c '/bin/cat /dev/null'
 # This should also work, as we do not disable the effect of NoExecPaths= but invert the exit code
-ExecStart=/bin/sh -x -c '! /bin/cat /dev/null'
+ExecStart=sh -x -c '! /bin/cat /dev/null'
 NoExecPaths=/bin/cat
index 25b5f1ffcc8221703d83f18b7d5fbf2f6e31d217..56560307968020ff09225c6f0830eac6b303edb4 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for OOMScoreAdjust
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100'
+ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100'
 Type=oneshot
 OOMScoreAdjust=-100
index ea6c23f78e808dfab0c153b93f81a7b485f681e5..a2079b841ecd318b02e256d38d41bbcaecca58a2 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for OOMScoreAdjust
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100'
+ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100'
 Type=oneshot
 OOMScoreAdjust=100
index 6b19a12bb7e24617fc3e063d0c8fdb117420d649..b2e5c200162f5991c859d64c264a3460699389d4 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PassEnvironment with variables absent from the execution environment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
+ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
 Type=oneshot
 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
index 6ffc5e7de680ed045f2798fe4b66055150d59bf4..a5fd092783eba99750c293103dd2f88eb88eb548 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PassEnvironment and erasing the variable list
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
+ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
 Type=oneshot
 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
 PassEnvironment=
index b8e904fb6d28d722cdc4790282fa89a67a5da0f0..f3b886c5c6920add4ac7aee2934037b16afd3da3 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PassEnvironment with a variable name repeated
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
 Type=oneshot
 PassEnvironment=VAR1 VAR2
 PassEnvironment=VAR1 VAR3
index b69592ad6a9db12fee88c68642294f4c3c861150..1dcbcf97c88da6898cc75774c1a83f64cc30d2c0 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PassEnvironment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
+ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
 Type=oneshot
 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
index 0783a873640408166721138fc2822a67d12aaf54..e4ea294dcc24bd4aba58a0c822769c34d650deb7 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=aarch64
 
 [Service]
-ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")'
+ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")'
 Type=oneshot
 Personality=aarch64
index 0531ad1164dcf58cdf8652b380e97254e870984b..31c6b258c71e3998c865222e7d1a4d34464140b0 100644 (file)
@@ -2,6 +2,6 @@
 Description=Test for Personality=loongarch64
 
 [Service]
-ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")'
+ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")'
 Type=oneshot
 Personality=loongarch64
index 72f063a59c1556ac00ecceeab32be6527c5e53ff..dd83bf66eec7b822cd9b81e0639fb1f3c15c67ca 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=ppc64
 
 [Service]
-ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")'
+ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")'
 Type=oneshot
 Personality=ppc64
index 5e38029c05433a5ca29dbfebb2ec9060e9e57b58..3f19d825db6dc74ad21422fc718e7fd9a0e24ebd 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=ppc64le
 
 [Service]
-ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")'
+ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")'
 Type=oneshot
 Personality=ppc64le
index 439dc5fea87ac6a2e078dfe1207188384c13ff0f..7d120cde2d2e83683a9fb4d5802c21059e40e9f9 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=s390
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(uname -m); test "$$c" = "s390"'
+ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390"'
 Type=oneshot
 Personality=s390
index c6a0a4061c7a4a9ae198f76d6ad6a57480e863c6..e7b945ca1491c3b7d9f68635bb52137e20efff89 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=x86-64
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(uname -m); test "$$c" = "x86_64"'
+ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "x86_64"'
 Type=oneshot
 Personality=x86-64
index 8b820b31c6eee67e484a20fcdffccd1ae6441d02..95ec353cb1e8c45825353d052a38131acbd2db07 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for Personality=x86
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"'
+ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"'
 Type=oneshot
 Personality=x86
index dbbbb4ee33d0eca21fbd160054f7ebb64ba316b0..c2229a4a7af4238c9113b070a66ebab771a12223 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test for PrivateDevices=yes with a bind mounted device
 
 [Service]
-ExecStart=/bin/sh -c 'test -c /dev/kmsg'
-ExecStart=/bin/sh -c 'test ! -w /dev/'
+ExecStart=sh -c 'test -c /dev/kmsg'
+ExecStart=sh -c 'test ! -w /dev/'
 Type=oneshot
 PrivateDevices=yes
 BindPaths=/dev/kmsg
index 021cadff529291d37f51ab0a87876770802ab4e3..8f09c4ab95c42e5c967553a3377ad8099bdb04a5 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PrivateDevices=yes with prefix
 
 [Service]
-ExecStart=/bin/sh -x -c '! test -c /dev/kmsg'
+ExecStart=sh -x -c '! test -c /dev/kmsg'
 ExecStart=+/bin/sh -x -c 'test -c /dev/kmsg'
 Type=oneshot
 PrivateDevices=yes
index a07e82284158a38b0ecf98ae03280eac48975526..811f4ad6853b629831d26242b957965c36ea3ec1 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_MKNOD capability for PrivateDevices=no
 [Service]
 PrivateDevices=no
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod'
+ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod'
 Type=oneshot
index b0ce2d409c55bff2bd90b2f7f69ef3a404944352..47be622b5fb7720021b4a21f77c0c6a620a5bfd2 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYS_RAWIO capability for PrivateDevices=no
 [Service]
 PrivateDevices=no
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio'
+ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio'
 Type=oneshot
index 31a5e3c72b23470f17ef62253c5ccb9c0e3262ce..5b8a05133bfed1fba69553ff6763ebf1646f661e 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PrivateDevices=no
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -c /dev/kmsg'
+ExecStart=sh -x -c 'test -c /dev/kmsg'
 Type=oneshot
 PrivateDevices=no
index f798f3167082573b3b7c54fc55268fd5d27e6ab1..3d29a9cb05073c87484ce505219afa4267050378 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_MKNOD capability for PrivateDevices=yes
 [Service]
 PrivateDevices=yes
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod'
+ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod'
 Type=oneshot
index d902c234e204032da651c99b11e11099de2d1fd3..b1c0617837c62dd5e4d5fecf6c6464588863c020 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYS_RAWIO capability for PrivateDevices=yes
 [Service]
 PrivateDevices=yes
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio'
+ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio'
 Type=oneshot
index a39ae0f846899be85ca3d25bdcab1817922dda0c..094ac227247a533139c31a2ab7697c6d31870c7a 100644 (file)
@@ -8,10 +8,10 @@ Group=daemon
 Type=oneshot
 
 # Check the group applied
-ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "daemon"'
+ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"'
 
 # Check that the namespace applied
-ExecStart=/bin/sh -c 'test ! -c /dev/kmsg'
+ExecStart=sh -c 'test ! -c /dev/kmsg'
 
 # Check that the owning group of a node is not daemon (should be the host root)
-ExecStart=/bin/sh -x -c 'test ! "$$(stat -c %%G /dev/stderr)" = "daemon"'
+ExecStart=sh -x -c 'test ! "$$(stat -c %%G /dev/stderr)" = "daemon"'
index 564e95892532c4304097f326a6eb22fae1cc23a6..2d32753053aefb7799daa14f8fb3e0bdf6220c19 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PrivateDevices=yes
 
 [Service]
-ExecStart=/bin/sh -c 'test ! -c /dev/kmsg'
+ExecStart=sh -c 'test ! -c /dev/kmsg'
 Type=oneshot
 PrivateDevices=yes
index 83708df830db697d79155ac96dbe97af73a6da10..c16102d07f43839e50ce09385793d50c5bb9c0aa 100644 (file)
@@ -3,10 +3,10 @@
 Description=Test for PrivateNetwork= without mount namespacing
 
 [Service]
-ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
-ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
+ExecStart=sh -x -c '! ip link show dummy-test-exec'
+ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
 # Without mount namespacing, we can access the dummy-test-exec interface through sysfs
-ExecStart=/bin/sh -x -c 'test -d /sys/class/net/dummy-test-exec'
+ExecStart=sh -x -c 'test -d /sys/class/net/dummy-test-exec'
 Type=oneshot
 PrivateNetwork=yes
 PrivateMounts=no
index 874f10084ef1b31d0dbb7d774b17349082a44682..eb48d6e0c56a61934a115401cf4c7fb7f6bcce0e 100644 (file)
@@ -3,10 +3,10 @@
 Description=Test for PrivateNetwork= with mount namespacing
 
 [Service]
-ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
-ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
+ExecStart=sh -x -c '! ip link show dummy-test-exec'
+ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
 # With mount namespacing, we cannot access the dummy-test-exec interface through sysfs.
-ExecStart=/bin/sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'
+ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'
 Type=oneshot
 PrivateNetwork=yes
 # PrivateNetwork=yes implies PrivateMounts=yes
index f67afee101cc89d39103cd3f0fa4dc0a63c6b025..9dfcecc02c139e545901fa43e18f0563153504de 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for PrivateTmp=yes with prefix
 
 [Service]
-ExecStart=/bin/sh -x -c 'test ! -f /tmp/test-exec_privatetmp'
+ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp'
 ExecStart=+/bin/sh -x -c 'test -f /tmp/test-exec_privatetmp'
 Type=oneshot
 PrivateTmp=yes
index 6a8a3fc319387d8eb70cbca08553808bfad029c6..599203abb80f92ce4f5768067ef5c8358553485b 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PrivateTmp=no
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -f /tmp/test-exec_privatetmp'
+ExecStart=sh -x -c 'test -f /tmp/test-exec_privatetmp'
 Type=oneshot
 PrivateTmp=no
index 6395be0842d6bf6b651382e01939b9e0666ccd47..5ea52639f0f90ba63da7fedbf85212ab135004bb 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for PrivateTmp=yes
 
 [Service]
-ExecStart=/bin/sh -x -c 'test ! -f /tmp/test-exec_privatetmp'
+ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp'
 Type=oneshot
 PrivateTmp=yes
index f84e6b6f037ced650971ea57f51663773663feef..c51cacf40d4c263677acbbed6869999e530cce18 100644 (file)
@@ -7,4 +7,4 @@ Description=Test ProtectHome=tmpfs vs ProtectSystem=strict
 ProtectHome=tmpfs
 ProtectSystem=strict
 Type=oneshot
-ExecStart=/bin/sh -x -c 'test "$$(stat -fc %%T /home)" = "tmpfs"'
+ExecStart=sh -x -c 'test "$$(stat -fc %%T /home)" = "tmpfs"'
index 54789627555fd562142f94d203e28c9a13e99b81..be64c58089f53c85e22238824a2c86f31edc7050 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYSLOG for ProtectKernelLogs=no
 [Service]
 ProtectKernelLogs=no
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog'
+ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog'
 Type=oneshot
index 6fe12410d96b06eae7617a31e14f9147644df393..646ff751a7b5622982d0375e2e09a267e1df70be 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYSLOG for ProtectKernelLogs=yes
 [Service]
 ProtectKernelLogs=yes
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog'
+ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog'
 Type=oneshot
index 7236af2b245e226467d91243fe6f5a7da743c941..cefdb60991ffd5348b4fceb17d2a33a32d6832fd 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYS_MODULE ProtectKernelModules=no
 [Service]
 ProtectKernelModules=no
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module'
+ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module'
 Type=oneshot
index e40160daf50d182d77035bb16667db13cf2fc178..1f327a28aba757ebef0513d31e5004a34409e72a 100644 (file)
@@ -5,5 +5,5 @@ Description=Test CAP_SYS_MODULE for ProtectKernelModules=yes
 [Service]
 ProtectKernelModules=yes
 # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
-ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module'
+ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module'
 Type=oneshot
index 0ecf1a2b6ce2000652415077b21aab2d2c5d9ed9..16399bd2061800597338780db911c8c173f6c8d4 100644 (file)
@@ -4,5 +4,5 @@ Description=Test to make sure that passing ProtectKernelModules=yes disconnect m
 
 [Service]
 ProtectKernelModules=yes
-ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
+ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
 Type=oneshot
index abc180b3b38930ac5d4a6e225e48420e66057207..e896bac5fdad40f356a2785f5ee91ee0c349c089 100644 (file)
@@ -4,5 +4,5 @@ Description=Test to make sure that passing ReadOnlyPaths= disconnect mount propa
 
 [Service]
 ReadOnlyPaths=-/i-dont-exist
-ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
+ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
 Type=oneshot
index 5587e8dce71eea767d94fea7cbbecee8bdc35e84..80e6c83bf74b2f7d5cb82a001fce3b9251455908 100644 (file)
@@ -7,6 +7,6 @@ Type=oneshot
 # This should work, as we explicitly disable the effect of ReadOnlyPaths=
 ExecStart=+/bin/sh -c 'touch /tmp/thisisasimpletest'
 # This should also work, as we do not disable the effect of ReadOnlyPaths= but invert the exit code
-ExecStart=/bin/sh -x -c '! touch /tmp/thisisasimpletest'
+ExecStart=sh -x -c '! touch /tmp/thisisasimpletest'
 ExecStart=+/bin/sh -c 'rm /tmp/thisisasimpletest'
 ReadOnlyPaths=/tmp
index 71c7e7b92683eca29ce20040a91e996ad3286f96..7a183672c73b7b92499f55974028e921b45b5f09 100644 (file)
@@ -5,5 +5,5 @@ Description=Test for ReadOnlyPaths=
 [Service]
 ReadOnlyPaths=/etc -/i-dont-exist /usr
 BindPaths=/etc:/tmp/etc2
-ExecStart=/bin/sh -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var'
+ExecStart=sh -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var'
 Type=oneshot
index 21814c2f26289fb0b89021bd6e11be66000754c8..a0eff8bcecc897ff24a6a0f021540c820ff7df48 100644 (file)
@@ -5,6 +5,6 @@ Description=Test for ReadOnlyPaths=
 [Service]
 ReadOnlyPaths=/usr /etc /sys /dev -/i-dont-exist
 PrivateDevices=yes
-ExecStart=/bin/sh -x -c 'test ! -w /usr && test ! -w /etc && test ! -w /sys && test ! -w /sys/fs/cgroup'
-ExecStart=/bin/sh -x -c 'test ! -w /dev && test ! -w /dev/shm && test ! -e /i-dont-exist && test -w /var'
+ExecStart=sh -x -c 'test ! -w /usr && test ! -w /etc && test ! -w /sys && test ! -w /sys/fs/cgroup'
+ExecStart=sh -x -c 'test ! -w /dev && test ! -w /dev/shm && test ! -e /i-dont-exist && test -w /var'
 Type=oneshot
index 35e736f74261cd261c1201cca790ebf3a4be04c2..9b844cf4338db7b176def66842177dbcc08af778 100644 (file)
@@ -4,5 +4,5 @@ Description=Test to make sure that passing ReadWritePaths= disconnect mount prop
 
 [Service]
 ReadWritePaths=-/i-dont-exist
-ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
+ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
 Type=oneshot
index 580bac94eacadb239b9cdf84fc704e58b7ad8172..e75e0d23800ab28f6586566c4561ca766c1112b9 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test for RuntimeDirectoryMode
 
 [Service]
-ExecStart=/bin/sh -x -c 'mode=$$(stat -c %%a %t/test-exec_runtimedirectory-mode); test "$$mode" = "750"'
-ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory-mode"'
+ExecStart=sh -x -c 'mode=$$(stat -c %%a %t/test-exec_runtimedirectory-mode); test "$$mode" = "750"'
+ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory-mode"'
 Type=oneshot
 RuntimeDirectory=test-exec_runtimedirectory-mode
 RuntimeDirectoryMode=0750
index 79bebc4616a81ad3385ff8e44a357b03057921b2..4bc336167c96c154831f00454a3d1e6e7930e329 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set)
 
 [Service]
-ExecStart=/bin/sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nfsnobody"'
+ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nfsnobody"'
 Type=oneshot
 Group=nfsnobody
 User=root
index 3b42a9fc419169120f01fb6d1849f2f7356019c6..5f94bf9cd0be39fd0693943e8bc3e0de89675729 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set)
 
 [Service]
-ExecStart=/bin/sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nobody"'
+ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nobody"'
 Type=oneshot
 Group=nobody
 User=root
index 804048ea0596234c7d9c8ef026c07df6a29f38fc..6d508959f8033a4bff55ddcea71ef735345973cf 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set)
 
 [Service]
-ExecStart=/bin/sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nogroup"'
+ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nogroup"'
 Type=oneshot
 Group=nogroup
 User=root
index e2c0890b006530aa2f51f4876f30a60d1d8837f2..64d66b302ee53710d32a82abb32d60ffec2d0ca1 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set)
 
 [Service]
-ExecStart=/bin/sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner-daemon); test "$$group" = "daemon"'
+ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner-daemon); test "$$group" = "daemon"'
 Type=oneshot
 Group=daemon
 User=root
index 1928c57acefd0f9925e3bf08d063cc22657a8828..f60110a48587994dcf7d51b6501ead771516a8b9 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for RuntimeDirectory
 
 [Service]
-ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory'
-ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge'
-ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory:%t/test-exec_runtimedirectory2/hogehoge"'
+ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectory'
+ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge'
+ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory:%t/test-exec_runtimedirectory2/hogehoge"'
 Type=oneshot
 RuntimeDirectory=test-exec_runtimedirectory
 RuntimeDirectory=./test-exec_runtimedirectory2///./hogehoge/.
index 9db6c5f3d4f81bcd07014b14db998711dbd175f1..22634361cb3fe501e12172f0d22830f5f2915a0f 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for SetCredential=
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
-ExecStartPost=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
-ExecStop=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
-ExecStopPost=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
+ExecStart=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
+ExecStartPost=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
+ExecStop=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
+ExecStopPost=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"'
 Type=oneshot
 SetCredential=test-execute.set-credential:hoge
index 2e8882c5ab18ec639aef1a2585470dacdf9a9d66..aa0ecdfe2013cf45327df2a1156d01951d33395c 100644 (file)
@@ -4,4 +4,4 @@ Description=https://github.com/systemd/systemd/issues/2637
 
 [Service]
 Type=oneshot
-ExecStart=/bin/bash -x -c "[[ %%U == ?U ]]"
+ExecStart=bash -x -c "[[ %%U == ?U ]]"
index 838fea7d047e0e9107b82a08f14db67cbcd942e7..fd56f7e37b3f7538fa5449ab3aabc5357ac1aa4a 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for StandardInputText= and StandardInputData=
 
 [Service]
-ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething   in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" >$d/text ; cmp $d/text ; rm -rf $d'
+ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething   in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" >$d/text ; cmp $d/text ; rm -rf $d'
 Type=oneshot
 StandardInput=data
 StandardInputText=this is a test
index 0ecc34441c423d4b97c6febb59a6f5395115d7c0..3c90124818db3bbbb153700ebe36208baa2140be 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for Supplementary Group with multiple groups without Group and User
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "%G" && test "$$(id -u)" = "%U"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "%G" && test "$$(id -u)" = "%U"'
 Type=oneshot
 SupplementaryGroups=1 2
index cd1021bbdfd679a1455b693ef96a34d7e15c1b8e..0fd1c6205286e4bbc93966c234e3e9c5c5f79738 100644 (file)
@@ -3,9 +3,9 @@
 Description=Test for Supplementary Group with multiple groups and Group=1
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "%U"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "%U"'
 Type=oneshot
 Group=1
 SupplementaryGroups=1 2
index 7913a2c2ededfcd24af3bca25527f40a71c99065..c430e54685a1b6701e5460599f9e1a166cf95904 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test for Supplementary Group with multiple groups and Uid=1
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
 Type=oneshot
 User=1
 SupplementaryGroups=1 2
index ee4017e74e79ae6ff84974eb528b36cd4bac3dc7..20a3561d08d36a30cebc3276e20eaf32bc20e1cf 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test for Supplementary Group with only one group and uid 1
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
 Type=oneshot
 User=1
 Group=1
index 62275201cc271c21648884b8a593bc7f26f59daa..8c812573e4d289cb400fdf5fd426d92bb66c7a3d 100644 (file)
@@ -3,8 +3,8 @@
 Description=Test for Supplementary Group with only one group
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "0"'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "0"'
 Type=oneshot
 Group=1
 SupplementaryGroups=1
index 03406c3ee8819a3bf594d9b5065acebb94ab43c6..0a3d370595c0096de041736b0b01db625586fcdc 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for Supplementary Group
 
 [Service]
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1'
-ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1'
+ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
 Type=oneshot
 SupplementaryGroups=1
index f2be6003c8fbe9a944ea4f26e4b012afb2082593..00a450810b41f3e4b9fc227f9f259ebf68ea8f11 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallErrorNumber
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname
 SystemCallErrorNumber=EACCES
index 5d99a97476b7a5686d9b61bfa7c0b033e766395d..3b5fb6eab2a21e5df5d644e55a132f3b0bf3020f 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallErrorNumber
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname
 SystemCallErrorNumber=255
index 3aad372900b3db5e07390c0623d42b5fbae74f9b..7437d301081de34e0dbc18bf96a0a189123a0381 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c '/bin/echo "This should not be seen"'
+ExecStart=sh -c '/bin/echo "This should not be seen"'
 Type=oneshot
 LimitCORE=0
 SystemCallFilter=ioperm
index 8cdb8de45b8f91f13f6e5eafb4a075ad039351ed..92672d1eb132324ea6f85d7327dd2b975775c0ab 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c '/bin/echo "This should not be seen"'
+ExecStart=sh -c '/bin/echo "This should not be seen"'
 Type=oneshot
 LimitCORE=0
 SystemCallFilter=~write open execve fexecve execveat exit_group close mmap munmap fstat DONOTEXIST
index 98c88fd0b15ee70e9ac856a968dde061a8501e56..4e7b81214b264ccfb438a10aafbc73dfc453e528 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c '/bin/echo "This should not be seen"'
+ExecStart=sh -c '/bin/echo "This should not be seen"'
 Type=oneshot
 LimitCORE=0
 SystemCallArchitectures=native
index 8f8192cc9433baa7cec1b08c4edca1f2a551ae1a..eaa75dfb61671115ac9d3b69412e68c5f4e98db0 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test bounding set is right with SystemCallFilter and non-root user
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_net_bind_service"'
+ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_net_bind_service"'
 Type=oneshot
 User=1
 SystemCallFilter=@system-service
index d78c3232bb4beb7af720656250471bfac024730c..fd0e3a259db5d9db6614bf76f324dffe15272eed 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test bounding set is right with SystemCallFilter and non-root user
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_setpcap,cap_net_bind_service,cap_sys_admin"'
+ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_setpcap,cap_net_bind_service,cap_sys_admin"'
 Type=oneshot
 User=1
 SystemCallFilter=@system-service
index f33a2a05c4b40e917089cf6a9b1e9a8b992cfa29..76b028c82c9314b87641497c61e668813192bb4a 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test no_new_privs is unset for ProtectClock and non-root user
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs:        "); test "$$c" = "NoNewPrivs:   0"'
+ExecStart=sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs:     "); test "$$c" = "NoNewPrivs:   0"'
 Type=oneshot
 User=1
 ProtectClock=yes
index 8bfd0a79d9a3ebda58fd019945d9b682a431195c..2091b71db009d2a4679a6c619a724423d5311cc4 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test no_new_privs is unset for SystemCallFilter and non-root user
 
 [Service]
-ExecStart=/bin/sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs:        "); test "$$c" = "NoNewPrivs:   0"'
+ExecStart=sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs:     "); test "$$c" = "NoNewPrivs:   0"'
 Type=oneshot
 User=1
 SystemCallFilter=@system-service
index c7eddea6655cf1690999f914cc3fe5beb0bbc182..bb2ea5516695a4ed08f46994b056e6519f5be136 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 SystemCallFilter=~read write open execve ioperm
 SystemCallFilter=ioctl
index 96eaf16a45bc257c2c6f8c28e033ff0c9aa57941..d9f0a3717cf0db9d03fad5c9d4e20768458b6cc2 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 SystemCallFilter=
index f8f409284457014619c580996901dbbbaf81c850..df4e662d40dc15237a8a379ba853f924f54f5dea 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 SystemCallArchitectures=native
 SystemCallFilter=
index de2c6ad2d6a4d415b0b4457eaf2d5739570ec4d5..6107d114bec1c65a174aea21878b1161d60d38a4 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter with specific kill action overriding default errno action
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname:kill
 SystemCallErrorNumber=EILSEQ
index ffa35e64dff2a847f2c18f6910541161d9f3d7e6..e049275604daf5cd94f589ec11e818d48f6f3649 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter with specific errno action overriding default kill action
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname:EILSEQ
 SystemCallErrorNumber=kill
index deba1543b44883394a9f81de3f06a75c4809408a..19122869b1ab6ffde616eabea6c51a124d0a078d 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter in system mode with User set
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 User=nfsnobody
 SystemCallFilter=~read write open execve ioperm
index 43fb9c3395dfd97e9a90160c9e24daaa5fe95bc0..0c2ebdd83e613c7342c376435ba10ea06ba94e78 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter in system mode with User set
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 User=nobody
 SystemCallFilter=~read write open execve ioperm
index 005c4ac1c82927abd39fdffbe78e52d448319503..6de39642e900a52eefb7837fed74da45b104c47e 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter in system mode with User set (daemon)
 
 [Service]
-ExecStart=/bin/sh -c 'echo "Foo bar"'
+ExecStart=sh -c 'echo "Foo bar"'
 Type=oneshot
 User=daemon
 SystemCallFilter=~read write open execve ioperm
index c7a4c4a61435336997310d737b270ba28bd5c4fc..a8dc10f3c18a1df241aa2e3e2172a6b75e30b7b5 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter with errno name (for issue #18916)
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=@system-service
 SystemCallFilter=~uname:EILSEQ
index 267832366fd32895864b54afedc01924ea193c73..224df01a23a9d6ebc0dfd6fac3e52fb40d085b07 100644 (file)
@@ -4,7 +4,7 @@ Description=Test for SystemCallFilter updating errno
 # test for issue #9939 which is fixed by a5404992cc7724ebf7572a0aa89d9fdb26ce0b62 (#9942)
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname:ENOENT uname:EILSEQ
 SystemCallErrorNumber=EACCES
index a9023314adbe262e85c55f5c3082e5f34c5e6b7a..bed79610bef5845a7dca826168b6464c7f94302f 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter with errno name
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname:EILSEQ
 SystemCallErrorNumber=EACCES
index ffbc84a3138beceb67abf0a8d5f31521d98fd80a..8db2281f81da9a6238d848b671bde0655c7d7a29 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for SystemCallFilter with errno number
 
 [Service]
-ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+ExecStart=python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
 Type=oneshot
 SystemCallFilter=~uname:255
 SystemCallErrorNumber=EACCES
index 1610c63a4adb1697fd48f734f1ec7a9e64d9e734..b00030131ec6f3b0073560f6b17bcb0463063599 100644 (file)
@@ -10,8 +10,8 @@ Type=oneshot
 TemporaryFileSystem=/var:ro,mode=0700,nostrictatime
 
 # Check /proc/self/mountinfo
-ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)mode=700(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
+ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)mode=700(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
 
-ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
-ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)nodev(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
-ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 ~ /(^|,)strictatime(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
+ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
+ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)nodev(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
+ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 ~ /(^|,)strictatime(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
index 2ee5c269f9f8fc4cb61a54c38974a27b46618f86..0a4b0f25521c39e5f0cb5975f711f10d40a2b174 100644 (file)
@@ -6,31 +6,31 @@ Description=Test for TemporaryFileSystem with read-only mode
 Type=oneshot
 
 # Check directories exist
-ExecStart=/bin/sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro'
+ExecStart=sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro'
 
 # Check TemporaryFileSystem= are empty
-ExecStart=/bin/sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
+ExecStart=sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
 
 # Check default mode
 ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"'
 
 # Cannot create a file in /var
-ExecStart=/bin/sh -c '! touch /var/hoge'
+ExecStart=sh -c '! touch /var/hoge'
 
 # Create a file in /var/test-exec-temporaryfilesystem/rw
-ExecStart=/bin/sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem'
+ExecStart=sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem'
 
 # Then, the file can be access through /tmp
-ExecStart=/bin/sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem'
+ExecStart=sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem'
 
 # Also, through /var/test-exec-temporaryfilesystem/ro
-ExecStart=/bin/sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
+ExecStart=sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
 
 # The file cannot modify through /var/test-exec-temporaryfilesystem/ro
-ExecStart=/bin/sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
+ExecStart=sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
 
 # Cleanup
-ExecStart=/bin/sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem'
+ExecStart=sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem'
 
 TemporaryFileSystem=/var:ro
 BindPaths=/tmp:/var/test-exec-temporaryfilesystem/rw
index f62ce1a85204b98b9beb98b921cb052f12ccbda2..455344e114c6952a63cc260f52fed63e9d1b5171 100644 (file)
@@ -6,11 +6,11 @@ Description=Test for TemporaryFileSystem on /usr
 Type=oneshot
 
 # Check TemporaryFileSystem= are empty
-ExecStart=/bin/sh -c 'for i in $$(ls -A /usr); do test $$i = lib -o $$i = lib64 -o $$i = bin -o $$i = sbin || false; done'
+ExecStart=sh -c 'for i in $$(ls -A /usr); do test $$i = lib -o $$i = lib64 -o $$i = bin -o $$i = sbin || false; done'
 
 # Cannot create files under /usr
-ExecStart=/bin/sh -c '! touch /usr/hoge'
-ExecStart=/bin/sh -c '! touch /usr/bin/hoge'
+ExecStart=sh -c '! touch /usr/hoge'
+ExecStart=sh -c '! touch /usr/bin/hoge'
 
 TemporaryFileSystem=/usr:ro
 BindReadOnlyPaths=-/usr/lib -/usr/lib64 /usr/bin /usr/sbin
index 380cb8234a1a77267b1ee955f9d70f64f4cd8d33..de9ac5a2333cb34ee65676db733831834e0247c7 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for UMask
 
 [Service]
-ExecStart=/bin/sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "600"'
+ExecStart=sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "600"'
 Type=oneshot
 UMask=0177
 PrivateTmp=yes
index b28023d8a9588e33a4b072de0fd0c000a0e8b075..6d13c0bfa2a7045cdf669ec0c747385171b26367 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for UMask default
 
 [Service]
-ExecStart=/bin/sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "644"'
+ExecStart=sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "644"'
 Type=oneshot
 PrivateTmp=yes
index 8419c86c9ab73f694f7e590e60c0823695e14492..aac1dadc5afc3717d004d1bc41c4dffc471f536e 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for UMask= + namespacing
 
 [Service]
-ExecStart=/bin/ls -lahd /tmp/subdir
+ExecStart=ls -lahd /tmp/subdir
 Type=oneshot
 User=65534
 Group=65534
index b79e3d42c7ec2d318a693ce2877f6e5b3d0c99c9..9c5e277d0578e83d2fbabade95cf39d5ec5a47e6 100644 (file)
@@ -3,7 +3,7 @@
 Description=Test for UnsetEnvironment
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$FOO" = "bar" && test "$${QUUX-X}" = "X" && test "$$VAR3" = "value3" && test "$${VAR4-X}" = "X" && test "$$VAR5" = "value5" && test "$${X%b-X}" = "X"'
+ExecStart=sh -x -c 'test "$$FOO" = "bar" && test "$${QUUX-X}" = "X" && test "$$VAR3" = "value3" && test "$${VAR4-X}" = "X" && test "$$VAR5" = "value5" && test "$${X%b-X}" = "X"'
 Type=oneshot
 Environment=FOO=bar QUUX=waldo VAR3=value3 VAR4=value4 VAR5=value5 X%b=%U
 UnsetEnvironment=QUUX=waldo VAR3=somethingelse VAR4 X%b=%U
index 8f0943c282e49990c0a93a08908b5f10c8ed5755..1ce5f08370c08381450d20d1ef2e1170934c4478 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for User
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$USER" = "nfsnobody"'
+ExecStart=sh -x -c 'test "$$USER" = "nfsnobody"'
 Type=oneshot
 User=nfsnobody
index 834d11ad319e92c14b616588c6bb8a5eeeaffbe8..003b873b39706467c20290b0574aada8fd2756ef 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for User
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$USER" = "nobody"'
+ExecStart=sh -x -c 'test "$$USER" = "nobody"'
 Type=oneshot
 User=nobody
index b9863d2025ff248d198d902867b5c72763b2f5e6..696c7e5739ac9d56b1c47dfa082604098c8e3b8d 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for User (daemon)
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$USER" = "daemon"'
+ExecStart=sh -x -c 'test "$$USER" = "daemon"'
 Type=oneshot
 User=daemon
index 130d9d5c507d31db8e0199e7243f715b98cb3bc3..3c4869d858078a8215b62e3583995d9f22894acb 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for WorkingDirectory with trailing dot
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"'
+ExecStart=sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"'
 Type=oneshot
 WorkingDirectory=/tmp///./test-exec_workingdirectory/.
index b53bf6081f729ae2c46c845715622c9558028bfa..4c40fafcf1df0209e3d19a4c1163e30b59f356c2 100644 (file)
@@ -3,6 +3,6 @@
 Description=Test for WorkingDirectory
 
 [Service]
-ExecStart=/bin/sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"'
+ExecStart=sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"'
 Type=oneshot
 WorkingDirectory=/tmp/test-exec_workingdirectory
diff --git a/test/test-network/conf/25-wireguard-endpoint-peer0-cred.txt b/test/test-network/conf/25-wireguard-endpoint-peer0-cred.txt
new file mode 100644 (file)
index 0000000..b4251c3
--- /dev/null
@@ -0,0 +1 @@
+192.168.27.3:51820
diff --git a/test/test-network/conf/25-wireguard-no-peer-private-key-cred.txt b/test/test-network/conf/25-wireguard-no-peer-private-key-cred.txt
new file mode 100644 (file)
index 0000000..8011c64
--- /dev/null
@@ -0,0 +1 @@
+EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong=
index ce3b31a5cecc134bb3254a25bff5863fd38193bf..8c90735bc7657bec6bbbe6b9a7c92f007c123122 100644 (file)
@@ -4,6 +4,6 @@ Name=wg97
 Kind=wireguard
 
 [WireGuard]
-PrivateKey=EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong=
+#PrivateKey=EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong=
 ListenPort=51821
 FwMark=1235
diff --git a/test/test-network/conf/25-wireguard-preshared-key-peer2-cred.txt b/test/test-network/conf/25-wireguard-preshared-key-peer2-cred.txt
new file mode 100644 (file)
index 0000000..5e79c19
--- /dev/null
@@ -0,0 +1 @@
+6Fsg8XN0DE6aPQgAX4r2oazEYJOGqyHUz3QRH/jCB+I=
index 4fed38e57a1ea2ef89a37ff2239793b04b0ec1d5..6a2bb88c2e88090a6df8b739e8cca6e956b894b9 100644 (file)
@@ -13,8 +13,8 @@ RouteMetric=456
 [WireGuardPeer]
 PublicKey=RDf+LSpeEre7YEIKaxg+wbpsNV7du+ktR99uBEtIiCA=
 AllowedIPs=fd31:bf08:57cb::/48,192.168.26.3/24
-#Endpoint=wireguard.example.com:51820
-Endpoint=192.168.27.3:51820
+#Endpoint=192.168.27.3:51820
+Endpoint=@network.wireguard.peer0.endpoint
 PresharedKey=IIWIV17wutHv7t4cR6pOT91z6NSz/T8Arh0yaywhw3M=
 PersistentKeepalive=20
 RouteTable=1234
index bf99a5ab0f8967f16c22a1a64446b636e878d044..f3440df28f163658abc5a29663b9635213b17f3a 100644 (file)
@@ -1,5 +1,5 @@
 [WireGuardPeer]
 PublicKey=9uioxkGzjvGjkse3V35I9AhorWfIjBcrf3UPMS0bw2c=
-PresharedKey=6Fsg8XN0DE6aPQgAX4r2oazEYJOGqyHUz3QRH/jCB+I=
+PresharedKey=@network.wireguard.peer2.psk
 
 AllowedIPs=192.168.124.3
index 491dcca9fa3b0d741885aef8a332e96f9f4e8726..b122e0a491b93ae563eb0bef509cbfb072875094 100755 (executable)
@@ -27,6 +27,7 @@ network_unit_dir = '/run/systemd/network'
 networkd_conf_dropin_dir = '/run/systemd/networkd.conf.d'
 networkd_ci_temp_dir = '/run/networkd-ci'
 udev_rules_dir = '/run/udev/rules.d'
+credstore_dir = '/run/credstore'
 
 dnsmasq_pid_file = '/run/networkd-ci/test-dnsmasq.pid'
 dnsmasq_log_file = '/run/networkd-ci/test-dnsmasq.log'
@@ -298,6 +299,11 @@ def copy_network_unit(*units, copy_dropins=True):
     if has_link:
         udev_reload()
 
+def copy_credential(src, target):
+        mkdir_p(credstore_dir)
+        cp(os.path.join(networkd_ci_temp_dir, src),
+           os.path.join(credstore_dir, target))
+
 def remove_network_unit(*units):
     """
     Remove previously copied unit files from the testbed.
@@ -1784,6 +1790,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
 
     @expectedFailureIfModuleIsNotAvailable('wireguard')
     def test_wireguard(self):
+        copy_credential('25-wireguard-endpoint-peer0-cred.txt', 'network.wireguard.peer0.endpoint')
+        copy_credential('25-wireguard-preshared-key-peer2-cred.txt', 'network.wireguard.peer2.psk')
+        copy_credential('25-wireguard-no-peer-private-key-cred.txt', 'network.wireguard.private.25-wireguard-no-peer')
+
         copy_network_unit('25-wireguard.netdev', '25-wireguard.network',
                           '25-wireguard-23-peers.netdev', '25-wireguard-23-peers.network',
                           '25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt',
index 637fea43875951e8dbcd7c6065dd8a3866699d17..9a3e31b0804e97008d78255cdb1b37f1f7549de9 100644 (file)
@@ -5,6 +5,6 @@ BindsTo=testsuite-23-bound-by.service
 After=testsuite-23-bound-by.service
 
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 # --kill-who= (no 'm') to check that the short form is accepted
 ExecStopPost=systemctl kill --kill-whom=main -sRTMIN+1 testsuite-23.service
index a2df5a1954b87a697a1700324e1b0f0158ceba1a..c999c2e4fcfe311e7b04a27e3f0db6fa0b408f39 100644 (file)
@@ -3,4 +3,4 @@
 Description=Unit with BoundBy=
 
 [Service]
-ExecStart=/bin/sleep 0.7
+ExecStart=sleep 0.7
index 36f8baa6ba4b589e8e916ef057e23b041f14b93d..597810797d099fd06483f22d6acf28e129f9868e 100644 (file)
@@ -4,4 +4,4 @@ Description=Failing unit
 OnFailure=testsuite-23-uphold.service
 
 [Service]
-ExecStart=/bin/false
+ExecStart=false
index 9919a9fa8216181bf19220614a923b03321368ea..47f0452919ec98b1d5641e03651cd5065d31c231 100644 (file)
@@ -4,4 +4,4 @@ Type=notify
 NotifyAccess=all
 MountAPIVFS=yes
 PrivateTmp=yes
-ExecStart=/bin/bash -c 'touch /tmp/shared-private-file && systemd-notify --ready && sleep infinity'
+ExecStart=bash -c 'touch /tmp/shared-private-file && systemd-notify --ready && sleep infinity'
index 5e823a177810b8432771f7e7182cf1ec2bb127cb..a70f8fca998d7d47de87d622a878d60a504d4597 100644 (file)
@@ -7,4 +7,4 @@ Type=notify
 NotifyAccess=all
 MountAPIVFS=yes
 PrivateTmp=yes
-ExecStart=/bin/bash -c 'touch /tmp/shared-private-file && systemd-notify --ready && sleep infinity'
+ExecStart=bash -c 'touch /tmp/shared-private-file && systemd-notify --ready && sleep infinity'
index bbbfd7c67db398c9356a80a20de3e326a64cd9de..dae533cc369c6fb2edc706e849cb9b6aa9df39f9 100644 (file)
@@ -7,4 +7,4 @@ Type=notify
 NotifyAccess=all
 MountAPIVFS=yes
 PrivateTmp=yes
-ExecStart=/bin/bash -c 'touch /tmp/shared-private-file-x && systemd-notify --ready && sleep infinity'
+ExecStart=bash -c 'touch /tmp/shared-private-file-x && systemd-notify --ready && sleep infinity'
index dac1cea7bdf30a766a4aeef6aa9afd65f505c57f..8e4944a8e7f4620ca7abbb3b3a65812ac104f4ec 100644 (file)
@@ -6,4 +6,4 @@ MountAPIVFS=yes
 PrivateTmp=yes
 ExecStartPre=test -e /tmp/shared-private-file-x
 ExecStartPre=test -e /tmp/hoge
-ExecStart=/bin/bash -c 'touch /tmp/shared-private-file-y && systemd-notify --ready && sleep infinity'
+ExecStart=bash -c 'touch /tmp/shared-private-file-y && systemd-notify --ready && sleep infinity'
index 5a6f5cd873a0f39649b099245e0cbbcc2c740567..46c27ca5d836a12307b5c786841c16c36094df55 100644 (file)
@@ -10,4 +10,4 @@ PrivateTmp=yes
 BindPaths=/run/testsuite-23-marker-fixed:/tmp/testfile-marker-fixed
 InaccessiblePaths=/run/inaccessible
 ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed
-ExecStart=/bin/sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed'
+ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed'
index 6f93c3bde57070564f19112ef885219c8291584a..699b6080d337700f839b75e81c269f5476a00146 100644 (file)
@@ -3,4 +3,4 @@
 RuntimeMaxSec=5
 Type=notify
 RemainAfterExit=yes
-ExecStart=/bin/sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0'
+ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0'
index f068daf2b3bf806aeec7a6d3b0c91077a74486d4..03189550a7f0423e878398fe0dd25ec7264790a7 100644 (file)
@@ -6,5 +6,5 @@ After=testsuite-23-prop-stop-two.service
 StopPropagatedFrom=testsuite-23-prop-stop-two.service
 
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 ExecStopPost=systemctl kill --kill-whom=main -sUSR2 testsuite-23.service
index 2bcd209e167243ab37005832be7fbad6391297b4..b2bb869524acd0b946ee856a52d38d89ccd08b87 100644 (file)
@@ -3,4 +3,4 @@
 Description=Stop Propagation Sender
 
 [Service]
-ExecStart=/bin/sleep 1.5
+ExecStart=sleep 1.5
index 0fc27c41fee0128b607b9c4aafc5309ae7fe6bda..2e0972cbf0dcdad4d86a87ec3a913dfee6871e98 100644 (file)
@@ -5,5 +5,5 @@ Description=Failed Dependency Unit
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/bin/sh -c "if [ -f /tmp/testsuite-23-retry-fail ]; then exit 0; else exit 1; fi"
+ExecStart=sh -c "if [ -f /tmp/testsuite-23-retry-fail ]; then exit 0; else exit 1; fi"
 Restart=no
index 0426d76a54649eb2f745d94ae95b36c8c1f4005d..3c20e4338c55e0fbf1a9258078a58257f62c95ea 100644 (file)
@@ -7,4 +7,4 @@ After=testsuite-23-retry-fail.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/bin/echo ok
+ExecStart=echo ok
index f35e8424de8ece0c04c6e33f233d7f0286ca240b..7f15f068b41b3253af7ecb30ff276cec60c8072d 100644 (file)
@@ -4,4 +4,4 @@ Description=Upholding Unit
 Upholds=testsuite-23-retry-upheld.service
 
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
index 410d4f83c3468e099fd2be347cb1d677de045595..2ace6fa370c7229dbc72f4104c2301a633101c96 100644 (file)
@@ -4,4 +4,4 @@ Description=Succeeding unit
 OnSuccess=testsuite-23-fail.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index a4562077db49da023ffe2577794be156ae9cf731..bcfacd21dd4c5ebe3435c50d6cf66eee34e26464 100644 (file)
@@ -3,7 +3,7 @@
 Description=Unit that sets UpheldBy= through [Install]
 
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 
 [Install]
 UpheldBy=testsuite-23-retry-uphold.service
index 3549d6a8f50691a206696a55ec03889ed3784278..67f0ac885992bded83fe660f2661320fcb9f5ed0 100644 (file)
@@ -4,4 +4,4 @@ Description=Upholding Unit
 Upholds=testsuite-23-short-lived.service
 
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
index 3a7c9e11edf717ba6ba2491b461668e9700a605f..13927e79b4761b1faed03bf0b38208d7cc8c95e1 100644 (file)
@@ -6,4 +6,4 @@ After=a.service
 Before=a.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index ec5d0594c3356d6b989e0fa2db9d3b7a472dece3..0cc13201607df442c08c4426721dd49ff5291811 100644 (file)
@@ -5,4 +5,4 @@ Requires=b.service
 Before=b.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 4503cf312898c495f0e9584b555f5b2d5d6863aa..e875714b8738444e0780729a1c5eaf556c6f07c7 100644 (file)
@@ -4,4 +4,4 @@ Description=B
 Wants=f.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index a1ce28c82a56d9b23af963fb1aa693aaa88adb1d..3fc3717a5033f924463f88fccd4e79e92f375c2c 100644 (file)
@@ -4,4 +4,4 @@ Description=C
 Requires=a.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 82023258e36ee48aa07aa810b242dc8f305280ea..0438607bf7d29d428df9fbacebcc1b3693caa134 100644 (file)
@@ -6,4 +6,4 @@ Before=a.service
 Requires=a.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 385fbed4921390bf4b0db6332e38f7032750b171..0ee4f24a4e96b3dc4c20e98c33c60facc73d5708 100644 (file)
@@ -5,5 +5,5 @@ Description=Daughter Service
 [Service]
 Slice=parent.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 CPUAccounting=true
index 720c1da00a44f2dee6f240a6fc5c9926df891ae5..c17698999ab09f360113432b642a991d56d612a2 100644 (file)
@@ -5,4 +5,4 @@ Description=DML discard empty service
 [Service]
 Slice=dml-discard.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
index 93246ac0dbbb65e3c34ec2433ceaa3b406d40b85..0fba2acdafb4750c69db9a2b6698ae3ccc9fb934 100644 (file)
@@ -5,5 +5,5 @@ Description=DML discard set ml service
 [Service]
 Slice=dml-discard.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 MemoryLow=15
index ac96de01cbbbf75ef549c712d3a06149d2d95b5f..5f0c143d66b039ed1561628f85caab2e52511616 100644 (file)
@@ -5,4 +5,4 @@ Description=DML override empty service
 [Service]
 Slice=dml-override.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
index 1e1ba3416e19af162d5f62334124fc2abd42bc83..896622689fc073bb9418524cacb6f05284fac9f0 100644 (file)
@@ -5,4 +5,4 @@ Description=DML passthrough empty service
 [Service]
 Slice=dml-passthrough.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
index 9a1531125baead2f3d715164d6bfa52e4aa34bc5..ec82174e6958608885258abdc34518fba7ca7c67 100644 (file)
@@ -5,5 +5,5 @@ Description=DML passthrough set DML service
 [Service]
 Slice=dml-passthrough.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 DefaultMemoryLow=15
index 65083bc24dd3907d0fc97089955c3d710bb4eff7..63ec3058cf01b12028e263451c9f04720dfd41d5 100644 (file)
@@ -5,5 +5,5 @@ Description=DML passthrough set ML service
 [Service]
 Slice=dml-passthrough.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 MemoryLow=0
index 5bbcde26dd9ace354d736f47447aa4c240d36a1b..c2acb92f6ea6bef15926f05a8dc215d573fa2ad9 100644 (file)
@@ -6,4 +6,4 @@ Before=a.service
 Wants=a.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index ca20053ee619767f4606692caf443e112d757363..a66043e96d894aec8f587ffcf4007a3772716569 100644 (file)
@@ -3,4 +3,4 @@
 Description=F
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 5fd794dfd1a98eb8caf3ba1e1de3e3b0625efd32..bfb3d7898c64547d4d0951428d32ad822a52e2f3 100644 (file)
@@ -4,4 +4,4 @@ Description=G
 Conflicts=e.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 4fe77b4a7db6ef75e55664394fbb0d6940c8118a..bdccfe1846040e124d4d82f11a7e7d78b3ab9094 100644 (file)
@@ -5,4 +5,4 @@ Description=Grandchild Service
 [Service]
 Slice=parent-deep.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
index 5361d42db7eab096fbcd25d767742c142ae2a5c8..1c4dbb4c90403598bf92832f5ce8e25391d4bcec 100644 (file)
@@ -4,4 +4,4 @@ Description=H
 Wants=g.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 2b5e821638e632ccb510948a8720e17eaba3c86b..783ac6539135440daacbffe1e360483c42152533 100644 (file)
@@ -6,4 +6,4 @@ Wants=b.service
 After=b.service
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 7fc0e4241ad6078781294148dcfc35f2c659f530..4c1a4a3cfd59f004fa8e9b359ab5acf69ccdf9da 100644 (file)
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 7fc0e4241ad6078781294148dcfc35f2c659f530..4c1a4a3cfd59f004fa8e9b359ab5acf69ccdf9da 100644 (file)
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index b2af20ab41828730ce78d148acb88f82dd3aae75..f7a2f67a1190af3462134f30cf5b72983058aa59 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 
 [Unit]
 Conflicts=loopy4.service
index b2af20ab41828730ce78d148acb88f82dd3aae75..f7a2f67a1190af3462134f30cf5b72983058aa59 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 
 [Unit]
 Conflicts=loopy4.service
index 14ce5ad326cf6fea0e351f9cf0f005cbefecc82c..2e5c8ced0201d5c7511ada8c2bddc25e37fb1d95 100644 (file)
@@ -5,6 +5,6 @@ Description=Nomem Leaf Service
 [Service]
 Slice=nomem.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 IOWeight=200
 MemoryAccounting=true
index be8f1c27c395cf42beded19bab4d8b2641a26a0c..d9fd6cc47a718343d76d37c1c0a1708bd8d6533d 100644 (file)
@@ -3,5 +3,5 @@
 Description=Bad sched priority for Idle
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 CPUSchedulingPriority=1
index 5a1d809339b18c7faaac2576bc58168897061414..a7238ed76b14a0737d7d6b6643115f49e487e7c0 100644 (file)
@@ -3,5 +3,5 @@
 Description=Sched idle with prio 0
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 CPUSchedulingPriority=0
index b51b868c2a98695d434cf69f6cb8b572ffc32e87..3f3bf39707a2c450173c14b9f3109d97866b3996 100644 (file)
@@ -3,7 +3,7 @@
 Description=Bad sched priority for RR
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 CPUSchedulingPriority=-1
 CPUSchedulingPriority=100
 CPUSchedulingPolicy=rr
index 6ae1febc8fd6f33577df051acdf7b472dbbc499a..3a72bd6476d697076f981d76c011145610f979a4 100644 (file)
@@ -3,7 +3,7 @@
 Description=Change prio
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 CPUSchedulingPriority=1
 CPUSchedulingPriority=2
 CPUSchedulingPriority=99
index 00b98220971e36f2da7eee1c7318f290a254abf7..5c71f30239e8394d8622300c41fef9c98bec9a69 100644 (file)
@@ -3,5 +3,5 @@
 Description=Default prio for RR
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 CPUSchedulingPolicy=rr
index 2059118f01e1dd9d0fffd6cc64e88d758bbfbced..0242509f3bd3d2ec0eca865435babc419d6fe2b5 100644 (file)
@@ -5,5 +5,5 @@ Description=Son Service
 [Service]
 Slice=parent.slice
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
 CPUShares=100
index e3567c2d7c598777542038dc12407ce55c7399d6..115b941f926826781a5f70ca8500014bd7194b34 100755 (executable)
@@ -80,13 +80,13 @@ cat <<EOF >/run/systemd/system/wait2.service
 [Unit]
 Description=Wait for 2 seconds
 [Service]
-ExecStart=/bin/sh -ec 'sleep 2'
+ExecStart=sh -ec 'sleep 2'
 EOF
 cat <<EOF >/run/systemd/system/wait5fail.service
 [Unit]
 Description=Wait for 5 seconds and fail
 [Service]
-ExecStart=/bin/sh -ec 'sleep 5; false'
+ExecStart=sh -ec 'sleep 5; false'
 EOF
 
 # wait2 succeeds
index 6eb802c93fb40e4892f71c456f737e7a4bbb4932..dcfa9b17b0d62c2be70f3ce58cc980d46f128583 100755 (executable)
@@ -24,7 +24,7 @@ Type=oneshot
 ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = my.timer'
 ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_REALTIME_USEC"'
 ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_MONOTONIC_USEC"'
-ExecStart=/bin/echo Timer runs me
+ExecStart=echo Timer runs me
 EOF
 
 cat >/run/systemd/system/my.timer <<EOF
index db17c25f9049f1e487dcbc1828e56f582937c334..374df542b8e7f7dae583dac23b7aae21360753f4 100755 (executable)
@@ -24,7 +24,7 @@ cat >/run/systemd/system/issue-3171@.service <<EOF
 Description=Test service
 [Service]
 StandardInput=socket
-ExecStart=/bin/sh -x -c cat
+ExecStart=sh -x -c cat
 EOF
 
 systemctl start issue-3171.socket
index 480d7ee8dffd6d0d9b00e189442d6004fc6c193f..ca988b2321dd78fc02bd6391730d8c0034e51ac4 100755 (executable)
@@ -5,12 +5,12 @@ set -o pipefail
 
 systemd-analyze log-level debug
 
-cat > /run/systemd/system/floodme@.service <<EOF
+cat >/run/systemd/system/floodme@.service <<EOF
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 EOF
 
-cat > /run/systemd/system/floodme.socket <<EOF
+cat >/run/systemd/system/floodme.socket <<EOF
 [Socket]
 ListenStream=/tmp/floodme
 PollLimitIntervalSec=10s
@@ -24,7 +24,7 @@ systemctl start floodme.socket
 START=$(date +%s%N)
 
 # Trigger this 100 times in a flood
-for (( i=0 ; i < 100; i++ )) ; do
+for _ in {1..100}; do
     logger -u /tmp/floodme foo &
 done
 
index b497f73dfe53b1eaebdbe269a4e3c6a77f178c44..d544ce6047c87e97c3c1db9d7104bfb241d0bbca 100755 (executable)
@@ -14,7 +14,7 @@ SERVICE_NAME="${SERVICE_PATH##*/}"
 echo "[#1] Failing ExecReload= should not kill the service"
 cat >"$SERVICE_PATH" <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 ExecReload=/bin/false
 EOF
 
@@ -30,7 +30,7 @@ systemctl stop "$SERVICE_NAME"
 echo "[#2] Failing ExecReload= should not kill the service (multiple ExecReload=)"
 cat >"$SERVICE_PATH" <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 ExecReload=/bin/true
 ExecReload=/bin/false
 ExecReload=/bin/true
@@ -47,7 +47,7 @@ systemctl stop "$SERVICE_NAME"
 echo "[#3] Failing ExecReload=- should not affect reload's exit code"
 cat >"$SERVICE_PATH" <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 ExecReload=-/bin/false
 EOF
 
index a82b54fe9e286cacc4962d56dd7495206d8ede85..a88324332638bc5d808c1537a630c7e9e50cbe67 100755 (executable)
@@ -26,7 +26,7 @@ StateDirectory=test-service
 CacheDirectory=test-service
 LogsDirectory=test-service
 RuntimeDirectoryPreserve=yes
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 Type=exec
 EOF
 
@@ -97,7 +97,7 @@ StateDirectory=test-service
 CacheDirectory=test-service
 LogsDirectory=test-service
 RuntimeDirectoryPreserve=yes
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 Type=exec
 EOF
 
index 9c4f17d7a29efba0b1edee03631d749e19294477..e40990bdbb8fe47f78eba4b66791cdcf2735cad8 100755 (executable)
@@ -37,7 +37,7 @@ sleep 3.1
 
 cat >/run/systemd/system/testsuite-23-no-reload.service <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 EOF
 
 systemctl start testsuite-23-no-reload.service
@@ -53,7 +53,7 @@ sleep 3.1
 
 cat >/run/systemd/system/testsuite-23-no-reload.service <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 EOF
 
 # Start a non-existing unit first, so that the cache is reloaded for an unrelated
@@ -85,7 +85,7 @@ systemctl start testsuite-23-no-reload.target
 
 cat >/run/systemd/system/testsuite-23-no-reload.service <<EOF
 [Service]
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 EOF
 
 systemctl restart testsuite-23-no-reload.target
index 8a53b984a652d586931a73f049c60ea742f1d93a..12bf1393e4b60ce50c87080ae0d3021c86485ab1 100755 (executable)
@@ -80,7 +80,7 @@ EOF
 
 writeTestUnit() {
     mkdir -p "$testUnitFile.d/"
-    printf "[Service]\nExecStart=/bin/sleep 3600\n" >"$testUnitFile"
+    printf "[Service]\nExecStart=sleep 3600\n" >"$testUnitFile"
 }
 
 writeTestUnitNUMAPolicy() {
index c116c80981b4793f1ff9b5fcb3fb53e0fc9a5a15..1bb9ddf1b70ccf600c09cac7730e4c78a7bff08e 100644 (file)
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 [Service]
-ExecStart=/bin/sleep 3600
+ExecStart=sleep 3600
index f6801da0a7042cac72c549564550be7cc4fa30fb..35d5503f73a7dcf3fdafa2c002b322aa11f4c6fc 100755 (executable)
@@ -258,7 +258,7 @@ ConditionVirtualization=
 Type=simple
 AmbientCapabilities=
 ExecStart=
-ExecStart=/bin/sleep infinity
+ExecStart=sleep infinity
 EOF
         systemctl daemon-reload
     fi
index b5d01bfc8e8b336e12ce84432144b7f45e4fae80..0e33ec9a26f210fc00890f4c4b5b85f4bcec35d6 100755 (executable)
@@ -352,7 +352,7 @@ Type=notify
 RemainAfterExit=yes
 MountAPIVFS=yes
 PrivateTmp=yes
-ExecStart=/bin/sh -c ' \\
+ExecStart=sh -c ' \\
     systemd-notify --ready; \\
     while [ ! -f /tmp/img/usr/lib/os-release ] || ! grep -q -F MARKER /tmp/img/usr/lib/os-release; do \\
         sleep 0.1; \\
@@ -416,8 +416,8 @@ RootImage=${image}.raw
 ExtensionImages=/usr/share/app0.raw /usr/share/app1.raw:nosuid
 # Relevant only for sanitizer runs
 UnsetEnvironment=LD_PRELOAD
-ExecStart=/bin/bash -c '/opt/script0.sh | grep ID'
-ExecStart=/bin/bash -c '/opt/script1.sh | grep ID'
+ExecStart=bash -c '/opt/script0.sh | grep ID'
+ExecStart=bash -c '/opt/script1.sh | grep ID'
 Type=oneshot
 RemainAfterExit=yes
 EOF
@@ -449,8 +449,8 @@ RootImage=${image}.raw
 ExtensionDirectories=${image_dir}/app0 ${image_dir}/app1
 # Relevant only for sanitizer runs
 UnsetEnvironment=LD_PRELOAD
-ExecStart=/bin/bash -c '/opt/script0.sh | grep ID'
-ExecStart=/bin/bash -c '/opt/script1.sh | grep ID'
+ExecStart=bash -c '/opt/script0.sh | grep ID'
+ExecStart=bash -c '/opt/script1.sh | grep ID'
 Type=oneshot
 RemainAfterExit=yes
 EOF
index 1b622b3d8edfc1428f842318cddcd5ae56f27fb5..61564dc1664e1800f8a3278cc051350219ace053 100755 (executable)
@@ -36,7 +36,7 @@ Description=TEST-59-RELOADING-RESTART Normal exit
 
 [Service]
 Type=notify
-ExecStart=/bin/bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 1; exit 1"
+ExecStart=bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 1; exit 1"
 EOF
 
 cat >/run/systemd/system/testservice-fail-restart-59.service <<EOF
@@ -45,7 +45,7 @@ Description=TEST-59-RELOADING-RESTART Restart=on-failure
 
 [Service]
 Type=notify
-ExecStart=/bin/bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 1; exit 1"
+ExecStart=bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 1; exit 1"
 Restart=on-failure
 StartLimitBurst=1
 EOF
@@ -57,7 +57,7 @@ Description=TEST-59-RELOADING-RESTART Restart=on-abort
 
 [Service]
 Type=notify
-ExecStart=/bin/bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 5; exit 1"
+ExecStart=bash -c "systemd-notify --ready; systemd-notify RELOADING=1; sleep 5; exit 1"
 Restart=on-abort
 EOF
 
index fa3a7e77b2f0ee65935ff2c5212ee15910944e9b..16695c18a2b9bbc18505b08310db245495e8d8ce 100644 (file)
@@ -2,8 +2,8 @@
 [Unit]
 Description=TEST-62-RESTRICT-IFACES-all-pings-work
 [Service]
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.1'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.5'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.9'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
 RestrictNetworkInterfaces=
 Type=oneshot
index b83362db89820dda8d31c93f12b1bfc8a21ce42b..bce7e8e6cbaca0986ce4175185b09fcdbfbdbffa 100644 (file)
@@ -2,9 +2,9 @@
 [Unit]
 Description=TEST-62-RESTRICT-IFACES-allow-list
 [Service]
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.1'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.5'
-ExecStart=/bin/sh -c '! ping -c 1 -W 0.2 192.168.113.9'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
+ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9'
 RestrictNetworkInterfaces=veth0
 RestrictNetworkInterfaces=veth1
 Type=oneshot
index b6c8e7aa87f35789ffd50706d26383ea6e7f0f8a..116530bad3507f074bd5abd918da4d8e9ae842f4 100644 (file)
@@ -2,9 +2,9 @@
 [Unit]
 Description=TEST-62-RESTRICT-IFACES-deny-list
 [Service]
-ExecStart=/bin/sh -c '! ping -c 1 -W 0.2 192.168.113.1'
-ExecStart=/bin/sh -c '! ping -c 1 -W 0.2 192.168.113.5'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.9'
+ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1'
+ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.5'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
 RestrictNetworkInterfaces=~veth0
 RestrictNetworkInterfaces=~veth1
 Type=oneshot
index 053e6d205f45ab354654c452d62f11b46b709b42..200a38355a300d31d9b845744166137cf52dd59d 100644 (file)
@@ -2,9 +2,9 @@
 [Unit]
 Description=TEST-62-RESTRICT-IFACES-empty-assignment
 [Service]
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.1'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.5'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.9'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
 RestrictNetworkInterfaces=veth0
 RestrictNetworkInterfaces=
 Type=oneshot
index a8f268d1d8196bb9d8ccb4c8679dfbb162eb2b41..51761ba27eba88b08c4f266be850854693ddaca1 100644 (file)
@@ -2,9 +2,9 @@
 [Unit]
 Description=TEST-62-RESTRICT-IFACES-invert-assignment
 [Service]
-ExecStart=/bin/sh -c '! ping -c 1 -W 0.2 192.168.113.1'
-ExecStart=/bin/sh -c 'ping -c 1 -W 0.2 192.168.113.5'
-ExecStart=/bin/sh -c '! ping -c 1 -W 0.2 192.168.113.9'
+ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1'
+ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
+ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9'
 RestrictNetworkInterfaces=veth0
 RestrictNetworkInterfaces=veth0 veth1
 RestrictNetworkInterfaces=~veth0
index 078bc8b5f5301d361e8cce07c44656a5981b188b..e14bdbefa78e7cf665aca618187ed1ccf89e58b4 100755 (executable)
@@ -107,7 +107,7 @@ ConditionKernelVersion=>1.0
 ConditionPathExists=/etc/os-release
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 EOF
 systemctl daemon-reload
 systemd-analyze condition --unit="$UNIT_NAME"
index 2d815a96da21cefad636c8c96a3887b3f893adff..14b0d8987af08bfbfe71dc0cd2ede5181cde0664 100644 (file)
@@ -7,4 +7,4 @@ DevicePolicy=strict
 DeviceAllow=/dev/null r
 StandardOutput=file:/tmp/testsuite66serviceresults
 ExecStartPre=rm -f /tmp/testsuite66serviceresults
-ExecStart=/bin/bash -c "while true; do sleep 0.01 && echo meow >/dev/null && echo thisshouldnotbehere; done"
+ExecStart=bash -c "while true; do sleep 0.01 && echo meow >/dev/null && echo thisshouldnotbehere; done"
index 7aa0664b85f6ddfc82e41b61ec66493c784a01f6..3910369c0ffd91cb3fccac026be26329caa31c80 100644 (file)
@@ -4,4 +4,4 @@ Description=TEST-69-SHUTDOWN
 
 [Service]
 Type=oneshot
-ExecStart=/bin/true
+ExecStart=true
index da765a9d97cb7c6c3d67bc340edcd1fa4ae054cc..813a676c928d28218f3c88f729acebd943af5195 100755 (executable)
@@ -61,6 +61,11 @@ get_chassis() (
     echo "$CHASSIS"
 )
 
+stop_hostnamed() {
+    systemctl stop systemd-hostnamed.service
+    systemctl reset-failed systemd-hostnamed # reset trigger limit
+}
+
 testcase_chassis() {
     local i
 
@@ -80,7 +85,7 @@ testcase_chassis() {
         assert_eq "$(get_chassis)" "$i"
     done
 
-    systemctl stop systemd-hostnamed.service
+    stop_hostnamed
     rm -f /etc/machine-info
 
     # fallback chassis type
@@ -95,7 +100,7 @@ restore_sysfs_dmi() {
     umount /sys/class/dmi/id
     rm -rf /run/systemd/system/systemd-hostnamed.service.d
     systemctl daemon-reload
-    systemctl stop systemd-hostnamed
+    stop_hostnamed
 }
 
 testcase_firmware_date() {
@@ -120,15 +125,15 @@ EOF
     echo '1' >/sys/class/dmi/id/uevent
 
     echo '09/08/2000' >/sys/class/dmi/id/bios_date
-    systemctl stop systemd-hostnamed
+    stop_hostnamed
     assert_in '2000-09-08' "$(hostnamectl)"
 
     echo '2022' >/sys/class/dmi/id/bios_date
-    systemctl stop systemd-hostnamed
+    stop_hostnamed
     assert_not_in 'Firmware Date' "$(hostnamectl)"
 
     echo 'garbage' >/sys/class/dmi/id/bios_date
-    systemctl stop systemd-hostnamed
+    stop_hostnamed
     assert_not_in 'Firmware Date' "$(hostnamectl)"
 }
 
@@ -223,6 +228,14 @@ testcase_nss-myhostname() {
     (! getent hosts -s myhostname fd00:dead:beef:cafe::1)
 }
 
+test_varlink() {
+    A="$(mktemp -u)"
+    B="$(mktemp -u)"
+    varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' --json=short > "$A"
+    hostnamectl --json=short > "$B"
+    cmp "$A" "$B"
+}
+
 run_testcases
 
 touch /testok
index a0e1cb52dd70994485951ede64d66114211feb6f..dabe2347093539e964feeae8342d33b7cedfa94f 100755 (executable)
@@ -14,14 +14,14 @@ trap at_exit EXIT
 # Extended unit
 cat >"/run/systemd/system/delta-test-unit-extended.service" <<EOF
 [Service]
-ExecStart=/bin/true
+ExecStart=true
 EOF
 mkdir -p "/run/systemd/system/delta-test-unit-extended.service.d"
 cat >"/run/systemd/system/delta-test-unit-extended.service.d/override.conf" <<EOF
 [Unit]
 Description=Foo Bar
 [Service]
-ExecStartPre=/bin/true
+ExecStartPre=true
 EOF
 # Masked unit
 cp -fv /run/systemd/system/delta-test-unit-extended.service /run/systemd/system/delta-test-unit-masked.service
index d97de3f604354e05c29baa737a82936e828acd8f..7912360315e97187f266b19365d4e9231b46e452 100755 (executable)
@@ -113,3 +113,7 @@ done
 (! varlinkctl call /run/systemd/userdb/io.systemd.Multiplexer io.systemd.UserDatabase.GetUserRecord </dev/null)
 (! varlinkctl validate-idl "")
 (! varlinkctl validate-idl </dev/null)
+
+varlinkctl info /run/systemd/io.systemd.Hostname
+varlinkctl introspect /run/systemd/io.systemd.Hostname io.systemd.Hostname
+varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}'
index 4aca9047a3d5a57e6740da4692d731898e641008..9ac3c8c68e3444da547cf1e9d3ba019fcfa8d9e6 100644 (file)
@@ -4,4 +4,4 @@ Description=A unit with multiple dashes
 Documentation=man:test
 
 [Service]
-ExecStart=/bin/true
+ExecStart=true
index 40cc3d10d35ff9f6621b77be051de44b1a008445..efd2eac58356d3cf085e2a28bfa7c377a88d7309 100644 (file)
@@ -321,6 +321,11 @@ units = [
           'conditions' : ['ENABLE_HOSTNAMED'],
           'symlinks' : ['dbus-org.freedesktop.hostname1.service'],
         },
+        {
+          'file' : 'systemd-hostnamed.socket',
+          'conditions' : ['ENABLE_HOSTNAMED'],
+          'symlinks' : ['sockets.target.wants/'],
+        },
         {
           'file' : 'systemd-hwdb-update.service.in',
           'conditions' : ['ENABLE_HWDB'],
diff --git a/units/systemd-hostnamed.socket b/units/systemd-hostnamed.socket
new file mode 100644 (file)
index 0000000..8d0a06c
--- /dev/null
@@ -0,0 +1,19 @@
+#  SPDX-License-Identifier: LGPL-2.1-or-later
+#
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Hostname Service Varlink Socket
+Documentation=man:systemd-hostnamed.service(8)
+Documentation=man:hostname(5)
+Documentation=man:machine-info(5)
+
+[Socket]
+ListenStream=/run/systemd/io.systemd.Hostname
+FileDescriptorName=varlink
+SocketMode=0666
index 3608458aa57aff363e905107f34e64568e9dbfa2..32b6e9fa2ffed33562b84cf031503b63d25d99e1 100644 (file)
@@ -50,6 +50,7 @@ SystemCallErrorNumber=EPERM
 SystemCallFilter=@system-service
 Type=notify-reload
 User=systemd-network
+ImportCredential=network.wireguard.*
 {{SERVICE_WATCHDOG}}
 
 [Install]