Commit graph

23544 commits

Author SHA1 Message Date
Franck Bui 7f0704da94 tmpfiles: use CHASE_WARN in addition to CHASE_SAFE
and let's emit a more comprehensive warning when an unsafe transition is
encountered.

Before this patch:

 Unsafe symlinks encountered in /run/nrpe, refusing.

After:

 Detected unsafe path transition / → /run during canonicalization of /run/nrpe.
2018-12-10 09:19:14 +01:00
Franck Bui 36c97decbe fs-util: make chase_symlink() returns -ENOLINK when unsafe transitions are met
We previously returned -EPERM but it can be returned for various other reasons
too.

Let's use -ENOLINK instead as this value shouldn't be used currently. This
allows users of CHASE_SAFE to detect without any ambiguities when unsafe
transitions are encountered by chase_symlinks().

All current users of CHASE_SAFE that explicitly reacted on -EPERM have been
converted to react on -ENOLINK.
2018-12-10 09:18:27 +01:00
Franck Bui fd74c6f3f8 fs-util: add new CHASE_WARN flag to chase_symlinks()
This flag can be used to make chase_symlinks() emit a warning when it
encounters an error.

Such flag can be useful for generating a comprehensive and detailed warning
since chase_symlinks() can generate a warning with a full context.

For now only warnings for unsafe transitions are produced.
2018-11-30 13:30:26 +01:00
Evgeny Vereshchagin c90c39ff7b catalog: reject entries where the language is too short early
Closes https://oss-fuzz.com/testcase-detail/5674475278827520
2018-11-29 13:41:40 +09:00
Lennart Poettering bf61b05a06 networkd: slightly rework route establishment logic
Use a for() loop to merge the two very similar loops into one, and add
more comments explaining the logic behing this.

Follow-up for 0d34228fc0
2018-11-29 13:38:54 +09:00
Zbigniew Jędrzejewski-Szmek 8b4e51a60e
Merge pull request #10797 from poettering/run-generator
add new "systemd-run-generator" for running arbitrary commands from the kernel command line as system services using the "systemd.run=" kernel command line switch
2018-11-28 22:40:55 +01:00
Yu Watanabe 50ae773f85
Merge pull request #10970 from yuwata/from-name-return-negative-errno
util: make *_from_name() returns negative errno on error
2018-11-29 03:18:03 +09:00
Yu Watanabe fab57f7f13
Merge pull request #10948 from ssahani/iprule-port-proto
networkd: add support to configure ip rule port range and protocol.
2018-11-29 03:17:36 +09:00
Susant Sahani 926062f083 networkd: add support to configure ip rule port range and protocol.
Please see:

iprule: support for ip_proto, sport and dport match options
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858

Closes 10622
2018-11-28 20:06:28 +05:30
Susant Sahani 0d34228fc0 fix: systemd-networkd reverse route ordering
We missing a default route. Add gateway first.

This fixes https://github.com/systemd/systemd/issues/5430
2018-11-28 23:19:00 +09:00
Victor Tapia e6eed94459 resolved: Increase size of TCP stub replies
DNS_PACKET_PAYLOAD_SIZE_MAX is limiting the size of the stub replies to
512 with EDNS off or 4096 with EDNS on, without checking the protocol
used. This makes TCP replies for clients without EDNS support to be
limited to 512, making the truncate flag useless if the query result is
bigger than 512 bytes.

This commit increases the size of TCP replies to DNS_PACKET_SIZE_MAX

