summaryrefslogtreecommitdiff
path: root/src/tmpfiles
Commit message (Collapse)AuthorAgeFilesLines
* meson: make the second and third elements of tests or fuzzers optionalYu Watanabe2021-01-191-3/+1
| | | | Then, we can shorten many test definitions.
* tmpfiles: move offline-passwd.[ch] to src/tmpfilesYu Watanabe2021-01-194-4/+269
| | | | | | offline-passwd.[ch] are only used by systemd-tmpfiles and the relevant test. And are not included in libshared. So, it is not suitable to located under src/shared.
* tmpfiles: add ANSI highlighting to our help textLennart Poettering2021-01-121-2/+4
| | | | As it is common now in our tools.
* string-util: imply NULL termination of strextend() argument listLennart Poettering2021-01-061-1/+1
| | | | | The trailing NULL in the argument list is now implied (similar to what we already have in place in strjoin()).
* tmpfiles: fix typoYu Watanabe2020-12-191-1/+1
| | | | Follow-up for 94566540e3863032df3a8a89f948b94d764ca2b4.
* tmpfiles: try to set file attributes one by oneYu Watanabe2020-12-181-5/+9
| | | | Closes #17690.
* tree-wide: sort specifiers and move common comments to specifier.hYu Watanabe2020-11-251-7/+9
|
* specifiers: introduce common macros for generating specifier tablesLennart Poettering2020-11-251-6/+2
| | | | | | | | | | | | | In many cases the tables are largely the same, hence define a common set of macros to generate the common parts. This adds in a couple of missing specifiers here and there, so is more thant just refactoring: it actually fixes accidental omissions. Note that some entries that look like they could be unified under these macros can't really be unified, since they are slightly different. For example in the DNSSD service logic we want to use the DNSSD hostname for %H rather than the unmodified kernel one.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-092-2/+2
|
* tmpfiles: Handle filesystems without ACL support in more cases.Pat Coulthard2020-10-261-11/+16
|
* Merge pull request #17297 from ↵Michael Biebl2020-10-201-2/+12
|\ | | | | | | | | keszybz/tmpfiles-sysusers-disable-standalone-image tmpfiles,sysusers: disable --image= support in standalone versions
| * tmpfiles,sysusers: disable --image= support in standalone versionsZbigniew Jędrzejewski-Szmek2020-10-091-2/+12
| | | | | | | | Fixes #17278.
* | tmpfiles: no need to specify a synthetic error code if we don't propagate itLennart Poettering2020-10-191-1/+1
| |
* | tree-wide: assorted coccinelle fixesFrantisek Sumsal2020-10-091-12/+12
|/
* tree-wide: fix typos found by codespellFrantisek Sumsal2020-09-141-1/+1
| | | | Reported by Fossies.org
* Merge pull request #16933 from poettering/copy-hardlinksZbigniew Jędrzejewski-Szmek2020-09-101-1/+1
|\ | | | | copy: optionally recreate hardlinks when copying file trees
| * tree-wide: copy hardlinks wherever we deal with possibly large OS-style treesLennart Poettering2020-09-091-1/+1
| | | | | | | | Fixes: #7382
* | fs-util,tmpfiles: fix error handling of fchmod_opath()Lennart Poettering2020-09-101-4/+7
|/ | | | | | | | | When 4dfaa528d45 was first commited its callers relied on `errno` instead of the return value for error reporting. Which worked fine, since internally under all conditions base were set — even if ugly and not inline with our coding style. Things then got broken in f8606626ed3c2582e06543550d58fe9886cdca5f where suddenly additional syscalls might end up being done in the function, thus corrupting `errno`.
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-081-13/+8
|
* stat-util: provide single fallback implementation of statx()Lennart Poettering2020-09-031-132/+72
| | | | | | This simplifies things quite a bit, and is reusable wherever we want to use statx() later on. Not sure why I didn't do it like this right from the beginning...
* stat-util: add new macros for declaring statx variableLennart Poettering2020-09-031-13/+2
| | | | | Let's deal with the msan initialization issue once for all cases instead of over and over again.
* Merge pull request #16877 from poettering/tmpfiles-statxZbigniew Jędrzejewski-Szmek2020-09-011-63/+204
|\ | | | | tmpfiles: use statx()
| * tmpfiles: use statx() when aging filesLennart Poettering2020-08-281-63/+204
| | | | | | | | | | | | | | | | This allows us to properly detect mount points, for free. (Also, allows us to respect btimes that are newer than the cutoff, which should be useful when people untar file trees in /var/tmp) Fixes: #16848
* | tree-wide: no need to negate argument to ERROR_IS_XYZ()Lennart Poettering2020-08-281-1/+1
|/ | | | These macros call abs() internally, hence let's simplify invocations.
* basic/time-util: add function to format timestamps with different stylesLuca Boccassi2020-08-191-8/+8
| | | | | Instead of a multiple fixed format helper functions, add an enum and a single helper, so that it's easier to extend in the future.
* tmpfiles: support --image= similar to --root=Lennart Poettering2020-08-051-5/+43
|
* tmpfiles: properly prefix paths in debug outputsLennart Poettering2020-08-051-3/+13
| | | | This is otherwise very confusing...
* tmpfiles: we don't support the combination of --root and --user, hence refuse itLennart Poettering2020-08-051-0/+4
| | | | | --user only really works with certain env vars such as XDG_RUNTIME_DIR set, but that's just weird if --root= is used.
* tmpfiles: add new switch -E for quickly excluding /proc, /dev, /sys and /runLennart Poettering2020-08-051-1/+30
|
* Move offline-password.[ch] to shared and add test-offline-passwdZbigniew Jędrzejewski-Szmek2020-07-183-133/+2
| | | | | | The test binary has two modes: in the default argument-less mode, it just checks that "root" can be resolved. When invoked manually, a root prefix and user/group names can be specified.
* tree-wide: avoid some loaded termsLennart Poettering2020-06-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | https://tools.ietf.org/html/draft-knodel-terminology-02 https://lwn.net/Articles/823224/ This gets rid of most but not occasions of these loaded terms: 1. scsi_id and friends are something that is supposed to be removed from our tree (see #7594) 2. The test suite defines an API used by the ubuntu CI. We can remove this too later, but this needs to be done in sync with the ubuntu CI. 3. In some cases the terms are part of APIs we call or where we expose concepts the kernel names the way it names them. (In particular all remaining uses of the word "slave" in our codebase are like this, it's used by the POSIX PTY layer, by the network subsystem, the mount API and the block device subsystem). Getting rid of the term in these contexts would mean doing some major fixes of the kernel ABI first. Regarding the replacements: when whitelist/blacklist is used as noun we replace with with allow list/deny list, and when used as verb with allow-list/deny-list.
* Merge pull request #16238 from keszybz/set-handling-moreZbigniew Jędrzejewski-Szmek2020-06-241-5/+1
|\ | | | | Fix handling of cases where a duplicate item is added to a set and related cleanups
| * tree-wide: use set_ensure_put()Zbigniew Jędrzejewski-Szmek2020-06-221-5/+1
| | | | | | | | | | | | | | | | | | Patch contains a coccinelle script, but it only works in some cases. Many parts were converted by hand. Note: I did not fix errors in return value handing. This will be done separate to keep the patch comprehensible. No functional change is intended in this patch.
* | Make failures of mac_selinux_init() fatalChristian Göttsche2020-06-231-1/+3
|/
* meson: build standalone version of systemd-tmpfilesFilipe Brandenburger2020-06-101-0/+7
| | | | | | | Use -Dstandalone-binaries=yes to enable building and installing this standalone version of the binary without a dependency on the systemd-shared solib. Also move the list of sources for systemd-tmpfiles to its own meson.build file.
* Merge pull request #15910 from poettering/tmpfiles-pstore-tweakDaan De Meyer2020-05-261-4/+8
|\ | | | | tmpfiles: let's make pstore sysfs failure silent
| * tmpfiles: downgrade log message when we can't write a file and failure is ↵Lennart Poettering2020-05-251-4/+8
| | | | | | | | allowed
* | tmpfiles: deal with kernel errno change if quota is not enabledLennart Poettering2020-05-261-1/+1
|/ | | | | | | | | | | Old kernels returned EINVAL if quota was off but we tried to manipulate it anyway. Since https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a36e408d40606e21cd4e2dd9601004a67b14868 this changed: now ENOTCONN is returned. This of course is a kernel API compat breakage, but let's not make a fuss and just map EINVAL to ENOTCONN to make it recognizable the same way everywhere. Fixes: #15896
* Merge pull request #15718 from poettering/tmpfiles-offlineZbigniew Jędrzejewski-Szmek2020-05-083-12/+199
|\ | | | | tmpfiles: read /etc/passwd + /etc/group with fgetpwent()/fgetgrent() if --root= is specified
| * sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. ↵Lennart Poettering2020-05-071-4/+6
| | | | | | | | without NSS)
| * tmpfiles: optionally, read /etc/passwd + /etc/group without NSSLennart Poettering2020-05-073-8/+193
| | | | | | | | | | | | | | | | | | | | There are two libc APIs for accessing the user database: NSS/getpwuid(), and fgetpwent(). if we run in --root= mode (i.e. "offline" mode), let's use the latter. Otherwise the former. This means tmpfiles can use the database included in the root environment for chowning, which is a lot more appropriate. Fixes: #14806
* | Add %l as specifier for the hostname without any domain componentZbigniew Jędrzejewski-Szmek2020-05-071-0/+1
|/ | | | | | | | | As described in #15603, it is a fairly common setup to use a fqdn as the configured hostname. But it is often convenient to use just the actual hostname, i.e. until the first dot. This adds support in tmpfiles, sysusers, and unit files for %l which expands to that. Fixes #15603.
* Merge pull request #15626 from poettering/more-specifiersFrantisek Sumsal2020-04-291-0/+5
|\ | | | | tmpfiles,sysusers,pid1: add a bunch of more specifiers
| * tree-wide: support a bunch of additional specifiersLennart Poettering2020-04-281-0/+5
| |
* | tmpfiles: remove unnecessary assertLennart Poettering2020-04-291-3/+1
| | | | | | | | | | | | | | if we parse an xattr line that has no valid assignment, we might end up with an empty ->xattr list. Don't hit assert on that, just go on. Fixes: #15610
* | tmpfiles: use log_syntax() for all parse errorsLennart Poettering2020-04-291-47/+36
|/
* tmpfiles: if we get ENOENT when opening /proc/self/fd/, check if /proc is ↵Lennart Poettering2020-04-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | mounted let's return ENOSYS in that case, to make things a bit less confusng. Previously we'd just propagate ENOENT, which people might mistake as applying to the object being modified rather than /proc/ just not being there. Let's return ENOSYS instead, i.e. an error clearly indicating that some kernel API is not available. This hopefully should put people on a better track. Note that we only do the procfs check in the error path, which hopefully means it's the less likely path. We probably can add similar bits to more suitable codepaths dealing with /proc/self/fd, but for now, let's pick to the ones noticed in #14745. Fixes: #14745
* sysusers,tmpfiles: always mention error when failing to replace specifiersLennart Poettering2020-04-231-1/+1
|
* sd-path: rename the two functionsZbigniew Jędrzejewski-Szmek2020-03-271-1/+1
| | | | | | | | | | | I think the two names were both pretty bad. They did not give a proper hint what the difference between the two functions is, and sd_path_home sounds like it is somehow related to /home or home directories or whatever, when in fact both functions return the same set of paths as either a colon-delimited string or a strv. "_strv" suffix is used by various functions in sd-bus, so let's reuse that. Those functions are not public yet, so let's rename.
* tmpfiles: create with correct MAC label on option CChristian Göttsche2019-11-281-1/+1
| | | | Closes: #10855