Commit Graph

2149 Commits

Author SHA1 Message Date
Yu Watanabe
4e412d2684 string-util: fix prototype of explicit_bzero_safe() (#10513)
Follow-up for 87f5446311.
2018-10-25 11:41:55 +09:00
Lennart Poettering
def34f63fe time-util: change parse_sec_fix_0() to accept "0s" for infinity too (#10501)
This function is about compatibility, nothing else, hence we should make
it properly compatible.

Fixes: #9556
2018-10-25 05:21:28 +09:00
Lennart Poettering
87f5446311 string-util: introduce explicit_zero_safe()
The only real difference is that this wrapper can deal with NULL
pointer arguments, but only if the length is also zero.

CID 1396277
2018-10-24 21:00:15 +02:00
Yu Watanabe
f6a178e91d util: check overflow in parse_nsec() 2018-10-23 22:24:16 +09:00
Yu Watanabe
8079c90333 util: check overflow in parse_time() 2018-10-23 22:23:34 +09:00
Chris Down
3f1c1287a9 analyze: Add "timespan" command to dump time span in usec
This is useful for a couple of cases, I'm mostly interested in case #1:

1. Verifying "reasonable" values in a trivially scriptable way
2. Debugging unexpected time span parsing directly

Test Plan:

```
% build/systemd-analyze timespan 20
Original: 20
      μs: 20
   Human: 20us
% build/systemd-analyze timespan 20ms
Original: 20ms
      μs: 20000
   Human: 20ms
% build/systemd-analyze timespan 20z
Failed to parse time span '20z': Invalid argument
```
2018-10-23 14:26:51 +02:00
Yu Watanabe
80df8f2518 missing: support old linux/fou.h
linux/fou.h was introduced in 3.18.
FOU_ATTR_REMCSUM_NOPARTIAL was added in 4.0.
FOU_CMD_GET was added in 4.1.

Follow-up for 53cb501a13.
Fixes #10474.
2018-10-21 22:34:28 +09:00
Lennart Poettering
a2689fa5fc Merge pull request #9437 from poettering/sd-boot-count
many sd-boot/bootctl fixes, and a new "boot counting" concept, for automatic fallback to older kernels on persistent failures
2018-10-19 23:04:22 +02:00
Lennart Poettering
41159592f8 Merge pull request #10470 from yuwata/log-message-updates
Log message updates
2018-10-19 22:58:53 +02:00
Lennart Poettering
36695e880a add new systemd-bless-boot.service that marks boots as successful
This is the counterpiece to the boot counting implemented in
systemd-boot: if a boot is detected as successful we mark drop the
counter again from the booted snippet or kernel image.
2018-10-19 22:34:50 +02:00
Yu Watanabe
14cb109d45 tree-wide: replace 'unsigned int' with 'unsigned' 2018-10-19 22:19:12 +02:00
Yu Watanabe
011723a451 fs-util: include error cause in log message 2018-10-20 00:48:21 +09:00
Lennart Poettering
490c5a37cb tree-wide: some automatic coccinelle fixes (#10463)
Nothing fancy, just coccinelle doing its work.
2018-10-20 00:07:46 +09:00
Lennart Poettering
6ab1853953 Merge pull request #10460 from yuwata/setsockopt_int-more
tree-wide: use setsockopt_int() more
2018-10-19 10:12:00 +02:00
Yu Watanabe
84711d20b0 Merge pull request #10437 from poettering/env-util-love
some env-util.c love
2018-10-19 08:57:51 +09:00
Yu Watanabe
b0b8c9a5a4 Merge pull request #10389 from poettering/nspawn-path-fix
nspawn $PATH execvpe() fix
2018-10-19 08:48:37 +09:00
Yu Watanabe
17acb7ef9a Merge pull request #10450 from poettering/foreach-line-excorcism
FOREACH_LINE excorcism
2018-10-19 08:44:51 +09:00
Yu Watanabe
218b4609d0 Merge pull request #10447 from poettering/fgets-excorcism
let's get rid of fgets()
2018-10-19 08:36:01 +09:00
Yu Watanabe
9e5b649655 tree-wide: use setsockopt_int() more 2018-10-19 05:52:42 +09:00
Lennart Poettering
b33fa02b2d util: drop const_int_one/const_int_zero again
There's only a single user remaining now that we have setsockopt_int(),
let's define those variables locally.

This more or less reverts 6d5e65f645.
2018-10-18 19:50:29 +02:00
Lennart Poettering
2ff48e981e tree-wide: introduce setsockopt_int() helper and make use of it everywhere
As suggested by @heftig:

6d5e65f645 (commitcomment-30938667)
2018-10-18 19:50:29 +02:00
Lennart Poettering
8f7329ac27 exec-util: errors are reported by non-zero, not negative by putenv() 2018-10-18 16:40:12 +02:00
Lennart Poettering
8d2b9d14c4 time-util: FOREACH_LINE excorcism 2018-10-18 16:23:45 +02:00
Lennart Poettering
7e7a16a00e process-util: FOREACH_LINE excorcism 2018-10-18 16:23:45 +02:00
Lennart Poettering
f5af75eaec mount-util: FOREACH_LINE() excorcism 2018-10-18 16:23:45 +02:00
Lennart Poettering
d2b39cb606 cgroup-util: FOREACH_LINE() excorcism 2018-10-18 16:23:45 +02:00
Lennart Poettering
d3f9790c81 terminal-util: use fgetc() carefully instead of fread() 2018-10-18 13:32:34 +02:00
Lennart Poettering
715bcf361d terminal-util: excorcise fgets() 2018-10-18 13:32:05 +02:00
Lennart Poettering
6d3db278fe clock-util: excorcise fgets() 2018-10-18 13:30:20 +02:00
Yu Watanabe
103341f9f8 Merge pull request #10438 from poettering/path-is-valid
be a bit more carful when processing transient socket paths via the bus
2018-10-18 06:20:41 +09:00
Lennart Poettering
67f5d31b45 Merge pull request #10440 from poettering/fflush-and-check-some-more
use fflush_and_check() and free_and_replace() where we can
2018-10-17 22:54:34 +02:00
Lennart Poettering
a42984dbc7 Merge pull request #10428 from keszybz/failure-actions
Implement manager status changes using SuccessAction=
2018-10-17 21:29:10 +02:00
Lennart Poettering
c93d527f46 exec-util: use fflush_and_check() where appropriate 2018-10-17 21:23:34 +02:00
Lennart Poettering
656552ebb3 path-util: add new path_is_valid() helper 2018-10-17 21:13:02 +02:00
Lennart Poettering
3088305166 list: fix double avaluation in LIST_APPEND() 2018-10-17 21:13:02 +02:00
Lennart Poettering
d3e66e684f env-util: drop ARG_MAX define
It's not a constant, hence don't pretend it was.
2018-10-17 20:51:14 +02:00
Lennart Poettering
fcbb657460 env-util: modernize strv_env_set() a bit 2018-10-17 20:51:14 +02:00
Lennart Poettering
04effffd84 env-util: modernize strv_env_replace() 2018-10-17 20:51:14 +02:00
Lennart Poettering
2d3ff1decb env-util: rework strv_env_merge()
Let's clean up the failure codepaths, by using _cleanup_.

This relies on the new behaviour of env_append() introduced in the
previous commit that guarantess the list always remains properly NULL
terminated
2018-10-17 20:51:14 +02:00
Lennart Poettering
2a13184a43 env-util: rework env_append()
Let's make sure the strv we are putting together always remains valid
(i.e. is NULL terminated). Also document the parameters to pass in
correctly.
2018-10-17 20:51:14 +02:00
Lennart Poettering
68ac147e8d env-util: use strv_contains() where appropriate 2018-10-17 20:51:14 +02:00
Lennart Poettering
8aeb1d3176 Merge pull request #10244 from poettering/nofile-bump
bump RLIMIT_NOFILE
2018-10-17 17:59:36 +02:00
Zbigniew Jędrzejewski-Szmek
1bcf3fc6c5 core: return true from cg_is_empty* on ENOENT 2018-10-17 17:49:57 +02:00
Zbigniew Jędrzejewski-Szmek
c02b6ee496 meson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere 2018-10-17 14:54:48 +02:00
Lennart Poettering
c8884aceef main: introduce a define HIGH_RLIMIT_MEMLOCK similar to HIGH_RLIMIT_NOFILE 2018-10-17 14:40:44 +02:00
Lennart Poettering
5450a37e3c Merge pull request #10419 from yuwata/fix-prioq
Fix segfault in prioq_remove() with empty Prioq object
2018-10-16 19:56:04 +02:00
Yu Watanabe
90c88092e6 tree-wide: use CMP() macro where applicable
Follow-up for 6dd91b3682.
2018-10-16 19:55:38 +02:00
Yu Watanabe
8da2f9e807 Merge pull request #10412 from poettering/sockaddr-sun-path
various fixes related to struct sockaddr_un handling
2018-10-17 01:25:58 +09:00
Yu Watanabe
0cb3b295ec prioq: use structrued initializer 2018-10-17 01:09:41 +09:00
Yu Watanabe
e6e637a11a prioq: fix index range check 2018-10-17 01:09:41 +09:00