]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #29038 from keszybz/test-name-length-enforcement
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Sep 2023 18:29:13 +0000 (21:29 +0300)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2023 18:29:13 +0000 (21:29 +0300)
Limit width of fuzz test names in meson output

241 files changed:
.github/workflows/build_test.yml
.github/workflows/cifuzz.yml
.github/workflows/codeql.yml
.github/workflows/coverity.yml
.github/workflows/development_freeze.yml
.github/workflows/differential-shellcheck.yml
.github/workflows/gather-pr-metadata.yml
.github/workflows/issue_labeler.yml
.github/workflows/linter.yml
.github/workflows/mkosi.yml
.github/workflows/requirements.txt
.github/workflows/scorecards.yml
.github/workflows/unit_tests.yml
NEWS
TODO
catalog/systemd.catalog.in
hwdb.d/60-sensor.hwdb
man/rules/meson.build
man/sd-id128.xml
man/sd_bus_add_match.xml
man/sd_bus_add_node_enumerator.xml
man/sd_bus_add_object.xml
man/sd_bus_add_object_manager.xml
man/sd_bus_attach_event.xml
man/sd_bus_call.xml
man/sd_bus_call_method.xml
man/sd_bus_can_send.xml
man/sd_bus_close.xml
man/sd_bus_creds_get_pid.xml
man/sd_bus_creds_new_from_pid.xml
man/sd_bus_default.xml
man/sd_bus_emit_signal.xml
man/sd_bus_enqueue_for_read.xml
man/sd_bus_error.xml
man/sd_bus_error_add_map.xml
man/sd_bus_get_current_handler.xml
man/sd_bus_get_fd.xml
man/sd_bus_get_n_queued_read.xml
man/sd_bus_get_name_creds.xml
man/sd_bus_get_name_machine_id.xml
man/sd_bus_interface_name_is_valid.xml
man/sd_bus_is_open.xml
man/sd_bus_list_names.xml
man/sd_bus_message_at_end.xml
man/sd_bus_message_get_cookie.xml
man/sd_bus_message_get_monotonic_usec.xml
man/sd_bus_message_get_signature.xml
man/sd_bus_message_get_type.xml
man/sd_bus_message_new.xml
man/sd_bus_message_new_method_call.xml
man/sd_bus_message_read.xml
man/sd_bus_message_read_array.xml
man/sd_bus_message_read_basic.xml
man/sd_bus_message_read_strv.xml
man/sd_bus_message_rewind.xml
man/sd_bus_message_seal.xml
man/sd_bus_message_sensitive.xml
man/sd_bus_message_set_destination.xml
man/sd_bus_message_set_expect_reply.xml
man/sd_bus_message_skip.xml
man/sd_bus_negotiate_fds.xml
man/sd_bus_new.xml
man/sd_bus_path_encode.xml
man/sd_bus_process.xml
man/sd_bus_query_sender_creds.xml
man/sd_bus_request_name.xml
man/sd_bus_send.xml
man/sd_bus_set_address.xml
man/sd_bus_set_close_on_exit.xml
man/sd_bus_set_connected_signal.xml
man/sd_bus_set_description.xml
man/sd_bus_set_exit_on_disconnect.xml
man/sd_bus_set_fd.xml
man/sd_bus_set_method_call_timeout.xml
man/sd_bus_set_property.xml
man/sd_bus_set_sender.xml
man/sd_bus_set_server.xml
man/sd_bus_set_watch_bind.xml
man/sd_bus_slot_get_bus.xml
man/sd_bus_slot_ref.xml
man/sd_bus_slot_set_description.xml
man/sd_bus_slot_set_destroy_callback.xml
man/sd_bus_slot_set_floating.xml
man/sd_bus_slot_set_userdata.xml
man/sd_bus_start.xml
man/sd_bus_track_add_name.xml
man/sd_bus_track_new.xml
man/sd_bus_wait.xml
man/sd_device_get_syspath.xml
man/sd_device_ref.xml
man/sd_event_add_child.xml
man/sd_event_add_defer.xml
man/sd_event_add_inotify.xml
man/sd_event_add_io.xml
man/sd_event_add_memory_pressure.xml
man/sd_event_add_signal.xml
man/sd_event_add_time.xml
man/sd_event_exit.xml
man/sd_event_get_fd.xml
man/sd_event_new.xml
man/sd_event_now.xml
man/sd_event_run.xml
man/sd_event_set_signal_exit.xml
man/sd_event_set_watchdog.xml
man/sd_event_source_get_event.xml
man/sd_event_source_get_pending.xml
man/sd_event_source_set_description.xml
man/sd_event_source_set_destroy_callback.xml
man/sd_event_source_set_enabled.xml
man/sd_event_source_set_exit_on_failure.xml
man/sd_event_source_set_floating.xml
man/sd_event_source_set_prepare.xml
man/sd_event_source_set_priority.xml
man/sd_event_source_set_ratelimit.xml
man/sd_event_source_set_userdata.xml
man/sd_event_source_unref.xml
man/sd_event_wait.xml
man/sd_get_seats.xml
man/sd_hwdb_get.xml
man/sd_hwdb_new.xml
man/sd_id128_get_machine.xml
man/sd_id128_randomize.xml
man/sd_id128_to_string.xml
man/sd_is_fifo.xml
man/sd_journal_add_match.xml
man/sd_journal_enumerate_fields.xml
man/sd_journal_get_catalog.xml
man/sd_journal_get_cursor.xml
man/sd_journal_get_cutoff_realtime_usec.xml
man/sd_journal_get_data.xml
man/sd_journal_get_fd.xml
man/sd_journal_get_realtime_usec.xml
man/sd_journal_get_seqnum.xml
man/sd_journal_get_usage.xml
man/sd_journal_has_runtime_files.xml
man/sd_journal_next.xml
man/sd_journal_open.xml
man/sd_journal_print.xml
man/sd_journal_query_unique.xml
man/sd_journal_seek_head.xml
man/sd_journal_stream_fd.xml
man/sd_listen_fds.xml
man/sd_login_monitor_new.xml
man/sd_machine_get_class.xml
man/sd_notify.xml
man/sd_path_lookup.xml
man/sd_pid_get_owner_uid.xml
man/sd_seat_get_active.xml
man/sd_session_is_active.xml
man/sd_uid_get_state.xml
man/sd_watchdog_enabled.xml
man/systemd-id128.xml
man/systemd.network.xml
mkosi.conf.d/05-qemu-mem.conf
mkosi.conf.d/10-centos.conf
mkosi.conf.d/10-debian.conf
mkosi.conf.d/10-fedora.conf
mkosi.conf.d/10-opensuse.conf
mkosi.conf.d/10-systemd.conf
mkosi.conf.d/10-ubuntu.conf
mkosi.presets/base/mkosi.conf
mkosi.presets/initrd/mkosi.conf
mkosi.presets/system/mkosi.conf
shell-completion/bash/systemctl.in
src/basic/string-util.h
src/core/crash-handler.c
src/core/dbus-manager.c
src/core/main.c
src/fundamental/uki.c
src/id128/id128.c
src/journal/journalctl.c
src/journal/journald-server.c
src/libsystemd-network/dhcp-client-internal.h
src/libsystemd-network/dhcp-internal.h
src/libsystemd-network/dhcp-protocol.c [new file with mode: 0644]
src/libsystemd-network/dhcp-protocol.h
src/libsystemd-network/dhcp6-client-internal.h [new file with mode: 0644]
src/libsystemd-network/dhcp6-internal.h
src/libsystemd-network/fuzz-ndisc-rs.c
src/libsystemd-network/icmp6-util-unix.c [new file with mode: 0644]
src/libsystemd-network/icmp6-util-unix.h [new file with mode: 0644]
src/libsystemd-network/icmp6-util.c
src/libsystemd-network/icmp6-util.h
src/libsystemd-network/meson.build
src/libsystemd-network/ndisc-protocol.c [new file with mode: 0644]
src/libsystemd-network/ndisc-protocol.h [new file with mode: 0644]
src/libsystemd-network/ndisc-router.c
src/libsystemd-network/radv-internal.h
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd-network/sd-ndisc.c
src/libsystemd-network/sd-radv.c
src/libsystemd-network/test-ndisc-ra.c
src/libsystemd-network/test-ndisc-rs.c
src/libsystemd/libsystemd.sym
src/libsystemd/sd-id128/id128-util.c
src/libsystemd/sd-id128/id128-util.h
src/libsystemd/sd-id128/sd-id128.c
src/libsystemd/sd-journal/journal-file.c
src/login/loginctl.c
src/login/logind-dbus.c
src/network/meson.build
src/network/networkd-address-generation.c
src/network/networkd-dhcp-common.c
src/network/networkd-dhcp4-bus.c [new file with mode: 0644]
src/network/networkd-dhcp4-bus.h [new file with mode: 0644]
src/network/networkd-dhcp4.c
src/network/networkd-dhcp6-bus.c [new file with mode: 0644]
src/network/networkd-dhcp6-bus.h [new file with mode: 0644]
src/network/networkd-dhcp6.c
src/network/networkd-json.c
src/network/networkd-link-bus.c
src/network/networkd-link.h
src/network/networkd-manager-bus.c
src/network/networkd-ndisc.c
src/network/networkd-ndisc.h
src/network/networkd-network-gperf.gperf
src/network/networkd-network.h
src/network/networkd-radv.c
src/network/networkd-radv.h
src/nspawn/nspawn.c
src/partition/repart.c
src/shared/ask-password-api.c
src/shared/conf-parser.c
src/shared/format-table.c
src/shared/id128-print.c
src/shared/switch-root.c
src/shared/switch-root.h
src/shutdown/shutdown.c
src/systemctl/systemctl-start-unit.c
src/systemctl/systemctl-switch-root.c
src/systemd/sd-dhcp-client.h
src/systemd/sd-id128.h
src/systemd/sd-messages.h
src/systemd/sd-ndisc.h
src/systemd/sd-radv.h
src/test/test-id128.c
src/test/test-string-util.c
test/test-network/systemd-networkd-tests.py
test/units/testsuite-74.id128.sh
units/systemd-userdbd.service.in

index 93b7f2c2d1ea801a60cf0c77eccf92d7620ec442..16dcd30c082a76947bd12b223eca0055c29d8d80 100644 (file)
@@ -33,6 +33,6 @@ jobs:
     env: ${{ matrix.env }}
     steps:
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
       - name: ${{ format('Build check ({0}-{1}-{2}-{3})', env.COMPILER, env.COMPILER_VERSION, env.LINKER, env.CRYPTOLIB) }}
         run: sudo -E .github/workflows/build_test.sh
index ca1ccf7fea5ad033c452bf1762701c27a4180938..a7e4d2b84202ef1ffda6a3c54c690ffbb14b9103 100644 (file)
@@ -67,7 +67,7 @@ jobs:
           path: ./out/artifacts
       - name: Upload Sarif
         if: always() && steps.build.outcome == 'success'
-        uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
+        uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8
         with:
           # Path to SARIF file relative to the root of the repository
           sarif_file: cifuzz-sarif/results.sarif
index 82c64db687716abc005fd3d45fef8f2ea427aa1d..d66dcdc7e89127ebf1cec6a7bada0725de6dd8f0 100644 (file)
@@ -42,10 +42,10 @@ jobs:
 
     steps:
     - name: Checkout repository
-      uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+      uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
 
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
+      uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8
       with:
         languages: ${{ matrix.language }}
         config-file: ./.github/codeql-config.yml
@@ -53,7 +53,7 @@ jobs:
     - run: sudo -E .github/workflows/unit_tests.sh SETUP
 
     - name: Autobuild
-      uses: github/codeql-action/autobuild@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
+      uses: github/codeql-action/autobuild@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
+      uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8
index e9ba8d8b8697d01f3819be38f7fa586b33c1b5c8..05bf751924d54a8a85404eb8b8efa93b24ed6048 100644 (file)
@@ -22,7 +22,7 @@ jobs:
       COVERITY_SCAN_NOTIFICATION_EMAIL: "${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}"
     steps:
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
       # Reuse the setup phase of the unit test script to avoid code duplication
       - name: Install build dependencies
         run: sudo -E .github/workflows/unit_tests.sh SETUP
index 7566e4dabda2f21c36d3648aab28d27af93525cd..17065b24d27534f48a86c2002f64d9559f834f4e 100644 (file)
@@ -63,7 +63,7 @@ jobs:
             core.exportVariable('pr_number', pr_number);
 
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
         with:
           fetch-depth: 0
 
index 4b40d397a35853a6406a8f9a1766d8e0859aa880..1a3615360591cdda265cf1f2371b5ac386d55ad3 100644 (file)
@@ -23,7 +23,7 @@ jobs:
 
     steps:
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
         with:
           fetch-depth: 0
 
index 7ec5a8ec0bd7cea4f76c44027f4354ea3054f164..c85795cbb5f1b7d2b659056acb9ca47e9cc11d6d 100644 (file)
@@ -20,7 +20,7 @@ jobs:
 
     steps:
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
         with:
           fetch-depth: 0
 
index 1530e019843e0f08c0abd257090f62388111e503..e57ac70bcdbd0d161c775d63a20db7d354f371b7 100644 (file)
@@ -20,7 +20,7 @@ jobs:
         template: [ bug_report.yml, feature_request.yml ]
 
     steps:
-      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
 
       - name: Parse issue form
         uses: stefanbuck/github-issue-parser@c1a559d78bfb8dd05216dab9ffd2b91082ff5324
index bf1ba59b4c70d8f6cccaf088faedf5f9d461bd62..d1b363824e5fdadd147871012e264761a676b83a 100644 (file)
@@ -23,7 +23,7 @@ jobs:
 
     steps:
       - name: Repo checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
         with:
           # We need a full repo clone
           fetch-depth: 0
index d5f587f4ad7e5bc00b7157ea109c26be3b45edf7..c353423c5821eb4a9de6d98c5a72cbb424d1684e 100644 (file)
@@ -75,34 +75,45 @@ jobs:
       SYSTEMD_LOG_LEVEL: debug
 
     steps:
-    - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
-    - uses: systemd/mkosi@0af3f8a35c3be0e54b20234be7ab478d25bcc740
+    - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
+    - uses: systemd/mkosi@cb5974d013f7c4c2a45f67c9ae990767e32e9034
 
     - name: Configure
       run: |
+        # We configure ExtraSearchPaths=build/ so make sure build/ exists.
+        mkdir build/
+
         tee mkosi.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
 
-        [Output]
+        [Host]
         KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
                                systemd.journald.max_level_console=debug
                                # udev's debug log output is very verbose, so up it to info in CI.
                                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
-
-        [Host]
-        ExtraSearchPaths=!*
         QemuVsock=yes
         Ephemeral=yes
         EOF
 
+        # TODO: Remove once archlinux-keyring is updated in ppa:michel-slm/kernel-utils.
+        tee mkosi.conf.d/11-arch-keyring.conf <<- EOF
+        [Match]
+        Distribution=arch
+
+        [Distribution]
+        RepositoryKeyCheck=no
+        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.
 
index 15ee81d4cb2c6fd4fd4823b64b7ea8388a43e92c..d320b794882bc996c367a8fac7729e0b70806ee4 100644 (file)
@@ -1,6 +1,6 @@
-meson==1.2.0 \
-    --hash=sha256:10c0364edc67a1b3146f405800b300f0535f42b8736e79c744a8029a855b7c6b \
-    --hash=sha256:1c0b634fe6b6a7072e398647f1bf392048577068a5c92ae44d04085dab0ded6f
+meson==1.2.1 \
+    --hash=sha256:08f83fc17513e99cd6e82c7554c1f58af70425211887f8f9c7363b2a90209462 \
+    --hash=sha256:b1db3a153087549497ee52b1c938d2134e0338214fe14f7efd16fecd57b639f5
 ninja==1.11.1 \
     --hash=sha256:1c474326e11fba3f8c2582715d79216292e327d3335367c0e87e9647a002cc4a \
     --hash=sha256:3329b4b7c1694730772522a3ba0ba40fd15c012476ed3e1c9f0fd9e76190394e \
index b668d92368cdeab94fb4ac05b5aa08ce61b12b95..062a95af2faa99107cc943204cfde134f4e98306 100644 (file)
@@ -29,7 +29,7 @@ jobs:
 
     steps:
       - name: Checkout code
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
         with:
           persist-credentials: false
 
index 98747663eab7f04cf09965badd4ddb79d4cd4a27..051e8ec3bf66a469bbbe218af5375322ca52a814 100644 (file)
@@ -30,7 +30,7 @@ jobs:
             cryptolib: gcrypt
     steps:
       - name: Repository checkout
-        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
+        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
       - name: Install build dependencies
         run: |
           # Drop XDG_* stuff from /etc/environment, so we don't get the user
diff --git a/NEWS b/NEWS
index 3acbafc44af6a7dc50dbecee648c637553915de8..8ba35e5b3151bcaad39972a89a1576000af9ac62 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,10 @@ CHANGES WITH 255 in spe:
           by default when combined with --scope, will be changed in a future
           release to be enabled by default.
 
+        * "systemctl switch-root" is now restricted to initrd transtions only.
+          Transitions between real systems should be done with "systemctl soft-reboot"
+          instead.
+
         Device Management:
 
         * udev will now create symlinks to loopback block devices in the
diff --git a/TODO b/TODO
index eda525dc443dc8626386c312cff0292bf361b98e..4a258e50143c292664c8d0b7dd1537ed132c67a0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -274,11 +274,6 @@ Features:
   idea, and specifically works around the fact the autofs ignores busy by mount
   namespaces)
 
-* refuse using the switch-root operation without /etc/initrd-release. Now
-  that we have a concept of userspace reboot, we can clearly say: switch-root
-  is for transitioning from initrd to host (or initrd to next initrd), while
-  userspace reboot is for switching host to next version of the host.
-
 * mount most file systems with a restrictive uidmap. e.g. mount /usr/ with a
   uidmap that blocks out anything outside 0…1000 (i.e. system users) and similar.
 
@@ -315,6 +310,8 @@ Features:
   aforementioned journald subscription varlink service, to enable
   activation-by-message id and similar.
 
+* .service with invalid Sockets= starts successfully.
+
 * landlock: lock down RuntimeDirectory= via landlock, so that services lose
   ability to write anywehere else below /run/. Similar for
   StateDirectory=. Benefit would be clear delegation via unit files: services
index 4ffd6128b20da7572fddc39e7df8464e2f06679a..fd83d1e3dd730a04d10e909b24f197b37bd24125 100644 (file)
@@ -190,142 +190,149 @@ System factory reset has been initiated. The precise operation this
 executes is implementation-defined, but typically has the effect of
 reverting the system's state and configuration to vendor defaults.
 
---d9ec5e95e4b646aaaea2fd05214edbda
-Subject: Exiting PID 1...
+-- d9ec5e95e4b646aaaea2fd05214edbda
+Subject: Container init crashed
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
-When systemd crashes, we want to either freeze or exit or reboot.
-For containers we choose the option of exiting.
+Container init has crashed and exited.
 The details of the crash can be obtained from the container manager.
 
-To fix:
-Check the container manager for details.
-
 -- 3ed0163e868a4417ab8b9e210407a96c
-Subject: Failed to reboot
+Subject: System reboot failed after crash
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 Reboot has failed when systemd attempted to reboot after a crash.
 
 -- 645c735537634ae0a32b15a7c6cba7d4
-Subject: Freezing execution
+Subject: Init execution froze
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
-Freezing execution after fatal error.
+Systemd froze execution after fatal error.
 
 -- 5addb3a06a734d3396b794bf98fb2d01
-Subject: Caught <signal>, not dumping core
+Subject: Init received fatal signal while coredump is disabled
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
-In the instance of a crash arising from corrupted memory. The signal caught is propagated, but the core is not dumped.
+Systemd received fatal signal, but core dumping is disabled.
 
 -- 5c9e98de4ab94c6a9d04d0ad793bd903
-Subject: Caught <signal>, cannot fork for core dump
+Subject: Init received fatal signal but fork failed
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
+Systemd received fatal signal, but failed to fork to dump the core.
+
 -- 5e6f1f5e4db64a0eaee3368249d20b94
-Subject: Caught <signal> from unknown sender process
+Subject: Init received fatal signal from unknown sender process
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 83f84b35ee264f74a3896a9717af34cb
-Subject: Caught <signal> from our own process
+Subject: Init received fatal signal from our own process
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 3a73a98baf5b4b199929e3226c0be783
-Subject: Caught <signal> from <PID>
+Subject: Init received fatal signal from other process
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 2ed18d4f78ca47f0a9bc25271c26adb4
-Subject: Caught <signal>, waitpid() failed
+Subject: Init received fatal signal but waitpid() failed
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
+Systemd received fatal signal, but waitpid() failed when
+trying to dump the core.
+
 -- 56b1cd96f24246c5b607666fda952356