Fixes: #10816
2018-11-28 14:06:36 +01:00
Yu Watanabe acf4d15893 util: make *_from_name() returns negative errno on error 2018-11-28 20:20:50 +09:00
Yu Watanabe 7b5e750d2a util: also move scripts related to socket-protocol-list.[ch] to shared/
The source files were moved to shared/. Let's also move the relevant scripts.
2018-11-28 20:20:29 +09:00
Yu Watanabe 6ec439fd4b tools: move generate-gperfs.py to tools/ 2018-11-28 20:19:41 +09:00
Lennart Poettering 59a2a18e27 missing.h: remove duplicate definition of 'struct ethtool_link_settings'
Fixes: #10966
2018-11-28 10:37:03 +01:00
Lennart Poettering 1f70196644
Merge pull request #10961 from poettering/busctl-monitor-json
busctl: support json mode also for 'busctl monitor'
2018-11-28 10:30:53 +01:00
Lennart Poettering b4525804a1 core: USB function properties do not change dynamically, don't claim so
This reduces our PropertiesChanged signals a bit in size as we don't
keep out blasting properties that cannot change anyway all the time.
2018-11-28 10:29:51 +01:00
Lennart Poettering e4086ae0b3 install: when enabling a template unit without DefaultInstance= nor specified instance don't do anything
Previously, we'd link the unit file into /etc in this case, but that
should only be done if the unit file is not in the search path anyway,
and this is already done implicitly anyway for all enabled unit files,
hence no reason to duplicate this here.

Fixes: #10253
2018-11-28 08:43:47 +01:00
Lennart Poettering d23aeead14 install: use structured initializers 2018-11-28 08:43:47 +01:00
Lennart Poettering ac9bbabbc5 systemctl: separate out paragraphs in long message with empty line 2018-11-28 08:43:47 +01:00
Lennart Poettering 18c93ee3ed systemctl: bullet lists FTW!
There's no reason to number these items, let's make this a bit nicer by
using proper bullets.
2018-11-28 08:43:47 +01:00
Lennart Poettering 46efc9780d systemctl: downgrade log message to LOG_NOTICE
This log message is not problematic at all, it is merely explanatory,
hence LOG_WARN is too high for this.
2018-11-28 08:43:47 +01:00
Lennart Poettering 1b9706b1cb systemctl: suffix unit file settings with = in our output
We do this in our man pages and log messages, and hence also in this
explanatory text.
2018-11-28 08:43:47 +01:00
Lennart Poettering 4101c1accb locale-util: add unicode bullet to special glyphs 2018-11-28 08:43:47 +01:00
Lennart Poettering 3919bc24aa busctl: use new JSON_BUILD_PAIR_CONDITIONAL() for minimizing bus message JSON transformations
Let's not generate object fields that aren't defined for a message.
2018-11-28 08:38:55 +01:00
Lennart Poettering 319a4f27c4 json: teach json builder "conditional" object fields
Quite often when we generate objects some fields should only be
generated in some conditions. Let's add high-level support for that.
Matching the existing JSON_BUILD_PAIR() this adds
JSON_BUILD_PAIR_CONDITIONAL() which is very similar, but takes an
additional parameter: a boolean condition. If "true" this acts like
JSON_BUILD_PAIR(), but if false then the whole pair is suppressed.

This sounds simply, but requires a tiny bit of complexity: when complex
sub-variants are used in fields, then we also need to suppress them.
2018-11-28 08:38:55 +01:00
Lennart Poettering 2de6225314 busctl: support json mode also for 'busctl monitor' 2018-11-28 08:38:55 +01:00
Lennart Poettering cb3108669d tree-wide: more IOVEC_MAKE() conversions 2018-11-28 13:08:19 +09:00
Yu Watanabe 466a2bee94
Merge pull request #10952 from evverx/keep-fuzz-udev-rules-going
tests: make fuzz-udev-rules work also in the environment created by run_minijail
2018-11-28 11:33:27 +09:00
Evgeny Vereshchagin 95ccf1aa5f tests: suppress "unwanted log lines" in several fuzzers
According to https://oss-fuzz.com/fuzzer-stats/by-fuzzer/fuzzer/libFuzzer/job/libfuzzer_asan_systemd,
fuzz-network-parser, fuzz-netdev-parser and fuzz-journal-remote produce
a lot of unwanted log lines. Let's set the maximum log level to LOG_CRIT
as we do in the other fuzzers.
2018-11-28 10:10:09 +09:00
Evgeny Vereshchagin fa6e5861f7 tests: make fuzz-udev-rules work also in the environment created by run_minijail
This should close https://oss-fuzz.com/testcase?key=5642013043589120.

