summaryrefslogtreecommitdiff
path: root/src/tmpfiles
AgeCommit message (Collapse)Author
2016-04-20tmpfiles: add new 'e' action which cleans up a dir without creating itZbigniew Jędrzejewski-Szmek
I wanted to add a config line that would empty a directory without creating it if doesn't exist. Existing actions don't allow this. v2: properly add 'e' to needs_glob() and takes_ownership()
2016-04-20tmpfiles: shorten some long error messagesZbigniew Jędrzejewski-Szmek
Also don't print %m when the message already contains all the info.
2016-04-20tmpfiles: interpret "-" as stdinZbigniew Jędrzejewski-Szmek
2016-03-05tree-wide: use SET_FLAG() macro to make code more clearAlexander Kuleshov
2016-03-03Merge pull request #2781 from keszybz/selinux-and-warningsLennart Poettering
Selinux loading fix and warning cleanups
2016-03-01selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek
https://github.com/systemd/systemd/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
2016-03-02tree-wide: no need to pass excess flags to open()/openat() if O_PATH is passedAlexander Kuleshov
As described in the documentation: When O_PATH is specified in flags, flag bits other than O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored. So, we can remove unnecessary flags in a case when O_PATH is passed to the open() or openat().
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-02-01tmpfiles: don't skip path_set_perms on errorEvgeny Vereshchagin
fixes #2196
2016-01-13tree-wide: check if errno is greater than zero (2)Zbigniew Jędrzejewski-Szmek
Compare errno with zero in a way that tells gcc that (if the condition is true) errno is positive.
2015-11-16tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subvolumeLennart Poettering
It's not a good idea to create subvolumes for parts of the OS tree (such as /home, or /var) if the root directory is not a subvolume too. We shouldn't assume control of "heavier" objects such as subvolumes, if the originating object (the root directory) is a "light-weight" object, i.e. a plain directory. Effectively this means that chroot() environments that are run on a plain directory do not have to deal with problems around systemd creating subvolumes that cannot be removed with a simple "rm" anymore. However, if the chroot manager creates a proper subvolume for such an environment it will also get further subvolumes placed in there, under the assumption that the manager understands the concept of subvolumes in that case.
2015-11-10tmpfiles: don't consider it a problem if quota is not enabled on btrfsLennart Poettering
If quota is not enabled on a btrfs file system, accept that, and only log a debug message, but do not consider this a reason for failure. Fixes: #1809
2015-11-10defs: rework CONF_DIRS_NULSTR() macroLennart Poettering
The macro is generically useful for putting together search paths, hence let's make it truly generic, by dropping the implicit ".d" appending it does, and leave that to the caller. Also rename it from CONF_DIRS_NULSTR() to CONF_PATHS_NULSTR(), since it's not strictly about dirs that way, but any kind of file system path. Also, mark CONF_DIR_SPLIT_USR() as internal macro by renaming it to _CONF_PATHS_SPLIT_USR() so that the leading underscore indicates that it's internal.
2015-11-03util-lib: move CONF_DIRS_NULSTR definition to def.hLennart Poettering
After all, this is not some compiler or C magic, but something very specific to how systemd works, hence let's move it into def.h, and out of macro.h
2015-10-27mount-util: move fstype_is_network() and name_to_handle_at() definitions overLennart Poettering
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27util-lib: split out globbing related calls into glob-util.[ch]Lennart Poettering
2015-10-27util-lib: split out printf() helpers to stdio-util.hLennart Poettering
2015-10-27src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → ↵Lennart Poettering
capability-util.[ch] The files are named too generically, so that they might conflict with the upstream project headers. Hence, let's add a "-util" suffix, to clarify that this are just our utility headers and not any official upstream headers.
2015-10-27util-lib: split out umask-related code to umask-util.hLennart Poettering
2015-10-27util-lib: move string table stuff into its own string-table.[ch]Lennart Poettering
2015-10-27util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]Lennart Poettering
2015-10-27util-lib: move a number of fs operations into fs-util.[ch]Lennart Poettering
2015-10-27util-lib: split out file attribute calls to chattr-util.[ch]Lennart Poettering
2015-10-27util-lib: move more file I/O related calls into fileio.[ch]Lennart Poettering
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering
2015-10-26util-lib: split out user/group/uid/gid calls into user-util.[ch]Lennart Poettering
2015-10-26util-lib: split out IO related calls to io-util.[ch]Lennart Poettering
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-24util: split out escaping code into escape.[ch]Lennart Poettering
This really deserves its own file, given how much code this is now.
2015-10-24path-util: unify how we process paths specified on the command lineLennart Poettering
Let's introduce a common function that makes relative paths absolute and warns about any errors while doing so.
2015-10-24util-lib: get_current_dir_name() can return errors other than ENOMEMLennart Poettering
get_current_dir_name() can return a variety of errors, not just ENOMEM, hence don't blindly turn its errors to ENOMEM, but return correct errors in path_make_absolute_cwd(). This trickles down into a couple of other functions, some of which receive unrelated minor fixes too with this commit.
2015-10-23tmpfiles: simplify mountpoint detectionThomas Hindoe Paaboel Andersen
No functional change. Just a simplification. A || (!A && B) is the same as A || B Introduced in 78a92a5a2306709e4587e332728a76901323ade9
2015-10-22tmpfiles: introduce "q" and "Q" for creating quota-enabled btrfs subvolumesLennart Poettering
This allows us to set up the quota group hierarchy in a reasonable way on btrfs file systems.
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-08-07util: Don't interpret quotes by default in extract_first_wordRichard Maw
This adds an EXTRACT_QUOTES option to allow the previous behaviour, of not interpreting any character inside ' or " quotes as separators.
2015-08-07util: change unquote_*_word to extract_*_wordRichard Maw
It now takes a separators argument, which defaults to WHITESPACE if NULL is passed.
2015-08-06tree-wide: fix indentationThomas Hindoe Paaboel Andersen
2015-07-22tmpfiles: downgrade errors when a file system does not support file attributesLennart Poettering
This downgrades errors from setting file attributes via tmpfiles to warnings and makes them non-fatal. Also, as a special case, if a file system does not support file attributes at all, then the message is downgraded to debug, so that it is not seen at all. With this change reiserfs should not see any messages at all anymore (since it apparently does not implement file attributes at all), but XFS will still get a warning but no failure. The warning is something the XFS kernel folks should fix though, by adjusting their file attributes behaviour to be identical to ext234's. Fixes #560.
2015-06-17tmpfiles: only root-owned aquota.* files are specialZbigniew Jędrzejewski-Szmek
Fixes #188.
2015-06-15tmpfiles: make sure "R" lines also remove subvolumesLennart Poettering
2015-05-15tmpfiles: use lstat() instead of stat() when checking whether a file system ↵Lennart Poettering
object already exists
2015-05-15tmpfiles: don't fail if we cannot create a subvolume because a file system ↵Lennart Poettering
is read-only but a dir already exists anyway https://bugs.freedesktop.org/show_bug.cgi?id=90281
2015-05-13util: add generic calls for prefixing a root directory to a pathLennart Poettering
So far a number of utilities implemented their own calls for this, unify them in prefix_root() and prefix_roota(). The former uses heap memory, the latter allocates from the stack via alloca(). Port over most users of a --root= logic.
2015-05-06tmpfiles: try to handle read-only file systems gracefullyMichael Olbrich
On read-only filesystems trying to create the target will not fail with EEXIST but with EROFS. Handle EROFS by checking if the target already exists, and if empty when truncating. This avoids reporting errors if tmpfiles doesn't actually needs to do anything. [zj: revert condition to whitelist rather then blacklisting, and add goto to avoid stat'ting twice.]
2015-04-22tmpfiles: use an ordered hashmap for the tmpfiles itemsLennart Poettering
We should try to execute them in the same order they appear in the configuration files, as it is documented. Hence move to an ordered hashmap. (Note though, that this still doesn't execute them completely in order: we will still apply non-glob lines before glob-lines, and reorder lines prefixing each other and that apply to the same paths). http://lists.freedesktop.org/archives/systemd-devel/2015-March/029055.html
2015-04-21tmpfiles: consider an argument of "-" as non-specifiedLennart Poettering
2015-04-13tmpfiles: don't follow symlinks when adjusting ACLs, fille attributes, ↵Lennart Poettering
access modes or ownership
2015-04-12tmpfiles: use qsort_safeZbigniew Jędrzejewski-Szmek