summaryrefslogtreecommitdiffstats
path: root/coccinelle/strjoin.cocci (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-02-20test: fix mixed indentFrantisek Sumsal1-1/+1
2024-02-20test: support TEST_MATCH_* stuff in TEST-23-UNIT-FILE as wellFrantisek Sumsal1-0/+5
TEST-23 uses run_subtests_with_signals() which I forgot about when introducing the change. Follow-up for 0efa27bd4b.
2024-02-20analyze: skip to check ExecCommand for .mount and .swap unitsYu Watanabe1-8/+0
They are not set by a unit file, but dynamically generated. Fixes a bug caused by abf0ccc1c6fb81fdcb801566695600a518a28b43. Fixes #31396.
2024-02-20logind: drop bitfield annotationsZbigniew Jędrzejewski-Szmek1-7/+7
As in other cases, this is simpler but better. pahole: - /* size: 336, cachelines: 6, members: 50 */ - /* sum members: 316, holes: 4, sum holes: 19 */ - /* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */ - /* last cacheline: 16 bytes */ + /* size: 328, cachelines: 6, members: 50 */ + /* sum members: 320, holes: 3, sum holes: 8 */ + /* last cacheline: 8 bytes */
2024-02-20timesyncd: reorder structs instead of useless bitfieldsZbigniew Jędrzejewski-Szmek2-4/+3
Because of alignment, those bitfields were not doing anything useful, and were causing the generated code to be more complicated. But in this case, at least potentially there might be a number of copies of those structs (if we have a bunch of time servers configured), so let's actually implement the intended space savings by reording the fields to reduce the size of holes.
2024-02-20systemctl: drop pointless bitfieldZbigniew Jędrzejewski-Szmek1-1/+1
2024-02-20sysupdate: drop pointless bitfieldsZbigniew Jędrzejewski-Szmek1-3/+3
Again, even without considering how many copies of the struct there can be, this bitfield is useless because of alignment.
2024-02-20core/kmod-setup: drop another pointless bitfield annotationZbigniew Jędrzejewski-Szmek1-11/+10
We have two bools followed by a func pointer, which is aligned to e.g. 8 bytes, so whether the two bools take one bit, one byte, or even a full word, makes no difference in storage size. But the code generated to service a bitfield is more complicated. Also switch to FOREACH_ARRAY().
2024-02-20udev: String substitutions can be done in ENV, tooruniq1-7/+8
Precedence for example in https://github.com/systemd/systemd/blob/ac63c8df309e37960618610d8b57ac19ac657254/rules.d/99-systemd.rules.in#L75. Add ENV to the list of keys where string substitutions can be used. While I'm at it, also sort the list in that paragraph alphabetically.
2024-02-20home: fix typoYu Watanabe2-2/+2
Follow-up for 25c89b89771adf3251b2398eaddc3a49c22752e3 and a4d72746c776f820a440d72eaadd49ad158e10dc.
2024-02-20vconsole-setup: fix typoYu Watanabe1-2/+2
Follow-up for 190ff0d0a8d1fc367ec04296f24cd1cab5b7543b.
2024-02-19resolve: several follow-ups for resolving service via varlinkYu Watanabe3-56/+75
Follow-ups for e1634bb8321c5534a8e5d16b474c7e9d43ef3baa. - Allow to call the method without "name" and "type". - Allow to specify SD_RESOLVE_NO_TXT and SD_RESOLVE_NO_ADDRESS. - Allow to provide multiple services, and fix memory leak. - Rearrange the return value format. - Encode TXT field with octescape() to make the field matches with the io.systemd.Resolve.Monitor interface. Fixes #31371.
2024-02-19gpt-auto-generator: fix argument passed to `parse_image_policy_argument`Antonio Alvarez Feijoo1-1/+1
Otherwise: ``` Feb 19 16:35:34 localhost systemd-gpt-auto-generator[188]: Assertion 's' failed at src/shared/image-policy.c:656, function parse_image_policy_argument(). Aborting. ``` Fixes 06e78680e3c36589b785f90ecda64d124905a3f7
2024-02-19pkcs11-util: Explicitly initiaiize variable to avoid warningDaan De Meyer1-1/+1
Avoid the following warning on C9S by explicitly initializing "object". """ [389/2801] Compiling C object src/shared/libsystemd-shared-256-devel.a.p/pkcs11-util.c.o ../src/src/shared/pkcs11-util.c: In function ‘pkcs11_token_find_private_key’: ../src/src/shared/pkcs11-util.c:983:21: warning: ‘object’ may be used uninitialized in this function [-Wmaybe-uninitialized] 983 | *ret_object = object; | ~~~~~~~~~~~~^~~~~~~~ """
2024-02-19cgroup: typo fix initial_restric_ifaces_link_fds → ↵Lennart Poettering3-7/+7
initial_restrict_ifaces_link_fds
2024-02-19test: add a test for #31384David Tardon2-0/+23
2024-02-19core/execute: clean up log_exec_full_errno and friendsMike Yuan3-56/+38
Also drop unused log_exec_struct_iovec().
2024-02-19core/exec-invoke: raise the log level of missing executable to noticeMike Yuan1-1/+1
Suggested in https://github.com/systemd/systemd/pull/31351#discussion_r1494450831: > one above just informational, but also not a warning yet.
2024-02-19core/exec-invoke: record correct exit status when failed to locate executableMike Yuan3-20/+35
Follow-up for 4d8b0f0f7aeadc401ac02f67576ccb1de8cf79e6 After the mentioned commit, when the ExecCommand executable is missing, and failure will be ignored by manager, we exit with EXIT_SUCCESS at executor side too. The behavior however contradicts systemd.service(5), which states: > If the executable path is prefixed with "-", an exit code of the command > normally considered a failure (i.e. non-zero exit status or abnormal exit > due to signal is _recorded_, but has no further effect and is considered > equivalent to success. and thus makes debugging unexpected failures harder. Therefore, let's still exit with EXIT_EXEC, but just skip LOG_ERR level log.
2024-02-19ci(labeler): add policy for `escape` labelerJan Macku1-0/+3
2024-02-19Set SYSTEMD_LOG_LEVEL=info explicitly in test-sysusersDaan De Meyer1-1/+1
If we're looking for output on stderr, let's make sure it's not littered with debug logs if SYSTEMD_LOG_LEVEL=debug.
2024-02-19update TODOAdrian Vovk1-4/+0
2024-02-19TEST-46-HOMED: Add tests for blob directoriesAdrian Vovk1-3/+134
2024-02-19homectl: Add flags to edit blob directoriesAdrian Vovk3-9/+290
This makes it possible to edit blob directories using homectl. The following syntax is available: * `--blob-directory=/path/somewhere`: Replaces the entire blob directory with the contents of /path/somewhere * `--blob-directory=foobar=/path/somewhere`: Replaces just the file foobar in the blob directory with the contents of /path/somewhere * `--blob-directory=foobar=`: Deletes the file foobar from the blob directory * `--blob-directory=`: Resets all previous flags * `--avatar=`, etc: Shortcuts for `--blob-directory=FILENAME=` for the known files in the blob directory
2024-02-19homework: Handle Update & Create w/ blob dirAdrian Vovk16-49/+534
Introduces new extended variants of the various incarnations of Create and Update, which take a map of filenames to FDs. This map is then used to populate the bulk directory. FDs are used to prevent the client from abusing homed's blob directory permissions (everything is made world-readable by homed) to open files that they normally aren't allowed to open. Passing along an FD ensures that the client has read access to the file it wants homed to make world-readable. Internally, homework uses the map to overwrite the system blob dir. Later, homework's existing blob dir reconciliation logic will propagate the new contents from the system blob dir into the embedded blob dir
2024-02-19homework: Reconcile blob directoriesAdrian Vovk6-17/+299
Whenever the host & embedded records are reconciled, the host & embedded blob directories are now reconciled too in the same direction. Reconciling the blob directories serves exactly the same purpose as reconciling the user records, and thus should behave in the same way.
2024-02-19homed: Create & advertise blob directoryAdrian Vovk7-2/+70
This ensures that a user-specific blob directory exists in /var/cache/systemd/homed for as long as the user exists, and gets deleted if the user gets deleted. It also advertises this blob directory via the user record, so that clients can find and use it.
2024-02-19user-record: Add blobDirectory and blobManifestAdrian Vovk5-5/+128
These fields are used to connect a JSON user record to its blob directory, and to include the directory's contents in the record's signature
2024-02-19Document blob directory behaviorAdrian Vovk2-0/+131
We're documenting the behavior of blob directories here. These docs refer to things that aren't yet implemented at the time of the commit, but will be later in the same PR.
2024-02-19fd-util: Expose helper to pack fds into 3,4,5,...Adrian Vovk6-48/+82
This is useful for situations where an array of FDs is to be passed into a child process (i.e. by passing it through safe_fork). This function can be called in the child (before calling exec) to pack the FDs to all be next to each-other starting from SD_LISTEN_FDS_START (i.e. 3)
2024-02-19journal: use the usual spelling of "serialize"Zbigniew Jędrzejewski-Szmek1-3/+3
2024-02-19vmspawn: rework --helpZbigniew Jędrzejewski-Szmek1-33/+28
In this context, "VM" doesn't need explaining. Make the texts more precise and try to make them fit in one line. Help output is much easier to read when it's not wrapped.
2024-02-19man: reword paragraph about --forward-journal= and adjust spacingZbigniew Jędrzejewski-Szmek1-104/+124
The previous text did not look right when rendered. The text is much easier to read when paragraphs are separated by an empty line, latex-style.
2024-02-19test-journald-config: indentationZbigniew Jędrzejewski-Szmek1-14/+14
2024-02-19journald: shorten code a bit and return error where it's usefulZbigniew Jędrzejewski-Szmek3-57/+47
Follow-up for f31cff849d3db074d0d8157e4117d9b8372c03e8.
2024-02-19test: temporarily enable session lingering for the test userFrantisek Sumsal1-0/+2
So the user daemon with the long-running service is not killed while we test the journal: [ 834.077080] testsuite-04.sh[10937]: Running as unit: user-sleep.service; invocation ID: b1f2c9c9a14a40ce836c867139d14dc8 [ 834.077687] systemd[10943]: Started user-sleep.service. [ 834.078437] (sd-pam)[10952]: pam_unix(login:session): session closed for user testuser [ 834.078643] systemd[1]: run-u3.service: Deactivated successfully. [ 834.078710] testsuite-04.sh[10930]: + for _ in {0..9} [ 834.078710] testsuite-04.sh[10930]: + journalctl --rotate ... [ 834.081253] systemd[1]: session-7.scope: Deactivated successfully. ... [ 844.602065] testsuite-04.sh[10930]: + journalctl --rotate [ 844.630414] testsuite-04.sh[10930]: + journalctl --sync [ 844.632005] systemd[1]: Stopping user@4711.service... [ 844.634179] systemd[10943]: Activating special unit exit.target... [ 844.635769] systemd[10943]: Stopped target default.target. [ 844.636136] systemd[10943]: Stopped target timers.target. [ 844.636479] systemd[10943]: Stopping user-sleep.service... [ 844.636998] systemd[10943]: Stopped user-sleep.service. ... [ 844.758893] testsuite-04.sh[10930]: + systemctl stop --user -M testuser@ user-sleep.service [ 845.213399] systemctl[11066]: Failed to stop user-sleep.service: Unit user-sleep.service not loaded.
2024-02-19Revert "test: use btrfs by default on Arch as well"Frantisek Sumsal1-5/+1
There's something very wrong going on when using btrfs for the test images, namely: - there's a significant performance hit, i.e. the Arch Linux run is ~20% slower, in the coverage run the situation is even worse - intermittent boot failures - intermittent "No space left on device" errors (even though there's enough free space) Since debugging this might take a while, let's temporarily revert back to ext4 to make the CI stable again. This reverts commit 7eb7e3ec4f5dbc13ee729557e1544527f3101187.
2024-02-19sd-radv: fix potential buffer overflowYu Watanabe1-3/+3
Fixes a bug in 1925f829ab17cee7d65cc8c350d8281f8f41588e and 6a6d27bc5b08388964118e922f0c1b49b3c6a8ae (v255).
2024-02-19pam-util: include cache ID of bus connection in the log messageYu Watanabe2-2/+4
To make it easier to debug issues like #31375.
2024-02-19core/exec: do not crash with UtmpMode=user without User= settingYu Watanabe2-1/+12
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2264404. Replaces #31356.
2024-02-19vconsole-setup: don't fail if the only found vc is already used by plymouthFranck Bui1-11/+37
During the boot process, systemd-vconsole-setup can be started when the only allocated VC is already taken by plymouth. This case is expected when a boot splash is displayed hence systemd-vconsole-setup.service should not fail if it happens. However rather than doing nothing, the sysfs utf8 flag is set before exiting early.
2024-02-18test: make testcase_owneridmap() compatible with coverage runsFrantisek Sumsal1-0/+1
Follow-up for 614d09a.
2024-02-18man: fix typo in uid0.xmlLuca Boccassi1-1/+1
Follow-up for 72eb3081b21a12252159e24188e25d04f14af83c
2024-02-17TODO: fix typoYu Watanabe1-1/+1
Follow-up for 10e3f15ac1258dd62bbb01e29375264d33e17deb.
2024-02-17test: "modernize" TEST-55-OOMD's initFrantisek Sumsal1-7/+6
2024-02-17test: don't abbreviate log messages when dumping the test journalFrantisek Sumsal1-1/+1
To make debugging test fails easier.
2024-02-17test: use btrfs' mkswapfile on btrfsFrantisek Sumsal2-4/+9
So it's created automagically with proper attributes.
2024-02-17test: make TEST-08-INITRD slightly less annoying to debugFrantisek Sumsal1-0/+4
Forward journal to console, since we won't have any journal from initrd and shutdown/exit initrd phases. Also, mention systemd.journald.max_level_console=debug that is very handy for debugging initrd shenanigans, but don't use it by default since it sends a _lot_ of stuff to the serial console, which slows down the test a lot.
2024-02-17test: always try to install the ext4 moduleFrantisek Sumsal1-2/+2
So the tests work even if the base image filesystem is not ext4.
2024-02-17test: use btrfs by default on Arch as wellFrantisek Sumsal1-1/+5