Commit Graph

41921 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 1bcefad919 Merge pull request #13623 from yuwata/network-wifi-iftype 2019-10-25 14:19:06 +02:00
Yu Watanabe 15e089644c network: add default configurations for wireless interfaces 2019-10-25 16:43:24 +09:00
Yu Watanabe 78404d22cc network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
Zbigniew Jędrzejewski-Szmek df7c4eb62a various tools: be more explicit when a glob is passed when not supported
See https://bugzilla.redhat.com/show_bug.cgi?id=1763488: when we say that
'foo@*.service' is not a valid unit name, this is not clear enough. Let's
include the name of the operation that does not support globbing in the
error message:

$ build/systemctl enable 'foo@*.service'
Glob pattern passed to enable, but globs are not supported for this.
Invalid unit name "foo@*.service" escaped as "foo@\x2a.service".
...
2019-10-25 13:41:49 +09:00
Dan Streetman 1c089741d3 resolved: set stream type during DnsStream creation
The DnsStreamType was added to track different types of DNS TCP streams,
instead of refcounting all of them together.  However, the stream type was
not actually set into the stream->type field, so while the reference count
was correctly incremented per-stream-type, the reference count was always
decremented in the cleanup function for stream type 0, leading to
underflow for the type 0 stream (unsigned) refcount, and preventing new
type 0 streams from being created.

Since type 0 is DNS_STREAM_LOOKUP, which is used to communicate with
upstream nameservers, once the refcount underflows the stub resolver
no longer is able to successfully fall back to TCP upstream lookups
for any truncated UDP packets.

This was found because lookups of A records with a large number of
addresses, too much to fit into a single 512 byte DNS UDP reply,
were causing getaddrinfo() to fall back to TCP and trigger this bug,
which then caused the TCP fallback for later large record lookups
to fail with 'connection timed out; no servers could be reached'.

The stream type was introduced in commit:
652ba568c6
2019-10-25 13:36:29 +09:00
Yu Watanabe f2106b1789
Merge pull request #13836 from systemd/assert-cleanups-and-constification
Assert cleanups and constification
2019-10-25 13:36:00 +09:00
Chen Qi 4a434023d2 machine-id-setup: avoid unexpected aborting
Code should not be reached 'Unhandled option' at src/machine-id-setup/machine-id-setup-main.c:97, function parse_argv(). Aborting.
Aborted

This behaviour is not good and will confuse user.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2019-10-25 13:35:37 +09:00
Zbigniew Jędrzejewski-Szmek a5648b8094 basic/fs-util: change CHASE_OPEN flag into a separate output parameter
chase_symlinks() would return negative on error, and either a non-negative status
or a non-negative fd when CHASE_OPEN was given. This made the interface quite
complicated, because dependning on the flags used, we would get two different
"types" of return object. Coverity was always confused by this, and flagged
every use of chase_symlinks() without CHASE_OPEN as a resource leak (because it
would this that an fd is returned). This patch uses a saparate output parameter,
so there is no confusion.

(I think it is OK to have functions which return either an error or an fd. It's
only returning *either* an fd or a non-fd that is confusing.)
2019-10-24 22:44:24 +09:00
Zbigniew Jędrzejewski-Szmek 58ce85f6a1 test-socket-util: avoid writing past the defined buffer
.sun_path has 108 bytes, and we'd write a string of 108 bytes + NUL.
I added this test, but I don't know what it was supposed to test. Let's
just remove.

Fixes #13713. CID#1405854.
2019-10-24 22:43:59 +09:00
Zbigniew Jędrzejewski-Szmek f7af63fd86 sd-dhcp-client: do not call assert in public functions 2019-10-24 12:04:48 +02:00
Zbigniew Jędrzejewski-Szmek 9b08c804ef sd-dhcp-client: remove unnecessary cleanup function
https://github.com/systemd/systemd/pull/13663#discussion_r335327099
2019-10-24 12:00:07 +02:00
Zbigniew Jędrzejewski-Szmek de157fe2a7 sd-netlink: constify object pointers passed to getters
sd-netlink is not public yet, so we can change the interface.

I did not touch interfaces of functions like sd_netlink_wait() and
sd_rtnl_message_new_link() which do not modify the object that is passed in,
because in the future we might want to change the code to e.g. take a
reference to the parent object or otherwise require a non-const reference.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 730b76bd2c sd-device: allow sd_device_get_devtype to be called with NULL arg and do not assert
We shouldn't call assert() on user-specified arguments in public functions.
While at it, let's return 1 if the type exists, and 0 otherwise.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 0e7f5ad9d3 Move PLYMOUTH_SOCKET define to def.h and nuke plymouth-util.h
Let's not have a file with a single define.
2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 8a2c82ac88 Remove unused plymouth_running() function 2019-10-24 11:48:08 +02:00
Zbigniew Jędrzejewski-Szmek 1048436869
Merge pull request #13452 from yuwata/network-reload
network: add networkctl reload and reconfigure
2019-10-24 11:07:24 +02:00
Yu Watanabe 235ecb6d75 test: drop duplicated 's'
This fixes the following log message
```
Container TEST-07-ISSUE-1981 terminated by signal KILL.
E: test timed out after 30s s
```
2019-10-24 08:39:31 +02:00
Yu Watanabe dcd9f07ccf network: add tests for "networkctl reconfigure" 2019-10-24 14:23:17 +09:00
Yu Watanabe 8dc85c5ef1 networkctl: introduce reconfigure method 2019-10-24 14:23:12 +09:00
Yu Watanabe e4857ee2f2 networkctl: use format_ifname_full() 2019-10-24 14:20:48 +09:00
Yu Watanabe d56d6cb8ca networkctl: fix error message 2019-10-24 14:20:48 +09:00
Yu Watanabe 882e21c72f format-util: introduce format_ifname_full() 2019-10-24 14:20:48 +09:00
Yu Watanabe 99b8517ca7 network: introduce Reconfigure() bus method 2019-10-24 14:20:48 +09:00
Yu Watanabe f39dbf28f3 network: include netinet/in.h to fix build error 2019-10-24 14:20:48 +09:00
Yu Watanabe 66de86712c test-network: add tests for "networkctl reload" 2019-10-24 14:20:48 +09:00
Yu Watanabe a227674cfb networkctl: add reload command 2019-10-24 14:20:42 +09:00
Yu Watanabe e272b62136 network: also reload .netdev files 2019-10-24 14:18:16 +09:00
Yu Watanabe 7f06b3e1b9 network: add Reload() dbus method 2019-10-24 14:18:09 +09:00
Yu Watanabe 6f3ad94590
Merge pull request #13828 from keszybz/networkctl-print-wlan
networkctl support for ssid and bssid
2019-10-24 11:12:39 +09:00
Michal Suchanek 14cd12b3d5 udev/cdrom_id: Do not open CD-rom in exclusive mode.
When you have a CD automunt solution that talks directly to the kernel
independently of udev it races with cdrom_id for exclusive access to the
device failing unpredictably.

