summaryrefslogtreecommitdiffstats
path: root/src/test/test-lock-util.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-22fs-util: always call label post ops in xopenat_full(), in both success and ↵Lennart Poettering1-9/+11
error path For SELinux it is essential that we reset the file creation label both in the success and in the error path, hence do so. Moreover, when calling the label post ops do it if possible with the opened fd of the inode itself, rather than always going via its path, simply to reduce the attack surface.
2024-10-22fs-util: don't second guess openat_report_new() return valuesLennart Poettering1-11/+0
If openat_report_new() fails, then 'made_file' will be false, as no file was created, hence there's no need to skip the unlinkat() explicitly early, given that we check for 'made_file' anyway in the error path. The extra error code checks are hence entirely redundant.
2024-10-22label: tweak LabelOps post() hook to take "created" booleanLennart Poettering6-15/+20
We have two distinct implementations of the post hook. 1. For SELinux we just reset the selinux label we told the kernel earlier to use for new inodes. 2. For SMACK we might apply an xattr to the specified file. The two calls are quite different: the first call we want to call in all cases (failure or success), the latter only if we actually managed to create an inode, in which case it is called on the inode.
2024-10-22fs-util: always go through the unlink cleanup paths in xopenat_full()Lennart Poettering1-5/+3
We didn't go through it at all if label_ops_post() failed.
2024-10-22fs-util: remove misplaced RET_NERRNO()Lennart Poettering1-1/+1
2024-10-22bus-util: Fix bus_log_connect_error()Daan De Meyer1-3/+3
2024-10-22bus-util: Special case when DBUS_SESSION_BUS_ADDRESS is set and ↵Daan De Meyer1-1/+11
XDG_RUNTIME_DIR isn't We noticed some failures because we have code that connects to user managers by setting DBUS_SESSION_BUS_ADDRESS without setting XDG_RUNTIME_DIR. If that's the case, connect to the user session bus instead of the private manager bus as we can't connect to the latter if XDG_RUNTIME_DIR is not set.
2024-10-22bus-util: Return ENOMEDIUM if XDG_RUNTIME_DIR is unsetDaan De Meyer1-1/+1
bus_log_connect_error() checks for ENOMEDIUM, not ENXIO.
2024-10-21test: CET/EET are deprecated, use Europe/Berlin and KyivLuca Boccassi4-17/+14
The links moved to the legacy dataset so they won't be available by default, so stop using them and just use the city ones instead
2024-10-21resolve: move sd-* api into libsystemd-networkRonan Pigott9-6/+41
This duplicates the svc param constants for the benefit of the resolved-core library.
2024-10-21ndisc: implement ndisc_option_build_encrypted_dnsRonan Pigott1-0/+140
This is only used by the fuzzer so far.
2024-10-21network: add dnr resolvers to networkctl status json outputRonan Pigott4-1/+144
2024-10-21test/fuzz: add dnr packetsRonan Pigott3-0/+0
The structure of DNR options is considerably more complicated than most DHCP options, and as a result the fuzzer has poor coverage of these code paths. This adds some DNR packets to the fuzzing corpus, not with the intent of capturing some specific edge case, but with the intent to rapidly improve the fuzzers' coverage of these codepaths by giving it a valid example to begin with. Also include an ndisc router advert with a few Encrypted DNS options, for the same purpose.
2024-10-21network: Serialize ipv6ra DNRRonan Pigott1-0/+24
Serialize DNR servers acquired by ipv6ra option, same as the V4/V6 DNR DHCP options.
2024-10-21network: Introduce IPv6RA UseDNR= optionRonan Pigott6-0/+19
Same as the DHCP v4/v6 options, this controls the use of DNR received from ipv6ra.
2024-10-21ndisc: Parse RFC9463 encrypted DNS (DNR) optionRonan Pigott7-1/+373
This option is equivalent to the V4/V6 DNR options for DHCP.
2024-10-21test-network: add DHCPv6 DNR testRonan Pigott1-1/+33
Same as the DHCPv4 test.
2024-10-21network: Serialize DHCPv6 DNR serversRonan Pigott1-2/+41
This serializes DNR servers acquired by V6_DNR option, equivalent to the V4_DNR option.
2024-10-21network: Introduce UseDNR DHCPv6 optionRonan Pigott7-0/+14
This is equivalent to the DHCPv4 option introduced earlier.
2024-10-21network: Parse RFC9463 DHCPv6 DNR optionRonan Pigott4-2/+111
Implement the parsing for V6_DNR DHCPv6 option. This does the same as the DHCP V4_DNR option.
2024-10-21dhcp6: use dns_name_from_wire_formatRonan Pigott2-76/+5
Convert some of the option parsing to use dns_name_from_wire_format, introduced earlier. No change in behavior intended.
2024-10-21test-dhcp6: terminate fqdn optionRonan Pigott1-4/+4
The encoded fqdn in this option must be properly terminated. We will soon validate that this field is correctly encoded, so correct it in the test.
2024-10-21test-network: add test for DHCPv4 DNRRonan Pigott1-0/+69
This will test that networkd/resolved can understand the V4_DNR DHCP option.
2024-10-21network: Serialize DNR serversRonan Pigott6-5/+105
Implement serialization/deserialization for DNR servers. This re-uses the string format in place for user configuration of DoT servers, and as a consequence non-DoT servers are discarded when recording the link configuration, for correctness. This also enables sd-resolved to use these servers as it would other DNS servers.
2024-10-21network: Add serialization for DoT resolversRonan Pigott3-0/+98
For now only DoT is supported, so DoT resolvers are represented using the existing configuration format.
2024-10-21network: Introduce UseDNR DHCPv4 optionRonan Pigott5-0/+27
This option will control the use of DNR for choosing DNS servers on the link. Defaults to the value of UseDNS so that in most cases they will be toggled together.
2024-10-21machine: add tests for Addresses/OSRelease/UIDShift fields in ↵Ivan Kruglov1-0/+16
io.systemd.Machine.List output
2024-10-21machine: use AcquireMetadata in io.systemd.MachineImage.List methodIvan Kruglov3-10/+23
2024-10-21machine: add Addresses field in varlink io.systemd.Machine.List outputIvan Kruglov2-2/+60
This is equivalent to DBus implementation of GetMachineAddresses.
2024-10-21machine: add OSRelease and UIDShift fields in varlink ↵Ivan Kruglov2-8/+64
io.systemd.Machine.List output This commit adds support of the above mentioned fields. This is equivalent to DBus implementation of: - GetMachineOSRelease - GetMachineUIDShift
2024-10-21machine: enum AcquireMetadataIvan Kruglov3-0/+24
2024-10-21Rework TEST-86-MULTI-PROFILE-UKIDaan De Meyer5-43/+40
Now that mkosi supports generating UKI profiles, let's make use of that to generate the UKI profiles required for the test instead of doing it within the test itself.
2024-10-21TEST-70-TPM2: Disable public key enrollment explicitlyDaan De Meyer1-2/+2
Otherwise, when the test is executed on a system with signed PCRs, cryptenroll will automatically pick up the public key from the UKI which results in a volume that can't be unlocked because the pcrextend tests appends extra things to pcr 11.
2024-10-21cryptenroll: Remove faulty assert()Daan De Meyer1-2/+0
We can break out of the preceeding for loop in certain scenarios which would trigger the assert so let's drop it.
2024-10-21pcrlock: Take VirtualSize > SizeOfRawData into accountDaan De Meyer1-1/+15
If VirtualSize > SizeOfRawData, measure extra zeros to take into account the extra zeros also measured by the stub.
2024-10-21machine: rework Operation logic to reuse in varlink interfaceIvan Kruglov5-43/+68
2024-10-21mkosi: update opensuse commit referenceLuca Boccassi1-1/+1
It was force-pushed again
2024-10-21varlinkctl: respect $COLUMNS when rebreaking lines and we are not connected ↵Lennart Poettering3-11/+38
to a TTY Let's provide a mechanism to select the number of screen columns for rebreaking comments in Varlink IDL connected to a TTY, by honouring the $COLUMNS env var then too. Previously we'd only honour when connected to a TTY, but it's also useful otherwise for rebreaking ridiculously long comments, hence honour it in this case too.
2024-10-21tty-askpw-agent: modernize wall_tty_match() a bitLennart Poettering1-11/+9
2024-10-21ask-password-api: don't accidentally create a dir, when we don't want oneLennart Poettering3-11/+21
Previously, we were using touch(), which usually works fine, because the path should always refer to an existing directory, in which case it just updates the timestamp. However, if the dir does not exist yet (which shouldn't happen), it would be created as regular file, which is just wrong. Hence, let's instead create the dir as dir if it is missing, and then update its timestamp.
2024-10-21man: update PASSWORD_AGENTS spec, and introduce unpriv pw queriesLennart Poettering1-21/+60
Fixes: #1232 #2217
2024-10-21ask-password-tool: add --user/--system flag to systemd-ask-password toolLennart Poettering2-24/+46
This allows selecting which agents to ask about this: system-level agents, or per-user agents. Fixes: #1232 #2217
2024-10-21ask-password-api: add support for querying pws from unpriv agentsLennart Poettering2-44/+94
2024-10-21ask-password-api: minor modernizationsLennart Poettering1-69/+62
2024-10-21tty-ask-password-agent: support for watching both system-wide and per-user ↵Lennart Poettering3-7/+42
askpw dir Fixes: #1232 #2217
2024-10-21tty-ask-password-agent: minor modernizationsLennart Poettering1-47/+43
2024-10-21core: modernize askpw handling a bitLennart Poettering2-31/+38
2024-10-21sysupdate: Use camelCase for JSON field namesAdrian Vovk4-16/+16
Seems like we missed some snake_case field names in previous reviews of systemd-sysupdate
2024-10-20measure: Take SizeOfImage into account as well for .linux sectionDaan De Meyer1-0/+33
Same change as https://github.com/systemd/systemd/pull/34583 but for systemd-measure. Otherwise we end up with PCR policy digest mismatches as systemd-stub will measure the full virtual size of the kernel image after it has been loaded while systemd-measure will disregard the extra size introduced by SizeOfImage. While ideally the stub would only measure the data that's actually on disk and not the uninitialized data introduced by VirtualSize > SizeOfRawData, we want newer systemd-measure to work with older stubs so we have to fix systemd-measure and can't fix this in the stub.
2024-10-19test: exercise bypass mode on the sd-resolved stubRonan Pigott1-1/+10
A basic test will verify that we provide the right flags.