-Subject: Caught <signal>, coredump failed (child <PID>, code=<code>, status=<status>.
+Subject: Init received fatal signal but coredump failed
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 4ac7566d4d7548f4981f629a28f0f829
-Subject: Caught <signal>, dumped core as pid <PID>
+Subject: Init received fatal signal and dumped core
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 38e8b1e039ad469291b18b44c553a5b7
-Subject: Failed to fork off crash shell
-
+Subject: Init failed to fork crash shell
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
+Systemd crashed and failed to fork off crash shell.
+
 -- 872729b47dbe473eb768ccecd477beda
-Subject: execle() failed
+Subject: Crash shell failed to execute
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
+Systemd crashed and failed to spawn crash shell.
+
 -- 658a67adc1c940b3b3316e7e8628834a
-Subject: Failed to load SELinux policy.
+Subject: Manager failed to load SELinux policy
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- e6f456bd92004d9580160b2207555186
-Subject: Battery level critically low. Please connect your charger or the system will power off in 10 seconds.
+Subject: Battery level critically low, waiting for charger
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
+Battery level is critically low. Please connect your charger
+or the system will power off in 10 seconds.
+
 -- 267437d33fdd41099ad76221cc24a335
-Subject: Battery level critically low, powering off.
+Subject: Battery level critically low, powering off
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 79e05b67bc4545d1922fe47107ee60c5
-Subject: Failed to run main loop
+Subject: Manager failed to run main loop
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- dbb136b10ef4457ba47a795d62f108c9
-Subject: Failed to determine <XDG_DIR> path
+Subject: User manager failed to determine $XDG_RUNTIME_DIR path
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- ed158c2df8884fa584eead2d902c1032
-Subject: Failed to drop capability bounding set of usermode helpers
+Subject: Init failed to drop capability bounding set of usermode helpers
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 42695b500df048298bee37159caa9f2e
-Subject: Failed to drop capability bounding set
+Subject: Init failed to drop capability bounding set
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- bfc2430724ab44499735b4f94cca9295
-Subject: Failed to disable new privileges
+Subject: User manager failed to disable new privileges
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 59288af523be43a28d494e41e26e4510
-Subject: Failed to start default target <target>
+Subject: Manager failed to start default target
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 689b4fcc97b4486ea5da92db69c9e314
-Subject: Failed to isolate default target <target>
+Subject: Manager failed to isolate default target
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 5ed836f1766f4a8a9fc5da45aae23b29
-Subject: Failed to allocate fd set
+Subject: Manager failed to collect passed file descriptors
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- 6a40fbfbd2ba4b8db02fb40c9cd090d7
-Subject: Failed to fix up PID1 environment
+Subject: Init failed to fix up environment variables
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
@@ -335,7 +342,7 @@ Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- d67fa9f847aa4b048a2ae33535331adb
-Subject: Failed to write Smack onlycap list
+Subject: Manager failed to write Smack onlycap list
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
@@ -345,7 +352,7 @@ Defined-By: systemd
 Support: %SUPPORT_URL%
 
 -- d18e0339efb24a068d9c1060221048c2
-Subject: Failed to fork off valgrind helper
+Subject: Init failed to fork off valgrind helper
 Defined-By: systemd
 Support: %SUPPORT_URL%
 
index 6bcf2cba4a543a8726d5bc24f450f0a8fdb01bae..c757f83f19cf914cae057889465681d354c96905 100644 (file)
@@ -926,6 +926,12 @@ sensor:modalias:acpi:SMO8500*:dmi:*:svnProwise:pnPT301:*
 sensor:modalias:acpi:SMO8500*:dmi:*:rvnReeder:rnA8iW-Rev.A:*
  ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
 
+#########################################
+# RCA
+#########################################
+sensor:modalias:acpi:KIOX000A*:dmi:*:svnRCA:pnW101SA23T1:*
+ ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
+
 #########################################
 # Schneider
 #########################################
index eaaf4adb1bd1cdde8cd7e467d7937b9e6095a919..2884cc32b41a0911b24e0af0a1c91886a669ff3e 100644 (file)
@@ -672,7 +672,8 @@ manpages = [
   ''],
  ['sd_id128_get_machine',
   '3',
-  ['sd_id128_get_boot',
+  ['sd_id128_get_app_specific',
+   'sd_id128_get_boot',
    'sd_id128_get_boot_app_specific',
    'sd_id128_get_invocation',
    'sd_id128_get_machine_app_specific'],
index 245bfbb4d39450532fd2f30c637cdffdceb6b465..f429ed3c7f0ee194bde1ff67f2f8ee630755c87b 100644 (file)
@@ -267,6 +267,17 @@ int main(int argc, char **argv) {
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_id128_equal()</function> was added in version 252.</para>
+    <para><function>sd_id128_in_set()</function> was added in version 252.</para>
+    <para><function>sd_id128_in_set_sentinel()</function> was added in version 252.</para>
+    <para><function>sd_id128_in_setv()</function> was added in version 252.</para>
+    <para><function>sd_id128_is_allf()</function> was added in version 252.</para>
+    <para><function>sd_id128_is_null()</function> was added in version 252.</para>
+    <para><function>sd_id128_string_equal()</function> was added in version 252.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index 1ab1c0f5171f9db985c3e683c9fd223aac9ade1b..80fc849485f3a8c0b064b33ca752b0d1db50fef3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_add_match()</function> was added in version 231.</para>
+    <para><function>sd_bus_add_match_async()</function> was added in version 237.</para>
+    <para><function>sd_bus_match_signal()</function> was added in version 237.</para>
+    <para><function>sd_bus_match_signal_async()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index fd793294d896ec1a97178c40f91b2c39fa4c8133..8afa0435a390be7fef42dc7469207be1a95e1ce5 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_add_node_enumerator()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 702bbb0f6b2a0566493d5dc57e887b99ae573104..c757f80912d617b05720fcd8df211b79883eedec 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_add_fallback()</function> was added in version 246.</para>
+    <para><function>sd_bus_add_fallback_vtable()</function> was added in version 246.</para>
+    <para><function>sd_bus_add_filter()</function> was added in version 246.</para>
+    <para><function>sd_bus_add_object()</function> was added in version 246.</para>
+    <para><function>sd_bus_add_object_vtable()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e178be996676fb761a54fa82c203e832b21fd585..e5f410b0e24d88c131811de03a01d668dc08fd8f 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_add_object_manager()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ba3e58c25dcd6f1fba7151e01ef056cb8730b767..42b5572411d6478beb1a86fe5b377df3a11689b3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_attach_event()</function> was added in version 240.</para>
+    <para><function>sd_bus_detach_event()</function> was added in version 240.</para>
+    <para><function>sd_bus_get_event()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ee8104deb4b73ee950c82786d771830c97c9c60b..862f65526db3758319f5f0129122e3770df010e1 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_call()</function> was added in version 246.</para>
+    <para><function>sd_bus_call_async()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7b525558d70c26df4be3aebcde929116c8f8baa1..9fce59074c6c71f30fef986a5bb55fe2e71e22cb 100644 (file)
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_call_method()</function> was added in version 246.</para>
+    <para><function>sd_bus_call_method_async()</function> was added in version 246.</para>
+    <para><function>sd_bus_call_method_asyncv()</function> was added in version 246.</para>
+    <para><function>sd_bus_call_methodv()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c7397629bb800cee13aa94f2d036354d5202594b..321b19d9ff3243eec3085687043ed9e8743f1a1e 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_can_send()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index dab1d77336692a5c5bdc09c8bac799c14a8c4a13..7ad2b5a29e34251b592d49bb93259ff3a645905b 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_close()</function> was added in version 240.</para>
+    <para><function>sd_bus_flush()</function> was added in version 240.</para>
+    <para><function>sd_bus_default_flush_close()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 56cfa4efa579778a571f45f349cf3292fedd7395..5346c013098a2aa3e5050f56f4b5c17eb41b82a8 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_creds_get_audit_login_uid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_audit_session_id()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_cgroup()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_cmdline()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_comm()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_exe()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_gid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_owner_uid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_pid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_selinux_context()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_session()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_slice()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_tid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_tid_comm()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_unique_name()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_unit()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_user_unit()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_well_known_names()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_has_bounding_cap()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_has_effective_cap()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_has_inheritable_cap()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_has_permitted_cap()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_description()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_egid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_euid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_fsgid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_fsuid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_ppid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_sgid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_suid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_supplementary_gids()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_tty()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_uid()</function> was added in version 220.</para>
+    <para><function>sd_bus_creds_get_user_slice()</function> was added in version 223.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ea3acc447e9a5851f6d97df5af455478d8d12b0b..5d77fe1891366d5a0c8ce975570cf42e89f760df 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_creds_get_mask()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_new_from_pid()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_ref()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_unref()</function> was added in version 209.</para>
+    <para><function>sd_bus_creds_get_augmented_mask()</function> was added in version 223.</para>
+    <para><function>sd_bus_creds_unrefp()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index a5f0ffb67faaf89cd93e580806f92f6fee0ba0e1..989af699661b13771ef0e42b587a4c709ae7fc69 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_default()</function> was added in version 220.</para>
+    <para><function>sd_bus_default_system()</function> was added in version 220.</para>
+    <para><function>sd_bus_default_user()</function> was added in version 220.</para>
+    <para><function>sd_bus_open()</function> was added in version 220.</para>
+    <para><function>sd_bus_open_system()</function> was added in version 220.</para>
+    <para><function>sd_bus_open_system_machine()</function> was added in version 220.</para>
+    <para><function>sd_bus_open_system_remote()</function> was added in version 220.</para>
+    <para><function>sd_bus_open_user()</function> was added in version 220.</para>
+    <para><function>sd_bus_open_system_with_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_open_user_with_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_open_with_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_open_user_machine()</function> was added in version 248.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 865120656e7635fadbf2d88009daf62291408fd9..634feb2693b4a6c6cae54326ea29254b5a1cea5a 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_emit_interfaces_added()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_interfaces_added_strv()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_interfaces_removed()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_interfaces_removed_strv()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_object_added()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_object_removed()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_properties_changed()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_properties_changed_strv()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_signal()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_signalv()</function> was added in version 246.</para>
+    <para><function>sd_bus_emit_signal_to()</function> was added in version 253.</para>
+    <para><function>sd_bus_emit_signal_tov()</function> was added in version 253.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 782271ccf12b33a304c0114bba0d1088b962d39d..dac32a07ec4ef9bebfc99264b2807d6c75b15cce 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_enqueue_for_read()</function> was added in version 245.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index b2f62f2fa09af5f1b0240939a195a14b36a6618d..25d55ebffe3e8e7427504b143bfdd0b99b0e4a00 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_error_copy()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_free()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_get_errno()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_has_name()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_is_set()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_set()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_set_const()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_set_errno()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_set_errnof()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_setf()</function> was added in version 209.</para>
+    <para><function>sd_bus_error_set_errnofv()</function> was added in version 223.</para>
+    <para><function>sd_bus_error_move()</function> was added in version 240.</para>
+    <para><function>sd_bus_error_has_names_sentinel()</function> was added in version 247.</para>
+    <para><function>sd_bus_error_setfv()</function> was added in version 252.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index a49b554459a97738ba2b1e9bed9a469e3008ec5e..55360d0c285440b3b060a972312a8c0dbd9f31b3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_error_add_map()</function> was added in version 223.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c3756b83e0791ed1b8fbc9ed070c28755cc89141..87e6e084a87c3830c6598b10650f60c72bdd0da6 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_current_handler()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_current_message()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_current_slot()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_current_userdata()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6484761a0d158806731b24e7117d2a5b6c3b00d0..5dfdbcd5e141d2aac1206c508cee0d691efbb259 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_fd()</function> was added in version 231.</para>
+    <para><function>sd_bus_get_events()</function> was added in version 240.</para>
+    <para><function>sd_bus_get_timeout()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 39476463b2eac53d2e8f1d57cb07b9a55fdc4296..7f647558e5d35185e0dcb7745d9588c613d421a2 100644 (file)
     </refsect2>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_n_queued_read()</function> was added in version 238.</para>
+    <para><function>sd_bus_get_n_queued_write()</function> was added in version 238.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7ebe58c17b9b7ac42142e03fe43ddd9cf2818d88..18fb49a453339d6da8373da01255f666c77bbbee 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_name_creds()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_owner_creds()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index f0478742bd9fb4a24cee2316dca23b4a6f72523f..64019c985641ca7b5887ad2829068f210caae0a0 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_name_machine_id()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index f234ce72f668b8985fd945d661609da68223a6be..772e75913ba839ad1c2e1fe3b0e5e9f4ad2e7080 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_interface_name_is_valid()</function> was added in version 246.</para>
+    <para><function>sd_bus_member_name_is_valid()</function> was added in version 246.</para>
+    <para><function>sd_bus_object_path_is_valid()</function> was added in version 246.</para>
+    <para><function>sd_bus_service_name_is_valid()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 8f6b3bcba1a7a50202d55e0a6b9bc062656137aa..07d1e9b59f912d02c7241e247f305f0e18cf9b87 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_is_open()</function> was added in version 237.</para>
+    <para><function>sd_bus_is_ready()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 62a28045c7e855ea45baeb19edd32963a94ae32b..77cd477a94171e2e51919ee28aa18058235beb50 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_list_names()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index da3343d960676b40a7c828624c5fd3cf2330927f..cb5bba6b1e4a3e4d161f170322161fc0c2c22615 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_at_end()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 148bda5feb099bd43dc67fe4176b684b44c16497..3dcabe9fab98aa87a872a0c26e0fa175b954bfec 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_cookie()</function> was added in version 209.</para>
+    <para><function>sd_bus_message_get_reply_cookie()</function> was added in version 209.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 605e2b4afe760cd7d2bf5ce5bae465099602a2e7..d34ac0cd33fd77effcb377a66241bc41d65db4a8 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_monotonic_usec()</function> was added in version 209.</para>
+    <para><function>sd_bus_message_get_realtime_usec()</function> was added in version 209.</para>
+    <para><function>sd_bus_message_get_seqnum()</function> was added in version 209.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 203145bcdd007974502d35cc35ecb3d52d9e8147..9f2028fbadf6f6bac088e581c29c0c9e695e7037 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_signature()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_has_signature()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_is_empty()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index dd86316832fd8def38426ac4a1eac2b073fcb376..2fabb17ca017984c5c97f31e8c9340f5ba83d089 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_type()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_is_method_call()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_is_method_error()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_is_signal()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_creds()</function> was added in version 246.</para>
+    <para><function>sd_bus_message_get_errno()</function> was added in version 246.</para>
+    <para><function>sd_bus_message_get_error()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c56df615a6b0019b9efc037b5de2b7815ffcd905..98b18e52f0d87f6cf01e0ef9af4e5dfe0a985bf2 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_bus()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_new()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_ref()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_unref()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_unrefp()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index f6278e3c738e742ced2b48efb6e8b0fe8dd55997..29666daa6ca820db136e6a2b65d423718e784992 100644 (file)
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_new_method_call()</function> was added in version 246.</para>
+    <para><function>sd_bus_message_new_method_return()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 9f75478e8d20b83249c9c90936d5a70d6bf09413..b00164b063d3b41d5fa1b9774575888e1a4ce798 100644 (file)
@@ -261,6 +261,13 @@ sd_bus_message_read(m, "h", &amp;fd);
 fd_copy = fcntl(fd, FD_DUPFD_CLOEXEC, 3);</programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_read()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_readv()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_peek_type()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index daff9097da9591ea7b941ec692fa8ebd5bbb36f9..1feec20781c33a401aefd3e51812647cda371e04 100644 (file)
     </refsect2>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_read_array()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c78f949147701943c446570acb7a9bc8f7826821..9619e2bd7fada7c5540cf2aa61291a7e72586d94 100644 (file)
     </refsect2>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_read_basic()</function> was added in version 231.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index a88dab9fd2c0d2b2ee156e5e1058c5f2ffb582be..6e23f6c927ae66e42aa07bdc6a6f275c8b59d520 100644 (file)
     </refsect2>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_read_strv()</function> was added in version 246.</para>
+    <para><function>sd_bus_message_read_strv_extend()</function> was added in version 252.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 5640d2821a3f478a509239c2568c87b31fc4613f..78f1bbcb70b33380028f8227832b0335e428cb94 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_rewind()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ced9f9773ad5217cb4ff65c85f4dbdae21c5c195..6c4b1f1b24351a86897b8351d9fc50df8013010c 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_seal()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7822ee87be73781c2bf8ca2c62421f74d67ef746..ff15a4a26de3955a327ac999b06e3400cc266257 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_sensitive()</function> was added in version 245.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6308b5e23c98bc90dcd8500e3aa7ed4f23f9ca4f..85ba88be3c96e5cd2dd073631de75a787b11b3e1 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_set_destination()</function> was added in version 237.</para>
+    <para><function>sd_bus_message_set_sender()</function> was added in version 237.</para>
+    <para><function>sd_bus_message_get_destination()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_interface()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_member()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_path()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_sender()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index dccb99ad8104029dda5975961a5ba3e228126469..97438ee572a90b66ff0137ca7769518f01a9922c 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_get_auto_start()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_expect_reply()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_set_auto_start()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_set_expect_reply()</function> was added in version 240.</para>
+    <para><function>sd_bus_message_get_allow_interactive_authorization()</function> was added in version 246.</para>
+    <para><function>sd_bus_message_set_allow_interactive_authorization()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7a227c4a2779a80ac264418ffdcc8b2763bc29dd..e10c9695d6e1793c2b5f7ce6a7b13d3eaa478912 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_message_skip()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e88ef4a657ce068ebe9c26d313f20f8d42eefaf3..fa02c1bd88e7ccde41a2bcb1741dbbc43f2b47ff 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_negotiate_creds()</function> was added in version 212.</para>
+    <para><function>sd_bus_negotiate_fds()</function> was added in version 212.</para>
+    <para><function>sd_bus_negotiate_timestamp()</function> was added in version 212.</para>
+    <para><function>sd_bus_get_creds_mask()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index b45106168c58a974e1fe9487bdb63ddf7aa45040..1b4004786d19bc5c1a17604742083c0bb2d3471c 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_new()</function> was added in version 209.</para>
+    <para><function>sd_bus_ref()</function> was added in version 209.</para>
+    <para><function>sd_bus_unref()</function> was added in version 209.</para>
+    <para><function>sd_bus_unrefp()</function> was added in version 229.</para>
+    <para><function>sd_bus_flush_close_unref()</function> was added in version 240.</para>
+    <para><function>sd_bus_flush_close_unrefp()</function> was added in version 240.</para>
+    <para><function>sd_bus_close_unref()</function> was added in version 241.</para>
+    <para><function>sd_bus_close_unrefp()</function> was added in version 241.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 5cdb1d77a1dd6892783bba461d44f5cfe65a0d99..f116c27fbb088d700d4cdac3c93d30511e5bbbaa 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_path_decode()</function> was added in version 211.</para>
+    <para><function>sd_bus_path_encode()</function> was added in version 211.</para>
+    <para><function>sd_bus_path_decode_many()</function> was added in version 227.</para>
+    <para><function>sd_bus_path_encode_many()</function> was added in version 227.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 193c16c6a5d456d25ae495d534e139f5a267a0a7..f16b30ec6c94098ac012eccaaa2f5b37f680519d 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_process()</function> was added in version 231.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index f6aa1d11e6d537ff829524a085cca9816ce1bb69..63effb2367bf41cdb41b63fb09fb0b93b9058dd1 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_query_sender_creds()</function> was added in version 246.</para>
+    <para><function>sd_bus_query_sender_privilege()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 64b1dcd41167b955d62ffa6508bc55a55de0faf1..c6fb84a9aa0cc819e2a2250535e268556dc328a3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_release_name()</function> was added in version 209.</para>
+    <para><function>sd_bus_request_name()</function> was added in version 209.</para>
+    <para><function>sd_bus_release_name_async()</function> was added in version 237.</para>
+    <para><function>sd_bus_request_name_async()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7088d67299573773c1f35b173f1e7e15c9863a38..164ff79cd93df856716fad52c6fd7201c4dc054d 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_send()</function> was added in version 246.</para>
+    <para><function>sd_bus_send_to()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 615d1f5d19d20d59c5671f540c7571363634df25..38106f0104321a7a1d66812368bdd55e9515e720 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_address()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_address()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_exec()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 5ee34a934aea01ff020968e17d79cd317144336a..099846b38f198bd89e77a02a4bcc394a3a3ec799 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_close_on_exit()</function> was added in version 240.</para>
+    <para><function>sd_bus_set_close_on_exit()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 09dcb5978a1b4aa2b9c346caa03c5a7683704ac3..84ee520c553f7886264ed9e98a58b80ef0e5ccf7 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_connected_signal()</function> was added in version 237.</para>
+    <para><function>sd_bus_set_connected_signal()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index dda54f4ebfe07508ec11f199836ffd8200d9547d..2978b21c66fc82b1fcd9f52270c2a56da6e58ff0 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_allow_interactive_authorization()</function> was added in version 240.</para>
+    <para><function>sd_bus_get_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_set_allow_interactive_authorization()</function> was added in version 240.</para>
+    <para><function>sd_bus_set_anonymous()</function> was added in version 240.</para>
+    <para><function>sd_bus_set_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_set_trusted()</function> was added in version 240.</para>
+    <para><function>sd_bus_get_scope()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_tid()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_unique_name()</function> was added in version 246.</para>
+    <para><function>sd_bus_is_anonymous()</function> was added in version 246.</para>
+    <para><function>sd_bus_is_trusted()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6d2092601b9408e5f295bc8be4da3f06913e83fe..36cc490513d19a825e8c908bcf2346db69d28231 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_exit_on_disconnect()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_exit_on_disconnect()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3479d117fb69d9c8b8c7ec88fa0c52c5a2e253a1..d05ed27bdb89299ea88a0a8e17522453cb81ffcc 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_set_fd()</function> was added in version 248.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 1dec4ca62a572546ca8833504f911780bde0b55e..06f579bdf9d82a06265b2a6edebcf4d60f72243c 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_method_call_timeout()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_method_call_timeout()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index d6a410e797ca135576e9584280f9f6e4e4e326d7..ae5b253cd63c35665c95472ca9e487fa53736673 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_property()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_property_string()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_property_strv()</function> was added in version 246.</para>
+    <para><function>sd_bus_get_property_trivial()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_property()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_propertyv()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2aedbfc01a2e8fd3ece4e1d1599c0c48d03264fb..dc157e372f30b3a9fc2b450f8f77bc21de5e19c4 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_sender()</function> was added in version 237.</para>
+    <para><function>sd_bus_set_sender()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 36c4933fad427dc6d0a99c21b67ccf9f3015d6b2..f67e8607c79aeb481778d1f46e75ce3c67effeeb 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_bus_id()</function> was added in version 246.</para>
+    <para><function>sd_bus_is_bus_client()</function> was added in version 246.</para>
+    <para><function>sd_bus_is_monitor()</function> was added in version 246.</para>
+    <para><function>sd_bus_is_server()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_bus_client()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_monitor()</function> was added in version 246.</para>
+    <para><function>sd_bus_set_server()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 123cef48a678312fa412bd4ec169d21e9bd97fe9..03a4f2db239a13b23954f5283fb93e0cdde5e71b 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_get_watch_bind()</function> was added in version 237.</para>
+    <para><function>sd_bus_set_watch_bind()</function> was added in version 237.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 48400ad15a5708d3c99903364588ebf90a07d2b4..a6c91c7014cbe636d2d8c9b22acb485482e6a827 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_get_bus()</function> was added in version 246.</para>
+    <para><function>sd_bus_slot_get_current_handler()</function> was added in version 246.</para>
+    <para><function>sd_bus_slot_get_current_message()</function> was added in version 246.</para>
+    <para><function>sd_bus_slot_get_current_userdata()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 8ada3cbcf1ca389fa01cbc1f787d234b661d6ff0..1923b1e015ec50de03c31647679bee3dee937f4f 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_ref()</function> was added in version 240.</para>
+    <para><function>sd_bus_slot_unref()</function> was added in version 240.</para>
+    <para><function>sd_bus_slot_unrefp()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 4a8df0cc48eece40a87f9b8db993d536de057c2f..9f4f6b57daa895308937c26b5982a54cd1b08c48 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_get_description()</function> was added in version 240.</para>
+    <para><function>sd_bus_slot_set_description()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 4de77d2baad3fe14706687f9bceed7a9edaddd6e..f33e2238e4746c436253255ec298af7227712737 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_get_destroy_callback()</function> was added in version 239.</para>
+    <para><function>sd_bus_slot_set_destroy_callback()</function> was added in version 239.</para>
+    <para><function>sd_bus_track_get_destroy_callback()</function> was added in version 239.</para>
+    <para><function>sd_bus_track_set_destroy_callback()</function> was added in version 239.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3309147847e1f9cfb70ac08ae7e233c118b88cd3..649c645c827a8f1139da964ac5390f4eb5f38c35 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_get_floating()</function> was added in version 239.</para>
+    <para><function>sd_bus_slot_set_floating()</function> was added in version 239.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 9fa5f3a97838a746f65d664df6508c4314cf27a8..8a1fa9e5ac9b825c396f90005de0ca0b893358ed 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_slot_get_userdata()</function> was added in version 240.</para>
+    <para><function>sd_bus_slot_set_userdata()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 824f0700821a1557e44b3ebb93781520d09fe592..bf693ced02ad4cefc73b4c354afad19e61a5e956 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_start()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ae90e4488230c533b704ad6d9ee30344033033b6..393e5a2132398c4f0d6d379f2fe238b7647cc886 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_track_add_name()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_add_sender()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_contains()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_count()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_count_name()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_count_sender()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_first()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_next()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_remove_name()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_remove_sender()</function> was added in version 232.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2147ad16dd0350b1e984094bbf36bdc4e9b949e6..80133ce35c74b13aca8230d35e7e80b64b27724d 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_track_get_bus()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_get_recursive()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_get_userdata()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_new()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_ref()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_set_recursive()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_set_userdata()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_unref()</function> was added in version 232.</para>
+    <para><function>sd_bus_track_unrefp()</function> was added in version 232.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3c24a6f0a915c40e77b6f6b156ca864876b6d832..04dd0907f951b4dbafe50ca01a0c112e84e3862f 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_bus_wait()</function> was added in version 240.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e78f5db657d0140d5ba686062d0670c25f1b6b8f..73e466700986bb89716fc8753a796e98505243e8 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_device_get_devname()</function> was added in version 251.</para>
+    <para><function>sd_device_get_devnum()</function> was added in version 251.</para>
+    <para><function>sd_device_get_devpath()</function> was added in version 251.</para>
+    <para><function>sd_device_get_devtype()</function> was added in version 251.</para>
+    <para><function>sd_device_get_diskseq()</function> was added in version 251.</para>
+    <para><function>sd_device_get_driver()</function> was added in version 251.</para>
+    <para><function>sd_device_get_ifindex()</function> was added in version 251.</para>
+    <para><function>sd_device_get_subsystem()</function> was added in version 251.</para>
+    <para><function>sd_device_get_sysname()</function> was added in version 251.</para>
+    <para><function>sd_device_get_sysnum()</function> was added in version 251.</para>
+    <para><function>sd_device_get_syspath()</function> was added in version 251.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2b8512a57288e31c9f3228f482c5787804a5f52d..a927f51eba2b5ef9a8cf65a409f35da87b176196 100644 (file)
     <function>sd_device_unref()</function> always returns <constant>NULL</constant>.
     </para>
   </refsect1>
+<refsect1>
+    <title>History</title>
+    <para><function>sd_device_ref()</function> was added in version 251.</para>
+    <para><function>sd_device_unref()</function> was added in version 251.</para>
+    <para><function>sd_device_unrefp()</function> was added in version 251.</para>
+  </refsect1>
 </refentry>
index 5977290a0b7bbe5bb07fdb0642a19e02027da2eb..5b51248a4fc94c63e2b320f7b0e419ee3207f98a 100644 (file)
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_child()</function> was added in version 217.</para>
+    <para><function>sd_event_source_get_child_pid()</function> was added in version 217.</para>
+    <para><function>sd_event_add_child_pidfd()</function> was added in version 245.</para>
+    <para><function>sd_event_source_get_child_pidfd()</function> was added in version 245.</para>
+    <para><function>sd_event_source_get_child_pidfd_own()</function> was added in version 245.</para>
+    <para><function>sd_event_source_get_child_process_own()</function> was added in version 245.</para>
+    <para><function>sd_event_source_send_child_signal()</function> was added in version 245.</para>
+    <para><function>sd_event_source_set_child_pidfd_own()</function> was added in version 245.</para>
+    <para><function>sd_event_source_set_child_process_own()</function> was added in version 245.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3bac5d53d424baeea4f11a18686dc2ec59ae7368..671f4d961b380be7d30b89ccaf4b5a51696c51a9 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_defer()</function> was added in version 217.</para>
+    <para><function>sd_event_add_exit()</function> was added in version 217.</para>
+    <para><function>sd_event_add_post()</function> was added in version 217.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c8eebe6a709bd2e3099e26ea2a104ecde5bbd289..7e5bf948e2f137e6bd3e1b25ae2773b2f0a47762 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_inotify()</function> was added in version 239.</para>
+    <para><function>sd_event_source_get_inotify_mask()</function> was added in version 239.</para>
+    <para><function>sd_event_add_inotify_fd()</function> was added in version 250.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e67135edb20bc8913236636fdb054cfcbc0b7818..eb6d6c6ae9ee5c10eb458b06e49d4a65b24a6e2a 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_io()</function> was added in version 229.</para>
+    <para><function>sd_event_source_get_io_events()</function> was added in version 229.</para>
+    <para><function>sd_event_source_get_io_fd()</function> was added in version 229.</para>
+    <para><function>sd_event_source_get_io_revents()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_io_events()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_io_fd()</function> was added in version 229.</para>
+    <para><function>sd_event_source_get_io_fd_own()</function> was added in version 239.</para>
+    <para><function>sd_event_source_set_io_fd_own()</function> was added in version 239.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 20da8fdbb3b88e2ba3cf5a1ff1f33d8a3088ca81..4ac123edb2ddd012b54adf0efaedf6136da96297 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_memory_pressure()</function> was added in version 254.</para>
+    <para><function>sd_event_source_set_memory_pressure_period()</function> was added in version 254.</para>
+    <para><function>sd_event_source_set_memory_pressure_type()</function> was added in version 254.</para>
+    <para><function>sd_event_trim_memory()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 29a782397404d3d68f6e1153950feb0f84b1b963..7a7619f2f17b896523f22df5dc4a6055bbba0df2 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_signal()</function> was added in version 217.</para>
+    <para><function>sd_event_source_get_signal()</function> was added in version 217.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2cb48d8cea5b0bab2ff6a67301354e3bba2942ba..e11d742506951388cf8c8f68d428ef4e09a49a08 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_add_time()</function> was added in version 213.</para>
+    <para><function>sd_event_source_get_time()</function> was added in version 213.</para>
+    <para><function>sd_event_source_get_time_accuracy()</function> was added in version 213.</para>
+    <para><function>sd_event_source_get_time_clock()</function> was added in version 213.</para>
+    <para><function>sd_event_source_set_time()</function> was added in version 213.</para>
+    <para><function>sd_event_source_set_time_accuracy()</function> was added in version 213.</para>
+    <para><function>sd_event_add_time_relative()</function> was added in version 247.</para>
+    <para><function>sd_event_source_set_time_relative()</function> was added in version 247.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 343dd9066e148d30cf2e16b0165525ed95df489d..50783743c380039b1e3b2607bf3437ada19a083c 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_exit()</function> was added in version 229.</para>
+    <para><function>sd_event_get_exit_code()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 698691fa0d200f96bf6d8c42a3b3ec73b631b266..e68b688aff69f277a55e2a72519df85c0829ebaf 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_get_fd()</function> was added in version 217.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 8a105a764b7119585b5ec872e614060fdc9fa3eb..604e02593d48d31fc9cf6b19e60593b6ab16907f 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_default()</function> was added in version 213.</para>
+    <para><function>sd_event_new()</function> was added in version 213.</para>
+    <para><function>sd_event_ref()</function> was added in version 213.</para>
+    <para><function>sd_event_unref()</function> was added in version 213.</para>
+    <para><function>sd_event_get_tid()</function> was added in version 229.</para>
+    <para><function>sd_event_unrefp()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 45037d13b25468022f6c2e0e783cf3d4056eaeeb..100d39a8f68b3de5422afb785aa569ac051bc9f3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_now()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index c30f5eb4c231d2c073df52ed83af6e50cd2ab889..fd17536991a54b34b9db8a6fdb8d99a9202047bb 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_loop()</function> was added in version 220.</para>
+    <para><function>sd_event_run()</function> was added in version 220.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3a343f5f1647df336572b9cad6a317e037b2363c..7c741ad3bb823bc3f7258024b0f9d4b80ffedaf1 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_set_signal_exit()</function> was added in version 252.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 954a1366cf6dfda90bbf5cf4a762058242e16910..99f9869dd68fd47748ce6b288f3dc7cf7912e5b6 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_get_watchdog()</function> was added in version 229.</para>
+    <para><function>sd_event_set_watchdog()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index a850583100eafae6f967e74ebdbce83eb9f6536f..50d3a9bcbc816699072a1dc92e2401a0ffbf06dd 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_event()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 7521ba6420c0e57bdea3114b76a5c6bb953e7f23..62b718b79d8d2c8470084b70f7a97dfe6c6f291a 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_pending()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 9ad369817f87fa795312d2bf6201aa58ccb25c42..5565ac3973c92538b6f392cd95c23ce539e37279 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_description()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_description()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 4e39f21020d053b1519523bd680d7768f0f89039..1220b79b1c80943eded1f1308556b8e7b9e35088 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_destroy_callback()</function> was added in version 239.</para>
+    <para><function>sd_event_source_set_destroy_callback()</function> was added in version 239.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index cab8667f0fe5c5e0669969b05f3d6350c38756b5..ac595f491ac52e294e280c2c2c7d004e84af99e4 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_enabled()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_enabled()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index fbdb71ba73325e928de972986df9e7e43ca73115..14be1159816da884f3d962eccf447fc7315332f9 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_exit_on_failure()</function> was added in version 247.</para>
+    <para><function>sd_event_source_set_exit_on_failure()</function> was added in version 247.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 1d038bd6ea7e19cff1b25c69c36d944d669e253c..0b9630ffc9016660d54a8c8f504c62b488ebdee9 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_floating()</function> was added in version 244.</para>
+    <para><function>sd_event_source_set_floating()</function> was added in version 244.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e7526a9ff5aa51083a50f234c18879be51827122..3b7b2a943225358ea4595754bd4f871fe051d05b 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_set_prepare()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6cc643822b3b92dc473e11fb5c9925deaabd0b5c..023c6b13694b0afe0b857ee78cc08a56044798ee 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_priority()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_priority()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index dc818bd57118e93208323a670bcc3cb28f3a732c..ff2362cf213eb6f1c4cae6f6eb65bdae73e28968 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_ratelimit()</function> was added in version 248.</para>
+    <para><function>sd_event_source_is_ratelimited()</function> was added in version 248.</para>
+    <para><function>sd_event_source_set_ratelimit()</function> was added in version 248.</para>
+    <para><function>sd_event_source_set_ratelimit_expire_callback()</function> was added in version 250.</para>
+    <para><function>sd_event_source_leave_ratelimit()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e8e5dc144486b79aacc3015b68a26c8b9639509a..9489104adf00eed548eb27c65cc006c384ac4109 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_get_userdata()</function> was added in version 229.</para>
+    <para><function>sd_event_source_set_userdata()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index b626e4cf4a7d25f0661092a3ed5d42c16764f12e..64a379443400e2ad09de4c0ffa6754b84287c8a7 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_source_ref()</function> was added in version 229.</para>
+    <para><function>sd_event_source_unref()</function> was added in version 229.</para>
+    <para><function>sd_event_source_unrefp()</function> was added in version 229.</para>
+    <para><function>sd_event_source_disable_unref()</function> was added in version 243.</para>
+    <para><function>sd_event_source_disable_unrefp()</function> was added in version 243.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6787a63f6f49b0327b9476479ac0711ef4dd8787..523aa4252144b8e387572c49745682306f24ff03 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_event_dispatch()</function> was added in version 220.</para>
+    <para><function>sd_event_prepare()</function> was added in version 220.</para>
+    <para><function>sd_event_wait()</function> was added in version 220.</para>
+    <para><function>sd_event_get_state()</function> was added in version 229.</para>
+    <para><function>sd_event_get_iteration()</function> was added in version 231.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 818f9684c30240cb89defd4f4647c0a0bb562d38..a19495c1a6c2b8e897a82d650078ea5af0bf552b 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_get_machine_names()</function> was added in version 203.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 57e62e406c1e833793da081a2258de7505c89c10..f7a604532b56fe343158e1dc20af1620313a901a 100644 (file)
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>SD_HWDB_FOREACH_PROPERTY()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_enumerate()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_get()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_seek()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 0c817f725c3fedfc77275a22612d600d7a2ef007..4d05d0e7bad17b84e0406c97eeb4032fcdfa7537 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_hwdb_new()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_ref()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_unref()</function> was added in version 246.</para>
+    <para><function>sd_hwdb_new_from_path()</function> was added in version 252.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 40b9b6f58279d2a92ffac13b9ffbc37566a254c9..114500b363cc51df5df681750269baa769fc9cef 100644 (file)
@@ -17,6 +17,7 @@
 
   <refnamediv>
     <refname>sd_id128_get_machine</refname>
+    <refname>sd_id128_get_app_specific</refname>
     <refname>sd_id128_get_machine_app_specific</refname>
     <refname>sd_id128_get_boot</refname>
     <refname>sd_id128_get_boot_app_specific</refname>
         <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef>
       </funcprototype>
 
+      <funcprototype>
+        <funcdef>int <function>sd_id128_get_app_specific</function></funcdef>
+        <paramdef>sd_id128_t <parameter>base</parameter></paramdef>
+        <paramdef>sd_id128_t <parameter>app_id</parameter></paramdef>
+        <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef>
+      </funcprototype>
+
       <funcprototype>
         <funcdef>int <function>sd_id128_get_machine_app_specific</function></funcdef>
         <paramdef>sd_id128_t <parameter>app_id</parameter></paramdef>
     ID from this machine ID, in an irreversible (cryptographically secure) way. To make this easy
     <function>sd_id128_get_machine_app_specific()</function> is provided, see below.</para>
 
+    <para><function>sd_id128_get_app_specific()</function> returns a machine ID that is a combination of the
+    <parameter>base</parameter> and <parameter>app_id</parameter> parameters. Internally, this function
+    calculates HMAC-SHA256 of the <parameter>app_id</parameter> parameter keyed by the
+    <parameter>base</parameter> parameter, and truncates this result to fit in
+    <structname>sd_id128_t</structname> and turns it into a valid Variant 1 Version 4 UUID, in accordance
+    with <ulink url="https://tools.ietf.org/html/rfc4122">RFC 4122</ulink>. Neither of the two input
+    parameters can be calculated from the output parameter <parameter>ret</parameter>.</para>
+
     <para><function>sd_id128_get_machine_app_specific()</function> is similar to
-    <function>sd_id128_get_machine()</function>, but retrieves a machine ID that is specific to the application that is
-    identified by the indicated application ID. It is recommended to use this function instead of
-    <function>sd_id128_get_machine()</function> when passing an ID to untrusted environments, in order to make sure
-    that the original machine ID may not be determined externally. This way, the ID used by the application remains
-    stable on a given machine, but cannot be easily correlated with IDs used in other applications on the same
-    machine. The application-specific ID should be generated via a tool like <command>systemd-id128 new</command>,
-    and may be compiled into the application. This function will return the same application-specific ID for each
-    combination of machine ID and application ID. Internally, this function calculates HMAC-SHA256 of the application
-    ID, keyed by the machine ID.</para>
+    <function>sd_id128_get_machine()</function>, but retrieves a machine ID that is specific to the
+    application that is identified by the indicated application ID. It is recommended to use this function
+    instead of <function>sd_id128_get_machine()</function> when passing an ID to untrusted environments, in
+    order to make sure that the original machine ID may not be determined externally. This way, the ID used
+    by the application remains stable on a given machine, but cannot be easily correlated with IDs used in
+    other applications on the same machine. The application-specific ID should be generated via a tool like
+    <command>systemd-id128 new</command>, and may be compiled into the application. This function will return
+    the same application-specific ID for each combination of machine ID and application ID. Internally, this
+    function calls <function>sd_id128_get_app_specific()</function> with the result from
+    <function>sd_id128_get_machine()</function> and the <parameter>app_id</parameter> parameter.</para>
 
     <para><function>sd_id128_get_boot()</function> returns the boot ID of the executing kernel. This reads and parses
     the <filename>/proc/sys/kernel/random/boot_id</filename> file exposed by the kernel. It is randomly generated early
     derive an application specific ID using <function>sd_id128_get_boot_app_specific()</function>, see below.</para>
 
     <para><function>sd_id128_get_boot_app_specific()</function> is analogous to
-    <function>sd_id128_get_machine_app_specific()</function> but returns an ID that changes between boots. Some
-    machines may be used for a long time without rebooting, hence the boot ID may remain constant for a long time, and
-    has properties similar to the machine ID during that time.</para>
+    <function>sd_id128_get_machine_app_specific()</function>, but returns an ID that changes between
+    boots. Some machines may be used for a long time without rebooting, hence the boot ID may remain constant
+    for a long time, and has properties similar to the machine ID during that time.</para>
 
     <para><function>sd_id128_get_invocation()</function> returns the invocation ID of the currently executed
     service. In its current implementation, this tries to read and parse the following:
           <term><constant>-ENXIO</constant></term>
 
           <listitem><para>Returned by <function>sd_id128_get_invocation()</function> if no invocation ID is
-          set.</para>
+          set. Also returned by <function>sd_id128_get_app_specific()</function>,
+          <function>sd_id128_get_machine_app_specific()</function>, and
+          <function>sd_id128_get_boot_app_specific()</function> when the <parameter>app_id</parameter>
+          parameter is all zeros.</para>
 
           <xi:include href="version-info.xml" xpointer="v242"/></listitem>
         </varlistentry>
@@ -234,6 +254,16 @@ As man:sd-id128(3) macro:
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_id128_get_boot()</function> was added in version 187.</para>
+    <para><function>sd_id128_get_machine()</function> was added in version 187.</para>
+    <para><function>sd_id128_get_invocation()</function> was added in version 232.</para>
+    <para><function>sd_id128_get_machine_app_specific()</function> was added in version 233.</para>
+    <para><function>sd_id128_get_boot_app_specific()</function> was added in version 240.</para>
+    <para><function>sd_id128_get_app_specific()</function> was added in version 255.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2df3547d40783cc8f939f253dc63dff0efda7cb2..54184f0bce6bb572e60c319907abb98d1ed10a82 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_id128_randomize()</function> was added in version 187.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 1dad90e1f78c5d2ceddb66b6a81dc24dbed111df..d767a31d37917c1bc6c1c9f51f15c1fd1816c152 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_id128_from_string()</function> was added in version 187.</para>
+    <para><function>sd_id128_to_string()</function> was added in version 187.</para>
+    <para><function>sd_id128_uuid_string()</function> was added in version 251.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2a513dc3299b7ac8da75133fd9efea37db36fb76..a00a2cc1b8ed82a0740f3dbcf195dcbab85212e4 100644 (file)
     to check the file descriptor type and where it is bound to.</para>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_is_special()</function> was added in version 209.</para>
+    <para><function>sd_is_socket_sockaddr()</function> was added in version 233.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index f7f5ee364ad99a5cacc498eafaa97eeb36542a02..fb43449ac34bdafe3b5286e87861c67c18b7f1d3 100644 (file)
@@ -161,6 +161,14 @@ int add_matches(sd_journal *j) {
 }</programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_add_disjunction()</function> was added in version 187.</para>
+    <para><function>sd_journal_add_match()</function> was added in version 187.</para>
+    <para><function>sd_journal_flush_matches()</function> was added in version 187.</para>
+    <para><function>sd_journal_add_conjunction()</function> was added in version 202.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 2d8055ec8986562244af2ec9bfa5c2cf3cdab658..bc0bb8527d93cb35b48144812391754d2b6132be 100644 (file)
     <programlisting><xi:include href="journal-enumerate-fields.c" parse="text" /></programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>SD_JOURNAL_FOREACH_FIELD()</function> was added in version 229.</para>
+    <para><function>sd_journal_enumerate_fields()</function> was added in version 229.</para>
+    <para><function>sd_journal_restart_fields()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index ad5992f0ba37c42b7bdd705ea9ed90ed1f52a6a1..7b65ab50751dfefe5e4e02b7b78995767354ab06 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_catalog()</function> was added in version 196.</para>
+    <para><function>sd_journal_get_catalog_for_message_id()</function> was added in version 196.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index acaba069607bcc90c09aea917bdfe1383e5b483a..0baae038b73983d67ce400e549459157a6cd5dee 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_cursor()</function> was added in version 187.</para>
+    <para><function>sd_journal_test_cursor()</function> was added in version 195.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 445130e1cb36bd1e39314aa973e140fc0f20ca03..1bff4ad9f369d46d33e3f0e1c1a817d2eaef1a4f 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_cutoff_monotonic_usec()</function> was added in version 187.</para>
+    <para><function>sd_journal_get_cutoff_realtime_usec()</function> was added in version 187.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index bf64b1b088ff2f79ec875f59ef9eb4bc2b6ab9a0..91f022687a20f0eebc5f8ebd60f8b44f8b2b77e7 100644 (file)
@@ -279,6 +279,17 @@ int print_fields(sd_journal *j) {
 â€¦</programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>SD_JOURNAL_FOREACH_DATA()</function> was added in version 187.</para>
+    <para><function>sd_journal_enumerate_data()</function> was added in version 187.</para>
+    <para><function>sd_journal_get_data()</function> was added in version 187.</para>
+    <para><function>sd_journal_restart_data()</function> was added in version 187.</para>
+    <para><function>sd_journal_get_data_threshold()</function> was added in version 196.</para>
+    <para><function>sd_journal_set_data_threshold()</function> was added in version 196.</para>
+    <para><function>sd_journal_enumerate_available_data()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6ca45c4e8ed2fc319748586c080678a58102056f..073afc154513cb0c71d9beeb72c35189114f886d 100644 (file)
@@ -243,6 +243,16 @@ else {
     <programlisting><xi:include href="journal-iterate-poll.c" parse="text" /></programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_fd()</function> was added in version 187.</para>
+    <para><function>sd_journal_process()</function> was added in version 187.</para>
+    <para><function>sd_journal_wait()</function> was added in version 187.</para>
+    <para><function>sd_journal_reliable_fd()</function> was added in version 196.</para>
+    <para><function>sd_journal_get_events()</function> was added in version 201.</para>
+    <para><function>sd_journal_get_timeout()</function> was added in version 201.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index f5096f8db8fc54762d034d1225806890a47ee20e..a3ad4251b838b96c90c460723b4f641d4e63e5d2 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_monotonic_usec()</function> was added in version 187.</para>
+    <para><function>sd_journal_get_realtime_usec()</function> was added in version 187.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 9cbf7f6495b7e92c51660c502f6043b4d6d8cd04..5459d947b8152cd4aab50130d0392341ecd5e0cb 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_seqnum()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e6fcd67df14ca99c0d72cc7b56a9e9ede649b8e7..e5fae28a05987657baaed589e11c497b5d4dc79b 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_get_usage()</function> was added in version 190.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e452b49e82a4087345765e1b960518bb217799c0..101940a2aeeba13a6f80c07b1cd259d599d7062b 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_has_persistent_files()</function> was added in version 229.</para>
+    <para><function>sd_journal_has_runtime_files()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index 5b10b38b2bbd67e00b2fd65ee70712d54241b901..fa61cd1e56c93dc2a0eb7f95fac2e9777f00af9f 100644 (file)
     <programlisting><xi:include href="journal-iterate-foreach.c" parse="text" /></programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>SD_JOURNAL_FOREACH()</function> was added in version 187.</para>
+    <para><function>SD_JOURNAL_FOREACH_BACKWARDS()</function> was added in version 187.</para>
+    <para><function>sd_journal_next()</function> was added in version 187.</para>
+    <para><function>sd_journal_next_skip()</function> was added in version 187.</para>
+    <para><function>sd_journal_previous()</function> was added in version 187.</para>
+    <para><function>sd_journal_previous_skip()</function> was added in version 187.</para>
+    <para><function>sd_journal_step_one()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 0c4b1a7d5abd8a0856eeadfb5311d789917ce216..81c667f3ffa193a7bcd5db9a695cc529f57d27b2 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_close()</function> was added in version 187.</para>
+    <para><function>sd_journal_open()</function> was added in version 187.</para>
+    <para><function>sd_journal_open_directory()</function> was added in version 187.</para>
+    <para><function>sd_journal_open_files()</function> was added in version 205.</para>
+    <para><function>sd_journal_open_directory_fd()</function> was added in version 230.</para>
+    <para><function>sd_journal_open_files_fd()</function> was added in version 230.</para>
+    <para><function>sd_journal_open_namespace()</function> was added in version 245.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 77782342f2d0ff51147a4b86a334b082d509d94d..8fe3ea55f56c59fa0df07be1dfa8634e3be4ea99 100644 (file)
@@ -257,6 +257,20 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_print()</function> was added in version 187.</para>
+    <para><function>sd_journal_printv()</function> was added in version 187.</para>
+    <para><function>sd_journal_send()</function> was added in version 187.</para>
+    <para><function>sd_journal_sendv()</function> was added in version 187.</para>
+    <para><function>sd_journal_perror()</function> was added in version 188.</para>
+    <para><function>sd_journal_perror_with_location()</function> was added in version 246.</para>
+    <para><function>sd_journal_print_with_location()</function> was added in version 246.</para>
+    <para><function>sd_journal_printv_with_location()</function> was added in version 246.</para>
+    <para><function>sd_journal_send_with_location()</function> was added in version 246.</para>
+    <para><function>sd_journal_sendv_with_location()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 81ee55b5761f5a07e3829e281a94d04a7d0172c3..9fe9be6385e7f3119721ad6c187ae32f956ff87d 100644 (file)
     <programlisting><xi:include href="journal-iterate-unique.c" parse="text" /></programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>SD_JOURNAL_FOREACH_UNIQUE()</function> was added in version 195.</para>
+    <para><function>sd_journal_enumerate_unique()</function> was added in version 195.</para>
+    <para><function>sd_journal_query_unique()</function> was added in version 195.</para>
+    <para><function>sd_journal_restart_unique()</function> was added in version 195.</para>
+    <para><function>sd_journal_enumerate_available_unique()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 869889a4bf665c94267238f1ad3675606e6b04c0..916472e8dd5394a8b9b64cf876fa5ef54408d78f 100644 (file)
     <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_seek_cursor()</function> was added in version 187.</para>
+    <para><function>sd_journal_seek_head()</function> was added in version 187.</para>
+    <para><function>sd_journal_seek_monotonic_usec()</function> was added in version 187.</para>
+    <para><function>sd_journal_seek_realtime_usec()</function> was added in version 187.</para>
+    <para><function>sd_journal_seek_tail()</function> was added in version 187.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 40d28041211f06cfd56bcb86de4d213268b47851..cbaed06e7fd92062fa86d4e102b948531d38476b 100644 (file)
     <programlisting><xi:include href="journal-stream-fd.c" parse="text" /></programlisting>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_journal_stream_fd()</function> was added in version 187.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e45907075c598a74e216ca6a1e3674bba982c9c3..3c32d726424d97930e3630282154c32368f9e06e 100644 (file)
     </variablelist>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_listen_fds_with_names()</function> was added in version 227.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 3fbda1c93e9bc1a967e624b755e37c401d93d24b..acd59608292ffe235a72646406f2746ac55629bf 100644 (file)
@@ -234,6 +234,13 @@ else {
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_login_monitor_get_events()</function> was added in version 201.</para>
+    <para><function>sd_login_monitor_get_timeout()</function> was added in version 201.</para>
+    <para><function>sd_login_monitor_unrefp()</function> was added in version 229.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 6e5fe9e23dc9c0c839bd6e2cccd0a818df440d2e..12a4beeb1c758aedcd58d6c6f1ebe799e02d8930 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_machine_get_class()</function> was added in version 217.</para>
+    <para><function>sd_machine_get_ifindices()</function> was added in version 217.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index af6863ec6bbd2d33c2d40ed920b3622808e2a37c..b4067410376311752d1de48212c2e31bc6646fbc 100644 (file)
@@ -532,6 +532,16 @@ sd_notify_barrier(0, 5 * 1000000);
     </example>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_pid_notify()</function> was added in version 219.</para>
+    <para><function>sd_pid_notify_with_fds()</function> was added in version 219.</para>
+    <para><function>sd_pid_notifyf()</function> was added in version 219.</para>
+    <para><function>sd_notify_barrier()</function> was added in version 246.</para>
+    <para><function>sd_pid_notify_barrier()</function> was added in version 254.</para>
+    <para><function>sd_pid_notifyf_with_fds()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index 5c8b84b1042d7a8e2a53c2ea5d23331c083d6035..36491f18c38b3f51466c816c53c0c48ea7e19f86 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_path_lookup()</function> was added in version 246.</para>
+    <para><function>sd_path_lookup_strv()</function> was added in version 246.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 5ce5a19144a3fcda6b8c66c9523a4e7e7d800c5f..e5e9e17ecbff594e5faf918bf8257844e0795c96 100644 (file)
     <citerefentry><refentrytitle>getsid</refentrytitle><manvolnum>2</manvolnum></citerefentry>.</para>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_peer_get_cgroup()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_machine_name()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_owner_uid()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_session()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_slice()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_unit()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_user_slice()</function> was added in version 236.</para>
+    <para><function>sd_peer_get_user_unit()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_cgroup()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_machine_name()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_owner_uid()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_session()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_slice()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_unit()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_user_slice()</function> was added in version 236.</para>
+    <para><function>sd_pid_get_user_unit()</function> was added in version 236.</para>
+    <para><function>sd_pidfd_get_cgroup()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_machine_name()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_owner_uid()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_session()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_slice()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_unit()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_user_slice()</function> was added in version 253.</para>
+    <para><function>sd_pidfd_get_user_unit()</function> was added in version 253.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 110862c5df3c701dac1fc2f87ae26347b46337e5..666f589d1f606319ca49f846b31b993ff27c687b 100644 (file)
     <para>In the past, <function>sd_seat_can_multi_session()</function> was used to check whether the seat
     supports multiple sessions. All seats support that now, so that function has been deprecated and always
     returns true.</para>
+    <para><function>sd_seat_can_graphical()</function> was added in version 186.</para>
+    <para><function>sd_seat_can_tty()</function> was added in version 186.</para>
   </refsect1>
 
   <refsect1>
index 8639599eccc7dc903cdbef4b946421f31d28da89..d95402a442630c791c9283a1490196cbc17bdea3 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_session_get_state()</function> was added in version 186.</para>
+    <para><function>sd_session_get_tty()</function> was added in version 198.</para>
+    <para><function>sd_session_get_vt()</function> was added in version 207.</para>
+    <para><function>sd_session_get_remote_host()</function> was added in version 209.</para>
+    <para><function>sd_session_get_remote_user()</function> was added in version 209.</para>
+    <para><function>sd_session_is_remote()</function> was added in version 209.</para>
+    <para><function>sd_session_get_desktop()</function> was added in version 217.</para>
+    <para><function>sd_session_get_leader()</function> was added in version 254.</para>
+    <para><function>sd_session_get_start_time()</function> was added in version 254.</para>
+    <para><function>sd_session_get_username()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index e6cf77ff6992a7dfa3431ec01d4bbe2a9cd92014..ce81aadb74cb011a55a20208757bd98532074a3e 100644 (file)
 
   <xi:include href="libsystemd-pkgconfig.xml" />
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_uid_get_display()</function> was added in version 213.</para>
+    <para><function>sd_uid_get_login_time()</function> was added in version 254.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
 
index 644342f273dd380769faa3a742499dd4e685a101..4a6bd6fb6df182236e8849e66b24049e4cfd4f94 100644 (file)
     </variablelist>
   </refsect1>
 
+  <refsect1>
+    <title>History</title>
+    <para><function>sd_watchdog_enabled()</function> was added in version 209.</para>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index 221155045134c04d66d6f5c5dbd3e42f1138fdf8..32226363cb2a7641598386fe8805fe2e0b61aff9 100644 (file)
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="plain">invocation-id</arg>
     </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>systemd-id128</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+      <arg choice="plain">show</arg>
+      <arg choice="opt" rep="repeat">NAME|UUID</arg>
+    </cmdsynopsis>
   </refsynopsisdiv>
 
   <refsect1>
     <para>With <command>boot-id</command>, the identifier of the current boot will be
     printed.</para>
 
-    <para>Both <command>machine-id</command> and <command>boot-id</command> may be combined
-    with the <option>--app-specific=<replaceable>app-id</replaceable></option> switch to
-    generate application-specific IDs. See
-    <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>
-    for the discussion when this is useful.</para>
-
     <para>With <command>invocation-id</command>, the identifier of the current service invocation
     will be printed. This is available in systemd services. See
     <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
 
     <para>With <command>show</command>, well-known IDs are printed (for now, only GPT partition type UUIDs),
     along with brief identifier strings. When no arguments are specified, all known IDs are shown. When
-    arguments are specified, they must be the identifiers or ID values of one or more known IDs, which are
-    then printed. Combine with <option>--uuid</option> to list the IDs in UUID style, i.e. the way GPT
-    partition type UUIDs are usually shown.</para>
+    arguments are specified, they may be the identifiers or ID values of one or more known IDs, which are
+    then printed with their name, or arbitrary IDs, which are then printed with a placeholder name. Combine
+    with <option>--uuid</option> to list the IDs in UUID style, i.e. the way GPT partition type UUIDs are
+    usually shown.</para>
+
+    <para><command>machine-id</command>, <command>boot-id</command>, and <command>show</command> may be
+    combined with the <option>--app-specific=<replaceable>app-id</replaceable></option> switch to generate
+    application-specific IDs. See
+    <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+    for the discussion when this is useful. Support for <command>show --app-specific=</command> was added in
+    version 255.</para>
   </refsect1>
 
   <refsect1>
         <xi:include href="version-info.xml" xpointer="v240"/></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><option>-P</option></term>
+        <term><option>--value</option></term>
+
+        <listitem><para>Only print the value. May be combined with
+        <option>-u</option>/<option>--uuid</option>.</para>
+
+        <xi:include href="version-info.xml" xpointer="v255"/></listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><option>-a <replaceable>app-id</replaceable></option></term>
         <term><option>--app-specific=<replaceable>app-id</replaceable></option></term>
 
-        <listitem><para>With this option, an identifier that is the result of hashing the
-        application identifier <replaceable>app-id</replaceable> and the machine identifier will be
-        printed. The <replaceable>app-id</replaceable> argument must be a valid sd-id128 string
-        identifying the application.</para>
+        <listitem><para>With this option, identifiers will be printed that are the result of hashing the
+        application identifier <replaceable>app-id</replaceable> and another ID. The
+        <replaceable>app-id</replaceable> argument must be a valid sd-id128 string identifying the
+        application. When used with <command>machine-id</command>, the other ID will be the machine ID as
+        described in
+        <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, when
+        used with <command>boot-id</command>, the other ID will be the boot ID, and when used with
+        <command>show</command>, the other ID or IDs should be specified via the positional arguments.</para>
 
         <xi:include href="version-info.xml" xpointer="v240"/>
         </listitem>
   <refsect1>
     <title>Exit status</title>
 
-    <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
+    <para>On success 0 is returned, and a non-zero failure code otherwise.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Examples</title>
+
+    <example>
+      <title>Show a well-known UUID</title>
+      <programlisting>
+$ systemd-id128 show -P user-home
+773f91ef66d449b5bd83d683bf40ad16
+
+$ systemd-id128 show -Pu user-home
+773f91ef-66d4-49b5-bd83-d683bf40ad16
+
+$ systemd-id128 show 773f91ef-66d4-49b5-bd83-d683bf40ad16
+NAME      ID
+user-home 773f91ef66d449b5bd83d683bf40ad16
+      </programlisting>
+    </example>
+
+    <example>
+      <title>Generate an application-specific UUID</title>
+
+      <programlisting>
+$ systemd-id128 machine-id -u
+3a9d668b-4db7-4939-8a4a-5e78a03bffb7
+
+$ systemd-id128 new -u
+1fb8f24b-02df-458d-9659-cc8ace68e28a
+
+$ systemd-id128 --app=1fb8f24b-02df-458d-9659-cc8ace68e28a
+47b82cb1-5339-43da-b2a6-1c350aef1bd1
+
+$ systemd-id128 -Pu show 3a9d668b-4db7-4939-8a4a-5e78a03bffb7 --app=1fb8f24b-02df-458d-9659-cc8ace68e28a
+47b82cb1-5339-43da-b2a6-1c350aef1bd1
+      </programlisting>
+
+      <para>On a given machine with the ID 3a9d668b-4db7-4939-8a4a-5e78a03bffb7, for the application
+      1fb8f24b-02df-458d-9659-cc8ace68e28a, we generate an application-specific machine ID. If we want to
+      later recreate the same calculation on a different machine, we need to specify both IDs explicitly.
+      </para>
+    </example>
   </refsect1>
 
   <refsect1>
index 1f2ba9b7d4c52a48cc3a505d4a2f2fb5d9e1ea4d..c52b80f2852979b9dd789d126ec2a06835ba92de 100644 (file)
@@ -3122,6 +3122,17 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>UsePREF64=</varname></term>
+        <listitem>
+          <para>When true, the IPv6 PREF64 (or NAT64) prefixes received in the Router Advertisement will be recorded
+          and made available to client programs and displayed in the <command>networkctl</command> status output per-link.
+          See <ulink url="https://tools.ietf.org/html/rfc8781">RFC 8781</ulink>. Defaults to false.</para>
+
+          <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>UseAutonomousPrefix=</varname></term>
         <listitem>
@@ -3661,6 +3672,37 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
         3600 seconds (one hour).</para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HomeAgent=</varname></term>
+
+        <listitem><para>Takes a boolean. Specifies that IPv6 router advertisements which indicates to hosts that
+        the router acts as a Home Agent and includes a Home Agent Option. Defaults to false. See
+        <ulink url="https://tools.ietf.org/html/rfc6275">RFC 6275</ulink> for further details.</para>
+
+         <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><varname>HomeAgentLifetimeSec=</varname></term>
+
+        <listitem><para>Takes a timespan. Specifies the lifetime of the Home Agent. An integer the default unit of seconds,
+        in the range 1…65535. Defaults to the value set to <varname>RouterLifetimeSec=</varname>.</para>
+
+         <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><varname>HomeAgentPreference=</varname></term>
+
+        <listitem><para>Configures IPv6 Home Agent preference. Takes an integer in the range 0…65535.
+        Defaults to 0.</para>
+
+         <xi:include href="version-info.xml" xpointer="v255"/>
+        </listitem>
+      </varlistentry>
+
     </variablelist>
     </refsect1>
 
index 7dd02925c015a07bbeb8477637e50744034f9d01..3a6f24a7b0c66fcbbd5dc0c226f75b2c4591682d 100644 (file)
@@ -8,4 +8,4 @@ Distribution=|arch
 Distribution=|centos
 
 [Host]
-QemuMem=3G
+@QemuMem=3G
index 6932b8b29cd941b311dd56b03d4fcec7951a8ee1..ae2706c791712918f0eebd939481dc6585c73e3a 100644 (file)
@@ -4,7 +4,7 @@
 Distribution=centos
 
 [Distribution]
-Release=9
+@Release=9
 Repositories=epel
              epel-next
              hyperscale-packages-main
index 0eeaf07400014173551292043168fbe4a86171f9..8674e884fad54d85561fef52636cd64e7be9f2ad 100644 (file)
@@ -4,4 +4,4 @@
 Distribution=debian
 
 [Distribution]
-Release=testing
+@Release=testing
index 4511dcdf879b643e0740c285567ac627ebf1a280..0196c9f745c4d79e64a2f7c6d2abc3e3af0122a7 100644 (file)
@@ -4,4 +4,4 @@
 Distribution=fedora
 
 [Distribution]
-Release=38
+@Release=38
index 98a7b4ef5cca64db4b782a6f9e33b2efe9c5b76a..832c0d15fb2ebf00323ad0a9921512fedbf125cb 100644 (file)
@@ -4,4 +4,4 @@
 Distribution=opensuse
 
 [Distribution]
-Release=tumbleweed
+@Release=tumbleweed
index adf3316ca5372c73bc893e9c4fde2a32e29439a3..f25d53d2b76834f40f8bb25d333a29eb4922b664 100644 (file)
@@ -12,8 +12,8 @@ Environment=ASAN_OPTIONS=verify_asan_link_order=false
             MKOSI_UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1
 
 [Host]
-Incremental=yes
-QemuMem=2G
+@Incremental=yes
+@QemuMem=2G
 ExtraSearchPaths=build/
 # Make sure we don't trigger systemd-firstboot prompting for the root password.
 Credentials=passwd.plaintext-password.root=
index d6ea6d1708da8191c84eac286a083f0b60ad1561..b0ebbadd48995e4148214fb620cc4d3c10edcb1c 100644 (file)
@@ -4,5 +4,5 @@
 Distribution=ubuntu
 
 [Distribution]
-Release=jammy
+@Release=jammy
 Repositories=universe
index eb67bfcf628eeeee5634ef6a07cf865a6206922c..6c6d0457752b1a846782232a3a7a71e00323f414 100644 (file)
@@ -6,6 +6,8 @@ Format=directory
 [Content]
 Bootable=no
 CleanPackageMetadata=no
+
+Packages=
 Packages=
         kmod
         less
index 78d55ba7cb6cccb60e0132130e7a03e33787cad8..5d347b71d81d7bc2656c55910ea1776098442dd4 100644 (file)
@@ -14,7 +14,12 @@ Format=cpio
 BaseTrees=../../mkosi.output/base
 ExtraTrees=../../mkosi.output/base-systemd
 MakeInitrd=yes
+Bootable=no
+BuildPackages=
+
+Packages=
 Packages=
+        gzip
         systemd
         udev
 
index 2474d7f847b2b05cf21a12a5728282859cb3544a..58cd4939427dee5881497537391f60406e4fa0af 100644 (file)
@@ -22,6 +22,7 @@ Packages=
         gcc # Sanitizer libraries
         gdb
         grep
+        gzip
         kbd
         kexec-tools
         less
@@ -43,6 +44,8 @@ Packages=
         xfsprogs
         zsh
 
+BuildPackages=
+
 [Validation]
 SecureBoot=yes
 SignExpectedPcr=yes
index 9c730846fcfc63c749c5cf6e9a9baab8d55a1711..03c3b7015048df24851c8f2b76b44bfe7099fb1a 100644 (file)
@@ -1,4 +1,5 @@
 # systemctl(1) completion                                 -*- shell-script -*-
+# vi: ft=sh
 # SPDX-License-Identifier: LGPL-2.1-or-later
 #
 # This file is part of systemd.
@@ -103,21 +104,22 @@ __get_reloadable_units () {
         } | sort -u )
 }
 
-__get_failed_units   () { __systemctl $1 list-units "$2*"      \
-                              | { while read -r a b c d; do [[ $c == "failed"   ]] && echo " $a"; done; }; }
-__get_enabled_units  () { __systemctl $1 list-unit-files "$2*" \
-                              | { while read -r a b c  ; do [[ $b == "enabled"  ]] && echo " $a"; done; }; }
-__get_disabled_units () { __systemctl $1 list-unit-files "$2*" \
-                              | { while read -r a b c  ; do [[ $b == "disabled" ]] && echo " $a"; done; }; }
-__get_masked_units   () { __systemctl $1 list-unit-files "$2*" \
-                              | { while read -r a b c  ; do [[ $b == "masked"   ]] && echo " $a"; done; }; }
-__get_all_unit_files () { { __systemctl $1 list-unit-files "$2*"; } | { while read -r a b; do echo " $a"; done; }; }
+__get_failed_units()   { __systemctl $1 list-units "$2*"      \
+                              | while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }
+__get_enabled_units()  { __systemctl $1 list-unit-files "$2*" \
+                              | while read -r a b c  ; do [[ $b == "enabled" ]] && echo " $a"; done; }
+__get_disabled_units() { __systemctl $1 list-unit-files "$2*" \
+                              | while read -r a b c  ; do [[ $b == "disabled" ]] && echo " $a"; done; }
+__get_masked_units()   { __systemctl $1 list-unit-files "$2*" \
+                              | while read -r a b c  ; do [[ $b == "masked" ]] && echo " $a"; done; }
+__get_all_unit_files() { __systemctl $1 list-unit-files "$2*" | while read -r a b; do echo " $a"; done; }
 
 __get_machines() {
-    local a b
-    { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
-       { while read a b; do echo " $a"; done; } | \
-        sort -u
+    local a
+
+    while read a _; do
+        echo " $a"
+    done < <(machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null | sort -u; echo ".host")
 }
 
 _systemctl () {
@@ -126,11 +128,13 @@ _systemctl () {
 
     local -A OPTS=(
         [STANDALONE]='--all -a --reverse --after --before --defaults --force -f --full -l --global
-                             --help -h --no-ask-password --no-block --legend=no --no-pager --no-reload --no-wall --now
-                             --quiet -q --system --user --version --runtime --recursive -r --firmware-setup
-                             --show-types --plain --failed --value --fail --dry-run --wait --no-warn'
-        [ARG]='--host -H --kill-whom --property -p --signal -s --type -t --state --job-mode --root
-                             --preset-mode -n --lines -o --output -M --machine --message --timestamp --check-inhibitors'
+                      --help -h --no-ask-password --no-block --legend=no --no-pager --no-reload --no-wall --now
+                      --quiet -q --system --user --version --runtime --recursive -r --firmware-setup
+                      --show-types --plain --failed --value --fail --dry-run --wait --no-warn --with-dependencies
+                      --show-transaction -T --mkdir --marked --read-only'
+        [ARG]='--host -H --kill-whom --property -p -P --signal -s --type -t --state --job-mode --root
+               --preset-mode -n --lines -o --output -M --machine --message --timestamp --check-inhibitors --what
+               --image --boot-loader-menu --boot-loader-entry --reboot-argument --drop-in'
     )
 
     if __contains_word "--user" ${COMP_WORDS[*]}; then
@@ -167,7 +171,7 @@ _systemctl () {
             --host|-H)
                 comps=$(compgen -A hostname)
                 ;;
-            --property|-p)
+            --property|-p|-P)
                 comps=$(__systemd_properties)
                 ;;
             --preset-mode)
@@ -185,6 +189,16 @@ _systemctl () {
             --check-inhibitors)
                 comps='auto yes no'
                 ;;
+            --what)
+                comps='configuration state cache logs runtime all'
+                ;;
+            --image)
+                comps=$(compgen -A file -- "$cur")
+                compopt -o filenames
+                ;;
+            --boot-loader-entry)
+                comps=$(systemctl --boot-loader-entry=help 2>/dev/null)
+                ;;
         esac
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
         return 0
@@ -203,7 +217,7 @@ _systemctl () {
         [REENABLABLE_UNITS]='reenable'
         [FAILED_UNITS]='reset-failed'
         [STARTABLE_UNITS]='start'
-        [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart'
+        [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart freeze thaw'
         [ISOLATABLE_UNITS]='isolate'
         [RELOADABLE_UNITS]='reload condreload try-reload-or-restart force-reload'
         [RESTARTABLE_UNITS]='restart reload-or-restart'
index 73d586d4c54c849687bb4f0cff489b68b5c30135..72f791f6ccb92c2905570e6b73684173275b6c10 100644 (file)
@@ -196,6 +196,17 @@ int strextendf_with_separator(char **x, const char *separator, const char *forma
 
 char *strrep(const char *s, unsigned n);
 
+#define strrepa(s, n)                                           \
+        ({                                                      \
+                char *_d_, *_p_;                                \
+                size_t _len_ = strlen(s) * n;                   \
+                _p_ = _d_ = newa(char, _len_ + 1);              \
+                for (unsigned _i_ = 0; _i_ < n; _i_++)          \
+                        _p_ = stpcpy(_p_, s);                   \
+                *_p_ = 0;                                       \
+                _d_;                                            \
+        })
+
 int split_pair(const char *s, const char *sep, char **l, char **r);
 
 int free_and_strdup(char **p, const char *s);
index c7a15815b0c8ae55d48df84bf923357679113630..f5c31b6b7483469cf93c617d0321e9a8b58da10c 100644 (file)
@@ -120,21 +120,22 @@ _noreturn_ static void crash(int sig, siginfo_t *siginfo, void *context) {
                                                  LOG_MESSAGE("Caught <%s>, waitpid() failed: %m", signal_to_string(sig)),
                                                  "MESSAGE_ID=" SD_MESSAGE_CRASH_WAITPID_FAILED_STR);
                         else if (status.si_code != CLD_DUMPED) {
-                                const char *s = status.si_code == CLD_EXITED
-                                        ? exit_status_to_string(status.si_status, EXIT_STATUS_LIBC)
-                                        signal_to_string(status.si_status);
+                                const char *s = status.si_code == CLD_EXITED ?
+                                        exit_status_to_string(status.si_status, EXIT_STATUS_LIBC) :
+                                        signal_to_string(status.si_status);
 
                                 log_struct(LOG_EMERG,
                                            LOG_MESSAGE("Caught <%s>, core dump failed (child "PID_FMT", code=%s, status=%i/%s).",
-                                                   signal_to_string(sig),
-                                                   pid,
-                                                   sigchld_code_to_string(status.si_code),
-                                                   status.si_status, strna(s)),
+                                                       signal_to_string(sig),
+                                                       pid,
+                                                       sigchld_code_to_string(status.si_code),
+                                                       status.si_status,
+                                                       strna(s)),
                                            "MESSAGE_ID=" SD_MESSAGE_CRASH_COREDUMP_FAILED_STR);
                         } else
                                 log_struct(LOG_EMERG,
                                            LOG_MESSAGE("Caught <%s>, dumped core as pid "PID_FMT".",
-                                                   signal_to_string(sig), pid),
+                                                       signal_to_string(sig), pid),
                                            "MESSAGE_ID=" SD_MESSAGE_CRASH_COREDUMP_PID_STR);
                 }
         }
index 245c5f14f1fbd4d4bd4ebcb7604889a1ccc8486b..3d1a38b21ed80b1c2f8752ab07bdef499f6874f9 100644 (file)
@@ -26,6 +26,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "format-util.h"
+#include "initrd-util.h"
 #include "install.h"
 #include "log.h"
 #include "manager-dump.h"
@@ -1864,26 +1865,37 @@ static int method_switch_root(sd_bus_message *message, void *userdata, sd_bus_er
                 if (!path_is_valid(root))
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
                                                  "New root directory must be a valid path.");
+
                 if (!path_is_absolute(root))
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
                                                  "New root path '%s' is not absolute.", root);
-                if (path_equal(root, "/"))
-                        return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
-                                                 "New root directory cannot be the old root directory.");
-        }
 
