From: Yu Watanabe Date: Tue, 16 Apr 2024 02:57:23 +0000 (+0900) Subject: network-generator: also copy drop-ins for networkd.conf from credential X-Git-Tag: v256-rc1~172^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12e16e9f736f87142995bd259efcf75995f2960;p=thirdparty%2Fsystemd.git network-generator: also copy drop-ins for networkd.conf from credential Follow-up for 1a30285590c2f40f256d0628950ef9243b2c1938. --- diff --git a/man/systemd-network-generator.service.xml b/man/systemd-network-generator.service.xml index 59d608028a7..8962f1a05f3 100644 --- a/man/systemd-network-generator.service.xml +++ b/man/systemd-network-generator.service.xml @@ -128,13 +128,15 @@ - network.netdev.* + network.conf.* network.link.* + network.netdev.* network.network.* These credentials should contain valid - systemd.netdev5, + networkd.conf5, systemd.link5, + systemd.netdev5, systemd.network5 configuration data. From each matching credential a separate file is created. Example: a passed credential network.link.50-foobar will be copied into a configuration file diff --git a/man/systemd.system-credentials.xml b/man/systemd.system-credentials.xml index 271c495d2a3..e8e2985a42b 100644 --- a/man/systemd.system-credentials.xml +++ b/man/systemd.system-credentials.xml @@ -138,20 +138,21 @@ - network.netdev.* + network.conf.* network.link.* + network.netdev.* network.network.* Configures network devices. Read by - systemd-network-generator.service8. These - credentials directly translate to a matching *.netdev, - *.link or *.network file. Example: the contents of a - credential network.link.50-foobar will be copied into a file - 50-foobar.link. See - systemd.netdev5, + systemd-network-generator.service8. + These credentials should contain valid + networkd.conf5, systemd.link5, + systemd.netdev5, systemd.network5 - for details. + configuration data. From each matching credential a separate file is created. Example: the contents + of a credential network.link.50-foobar will be copied into a file + 50-foobar.link. 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 diff --git a/src/network/generator/main.c b/src/network/generator/main.c index 5a26a54fc56..0911656e889 100644 --- a/src/network/generator/main.c +++ b/src/network/generator/main.c @@ -234,9 +234,10 @@ static int run(int argc, char *argv[]) { RET_GATHER(ret, context_save(&context)); static const PickUpCredential table[] = { - { "network.link.", NETWORK_UNIT_DIRECTORY, ".link" }, - { "network.netdev.", NETWORK_UNIT_DIRECTORY, ".netdev" }, - { "network.network.", NETWORK_UNIT_DIRECTORY, ".network" }, + { "network.conf.", "/run/systemd/networkd.conf.d/", ".conf" }, + { "network.link.", NETWORK_UNIT_DIRECTORY, ".link" }, + { "network.netdev.", NETWORK_UNIT_DIRECTORY, ".netdev" }, + { "network.network.", NETWORK_UNIT_DIRECTORY, ".network" }, }; RET_GATHER(ret, pick_up_credentials(table, ELEMENTSOF(table)));