b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
114a17d2ad7dcf33367cc63e88f426dfc832b189 |
|
01-Feb-2016 |
Evgeny Vereshchagin <evvers@ya.ru> |
tmpfiles: don't skip path_set_perms on error
fixes #2196 |
b3267152783d5784c45010615045d4e8ee459da2 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive. |
2904e949f23aeb17b7e21a2a0f8c43f959a07f98 |
|
16-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subvolume
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. |
be6d467c1f9219b2016d556a0a369828d463ca27 |
|
10-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: don't consider it a problem if quota is not enabled on btrfs
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 |
75eb615480afd787fa412f0a529523f568f79b26 |
|
10-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
defs: rework CONF_DIRS_NULSTR() macro
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. |
a0f29c767a3bb3d621c658fa5b87063e1f44e24a |
|
03-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move CONF_DIRS_NULSTR definition to def.h
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 |
4e036b7a96b7a72461bdb68ded304041e892b8eb |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
mount-util: move fstype_is_network() and name_to_handle_at() definitions over |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
7d50b32a129e781401cf897475f388f682de1368 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out globbing related calls into glob-util.[ch] |
15a5e95075a7f6007dd97b2a165c8ed16fe683df |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out printf() helpers to stdio-util.h |
430f0182b72373145c839dbfe99d2382855cb8f8 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → 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. |
affb60b1ef0cb48388d23360c6f3b043c50f6b8c |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out umask-related code to umask-util.h |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
8fcde01280adcbd07e8205b91ac52b06305b6208 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
c8b3094de58e3b1e37d06f3d56c9346cffbe320a |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out file attribute calls to chattr-util.[ch] |
0d39fa9c69b97a2ceb156053deef69c0866c2b97 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more file I/O related calls into fileio.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out user/group/uid/gid calls into user-util.[ch] |
c004493cdefc1f43a3956ca529e8070f8d70be56 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out IO related calls to io-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file 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. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
0f03c2a4c093e3d44f4072144827e943c05c8904 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
path-util: unify how we process paths specified on the command line
Let's introduce a common function that makes relative paths absolute and
warns about any errors while doing so. |
0f4743651081b5367ab06f238827ddfd4da74e74 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: get_current_dir_name() can return errors other than ENOMEM
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. |
2bb158c1ce914632aa3d19baef33877d58ba1e40 |
|
23-Oct-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tmpfiles: simplify mountpoint detection
No functional change. Just a simplification. A || (!A && B) is
the same as A || B
Introduced in 78a92a5a2306709e4587e332728a76901323ade9 |
5fb13eb51bf641a3434828947e137e1a5f2d7eb2 |
|
22-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: introduce "q" and "Q" for creating quota-enabled btrfs subvolumes
This allows us to set up the quota group hierarchy in a reasonable way
on btrfs file systems. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
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. |
12ba2c44dde4d7cfc0e531dbc3cbd0581c323637 |
|
07-Aug-2015 |
Richard Maw <richard.maw@codethink.co.uk> |
util: Don't interpret quotes by default in extract_first_word
This adds an EXTRACT_QUOTES option to allow the previous behaviour, of
not interpreting any character inside ' or " quotes as separators. |
6868560773ada8ea31d1f86422be6bf026a1f660 |
|
07-Aug-2015 |
Richard Maw <richard.maw@codethink.co.uk> |
util: change unquote_*_word to extract_*_word
It now takes a separators argument, which defaults to WHITESPACE if NULL
is passed. |
7d6884b65e6ea7317346d29bc2f6c9ba051a0cac |
|
06-Aug-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: fix indentation |
ad75a97f7d86ddbc1b8521ae084862013c1713b0 |
|
22-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: downgrade errors when a file system does not support file attributes
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. |
1542c01b1dd5e34bfc2355aba603131e458ee0da |
|
17-Jun-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles:Â only root-owned aquota.* files are special
Fixes #188. |
1b26f09eb0ab6925ca15835107e75c47931cdef2 |
|
15-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: make sure "R" lines also remove subvolumes |
a542c4dc43db906b30ea6b2b1192cf87b01f572e |
|
15-May-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: use lstat() instead of stat() when checking whether a file system object already exists |
7b135a73999b6911ebb85c053b6f7701fdac1883 |
|
15-May-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: don't fail if we cannot create a subvolume because a file system is read-only but a dir already exists anyway
https://bugs.freedesktop.org/show_bug.cgi?id=90281 |
1d13f648d0fade38194db74b4f82ca68c8a26856 |
|
13-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: add generic calls for prefixing a root directory to a path
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. |
f44b28fda0a9ac88b0b20c475fc1d2f2036e7f71 |
|
06-May-2015 |
Michael Olbrich <m.olbrich@pengutronix.de> |
tmpfiles: try to handle read-only file systems gracefully
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.] |
ef43a39176616e545ceb9f4c3ac03fd78fd5e4a6 |
|
22-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: use an ordered hashmap for the tmpfiles items
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 |
aa5f6817bcb4cfea8708edf765358f4f507d5923 |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: consider an argument of "-" as non-specified |
48b8aaa82724bc2d8440470f414fb0d2416f29c7 |
|
13-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: don't follow symlinks when adjusting ACLs, fille attributes, access modes or ownership |
dd449aca6182ff49aa11701e47928c9df36be16a |
|
12-Apr-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: use qsort_safe |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
75c2a9fd13bf2553e303443b5f25adf093892099 |
|
10-Apr-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tmpfiles: fix build with clang
Clang is not happy about using the cleanup attribute in switches |
5c5ccf12b623a1e77684c58bb0d06e1d4fd73e21 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add specifier expansion for L and C lines, too |
17493fa5d17cadce3b773692d3eeab137de7d323 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: enforce ordering when executing lines
Always create files first, and then adjust their ACLs, xattrs, file
attributes, never the opposite. Previously the order was not
deterministic, thus possibly first adjusting ACLs/xattrs/file
attributes before actually creating the items. |
90937fe3d31b433a1794d181a4e028d3817c258d |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: eat up empty columns |
bd550f78eb261c757cbff85acdb55563c56521f2 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: substitute % specifiers in arguments for writing files and xattrs |
c82500c6fb37a25bc3c4b1e0be11a90a395619d9 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: warn if we get an argument on lines that don't take any |
3ea40b781060f4fa429f77356f8baef4bdf3d4b5 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: mostly revert 71044f609b829d802e0eb81270e13b4f55d76476
Add a comment why returning a positive error is OK and intended in this
case.
(It's still a nasty hack to do this though!) |
2ff7b0a54271c8480024d6d68edff4a92e781052 |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: unify how we parse mode_t strings |
71044f609b829d802e0eb81270e13b4f55d76476 |
|
09-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: properly return error code from path_set_acl() |
34f645360325c4a986f85eaea7655b986d754251 |
|
09-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add file attribute calls to list of glob needing commands |
88ec4dfa289cd97496dbb9670365a3d4be13d41c |
|
08-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: rework file attribute code
- Stick to one type for the flags field: unsigned. This appears to be
what the kernel uses, and there's no point in using something else.
- compress the flags array by avoiding sparse entries
- extend some error messages to not use abbreviated words
- avoid TTOCTTOU issues by invoking fstat() after open() when applying
file flags
- add explanation why we need to check the file type with fstat().
- don't needlessly abbreviate "attribute" as "attrib", in particually as
"chattr" abbreviates it as "attr" rather than "attrib". |
1ed8f8c16da99551c6731764759878a0bc243fde |
|
08-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: merge change_attr_fd() and chattr_fd() |
527b7a421ff3927d4f3f170b1b143452e88ae1dc |
|
07-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework cunescape(), improve error handling
Change cunescape() to return a normal error code, so that we can
distuingish OOM errors from parse errors.
This also adds a flags parameter to control whether "relaxed" or normal
parsing shall be done. If set no parse failures are generated, and the
only reason why cunescape() can fail is OOM. |
c6878637502b1717a110a9a7e8bba32a8583fcdf |
|
06-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework rm_rf() logic
- Move to its own file rm-rf.c
- Change parameters into a single flags parameter
- Remove "honour sticky" logic, it's unused these days |
4034a06ddb82ec9868cd52496fef2f5faa25575f |
|
26-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework word parsing and c unescaping code
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. |
1532227a19f9ec56b4b32f0bfa6806c55d6ce14c |
|
26-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: minor simplification |
a4135d32340a5a6cca7a10cc797cafda5451f982 |
|
24-Mar-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tmpfiles: avoid out of bounds read
Otherwise this will go wrong for 'v'. |
22c3a6cadbc99ad623501db9a928f52f6f84c0c3 |
|
20-Mar-2015 |
Goffredo Baroncelli <kreijack@inwind.it> |
Allow systemd-tmpfiles to set the file/directory attributes
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. |
51bfdaf66c381793d2f39ad891f3411a55927da6 |
|
15-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: remove redundant debug message
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. |
15411c0cb1192799b37ec8f25d6f30e8d7292fc6 |
|
13-Mar-2015 |
David Herrmann <dh.herrmann@gmail.com> |
tree-wide: there is no ENOTSUP on linux
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses. |
657cf7f4f8d376e082db48022d2be193ff647d06 |
|
10-Mar-2015 |
daurnimator <quae@daurnimator.com> |
tmpfiles: port to unquote_many_words() |
6487ada88d63e4998113f4c57fa10b7c865f8026 |
|
05-Mar-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
tmpfiles: Fix handling of duplicate lines
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 |
d873e8778c92014c02a9122852758b436fa95c0e |
|
03-Mar-2015 |
Hans-Peter Deifel <hpd@hpdeifel.de> |
tmpfiles: quietly ignore ACLs on unsupported filesystems
A warning is printed if ACLs cannot be retrieved for any reason other
than -ENOSYS. For -ENOSYS, debug log is printed. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
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. |
484adfd914504cd7e95867cea20ca7af71b888f2 |
|
17-Feb-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
tmpfiles: Fix parse_acl error message
parse_acl() returns the error instead of setting errno. |
35888b67f77fa7a5cae0973403cb97aa30cad70c |
|
04-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: fix compilation without acl support |
4cd552bc502077f2626b07b8aa0706c3fb6c7f56 |
|
03-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
partial revert of fed6df8
This one was acutally used to free xattr |
fed6df828d86c053a96d5b50af75c53eb8dd4666 |
|
02-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused variables |
7a7d5db71f12ae6f3c055b88a85f6bc9305ea1c4 |
|
02-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: let's always use DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING() instead of defining our own string tables |
294929f8916ca37d89ccb1757868d22f8068c56b |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: accurately report creation results |
612532206c531ab2aafd398338d5dd44cb6d3553 |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: remove dead branch
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. |
79ca888f5ad026b5b3844c05a80401905e64e2f0 |
|
28-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: fix help text
The help text, apart from being too long, did not describe what the options
really do. |
ebf31a1f58d0b10ca63c928ff31b7745fc724003 |
|
26-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: use casts instead of warning suppression
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. |
df99a9ef5bb7a89b92ccfb103b2f3e7046c62ef5 |
|
25-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: do not bump access times of directories we are cleaning up
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 |
582deb8446b7c76f945bb3174a8059d56b5edb65 |
|
25-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: add debug statements for all actions
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. |
7fcb4b9b17fcb19c97fdfff689dc0aaaa1391b68 |
|
23-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: minor simplification |
dd4105b0a90c3c146a01e5a7734ee76c3a9aa1cd |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
shared/acl-util: add mask only when needed, always add base ACLs
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. |
50d9e46dbb8400d4570781728c63b151d9ca982b |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: implement augmenting of existing ACLs
This is much more useful in practice (equivalent to setfacl -m). |
b705ab6a838937f947216af7b2d1fffb00f8b0dc |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: make t and a globby, add their recursive versions T and A
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. |
081043cf06cc67a327f55806039639c55acdd439 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: make recursive operation generic |
f8eeeaf9b783ebbab30672629abf3920db286811 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: add 'a' type to set ACLs |
3f93da987961c139215d3a55fd25496310537d1b |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: attach an array of items to each path
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. |
222c47f47615a275b9a9862a45f9b91b01eb8be5 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: make sure not to concatenate non-absolute path
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. |
5f255144ae1ca7162b15e712a79d2eb9d83015f7 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: detect all combinations of + and !
The same algorithm as with - and @ in ExecStart= is used. |
505ef0e36c218f5c7a0987156a8d5bd5129a6773 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: simplification
Certain conditions were checked more than once. Warning message
is improved. |
2695c5c44e028d1bc07404baf3357e5a6017fc57 |
|
19-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add initialization helper for file_handle_union |
1e95893a89b87e4ed656910e30c430e583bc8133 |
|
06-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: make gcc shut up |
1db50423ba427565f92c05f3aaeab351860e30bc |
|
06-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: finish with EXIT_FAILURE if anything failed
Return value is successful only if everything succeeded. |
65d6d8e32bf06635fd7f0fc0ea2a8d5ee9da3fe5 |
|
05-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: fix 'D' lines
https://bugs.freedesktop.org/show_bug.cgi?id=87953 |
d7b8eec7dc7fe307d3a08b32cf1a9ad4276ce6d5 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add new line type 'v' for creating btrfs subvolumes |
2395eb17ebd1033e53989e4a9b8745f921a7d965 |
|
25-Dec-2014 |
Filipe Brandenburger <filbranden@google.com> |
tmpfiles: remove spurious include of <sys/capability.h>
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. |
ebf4e8013b2928fdcfa6008ee6559e8c7e1fd60b |
|
04-Dec-2014 |
Maciej Wereski <m.wereski@partner.samsung.com> |
tmpfiles, man: Add xattr support to tmpfiles
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 |
fed1e721fd0c81e60c77120539f34e16c2585634 |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
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. |
8d3d7072e609ef0e0fb37e1d19a29307d58146c3 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: a few more log_*_errno + return simplifications
The one in tmpfiles.c:create_item() even looks like it fixes a bug. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
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. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
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(). |
7f0a55d4325f7df91f91b3b818f61f97d78df14a |
|
27-Nov-2014 |
Josh Triplett <josh@joshtriplett.org> |
Introduce CONF_DIRS_NULSTR helper to define standard conf dirs
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. |
ecabcf8b6edcc856ec2fd5bd43fc675a8fe04731 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
selinux: clean up selinux label function naming |
cc56fafeebf814ef035e549115cf1850e6473fa5 |
|
23-Oct-2014 |
WaLyong Cho <walyong.cho@samsung.com> |
mac: rename apis with mac_{selinux/smack}_ prefix |
e7aab5412829ed6b50d109f670bd0b1b365838a7 |
|
13-Oct-2014 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: compare return against correct errno
name_to_handle_at returns -EOPNOTSUPP, not -ENOTSUP. |
9348f0e690c28f86a69c96e3e9b9f19a31c6d466 |
|
01-Oct-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: use allocated buffer for path
Paths can in principle be longer then PATH_MAX, so
simply allocate the buffer with malloc().
CID #1237773 |
9ed2a35e93f4a9e82585f860f54cdcbbdf3e1f86 |
|
26-Sep-2014 |
Richard Weinberger <richard@nod.at> |
systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
If one has a config like:
d /tmp 1777 root root -
X /tmp/important_mount
All files below /tmp/important_mount will be deleted as the
/tmp/important_mount item will spuriously inherit a max age of 0
from /tmp.
/tmp has a max age of 0 but age_set is (of course) false.
This affects also the PrivateTmp feature of systemd.
All tmp files of such services will be deleted unconditionally
and can cause service failures and data loss.
Fix this by checking ->age_set in the IGNORE_DIRECTORY_PATH logic. |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
1924a97db5d55b6537a6c6ef84944caab93cd19c |
|
18-Aug-2014 |
Michael Olbrich <m.olbrich@pengutronix.de> |
tmpfiles: only execute chmod()/chown() when needed
This avoids errors like this, when the paths are already there with the
correct permissions and owner:
chmod(/var/spool) failed: Read-only file system |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
2f3b873a49734f8ecc8d929612d33153acbda891 |
|
20-Jun-2014 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: copy/link /usr/share/factory/ files when the source argument is omitted |
e156347e0480d3eee4877463297149ae96e34f8c |
|
19-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: make sure "C" doesn't copy anything if the destination already exists
Previously it would recursively copy the entire tree in, and descend
into subdirectories even if the destination already exists. Let's do
what the documentation says and not do that.
If files down the tree shall be copied too, they should get their own
"C" lines. |
19f3934057d20c63f4c95791312038a41b4666d0 |
|
19-Jun-2014 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: do not fail when copying an empty directory |
6f04529399a7a59cfe549913349176409a4dc2e3 |
|
18-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: create directories already with the right label, instead of creating them first, and relabeling them afterwards |
43ad6e31aae7e5d36e8a01968dfdca1d3fedc7fa |
|
18-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: w lines should allow following symlinks |
1554afae546f6cfb8ac85e36300d7bf608886780 |
|
18-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add "+" modifier support to b, c, p lines in addition to L |
2e78fa79bbaebb358d2657c397180d2d08d69b12 |
|
16-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add new "L+" command as stronger version of "L", that removes the destination before creating a symlink
Also, make use of this for mtab as long as mount insists on creating it
even if we invoke it with "-n". |
45c196a76b2d883552c90807386d9bed40da822b |
|
16-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: set up selinux label proeprly when creating fifos |
6555ad8e9d0ae2ec65783b33f9a5fbc018da64d4 |
|
13-Jun-2014 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: skip mknod() on -EPERM (device cgroup) |
753615e85d990077c303ae4a42a53e792ffb12ca |
|
12-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: minor modernizations |
abef3f91ce5fa9eeffceead885d2d2cabd9f1c96 |
|
11-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add ability to mask access mode by pre-existing access mode on files/directories
This way it makes a lot more sense to specify an access mode for "Z"
lines. |
9855d6c7a161a80084cf94faa42333c48cbeac56 |
|
11-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: remove unnecessary function |
1910cd0e05f7661986680e0a4472f4e857f90787 |
|
11-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: when processing lines, always process prefixes before suffixes
If two lines refer to paths that are suffix and prefix of each other,
then always process the prefix first, the suffix second. In all other
cases strictly process rules in the order they appear in the files.
This makes creating /var/run as symlink to /run a lot more fun, since it
is automatically created first. |
7bc040fab802ff20eacd1745e393f1766c8c35d9 |
|
11-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: static variables populated immediately from the command line should be prefixed with arg_ |
9339db7187c61eb7ae7e6ffcddb2b2f2686954eb |
|
11-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: always recreate the most basic directory structure in /var
Let's allow booting up with /var empty. Only create the most basic
directories to get to a working directory structure and symlink set in
/var. |
e73a03e059830a3df8fac811f923704311e93731 |
|
10-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: get rid of "m" lines, make them redundant by "z"
"m" so far has been a non-globbing version of "z". Since this makes it
quite redundant, let's get rid of it. Remove "m" from the man pages,
beef up "z" docs instead, and make "m" nothing more than a compatibility
alias for "z". |
849958d1ba3533c953fad46d4d41c0ec6e48316d |
|
10-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add new "C" line for copying files or directories |
cde684a2932d3c8cbb9b3374aec27a1c20ba75fa |
|
10-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: various modernizations |
874f1947e33922f08c578696af5b628a0f67fec2 |
|
10-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
label: when clearing selinux context, don't mangle errno |
370c860f748d149097710dc7952a64f627db9de7 |
|
21-Apr-2014 |
Dave Reisner <dreisner@archlinux.org> |
implement a union to pad out file_handle
Cases where name_to_handle_at is used allocated the full struct to be
MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong
since handle_bytes should describe the length of the flexible array
member and not the whole struct.
Define a union type which includes sufficient padding to allow
assignment of MAX_HANDLE_SZ to be correct. |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
6cf487afad4ef4706b5d6d9ba5df24cac68e687a |
|
17-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
shared: export is_dir |
cf9a4abdc24c43565d0890fcb88c00169057c0c4 |
|
14-Mar-2014 |
Michael Marineau <michael.marineau@coreos.com> |
tmpfiles: add --root option to operate on an alternate fs tree
This makes it possible to initialize or cleanup an arbitrary filesystem
hierarchy in the same way that it would be during system boot. |
4cf7ea556aa1e74f9b34d4467f36d46a1bb25da3 |
|
14-Mar-2014 |
Michael Marineau <michael.marineau@coreos.com> |
shared: add root argument to search_and_fopen
This adds the same root argument to search_and_fopen that
conf_files_list already has. Tools that use those two functions as a
pair can now be easily modified to load configuration files from an
alternate root filesystem tree. |
e26da2dcea2f56461a8411e64d046cb5d903275c |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: simplification |
498f8a39e66a62d015ac78e67e2504658bbba5f2 |
|
31-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: fix memory leak of exclude_prefixes
Missed in 5c795114. |
f58ceb21e9cdc4b79586283743351750ae35c175 |
|
09-Jan-2014 |
Lukas Nykryn <lnykryn@redhat.com> |
tmpfiles: don't allow label_fix to print ENOENT when we want to ignore it |
818156512411835a4a7f070e6fec3d7b80e1f629 |
|
30-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: rename --unsafe to --boot
As suggested by Kay, it is better to describe what is done,
not what might happen. |
c4708f132381e4bbc864d5241381b5cde4f54878 |
|
24-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: introduce the concept of unsafe operations
Various operations done by systemd-tmpfiles may only be safely done at
boot (e.g. removal of X lockfiles in /tmp, creation of /run/nologin).
Other operations may be done at any point in time (e.g. setting the
ownership on /{run,var}/log/journal). This distinction is largely
orthogonal to the type of operation.
A new switch --unsafe is added, and operations which should only be
executed during bootup are marked with an exclamation mark in the
configuration files. systemd-tmpfiles.service is modified to use this
switch, and guards are added so it is hard to re-start it by mistake.
If we install a new version of systemd, we actually want to enforce
some changes to tmpfiles configuration immediately. This should now be
possible to do safely, so distribution packages can be modified to
execute the "safe" subset at package installation time.
/run/nologin creation is split out into a separate service, to make it
easy to override.
https://bugzilla.redhat.com/show_bug.cgi?id=1043212
https://bugzilla.redhat.com/show_bug.cgi?id=1045849 |
9f6445e34a57c270f013c9416c123e56261553dd |
|
24-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
log: log_error() and friends add a newline after each line anyway, so avoid including it in the log strings |
d78096b343400d7a9f513a55b76c8de28adb2e08 |
|
22-Dec-2013 |
Florian Weimer <fweimer@redhat.com> |
tmpfiles: replace readdir_r with readdir |
eb9da376d76b48585b3b63b4f91903b54f7abd36 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts. |
df28bc0836ad6a79cb537ad0b463819738088f3e |
|
21-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
build-sys: use -Og instead of -O0 to catch warnings
$ touch src/core/dbus.c; make CFLAGS=-O0
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
CCLD libsystemd-core.la
$ touch src/core/dbus.c; make CFLAGS=-Og
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
src/core/dbus.c: In function 'init_registered_system_bus':
src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
dbus_free(id);
^
CCLD libsystemd-core.la
-Og Optimize debugging experience. -Og enables optimizations that do
not interfere with debugging. It should be the optimization level of
choice for the standard edit-compile-debug cycle, offering a
reasonable level of optimization while maintaining fast compilation
and a good debugging experience. |
ca2f4176fee7dd5f5664429988e7059163fddb2d |
|
17-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: log unaccessible FUSE mount points only as debug message |
14bf2c9d375db6a4670bc0ef0e521e35a939a498 |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
util: allow trailing semicolons on define_trivial_cleanup_func lines
Emacs C indenting really gets confused by these lines if they carry no
trailing semicolon, hence let's make this nicer for good old emacs. The
other macros which define functions already do this too, so let's copy
the scheme here.
Also, let's use an uppercase name for the macro. So far our rough rule
was that macros that are totally not function-like (like this ones,
which define a function) are uppercase. (Well, admittedly it is a rough
rule only, for example function and variable decorators are all
lower-case SINCE THE CONSTANT YELLING IN THE SOURCES WOULD SUCK, and
also they at least got underscore prefixes.) Also, the macros that
define functions that we already have are all uppercase, so let's do the
same here... |
1ca208fb4f93e5869704af1812cbff7130a2fc03 |
|
13-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Introduce udev object cleanup functions |
265ffa1e05acf12769a64d0734fd2472237c03c5 |
|
17-Sep-2013 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add a new "m" line type that adjusts user/group/mode of a file if it exists |
1731e34a4ebddf6e1247ad252c7a45c2c1163f42 |
|
17-Sep-2013 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: support simple specifier expansion for specified paths |
5c7951141fa9f33e1b97de97586cc16bce2776e0 |
|
24-Jul-2013 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: introduce --exclude-prefix
The opposite of --prefix, allows specifying path prefixes which should
be skipped when processing rules. |
a2aced4add1964f82cfd250f1fee8de9d974b507 |
|
24-Jul-2013 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: support passing --prefix multiple times |
e2f2fb786059fbed410938f16e5cc8b851366b14 |
|
19-Jul-2013 |
Maciej Wereski <m.wereski@partner.samsung.com> |
tmpfiles: Fix memory leak in parse_line() |
96ca81944e40d9bc75d8599e216ee3babe0f5f81 |
|
21-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: fix error check |
ef42202ac8ed27e7ff1fc90ef8bc2590046dff25 |
|
24-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add set_consume which always takes ownership
Freeing in error path is the common pattern with set_put(). |
7fd1b19bc9e9f5574f2877936b8ac267c7706947 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html |
ab06eef8101866dd1337c4759002f7360a9db416 |
|
15-Apr-2013 |
Anatol Pomozov <anatol.pomozov@gmail.com> |
Fix spelling errors using 'codespell' tool |
c84a94883161073239c35d181e25823ff0454f68 |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add _cleanup_globfree_
Fixes a memleak in error path in exec_context_load_environment. |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert. |
5c0d398dfc4d79df2209515d28cafd9dc129838e |
|
04-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: add a bit of syntactic sugar to run short code fragments with a different umask |
7f602784de4fd378120e8ebfe6d830862b9cae03 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: rename parse_usec() to parse_sec() sinds the default unit is seconds
Internally we store all time values in usec_t, however parse_usec()
actually was used mostly to parse values in seconds (unless explicit
units were specified to define a different unit). Hence, be clear about
this and name the function about what we pass into it, not what we get
out of it. |
7f2c1f4dbfe00eeef072c65f81a43b3b7fb83365 |
|
01-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: fix obscure leak in error path
The leak was because of the single return in midst of all
'goto finish'es. Using automatic cleanup simplifies things. |
8333c77edf8fd1654cd96f3f6ee0f078dd64b58b |
|
29-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Always use errno > 0 to help gcc
gcc thinks that errno might be negative, and functions could return
something positive on error (-errno). Should not matter in practice,
but makes an -O4 build much quieter. |
d39efe744a050cf2231459262e04a87fb0da3d7f |
|
14-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: add missing missing.h include
mbiebl> src/tmpfiles/tmpfiles.c:221:13: error: ‘MAX_HANDLE_SZ’
undeclared (first use in this function)
Fixup for 427b47c4abaf4b5. |
99d680acf192a7193c3de73b525ffbc24c25cca8 |
|
13-Mar-2013 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: --clean -- check for bind mounts of the same filesystem and skip them |
19fbec19192998fa7fc0c24a58038b98cf989802 |
|
04-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tmpfiles: use cleanup func. to save a few lines |
a6187d4ce884e3c9ccf18d46b2ee494af386cb42 |
|
04-Mar-2013 |
Lukas Nykryn <lnykryn@redhat.com> |
tmpfiles: move exclamation mark into right place
Unary not has higher precedence than comparisons,
so the condition was bogus. |
fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda |
|
11-Feb-2013 |
Lennart Poettering <lennart@poettering.net> |
binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services that work on .d/ directories
This unifies much of the logic behind them:
- All four will now ofllow the rule that the earlier file and earlier
assignment in the .d/ directories wins. Before, sysctl was the only
outlier, where the later setting always won.
- All four now support getopt() and --help on the command line.
- All four can now handle specification of configuration file names on
the command line to apply. The tools will automatically find them, and
apply them. Previously only tmpfiles could do that. This is useful for
%post scripts in RPMs and suchlike.
- This fixes various error path issues in conf_files_list() |
7850b3b83791ba0e2377ba40383c5abc258b839d |
|
08-Feb-2013 |
Kay Sievers <kay@vrfy.org> |
shared: conf-files - add root parameter |
78a92a5a2306709e4587e332728a76901323ade9 |
|
25-Jan-2013 |
Michal Sekletar <msekleta@redhat.com> |
tmpfiles: introduce type X
Type X will exclude path itself from clean-up. However, if the path is a
directory systemd-tmpfiles will clean-up its content.
In contrast to type x, where path is ignored completely, type X needs some
Age parameter. In order to determine Age parameter, we will look for config
entries of type d or D and pick the best match. Best match is either
exact match or longest prefix match. |
3785ba6966c6f42ed1109bd238f001862736ff73 |
|
03-Jan-2013 |
Thomas Jarosch <thomas.jarosch@intra2net.com> |
tmpfiles: Fix file descriptor leak on error
Detected by cppcheck |
a2558205f762ce6f1374cea0eedf5e76a6134f41 |
|
23-Oct-2012 |
Tom Gundersen <teg@jklm.no> |
tmpfiles: allow Age to be set to 0
Mostly useful for testing purposes. Setting Age to 1s works just as
well, but it is surprising that using 0s (or just 0) does not work.
Also clarify this in the documentation. |
796b06c21b62d13c9021e2fbd9c58a5c6edb2764 |
|
23-Oct-2012 |
Kay Sievers <kay@vrfy.org> |
udev: add hardware database support |
1845fdd967d3a4c06f895413505de3c2429955b0 |
|
28-Sep-2012 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: restore previous behavior for F/f
d4e9eb91ea changed the behavior for the F and f actions, wrongly sending
them to glob_item(). Restore the old behavior and shortcut straight to
write_one_file(). |
7d5e9c0f60cddf01ec803012cbdc02d2f55b78c1 |
|
19-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().
https://bugzilla.redhat.com/show_bug.cgi?id=858754 |
54693d9bfa855841e8097d7a6b8c8d7acc068004 |
|
16-Sep-2012 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: use write(2) for the 'w' action
This resolves problems with filesystems which do not implement the
aio_write file operation. In this case, the kernel will fall back using
a loop writing technique for each pointer in a received iovec. The
result is strange errors in dmesg such as:
[ 31.855871] elevator: type not found
[ 31.856262] elevator: switch to
[ 31.856262] failed
It does not make sense to implement a synchronous aio_write method for
sysfs as this isn't a real filesystem where a reasonable use case for
using writev exists, nor is there an expectation that tmpfiles will be
used to write more data than can be reasonably written in a single write
syscall.
In addition, some sysfs attrs are currently buggy and will NOT reject
the second write with the newline, causing the sysfs value to be zeroed
out. This of course should be fixed in the kernel regardless of any
wrongdoing in userspace, but this simple change makes us immune to such
a bug.
This change means that we do not write a trailing newline by default, as
the expected use case of 'w' is for sysfs and procfs. In exchange, honor
C-style backslash escapes so that if the newline is really needed, the
user can add it. |
3612fbc1e4ae57af0783cc82a56917bcd29a0431 |
|
13-Sep-2012 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: plug file descriptor leak.
Introduced in d4e9eb91. |
d4e9eb91ea12e11bff7d8c6265b067a20ccf37b8 |
|
12-Sep-2012 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: support globbing for w option
Break out the write logic into a separate function and simply use it as
a callback to glob_item.
This allows users to consolidate writes to sysfs with multiple similar
pathnames, e.g.
w /sys/class/block/sd[a-z]/queue/read_ahead_kb - - - - 1024 |
cb7ed9dfca647198bce95f503552710eae22da37 |
|
06-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: don't attempt creation of device nodes when we run in a container |
0d0f0c50d3a1d90f03972a6abb82e6413daaa583 |
|
26-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera |
669241a076108e0483d7d8475beaa506106d077e |
|
25-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.
Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id |
3f2afb29140c1caa97901e5e1cd38865afb19d6e |
|
20-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: also look in /lib/tmpfiles.d on split /usr systems
https://bugs.freedesktop.org/show_bug.cgi?id=38686
I don't think the usecase case in that bug makes much sense, but all the
other tools do honour /lib in the search path so we probably should do
that here, too. |
d05c5031ad4c528fe6bbfed289519edb9f13180a |
|
16-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: introduce %s specifier for the user shell |
b7def684941808600c344f0be7a2b9fcdda97e0f |
|
13-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
util: rename join() to strjoin()
This is to match strappend() and the other string related functions. |
f56d5db919902851535ac1591d5c95ebcd3a0b17 |
|
10-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
util: rm_rf() refuse cleaning non-memory file systems, as extra paranoia |
c9bc07646100855ff8193e1e62c52b77327e264d |
|
03-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS |
d139b24a808beb0dd39d1a80023c111241c0a009 |
|
20-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
update TODO |
24f3a374b9588a6e409ba58b40bdd684050decf3 |
|
20-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: exclude the first level directories in /run/user from automatic clean up
It's logind's job to maintain those user dirs, so avoid automatic clean
up for them. However, we do cover everything within them. |
e7aee75932e8a5bee54eefcc77f4702a3ea79db2 |
|
14-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
tmpfiles: create char devices with correct SELinux context
https://bugzilla.redhat.com/show_bug.cgi?id=824059 |
94f7a71442bda7c43191979ea13cc97112745ce4 |
|
10-Jun-2012 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: fix error message |
ca2e894bdbd06b43800b57074be0e499a3539b0d |
|
10-Jun-2012 |
Kay Sievers <kay@vrfy.org> |
tmpfiles: print error if basename lookup fails; document it in manpage |
9125670f9a3dc34adf16b87635b460b2e4099b78 |
|
10-Jun-2012 |
Dave Reisner <dreisner@archlinux.org> |
tmpfiles: allow to specify basename only: systemd-tmpfiles <program.conf>
Allow passing of basename only, instead of the absolute path; letting
systemd-tmpfiles perform a path lookup for the proper fragment path in
the config directories.
This allows distributions to call: systemd-tmpfiles <program.conf> on
upgrade of a package, with respecting the possibly overriden (or even
masked) tmpfile. |
d2e54fae5ca7a0f71b5ac8b356a589ff0a09ea0a |
|
31-May-2012 |
Kay Sievers <kay@vrfy.org> |
mkdir: append _label to all mkdir() calls that explicitly set the selinux context |
03ad1136ba6ddaeca626aa24362dab764c7e2398 |
|
15-May-2012 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: if we are supposed to write a string to a file, it's OK if we can't write the trailing newline |
9eb977db5b89b44f254ab40c1876a76b7d7ea2d0 |
|
08-May-2012 |
Kay Sievers <kay@vrfy.org> |
util: split-out path-util.[ch] |
2c21044f05e32ec483b6ab13e175278779e9ebe3 |
|
07-May-2012 |
Kay Sievers <kay@vrfy.org> |
util: split-out conf-file.[ch] |
a48f3d156652cc241eb67fdf34041d1b7cdb71fb |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
tmpfiles: fix error message |
e9a5ef7cddcfcdb29b5aef3896931132b6fd5165 |
|
17-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
selinux: unify systemd and udev code |
dce818b390a857a11f7dd634684500675cf79833 |
|
12-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
move all tools to subdirs |