-        /* Safety check */
-        if (isempty(init)) {
-                r = path_is_os_tree(root);
+                r = path_is_root(root);
                 if (r < 0)
                         return sd_bus_error_set_errnof(error, r,
-                                                       "Failed to determine whether root path '%s' contains an OS tree: %m",
+                                                       "Failed to check if new root directory '%s' is the same as old root: %m",
                                                        root);
-                if (r == 0)
+                if (r > 0)
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
-                                                 "Specified switch root path '%s' does not seem to be an OS tree. os-release file is missing.",
-                                                 root);
-        } else {
+                                                 "New root directory cannot be the old root directory.");
+        }
+
+        /* Safety check */
+        if (!in_initrd())
+                return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
+                                         "Not in initrd, refusing switch-root operation.");
+
+        r = path_is_os_tree(root);
+        if (r < 0)
+                return sd_bus_error_set_errnof(error, r,
+                                               "Failed to determine whether root path '%s' contains an OS tree: %m",
+                                               root);
+        if (r == 0)
+                return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
+                                         "Specified switch root path '%s' does not seem to be an OS tree. os-release file is missing.",
+                                         root);
+
+        if (!isempty(init)) {
                 if (!path_is_valid(init))
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
                                                  "Path to init binary '%s' is not a valid path.", init);