See also https://github.com/google/oss-fuzz/issues/1983.
2018-11-28 01:34:38 +01:00
Lennart Poettering e849ae9524
Merge pull request #10951 from thom311/network-dhcp-route-option
add accessor for sd_dhcp_route's "option"
2018-11-27 22:37:22 +01:00
Zbigniew Jędrzejewski-Szmek 19069ed853 rc-local-generator: provide more debugging information
C.f. https://bugzilla.redhat.com/show_bug.cgi?id=1516188.
2018-11-27 15:24:07 +01:00
Zbigniew Jędrzejewski-Szmek 1332ecb8ad rc-local-generator: use macro to define main() 2018-11-27 15:23:35 +01:00
Lennart Poettering 4917894417
Merge pull request #10944 from poettering/redirect-file-fix
StandardOutput=file: fixes
2018-11-27 13:18:26 +01:00
Zbigniew Jędrzejewski-Szmek 6fa158f55c
Merge pull request #10902 from poettering/highlight-status
Highlight status
2018-11-27 12:53:43 +01:00
Evgeny Vereshchagin 8e96f161af tests: keep going even if setup_mount_namespace has failed
This should address https://github.com/google/oss-fuzz/issues/1983.
2018-11-27 12:47:06 +01:00
Thomas Haller 3476951cbb network: use sd_dhcp_route_get_option() accessor in link_set_dhcp_routes() 2018-11-27 12:20:51 +01:00
Thomas Haller cf6f5bb558 network: add sd_dhcp_route_get_option() accessor
Since sd_dhcp_lease_get_routes() returns the list of all routes,
the caller may need to differenciate whether the route was option
33 (static-routes) or 121 (classless-static-route).

Add an accessor for the internal field.
2018-11-27 12:20:19 +01:00
Lennart Poettering de38f06f52
Merge pull request #10813 from poettering/cgroup-exec-start-pre
make sure ExecStartPre= and Delegate=yes mix well
2018-11-27 10:29:17 +01:00
Lennart Poettering 5cfa2c3dc0 tree-wide: use IOVEC_MAKE() at many places 2018-11-27 10:12:27 +01:00
Lennart Poettering 41fc585a7a core: be more careful when inheriting stdout fds to stderr
We need to compare the fd name/file name if we inherit an fd from stdout
to stderr. Let's do that.

Fixes: #10875
2018-11-27 10:06:51 +01:00
Lennart Poettering 8d33232ef1 bus-unit-util: properly accept StandardOutput=append:… settings 2018-11-27 10:06:51 +01:00
Lennart Poettering 1704fba92f dbus-execute: generate the correct transient unit setting 2018-11-27 10:06:50 +01:00
Lennart Poettering dbe6c4b657 dbus-execute: fix indentation 2018-11-27 10:06:50 +01:00
Lennart Poettering 922ce049d1 core: drop references to 'StandardOutputFileToCreate'
This property never existed, let's drop any reference to it.
2018-11-27 10:06:50 +01:00
Lennart Poettering 35a1ff4cfe add new run-generator
This is really useful for running commands like this:

        # systemd-run -i someimage.raw -b systemd.run='"some command line"'

This will now run the command line inside a small Type=oneshot service
and even propagate the exit code of the command back to the parent. And
all that with the full system booted up.

By default this causes the system to shutdown right after the command
completed, but this can be tweaked with systemd.run_success_action= and
systemd.run_failure_action=.

Note that when used in VMs the exit status can of course not be
propagate, as VMs don't really know a concept for that.
2018-11-27 09:44:40 +01:00
Lennart Poettering 7af67e9a8b core: allow to set exit status when using SuccessAction=/FailureAction=exit in units
This adds SuccessActionExitStatus= and FailureActionExitStatus= that may
be used to configure the exit status to propagate in when
SuccessAction=exit or FailureAction=exit is used.

When not specified let's also propagate the exit status of the main
process we fork off for the unit.
2018-11-27 09:44:40 +01:00
Yu Watanabe 2fb14a12cf
Merge pull request #10947 from poettering/sd-radv-fixes
sd-radv fixes
2018-11-27 14:24:43 +09:00
Lennart Poettering 30acbadc6a journald: don't try to rotate user journals in /var/log/journal/ if we are still in log-to-runtime-journal mode
Fixes: #10879
2018-11-27 11:09:15 +09:00