summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tmpfiles: introduce an explicit line flag $ for enabling purge logic for a lineLennart Poettering2024-09-151-1/+15
| | | | | | | Let's make the risk of accidental misuse, and mark lines that shall be covered by --purge with an explicit new flag "$". See: #33349
* meson: rename libbasic to libbasic_staticZbigniew Jędrzejewski-Szmek2024-07-031-1/+1
| | | | | | | Our variables for internal libraries are named 'libfoo' for the shared lib variant, and 'libfoo_static' for the static lib variant. The only exception was libbasic, because we didn't have a shared variant for it. But let's rename it for consitency. This makes the build config easier to understand.
* tmpfiles: use common macro for a set of specifiersMatthias Lisin2024-06-261-11/+1
| | | | | | This adds %q, %A and %M specifiers to tmpfiles: - %A and %M were previously added to tmpfiles.d man page, but not to specifier_table - %q is added via COMMON_SYSTEM_SPECIFIERS
* tmpfiles: mention that --create also adjusts files/directories in --help textLennart Poettering2024-06-181-1/+1
|
* tmpfiles: suffix --replace= properly with = in commentLennart Poettering2024-06-181-6/+4
|
* tmpfiles: make --tldr help text symmetric to --cat-configLennart Poettering2024-06-181-1/+1
|
* tmpfiles: improve debug logging around O_NOATIME fallbackLennart Poettering2024-06-181-4/+3
|
* tmpfiles: remove pointless empty lineLennart Poettering2024-06-181-1/+0
|
* tmpfiles: move --purge to command section in --help text where it belongsLennart Poettering2024-06-181-2/+3
| | | | | Also, make contrast between --remove and --purge clearer: one deletes files marked for deletion, the other deletes files marked for creation.
* tmpfiles: insist on at least one configuration file being specified on --purgeLennart Poettering2024-06-181-0/+4
| | | | | | | Also, extend the man page explanation substantially, matching more closely what --create says. Fixes: #33349
* tmpfiles: honour --dry-run when removing directoriesLennart Poettering2024-06-181-4/+10
|
* tmpfiles: sort needs_purge line list in same order as enum defines themLennart Poettering2024-06-181-8/+8
|
* tmpfiles: improve warning message and use O_NOCTTYChristian Göttsche2024-05-281-2/+2
| | | | | | | | Mention in the warning message for a failed open on a to be removed file why systemd-tmpfiles tried to open it. Also open the file with the O_NOCTTY flag, since it should never become the controlling terminal.
* tmpfiles: use RET_GATHER more, add missing assertionsMike Yuan2024-05-101-45/+44
| | | | | | Note that item_do() now aborts on OOM, since it's pretty pointless to iterate further if memory allocation doesn't work.
* tmpfiles: don't compare errno with negative valueMike Yuan2024-05-101-1/+1
| | | | Follow-up for 677430b3c7fcd1b352eb66f19b8746741459b91a
* tmpfiles: clean up hardlinks_vulnerable a bitMike Yuan2024-05-101-14/+13
| | | | | | | | | dangerous_hardlinks() -> hardlinks_protected(), and the meaning of the function is now in line with fs.protected_hardlinks value. Plus, We ship 50-default.conf where the sysctl is enabled. Mention it in the comment.
* tmpfiles: Don't fail if file does not exist in item_do()Daan De Meyer2024-05-081-4/+5
| | | | | | | | | If the file was removed by some other program, we should just go to the next one without failing. item_do() is only used for recursive globs instead of fixed paths so skipping on missing files makes sense (unlike if the path was fixed where we should probably fail). Fixes #32691 (hopefully)
* gcrypt: dlopenify for libsystemdLuca Boccassi2024-04-031-1/+0
| | | | | | | | | gcrypt is used only for journal sealing operations in libsystemd, so it can be made into a dlopen dependency that is used only on demand. This allows to reduce the footprint of libsystemd in the most common cases. Keep systemd-pull and systemd-resolved with normal linking, as they are executables, and usually built with OpenSSL support anyway.
* Merge pull request #30480 from keszybz/kernel-install-more-pathsZbigniew Jędrzejewski-Szmek2024-03-081-4/+3
|\ | | | | Read kernel-install config from /run/kernel too
| * strv: add helper to extend strv from both sidesZbigniew Jędrzejewski-Szmek2024-03-071-2/+2
| | | | | | | | | | | | Also, use the more correct type of 'const char* const*' for the input strv. This requires adding the cast in a few places, but also allows to remove some casts in others.
| * various: use modern strv helpersZbigniew Jędrzejewski-Szmek2024-02-281-2/+1
| | | | | | | | | | If we're building a strv, let's just use strv_new() with the CONF_PATHS macro, which gives as an exploded string set.
* | tmpfiles: do 'X' bit check in an ACL-aware mannerMike Yuan2024-03-061-18/+28
| | | | | | | | | | | | | | | | | | | | | | Follow-up for 26d98cdd78cb5283f5771bd5866997acc494b067 I.e. stat() cannot be used here. Also, before this commit, the 'X' is only applied if the owner has execute bit set. Now it takes group and other into consideration too. setfacl(1) also has the same behavior.
* | tmpfiles: remove one more use of goto and modernizationMike Yuan2024-03-061-66/+47
| |
* | extract-word: update remaining calls to `extract_many_words`Antonio Alvarez Feijoo2024-03-051-2/+1
| | | | | | | | Follow-up to 4f49512695f8214c55c206b3c2f583dc7b309e1b
* | dissect-image: add flag for explicitly enabling userspace verity signature ↵Lennart Poettering2024-02-281-1/+2
|/ | | | | | | | | | checking let's make userspace verity signature checking optional. This adds a dissection flag to enable the logic and patches through all our users to enable it by default, thus effectively not changing anything from the status quo ante. However, know we have a knob to turn this off in certain scenarios.
* fs-util: rename xopenat() -> xopanat_full()Yu Watanabe2024-02-151-5/+1
|
* systemd-tmpfiles: use statx_mount_sameZbigniew Jędrzejewski-Szmek2024-02-121-12/+10
| | | | | It was pointed out in review that the preexisting code should be updated (https://github.com/systemd/systemd/pull/30380#discussion_r1426899180).
* tmpfiles: implement --dry-runZbigniew Jędrzejewski-Szmek2024-02-121-106/+210
| | | | | | | | The idea is simple: skip the final operation that creates or removes things or changes the attributes, but otherwise go through the rest of the code. This results in quite a lot of fairly repetitive conditions in the low-level code. Another approach would be to print earlier, at a higher level, but then we'd have less precise information about what is about to happen.
* tmpfiles: simplify how a helper function is calledZbigniew Jędrzejewski-Szmek2024-02-091-2/+5
| | | | No functional change.
* tmpfiles: use dir_cleanup() for R and DZbigniew Jędrzejewski-Szmek2024-02-091-31/+49
| | | | | | | | | | | | | | | | | | | | | | ... i.e. apply nested config (exclusions and such) when executing R and D. This fixes a long-standing RFE. The existing logic seems to have been an accident of implementation. After all, if somebody specifies a config with 'R /foo; x /tmp/bar', then probably the goal is to remove stuff from under /foo, but keep /tmp/bar. If they just wanted to nuke everything, then would not specify the second item. This also makes R and D use O_NOATIME, i.e. the access times of the directories that are accessed will not be changed by the cleanup. Obviously, we'll have to add this to NEWS and such. Looking at the whole tmpfiles.d config in Fedora, this change has no effect. The test cases are adjusted as appropriate. I also added another test case for 'R'/'D' with a file, just to test this code path more. Replaces #20641. Fixes #1633.
* tmpfiles: split out helper to open a directoryZbigniew Jędrzejewski-Szmek2024-02-091-34/+68
| | | | In preparation for future commits.
* tmpfiles: drop unnecessary assignmentZbigniew Jędrzejewski-Szmek2024-02-091-2/+2
|
* tmpfiles: split out verbs in helpZbigniew Jędrzejewski-Szmek2024-02-091-7/+10
| | | | | | | | | | One of the three must always be specified, but they buried in a long list of options in the output of --help. Make them more visible to draw the eye. Also, drop "marked" from the description. It's supposed to mean "configured", but it's a strange way to say that, and also it's generally obvious that the program does what its configuration tells it to, and it's not going to remove all files found on the system.
* tree-wide: use normal spelling of "reopen"Zbigniew Jędrzejewski-Szmek2024-02-091-3/+3
| | | | It's a commonly used verb meaning "to open again".
* tmpfiles: break long log invocations and commentsZbigniew Jędrzejewski-Szmek2024-02-091-57/+78
|
* tmpfiles: inline variable declarations, use FOREACH_ARRAY and RET_GATHERZbigniew Jędrzejewski-Szmek2024-02-091-42/+15
|
* tmpfiles: split out helper to open and read a "config file"Zbigniew Jędrzejewski-Szmek2024-02-091-59/+7
| | | | | | | No functional change. Note that this function will be modified in subsequent commits, and the API will change.
* tmpfiles: only populate uid and gid caches onceZbigniew Jędrzejewski-Szmek2024-02-091-8/+11
| | | | | | | | a3451c2c4ce7d3c02451f6ace4ee9f873880f78f added offline uid/gid support in a way where the <root>/etc/passwd and <root>/etc/group would be read anew for each configuration file that was parsed. The result would always be the same, so I assume that this was an oversight. Let's use a global cache and and read the file just once.
* tmpfiles: adjust vertical whitespaceZbigniew Jędrzejewski-Szmek2024-02-091-4/+7
|
* sysusers,tmpfiles: clarify error message for --replaceZbigniew Jędrzejewski-Szmek2024-02-091-3/+5
| | | | | | I was trying to run sysusers --replace, but the input file didn't have the right suffix, and the message was very confusing. Let's split the message in two to make it clearer that we care about the extension.
* Fix bug where systemd-tmpfiles gets stuck on fifos in tmp.r-vdp2024-01-291-1/+1
| | | | Fixes #30690.
* tree-wide: port over various pieces of code to strv_extend_many()Lennart Poettering2024-01-171-15/+11
|
* hexdecoct: make unbase64mem and unhexmem always use SIZE_MAXMike Yuan2024-01-081-1/+2
|
* tmpfiles: fix memory leak in arg_exclude_prefixesAntonio Alvarez Feijoo2024-01-081-4/+4
| | | | | | | | | When using the `--image` or `-E` options, `arg_exclude_prefixes` is extended via the `exclude_default_prefixes` function, which calls `strv_extend_strv`, adding values using `strdup` that must be freed on exit. Also changing `arg_include_prefixes` to use the same model, although there is no leak here.
* Merge pull request #30769 from AdrianVovk/statx-timestampLennart Poettering2024-01-051-19/+7
|\ | | | | stat-util: Add statx version of timespec_load
| * tmpfiles: Use statx_timestamp_loadAdrian Vovk2024-01-041-19/+7
| | | | | | | | This is a new utility function recently added. Let's use it.
* | Merge pull request #30749 from poettering/tmpfiles-verb-fixLennart Poettering2024-01-041-11/+11
|\ \ | |/ |/| tmpfiles: correctly apply globbing when cleaning 'x' lines
| * tmpfiles: 'x' takes globs, hence clean it with globbingLennart Poettering2024-01-041-2/+2
| |
| * tmpfiles: always list tmpfiles line types in same orderLennart Poettering2024-01-041-9/+9
| | | | | | | | otherwise it just gets too confusing to follow.
* | tmpfiles: add --purge switchLuca Boccassi2024-01-041-10/+65
|/ | | | | Any file/directory created by a tmpfiles.d will be deleted. Useful for purge/factory reset patterns.