index c54558f23b9ba0e0757f887be559e33ec64c0a02..279f1b16ce33a671ad6df4f31a58280ff30693b4 100644 (file)
@@ -242,20 +242,6 @@ static int console_setup(void) {
         return 0;
 }
 
-static int set_machine_id(const char *m) {
-        sd_id128_t t;
-        assert(m);
-
-        if (sd_id128_from_string(m, &t) < 0)
-                return -EINVAL;
-
-        if (sd_id128_is_null(t))
-                return -EINVAL;
-
-        arg_machine_id = t;
-        return 0;
-}
-
 static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
         int r;
 
@@ -392,7 +378,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
                 if (proc_cmdline_value_missing(key, value))
                         return 0;
 
-                r = set_machine_id(value);
+                r = id128_from_string_nonzero(value, &arg_machine_id);
                 if (r < 0)
                         log_warning_errno(r, "MachineID '%s' is not valid, ignoring: %m", value);
 
@@ -1045,7 +1031,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_MACHINE_ID:
-                        r = set_machine_id(optarg);
+                        r = id128_from_string_nonzero(optarg, &arg_machine_id);
                         if (r < 0)
                                 return log_error_errno(r, "MachineID '%s' is not valid: %m", optarg);
                         break;
@@ -1891,7 +1877,7 @@ static int do_reexecute(
                 r = switch_root(/* new_root= */ switch_root_dir,
                                 /* old_root_after= */ NULL,
                                 /* flags= */ (objective == MANAGER_SWITCH_ROOT ? SWITCH_ROOT_DESTROY_OLD_ROOT : 0) |
-                                             (objective == MANAGER_SOFT_REBOOT ? SWITCH_ROOT_SKIP_RECURSIVE_RUN : 0));
+                                             (objective == MANAGER_SOFT_REBOOT ? 0 : SWITCH_ROOT_RECURSIVE_RUN));
                 if (r < 0)
                         log_error_errno(r, "Failed to switch root, trying to continue: %m");
         }
index ec37d74e03584edae035be945150eea6e23bd5b2..b1fa04481341029bebf2c7c4a3bac255b82e0d29 100644 (file)
@@ -5,6 +5,10 @@
 #include "uki.h"
 
 const char* const unified_sections[_UNIFIED_SECTION_MAX + 1] = {
+        /* These section names must fit in 8ch (excluding any trailing NUL) as per PE spec for executables:
+         * https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers
+         * (Note that PE *object* files may have longer section names (via indirection in the string table) but
+         * this is not allowed for PE *executables*, which UKIs are.) */
         [UNIFIED_SECTION_LINUX]   = ".linux",
         [UNIFIED_SECTION_OSREL]   = ".osrel",
         [UNIFIED_SECTION_CMDLINE] = ".cmdline",
index a8c5c9ac6cff70fcc4b6c38990bf878e7e929907..9e0a3488dd5fe69db80551ef2419ff5730321df3 100644 (file)
@@ -16,6 +16,7 @@
 
 static Id128PrettyPrintMode arg_mode = ID128_PRINT_ID128;
 static sd_id128_t arg_app = {};
+static bool arg_value = false;
 
 static int verb_new(int argc, char **argv, void *userdata) {
         return id128_print_new(arg_mode);
@@ -67,8 +68,16 @@ static int verb_invocation_id(int argc, char **argv, void *userdata) {
 }
 
 static int show_one(Table **table, const char *name, sd_id128_t uuid, bool first) {
+        sd_id128_t u;
         int r;
 
+        assert(table);
+
+        if (sd_id128_is_null(arg_app))
+                u = uuid;
+        else
+                assert_se(sd_id128_get_app_specific(uuid, arg_app, &u) == 0);
+
         if (arg_mode == ID128_PRINT_PRETTY) {
                 _cleanup_free_ char *id = NULL;
 
@@ -78,26 +87,28 @@ static int show_one(Table **table, const char *name, sd_id128_t uuid, bool first
 
                 ascii_strupper(id);
 
-                r = id128_pretty_print_sample(id, uuid);
+                r = id128_pretty_print_sample(id, u);
                 if (r < 0)
                         return r;
                 if (!first)
                         puts("");
                 return 0;
+        }
 
-        } else {
-                if (!*table) {
-                        *table = table_new("name", "id");
-                        if (!*table)
-                                return log_oom();
-                        table_set_width(*table, 0);
-                }
+        if (arg_value)
+                return id128_pretty_print(u, arg_mode);
 
-                return table_add_many(*table,
-                                      TABLE_STRING, name,
-                                      arg_mode == ID128_PRINT_ID128 ? TABLE_ID128 : TABLE_UUID,
-                                      uuid);
+        if (!*table) {
+                *table = table_new("name", "id");
+                if (!*table)
+                        return log_oom();
+                table_set_width(*table, 0);
         }
+
+        return table_add_many(*table,
+                              TABLE_STRING, name,
+                              arg_mode == ID128_PRINT_ID128 ? TABLE_ID128 : TABLE_UUID,
+                              u);
 }
 
 static int verb_show(int argc, char **argv, void *userdata) {
@@ -162,7 +173,7 @@ static int help(void) {
                "  machine-id              Print the ID of current machine\n"
                "  boot-id                 Print the ID of current boot\n"
                "  invocation-id           Print the ID of current invocation\n"
-               "  show [NAME]             Print one or more well-known GPT partition type IDs\n"
+               "  show [NAME|UUID]        Print one or more UUIDs\n"
                "  help                    Show this help\n"
                "\nOptions:\n"
                "  -h --help               Show this help\n"
@@ -191,6 +202,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "help",         no_argument,       NULL, 'h'              },
                 { "version",      no_argument,       NULL, ARG_VERSION      },
                 { "pretty",       no_argument,       NULL, 'p'              },
+                { "value",        no_argument,       NULL, 'P'              },
                 { "app-specific", required_argument, NULL, 'a'              },
                 { "uuid",         no_argument,       NULL, 'u'              },
                 {},
@@ -201,7 +213,7 @@ static int parse_argv(int argc, char *argv[]) {
         assert(argc >= 0);
         assert(argv);
 
-        while ((c = getopt_long(argc, argv, "hpa:u", options, NULL)) >= 0)
+        while ((c = getopt_long(argc, argv, "hpa:uP", options, NULL)) >= 0)
                 switch (c) {
 
                 case 'h':
@@ -212,10 +224,19 @@ static int parse_argv(int argc, char *argv[]) {
 
                 case 'p':
                         arg_mode = ID128_PRINT_PRETTY;
+                        arg_value = false;
+                        break;
+
+                case 'P':
+                        arg_value = true;
+                        if (arg_mode == ID128_PRINT_PRETTY)
+                                arg_mode = ID128_PRINT_ID128;
                         break;
 
                 case 'a':
-                        r = sd_id128_from_string(optarg, &arg_app);
+                        r = id128_from_string_nonzero(optarg, &arg_app);
+                        if (r == -ENXIO)
+                                return log_error_errno(r, "Application ID cannot be all zeros.");
                         if (r < 0)
                                 return log_error_errno(r, "Failed to parse \"%s\" as application-ID: %m", optarg);
                         break;
index f1c19af1b26229a92fdd0bab8cdbdb2e900e814f..48747929bebd36c8d89be6f600270cd1618c0cd7 100644 (file)
@@ -330,6 +330,7 @@ static int parse_lines(const char *arg, bool graceful) {
 
 default_noarg:
         arg_lines = 10;
+        arg_lines_oldest = false;
         return 0;
 }
 
index 2932a190ff7e4bfc66a9f4a46753abaca4983c26..897e2abd3a2f540b0115f2e99e4af51c8c48f16e 100644 (file)
@@ -871,12 +871,12 @@ static bool shall_try_append_again(JournalFile *f, int r) {
                 log_ratelimit_info_errno(r, JOURNAL_LOG_RATELIMIT, "%s: Realtime clock jumped backwards relative to last journal entry, rotating.", f->path);
                 return true;
 
-        case -EREMOTE:         /* Boot ID different from the one of the last entry */
-                log_ratelimit_info_errno(r, JOURNAL_LOG_RATELIMIT, "%s: Boot ID changed since last record, rotating.", f->path);
-                return true;
-
-        case -ENOTNAM:         /* Monotonic time (CLOCK_MONOTONIC) jumped backwards relative to last journal entry */
-                log_ratelimit_info_errno(r, JOURNAL_LOG_RATELIMIT, "%s: Monotonic clock jumped backwards relative to last journal entry, rotating.", f->path);
+        case -ENOTNAM: /* Monotonic time (CLOCK_MONOTONIC) jumped backwards relative to last journal entry with the same boot ID */
+                log_ratelimit_info_errno(
+                                r,
+                                JOURNAL_LOG_RATELIMIT,
+                                "%s: Monotonic clock jumped backwards relative to last journal entry with the same boot ID, rotating.",
+                                f->path);
                 return true;
 
         case -EILSEQ:          /* seqnum ID last used in the file doesn't match the one we'd passed when writing an entry to it */
index a6f37522d1ee96f01f2282ecb25c4af0a05f4c70..6f43975977a270ae398334a9f81e705f2ffa59d1 100644 (file)
@@ -1,4 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include "sd-dhcp-client.h"
+
 extern const struct hash_ops dhcp_option_hash_ops;
+
+int dhcp_client_set_state_callback(
+                sd_dhcp_client *client,
+                sd_dhcp_client_callback_t cb,
+                void *userdata);
+int dhcp_client_get_state(sd_dhcp_client *client);
index e020db7bcd0e081f409776a7a16cea72065bf79f..d4e4a026b5275ba9d283ac868224a534234b7ae2 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "sd-dhcp-client.h"
 
+#include "dhcp-client-internal.h"
 #include "dhcp-protocol.h"
 #include "ether-addr-util.h"
 #include "network-common.h"
@@ -29,8 +30,6 @@ typedef struct DHCPServerData {
         size_t size;
 } DHCPServerData;
 
-extern const struct hash_ops dhcp_option_hash_ops;
-
 typedef struct sd_dhcp_client sd_dhcp_client;
 
 int dhcp_network_bind_raw_socket(
diff --git a/src/libsystemd-network/dhcp-protocol.c b/src/libsystemd-network/dhcp-protocol.c
new file mode 100644 (file)
index 0000000..955d087
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "dhcp-protocol.h"
+#include "string-table.h"
+
+static const char* const dhcp_state_table[_DHCP_STATE_MAX] = {
+        [DHCP_STATE_STOPPED]              = "stopped",
+        [DHCP_STATE_INIT]                 = "initialization",
+        [DHCP_STATE_SELECTING]            = "selecting",
+        [DHCP_STATE_INIT_REBOOT]          = "init-reboot",
+        [DHCP_STATE_REBOOTING]            = "rebooting",
+        [DHCP_STATE_REQUESTING]           = "requesting",
+        [DHCP_STATE_BOUND]                = "bound",
+        [DHCP_STATE_RENEWING]             = "renewing",
+        [DHCP_STATE_REBINDING]            = "rebinding",
+};
+
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState);
index 2dc0660cc7d7b59dbce56e32d6c9e1a532d8d048..dd330ae83938829a5600ac3447ccfe914f449913 100644 (file)
@@ -55,15 +55,17 @@ enum {
 };
 
 enum DHCPState {
-        DHCP_STATE_STOPPED                      = 0,
-        DHCP_STATE_INIT                         = 1,
-        DHCP_STATE_SELECTING                    = 2,
-        DHCP_STATE_INIT_REBOOT                  = 3,
-        DHCP_STATE_REBOOTING                    = 4,
-        DHCP_STATE_REQUESTING                   = 5,
-        DHCP_STATE_BOUND                        = 6,
-        DHCP_STATE_RENEWING                     = 7,
-        DHCP_STATE_REBINDING                    = 8,
+        DHCP_STATE_STOPPED,
+        DHCP_STATE_INIT,
+        DHCP_STATE_SELECTING,
+        DHCP_STATE_INIT_REBOOT,
+        DHCP_STATE_REBOOTING,
+        DHCP_STATE_REQUESTING,
+        DHCP_STATE_BOUND,
+        DHCP_STATE_RENEWING,
+        DHCP_STATE_REBINDING,
+        _DHCP_STATE_MAX,
+        _DHCP_STATE_INVALID                     = -EINVAL,
 };
 
 typedef enum DHCPState DHCPState;
@@ -107,3 +109,5 @@ enum {
         DHCP_FQDN_FLAG_E = (1 << 2),
         DHCP_FQDN_FLAG_N = (1 << 3),
 };
+
+const char *dhcp_state_to_string(DHCPState s) _const_;
diff --git a/src/libsystemd-network/dhcp6-client-internal.h b/src/libsystemd-network/dhcp6-client-internal.h
new file mode 100644 (file)
index 0000000..6c17f57
--- /dev/null
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "sd-dhcp6-client.h"
+
+int dhcp6_client_set_state_callback(
+                sd_dhcp6_client *client,
+                sd_dhcp6_client_callback_t cb,
+                void *userdata);
+int dhcp6_client_get_state(sd_dhcp6_client *client);
index fa43f28eb55e09e92ce332e004235c0f215b3a86..97bc82d5210cb9da75352a97c233d681dd26a622 100644 (file)
@@ -12,6 +12,7 @@
 #include "sd-dhcp6-client.h"
 
 #include "dhcp-identifier.h"
+#include "dhcp6-client-internal.h"
 #include "dhcp6-option.h"
 #include "dhcp6-protocol.h"
 #include "ether-addr-util.h"
@@ -79,6 +80,8 @@ struct sd_dhcp6_client {
 
         sd_dhcp6_client_callback_t callback;
         void *userdata;
+        sd_dhcp6_client_callback_t state_callback;
+        void *state_userdata;
         bool send_release;
 
         /* Ignore machine-ID when generating DUID. See dhcp_identifier_set_duid_en(). */
index 7a5c45a2f97395d1d649f4b55a1f583b157d37aa..54dbfc1c76f8c9deb281431cca47e505efd922ce 100644 (file)
@@ -9,35 +9,10 @@
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "fuzz.h"
-#include "icmp6-util.h"
+#include "icmp6-util-unix.h"
 #include "ndisc-internal.h"
 #include "socket-util.h"
 
-static int test_fd[2] = PIPE_EBADF;
-
-int icmp6_bind_router_solicitation(int index) {
-        assert_se(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) >= 0);
-        return test_fd[0];
-}
-
-int icmp6_bind_router_advertisement(int index) {
-        return -ENOSYS;
-}
-
-int icmp6_receive(int fd, void *iov_base, size_t iov_len,
-                  struct in6_addr *dst, triple_timestamp *timestamp) {
-        assert_se(read(fd, iov_base, iov_len) == (ssize_t) iov_len);
-
-        if (timestamp)
-                triple_timestamp_get(timestamp);
-
-        return 0;
-}
-
-int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
-        return 0;
-}
-
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         struct ether_addr mac_addr = {
                 .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
diff --git a/src/libsystemd-network/icmp6-util-unix.c b/src/libsystemd-network/icmp6-util-unix.c
new file mode 100644 (file)
index 0000000..bbb3bc8
--- /dev/null
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include <netinet/ip6.h>
+#include <unistd.h>
+
+#include "fd-util.h"
+#include "icmp6-util-unix.h"
+
+send_ra_t send_ra_function = NULL;
+int test_fd[2] = PIPE_EBADF;
+
+static struct in6_addr dummy_link_local = {
+        .s6_addr = {
+                0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+                0x12, 0x34, 0x56, 0xff, 0xfe, 0x78, 0x9a, 0xbc,
+        },
+};
+
+int icmp6_bind_router_solicitation(int ifindex) {
+        if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) < 0)
+                return -errno;
+
+        return test_fd[0];
+}
+
+int icmp6_bind_router_advertisement(int ifindex) {
+        return test_fd[1];
+}
+
+int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
+        if (!send_ra_function)
+                return 0;
+
+        return send_ra_function(0);
+}
+
+int icmp6_receive(
+                int fd,
+                void *iov_base,
+                size_t iov_len,
+                struct in6_addr *ret_sender,
+                triple_timestamp *ret_timestamp) {
+
+        assert_se(read (fd, iov_base, iov_len) == (ssize_t) iov_len);
+
+        if (ret_timestamp)
+                triple_timestamp_get(ret_timestamp);
+
+        if (ret_sender)
+                *ret_sender = dummy_link_local;
+
+        return 0;
+}
diff --git a/src/libsystemd-network/icmp6-util-unix.h b/src/libsystemd-network/icmp6-util-unix.h
new file mode 100644 (file)
index 0000000..a9cb05a
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "icmp6-util.h"
+
+typedef int (*send_ra_t)(uint8_t flags);
+
+extern send_ra_t send_ra_function;
+extern int test_fd[2];
index ecddab61e42381ca2aa6f0aa71436c313ce61f00..ecd0dd0f3175911a45c24c5e96d4c82f98b5f0d4 100644 (file)
@@ -144,8 +144,12 @@ int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
         return 0;
 }
 
-int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst,
-                  triple_timestamp *ret_timestamp) {
+int icmp6_receive(
+                int fd,
+                void *buffer,
+                size_t size,
+                struct in6_addr *ret_sender,
+                triple_timestamp *ret_timestamp) {
 
         /* This needs to be initialized with zero. See #20741. */
         CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(int)) + /* ttl */
@@ -178,7 +182,7 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst,
             sa.in6.sin6_family == AF_INET6)  {
 
                 addr = sa.in6.sin6_addr;
-                if (!in6_addr_is_link_local(&addr))
+                if (!in6_addr_is_link_local(&addr) && !in6_addr_is_null(&addr))
                         return -EADDRNOTAVAIL;
 
         } else if (msg.msg_namelen > 0)
@@ -206,10 +210,14 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst,
                 }
         }
 
-        if (!triple_timestamp_is_set(&t))
-                triple_timestamp_get(&t);
+        if (ret_timestamp) {
+                if (triple_timestamp_is_set(&t))
+                        *ret_timestamp = t;
+                else
+                        triple_timestamp_get(ret_timestamp);
+        }
 
-        *ret_dst = addr;
-        *ret_timestamp = t;
+        if (ret_sender)
+                *ret_sender = addr;
         return 0;
 }
index f7ad26b5e61995486aa82e21ba73277f00d02c8a..0a9ecb4c44d72cdc7c1481a5646a7a4a00e58bef 100644 (file)
@@ -20,5 +20,9 @@
 int icmp6_bind_router_solicitation(int ifindex);
 int icmp6_bind_router_advertisement(int ifindex);
 int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr);
-int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst,
-                  triple_timestamp *ret_timestamp);
+int icmp6_receive(
+                int fd,
+                void *buffer,
+                size_t size,
+                struct in6_addr *ret_sender,
+                triple_timestamp *ret_timestamp);
index 043d3bc2548b5fbe5725963f633bd589fc441b41..3eba57f991f82a5063dabf21d2e8af33806ecde8 100644 (file)
@@ -6,12 +6,14 @@ sources = files(
         'dhcp-network.c',
         'dhcp-option.c',
         'dhcp-packet.c',
+        'dhcp-protocol.c',
         'dhcp6-network.c',
         'dhcp6-option.c',
         'dhcp6-protocol.c',
         'icmp6-util.c',
         'lldp-neighbor.c',
         'lldp-network.c',
+        'ndisc-protocol.c',
         'ndisc-router.c',
         'network-common.c',
         'network-internal.c',
@@ -82,10 +84,16 @@ executables += [
                 'sources' : files('test-lldp-rx.c'),
         },
         network_test_template + {
-                'sources' : files('test-ndisc-ra.c'),
+                'sources' : files(
+                        'test-ndisc-ra.c',
+                        'icmp6-util-unix.c',
+                ),
         },
         network_test_template + {
-                'sources' : files('test-ndisc-rs.c'),
+                'sources' : files(
+                        'test-ndisc-rs.c',
+                        'icmp6-util-unix.c',
+                ),
         },
         network_test_template + {
                 'sources' : files('test-sd-dhcp-lease.c'),
@@ -106,6 +114,9 @@ executables += [
                 'sources' : files('fuzz-lldp-rx.c'),
         },
         network_fuzz_template + {
-                'sources' : files('fuzz-ndisc-rs.c'),
+                'sources' : files(
+                        'fuzz-ndisc-rs.c',
+                        'icmp6-util-unix.c',
+                ),
         },
 ]
diff --git a/src/libsystemd-network/ndisc-protocol.c b/src/libsystemd-network/ndisc-protocol.c
new file mode 100644 (file)
index 0000000..fae4a58
--- /dev/null
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "ndisc-protocol.h"
+
+static const uint8_t prefix_length_code_to_prefix_length[_PREFIX_LENGTH_CODE_MAX] = {
+        [PREFIX_LENGTH_CODE_96] = 96,
+        [PREFIX_LENGTH_CODE_64] = 64,
+        [PREFIX_LENGTH_CODE_56] = 56,
+        [PREFIX_LENGTH_CODE_48] = 48,
+        [PREFIX_LENGTH_CODE_40] = 40,
+        [PREFIX_LENGTH_CODE_32] = 32,
+};
+
+int pref64_plc_to_prefix_length(uint16_t plc, uint8_t *ret) {
+        plc &= PREF64_PLC_MASK;
+        if (plc >= _PREFIX_LENGTH_CODE_MAX)
+                return -EINVAL;
+
+        if (ret)
+                *ret = prefix_length_code_to_prefix_length[plc];
+        return 0;
+}
+
+int pref64_prefix_length_to_plc(uint8_t prefixlen, uint8_t *ret) {
+        assert(ret);
+
+        for (size_t i = 0; i < ELEMENTSOF(prefix_length_code_to_prefix_length); i++)
+                if (prefix_length_code_to_prefix_length[i] == prefixlen) {
+                        *ret = i;
+                        return 0;
+                }
+
+        return -EINVAL;
+}
diff --git a/src/libsystemd-network/ndisc-protocol.h b/src/libsystemd-network/ndisc-protocol.h
new file mode 100644 (file)
index 0000000..8e403e3
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "time-util.h"
+
+/* RFC 8781: PREF64 or (NAT64 prefix) */
+#define PREF64_SCALED_LIFETIME_MASK      0xfff8
+#define PREF64_PLC_MASK                  0x0007
+#define PREF64_MAX_LIFETIME_USEC         (65528 * USEC_PER_SEC)
+
+typedef enum PrefixLengthCode {
+        PREFIX_LENGTH_CODE_96,
+        PREFIX_LENGTH_CODE_64,
+        PREFIX_LENGTH_CODE_56,
+        PREFIX_LENGTH_CODE_48,
+        PREFIX_LENGTH_CODE_40,
+        PREFIX_LENGTH_CODE_32,
+        _PREFIX_LENGTH_CODE_MAX,
+        _PREFIX_LENGTH_CODE_INVALID = -EINVAL,
+} PrefixLengthCode;
+
+/* rfc8781: section 4 - Scaled Lifetime: 13-bit unsigned integer. PREFIX_LEN (Prefix Length Code): 3-bit unsigned integer */
+struct nd_opt_prefix64_info {
+        uint8_t type;
+        uint8_t length;
+        uint16_t lifetime_and_plc;
+        uint8_t prefix[12];
+} __attribute__((__packed__));
+
+int pref64_plc_to_prefix_length(uint16_t plc, uint8_t *ret);
+int pref64_prefix_length_to_plc(uint8_t prefixlen, uint8_t *ret);
index 86f8ca0364d9bfb28693f7214e88596caf769acb..fe8d26ebd4b90853cbed9e3abdabc060678a3930 100644 (file)
@@ -13,6 +13,7 @@
 #include "memory-util.h"
 #include "missing_network.h"
 #include "ndisc-internal.h"
+#include "ndisc-protocol.h"
 #include "ndisc-router.h"
 #include "strv.h"
 
@@ -69,6 +70,21 @@ int sd_ndisc_router_get_raw(sd_ndisc_router *rt, const void **ret, size_t *size)
         return 0;
 }
 
+static bool pref64_option_verify(const struct nd_opt_prefix64_info *p, size_t length) {
+        uint16_t lifetime_and_plc;
+
+        assert(p);
+
+        if (length != sizeof(struct nd_opt_prefix64_info))
+                return false;
+
+        lifetime_and_plc = be16toh(p->lifetime_and_plc);
+        if (pref64_plc_to_prefix_length(lifetime_and_plc, NULL) < 0)
+                return false;
+
+        return true;
+}
+
 int ndisc_router_parse(sd_ndisc *nd, sd_ndisc_router *rt) {
         struct nd_router_advert *a;
         const uint8_t *p;
@@ -205,7 +221,12 @@ int ndisc_router_parse(sd_ndisc *nd, sd_ndisc_router *rt) {
                                                        "DNSSL option has invalid size.");
 
                         break;
-                }
+                case SD_NDISC_OPTION_PREF64: {
+                        if (!pref64_option_verify((struct nd_opt_prefix64_info *) p, length))
+                                log_ndisc_errno(nd, SYNTHETIC_ERRNO(EBADMSG),
+                                                "PREF64 prefix has invalid prefix length.");
+                        break;
+                }}
 
                 p += length, left -= length;
         }
@@ -766,3 +787,94 @@ int sd_ndisc_router_captive_portal_get_uri(sd_ndisc_router *rt, const char **ret
 
         return 0;
 }
+
+static int get_pref64_prefix_info(sd_ndisc_router *rt, struct nd_opt_prefix64_info **ret) {
+        struct nd_opt_prefix64_info *ri;
+        size_t length;
+        int r;
+
+        assert(rt);
+        assert(ret);
+
+        r = sd_ndisc_router_option_is_type(rt, SD_NDISC_OPTION_PREF64);
+        if (r < 0)
+                return r;
+        if (r == 0)
+                return -EMEDIUMTYPE;
+
+        length = NDISC_ROUTER_OPTION_LENGTH(rt);
+        if (length != sizeof(struct nd_opt_prefix64_info))
+                return -EBADMSG;
+
+        ri = (struct nd_opt_prefix64_info *) ((uint8_t*) NDISC_ROUTER_RAW(rt) + rt->rindex);
+        if (!pref64_option_verify(ri, length))
+                return -EBADMSG;
+
+        *ret = ri;
+        return 0;
+}
+
+int sd_ndisc_router_prefix64_get_prefix(sd_ndisc_router *rt, struct in6_addr *ret_addr) {
+        struct nd_opt_prefix64_info *pi;
+        struct in6_addr a = {};
+        unsigned prefixlen;
+        int r;
+
+        assert_return(rt, -EINVAL);
+        assert_return(ret_addr, -EINVAL);
+
+        r = get_pref64_prefix_info(rt, &pi);
+        if (r < 0)
+                return r;
+
+        r = sd_ndisc_router_prefix64_get_prefixlen(rt, &prefixlen);
+        if (r < 0)
+                return r;
+
+        memcpy(&a, pi->prefix, sizeof(pi->prefix));
+        in6_addr_mask(&a, prefixlen);
+        /* extra safety check for refusing malformed prefix. */
+        if (memcmp(&a, pi->prefix, sizeof(pi->prefix)) != 0)
+                return -EBADMSG;
+
+        *ret_addr = a;
+        return 0;
+}
+
+int sd_ndisc_router_prefix64_get_prefixlen(sd_ndisc_router *rt, unsigned *ret) {
+        struct nd_opt_prefix64_info *pi;
+        uint16_t lifetime_prefix_len;
+        uint8_t prefix_len;
+        int r;
+
+        assert_return(rt, -EINVAL);
+        assert_return(ret, -EINVAL);
+
+        r = get_pref64_prefix_info(rt, &pi);
+        if (r < 0)
+              return r;
+
+        lifetime_prefix_len = be16toh(pi->lifetime_and_plc);
+        pref64_plc_to_prefix_length(lifetime_prefix_len, &prefix_len);
+
+        *ret = prefix_len;
+        return 0;
+}
+
+int sd_ndisc_router_prefix64_get_lifetime_sec(sd_ndisc_router *rt, uint16_t *ret) {
+        struct nd_opt_prefix64_info *pi;
+        uint16_t lifetime_prefix_len;
+        int r;
+
+        assert_return(rt, -EINVAL);
+        assert_return(ret, -EINVAL);
+
+        r = get_pref64_prefix_info(rt, &pi);
+        if (r < 0)
+                return r;
+
+        lifetime_prefix_len = be16toh(pi->lifetime_and_plc);
+
+        *ret = lifetime_prefix_len & PREF64_SCALED_LIFETIME_MASK;
+        return 0;
+}
index 534d7959827d989f7159ba3969af3f8c5a885594..af0be7a5b7c0330b1a819a77a3817a02d6d0ff77 100644 (file)
@@ -5,9 +5,12 @@
   Copyright Â© 2017 Intel Corporation. All rights reserved.
 ***/
 
+#include <netinet/icmp6.h>
+
 #include "sd-radv.h"
 
 #include "list.h"
+#include "ndisc-protocol.h"
 #include "network-common.h"
 #include "sparse-endian.h"
 #include "time-util.h"
 /* Pref64 option type (RFC8781, section 4) */
 #define RADV_OPT_PREF64                           38
 
