summaryrefslogtreecommitdiff
path: root/src/tmpfiles/tmpfiles.c
Commit message (Collapse)AuthorAge
* Remove src/tmpfilesAndy Wingo2015-04-19
|
* util: rework word parsing and c unescaping codeLennart Poettering2015-03-26
| | | | | | | | | | | When parsing words from input files, optionally automatically unescape the passed strings, controllable via a new flags parameter. Make use of this in tmpfiles, and port everything else over, too. This improves parsing quite a bit, since we no longer have to process the same string multiple times with different calls, where an earlier call might corrupt the input for a later call.
* tmpfiles: minor simplificationLennart Poettering2015-03-26
|
* tmpfiles: avoid out of bounds readThomas Hindoe Paaboel Andersen2015-03-24
| | | | Otherwise this will go wrong for 'v'.
* Allow systemd-tmpfiles to set the file/directory attributesGoffredo Baroncelli2015-03-19
| | | | | | Allow systemd-tmpfiles to set the file/directory attributes, like chattr(1) does. Two more commands are added: 'H' and 'h' to set the attributes, recursively and not.
* tmpfiles: remove redundant debug messageZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | Mar 13 19:48:30 adam.happyassassin.net systemd-tmpfiles[970]: "/var/lib/machines" has right mode 40700 Mar 13 19:48:30 adam.happyassassin.net systemd-tmpfiles[970]: /var/lib/machines created successfully.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* tmpfiles: port to unquote_many_words()daurnimator2015-03-10
|
* tmpfiles: Fix handling of duplicate linesMartin Pitt2015-03-05
| | | | | | | | Commit 3f93da987 accidentally dropped the "return 0" after detection of a duplicate line. Put it back, to get back the documented and intended "first match wins" behaviour. https://launchpad.net/bugs/1428540
* tmpfiles: quietly ignore ACLs on unsupported filesystemsHans-Peter Deifel2015-03-03
| | | | | A warning is printed if ACLs cannot be retrieved for any reason other than -ENOSYS. For -ENOSYS, debug log is printed.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* tmpfiles: Fix parse_acl error messageMartin Pitt2015-02-17
| | | | parse_acl() returns the error instead of setting errno.
* tmpfiles: fix compilation without acl supportZbigniew Jędrzejewski-Szmek2015-02-03
|
* partial revert of fed6df8Thomas Hindoe Paaboel Andersen2015-02-03
| | | | This one was acutally used to free xattr
* remove unused variablesThomas Hindoe Paaboel Andersen2015-02-02
|
* tmpfiles: let's always use DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING() ↵Lennart Poettering2015-02-02
| | | | instead of defining our own string tables
* tmpfiles: accurately report creation resultsZbigniew Jędrzejewski-Szmek2015-02-01
|
* tmpfiles: remove dead branchZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | In the test, p is a path to a directory, always absolute. dent->d_name is a single path component, so they cannot be equal. The comparison was wrong also for other reasons: D type supports globs, so direct comparisons using streq are not enough.
* tmpfiles: fix help textZbigniew Jędrzejewski-Szmek2015-01-27
| | | | | The help text, apart from being too long, did not describe what the options really do.
* tmpfiles: use casts instead of warning suppressionZbigniew Jędrzejewski-Szmek2015-01-26
| | | | | | This warning got its own name only in gcc5, so the suppression does not work in gcc4, and generates a warning of its own. Use a cast, which is ugly too, but less so.
* tmpfiles: do not bump access times of directories we are cleaning upZbigniew Jędrzejewski-Szmek2015-01-24
| | | | | | | | | | | | | Both plain opendir() and glob() will bump access time. Privileged option O_NOATIME can be used to prevent the access time from being updated. We already used it for subdirectories of the directories which we were cleaning up. But for the directories specified directly in the config files, we wouldn't do that. This means that, paradoxically, our own temporary directories for PrivateTmp would stay around forever, as long as one let systemd-tmpfiles-clean.service run regularly, because they had their own glob patterns specified. https://bugzilla.redhat.com/show_bug.cgi?id=1183684
* tmpfiles: add debug statements for all actionsZbigniew Jędrzejewski-Szmek2015-01-24
| | | | | | | systemd-tmpfiles can be used by users, but it can be quite hard to figure out the logic it follows, especially since the logic is in some places rather torturous. Hopefuly this will make it easier for users to understand what is happening.
* tmpfiles: minor simplificationZbigniew Jędrzejewski-Szmek2015-01-23
|
* shared/acl-util: add mask only when needed, always add base ACLsZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | | | For ACLs to be valid, a set of entries for user, group, and other must be always present. Always add those entries. While at it, only add the mask ACL if it is actually required, i.e. when at least on ACL for non-owner group or user exists.
* tmpfiles: implement augmenting of existing ACLsZbigniew Jędrzejewski-Szmek2015-01-22
| | | | This is much more useful in practice (equivalent to setfacl -m).
* tmpfiles: make t and a globby, add their recursive versions T and AZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | | | | | | | | | For types which adapt existing files it is generally more useful to accept globs. In analogy to z and Z, add recursive versions using uppercase letters. Technically, making a accept globs is backwards incompatible, but in practice it probably isn't yet widely used and we can assume that most people don't create files with wildcards in names. Functions which are used as callbacks, but not directly on items, are renamed not to have "item_" prefix.
* tmpfiles: make recursive operation genericZbigniew Jędrzejewski-Szmek2015-01-22
|
* tmpfiles: add 'a' type to set ACLsZbigniew Jędrzejewski-Szmek2015-01-22
|
* tmpfiles: attach an array of items to each pathZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | | | | | | | | | | | The data structure used by tmpfiles is changed: instead of hashmaps mapping {path → Item*} we now have hashmaps containing {path -> ItemArray}, where ItemArray contains a pointer to an array of Items. For current code it doesn't matter much, but when we add new types it is easier to simply add a new Item for a given path, then to coalesce multiple lines into one Item. In the future, this change will also make it possible to remember the file and line where each Item originates, and use that in reporting errors. Currently this is not possible, since each Item can be created from multiple lines.
* tmpfiles: make sure not to concatenate non-absolute pathZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | If the path is absolute was only checked later. Also do not check if path if absolute if we just specified it starting with a slash.
* tmpfiles: detect all combinations of + and !Zbigniew Jędrzejewski-Szmek2015-01-22
| | | | The same algorithm as with - and @ in ExecStart= is used.
* tmpfiles: simplificationZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Certain conditions were checked more than once. Warning message is improved.
* Add initialization helper for file_handle_unionZbigniew Jędrzejewski-Szmek2015-01-18
|
* tmpfiles: make gcc shut upLennart Poettering2015-01-06
|
* tmpfiles: finish with EXIT_FAILURE if anything failedZbigniew Jędrzejewski-Szmek2015-01-06
| | | | Return value is successful only if everything succeeded.
* tmpfiles: fix 'D' linesLennart Poettering2015-01-05
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=87953
* tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering2014-12-28
|
* tmpfiles: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | | It does not use any functions from libcap directly. The CAP_MKNOD constant in use by this file comes from <linux/capability.h> imported through "missing.h". Tested that "systemd-tmpfiles" builds cleanly and works after this change.
* tmpfiles, man: Add xattr support to tmpfilesMaciej Wereski2014-12-04
| | | | | | | | | | | | | | | | | | | | This patch makes it possible to set extended attributes on files created by tmpfiles. This can be especially used to set SMACK security labels on volatile files and directories. It is done by adding new line of type "t". Such line should contain attributes in Argument field, using following format: name=value All other fields are ignored. If value contains spaces, then it must be surrounded by quotation marks. User can also put quotation mark in value by escaping it with backslash. Example: D /var/run/cups - - - - t /var/run/cups - - - - security.SMACK64=printing
* treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1Lennart Poettering2014-11-28
|
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: a few more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | The one in tmpfiles.c:create_item() even looks like it fixes a bug.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* Introduce CONF_DIRS_NULSTR helper to define standard conf dirsJosh Triplett2014-11-26
| | | | | | | Several different systemd tools define a nulstr containing a standard series of configuration file directories, in /etc, /run, /usr/local/lib, /usr/lib, and (#ifdef HAVE_SPLIT_USR) /lib. Factor that logic out into a new helper macro, CONF_DIRS_NULSTR.
* selinux: clean up selinux label function namingLennart Poettering2014-10-23
|
* mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho2014-10-23
|
* tmpfiles: compare return against correct errnoDave Reisner2014-10-12
| | | | name_to_handle_at returns -EOPNOTSUPP, not -ENOTSUP.