The whole is_mounted function in cdrom_id is broken: there is no saying
what happens between calling is_mounted and opening the device.

Hence assume that the device can be mounted asynchronously at any time,
do not use exclusive access, and do away with is_mouted.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2019-10-24 00:09:18 +02:00
Zbigniew Jędrzejewski-Szmek 8d07de2534 networkctl: print ssid and bssid 2019-10-24 00:02:43 +02:00
Zbigniew Jędrzejewski-Szmek 172353b110 networkctl: create the sd_device structure just once
This is mostly in preparation for future changes: a proper freeing function
is now called on the LinkInfo items.
2019-10-24 00:02:43 +02:00
Zbigniew Jędrzejewski-Szmek b492aea093 network: split out functions to get ssid and bssid 2019-10-24 00:02:41 +02:00
Yu Watanabe 69ec2fdd9c
Merge pull request #13807 from 1848/ip6gre_key_fix
networkd: Set key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces.
2019-10-23 23:18:59 +09:00
pan93412 3dc9e2220f l10n(zh_TW): update translations 2019-10-23 16:15:46 +02:00
David Tardon 7976b9f098 run: add -u as a synonym for --unit
Other tools that do have --unit= option (journalctl and systemd-cgls)
already do this, so let's be consistent.
2019-10-23 22:06:32 +09:00
Yu Watanabe c0c8886141
Merge pull request #13825 from keszybz/nspawn-console-help
nspawn: fix handling of --console=help
2019-10-23 22:03:53 +09:00
Zbigniew Jędrzejewski-Szmek 510c4bb31f
Merge pull request #13142 from yuwata/network-wifi-ssid-support-nl80211
network: wifi ssid support with nl80211
2019-10-23 14:51:23 +02:00
Zbigniew Jędrzejewski-Szmek 516e9c802f networkctl: split out helper function 2019-10-23 12:29:04 +02:00
Zbigniew Jędrzejewski-Szmek ceb366df29 networkctl: show carrier in green for loopback iface
We don't ever expect anything different, so let's hightlight
that carrier in this case is OK.
2019-10-23 11:10:32 +02:00
Zbigniew Jędrzejewski-Szmek 7a25ba554a man: reorder description of nspawn --console
The default value was described at the end of two long paragraphs.
Make the first para self contained, and move the description of --console=pipe
into the second para.
2019-10-23 10:13:30 +02:00
Zbigniew Jędrzejewski-Szmek dce66ffedb nspawn: fix handling of --console=help
We shouldn't continue to run the container after printing help.
2019-10-23 09:35:36 +02:00
Yu Watanabe c199cc0704
Merge pull request #13820 from keszybz/dead-code-removal
Dead code removal
2019-10-23 16:11:27 +09:00
1848 21bba27d9b Added ip6gre example to man 2019-10-22 17:41:10 +02:00
Zbigniew Jędrzejewski-Szmek 12c829376a Revert "sysusers: properly mark generated accounts as locked"
This reverts the gist of commit 636e72bce6.
The comment and the tiny cleanup are left alone.

We shouldn't lock the accounts because people actually need to use them, and
if they are locked, various tools will refuse.
See https://github.com/systemd/systemd/pull/13277#issuecomment-529964578
and follow-up comments.
2019-10-22 17:59:11 +09:00
Thibault Nélis 2c54acb112 journal: Consistently capitalize printed header entries
Per comments in https://github.com/systemd/systemd/pull/13808.
2019-10-22 10:32:09 +02:00
Marko Myllynen de52000695 Remove unprintable non-ASCII char from special glyph ASCII fallback table 2019-10-22 10:31:47 +02:00
Anita Zhang 5b90e5f3f5
Merge pull request #13811 from keszybz/logind-signal-emitting-fix
Logind signal emitting fix
2019-10-21 17:13:57 -07:00
Zbigniew Jędrzejewski-Szmek ecfd9a990c update-utmp: remove dead conditional
Coverity was complaining that runlevel>0 is guaranteed at this point.
CID #1404262.

While at it, shorten the code a bit.
2019-10-21 21:12:42 +02:00
Zbigniew Jędrzejewski-Szmek 7d895205ef tty-ask-password: fix dead code path
Coverity was complaining that watch==1 always at this point.
CID #1405882.

Use structured initialization while at it.
2019-10-21 21:12:42 +02:00