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. |
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. |
e1427b138fbf7b7f13bb61187635b882be3ca2b2 |
|
09-Nov-2015 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: apply errno.cocci
with small manual cleanups for style. |
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 |
4e731273edfe852a3eee2949cd20f49fd5b4f6d7 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch] |
0d39fa9c69b97a2ceb156053deef69c0866c2b97 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more file I/O related calls into fileio.[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. |
e287086b8aa2558356af225a12d9bfea8e7d61ca |
|
07-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
ask-password: add support for caching passwords in the kernel keyring
This adds support for caching harddisk passwords in the kernel keyring
if it is available, thus supporting caching without Plymouth being
around.
This is also useful for hooking up "gdm-auto-login" with the collected
boot-time harddisk password, in order to support gnome keyring
passphrase unlocking via the HDD password, if it is the same.
Any passwords added to the kernel keyring this way have a timeout of
2.5min at which time they are purged from the kernel. |
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. |
4df3277881cffcd3bc9a5238203d6af7e1fd960f |
|
13-May-2015 |
Cristian Rodríguez <crrodriguez@opensuse.org> |
modules-load: fix memory leak
=================================================================
==64281==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f623c961c4a in malloc (/usr/lib64/libasan.so.2+0x96c4a)
#1 0x5651f79ad34e in malloc_multiply (/home/crrodriguez/scm/systemd/systemd-modules-load+0x2134e)
#2 0x5651f79b02d6 in strjoin (/home/crrodriguez/scm/systemd/systemd-modules-load+0x242d6)
#3 0x5651f79be1f5 in files_add (/home/crrodriguez/scm/systemd/systemd-modules-load+0x321f5)
#4 0x5651f79be6a3 in conf_files_list_strv_internal (/home/crrodriguez/scm/systemd/systemd-modules-load+0x326a3)
#5 0x5651f79bea24 in conf_files_list_nulstr (/home/crrodriguez/scm/systemd/systemd-modules-load+0x32a24)
#6 0x5651f79ad01a in main (/home/crrodriguez/scm/systemd/systemd-modules-load+0x2101a)
#7 0x7f623c11586f in __libc_start_main (/lib64/libc.so.6+0x2086f)
SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).
This happens due to the wrong cleanup attribute is used (free vs strv_free) |
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. |
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. |
c33b329709ebe2755181980a050d02ec7c81ed87 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation 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(). |
79008bddf679a5e0900369950eb346c9fa687107 |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style. |
086891e5c119abb9854237fc32e736fe2d67234c |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers
This change has two benefits:
- The format string %m will now resolve to the specified error (or to
errno if the specified error is 0. This allows getting rid of a ton of
strerror() invocations, a function that is not thread-safe.
- The specified error can be passed to the journal in the ERRNO= field.
Now of course, we just need somebody to convert all cases of this:
log_error("Something happened: %s", strerror(-r));
into thus:
log_error_errno(-r, "Something happened: %m"); |
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. |
b5884878a2874447b2a9f07f324a7cd909d96d48 |
|
07-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
util: simplify proc_cmdline() to reuse get_process_cmdline()
Also, make all parsing of the kernel cmdline non-fatal. |
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. |
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. |
059cb3858acd038ff2cef10a3a99119bf71a8fc6 |
|
06-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: move more intellegince into parse_proc_cmdline()
Already split variable assignments before invoking the callback. And
drop "rd." settings if we are not in an initrd. |
bcfce235a3d757f0ec3b0c01e8583382db1adfe2 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
macro: introduce a nice macro for disabling -Wformat-nonliteral temporarily |
4b462d1a28461b302586b117736ef288fba1012f |
|
18-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
load-modules: properly return a failing error code if some module fails to load
This is the missing part of b857193b1def5172e3641ca1d5bc9e08ae81aac4. |
141a79f491fd4bf5ea0d66039065c9f9649bfc0e |
|
17-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Extract looping over /proc/cmdline into a shared function
In cryptsetup-generator automatic cleanup had to be replaced
with manual cleanup, and the code gets a bit longer. But existing
code had the issue that it returned negative values from main(),
which was wrong, so should be reworked anyway. |
cc3d61683d877791e6b2ce0b17940d4d77cd6550 |
|
05-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unused variables |
e3e45d4f82daa5cd85ba40dde9127df900096c0c |
|
05-Jan-2014 |
Simon Peeters <peeters.simon@gmail.com> |
strv: multiple cleanups
- turn strv_merge into strv_extend_strv.
appending strv b to the end of strv a instead of creating a new strv
- strv_append: remove in favor of strv_extend and strv_push.
- strv_remove: write slightly more elegant
- strv_remove_prefix: remove unused function
- strv_overlap: use strv_contains
- strv_printf: STRV_FOREACH handles NULL correctly |
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 |
f168c27313e4d7b0aabee037dc9c78a5799f0597 |
|
03-Dec-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
trivial coding style clean ups
- Add space between if/for and the opening parentheses
- Place the opening brace on same line as the function (not for udev)
From the CODING_STYLE
Try to use this:
void foo() {
}
instead of this:
void foo()
{
} |
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. |
74df0fca09b3c31ed19e14ba80f996fdff772417 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
util: unify reading of /proc/cmdline
Instead of individually checking for containers in each user do this
once in a new call proc_cmdline() that read the file only if we are not
in a container. |
b857193b1def5172e3641ca1d5bc9e08ae81aac4 |
|
02-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
modules-load: fix error handling |
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 |
d3b6d0c21ea5a0d15ec6dbd8b8d179138b7463bc |
|
14-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
fileio: in envfiles, do not skip lines following empty lines
https://bugs.freedesktop.org/show_bug.cgi?id=63477 |
b56c267ffbd3a5598dfa1dba5e6a51b38fcaed57 |
|
26-Mar-2013 |
Lennart Poettering <lennart@poettering.net> |
modules-load: there's really no point in mentioning that a certain modules is already loaded
After all, this runs in parallel to udev, so there's quite a chance it
already is.... |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
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 |
c007bb1b4d1366130f69dfbde53124211307a31a |
|
04-Dec-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
modules-load: fix memory leak when bailing out
Suggested-by: Mauro Dreissig <mukadr@gmail.com> |
d42c44fb6dd926271bfd56157114ba9d29935ea7 |
|
21-Sep-2012 |
Václav Pavlín < <vpavlin@redhat.com> |
modules-load: initalize files to null |
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 |
b2fc39a6838f08e6050b681e0c93f95bc6176786 |
|
25-Jul-2012 |
Michal Schmidt <mschmidt@redhat.com> |
modules-load: fix kernel cmdline parsing |
91ac74250149a29122b2291c5393dec4592430d4 |
|
02-Jul-2012 |
Kay Sievers <kay@vrfy.org> |
modules load: rename kernel command line option to (rd.)modules-load= |
e62abb626806140a4cd9abc928d23c661a7b9a33 |
|
28-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
modules-load: use correct va_list logging function |
8f9c0b4cc17dc0eb24e420f9bd6f8c9534b5dd84 |
|
28-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
modules-load: fix return value |
27fda47f40453e552ebccf7acb85f915cf34f23a |
|
27-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
modules-load: don't fail on builtin modules, better prints
Distinguish between non-existing modules, builtin modules, already
loaded modules, and modules we load.
Only the non-existing ones are treated as errors.
https://bugzilla.redhat.com/show_bug.cgi?id=817760 |
03658d4fd66d5d0ccce643cef92185ec38b0e575 |
|
22-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
modules-load: parse driver=/rd.driver= kernel command line option
This generalizes logic that already has been available in dracut before. |
2c21044f05e32ec483b6ab13e175278779e9ebe3 |
|
07-May-2012 |
Kay Sievers <kay@vrfy.org> |
util: split-out conf-file.[ch] |
dce818b390a857a11f7dd634684500675cf79833 |
|
12-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
move all tools to subdirs |