+/* rfc6275 7.4 Neighbor Discovery Home Agent Lifetime.
+ * The default value is the same as the Router Lifetime
+ * The maximum value corresponds to 18.2 hours. value of 0 MUST NOT be used.*/
+#define RADV_MAX_HOME_AGENT_LIFETIME_USEC (65535 * USEC_PER_SEC)
+
 enum RAdvState {
         RADV_STATE_IDLE                      = 0,
         RADV_STATE_ADVERTISING               = 1,
@@ -112,6 +120,9 @@ struct sd_radv {
         size_t n_rdnss;
         struct sd_radv_opt_dns *rdnss;
         struct sd_radv_opt_dns *dnssl;
+
+        /* Mobile IPv6 extension: Home Agent Info.  */
+        struct nd_opt_home_agent_info home_agent;
 };
 
 #define radv_prefix_opt__contents {             \
@@ -180,23 +191,10 @@ struct sd_radv_route_prefix {
         usec_t valid_until;
 };
 
-/* rfc8781: section 4 - Scaled Lifetime: 13-bit unsigned integer. PLC (Prefix Length Code): 3-bit unsigned integer */
-#define radv_pref64_prefix_opt__contents { \
-        uint8_t type;                      \
-        uint8_t length;                    \
-        uint16_t lifetime_and_plc;         \
-        uint8_t prefix[12];                \
-}
-
-struct radv_pref64_prefix_opt radv_pref64_prefix_opt__contents;
-
-struct radv_pref64_prefix_opt__packed radv_pref64_prefix_opt__contents _packed_;
-assert_cc(sizeof(struct radv_pref64_prefix_opt) == sizeof(struct radv_pref64_prefix_opt__packed));
-
 struct sd_radv_pref64_prefix {
         unsigned n_ref;
 
-        struct radv_pref64_prefix_opt opt;
+        struct nd_opt_prefix64_info opt;
 
         struct in6_addr in6_addr;
         uint8_t prefixlen;
index 21b6592037405bb0a2195d5e7c8ceb068d1ab9a1..9ec7a2256e5497a1833a7c336e9a4d69e828e9ea 100644 (file)
@@ -118,6 +118,8 @@ struct sd_dhcp_client {
         sd_event_source *timeout_expire;
         sd_dhcp_client_callback_t callback;
         void *userdata;
+        sd_dhcp_client_callback_t state_callback;
+        void *state_userdata;
         sd_dhcp_lease *lease;
         usec_t start_delay;
         int ip_service_type;
@@ -226,6 +228,19 @@ int sd_dhcp_client_id_to_string(const void *data, size_t len, char **ret) {
         return 0;
 }
 
+int dhcp_client_set_state_callback(
+                sd_dhcp_client *client,
+                sd_dhcp_client_callback_t cb,
+                void *userdata) {
+
+        assert_return(client, -EINVAL);
+
+        client->state_callback = cb;
+        client->state_userdata = userdata;
+
+        return 0;
+}
+
 int sd_dhcp_client_set_callback(
                 sd_dhcp_client *client,
                 sd_dhcp_client_callback_t cb,
@@ -701,6 +716,18 @@ int sd_dhcp_client_get_lease(sd_dhcp_client *client, sd_dhcp_lease **ret) {
         return 0;
 }
 
+int sd_dhcp_client_get_lease_timestamp(sd_dhcp_client *client, uint64_t *timestamp) {
+        assert_return(client, -EINVAL);
+
+        if (!IN_SET(client->state, DHCP_STATE_BOUND, DHCP_STATE_RENEWING, DHCP_STATE_REBINDING))
+                return -ENODATA;
+
+        if(timestamp)
+                *timestamp = client->request_sent;
+
+        return 0;
+}
+
 int sd_dhcp_client_set_service_type(sd_dhcp_client *client, int type) {
         assert_return(client, -EINVAL);
         assert_return(!sd_dhcp_client_is_running(client), -EBUSY);
@@ -730,6 +757,27 @@ int sd_dhcp_client_set_fallback_lease_lifetime(sd_dhcp_client *client, uint32_t
         return 0;
 }
 
+static void client_set_state(sd_dhcp_client *client, DHCPState state) {
+        assert(client);
+
+        if (client->state == state)
+                return;
+
+        log_dhcp_client(client, "State changed: %s -> %s",
+                        dhcp_state_to_string(client->state), dhcp_state_to_string(state));
+
+        client->state = state;
+
+        if (client->state_callback)
+                client->state_callback(client, state, client->state_userdata);
+}
+
+int dhcp_client_get_state(sd_dhcp_client *client) {
+        assert_return(client, -EINVAL);
+
+        return client->state;
+}
+
 static int client_notify(sd_dhcp_client *client, int event) {
         assert(client);
 
@@ -753,7 +801,7 @@ static int client_initialize(sd_dhcp_client *client) {
 
         client->attempt = 0;
 
-        client->state = DHCP_STATE_STOPPED;
+        client_set_state(client, DHCP_STATE_STOPPED);
         client->xid = 0;
 
         client->lease = sd_dhcp_lease_unref(client->lease);
@@ -1183,6 +1231,7 @@ static int client_send_request(sd_dhcp_client *client) {
         case DHCP_STATE_REBOOTING:
         case DHCP_STATE_BOUND:
         case DHCP_STATE_STOPPED:
+        default:
                 return -EINVAL;
         }
 
@@ -1307,7 +1356,7 @@ static int client_timeout_resend(
         case DHCP_STATE_INIT:
                 r = client_send_discover(client);
                 if (r >= 0) {
-                        client->state = DHCP_STATE_SELECTING;
+                        client_set_state(client, DHCP_STATE_SELECTING);
                         client->attempt = 0;
                 } else if (client->attempt >= client->max_attempts)
                         goto error;
@@ -1330,7 +1379,7 @@ static int client_timeout_resend(
                          goto error;
 
                 if (client->state == DHCP_STATE_INIT_REBOOT)
-                        client->state = DHCP_STATE_REBOOTING;
+                        client_set_state(client, DHCP_STATE_REBOOTING);
 
                 client->request_sent = time_now;
                 break;
@@ -1340,6 +1389,7 @@ static int client_timeout_resend(
                 break;
 
         case DHCP_STATE_STOPPED:
+        default:
                 r = -EINVAL;
                 goto error;
         }
@@ -1479,7 +1529,7 @@ static int client_timeout_t2(sd_event_source *s, uint64_t usec, void *userdata)
         client->receive_message = sd_event_source_disable_unref(client->receive_message);
         client->fd = safe_close(client->fd);
 
-        client->state = DHCP_STATE_REBINDING;
+        client_set_state(client, DHCP_STATE_REBINDING);
         client->attempt = 0;
 
         r = dhcp_network_bind_raw_socket(client->ifindex, &client->link, client->xid,
@@ -1500,9 +1550,9 @@ static int client_timeout_t1(sd_event_source *s, uint64_t usec, void *userdata)
         DHCP_CLIENT_DONT_DESTROY(client);
 
         if (client->lease)
-                client->state = DHCP_STATE_RENEWING;
+                client_set_state(client, DHCP_STATE_RENEWING);
         else if (client->state != DHCP_STATE_INIT)
-                client->state = DHCP_STATE_INIT_REBOOT;
+                client_set_state(client, DHCP_STATE_INIT_REBOOT);
         client->attempt = 0;
 
         return client_initialize_time_events(client);
@@ -1782,7 +1832,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, i
                 if (r < 0)
                         goto error;
 
-                client->state = DHCP_STATE_REQUESTING;
+                client_set_state(client, DHCP_STATE_REQUESTING);
                 client->attempt = 0;
 
                 r = event_reset_time(client->event, &client->timeout_resend,
@@ -1831,7 +1881,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, i
                 client->receive_message = sd_event_source_disable_unref(client->receive_message);
                 client->fd = safe_close(client->fd);
 
-                client->state = DHCP_STATE_BOUND;
+                client_set_state(client, DHCP_STATE_BOUND);
                 client->attempt = 0;
 
                 client->last_addr = client->lease->address;
@@ -2047,7 +2097,7 @@ int sd_dhcp_client_send_renew(sd_dhcp_client *client) {
 
         client->start_delay = 0;
         client->attempt = 1;
-        client->state = DHCP_STATE_RENEWING;
+        client_set_state(client, DHCP_STATE_RENEWING);
 
         return client_initialize_time_events(client);
 }
@@ -2083,7 +2133,7 @@ int sd_dhcp_client_start(sd_dhcp_client *client) {
            the client MAY issue a DHCPREQUEST to try to reclaim the current
            address. */
         if (client->last_addr && !client->anonymize)
-                client->state = DHCP_STATE_INIT_REBOOT;
+                client_set_state(client, DHCP_STATE_INIT_REBOOT);
 
         r = client_start(client);
         if (r >= 0)
@@ -2176,7 +2226,6 @@ int sd_dhcp_client_stop(sd_dhcp_client *client) {
         DHCP_CLIENT_DONT_DESTROY(client);
 
         client_stop(client, SD_DHCP_CLIENT_EVENT_STOP);
-        client->state = DHCP_STATE_STOPPED;
 
         return 0;
 }
index 8957e1cf4bfe57d2fe86a31efffd431e6a799fbf..fb209a0c624cf71b12c18d051205196dba3f4f3a 100644 (file)
@@ -47,6 +47,19 @@ int sd_dhcp6_client_set_callback(
         return 0;
 }
 
+int dhcp6_client_set_state_callback(
+                sd_dhcp6_client *client,
+                sd_dhcp6_client_callback_t cb,
+                void *userdata) {
+
+        assert_return(client, -EINVAL);
+
+        client->state_callback = cb;
+        client->state_userdata = userdata;
+
+        return 0;
+}
+
 int sd_dhcp6_client_set_ifindex(sd_dhcp6_client *client, int ifindex) {
         assert_return(client, -EINVAL);
         assert_return(!sd_dhcp6_client_is_running(client), -EBUSY);
@@ -553,6 +566,15 @@ static void client_set_state(sd_dhcp6_client *client, DHCP6State state) {
                          dhcp6_state_to_string(client->state), dhcp6_state_to_string(state));
 
         client->state = state;
+
+        if (client->state_callback)
+                client->state_callback(client, state, client->state_userdata);
+}
+
+int dhcp6_client_get_state(sd_dhcp6_client *client) {
+        assert_return(client, -EINVAL);
+
+        return client->state;
 }
 
 static void client_notify(sd_dhcp6_client *client, int event) {
index ca5365b95ffec647633a357610b7a52a008fae65..d7d9e7e2d9f3299614dad60d89374545efe8130d 100644 (file)
@@ -225,8 +225,7 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda
         if (r < 0)
                 switch (r) {
                 case -EADDRNOTAVAIL:
-                        log_ndisc(nd, "Received RA from non-link-local address %s. Ignoring.",
-                                  IN6_ADDR_TO_STRING(&rt->address));
+                        log_ndisc(nd, "Received RA from neither link-local nor null address. Ignoring.");
                         return 0;
 
                 case -EMULTIHOP:
@@ -242,6 +241,11 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda
                         return 0;
                 }
 
+        /* The function icmp6_receive() accepts the null source address, but RFC 4861 Section 6.1.2 states
+         * that hosts MUST discard messages with the null source address. */
+        if (in6_addr_is_null(&rt->address))
+                log_ndisc(nd, "Received RA from null address. Ignoring.");
+
         (void) event_source_disable(nd->timeout_event_source);
         (void) ndisc_handle_datagram(nd, rt);
         return 0;
index cb7bc07f5af759e293b4bb3bca2bbc79de7a914c..a35311efb99c6aae392afd214bef5361a632d6ec 100644 (file)
@@ -231,6 +231,17 @@ static int radv_send(sd_radv *ra, const struct in6_addr *dst, usec_t lifetime_us
         if (ra->dnssl)
                 iov[msg.msg_iovlen++] = IOVEC_MAKE(ra->dnssl, ra->dnssl->length * 8);
 
+        if (FLAGS_SET(ra->flags, ND_RA_FLAG_HOME_AGENT)) {
+                ra->home_agent.nd_opt_home_agent_info_type = ND_OPT_HOME_AGENT_INFO;
+                ra->home_agent.nd_opt_home_agent_info_len = 1;
+
+                /* 0 means to place the current Router Lifetime value */
+                if (ra->home_agent.nd_opt_home_agent_info_lifetime == 0)
+                        ra->home_agent.nd_opt_home_agent_info_lifetime = adv.nd_ra_router_lifetime;
+
+                iov[msg.msg_iovlen++] = IOVEC_MAKE(&ra->home_agent, sizeof(ra->home_agent));
+        }
+
         if (sendmsg(ra->fd, &msg, 0) < 0)
                 return -errno;
 
@@ -264,8 +275,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat
         if (r < 0)
                 switch (r) {
                 case -EADDRNOTAVAIL:
-                        log_radv(ra, "Received RS from non-link-local address %s. Ignoring",
-                                 IN6_ADDR_TO_STRING(&src));
+                        log_radv(ra, "Received RS from neither link-local nor null address. Ignoring");
                         return 0;
 
                 case -EMULTIHOP:
@@ -286,6 +296,9 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat
                 return 0;
         }
 
+        /* TODO: if the sender address is null, check that the message does not have the source link-layer
+         * address option. See RFC 4861 Section 6.1.1. */
+
         const char *addr = IN6_ADDR_TO_STRING(&src);
 
         r = radv_send(ra, &src, ra->lifetime_usec);
@@ -570,6 +583,39 @@ int sd_radv_set_preference(sd_radv *ra, unsigned preference) {
         return 0;
 }
 
+int sd_radv_set_home_agent_information(sd_radv *ra, int home_agent) {
+        assert_return(ra, -EINVAL);
+
+        if (ra->state != RADV_STATE_IDLE)
+                return -EBUSY;
+
+        SET_FLAG(ra->flags, ND_RA_FLAG_HOME_AGENT, home_agent);
+
+        return 0;
+}
+
+int sd_radv_set_home_agent_preference(sd_radv *ra, uint16_t preference) {
+        assert_return(ra, -EINVAL);
+
+        if (ra->state != RADV_STATE_IDLE)
+                return -EBUSY;
+
+        ra->home_agent.nd_opt_home_agent_info_preference = htobe16(preference);
+
+        return 0;
+}
+
+int sd_radv_set_home_agent_lifetime(sd_radv *ra, uint16_t lifetime) {
+        assert_return(ra, -EINVAL);
+
+        if (ra->state != RADV_STATE_IDLE)
+                return -EBUSY;
+
+        ra->home_agent.nd_opt_home_agent_info_lifetime = htobe16(lifetime);
+
+        return 0;
+}
+
 int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p) {
         sd_radv_prefix *found = NULL;
         int r;
@@ -1091,33 +1137,14 @@ int sd_radv_pref64_prefix_set_prefix(
 
         uint16_t pref64_lifetime;
         uint8_t prefixlen_code;
+        int r;
 
         assert_return(p, -EINVAL);
         assert_return(prefix, -EINVAL);
 
-        switch (prefixlen) {
-        case 96:
-                prefixlen_code = 0;
-                break;
-        case 64:
-                prefixlen_code = 1;
-                break;
-        case 56:
-                prefixlen_code = 2;
-                break;
-        case 48:
-                prefixlen_code = 3;
-                break;
-        case 40:
-                prefixlen_code = 4;
-                break;
-        case 32:
-                prefixlen_code = 5;
-                break;
-        default:
-                log_radv(NULL, "Unsupported PREF64 prefix length %u. Valid lengths are 32, 40, 48, 56, 64 and 96", prefixlen);
-                return -EINVAL;
-        }
+        r = pref64_prefix_length_to_plc(prefixlen, &prefixlen_code);
+        if (r < 0)
+                return log_radv_errno(NULL, r,  "Unsupported PREF64 prefix length %u. Valid lengths are 32, 40, 48, 56, 64 and 96", prefixlen);
 
         if (lifetime_usec == USEC_INFINITY || DIV_ROUND_UP(lifetime_usec, 8 * USEC_PER_SEC) >= UINT64_C(1) << 13)
                 return -EINVAL;
index bd8c0fd426a1dcbd115fc883778e0f1fdb3cddeb..18004f64665255c402fa9d18ff1998581990f2ab 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "alloc-util.h"
 #include "hexdecoct.h"
-#include "icmp6-util.h"
+#include "icmp6-util-unix.h"
 #include "socket-util.h"
 #include "strv.h"
 #include "tests.h"
@@ -52,7 +52,6 @@ static uint8_t advertisement[] = {
 };
 
 static bool test_stopped;
-static int test_fd[2];
 static struct {
         struct in6_addr address;
         unsigned char prefixlen;
@@ -208,31 +207,6 @@ TEST(radv) {
         assert_se(!ra);
 }
 
-int icmp6_bind_router_solicitation(int ifindex) {
-        return -ENOSYS;
-}
-
-int icmp6_bind_router_advertisement(int ifindex) {
-        assert_se(ifindex == 42);
-
-        return test_fd[1];
-}
-
-int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
-
-        return 0;
-}
-
-int icmp6_receive(int fd, void *iov_base, size_t iov_len,
-                  struct in6_addr *dst, triple_timestamp *timestamp) {
-        assert_se(read (fd, iov_base, iov_len) == (ssize_t)iov_len);
-
-        if (timestamp)
-                triple_timestamp_get(timestamp);
-
-        return 0;
-}
-
 static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
         sd_radv *ra = userdata;
         unsigned char buf[168];
index e501b6437744bc21edc16e5c99f362b0d2460d8e..09e292a2ec36d9da8360b19d8c9b118e24f9d573 100644 (file)
@@ -12,7 +12,7 @@
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "hexdecoct.h"
-#include "icmp6-util.h"
+#include "icmp6-util-unix.h"
 #include "socket-util.h"
 #include "strv.h"
 #include "ndisc-internal.h"
@@ -23,12 +23,8 @@ static struct ether_addr mac_addr = {
 };
 
 static bool verbose = false;
-static int test_fd[2];
 static sd_ndisc *test_timeout_nd;
 
-typedef int (*send_ra_t)(uint8_t flags);
-static send_ra_t send_ra_function;
-
 static void router_dump(sd_ndisc_router *rt) {
         struct in6_addr addr;
         uint8_t hop_limit;
@@ -41,7 +37,8 @@ static void router_dump(sd_ndisc_router *rt) {
         assert_se(rt);
 
         log_info("--");
-        assert_se(sd_ndisc_router_get_address(rt, &addr) == -ENODATA);
+        assert_se(sd_ndisc_router_get_address(rt, &addr) >= 0);
+        log_info("Sender: %s", IN6_ADDR_TO_STRING(&addr));
 
         assert_se(sd_ndisc_router_get_timestamp(rt, CLOCK_REALTIME, &t) >= 0);
         log_info("Timestamp: %s", FORMAT_TIMESTAMP(t));
@@ -163,29 +160,6 @@ static void router_dump(sd_ndisc_router *rt) {
         }
 }
 
-int icmp6_bind_router_solicitation(int ifindex) {
-        assert_se(ifindex == 42);
-
-        if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) < 0)
-                return -errno;
-
-        return test_fd[0];
-}
-
-int icmp6_bind_router_advertisement(int ifindex) {
-        return -ENOSYS;
-}
-
-int icmp6_receive(int fd, void *iov_base, size_t iov_len,
-                  struct in6_addr *dst, triple_timestamp *timestamp) {
-        assert_se(read (fd, iov_base, iov_len) == (ssize_t)iov_len);
-
-        if (timestamp)
-                triple_timestamp_get(timestamp);
-
-        return 0;
-}
-
 static int send_ra(uint8_t flags) {
         uint8_t advertisement[] = {
                 0x86, 0x00, 0xde, 0x83, 0x40, 0xc0, 0x00, 0xb4,
@@ -214,13 +188,6 @@ static int send_ra(uint8_t flags) {
         return 0;
 }
 
-int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
-        if (!send_ra_function)
-                return 0;
-
-        return send_ra_function(0);
-}
-
 static void test_callback(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router *rt, void *userdata) {
         sd_event *e = userdata;
         static unsigned idx = 0;
index ea13e02719b86cc386fe41563675976419a4002e..56a8831f0fec07c6c8591a695bd327e66ec31df2 100644 (file)
@@ -828,3 +828,8 @@ global:
         sd_journal_step_one;
         sd_session_get_leader;
 } LIBSYSTEMD_253;
+
+LIBSYSTEMD_255 {
+global:
+        sd_id128_get_app_specific;
+} LIBSYSTEMD_254;
index ee9e91c58d5f9e927dd9570008abc5abca440f7a..9d391de1664278623a14bfb66eb348acdf32a348 100644 (file)
 #include "string-util.h"
 #include "sync-util.h"
 
+int id128_from_string_nonzero(const char *s, sd_id128_t *ret) {
+        sd_id128_t t;
+        int r;
+
+        assert(ret);
+
+        r = sd_id128_from_string(ASSERT_PTR(s), &t);
+        if (r < 0)
+                return r;
+
+        if (sd_id128_is_null(t))
+                return -ENXIO;
+
+        *ret = t;
+        return 0;
+}
+
 bool id128_is_valid(const char *s) {
         size_t l;
 
index bd3e201361716f463104108e565e6adf671173b1..80c36e5a7ba21b3f9ff009c272e97f253809bd1e 100644 (file)
@@ -21,6 +21,8 @@ typedef enum Id128Flag {
         ID128_REFUSE_NULL   = 1 << 3, /* Refuse all zero ID with -ENOMEDIUM. */
 } Id128Flag;
 
+int id128_from_string_nonzero(const char *s, sd_id128_t *ret);
+
 int id128_read_fd(int fd, Id128Flag f, sd_id128_t *ret);
 int id128_read_at(int dir_fd, const char *path, Id128Flag f, sd_id128_t *ret);
 static inline int id128_read(const char *path, Id128Flag f, sd_id128_t *ret) {
index 6a82a7f7b890b8b1db308927a806ca0a17907e07..9fda79ae266cf716634d36f0f4359c79963c429d 100644 (file)
@@ -338,18 +338,20 @@ _public_ int sd_id128_randomize(sd_id128_t *ret) {
         return 0;
 }
 
-static int get_app_specific(sd_id128_t base, sd_id128_t app_id, sd_id128_t *ret) {
-        uint8_t hmac[SHA256_DIGEST_SIZE];
-        sd_id128_t result;
+_public_ int sd_id128_get_app_specific(sd_id128_t base, sd_id128_t app_id, sd_id128_t *ret) {
+        assert_cc(sizeof(sd_id128_t) < SHA256_DIGEST_SIZE); /* Check that we don't need to pad with zeros. */
+        union {
+                uint8_t hmac[SHA256_DIGEST_SIZE];
+                sd_id128_t result;
+        } buf;
 
-        assert(ret);
+        assert_return(ret, -EINVAL);
+        assert_return(!sd_id128_is_null(app_id), -ENXIO);
 
-        hmac_sha256(&base, sizeof(base), &app_id, sizeof(app_id), hmac);
+        hmac_sha256(&base, sizeof(base), &app_id, sizeof(app_id), buf.hmac);
 
         /* Take only the first half. */
-        memcpy(&result, hmac, MIN(sizeof(hmac), sizeof(result)));
-
-        *ret = id128_make_v4_uuid(result);
+        *ret = id128_make_v4_uuid(buf.result);
         return 0;
 }
 
@@ -363,7 +365,7 @@ _public_ int sd_id128_get_machine_app_specific(sd_id128_t app_id, sd_id128_t *re
         if (r < 0)
                 return r;
 
-        return get_app_specific(id, app_id, ret);
+        return sd_id128_get_app_specific(id, app_id, ret);
 }
 
 _public_ int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret) {
@@ -376,5 +378,5 @@ _public_ int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret)
         if (r < 0)
                 return r;
 
-        return get_app_specific(id, app_id, ret);
+        return sd_id128_get_app_specific(id, app_id, ret);
 }
index 06ffa137d41f1c59c390971aeb53313f72af8e99..95cf25bff00264672e1d626657bbf57bd0d428ba 100644 (file)
@@ -572,6 +572,10 @@ static int journal_file_verify_header(JournalFile *f) {
         if (journal_file_writable(f) && header_size != sizeof(Header))
                 return -EPROTONOSUPPORT;
 
+        /* Don't write to journal files without the new boot ID update behavior guarantee. */
+        if (journal_file_writable(f) && !JOURNAL_HEADER_TAIL_ENTRY_BOOT_ID(f->header))
+                return -EPROTONOSUPPORT;
+
         if (JOURNAL_HEADER_SEALED(f->header) && !JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays))
                 return -EBADMSG;
 
@@ -2283,18 +2287,15 @@ static int journal_file_append_entry_internal(
                                                "timestamp %" PRIu64 ", refusing entry.",
                                                ts->realtime, le64toh(f->header->tail_entry_realtime));
 
-                if (!sd_id128_is_null(f->header->tail_entry_boot_id) && boot_id) {
-
-                        if (!sd_id128_equal(f->header->tail_entry_boot_id, *boot_id))
-                                return log_debug_errno(SYNTHETIC_ERRNO(EREMOTE),
-                                                       "Boot ID to write is different from previous boot id, refusing entry.");
-
-                        if (ts->monotonic < le64toh(f->header->tail_entry_monotonic))
-                                return log_debug_errno(SYNTHETIC_ERRNO(ENOTNAM),
-                                                       "Monotonic timestamp %" PRIu64 " smaller than previous monotonic "
-                                                       "timestamp %" PRIu64 ", refusing entry.",
-                                                       ts->monotonic, le64toh(f->header->tail_entry_monotonic));
-                }
+                if ((!boot_id || sd_id128_equal(*boot_id, f->header->tail_entry_boot_id)) &&
+                    ts->monotonic < le64toh(f->header->tail_entry_monotonic))
+                        return log_debug_errno(
+                                        SYNTHETIC_ERRNO(ENOTNAM),
+                                        "Monotonic timestamp %" PRIu64
+                                        " smaller than previous monotonic timestamp %" PRIu64
+                                        " while having the same boot ID, refusing entry.",
+                                        ts->monotonic,
+                                        le64toh(f->header->tail_entry_monotonic));
         }
 
         if (seqnum_id) {
index cc72d6ca8f057e791946a621d177a030859431bb..8704f44dfd7989a5b9564be6c455211068a9ff00 100644 (file)
@@ -113,32 +113,6 @@ static OutputFlags get_output_flags(void) {
                 colors_enabled() * OUTPUT_COLOR;
 }
 
-static int get_session_path(sd_bus *bus, const char *session_id, sd_bus_error *error, char **path) {
-        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
-        char *ans;
-        int r;
-
-        assert(bus);
-        assert(session_id);
-        assert(error);
-        assert(path);
-
-        r = bus_call_method(bus, bus_login_mgr, "GetSession", error, &reply, "s", session_id);
-        if (r < 0)
-                return r;
-
-        r = sd_bus_message_read(reply, "o", &ans);
-        if (r < 0)
-                return r;
-
-        ans = strdup(ans);
-        if (!ans)
-                return -ENOMEM;
-
-        *path = ans;
-        return 0;
-}
-
 static int show_table(Table *table, const char *word) {
         int r;
 
@@ -375,14 +349,20 @@ static int list_seats(int argc, char *argv[], void *userdata) {
         return show_table(table, "seats");
 }
 
-static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit, pid_t leader) {
-        _cleanup_free_ char *cgroup = NULL;
+static int show_unit_cgroup(
+                sd_bus *bus,
+                const char *unit,
+                pid_t leader,
+                const char *prefix) {
+
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_free_ char *cgroup = NULL;
         unsigned c;
         int r;
 
         assert(bus);
         assert(unit);
+        assert(prefix);
 
         r = show_cgroup_get_unit_path_and_warn(bus, unit, &cgroup);
         if (r < 0)
@@ -394,12 +374,9 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
         c = columns();
         if (c > 18)
                 c -= 18;
-        else
-                c = 0;
 
-        r = unit_show_processes(bus, unit, cgroup, "\t\t  ", c, get_output_flags(), &error);
+        r = unit_show_processes(bus, unit, cgroup, prefix, c, get_output_flags(), &error);
         if (r == -EBADR) {
-
                 if (arg_transport == BUS_TRANSPORT_REMOTE)
                         return 0;
 
@@ -408,7 +385,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
                 if (cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup) != 0 && leader <= 0)
                         return 0;
 
-                show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t  ", c, &leader, leader > 0, get_output_flags());
+                show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, prefix, c, &leader, leader > 0, get_output_flags());
         } else if (r < 0)
                 return log_error_errno(r, "Failed to dump process list: %s", bus_error_message(&error, r));
 
@@ -467,7 +444,25 @@ static int prop_map_sessions_strv(sd_bus *bus, const char *member, sd_bus_messag
         return sd_bus_message_exit_container(m);
 }
 
-static int print_session_status_info(sd_bus *bus, const char *path, bool *new_line) {
+static int mark_session(char **sessions, const char *target_session) {
+        assert(sessions);
+        assert(target_session);
+
+        STRV_FOREACH(i, sessions)
+                if (streq(*i, target_session)) {
+                        _cleanup_free_ char *marked = NULL;
+
+                        marked = strjoin("*", target_session);
+                        if (!marked)
+                                return log_oom();
+
+                        return free_and_replace(*i, marked);
+                }
+
+        return 0;
+}
+
+static int print_session_status_info(sd_bus *bus, const char *path) {
 
         static const struct bus_properties_map map[] = {
                 { "Id",                     "s",    NULL,                     offsetof(SessionStatusInfo,  id)                            },
@@ -497,6 +492,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
 
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
+        _cleanup_(table_unrefp) Table *table = NULL;
         SessionStatusInfo i = {};
         int r;
 
@@ -504,95 +500,148 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
         if (r < 0)
                 return log_error_errno(r, "Could not get properties: %s", bus_error_message(&error, r));
 
-        if (*new_line)
-                printf("\n");
-
-        *new_line = true;
+        table = table_new_vertical();
+        if (!table)
+                return log_oom();
 
-        printf("%s - ", strna(i.id));
+        if (dual_timestamp_is_set(&i.timestamp)) {
+                r = table_add_cell(table, NULL, TABLE_FIELD, "Since");
+                if (r < 0)
+                        return table_log_add_error(r);
 
-        if (i.name)
-                printf("%s (" UID_FMT ")\n", i.name, i.uid);
-        else
-                printf(UID_FMT "\n", i.uid);
+                r = table_add_cell_stringf(table, NULL, "%s; %s",
+                                           FORMAT_TIMESTAMP(i.timestamp.realtime),
+                                           FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.timestamp.monotonic));
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-        if (dual_timestamp_is_set(&i.timestamp))
-                printf("\t   Since: %s; %s\n",
-                       FORMAT_TIMESTAMP(i.timestamp.realtime),
-                       FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.timestamp.monotonic));
+        r = table_add_many(table,
+                           TABLE_FIELD, "State",
+                           TABLE_STRING, i.state);
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (i.leader > 0) {
-                _cleanup_free_ char *t = NULL;
+                _cleanup_free_ char *name = NULL;
 
-                printf("\t  Leader: " PID_FMT, i.leader);
+                (void) get_process_comm(i.leader, &name);
 
-                (void) get_process_comm(i.leader, &t);
-                if (t)
-                        printf(" (%s)", t);
+                r = table_add_cell(table, NULL, TABLE_FIELD, "Leader");
+                if (r < 0)
+                        return table_log_add_error(r);
 
-                printf("\n");
+                r = table_add_cell_stringf(table, NULL, PID_FMT "%s%s%s",
+                                           i.leader,
+                                           !isempty(name) ? " (" : "",
+                                           strempty(name),
+                                           !isempty(name) ? ")" : "");
+                if (r < 0)
+                        return table_log_add_error(r);
         }
 
-        if (!isempty(i.seat)) {
-                printf("\t    Seat: %s", i.seat);
-
-                if (i.vtnr > 0)
-                        printf("; vc%u", i.vtnr);
+        r = table_add_cell(table, NULL, TABLE_FIELD, "Seat");
+        if (r < 0)
+                return table_log_add_error(r);
 
-                printf("\n");
-        }
+        if (i.vtnr > 0)
+                r = table_add_cell_stringf(table, NULL, "%s; vc%u", i.seat, i.vtnr);
+        else
+                r = table_add_cell(table, NULL, TABLE_STRING, i.seat);
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (i.tty)
-                printf("\t     TTY: %s\n", i.tty);
+                r = table_add_many(table,
+                                   TABLE_FIELD, "TTY",
+                                   TABLE_STRING, i.tty);
         else if (i.display)
-                printf("\t Display: %s\n", i.display);
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Display",
+                                   TABLE_STRING, i.display);
+        else
+                r = 0;
+        if (r < 0)
+                return table_log_add_error(r);
+
+        r = table_add_cell(table, NULL, TABLE_FIELD, "Remote");
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (i.remote_host && i.remote_user)
-                printf("\t  Remote: %s@%s\n", i.remote_user, i.remote_host);
+                r = table_add_cell_stringf(table, NULL, "%s@%s", i.remote_user, i.remote_host);
         else if (i.remote_host)
-                printf("\t  Remote: %s\n", i.remote_host);
+                r = table_add_cell(table, NULL, TABLE_STRING, i.remote_host);
         else if (i.remote_user)
-                printf("\t  Remote: user %s\n", i.remote_user);
-        else if (i.remote)
-                printf("\t  Remote: Yes\n");
+                r = table_add_cell_stringf(table, NULL, "user %s", i.remote_user);
+        else
+                r = table_add_cell(table, NULL, TABLE_BOOLEAN, &i.remote);
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (i.service) {
-                printf("\t Service: %s", i.service);
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Service",
+                                   TABLE_STRING, i.service);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-                if (i.type)
-                        printf("; type %s", i.type);
+        if (i.type) {
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Type",
+                                   TABLE_STRING, i.type);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-                if (i.class)
-                        printf("; class %s", i.class);
+        if (i.class) {
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Class",
+                                   TABLE_STRING, i.class);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-                printf("\n");
-        } else if (i.type) {
-                printf("\t    Type: %s", i.type);
+        if (!isempty(i.desktop)) {
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Desktop",
+                                   TABLE_STRING, i.desktop);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-                if (i.class)
-                        printf("; class %s", i.class);
+        r = table_add_cell(table, NULL, TABLE_FIELD, "Idle");
+        if (r < 0)
+                return table_log_add_error(r);
 
-                printf("\n");
-        } else if (i.class)
-                printf("\t   Class: %s\n", i.class);
+        if (i.idle_hint && dual_timestamp_is_set(&i.idle_hint_timestamp))
+                r = table_add_cell_stringf(table, NULL, "%s since %s (%s)",
+                                           yes_no(i.idle_hint),
+                                           FORMAT_TIMESTAMP(i.idle_hint_timestamp.realtime),
+                                           FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.idle_hint_timestamp.monotonic));
+        else
+                r = table_add_cell(table, NULL, TABLE_BOOLEAN, &i.idle_hint);
+        if (r < 0)
+                return table_log_add_error(r);
 
-        if (!isempty(i.desktop))
-                printf("\t Desktop: %s\n", i.desktop);
+        if (i.scope) {
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Unit",
+                                   TABLE_STRING, i.scope);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-        if (i.state)
-                printf("\t   State: %s\n", i.state);
+        /* We don't use the table to show the header, in order to make the width of the column stable. */
+        printf("%s%s - %s (" UID_FMT ")%s\n", ansi_highlight(), i.id, i.name, i.uid, ansi_normal());
 
-        if (i.idle_hint && dual_timestamp_is_set(&i.idle_hint_timestamp))
-                printf("\t    Idle: %s since %s (%s)\n",
-                       yes_no(i.idle_hint),
-                       FORMAT_TIMESTAMP(i.idle_hint_timestamp.realtime),
-                       FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.idle_hint_timestamp.monotonic));
-        else
-                printf("\t    Idle: %s\n", yes_no(i.idle_hint));
+        r = table_print(table, NULL);
+        if (r < 0)
+                return table_log_print_error(r);
 
         if (i.scope) {
-                printf("\t    Unit: %s\n", i.scope);
-                show_unit_cgroup(bus, "org.freedesktop.systemd1.Scope", i.scope, i.leader);
+                show_unit_cgroup(bus, i.scope, i.leader, /* prefix = */ strrepa(" ", STRLEN("Display: ")));
 
                 if (arg_transport == BUS_TRANSPORT_LOCAL)
                         show_journal_by_unit(
@@ -613,7 +662,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
         return 0;
 }
 
-static int print_user_status_info(sd_bus *bus, const char *path, bool *new_line) {
+static int print_user_status_info(sd_bus *bus, const char *path) {
 
         static const struct bus_properties_map map[] = {
                 { "Name",               "s",     NULL,                     offsetof(UserStatusInfo, name)                },
@@ -631,66 +680,92 @@ static int print_user_status_info(sd_bus *bus, const char *path, bool *new_line)
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         _cleanup_(user_status_info_done) UserStatusInfo i = {};
+        _cleanup_(table_unrefp) Table *table = NULL;
         int r;
 
         r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, BUS_MAP_BOOLEAN_AS_BOOL, &error, &m, &i);
         if (r < 0)
                 return log_error_errno(r, "Could not get properties: %s", bus_error_message(&error, r));
 
-        if (*new_line)
-                printf("\n");
-
-        *new_line = true;
+        table = table_new_vertical();
+        if (!table)
+                return log_oom();
 
-        if (i.name)
-                printf("%s (%"PRIu32")\n", i.name, i.uid);
-        else
-                printf("%"PRIu32"\n", i.uid);
+        if (dual_timestamp_is_set(&i.timestamp)) {
+                r = table_add_cell(table, NULL, TABLE_FIELD, "Since");
+                if (r < 0)
+                        return table_log_add_error(r);
 
-        if (dual_timestamp_is_set(&i.timestamp))
-                printf("\t   Since: %s; %s\n",
-                       FORMAT_TIMESTAMP(i.timestamp.realtime),
-                       FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.timestamp.monotonic));
+                r = table_add_cell_stringf(table, NULL, "%s; %s",
+                                           FORMAT_TIMESTAMP(i.timestamp.realtime),
+                                           FORMAT_TIMESTAMP_RELATIVE_MONOTONIC(i.timestamp.monotonic));
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
 
-        if (!isempty(i.state))
-                printf("\t   State: %s\n", i.state);
+        r = table_add_many(table,
+                           TABLE_FIELD, "State",
+                           TABLE_STRING, i.state);
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (!strv_isempty(i.sessions)) {
-                printf("\tSessions:");
+                _cleanup_strv_free_ char **sessions = TAKE_PTR(i.sessions);
 
-                STRV_FOREACH(l, i.sessions)
-                        printf(" %s%s",
-                               streq_ptr(*l, i.display) ? "*" : "",
-                               *l);
+                r = mark_session(sessions, i.display);
+                if (r < 0)
+                        return r;
 
-                printf("\n");
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Sessions",
+                                   TABLE_STRV_WRAPPED, sessions);
+                if (r < 0)
+                        return table_log_add_error(r);
         }
 
-        printf("\t  Linger: %s\n", yes_no(i.linger));
+        r = table_add_many(table,
+                           TABLE_FIELD, "Linger",
+                           TABLE_BOOLEAN, i.linger);
+        if (r < 0)
+                return table_log_add_error(r);
 
         if (i.slice) {
-                printf("\t    Unit: %s\n", i.slice);
-                show_unit_cgroup(bus, "org.freedesktop.systemd1.Slice", i.slice, 0);
-
-                show_journal_by_unit(
-                                stdout,
-                                i.slice,
-                                NULL,
-                                arg_output,
-                                0,
-                                i.timestamp.monotonic,
-                                arg_lines,
-                                0,
-                                get_output_flags() | OUTPUT_BEGIN_NEWLINE,
-                                SD_JOURNAL_LOCAL_ONLY,
-                                true,
-                                NULL);
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Unit",
+                                   TABLE_STRING, i.slice);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
+
+        printf("%s%s (" UID_FMT ")%s\n", ansi_highlight(), i.name, i.uid, ansi_normal());
+
+        r = table_print(table, NULL);
+        if (r < 0)
+                return table_log_print_error(r);
+
+        if (i.slice) {
+                show_unit_cgroup(bus, i.slice, /* leader = */ 0, /* prefix = */ strrepa(" ", STRLEN("Sessions: ")));
+
+                if (arg_transport == BUS_TRANSPORT_LOCAL)
+                        show_journal_by_unit(
+                                        stdout,
+                                        i.slice,
+                                        NULL,
+                                        arg_output,
+                                        0,
+                                        i.timestamp.monotonic,
+                                        arg_lines,
+                                        0,
+                                        get_output_flags() | OUTPUT_BEGIN_NEWLINE,
+                                        SD_JOURNAL_LOCAL_ONLY,
+                                        true,
+                                        NULL);
         }
 
         return 0;
 }
 
-static int print_seat_status_info(sd_bus *bus, const char *path, bool *new_line) {
+static int print_seat_status_info(sd_bus *bus, const char *path) {
 
         static const struct bus_properties_map map[] = {
                 { "Id",            "s",     NULL,                     offsetof(SeatStatusInfo, id)             },
@@ -702,44 +777,51 @@ static int print_seat_status_info(sd_bus *bus, const char *path, bool *new_line)
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
         _cleanup_(seat_status_info_done) SeatStatusInfo i = {};
+        _cleanup_(table_unrefp) Table *table = NULL;
         int r;
 
         r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, 0, &error, &m, &i);
         if (r < 0)
                 return log_error_errno(r, "Could not get properties: %s", bus_error_message(&error, r));
 
-        if (*new_line)
-                printf("\n");
-
-        *new_line = true;
-
-        printf("%s\n", strna(i.id));
+        table = table_new_vertical();
+        if (!table)
+                return log_oom();
 
         if (!strv_isempty(i.sessions)) {
-                printf("\tSessions:");
+                _cleanup_strv_free_ char **sessions = TAKE_PTR(i.sessions);
 
-                STRV_FOREACH(l, i.sessions) {
-                        if (streq_ptr(*l, i.active_session))
-                                printf(" *%s", *l);
-                        else
-                                printf(" %s", *l);
-                }
+                r = mark_session(sessions, i.active_session);
+                if (r < 0)
+                        return r;
 
-                printf("\n");
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Sessions",
+                                   TABLE_STRV_WRAPPED, sessions);
+                if (r < 0)
+                        return table_log_add_error(r);
         }
 
         if (arg_transport == BUS_TRANSPORT_LOCAL) {
-                unsigned c;
+                r = table_add_many(table,
+                                   TABLE_FIELD, "Devices",
+                                   TABLE_EMPTY);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
+
+        printf("%s%s%s\n", ansi_highlight(), i.id, ansi_normal());
+
+        r = table_print(table, NULL);
+        if (r < 0)
+                return table_log_print_error(r);
 
-                c = columns();
+        if (arg_transport == BUS_TRANSPORT_LOCAL) {
+                unsigned c = columns();
                 if (c > 21)
                         c -= 21;
-                else
-                        c = 0;
 
-                printf("\t Devices:\n");
-
-                show_sysfs(i.id, "\t\t  ", c, get_output_flags());
+                show_sysfs(i.id, strrepa(" ", STRLEN("Sessions:")), c, get_output_flags());
         }
 
         return 0;
@@ -825,17 +907,11 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
         return 0;
 }
 
-static int show_properties(sd_bus *bus, const char *path, bool *new_line) {
+static int show_properties(sd_bus *bus, const char *path) {
         int r;
 
         assert(bus);
         assert(path);
-        assert(new_line);
-
-        if (*new_line)
-                printf("\n");
-
-        *new_line = true;
 
         r = bus_print_all_properties(
                         bus,
@@ -851,12 +927,46 @@ static int show_properties(sd_bus *bus, const char *path, bool *new_line) {
         return 0;
 }
 
+static int get_bus_path_by_id(
+                sd_bus *bus,
+                const char *type,
+                const char *method,
+                const char *id,
+                char **ret) {
+
+        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
+        _cleanup_free_ char *p = NULL;
+        const char *path;
+        int r;
+
+        assert(bus);
+        assert(type);
+        assert(STR_IN_SET(type, "session", "seat"));
+        assert(method);
+        assert(id);
+        assert(ret);
+
+        r = bus_call_method(bus, bus_login_mgr, method, &error, &reply, "s", id);
+        if (r < 0)
+                return log_error_errno(r, "Failed to get path for %s '%s': %s", type, id, bus_error_message(&error, r));
+
+        r = sd_bus_message_read(reply, "o", &path);
+        if (r < 0)
+                return bus_log_parse_error(r);
+
+        p = strdup(path);
+        if (!p)
+                return log_oom();
+
+        *ret = TAKE_PTR(p);
+        return 0;
+}
+
 static int show_session(int argc, char *argv[], void *userdata) {
-        bool properties, new_line = false;
         sd_bus *bus = ASSERT_PTR(userdata);
+        bool properties;
         int r;
-        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
-        _cleanup_free_ char *path = NULL;
 
         assert(argv);
 
@@ -867,21 +977,25 @@ static int show_session(int argc, char *argv[], void *userdata) {
         if (argc <= 1) {
                 /* If no argument is specified inspect the manager itself */
                 if (properties)
-                        return show_properties(bus, "/org/freedesktop/login1", &new_line);
+                        return show_properties(bus, "/org/freedesktop/login1");
 
-                return print_session_status_info(bus, "/org/freedesktop/login1/session/auto", &new_line);
+                return print_session_status_info(bus, "/org/freedesktop/login1/session/auto");
         }
 
-        for (int i = 1; i < argc; i++) {
-                r = get_session_path(bus, argv[i], &error, &path);
+        for (int i = 1, first = true; i < argc; i++, first = false) {
+                _cleanup_free_ char *path = NULL;
+
+                r = get_bus_path_by_id(bus, "session", "GetSession", argv[i], &path);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to get session path: %s", bus_error_message(&error, r));
+                        return r;
+
+                if (!first)
+                        putchar('\n');
 
                 if (properties)
-                        r = show_properties(bus, path, &new_line);
+                        r = show_properties(bus, path);
                 else
-                        r = print_session_status_info(bus, path, &new_line);
-
+                        r = print_session_status_info(bus, path);
                 if (r < 0)
                         return r;
         }
@@ -890,8 +1004,8 @@ static int show_session(int argc, char *argv[], void *userdata) {
 }
 
 static int show_user(int argc, char *argv[], void *userdata) {
-        bool properties, new_line = false;
         sd_bus *bus = ASSERT_PTR(userdata);
+        bool properties;
         int r;
 
         assert(argv);
@@ -903,15 +1017,15 @@ static int show_user(int argc, char *argv[], void *userdata) {
         if (argc <= 1) {
                 /* If no argument is specified inspect the manager itself */
                 if (properties)
-                        return show_properties(bus, "/org/freedesktop/login1", &new_line);
+                        return show_properties(bus, "/org/freedesktop/login1");
 
-                return print_user_status_info(bus, "/org/freedesktop/login1/user/self", &new_line);
+                return print_user_status_info(bus, "/org/freedesktop/login1/user/self");
         }
 
-        for (int i = 1; i < argc; i++) {
+        for (int i = 1, first = true; i < argc; i++, first = false) {
                 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
-                _cleanup_(sd_bus_message_unrefp) sd_bus_message * reply = NULL;
-                const char *path = NULL;
+                _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
+                const char *path;
                 uid_t uid;
 
                 r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL, 0);
@@ -926,11 +1040,13 @@ static int show_user(int argc, char *argv[], void *userdata) {
                 if (r < 0)
                         return bus_log_parse_error(r);
 
+                if (!first)
+                        putchar('\n');
+
                 if (properties)
-                        r = show_properties(bus, path, &new_line);
+                        r = show_properties(bus, path);
                 else
-                        r = print_user_status_info(bus, path, &new_line);
-
+                        r = print_user_status_info(bus, path);
                 if (r < 0)
                         return r;
         }
@@ -939,8 +1055,8 @@ static int show_user(int argc, char *argv[], void *userdata) {
 }
 
 static int show_seat(int argc, char *argv[], void *userdata) {
-        bool properties, new_line = false;
         sd_bus *bus = ASSERT_PTR(userdata);
+        bool properties;
         int r;
 
         assert(argv);
@@ -952,29 +1068,25 @@ static int show_seat(int argc, char *argv[], void *userdata) {
         if (argc <= 1) {
                 /* If no argument is specified inspect the manager itself */
                 if (properties)
-                        return show_properties(bus, "/org/freedesktop/login1", &new_line);
+                        return show_properties(bus, "/org/freedesktop/login1");
 
-                return print_seat_status_info(bus, "/org/freedesktop/login1/seat/auto", &new_line);
+                return print_seat_status_info(bus, "/org/freedesktop/login1/seat/auto");
         }
 
-        for (int i = 1; i < argc; i++) {
-                _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
-                _cleanup_(sd_bus_message_unrefp) sd_bus_message * reply = NULL;
-                const char *path = NULL;
+        for (int i = 1, first = true; i < argc; i++, first = false) {
+                _cleanup_free_ char *path = NULL;
 
-                r = bus_call_method(bus, bus_login_mgr, "GetSeat", &error, &reply, "s", argv[i]);
+                r = get_bus_path_by_id(bus, "seat", "GetSeat", argv[i], &path);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to get seat: %s", bus_error_message(&error, r));
+                        return r;
 
-                r = sd_bus_message_read(reply, "o", &path);
-                if (r < 0)
-                        return bus_log_parse_error(r);
+                if (!first)
+                        putchar('\n');
 
                 if (properties)
-                        r = show_properties(bus, path, &new_line);
+                        r = show_properties(bus, path);
                 else
-                        r = print_seat_status_info(bus, path, &new_line);
-
+                        r = print_seat_status_info(bus, path);
                 if (r < 0)
                         return r;
         }
index b3a36d0d058df4682387d70e3eba5f8564b932be..2d1af602c0b81cc9af0717c2cc53e9b38680203e 100644 (file)
@@ -1325,7 +1325,7 @@ static int trigger_device(Manager *m, sd_device *parent) {
         return 0;
 }
 
-static int attach_device(Manager *m, const char *seat, const char *sysfs) {
+static int attach_device(Manager *m, const char *seat, const char *sysfs, sd_bus_error *error) {
         _cleanup_(sd_device_unrefp) sd_device *d = NULL;
         _cleanup_free_ char *rule = NULL, *file = NULL;
         const char *id_for_seat;
@@ -1337,13 +1337,13 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
 
         r = sd_device_new_from_syspath(&d, sysfs);
         if (r < 0)
-                return r;
+                return sd_bus_error_set_errnof(error, r, "Failed to open device '%s': %m", sysfs);
 
         if (sd_device_has_current_tag(d, "seat") <= 0)
-                return -ENODEV;
+                return sd_bus_error_set_errnof(error, ENODEV, "Device '%s' lacks 'seat' udev tag.", sysfs);
 
         if (sd_device_get_property_value(d, "ID_FOR_SEAT", &id_for_seat) < 0)
-                return -ENODEV;
+                return sd_bus_error_set_errnof(error, ENODEV, "Device '%s' lacks 'ID_FOR_SEAT' udev property.", sysfs);
 
         if (asprintf(&file, "/etc/udev/rules.d/72-seat-%s.rules", id_for_seat) < 0)
                 return -ENOMEM;
@@ -1428,7 +1428,7 @@ static int method_attach_device(sd_bus_message *message, void *userdata, sd_bus_
         if (r == 0)
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
 
-        r = attach_device(m, seat, sysfs);
+        r = attach_device(m, seat, sysfs, error);
         if (r < 0)
                 return r;
 
index 7d0e5d63457415bd8accf805de5e604a2ba43884..2ca9eac714b3ee329bf431cc82e4ba622656f1c6 100644 (file)
@@ -43,7 +43,9 @@ sources = files(
         'networkd-dhcp-server-bus.c',
         'networkd-dhcp-server-static-lease.c',
         'networkd-dhcp-server.c',
+        'networkd-dhcp4-bus.c',
         'networkd-dhcp4.c',
+        'networkd-dhcp6-bus.c',
         'networkd-dhcp6.c',
         'networkd-ipv4acd.c',
         'networkd-ipv4ll.c',
index 769cccf7484de9020c20717fe308410897a0a853..79fde024a365ef456e53b4ed24ed1c3527cd056e 100644 (file)
@@ -370,16 +370,11 @@ int config_parse_address_generation_type(
                 }
 
                 if (comma) {
-                        r = sd_id128_from_string(comma + 1, &secret_key);
+                        r = id128_from_string_nonzero(comma + 1, &secret_key);
                         if (r < 0) {
                                 log_syntax(unit, LOG_WARNING, filename, line, r,
-                                           "Failed to parse secret key in %s=, ignoring assignment: %s",
-                                           lvalue, rvalue);
-                                return 0;
-                        }
-                        if (sd_id128_is_null(secret_key)) {
-                                log_syntax(unit, LOG_WARNING, filename, line, 0,
-                                           "Secret key in %s= cannot be null, ignoring assignment: %s",
+                                           r == -ENXIO ? "Secret key in %s= cannot be null, ignoring assignment: %s"
+                                                       : "Failed to parse secret key in %s=, ignoring assignment: %s",
                                            lvalue, rvalue);
                                 return 0;
                         }
index 5b5b251e61ed259c5622dffd778e4a411e0d05e0..ff0ee717c5ddd51edd2e5ab9957f39aa6a2064fd 100644 (file)
@@ -6,7 +6,7 @@
 #include "bus-error.h"
 #include "bus-locator.h"
 #include "dhcp-identifier.h"
-#include "dhcp-internal.h"
+#include "dhcp-client-internal.h"
 #include "dhcp6-internal.h"
 #include "escape.h"
 #include "hexdecoct.h"
diff --git a/src/network/networkd-dhcp4-bus.c b/src/network/networkd-dhcp4-bus.c
new file mode 100644 (file)
index 0000000..cb88627
--- /dev/null
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "sd-dhcp-client.h"
+
+#include "alloc-util.h"
+#include "bus-common-errors.h"
+#include "bus-util.h"
+#include "dhcp-client-internal.h"
+#include "dhcp-protocol.h"
+#include "networkd-dhcp4-bus.h"
+#include "networkd-link-bus.h"
+#include "networkd-manager.h"
+#include "string-table.h"
+#include "strv.h"
+
+static int property_get_dhcp_client_state(
+                sd_bus *bus,
+                const char *path,
+                const char *interface,
+                const char *property,
+                sd_bus_message *reply,
+                void *userdata,
+                sd_bus_error *error) {
+
+        Link *l = ASSERT_PTR(userdata);
+        sd_dhcp_client *c;
+
+        assert(reply);
+
+        c = l->dhcp_client;
+        if (!c)
+                return sd_bus_message_append(reply, "s", "disabled");
+
+        return sd_bus_message_append(reply, "s", dhcp_state_to_string(dhcp_client_get_state(c)));
+}
+
+static int dhcp_client_emit_changed(Link *link, const char *property, ...) {
+        _cleanup_free_ char *path = NULL;
+        char **l;
+
+        assert(link);
+
+        if (sd_bus_is_ready(link->manager->bus) <= 0)
+                return 0;
+
+        path = link_bus_path(link);
+        if (!path)
+                return log_oom();
+
+        l = strv_from_stdarg_alloca(property);
+
+        return sd_bus_emit_properties_changed_strv(
+                        link->manager->bus,
+                        path,
+                        "org.freedesktop.network1.DHCPv4Client",
+                        l);
+}
+
+int dhcp_client_callback_bus(sd_dhcp_client *c, int event, void *userdata) {
+        Link *l = ASSERT_PTR(userdata);
+
+        return dhcp_client_emit_changed(l, "State", NULL);
+}
+
+static const sd_bus_vtable dhcp_client_vtable[] = {
+        SD_BUS_VTABLE_START(0),
+
+        SD_BUS_PROPERTY("State", "s", property_get_dhcp_client_state, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
+
+        SD_BUS_VTABLE_END
+};
+
+const BusObjectImplementation dhcp_client_object = {
+        "/org/freedesktop/network1/link",
+        "org.freedesktop.network1.DHCPv4Client",
+        .fallback_vtables = BUS_FALLBACK_VTABLES({dhcp_client_vtable, link_object_find}),
+        .node_enumerator = link_node_enumerator,
+};
diff --git a/src/network/networkd-dhcp4-bus.h b/src/network/networkd-dhcp4-bus.h
new file mode 100644 (file)
index 0000000..482e824
--- /dev/null
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "sd-dhcp-client.h"
+
+#include "networkd-link-bus.h"
+
+extern const BusObjectImplementation dhcp_client_object;
+
+int dhcp_client_callback_bus(sd_dhcp_client *client, int event, void *userdata);
index 9dcd37e11c6ab264d438717844342d0ee67f873b..f952d6dfbcc2f555a61183151e7764d749fc49a4 100644 (file)
@@ -13,6 +13,7 @@
 #include "network-internal.h"
 #include "networkd-address.h"
 #include "networkd-dhcp-prefix-delegation.h"
+#include "networkd-dhcp4-bus.h"
 #include "networkd-dhcp4.h"
 #include "networkd-ipv4acd.h"
 #include "networkd-link.h"
@@ -1482,6 +1483,10 @@ static int dhcp4_configure(Link *link) {
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set request flag for broadcast: %m");
 
+        r = dhcp_client_set_state_callback(link->dhcp_client, dhcp_client_callback_bus, link);
+        if (r < 0)
+                return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set state change callback: %m");
+
         if (link->mtu > 0) {
                 r = sd_dhcp_client_set_mtu(link->dhcp_client, link->mtu);
                 if (r < 0)
diff --git a/src/network/networkd-dhcp6-bus.c b/src/network/networkd-dhcp6-bus.c
new file mode 100644 (file)
index 0000000..a225877
--- /dev/null
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "alloc-util.h"
+#include "bus-common-errors.h"
+#include "bus-util.h"
+#include "dhcp6-client-internal.h"
+#include "dhcp6-protocol.h"
+#include "networkd-dhcp6-bus.h"
+#include "networkd-link-bus.h"
+#include "networkd-manager.h"
+#include "string-table.h"
+#include "strv.h"
+
+static int property_get_dhcp6_client_state(
+                sd_bus *bus,
+                const char *path,
+                const char *interface,
+                const char *property,
+                sd_bus_message *reply,
+                void *userdata,
+                sd_bus_error *error) {
+
+        Link *l = ASSERT_PTR(userdata);
+        sd_dhcp6_client *c;
+
+        assert(reply);
+
+        c = l->dhcp6_client;
+        if (!c)
+                return sd_bus_message_append(reply, "s", "disabled");
+
+        return sd_bus_message_append(reply, "s", dhcp6_state_to_string(dhcp6_client_get_state(c)));
+}
+
+static int dhcp6_client_emit_changed(Link *link, const char *property, ...) {
+        _cleanup_free_ char *path = NULL;
+        char **l;
+
+        assert(link);
+
+        if (sd_bus_is_ready(link->manager->bus) <= 0)
+                return 0;
+
+        path = link_bus_path(link);
+        if (!path)
+                return log_oom();
+
+        l = strv_from_stdarg_alloca(property);
+
+        return sd_bus_emit_properties_changed_strv(
+                        link->manager->bus,
+                        path,
+                        "org.freedesktop.network1.DHCPv6Client",
+                        l);
+}
+
+void dhcp6_client_callback_bus(sd_dhcp6_client *c, int event, void *userdata) {
+        Link *l = ASSERT_PTR(userdata);
+
+        dhcp6_client_emit_changed(l, "State", NULL);
+}
+
+static const sd_bus_vtable dhcp6_client_vtable[] = {
+        SD_BUS_VTABLE_START(0),
+
+        SD_BUS_PROPERTY("State", "s", property_get_dhcp6_client_state, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
+
+        SD_BUS_VTABLE_END
+};
+
+const BusObjectImplementation dhcp6_client_object = {
+        "/org/freedesktop/network1/link",
+        "org.freedesktop.network1.DHCPv6Client",
+        .fallback_vtables = BUS_FALLBACK_VTABLES({dhcp6_client_vtable, link_object_find}),
+        .node_enumerator = link_node_enumerator,
+};
diff --git a/src/network/networkd-dhcp6-bus.h b/src/network/networkd-dhcp6-bus.h
new file mode 100644 (file)
index 0000000..76a6b72
--- /dev/null
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "sd-dhcp6-client.h"
+
+#include "networkd-link-bus.h"
+
+extern const BusObjectImplementation dhcp6_client_object;
+
+void dhcp6_client_callback_bus(sd_dhcp6_client *client, int event, void *userdata);
index 95b13ca93c6191db82b419cfa8c46781441a588f..57e108721162cccda04b6b009ed89d0a6a98e691 100644 (file)
@@ -5,11 +5,13 @@
 
 #include "sd-dhcp6-client.h"
 
+#include "dhcp6-client-internal.h"
 #include "hashmap.h"
 #include "hostname-setup.h"
 #include "hostname-util.h"
 #include "networkd-address.h"
 #include "networkd-dhcp-prefix-delegation.h"
+#include "networkd-dhcp6-bus.h"
 #include "networkd-dhcp6.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
@@ -699,6 +701,10 @@ static int dhcp6_configure(Link *link) {
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to set callback: %m");
 
+        r = dhcp6_client_set_state_callback(client, dhcp6_client_callback_bus, link);
+        if (r < 0)
+                return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to set state change callback: %m");
+
         r = sd_dhcp6_client_set_prefix_delegation(client, link->network->dhcp6_use_pd_prefix);
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to %s requesting prefixes to be delegated: %m",
index a9e33ac627ec44b2069cd2d1994bf67bb3245be3..92a086af64251f4b1929fa6fc6fa83582f651430 100644 (file)
@@ -9,6 +9,7 @@
 #include "netif-util.h"
 #include "networkd-address.h"
 #include "networkd-dhcp-common.h"
+#include "networkd-dhcp-prefix-delegation.h"
 #include "networkd-json.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
@@ -921,6 +922,35 @@ static int captive_portal_append_json(Link *link, JsonVariant **v) {
         return json_variant_merge_objectb(v, JSON_BUILD_OBJECT(JSON_BUILD_PAIR_STRING("CaptivePortal", captive_portal)));
 }
 
+static int pref64_append_json(Link *link, JsonVariant **v) {
+        _cleanup_(json_variant_unrefp) JsonVariant *array = NULL, *w = NULL;
+        NDiscPREF64 *i;
+        int r;
+
+        assert(link);
+        assert(v);
+
+        if (!link->network || !link->network->ipv6_accept_ra_use_pref64)
+                return 0;
+
+        SET_FOREACH(i, link->ndisc_pref64) {
+                r = json_variant_append_arrayb(&array,
+                                               JSON_BUILD_OBJECT(
+                                                               JSON_BUILD_PAIR_IN6_ADDR_NON_NULL("Prefix", &i->prefix),
+                                                               JSON_BUILD_PAIR_UNSIGNED("PrefixLength", i->prefix_len),
+                                                               JSON_BUILD_PAIR_FINITE_USEC("LifetimeUSec", i->lifetime_usec),
+                                                               JSON_BUILD_PAIR_IN6_ADDR_NON_NULL("ConfigProvider", &i->router)));
+                if (r < 0)
+                        return r;
+        }
+
+        r = json_append_one(&w, "PREF64", array);
+        if (r < 0)
+                return r;
+
+        return json_append_one(v, "NDisc", w);
+}
+
 static int dhcp_server_offered_leases_append_json(Link *link, JsonVariant **v) {
         _cleanup_(json_variant_unrefp) JsonVariant *array = NULL;
         DHCPLease *lease;
@@ -1016,6 +1046,7 @@ static int dhcp_server_append_json(Link *link, JsonVariant **v) {
 
 static int dhcp6_client_lease_append_json(Link *link, JsonVariant **v) {
         _cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
+        uint64_t lease_timestamp_usec;
         int r;
 
         assert(link);
@@ -1024,15 +1055,59 @@ static int dhcp6_client_lease_append_json(Link *link, JsonVariant **v) {
         if (!link->dhcp6_lease)
                 return 0;
 
+        r = sd_dhcp6_lease_get_timestamp(link->dhcp6_lease, CLOCK_BOOTTIME, &lease_timestamp_usec);
+        if (r < 0)
+                return 0;
+
         r = json_build(&w, JSON_BUILD_OBJECT(
-                                JSON_BUILD_PAIR_FINITE_USEC("T1", link->dhcp6_lease->lifetime_t1),
-                                JSON_BUILD_PAIR_FINITE_USEC("T2", link->dhcp6_lease->lifetime_t2)));
+                                JSON_BUILD_PAIR_FINITE_USEC("Timeout1USec",
+                                        link->dhcp6_lease->lifetime_t1 + lease_timestamp_usec),
+                                JSON_BUILD_PAIR_FINITE_USEC("Timeout2USec",
+                                        link->dhcp6_lease->lifetime_t2 + lease_timestamp_usec),
+                                JSON_BUILD_PAIR_FINITE_USEC("LeaseTimestampUSec",
+                                        lease_timestamp_usec)));
         if (r < 0)
                 return r;
 
         return json_append_one(v, "Lease", w);
 }
 
+static int dhcp6_client_pd_append_json(Link *link, JsonVariant **v) {
+        _cleanup_(json_variant_unrefp) JsonVariant *array = NULL;
+        struct in6_addr prefix;
+        uint32_t lifetime_preferred, lifetime_valid;
+        uint8_t prefix_len;
+        uint64_t lease_timestamp_usec;
+        int r;
+
+        assert(link);
+        assert(link->network);
+        assert(v);
+
+        if (!link->network->dhcp6_use_pd_prefix || !link->dhcp6_lease || !dhcp6_lease_has_pd_prefix(link->dhcp6_lease))
+                return 0;
+
+        sd_dhcp6_lease_reset_pd_prefix_iter(link->dhcp6_lease);
+
+        r = sd_dhcp6_lease_get_timestamp(link->dhcp6_lease, CLOCK_BOOTTIME, &lease_timestamp_usec);
+        if (r < 0)
+                return 0;
+
+        while (sd_dhcp6_lease_get_pd(link->dhcp6_lease, &prefix, &prefix_len, &lifetime_preferred, &lifetime_valid) >= 0) {
+                r = json_variant_append_arrayb(&array, JSON_BUILD_OBJECT(
+                                               JSON_BUILD_PAIR_IN6_ADDR("Prefix", &prefix),
+                                               JSON_BUILD_PAIR_UNSIGNED("PrefixLength", prefix_len),
+                                               JSON_BUILD_PAIR_FINITE_USEC("PreferredLifetimeUSec",
+                                                                           sec_to_usec(lifetime_preferred, lease_timestamp_usec)),
+                                               JSON_BUILD_PAIR_FINITE_USEC("ValidLifetimeUSec",
+                                                                           sec_to_usec(lifetime_valid, lease_timestamp_usec))));
+                if (r < 0)
+                        return r;
+        }
+
+        return json_append_one(v, "Prefixes", array);
+}
+
 static int dhcp6_client_append_json(Link *link, JsonVariant **v) {
         _cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
         int r;
@@ -1047,9 +1122,106 @@ static int dhcp6_client_append_json(Link *link, JsonVariant **v) {
         if (r < 0)
                 return r;
 
+        r = dhcp6_client_pd_append_json(link, &w);
+        if (r < 0)
+                return r;
+
         return json_append_one(v, "DHCPv6Client", w);
 }
 
+static int dhcp_client_lease_append_json(Link *link, JsonVariant **v) {
+        _cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
+        uint32_t t1, t2;
+        uint64_t lease_timestamp_usec;
+        int r;
+
+        assert(link);
+        assert(v);
+
+        if (!link->dhcp_client || !link->dhcp_lease)
+                return 0;
+
+        r = sd_dhcp_lease_get_t1(link->dhcp_lease, &t1);
+        if (r < 0)
+                return 0;
+
+        r = sd_dhcp_lease_get_t2(link->dhcp_lease, &t2);
+        if (r < 0)
+                return 0;
+
+        r = sd_dhcp_client_get_lease_timestamp(link->dhcp_client, &lease_timestamp_usec);
+        if (r < 0)
+                return 0;
+
+        r = json_build(&w, JSON_BUILD_OBJECT(
+                                JSON_BUILD_PAIR_FINITE_USEC("Timeout1USec",
+                                                            sec_to_usec(t1, lease_timestamp_usec)),
+                                JSON_BUILD_PAIR_FINITE_USEC("Timeout2USec",
+                                                            sec_to_usec(t2, lease_timestamp_usec)),
+                                JSON_BUILD_PAIR_FINITE_USEC("LeaseTimestampUSec", lease_timestamp_usec)));
+        if (r < 0)
+                return r;
+
+        return json_append_one(v, "Lease", w);
+}
+
+static int dhcp_client_pd_append_json(Link *link, JsonVariant **v) {
+        _cleanup_(json_variant_unrefp) JsonVariant *addresses = NULL, *array = NULL;
+        uint8_t ipv4masklen, sixrd_prefixlen;
+        struct in6_addr sixrd_prefix;
+        const struct in_addr *br_addresses;
+        size_t n_br_addresses = 0;
+        int r;
+
+        assert(link);
+        assert(link->network);
+        assert(v);
+
+        if (!link->network->dhcp_use_6rd || !link->dhcp_lease || !dhcp4_lease_has_pd_prefix(link->dhcp_lease))
+                return 0;
+
+        r = sd_dhcp_lease_get_6rd(link->dhcp_lease, &ipv4masklen, &sixrd_prefixlen, &sixrd_prefix, &br_addresses, &n_br_addresses);
+        if (r < 0)
+                return r;
+
+        FOREACH_ARRAY(br_address, br_addresses, n_br_addresses) {
+                r = json_variant_append_arrayb(&addresses, JSON_BUILD_IN4_ADDR(br_address));
+                if (r < 0)
+                        return r;
+        }
+
+        r = json_build(&array, JSON_BUILD_OBJECT(
+                                       JSON_BUILD_PAIR_IN6_ADDR("Prefix", &sixrd_prefix),
+                                       JSON_BUILD_PAIR_UNSIGNED("PrefixLength", sixrd_prefixlen),
+                                       JSON_BUILD_PAIR_UNSIGNED("IPv4MaskLength", ipv4masklen),
+                                       JSON_BUILD_PAIR_VARIANT_NON_NULL("BorderRouters", addresses)));
+        if (r < 0)
+                return r;
+
+        return json_append_one(v, "6rdPrefix", array);
+}
+
+static int dhcp_client_append_json(Link *link, JsonVariant **v) {
+        _cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
+        int r;
+
+        assert(link);
+        assert(v);
+
+        if (!link->dhcp_client)
+                return 0;
+
+        r = dhcp_client_lease_append_json(link, &w);
+        if (r < 0)
+                return r;
+
+        r = dhcp_client_pd_append_json(link, &w);
+        if (r < 0)
+                return r;
+
+        return json_append_one(v, "DHCPv4Client", w);
+}
+
 int link_build_json(Link *link, JsonVariant **ret) {
         _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
         _cleanup_free_ char *type = NULL, *flags = NULL;
@@ -1145,6 +1317,10 @@ int link_build_json(Link *link, JsonVariant **ret) {
         if (r < 0)
                 return r;
 
+        r = pref64_append_json(link, &v);
+        if (r < 0)
+                return r;
+
         r = addresses_append_json(link->addresses, &v);
         if (r < 0)
                 return r;
@@ -1165,6 +1341,10 @@ int link_build_json(Link *link, JsonVariant **ret) {
         if (r < 0)
                 return r;
 
+        r = dhcp_client_append_json(link, &v);
+        if (r < 0)
+                return r;
+
         r = dhcp6_client_append_json(link, &v);
         if (r < 0)
                 return r;
index e9c18f0fd01de8c804aca98e70fab36023b4aebf..06749307832635f4fd55f32b271eada4fbb00756 100644 (file)
@@ -862,6 +862,12 @@ int link_object_find(sd_bus *bus, const char *path, const char *interface, void
             (!link->dhcp_server || sd_dhcp_server_is_in_relay_mode(link->dhcp_server)))
                 return 0;
 
+        if (streq(interface, "org.freedesktop.network1.DHCPv4Client") && !link->dhcp_client)
+                return 0;
+
+        if (streq(interface, "org.freedesktop.network1.DHCPv6Client") && !link->dhcp6_client)
+                return 0;
+
         *found = link;
 
         return 1;
index e46e5f0c617cfa8f1e441fa383fc2cde8c7aa622..8ced02f3c1aeb0872b2c4a8815bde18ffe53bf04 100644 (file)
@@ -157,6 +157,7 @@ typedef struct Link {
         Set *ndisc_rdnss;
         Set *ndisc_dnssl;
         Set *ndisc_captive_portals;
+        Set *ndisc_pref64;
         unsigned ndisc_messages;
         bool ndisc_configured:1;
 
index 67f951df69d5e80fb08cafa3d563b93d1917665b..7813a3173a59349f8241bdb2680c9351a5326215 100644 (file)
@@ -9,6 +9,8 @@
 #include "bus-message-util.h"
 #include "bus-polkit.h"
 #include "networkd-dhcp-server-bus.h"
+#include "networkd-dhcp4-bus.h"
+#include "networkd-dhcp6-bus.h"
 #include "networkd-json.h"
 #include "networkd-link-bus.h"
 #include "networkd-link.h"
@@ -413,5 +415,6 @@ const BusObjectImplementation manager_object = {
         "/org/freedesktop/network1",
         "org.freedesktop.network1.Manager",
         .vtables = BUS_VTABLES(manager_vtable),
-        .children = BUS_IMPLEMENTATIONS(&dhcp_server_object, &link_object, &network_object),
+        .children = BUS_IMPLEMENTATIONS(&dhcp_server_object, &dhcp_client_object,
+                                        &dhcp6_client_object, &link_object, &network_object),
 };
index ae267ce5ca5131bed1e5b790920286b4ed5dc799..e8606506916e0697c535aca80b66bd546b2993ae 100644 (file)
@@ -885,6 +885,9 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
         if (r < 0)
                 return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
 
+        /* RFC 4861 section 4.2. states that the lifetime in the message header should be used only for the
+         * default gateway, but the captive portal option does not have a lifetime field, hence, we use the
+         * main lifetime for the portal. */
         r = sd_ndisc_router_get_lifetime(rt, &lifetime_sec);
         if (r < 0)
                 return log_link_warning_errno(link, r, "Failed to get lifetime of RA message: %m");
@@ -909,7 +912,19 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
         if (!in_charset(captive_portal, URI_VALID))
                 return log_link_warning_errno(link, SYNTHETIC_ERRNO(EBADMSG), "Received invalid captive portal, ignoring.");
 
-        exist = set_get(link->ndisc_captive_portals, &(NDiscCaptivePortal) { .captive_portal = captive_portal });
+        if (lifetime_usec == 0) {
+                /* Drop the portal with zero lifetime. */
+                ndisc_captive_portal_free(set_remove(link->ndisc_captive_portals,
+                                                     &(NDiscCaptivePortal) {
+                                                             .captive_portal = captive_portal,
+                                                     }));
+                return 0;
+        }
+
+        exist = set_get(link->ndisc_captive_portals,
+                        &(NDiscCaptivePortal) {
+                                .captive_portal = captive_portal,
+                        });
         if (exist) {
                 /* update existing entry */
                 exist->router = router;
@@ -950,6 +965,113 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
         return 1;
 }
 
+static void ndisc_pref64_hash_func(const NDiscPREF64 *x, struct siphash *state) {
+        assert(x);
+
+        siphash24_compress(&x->prefix_len, sizeof(x->prefix_len), state);
+        siphash24_compress(&x->prefix, sizeof(x->prefix), state);
+}
+
+static int ndisc_pref64_compare_func(const NDiscPREF64 *a, const NDiscPREF64 *b) {
+        int r;
+
+        assert(a);
+        assert(b);
+
+        r = CMP(a->prefix_len, b->prefix_len);
+        if (r != 0)
+                return r;
+
+        return memcmp(&a->prefix, &b->prefix, sizeof(a->prefix));
+}
+
+DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
+                ndisc_pref64_hash_ops,
+                NDiscPREF64,
+                ndisc_pref64_hash_func,
+                ndisc_pref64_compare_func,
+                mfree);
+
+static int ndisc_router_process_pref64(Link *link, sd_ndisc_router *rt) {
+        _cleanup_free_ NDiscPREF64 *new_entry = NULL;
+        usec_t lifetime_usec, timestamp_usec;
+        struct in6_addr a, router;
+        uint16_t lifetime_sec;
+        unsigned prefix_len;
+        NDiscPREF64 *exist;
+        int r;
+
+        assert(link);
+        assert(link->network);
+        assert(rt);
+
+        if (!link->network->ipv6_accept_ra_use_pref64)
+                return 0;
+
+        r = sd_ndisc_router_get_address(rt, &router);
+        if (r < 0)
+                return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
+
+        r = sd_ndisc_router_prefix64_get_prefix(rt, &a);
+        if (r < 0)
+                return log_link_warning_errno(link, r, "Failed to get pref64 prefix: %m");
+
+        r = sd_ndisc_router_prefix64_get_prefixlen(rt, &prefix_len);
+        if (r < 0)
+                return log_link_warning_errno(link, r, "Failed to get pref64 prefix length: %m");
+
+        r = sd_ndisc_router_prefix64_get_lifetime_sec(rt, &lifetime_sec);
+        if (r < 0)
+                return log_link_warning_errno(link, r, "Failed to get pref64 prefix lifetime: %m");
+
+        r = sd_ndisc_router_get_timestamp(rt, CLOCK_BOOTTIME, &timestamp_usec);
+        if (r < 0)
+                return log_link_warning_errno(link, r, "Failed to get RA timestamp: %m");
+
+        lifetime_usec = sec16_to_usec(lifetime_sec, timestamp_usec);
+
+        if (lifetime_usec == 0) {
+                free(set_remove(link->ndisc_pref64,
+                                &(NDiscPREF64) {
+                                        .prefix = a,
+                                        .prefix_len = prefix_len
+                                }));
+                return 0;
+        }
+
+        exist = set_get(link->ndisc_pref64,
+                        &(NDiscPREF64) {
+                                .prefix = a,
+                                .prefix_len = prefix_len
+                });
+        if (exist) {
+                /* update existing entry */
+                exist->router = router;
+                exist->lifetime_usec = lifetime_usec;
+                return 0;
+        }
+
+        new_entry = new(NDiscPREF64, 1);
+        if (!new_entry)
+                return log_oom();
+
+        *new_entry = (NDiscPREF64) {
+                .router = router,
+                .lifetime_usec = lifetime_usec,
+                .prefix = a,
+                .prefix_len = prefix_len,
+        };
+
+        r = set_ensure_put(&link->ndisc_pref64, &ndisc_pref64_hash_ops, new_entry);
+        if (r < 0)
+                return log_oom();
+
+        assert(r > 0);
+        TAKE_PTR(new_entry);
+
+        return 0;
+}
+
 static int ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
         size_t n_captive_portal = 0;
         int r;
@@ -998,13 +1120,16 @@ static int ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
                         if (r > 0)
                                 n_captive_portal++;
                         break;
+                case SD_NDISC_OPTION_PREF64:
+                        r = ndisc_router_process_pref64(link, rt);
+                        break;
                 }
                 if (r < 0 && r != -EBADMSG)
                         return r;
         }
 }
 
-static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct in6_addr *router) {
+static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
         bool updated = false;
         NDiscDNSSL *dnssl;
         NDiscRDNSS *rdnss;
@@ -1028,9 +1153,6 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct i
                 if (route->lifetime_usec >= timestamp_usec)
                         continue; /* the route is still valid */
 
-                if (router && !in6_addr_equal(&route->provider.in6, router))
-                        continue;
-
                 k = route_remove_and_drop(route);
                 if (k < 0)
                         r = log_link_warning_errno(link, k, "Failed to remove outdated SLAAC route, ignoring: %m");
@@ -1043,9 +1165,6 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct i
                 if (address->lifetime_valid_usec >= timestamp_usec)
                         continue; /* the address is still valid */
 
-                if (router && !in6_addr_equal(&address->provider.in6, router))
-                        continue;
-
                 k = address_remove_and_drop(address);
                 if (k < 0)
                         r = log_link_warning_errno(link, k, "Failed to remove outdated SLAAC address, ignoring: %m");
@@ -1055,9 +1174,6 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct i
                 if (rdnss->lifetime_usec >= timestamp_usec)
                         continue; /* the DNS server is still valid */
 
-                if (router && !in6_addr_equal(&rdnss->router, router))
-                        continue;
-
                 free(set_remove(link->ndisc_rdnss, rdnss));
                 updated = true;
         }
@@ -1066,9 +1182,6 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct i
                 if (dnssl->lifetime_usec >= timestamp_usec)
                         continue; /* the DNS domain is still valid */
 
-                if (router && !in6_addr_equal(&dnssl->router, router))
-                        continue;
-
                 free(set_remove(link->ndisc_dnssl, dnssl));
                 updated = true;
         }
@@ -1077,9 +1190,6 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec, const struct i
                 if (cp->lifetime_usec >= timestamp_usec)
                         continue; /* the captive portal is still valid */
 
-                if (router && !in6_addr_equal(&cp->router, router))
-                        continue;
-
                 ndisc_captive_portal_free(set_remove(link->ndisc_captive_portals, cp));
                 updated = true;
         }
@@ -1100,7 +1210,7 @@ static int ndisc_expire_handler(sd_event_source *s, uint64_t usec, void *userdat
 
         assert_se(sd_event_now(link->manager->event, CLOCK_BOOTTIME, &now_usec) >= 0);
 
-        (void) ndisc_drop_outdated(link, now_usec, NULL);
+        (void) ndisc_drop_outdated(link, now_usec);
         (void) ndisc_setup_expire(link);
         return 0;
 }
@@ -1201,7 +1311,6 @@ static int ndisc_start_dhcp6_client(Link *link, sd_ndisc_router *rt) {
 }
 
 static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) {
-        uint16_t router_lifetime_sec;
         struct in6_addr router;
         usec_t timestamp_usec;
         int r;
@@ -1234,28 +1343,12 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) {
                 log_link_debug(link, "Received RA without timestamp, ignoring.");
                 return 0;
         }
-
-        r = ndisc_drop_outdated(link, timestamp_usec, NULL);
         if (r < 0)
                 return r;
 
-        r = sd_ndisc_router_get_lifetime(rt, &router_lifetime_sec);
+        r = ndisc_drop_outdated(link, timestamp_usec);
         if (r < 0)
-                return log_link_warning_errno(link, r, "Failed to get lifetime of RA message: %m");
-
-         /* https://datatracker.ietf.org/doc/html/rfc4861
-          * Router Lifetime: A Lifetime of 0 indicates that the router is not a default router
-          * and SHOULD NOT appear on the default router list.
-          */
-        if (router_lifetime_sec == 0) {
-                log_link_debug(link, "Received RA with lifetime = 0, dropping configurations.");
-
-                r = ndisc_drop_outdated(link, USEC_INFINITY, &router);
-                if (r < 0)
-                        log_link_warning_errno(link, r, "Failed to process RA with zero lifetime, ignoring: %m");
-
-                return 0;
-        }
+                return r;
 
         r = ndisc_start_dhcp6_client(link, rt);
         if (r < 0)
@@ -1430,6 +1523,7 @@ void ndisc_flush(Link *link) {
         link->ndisc_rdnss = set_free(link->ndisc_rdnss);
         link->ndisc_dnssl = set_free(link->ndisc_dnssl);
         link->ndisc_captive_portals = set_free(link->ndisc_captive_portals);
+        link->ndisc_pref64 = set_free(link->ndisc_pref64);
 }
 
 static const char* const ipv6_accept_ra_start_dhcp6_client_table[_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX] = {
index 267f7d4a02057242d757b919d8fe6df1884dbe97..a463f42b52294ff3dca079d869d53f58793e130c 100644 (file)
@@ -39,6 +39,15 @@ typedef struct NDiscCaptivePortal {
         char *captive_portal;
 } NDiscCaptivePortal;
 
+typedef struct NDiscPREF64 {
+        struct in6_addr router;
+        /* This is an absolute point in time, and NOT a timespan/duration.
+         * Must be specified with CLOCK_BOOTTIME. */
+        usec_t lifetime_usec;
+        uint8_t prefix_len;
+        struct in6_addr prefix;
+} NDiscPREF64;
+
 static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) {
         return ((char*) n) + ALIGN(sizeof(NDiscDNSSL));
 }
index 6309baa0569383aa71da54b2386ec9dcdcb56e8b..bbb87e00bd22fc4c68f66e2776a7b9eead11797c 100644 (file)
@@ -285,6 +285,7 @@ IPv6AcceptRA.UseGateway,                     config_parse_bool,
 IPv6AcceptRA.UseRoutePrefix,                 config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_route_prefix)
 IPv6AcceptRA.UseAutonomousPrefix,            config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_autonomous_prefix)
 IPv6AcceptRA.UseOnLinkPrefix,                config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_onlink_prefix)
+IPv6AcceptRA.UsePREF64,                      config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_pref64)
 IPv6AcceptRA.UseDNS,                         config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_dns)
 IPv6AcceptRA.UseDomains,                     config_parse_ipv6_accept_ra_use_domains,                  0,                             offsetof(Network, ipv6_accept_ra_use_domains)
 IPv6AcceptRA.UseMTU,                         config_parse_bool,                                        0,                             offsetof(Network, ipv6_accept_ra_use_mtu)
@@ -384,6 +385,9 @@ IPv6SendRA.EmitDomains,                      config_parse_bool,
 IPv6SendRA.Domains,                          config_parse_radv_search_domains,                         0,                             0
 IPv6SendRA.DNSLifetimeSec,                   config_parse_sec,                                         0,                             offsetof(Network, router_dns_lifetime_usec)
 IPv6SendRA.UplinkInterface,                  config_parse_uplink,                                      0,                             0
+IPv6SendRA.HomeAgent,                        config_parse_bool,                                        0,                             offsetof(Network, router_home_agent_information)
+IPv6SendRA.HomeAgentLifetimeSec,             config_parse_router_home_agent_lifetime,                  0,                             offsetof(Network, home_agent_lifetime_usec)
+IPv6SendRA.HomeAgentPreference,              config_parse_uint16,                                      0,                             offsetof(Network, router_home_agent_preference)
 IPv6Prefix.Prefix,                           config_parse_prefix,                                      0,                             0
 IPv6Prefix.OnLink,                           config_parse_prefix_boolean,                              0,                             0
 IPv6Prefix.AddressAutoconfiguration,         config_parse_prefix_boolean,                              0,                             0
index 19e4657f3c7c09eca301f7f822afef525d308482..3e1110e6d7d8e5fd2678bb6cebdcc99d78a75e16 100644 (file)
@@ -242,6 +242,10 @@ struct Network {
         OrderedSet *router_search_domains;
         int router_uplink_index;
         char *router_uplink_name;
+        /* Mobile IPv6 Home Agent */
+        bool router_home_agent_information;
+        uint16_t router_home_agent_preference;
+        usec_t home_agent_lifetime_usec;
 
         /* DHCP Prefix Delegation support */
         int dhcp_pd;
@@ -329,6 +333,7 @@ struct Network {
         bool ipv6_accept_ra_use_icmp6_ratelimit;
         bool ipv6_accept_ra_quickack;
         bool ipv6_accept_ra_use_captive_portal;
+        bool ipv6_accept_ra_use_pref64;
         bool active_slave;
         bool primary_slave;
         DHCPUseDomains ipv6_accept_ra_use_domains;
index 57fd68f5a0f758617ed0a4f6df01d5ac16137895..d6a8d36152b23b83342a28dfb9c3718deb0736af 100644 (file)
@@ -600,6 +600,18 @@ static int radv_configure(Link *link) {
         if (r < 0)
                 return log_link_debug_errno(link, r, "Could not set RA Domains: %m");
 
+        r = sd_radv_set_home_agent_information(link->radv, link->network->router_home_agent_information);
+        if (r < 0)
+                return r;
+
+        r = sd_radv_set_home_agent_preference(link->radv, link->network->router_home_agent_preference);
+        if (r < 0)
+                return r;
+
+        r = sd_radv_set_home_agent_lifetime(link->radv, DIV_ROUND_UP(link->network->home_agent_lifetime_usec, USEC_PER_SEC));
+        if (r < 0)
+                return r;
+
         return 0;
 }
 
@@ -1575,3 +1587,47 @@ int config_parse_router_preference(
 
         return 0;
 }
+
+int config_parse_router_home_agent_lifetime(
+                const char *unit,
+                const char *filename,
+                unsigned line,
+                const char *section,
+                unsigned section_line,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        usec_t usec, *home_agent_lifetime_usec = ASSERT_PTR(data);
+        int r;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+
+        if (isempty(rvalue)) {
+                *home_agent_lifetime_usec = 0;
+                return 0;
+        }
+
+        r = parse_sec(rvalue, &usec);
+        if (r < 0) {
+                log_syntax(unit, LOG_WARNING, filename, line, r,
+                           "Failed to parse %s=, ignoring assignment: %s", lvalue, rvalue);
+                return 0;
+        }
+
+        if (usec == USEC_INFINITY || usec == 0 ||
+            DIV_ROUND_UP(usec, USEC_PER_SEC) > RADV_MAX_HOME_AGENT_LIFETIME_USEC) {
+                log_syntax(unit, LOG_WARNING, filename, line, 0,
+                           "Invalid %s= must be in the range 1…%s, ignoring: %s", lvalue,
+                           FORMAT_TIMESPAN(RADV_MAX_HOME_AGENT_LIFETIME_USEC, USEC_PER_SEC), rvalue);
+                return 0;
+        }
+
+        *home_agent_lifetime_usec = usec;
+        return 0;
+}
index 8ea1a85b26c699da6a584c34e11b3d37a3385d30..48677b50de4b775829c6debe272d17c8e67fdaab 100644 (file)
@@ -98,3 +98,4 @@ CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);
 CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix);
 CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime);
+CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime);
index d3ae547746a060be6a1300083e4574d8eda9673f..9e74ead8d58191db0614ce405d2874ad9a0b8855 100644 (file)
@@ -976,13 +976,12 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_UUID:
-                        r = sd_id128_from_string(optarg, &arg_uuid);
-                        if (r < 0)
-                                return log_error_errno(r, "Invalid UUID: %s", optarg);
-
-                        if (sd_id128_is_null(arg_uuid))
+                        r = id128_from_string_nonzero(optarg, &arg_uuid);
+                        if (r == -ENXIO)
                                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                                        "Machine UUID may not be all zeroes.");
+                        if (r < 0)
+                                return log_error_errno(r, "Invalid UUID: %s", optarg);
 
                         arg_settings_mask |= SETTING_MACHINE_ID;
                         break;
index e403012e92dd79fb2cb882cdab94ab00c796ba91..b6fe9ef79eeeba8a04c7bea6b261be028a428a21 100644 (file)
@@ -2438,11 +2438,8 @@ static int context_load_partition_table(Context *context) {
         if (r < 0)
                 return log_error_errno(r, "Failed to get current GPT disk label UUID: %m");
 
-        r = sd_id128_from_string(disk_uuid_string, &disk_uuid);
-        if (r < 0)
-                return log_error_errno(r, "Failed to parse current GPT disk label UUID: %m");
-
-        if (sd_id128_is_null(disk_uuid)) {
+        r = id128_from_string_nonzero(disk_uuid_string, &disk_uuid);
+        if (r == -ENXIO) {
                 r = derive_uuid(context->seed, "disk-uuid", &disk_uuid);
                 if (r < 0)
                         return log_error_errno(r, "Failed to acquire disk GPT uuid: %m");
@@ -2450,7 +2447,8 @@ static int context_load_partition_table(Context *context) {
                 r = fdisk_set_disklabel_id(c);
                 if (r < 0)
                         return log_error_errno(r, "Failed to set GPT disk label: %m");
-        }
+        } else if (r < 0)
+                return log_error_errno(r, "Failed to parse current GPT disk label UUID: %m");
 
         r = fdisk_get_partitions(c, &t);
         if (r < 0)
index f4697736d9cc01b55a8e576e56da3867383c3bb3..92a191ee60b3d508577aadcb928f70709f60beff 100644 (file)
@@ -608,7 +608,11 @@ int ask_password_tty(
                                         if (FLAGS_SET(flags, ASK_PASSWORD_ECHO))
                                                 (void) loop_write(ttyfd, passphrase + codepoint, n, false);
                                         else
-                                                (void) loop_write(ttyfd, "*", 1, false);
+                                                (void) loop_write(
+                                                                ttyfd,
+                                                                special_glyph(SPECIAL_GLYPH_BULLET),
+                                                                SIZE_MAX,
+                                                                false);
                                         codepoint = p;
                                 }
                         }
index ec4b53b2e8ee75532eb1a745eab81b64b1b3c332..68c4b2ca1af0bb2f1a9fc7ed511d246081f58a96 100644 (file)
@@ -19,6 +19,7 @@
 #include "fileio.h"
 #include "fs-util.h"
 #include "hostname-util.h"
+#include "id128-util.h"
 #include "in-addr-util.h"
 #include "log.h"
 #include "macro.h"
@@ -944,25 +945,19 @@ int config_parse_id128(
                 void *data,
                 void *userdata) {
 
-        sd_id128_t t, *result = data;
+        sd_id128_t *result = data;
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
 
-        r = sd_id128_from_string(rvalue, &t);
-        if (r < 0) {
+        r = id128_from_string_nonzero(rvalue, result);
+        if (r == -ENXIO)
+                log_syntax(unit, LOG_WARNING, filename, line, r, "128-bit ID/UUID is all 0, ignoring: %s", rvalue);
+        else if (r < 0)
                 log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse 128-bit ID/UUID, ignoring: %s", rvalue);
-                return 0;
-        }
-
-        if (sd_id128_is_null(t)) {
-                log_syntax(unit, LOG_WARNING, filename, line, 0, "128-bit ID/UUID is all 0, ignoring: %s", rvalue);
-                return 0;
-        }
 
-        *result = t;
         return 0;
 }
 
index 679e835db5b15342304da74c07579bca20595bdc..20e1675d0decabc606e20ca5724c7ac15062fa7f 100644 (file)
@@ -1586,9 +1586,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
                 else if (d->type == TABLE_TIMESTAMP_DATE)
                         ret = format_timestamp_style(p, FORMAT_TIMESTAMP_MAX, d->timestamp, TIMESTAMP_DATE);
                 else if (d->type == TABLE_TIMESTAMP_RELATIVE_MONOTONIC)
-                        ret = format_timestamp_relative_full(p, FORMAT_TIMESTAMP_RELATIVE_MAX,
-                                                             d->timestamp, CLOCK_MONOTONIC,
-                                                             /* implicit_left = */ false);
+                        ret = format_timestamp_relative_monotonic(p, FORMAT_TIMESTAMP_RELATIVE_MAX, d->timestamp);
                 else
                         ret = format_timestamp_relative_full(p, FORMAT_TIMESTAMP_RELATIVE_MAX,
                                                              d->timestamp, CLOCK_REALTIME,
index f232767adf529aa02aa4bfb89322ea80232783b6..c9509b28f0f52051a94c97597e282e14dcd6baea 100644 (file)
 #include "terminal-util.h"
 
 int id128_pretty_print_sample(const char *name, sd_id128_t id) {
-       _cleanup_free_ char *man_link = NULL, *mod_link = NULL;
-        const char *on, *off;
-        unsigned i;
+        _cleanup_free_ char *man_link = NULL, *mod_link = NULL;
 
-        on = ansi_highlight();
-        off = ansi_normal();
+        const char *on = ansi_highlight(),
+                   *off = ansi_normal();
 
         if (terminal_urlify("man:systemd-id128(1)", "systemd-id128(1)", &man_link) < 0)
                 return log_oom();
@@ -34,8 +32,8 @@ int id128_pretty_print_sample(const char *name, sd_id128_t id) {
                on, SD_ID128_FORMAT_VAL(id), off,
                man_link,
                on, name);
-        for (i = 0; i < 16; i++)
-                printf("%02x%s", id.bytes[i], i != 15 ? "," : "");
+        for (size_t i = 0; i < 16; i++)
+                printf("%02x%s", id.bytes[i], i < 15 ? "," : "");
         printf(")%s\n\n", off);
 
         printf("As Python constant:\n"
index 9fb9a3e3768ef426745e2ab733c8ea8444b42a08..b620156c75be0558ad3062b44f810e8e0edee8aa 100644 (file)
@@ -30,23 +30,22 @@ int switch_root(const char *new_root,
                 const char *old_root_after,   /* path below the new root, where to place the old root after the transition; may be NULL to unmount it */
                 SwitchRootFlags flags) {
 
-        /* Stuff mounted below /run we don't save on soft reboot, as it might have lost its relevance, i.e.
-         * credentials, removable media and such, we rather want that the new boot mounts this fresh.
-         * But on the switch from initrd we do use MS_REC, as it is expected that mounts set up in /run
-         * are maintained. */
-        unsigned long run_mount_flags = MS_BIND|(!FLAGS_SET(flags, SWITCH_ROOT_SKIP_RECURSIVE_RUN) ? MS_REC : 0);
-        struct {
+        /* Stuff mounted below /run/ we don't save on soft reboot, as it might have lost its relevance, i.e.
+         * credentials, removable media and such, we rather want that the new boot mounts this fresh.  But on
+         * the switch from initrd we do use MS_REC, as it is expected that mounts set up in /run/ are
+         * maintained. */
+        static const struct {
                 const char *path;
-                unsigned long mount_flags;
-                bool skip_if_run_is_rec; /* For child mounts of /run, if it's moved recursively no need to handle */
+                unsigned long mount_flags;                 /* Flags to apply if SWITCH_ROOT_RECURSIVE_RUN is unset */
+                unsigned long mount_flags_recursive_run;   /* Flags to apply if SWITCH_ROOT_RECURSIVE_RUN is set (0 if shall be skipped) */
         } transfer_table[] = {
-                { "/dev",                                 MS_BIND|MS_REC,  false }, /* Recursive, because we want to save the original /dev/shm + /dev/pts and similar */
-                { "/sys",                                 MS_BIND|MS_REC,  false }, /* Similar, we want to retain various API VFS, or the cgroupv1 /sys/fs/cgroup/ tree */
-                { "/proc",                                MS_BIND|MS_REC,  false }, /* Similar */
-                { "/run",                                 run_mount_flags, false }, /* Recursive except on soft reboot, see above */
-                { SYSTEM_CREDENTIALS_DIRECTORY,           MS_BIND,         true },  /* Credentials passed into the system should survive */
-                { ENCRYPTED_SYSTEM_CREDENTIALS_DIRECTORY, MS_BIND,         true },  /* Similar */
-                { "/run/host",                            MS_BIND|MS_REC,  true },  /* Host supplied hierarchy should also survive */
+                { "/dev",                                 MS_BIND|MS_REC,  MS_BIND|MS_REC }, /* Recursive, because we want to save the original /dev/shm/ + /dev/pts/ and similar */
+                { "/sys",                                 MS_BIND|MS_REC,  MS_BIND|MS_REC }, /* Similar, we want to retain various API VFS, or the cgroupv1 /sys/fs/cgroup/ tree */
+                { "/proc",                                MS_BIND|MS_REC,  MS_BIND|MS_REC }, /* Similar */
+                { "/run",                                 MS_BIND,         MS_BIND|MS_REC }, /* Recursive except on soft reboot, see above */
+                { SYSTEM_CREDENTIALS_DIRECTORY,           MS_BIND,         0 /* skip! */  }, /* Credentials passed into the system should survive */
+                { ENCRYPTED_SYSTEM_CREDENTIALS_DIRECTORY, MS_BIND,         0 /* skip! */  },  /* Similar */
+                { "/run/host",                            MS_BIND|MS_REC,  0 /* skip! */  },  /* Host supplied hierarchy should also survive */
         };
 
         _cleanup_close_ int old_root_fd = -EBADF, new_root_fd = -EBADF;
@@ -129,8 +128,10 @@ int switch_root(const char *new_root,
 
         FOREACH_ARRAY(transfer, transfer_table, ELEMENTSOF(transfer_table)) {
                 _cleanup_free_ char *chased = NULL;
+                unsigned long mount_flags;
 
-                if (transfer->skip_if_run_is_rec && !FLAGS_SET(flags, SWITCH_ROOT_SKIP_RECURSIVE_RUN))
+                mount_flags = FLAGS_SET(flags, SWITCH_ROOT_RECURSIVE_RUN) ? transfer->mount_flags_recursive_run : transfer->mount_flags;
+                if (mount_flags == 0) /* skip if zero */
                         continue;
 
                 if (access(transfer->path, F_OK) < 0) {
@@ -149,7 +150,7 @@ int switch_root(const char *new_root,
                 if (r > 0) /* If it is already mounted, then do nothing */
                         continue;
 
-                r = mount_nofollow_verbose(LOG_ERR, transfer->path, chased, NULL, transfer->mount_flags, NULL);
+                r = mount_nofollow_verbose(LOG_ERR, transfer->path, chased, NULL, mount_flags, NULL);
                 if (r < 0)
                         return r;
         }
@@ -172,14 +173,19 @@ int switch_root(const char *new_root,
         if (r < 0) {
                 log_debug_errno(r, "Pivoting root file system failed, moving mounts instead: %m");
 
+                if (resolved_old_root_after) {
+                        r = mount_nofollow_verbose(LOG_ERR, "/", resolved_old_root_after, NULL, MS_BIND|MS_REC, NULL);
+                        if (r < 0)
+                                return r;
+                }
+
                 /* If we have to use MS_MOVE let's first try to get rid of *all* mounts we can, with the
                  * exception of the path we want to switch to, plus everything leading to it and within
                  * it. This is necessary because unlike pivot_root() just moving the mount to the root via
                  * MS_MOVE won't magically unmount anything below it. Once the chroot() succeeds the mounts
                  * below would still be around but invisible to us, because not accessible via
                  * /proc/self/mountinfo. Hence, let's clean everything up first, as long as we still can. */
-                if (!FLAGS_SET(flags, SWITCH_ROOT_SKIP_RECURSIVE_UMOUNT))
-                        (void) umount_recursive_full(NULL, MNT_DETACH, STRV_MAKE(new_root));
+                (void) umount_recursive_full(NULL, MNT_DETACH, STRV_MAKE(new_root));
 
                 if (mount(".", "/", NULL, MS_MOVE, NULL) < 0)
                         return log_error_errno(errno, "Failed to move %s to /: %m", new_root);
index 20561fcee8bdd9b4c61757de952b1b49f5cb7c0b..ba0d280eba4ec9f28e926a7e04f0038ba5d29e37 100644 (file)
@@ -7,8 +7,7 @@ typedef enum SwitchRootFlags {
         SWITCH_ROOT_DESTROY_OLD_ROOT      = 1 << 0, /* rm -rf old root when switching â€“ under the condition
                                                      * that it is backed by non-persistent tmpfs/ramfs/… */
         SWITCH_ROOT_DONT_SYNC             = 1 << 1, /* don't call sync() immediately before switching root */
-        SWITCH_ROOT_SKIP_RECURSIVE_RUN    = 1 << 2, /* move /run without MS_REC */
-        SWITCH_ROOT_SKIP_RECURSIVE_UMOUNT = 1 << 3, /* do not umount recursively on move */
+        SWITCH_ROOT_RECURSIVE_RUN         = 1 << 2, /* move /run/ with MS_REC from old to new root */
 } SwitchRootFlags;
 
 int switch_root(const char *new_root, const char *old_root_after, SwitchRootFlags flags);
index 263c444ac20d6698008eae35a274401744e7b931..b976b7d8cf60d299cc96d4a8192dddfc62003f34 100644 (file)
@@ -169,13 +169,11 @@ static int switch_root_initramfs(void) {
          * Disable sync() during switch-root, we after all sync'ed here plenty, and a dumb sync (as opposed
          * to the "smart" sync() we did here that looks at progress parameters) would defeat much of our
          * efforts here. As the new root will be /run/initramfs/, it is not necessary to mount /run/
-         * recursively. Also, do not umount filesystems before MS_MOVE, as that should be done by ourself. */
+         * recursively. */
         return switch_root(
                         /* new_root= */ "/run/initramfs",
                         /* old_root_after= */ "/oldroot",
-                        /* flags= */ SWITCH_ROOT_DONT_SYNC |
-                                     SWITCH_ROOT_SKIP_RECURSIVE_RUN |
-                                     SWITCH_ROOT_SKIP_RECURSIVE_UMOUNT);
+                        /* flags= */ SWITCH_ROOT_DONT_SYNC);
 }
 
 /* Read the following fields from /proc/meminfo:
index 8268217967ba79429fc9aee71bbd241609847759..551e6f6768599be1d780b53ef048d4c421e1a26f 100644 (file)
@@ -168,8 +168,9 @@ fail:
 
                 log_debug_errno(r, "Failed to %s %s, ignoring: %s", job_type, name, bus_error_message(error, r));
                 return 0;
-        } else
-                log_error_errno(r, "Failed to %s %s: %s", job_type, name, bus_error_message(error, r));
+        }
+
+        log_error_errno(r, "Failed to %s %s: %s", job_type, name, bus_error_message(error, r));
 
         if (!sd_bus_error_has_names(error, BUS_ERROR_NO_SUCH_UNIT,
                                            BUS_ERROR_UNIT_MASKED,
index b59ea701c91cfbe6a9451d7a4546de5bf15651f8..ae4a1a72c2b56dd5e29beda3f0053723298e21bb 100644 (file)
@@ -4,6 +4,8 @@
 #include "bus-error.h"
 #include "bus-locator.h"
 #include "chase.h"
+#include "fd-util.h"
+#include "initrd-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "proc-cmdline.h"
@@ -47,15 +49,24 @@ int verb_switch_root(int argc, char *argv[], void *userdata) {
 
         if (argc >= 2) {
                 root = argv[1];
+
                 if (!path_is_valid(root))
                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid root path: %s", root);
+
                 if (!path_is_absolute(root))
                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Root path is not absolute: %s", root);
-                if (path_equal(root, "/"))
+
+                r = path_is_root(root);
+                if (r < 0)
+                        return log_error_errno(r, "Failed to check if switch-root directory '%s' is current root: %m", root);
+                if (r > 0)
                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot switch to current root directory: %s", root);
         } else
                 root = "/sysroot";
 
+        if (!in_initrd())
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Not in initrd, refusing switch-root operation.");
+
         if (argc >= 3)
                 init = argv[2];
         else {
index ddd445c9f0556ce69b9c2647fd33e7e9f7a85af2..45ab8765d25534c229bc401f2bb3730c0b3bec17 100644 (file)
@@ -329,6 +329,7 @@ int sd_dhcp_client_start(sd_dhcp_client *client);
 int sd_dhcp_client_send_release(sd_dhcp_client *client);
 int sd_dhcp_client_send_decline(sd_dhcp_client *client);
 int sd_dhcp_client_send_renew(sd_dhcp_client *client);
+int sd_dhcp_client_get_lease_timestamp(sd_dhcp_client *client, uint64_t *timestamp);
 
 sd_dhcp_client *sd_dhcp_client_ref(sd_dhcp_client *client);
 sd_dhcp_client *sd_dhcp_client_unref(sd_dhcp_client *client);
index 3303c374cee7f744ac6f137fb176d98c618f735a..a984a9d85e15ca37b989b83a2a0a46184d8b5c15 100644 (file)
@@ -50,6 +50,7 @@ int sd_id128_get_machine(sd_id128_t *ret);
 int sd_id128_get_boot(sd_id128_t *ret);
 int sd_id128_get_invocation(sd_id128_t *ret);
 
+int sd_id128_get_app_specific(sd_id128_t base, sd_id128_t app_id, sd_id128_t *ret);
 int sd_id128_get_machine_app_specific(sd_id128_t app_id, sd_id128_t *ret);
 int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret);
 
index 726a3139009b773fb6b7c0112995813c78c7e9f8..b220fa0113d62a7944618b8b2db99b5b1219c2ab 100644 (file)
@@ -82,12 +82,12 @@ _SD_BEGIN_DECLARATIONS;
 #define SD_MESSAGE_FACTORY_RESET                      SD_ID128_MAKE(c1,4a,af,76,ec,28,4a,5f,a1,f1,05,f8,8d,fb,06,1c)
 #define SD_MESSAGE_FACTORY_RESET_STR                  SD_ID128_MAKE_STR(c1,4a,af,76,ec,28,4a,5f,a1,f1,05,f8,8d,fb,06,1c)
 
-#define SD_MESSAGE_CRASH_EXIT                        SD_ID128_MAKE(d9,ec,5e,95,e4,b6,46,aa,ae,a2,fd,05,21,4e,db,da)
-#define SD_MESSAGE_CRASH_EXIT_STR                    SD_ID128_MAKE_STR(d9,ec,5e,95,e4,b6,46,aa,ae,a2,fd,05,21,4e,db,da)
-#define SD_MESSAGE_CRASH_FAILED                      SD_ID128_MAKE(3e,d0,16,3e,86,8a,44,17,ab,8b,9e,21,04,07,a9,6c)
-#define SD_MESSAGE_CRASH_FAILED_STR                  SD_ID128_MAKE_STR(3e,d0,16,3e,86,8a,44,17,ab,8b,9e,21,04,07,a9,6c)
-#define SD_MESSAGE_CRASH_FREEZE                      SD_ID128_MAKE(64,5c,73,55,37,63,4a,e0,a3,2b,15,a7,c6,cb,a7,d4)
-#define SD_MESSAGE_CRASH_FREEZE_STR                  SD_ID128_MAKE_STR(64,5c,73,55,37,63,4a,e0,a3,2b,15,a7,c6,cb,a7,d4)
+#define SD_MESSAGE_CRASH_EXIT                         SD_ID128_MAKE(d9,ec,5e,95,e4,b6,46,aa,ae,a2,fd,05,21,4e,db,da)
+#define SD_MESSAGE_CRASH_EXIT_STR                     SD_ID128_MAKE_STR(d9,ec,5e,95,e4,b6,46,aa,ae,a2,fd,05,21,4e,db,da)
+#define SD_MESSAGE_CRASH_FAILED                       SD_ID128_MAKE(3e,d0,16,3e,86,8a,44,17,ab,8b,9e,21,04,07,a9,6c)
+#define SD_MESSAGE_CRASH_FAILED_STR                   SD_ID128_MAKE_STR(3e,d0,16,3e,86,8a,44,17,ab,8b,9e,21,04,07,a9,6c)
+#define SD_MESSAGE_CRASH_FREEZE                       SD_ID128_MAKE(64,5c,73,55,37,63,4a,e0,a3,2b,15,a7,c6,cb,a7,d4)
+#define SD_MESSAGE_CRASH_FREEZE_STR                   SD_ID128_MAKE_STR(64,5c,73,55,37,63,4a,e0,a3,2b,15,a7,c6,cb,a7,d4)
 
 #define SD_MESSAGE_CRASH_NO_COREDUMP                  SD_ID128_MAKE(5a,dd,b3,a0,6a,73,4d,33,96,b7,94,bf,98,fb,2d,01)
 #define SD_MESSAGE_CRASH_NO_COREDUMP_STR              SD_ID128_MAKE_STR(5a,dd,b3,a0,6a,73,4d,33,96,b7,94,bf,98,fb,2d,01)
index be702f68a52c3c947540f3380193b4a41fe38faa..89b6413ef9bfec3164c6caa986010b1604c5d6bd 100644 (file)
@@ -42,7 +42,8 @@ enum {
         SD_NDISC_OPTION_RDNSS              = 25,
         SD_NDISC_OPTION_FLAGS_EXTENSION    = 26,
         SD_NDISC_OPTION_DNSSL              = 31,
-        SD_NDISC_OPTION_CAPTIVE_PORTAL     = 37
+        SD_NDISC_OPTION_CAPTIVE_PORTAL     = 37,
+        SD_NDISC_OPTION_PREF64             = 38
 };
 
 /* Route preference, RFC 4191, Section 2.1 */
@@ -127,6 +128,11 @@ int sd_ndisc_router_dnssl_get_lifetime(sd_ndisc_router *rt, uint32_t *ret);
 /* Specific option access: SD_NDISC_OPTION_CAPTIVE_PORTAL */
 int sd_ndisc_router_captive_portal_get_uri(sd_ndisc_router *rt, const char **uri, size_t *size);
 
+/* Specific option access: SD_NDISC_OPTION_PREF64 */
+int sd_ndisc_router_prefix64_get_prefix(sd_ndisc_router *rt, struct in6_addr *ret_addr);
+int sd_ndisc_router_prefix64_get_prefixlen(sd_ndisc_router *rt, unsigned *ret);
+int sd_ndisc_router_prefix64_get_lifetime_sec(sd_ndisc_router *rt, uint16_t *ret);
+
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc, sd_ndisc_unref);
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc_router, sd_ndisc_router_unref);
 
index 882613c0b3f92f23729ca617d3a9026d6a3640e5..295b8846f5a56046bae0e8faae959e7f0274322f 100644 (file)
@@ -95,6 +95,11 @@ int sd_radv_pref64_prefix_set_prefix(sd_radv_pref64_prefix *p, const struct in6_
 sd_radv_pref64_prefix *sd_radv_pref64_prefix_ref(sd_radv_pref64_prefix *ra);
 sd_radv_pref64_prefix *sd_radv_pref64_prefix_unref(sd_radv_pref64_prefix *ra);
 
+/* Mobile IPv6 extension: Home Agent Info. */
+int sd_radv_set_home_agent_information(sd_radv *ra, int home_agent);
+int sd_radv_set_home_agent_preference(sd_radv *ra, uint16_t preference);
+int sd_radv_set_home_agent_lifetime(sd_radv *ra, uint16_t lifetime);
+
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv, sd_radv_unref);
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv_prefix, sd_radv_prefix_unref);
 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv_route_prefix, sd_radv_route_prefix_unref);
index 58dc88110e7b1f9c601182f9a8c29ec1c41b00a8..ae7df27d8f9e3297d56688ab000b729c6175781b 100644 (file)
@@ -20,6 +20,7 @@
 #define ID128_WALDI SD_ID128_MAKE(01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10)
 #define STR_WALDI "0102030405060708090a0b0c0d0e0f10"
 #define UUID_WALDI "01020304-0506-0708-090a-0b0c0d0e0f10"
+#define STR_NULL "00000000000000000000000000000000"
 
 TEST(id128) {
         sd_id128_t id, id2;
@@ -75,6 +76,13 @@ TEST(id128) {
         assert_se(sd_id128_from_string("01020304-0506-0708-090a0b0c0d0e0f10", &id) < 0);
         assert_se(sd_id128_from_string("010203040506-0708-090a-0b0c0d0e0f10", &id) < 0);
 
+        assert_se(id128_from_string_nonzero(STR_WALDI, &id) == 0);
+        assert_se(id128_from_string_nonzero(STR_NULL, &id) == -ENXIO);
+        assert_se(id128_from_string_nonzero("01020304-0506-0708-090a-0b0c0d0e0f101", &id) < 0);
+        assert_se(id128_from_string_nonzero("01020304-0506-0708-090a-0b0c0d0e0f10-", &id) < 0);
+        assert_se(id128_from_string_nonzero("01020304-0506-0708-090a0b0c0d0e0f10", &id) < 0);
+        assert_se(id128_from_string_nonzero("010203040506-0708-090a-0b0c0d0e0f10", &id) < 0);
+
         assert_se(id128_is_valid(STR_WALDI));
         assert_se(id128_is_valid(UUID_WALDI));
         assert_se(!id128_is_valid(""));
@@ -172,6 +180,11 @@ TEST(id128) {
         assert_se(lseek(fd, 0, SEEK_SET) == 0);
         assert_se(id128_read_fd(fd, ID128_FORMAT_ANY, NULL) == -EUCLEAN);
 
+        /* build/systemd-id128 -a f03daaeb1c334b43a732172944bf772e show 51df0b4bc3b04c9780e299b98ca373b8 */
+        assert_se(sd_id128_get_app_specific(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8),
+                                            SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id) >= 0);
+        assert_se(sd_id128_equal(id, SD_ID128_MAKE(1d,ee,59,54,e7,5c,4d,6f,b9,6c,c6,c0,4c,a1,8a,86)));
+
         if (sd_booted() > 0 && sd_id128_get_machine(NULL) >= 0) {
                 assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id) >= 0);
                 assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id2) >= 0);
@@ -179,6 +192,10 @@ TEST(id128) {
                 assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8), &id2) >= 0);
                 assert_se(!sd_id128_equal(id, id2));
         }
+
+        /* Check return values */
+        assert_se(sd_id128_get_app_specific(SD_ID128_ALLF, SD_ID128_NULL, &id) == -ENXIO);
+        assert_se(sd_id128_get_app_specific(SD_ID128_NULL, SD_ID128_ALLF, &id) == 0);
 }
 
 TEST(sd_id128_get_invocation) {
index b5f0008d76bef481b49198af55205965f2c8ec46..a8fd45df733e77aed6d42e46a971e725c11fb53c 100644 (file)
@@ -260,6 +260,8 @@ TEST(strextend_with_separator) {
 
 TEST(strrep) {
         _cleanup_free_ char *one = NULL, *three = NULL, *zero = NULL;
+        char *onea, *threea;
+
         one = strrep("waldo", 1);
         three = strrep("waldo", 3);
         zero = strrep("waldo", 0);
@@ -267,6 +269,12 @@ TEST(strrep) {
         assert_se(streq(one, "waldo"));
         assert_se(streq(three, "waldowaldowaldo"));
         assert_se(streq(zero, ""));
+
+        onea = strrepa("waldo", 1);
+        threea = strrepa("waldo", 3);
+
+        assert_se(streq(onea, "waldo"));
+        assert_se(streq(threea, "waldowaldowaldo"));
 }
 
 TEST(string_has_cc) {
index bc60e9385045699bbaf9a5bf3f2522ba11033ec7..c7c757a248b805e8d0dc60bdd3a31b705b657cf9 100755 (executable)
@@ -5071,6 +5071,45 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
         self.assertIn('DHCPREPLY(veth-peer)', output)
         self.assertNotIn('rapid-commit', output)
 
+    def test_dhcp_client_ipv6_dbus_status(self):
+        def get_dbus_dhcp6_client_state(IF):
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           '/org/freedesktop/network1', 'org.freedesktop.network1.Manager',
+                                           'GetLinkByName', 's', IF])
+
+            assert out.startswith(b'io ')
+            out = out.strip()
+            assert out.endswith(b'"')
+            out = out.decode()
+            linkPath = out[:-1].split('"')[1]
+
+            print(f"Found {IF} link path: {linkPath}")
+
+            out = subprocess.check_output(['busctl', 'get-property', 'org.freedesktop.network1',
+                                           linkPath, 'org.freedesktop.network1.DHCPv6Client', 'State'])
+            assert out.startswith(b's "')
+            out = out.strip()
+            assert out.endswith(b'"')
+            return out[3:-1].decode()
+
+        copy_network_unit('25-veth.netdev', '25-dhcp-server-veth-peer.network', '25-dhcp-client-ipv6-only.network')
+
+        start_networkd()
+        self.wait_online(['veth-peer:carrier'])
+
+        # Note that at this point the DHCPv6 client has not been started because no RA (with managed
+        # bit set) has yet been recieved and the configuration does not include WithoutRA=true
+        state = get_dbus_dhcp6_client_state('veth99')
+        print(f"State = {state}")
+        self.assertEqual(state, 'stopped')
+
+        start_dnsmasq()
+        self.wait_online(['veth99:routable', 'veth-peer:routable'])
+
+        state = get_dbus_dhcp6_client_state('veth99')
+        print(f"State = {state}")
+        self.assertEqual(state, 'bound')
+
     def test_dhcp_client_ipv6_only_with_custom_client_identifier(self):
         copy_network_unit('25-veth.netdev', '25-dhcp-server-veth-peer.network', '25-dhcp-client-ipv6-only-custom-client-identifier.network')
 
@@ -5224,6 +5263,47 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
 
         self.teardown_nftset('addr4', 'network4', 'ifindex')
 
+    def test_dhcp_client_ipv4_dbus_status(self):
+        def get_dbus_dhcp4_client_state(IF):
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           '/org/freedesktop/network1', 'org.freedesktop.network1.Manager',
+                                           'GetLinkByName', 's', IF])
+
+            assert out.startswith(b'io ')
+            out = out.strip()
+            assert out.endswith(b'"')
+            out = out.decode()
+            linkPath = out[:-1].split('"')[1]
+
+            print(f"Found {IF} link path: {linkPath}")
+
+            out = subprocess.check_output(['busctl', 'get-property', 'org.freedesktop.network1',
+                                           linkPath, 'org.freedesktop.network1.DHCPv4Client', 'State'])
+            assert out.startswith(b's "')
+            out = out.strip()
+            assert out.endswith(b'"')
+            return out[3:-1].decode()
+
+        copy_network_unit('25-veth.netdev', '25-dhcp-server-veth-peer.network', '25-dhcp-client-ipv4-only.network')
+
+        start_networkd()
+        self.wait_online(['veth-peer:carrier'])
+
+        state = get_dbus_dhcp4_client_state('veth99')
+        print(f"State = {state}")
+        self.assertEqual(state, 'selecting')
+
+        start_dnsmasq('--dhcp-option=option:dns-server,192.168.5.6,192.168.5.7',
+                      '--dhcp-option=option:domain-search,example.com',
+                      '--dhcp-alternate-port=67,5555',
+                      ipv4_range='192.168.5.110,192.168.5.119')
+        self.wait_online(['veth99:routable', 'veth-peer:routable'])
+        self.wait_address('veth99', r'inet 192.168.5.11[0-9]*/24', ipv='-4')
+
+        state = get_dbus_dhcp4_client_state('veth99')
+        print(f"State = {state}")
+        self.assertEqual(state, 'bound')
+
     def test_dhcp_client_ipv4_use_routes_gateway(self):
         first = True
         for (routes, gateway, dns_and_ntp_routes, classless) in itertools.product([True, False], repeat=4):
@@ -5672,6 +5752,38 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         tear_down_common()
 
     def test_dhcp6pd(self):
+        def get_dbus_dhcp6_prefix(IF):
+            # busctl call org.freedesktop.network1 /org/freedesktop/network1 org.freedesktop.network1.Manager GetLinkByName s IF
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           '/org/freedesktop/network1', 'org.freedesktop.network1.Manager',
+                                           'GetLinkByName', 's', IF])
+
+            assert out.startswith(b'io ')
+            out = out.strip()
+            assert out.endswith(b'"')
+            out = out.decode()
+            linkPath = out[:-1].split('"')[1]
+
+            print(f"Found {IF} link path: {linkPath}")
+
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           linkPath, 'org.freedesktop.network1.Link', 'Describe'])
+            assert out.startswith(b's "')
+            out = out.strip()
+            assert out.endswith(b'"')
+            json_raw = out[2:].decode()
+            check_json(json_raw)
+            description = json.loads(json_raw) # Convert from escaped sequences to json
+            check_json(description)
+            description = json.loads(description) # Now parse the json
+
+            self.assertIn('DHCPv6Client', description.keys())
+            self.assertIn('Prefixes', description['DHCPv6Client'])
+
+            prefixInfo = description['DHCPv6Client']['Prefixes']
+
+            return prefixInfo
+
         copy_network_unit('25-veth.netdev', '25-dhcp6pd-server.network', '25-dhcp6pd-upstream.network',
                           '25-veth-downstream-veth97.netdev', '25-dhcp-pd-downstream-veth97.network', '25-dhcp-pd-downstream-veth97-peer.network',
                           '25-veth-downstream-veth98.netdev', '25-dhcp-pd-downstream-veth98.network', '25-dhcp-pd-downstream-veth98-peer.network',
@@ -5690,6 +5802,22 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         self.wait_online(['veth99:routable', 'test1:routable', 'dummy98:routable', 'dummy99:degraded',
                           'veth97:routable', 'veth97-peer:routable', 'veth98:routable', 'veth98-peer:routable'])
 
+        # Check DBus assigned prefix information to veth99
+        prefixInfo = get_dbus_dhcp6_prefix('veth99')
+
+        self.assertEqual(len(prefixInfo), 1)
+        prefixInfo = prefixInfo[0]
+
+        self.assertIn('Prefix', prefixInfo.keys())
+        self.assertIn('PrefixLength', prefixInfo.keys())
+        self.assertIn('PreferredLifetimeUSec', prefixInfo.keys())
+        self.assertIn('ValidLifetimeUSec', prefixInfo.keys())
+
+        self.assertEqual(prefixInfo['Prefix'][0:6], [63, 254, 5, 1, 255, 255])
+        self.assertEqual(prefixInfo['PrefixLength'], 56)
+        self.assertGreater(prefixInfo['PreferredLifetimeUSec'], 0)
+        self.assertGreater(prefixInfo['ValidLifetimeUSec'], 0)
+
         print('### ip -6 address show dev veth-peer scope global')
         output = check_output('ip -6 address show dev veth-peer scope global')
         print(output)
@@ -6058,6 +6186,41 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         self.assertIn(f'via ::10.0.0.1 dev {tunnel_name}', output)
 
     def test_dhcp4_6rd(self):
+        def get_dbus_dhcp_6rd_prefix(IF):
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           '/org/freedesktop/network1', 'org.freedesktop.network1.Manager',
+                                           'GetLinkByName', 's', IF])
+
+            assert out.startswith(b'io ')
+            out = out.strip()
+            assert out.endswith(b'"')
+            out = out.decode()
+            linkPath = out[:-1].split('"')[1]
+
+            print(f"Found {IF} link path: {linkPath}")
+
+            out = subprocess.check_output(['busctl', 'call', 'org.freedesktop.network1',
+                                           linkPath, 'org.freedesktop.network1.Link', 'Describe'])
+            assert out.startswith(b's "')
+            out = out.strip()
+            assert out.endswith(b'"')
+            json_raw = out[2:].decode()
+            check_json(json_raw)
+            description = json.loads(json_raw) # Convert from escaped sequences to json
+            check_json(description)
+            description = json.loads(description) # Now parse the json
+
+            self.assertIn('DHCPv4Client', description.keys())
+            self.assertIn('6rdPrefix', description['DHCPv4Client'].keys())
+
+            prefixInfo = description['DHCPv4Client']['6rdPrefix']
+            self.assertIn('Prefix', prefixInfo.keys())
+            self.assertIn('PrefixLength', prefixInfo.keys())
+            self.assertIn('IPv4MaskLength', prefixInfo.keys())
+            self.assertIn('BorderRouters', prefixInfo.keys())
+
+            return prefixInfo
+
         copy_network_unit('25-veth.netdev', '25-dhcp4-6rd-server.network', '25-dhcp4-6rd-upstream.network',
                           '25-veth-downstream-veth97.netdev', '25-dhcp-pd-downstream-veth97.network', '25-dhcp-pd-downstream-veth97-peer.network',
                           '25-veth-downstream-veth98.netdev', '25-dhcp-pd-downstream-veth98.network', '25-dhcp-pd-downstream-veth98-peer.network',
@@ -6080,6 +6243,14 @@ class NetworkdDHCPPDTests(unittest.TestCase, Utilities):
         self.wait_online(['veth99:routable', 'test1:routable', 'dummy98:routable', 'dummy99:degraded',
                           'veth97:routable', 'veth97-peer:routable', 'veth98:routable', 'veth98-peer:routable'])
 
+        # Check the DBus interface for assigned prefix information
+        prefixInfo = get_dbus_dhcp_6rd_prefix('veth99')
+
+        self.assertEqual(prefixInfo['Prefix'], [32,1,13,184,0,0,0,0,0,0,0,0,0,0,0,0]) # 2001:db8::
+        self.assertEqual(prefixInfo['PrefixLength'], 32)
+        self.assertEqual(prefixInfo['IPv4MaskLength'], 8)
+        self.assertEqual(prefixInfo['BorderRouters'], [[10,0,0,1]])
+
         # Test case for a downstream which appears later
         check_output('ip link add dummy97 type dummy')
         self.wait_online(['dummy97:routable'])
index 213333d9d1fe98e931c6e6fbd1d8583ecda56fb5..c1b80d660e85e33df7b5d9ea2077b230f7162bf2 100755 (executable)
@@ -9,9 +9,18 @@ set -o pipefail
 systemd-id128 --help
 systemd-id128 help
 systemd-id128 show
-systemd-id128 show --pretty | tail -n10
+systemd-id128 show --pretty | tail
+systemd-id128 show --value | tail
 systemd-id128 show 4f68bce3e8cd4db196e7fbcaf984b709 # root-x86-64
 systemd-id128 show --pretty 4f68bce3e8cd4db196e7fbcaf984b709
+systemd-id128 show root-x86-64
+systemd-id128 show --pretty root-x86-64
+[[ "$(systemd-id128 show 4f68bce3e8cd4db196e7fbcaf984b709)" = "$(systemd-id128 show root-x86-64)" ]]
+[[ "$(systemd-id128 show 4f68bce3-e8cd-4db1-96e7-fbcaf984b709)" = "$(systemd-id128 show root-x86-64)" ]]
+
+systemd-id128 show root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+systemd-id128 show --pretty root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+[[ "$(systemd-id128 show root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709 -P)" = "8ee5535e7cb14c249e1d28b8dfbb939c" ]]
 
 [[ "$(systemd-id128 new | wc -c)" -eq 33 ]]
 systemd-id128 new -p
index 1c092654b99cfcd07ddf9dae1bba7e577b48a9ea..407e9204a5f7fff919b34bd659d2caf36b631a91 100644 (file)
@@ -11,7 +11,7 @@
 Description=User Database Manager
 Documentation=man:systemd-userdbd.service(8)
 Requires=systemd-userdbd.socket
-After=systemd-userdbd.socket
+After=systemd-userdbd.socket systemd-remount-fs.service
 Before=sysinit.target
 DefaultDependencies=no