1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

26202 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
a1feacf77f load-fragment: ignore ENOTDIR/EACCES errors (#3510)
If for whatever reason the file system is "corrupted", we want
to be resilient and ignore the error, as long as we can load the units
from a different place.

Arch bug https://bugs.archlinux.org/task/49547.

A user had an ntfs symlink (essentially a file) instead of a directory after
restoring from backup. We should just ignore that like we would treat a missing
directory, for general resiliency.

We should treat permission errors similarly. For example an unreadable
/usr/local/lib directory would prevent (user) instances of systemd from
loading any units. It seems better to continue.
2016-06-15 23:02:27 +02:00
Kai Ruhnau
77d4acf332 socket-util: Run the fallback when the kernel complains about the null buffer (#3541)
Calling recv with a NULL buffer returns EFAULT instead of EOPNOTSUPP on
older kernels (3.14).

Fixes #3407

Signed-off-by: Kai Ruhnau <kai.ruhnau@target-sg.com>
2016-06-15 12:33:24 +02:00
Zbigniew Jędrzejewski-Szmek
7d38158b5d Merge pull request #3540 from poettering/resolved-various
three resolved fixes
2016-06-14 21:08:36 -04:00
Lennart Poettering
8e38570ebe tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
Super-important change, yeah!
2016-06-15 01:26:01 +02:00
Lennart Poettering
69281c49eb util-lib: rework get_process_cmdline() (#3529)
This reworks get_process_cmdline() quite substantially, fixing the following:

- Fixes:
  a4e3bf4d7a (r66837630)

- The passed max_length is also applied to the "comm" name, if comm_fallback is
  set.

- The right thing happens if max_length == 1 is specified

- when the cmdline "foobar" is abbreviated to 6 characters the result is not
  "foobar" instead of "foo...".

- trailing whitespace are removed before the ... suffix is appended. The 7
  character abbreviation of "foo barz" is hence "foo..." instead of "foo ...".

- leading whitespace are suppressed from the cmdline

- a comprehensive test case is added
2016-06-14 17:52:29 -04:00
Lennart Poettering
8dd57192bc Merge pull request #3539 from keszybz/udevadm-man-fix
Udevadm man fix
2016-06-14 23:41:00 +02:00
Lennart Poettering
94831eaeec resolved: in the ResolveHostname() bus call, accept IP addresses with scope
When we get a literal IP address as string that includes a zone suffix, process
this properly and return the parsed ifindex back to the client, and include it
in the canonical name in case of a link-local IP address.
2016-06-14 23:37:16 +02:00
Lennart Poettering
97ebebbc9c resolved: make sure we initialize the ifindex of direct zone answers properly
Previously, after checking the local zone for a reply and finding one we'd not
initialize the answer ifindex from that. Let's fix that.
2016-06-14 23:28:54 +02:00
Lennart Poettering
145fab1eae resolve: port resolve tool to in_addr_ifindex_{from_string_auto|to_string}()
We can reuse some code here, so let's do it.
2016-06-14 23:27:30 +02:00
Zbigniew Jędrzejewski-Szmek
bd8420c518 man: fix option letter in udevadm control -e
-x never worked, so let's just correct the man page.

Fixes #3524.
2016-06-14 17:12:23 -04:00
Zbigniew Jędrzejewski-Szmek
19a29798bc udevadm: trivial simplification 2016-06-14 17:12:23 -04:00
Susant Sahani
1d7100298c networkd: Tunnel add support to configure key for VTI/VTI6 (#3532)
fixes #3298
2016-06-14 19:11:57 +02:00
Daniel Mack
91bb59b4b1 Merge pull request #3527 from poettering/systemctl-fixes
Systemctl fixes
2016-06-14 14:25:43 +02:00
Lukáš Nykrýn
4892084f09 manager: reduce complexity of unit_gc_sweep (#3507)
When unit is marked as UNSURE, we are trying to find if it state was
changed over and over again. So lets not go through the UNSURE states
again. Also when we find a GOOD unit lets propagate the GOOD state to
all units that this unit reference.

This is a problem on machines with a lot of initscripts with different
starting priority, since those units will reference each other and the
original algorithm might get to n! complexity.

Thanks HATAYAMA Daisuke for the expand_good_state code.
2016-06-14 14:20:56 +02:00
Evgeny Vereshchagin
bbc85a16e1 core: on unified we don't need to check u->pids: we can use proper notifications (#3531)
Fixes: #3483
2016-06-14 14:08:01 +02:00
Andrew Jeddeloh
f4f5e50a0a build: fix missing symbol for old kernel headers (#3530)
Fix issue where IN6_ADDR_GEN_MODE_STABLE_PRIVACY is undefined but
IFLA_INET6_ADDR_GEN_MODE is defined and thus the former does not get
fixed in missing.h. This occurs with kernel headers new enough to have
the IFLA_INET6_ADDR_GEN_MODE but old enough to not yet have
IN6_ADDR_GEN_MODE_STABLE_PRIVACY (e.g. 3.18).
2016-06-14 11:09:06 +02:00
Lennart Poettering
3dced37b7c systemctl: rework "systemctl status" a bit
This reworks "systemctl status" and "systemctl show" a bit. It removes the
definition of the `property_info` structure, because we can simply reuse the
existing UnitStatusInfo type for that.

The "could not be found" message is now printed by show_one() itself (and not
its caller), so that it is shown regardless by who the function is called.
(This makes it necessary to pass the unit name to the function.)

This also adds all properties found to a set, and then checks if any of the
properties passed via "--property=" is mising in it, if so, a proper error is
generated.

Support for checking the PID file of a unit is removed, as this cannot be done
reasonably client side (since the systemd instance we are talking to might sit
on another host)

Replaces: #3411
Fixes: #3425
Also see: #3504
2016-06-13 19:17:14 +02:00
Lennart Poettering
51e22f8851 systemctl: fix assertion hit when showing state of a unit without control group 2016-06-13 18:54:36 +02:00
Lennart Poettering
f256aa8853 unit-name: remove spurious newline 2016-06-13 18:47:42 +02:00
Tom Gundersen
1be3f471e7 Merge pull request #3491 from poettering/hwdb-acpi
hwdb: update UEFI/ACPI/PNP/EISA/EDID database from UEFI web site
2016-06-13 18:41:15 +02:00
Lennart Poettering
9ea8e2ce85 Merge pull request #3498 from poettering/syscall-filter-fixes
Syscall filter fixes, tighter nspawn seccomp sandbox by default
2016-06-13 16:54:21 +02:00
Ivan Shapovalov
dcd6145002 core: parse rd.rescue and rd.emergency as initrd-specific shorthands (#3488)
Typing `rd.rescue` is easier than `rd.systemd.unit=rescue.target`.
2016-06-13 16:28:42 +02:00
Lennart Poettering
68884a0b8a Merge pull request #3384 from keszybz/localed-keymap
More verbose logging in localed, unit tests, and a few tweaks to keymap conversions
2016-06-13 16:27:52 +02:00
Lennart Poettering
54a17e01de nspawn: lock down system call filter a bit
Let's block access to the kernel keyring and a number of obsolete system calls.
Also, update list of syscalls that may alter the system clock, and do raw IO
access. Filter ptrace() if CAP_SYS_PTRACE is not passed to the container and
acct() if CAP_SYS_PACCT is not passed.

This also changes things so that kexec(), some profiling calls, the swap calls
and quotactl() is never available to containers, not even if CAP_SYS_ADMIN is
passed. After all we currently permit CAP_SYS_ADMIN to containers by default,
but these calls should not be available, even then.
2016-06-13 16:25:54 +02:00
Lennart Poettering
4e069746fe units: tighten system call filters a bit
Take away kernel keyring access, CPU emulation system calls and various debug
system calls from the various daemons we have.
2016-06-13 16:25:54 +02:00
Lennart Poettering
1f9ac68b5b core: improve seccomp syscall grouping a bit
This adds three new seccomp syscall groups: @keyring for kernel keyring access,
@cpu-emulation for CPU emulation features, for exampe vm86() for dosemu and
suchlike, and @debug for ptrace() and related calls.

Also, the @clock group is updated with more syscalls that alter the system
clock. capset() is added to @privileged, and pciconfig_iobase() is added to
@raw-io.

Finally, @obsolete is a cleaned up. A number of syscalls that never existed on
Linux and have no number assigned on any architecture are removed, as they only
exist in the man pages and other operating sytems, but not in code at all.
create_module() is moved from @module to @obsolete, as it is an obsolete system
call. mem_getpolicy() is removed from the @obsolete list, as it is not
obsolete, but simply a NUMA API.
2016-06-13 16:25:54 +02:00
Lennart Poettering
50b52222f2 nspawn: order caps to retain alphabetically 2016-06-13 16:25:54 +02:00
Lennart Poettering
0e3f29f03f update TODO 2016-06-13 16:25:54 +02:00
Zbigniew Jędrzejewski-Szmek
aac57b3539 resolved: use single message for both dbus and signal calls (#3515)
Follow-up for #3502.
2016-06-13 16:24:48 +02:00
Lennart Poettering
11dc0a137b Merge pull request #3520 from keszybz/add-release.md
Add RELEASE.md
2016-06-13 16:13:41 +02:00
Lennart Poettering
ca9cdf93af Merge pull request #3518 from keszybz/test-process-util
Enhance test-process-util to take the PID to look at
2016-06-13 16:01:44 +02:00
Susant Sahani
357bb46af6 networkd: fix NULL pointer (#3523)
Not every link has kind associated with it.

(gdb) r
Starting program: /home/sus/tt/systemd/systemd-networkd
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.23.1-7.fc24.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
vboxnet0: Gained IPv6LL
wlp3s0: Gained IPv6LL
enp0s25: Gained IPv6LL
Enumeration completed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e27ade in __strcmp_sse2_unaligned () from /lib64/libc.so.6
(gdb) bt
src/network/networkd-link.c:2008
src/network/networkd-link.c:2059
src/network/networkd-link.c:2442
m=0x555555704a30, userdata=0x55555570bfe0) at src/network/networkd-link.c:2497
at src/libsystemd/sd-netlink/sd-netlink.c:347
src/libsystemd/sd-netlink/sd-netlink.c:402
src/libsystemd/sd-netlink/sd-netlink.c:432
userdata=0x5555556f7470) at src/libsystemd/sd-netlink/sd-netlink.c:739
src/libsystemd/sd-event/sd-event.c:2275
src/libsystemd/sd-event/sd-event.c:2626
timeout=18446744073709551615) at src/libsystemd/sd-event/sd-event.c:2685
bus=0x5555556f9af0, name=0x555555692315 "org.freedesktop.network1",
timeout=30000000,
    check_idle=0x55555556ac84 <manager_check_idle>, userdata=0x5555556f6b20) at
src/shared/bus-util.c:134
src/network/networkd-manager.c:1128
src/network/networkd.c:127
(gdb) f 1
src/network/networkd-link.c:2008
2008            if (link->network->bridge || streq("bridge", link->kind)) {
(gdb) p link->kind
$1 = 0x0
2016-06-13 15:57:38 +02:00
Susant Sahani
1c4b11794b networkd: route priority replace parsing config_parse_uint32 with safe_atou32 (#3522) 2016-06-13 15:57:17 +02:00
Jouke Witteveen
2065ca699b core/execute: pass env vars to PAM session setup (#3503)
Move the merger of environment variables before setting up the PAM
session and pass the aggregate environment to PAM setup. This allows
control over the PAM session hooks through environment variables.

PAM session initiation may update the environment. On successful
initiation of a PAM session, we adopt the environment of the
PAM context.
2016-06-13 12:50:12 +02:00
Zbigniew Jędrzejewski-Szmek
988b3b1765 systemctl: disallow systemctl --user reboot (#3519)
... as well as halt/poweroff/kexec/suspend/hibernate/hybrid-sleep.
Running those commands will fail in user mode, but we try to set the wall
message first, which might even succeed for privileged users. Best to nip
the whole sequence in the bud.

https://github.com/systemd/systemd/pull/3453#issuecomment-225455156
2016-06-13 07:57:28 +03:00
Zbigniew Jędrzejewski-Szmek
d11343ac79 Add RELEASE.md file which lists the steps needed for release
I put it in .github, so it doesn't stand out too much; after all
it's not interesting to most people.
2016-06-12 22:23:57 -04:00
Zbigniew Jędrzejewski-Szmek
476ef627af CONTRIBUTING: ask people to comment after after force-push 2016-06-12 22:21:49 -04:00
Zbigniew Jędrzejewski-Szmek
945c6e7cc0 CONTRIBUTING: remove line wrapping
GitHub displays this file poorly, because it preserves the newlines.
Let's try how things look without any wrapping.
2016-06-12 22:21:49 -04:00
Zbigniew Jędrzejewski-Szmek
4201ce672a process-util: remove broken support for pid==0
Our functions that query /proc/pid/ support using pid==0 to mean
self. get_process_id also seemed to support that, but it was not implemented
correctly: the result should be in *uid, not returned, and also it gave
completely bogus result when called from get_process_gid(). But afaict,
get_process_{uid,gid} were never called with pid==0, so it's not an actual
bug. Remove the broken code to avoid confusion.
2016-06-12 21:15:53 -04:00
Zbigniew Jędrzejewski-Szmek
18dade5aae test-process-util: allow pid to be specified on the command line
This makes it easy to test the query code on "ssh localhost"
and similar.
2016-06-12 21:15:53 -04:00
Zbigniew Jędrzejewski-Szmek
9a140c3564 test-process-util: rework the test function to take pid as argument
This fixes a bunch of copy&paste errors in the output.
2016-06-12 21:15:52 -04:00
Max Prokhorov
ba4cd7e257 util-lib: drop trailing non-printable characters from cmdline (#3512)
If max_length is equal or greater than cmdline length all trailing non-printable
characters are dropped. If max_length is 0 it should do the same.

This should also fix cmdline truncation if the last character is not '\0'.

Fixes #3469.
2016-06-12 21:13:42 -04:00
Peter Hutterer
e7b90ddc34 hwdb: change the Logitech MX500 to 1100 dpi (#3517)
https://bugs.freedesktop.org/show_bug.cgi?id=96225
and specifically the tech specs here:
http://support.logitech.com/en_us/product/corded-mouse-m500
2016-06-12 20:52:48 -04:00
Zbigniew Jędrzejewski-Szmek
af4ddf529e Merge pull request #3502 from poettering/resolved-flush-cache
resolved: allow clients request cache flushes
2016-06-12 18:28:30 -04:00
Zbigniew Jędrzejewski-Szmek
7f401340b0 Merge pull request #3453 from poettering/fix-3353
Fixes #3353.
2016-06-12 15:21:22 -04:00
Tobias Jungel
0e83e7a5a2 networkd: more vlan cleanup (#3506)
use config_parse_vlanid to parse vlan for BridgeFDB entries
2016-06-12 20:01:14 +02:00
Tobias Jungel
ceac40781b networkd: cleanup of bridge vlan code (#3505)
cleanup minor nitpicks mentioned in #3428
2016-06-12 19:59:21 +02:00
Alex Gaynor
f045931a73 Fixed a small typo in a comment (#3514) 2016-06-12 16:42:13 +02:00
Zbigniew Jędrzejewski-Szmek
cabffaf86c test-keymap-util: use kbd-model-map/language-fallback-map from $(srcdir)
This adds (undocumented) environment variables SYSTEMD_KBD_MODEL_MAP
and SYSTEMD_LANGUAGE_FALLBACK_MAP, which, if set, override compiled-in
locations of those two files.

Instead of skipping tests when the maps are not installed, just use
the one from the source dir. We still cannot do the mappings the other
way if /usr/lib/kbd/keymaps is not present, so truncate the tests in
that case.

Also tweak the debug messages a bit to make it easier to see
which function is failing.
2016-06-11 11:24:06 -04:00
Federico Mena Quintero
3411164af3 hwdb: update UEFI/ACPI/PNP/EISA/EDID database from UEFI web site
Let's hook up the ACPI database we maintain from the upstream UEFI sources.
This adds a tool to convert the database provided upstream to our native
format, similar to how this is handled for the PCI and USB databases.

Note that the upstream web site claims to offer an XLS download, but the actual
data made available is an HTML file in reality, just one with the ".xls"
suffix...

The data provided from the UEFI folks is not very high quality nor complete,
hence apply a patch after the conversion step that fixes up a few things and
adds in more entries from various sources. For example, the EDID ids maintained
by GNOME and other sources have been added too, as they all appear to use the
same ID namespace.

This also adds explicit support for 4 character ACPI ids, in addition to the
normal 3 character PNP ids.

Also fixes:

https://bugs.freedesktop.org/show_bug.cgi?id=90524
2016-06-10 23:27:58 +02:00