Commit graph

31792 commits

Author SHA1 Message Date
Lennart Poettering b1bfb84804 fs-util: extra safety checks on chase_symlinks() root parameter
Let's handle root="" and root="/" safely.
2018-01-17 12:04:15 +01:00
Yu Watanabe 5caf49360b efivars: include errno.h when EFI support is disabled (#7900)
Fixes #7898.
2018-01-17 20:25:42 +11:00
Alan Jenkins e41090db89
Merge pull request #7886 from gdamjan/fix-ptmx
namespace: make /dev/ptmx a copy of the host not a symlink
2018-01-17 09:24:00 +00:00
Zbigniew Jędrzejewski-Szmek 4e4e3d9766
Merge pull request #7893 from poettering/parse-tweaks
parsing tweaks
2018-01-17 20:22:17 +11:00
Zbigniew Jędrzejewski-Szmek 9b1f89bcb1
Merge pull request #7902 from yuwata/fix-warning-by-clang
network: small fixes
2018-01-17 20:17:23 +11:00
Hans de Goede 66500345ec hwdb: 60-sensors: Add DMI strings for Trekstor Surftab 7.0 newer BIOS versions (#7904)
Some newer BIOS versions of the TrekStor SurfTab wintron 7.0 tablet use
different (better) DMI strings, update the existing 60-sensors.hwdb
entry for this tablet to also work with the newer BIOS.
2018-01-17 20:15:41 +11:00
Jerónimo Borque 252d847a2b hwdb: HP vendor name for ZBooks in 60-keyboard.hwdb (#7905)
Added new HP vendor name to support Zbook's mic mute key mapping
2018-01-17 20:15:00 +11:00
Zbigniew Jędrzejewski-Szmek 58eab88176
Merge pull request #7897 from yuwata/small-man-fixes
Several man fixes
2018-01-17 20:13:54 +11:00
Дамјан Георгиевски 414b304ba2 namespace: only make the symlink /dev/ptmx if it was already a symlink
…otherwise try to clone it as a device node

On most contemporary distros /dev/ptmx is a device node, and
/dev/pts/ptmx has 000 inaccessible permissions. In those cases
the symlink /dev/ptmx -> /dev/pts/ptmx breaks the pseudo tty support.

In that case we better clone the device node.

OTOH, in nspawn containers (and possibly others), /dev/pts/ptmx has
normal permissions, and /dev/ptmx is a symlink. In that case make the
same symlink.

fixes #7878
2018-01-17 01:19:46 +01:00
Дамјан Георгиевски b5e99f23ed namespace: extract clone_device_node function from mount_private_dev 2018-01-16 21:41:10 +01:00
Yu Watanabe 976fade6c1 dhcp6: fix warnings by clang with -Waddress-of-packed-member
This fixes the following warnings:
```
[194/1521] Compiling C object 'src/libsystemd-network/systemd-network@sta/dhcp6-option.c.o'.
../../git/systemd/src/libsystemd-network/dhcp6-option.c:110:25: warning: taking address of packed member 'id' of class or structure 'ia_na' may result in an unaligned pointer value [-Waddress-of-packed-member]
                iaid = &ia->ia_na.id;
                        ^~~~~~~~~~~~
../../git/systemd/src/libsystemd-network/dhcp6-option.c:115:25: warning: taking address of packed member 'id' of class or structure 'ia_ta' may result in an unaligned pointer value [-Waddress-of-packed-member]
                iaid = &ia->ia_ta.id;
                        ^~~~~~~~~~~~
2 warnings generated.
```
2018-01-17 01:53:03 +09:00
Yu Watanabe b7d16a91d6 networkd: fix wrong argument check 2018-01-17 01:29:13 +09:00
Yu Watanabe 1291a04298 ipvlan: fix wrong assignment in ipvlan_init() 2018-01-17 01:28:09 +09:00
Yu Watanabe c7612b2005 man: mention that systemctl is-active or is-failed do not load units
See the discussion in the issue #7875.
2018-01-16 23:25:56 +09:00
Yu Watanabe 47dbb99ad7 virt: add comment that we need to use sscanf()
Follow-up for 13e0f9fe83.
See PR #7890 and comment in PR #7581.
2018-01-16 23:00:39 +09:00
Yu Watanabe fb76275a7a man: remove duplicated line
Follow-up for c46bc7e216.
2018-01-16 22:22:18 +09:00
Lennart Poettering bac794f607 parse-util: detect overflows in parse_percent_unbounded()
We shouldn't accept percentages beyon INT32_MAX and consider them
valid.
2018-01-16 11:53:43 +01:00
Lennart Poettering b5ffbc5579 parse-util: coding style fix
Let's not rely on C's downgrade-to-bool feature to check for NUL bytes
2018-01-16 11:53:43 +01:00
Lennart Poettering e520e0fc2c locale-util: add freelocale() cleanup helper 2018-01-16 11:53:43 +01:00
Lennart Poettering fc432c2314
Merge pull request #7885 from pfl/dhcp6_fixes
Minor fixes
2018-01-16 10:44:35 +01:00
John Lin 3c887f9733 man: fix broken kernel document links (#7892) 2018-01-16 18:29:35 +09:00
Olaf Hering 13e0f9fe83 Fix parsing of features in detect_vm_xen_dom0 (#7890)
Use sscanf instead of the built-in safe_atolu because the scanned string
lacks the leading "0x", it is generated with snprintf(b, "%08x", val).
As a result strtoull handles it as octal, and parsing fails.

The initial submission already used sscanf, then parsing was replaced by
safe_atolu without retesting the updated PR.

Fixes 575e6588d ("virt: use XENFEAT_dom0 to detect the hardware domain
(#6442, #6662) (#7581)")
2018-01-16 20:24:37 +11:00
Zbigniew Jędrzejewski-Szmek 4579e8ef31
Merge pull request #7540 from fbuihuu/systemd-delta-tweaks
Systemd delta tweaks
2018-01-16 20:22:25 +11:00
Shawn Landden c46bc7e216 machined: use getent to get default shell for machinectl shell (#7684)
Closes: https://github.com/systemd/systemd/issues/1395
2018-01-16 05:17:51 +11:00
Patrik Flykt ecf07fb748 sd-dhcp6-client: Use offsetof() instead of sizeof()
The slightly modified review comments say that "...in theory
offsetof(DHCP6Option, data) is nicer than sizeof(DHCP6Option)
because the former removes alignment artifacts. In this
specific case there are no alignment whitespaces hence it's
fine, but out of a matter of principle offsetof() is preferred
over sizeof() in cases like this..."
2018-01-15 18:00:33 +02:00
Patrik Flykt 3c03564911 dhcp6: Fix valgrind nitpick about returned test case value
Calling dhcp6_option_parse_address() will always return a value
< 0 on error even though lt_valid remains unset. This is more
than valgrind can safely detect, but let's fix the valgrind
nitpick anyway.

While fixing, use UINT32_MAX instead of ~0 on the same line.
2018-01-15 18:00:33 +02:00
Lennart Poettering 01816fee33
Merge pull request #7884 from yuwata/small-fixes
Small fixes
2018-01-15 16:40:41 +01:00
Дилян Палаузов 5f79d69cba man: fix typo
Closes #7866.
2018-01-16 00:10:12 +09:00
Yu Watanabe 3249bf3125 man: logind: update reference
Fixes #7858.
2018-01-16 00:03:33 +09:00
Yu Watanabe bb6b922f9f journal: coding style fix
This is originally pointed out by @cpsw.
2018-01-15 23:53:10 +09:00
Yu Watanabe 9c3b99feb8 network: fix indentation
Follow-up for 56a23cb40a.
2018-01-15 23:49:55 +09:00
Yu Watanabe 55a7c78b9d networkd: remove unnecessary parentheses
Follow-up for 56a23cb40a.
2018-01-15 23:48:00 +09:00
Yu Watanabe 3e7e587d32 systemctl: comment that the verb 'check' is deprecated 2018-01-15 23:44:31 +09:00
Yu Watanabe 444c1915f9 timesync: use current uid when started as non-root user
Fixes #7883.
2018-01-15 23:40:29 +09:00
Yu Watanabe 5a45fde547 test: free memory
Fixes #7882.
2018-01-15 23:37:02 +09:00
Adam Duskett 08318a2c5a add false option for tests (#7778)
Currently there is no way to prevent tests from building using meson.
This introduces two problems:

1) It adds a extra 381 files to compile.
2) One of these tests explicitly requires libgcrypt to be built even if systemd
   is not using it.
3) It adds C++ to the requirements to build systemd.

When cross-compiling, this is uneccessary.
2018-01-15 15:25:46 +04:00
Lennart Poettering 38edb7674b
Merge pull request #7582 from pfl/dhcp6_prefix_delegation
DHCPv6 prefix delegation
2018-01-15 12:02:37 +01:00
Zbigniew Jędrzejewski-Szmek f94abc667a man: --this-boot is deprecated (#7880)
This removes the last public reference. Follow-up for #7844.
2018-01-15 19:45:40 +09:00
Zbigniew Jędrzejewski-Szmek e0b6d3cabe
Merge pull request #7816 from poettering/chase-pid
Make MAINPID= and PIDFile= handling more restrictive (and other stuff)
2018-01-15 14:14:34 +04:00
Zbigniew Jędrzejewski-Szmek c557fc3e2f
Merge pull request #7844 from yuwata/bash-completion
update bash completions
2018-01-15 13:51:29 +04:00
Zbigniew Jędrzejewski-Szmek 67ddb52432
Merge pull request #7855 from poettering/log-h-includes
log.h #include cleanups
2018-01-15 13:43:09 +04:00
Zbigniew Jędrzejewski-Szmek d04e012ad9
Merge pull request #7871 from sourcejedi/log_mounts
core: fix output (logging) for mount units (#7603)
2018-01-15 13:34:06 +04:00
Zbigniew Jędrzejewski-Szmek e4976acec4
Merge pull request #7872 from mineo/coredumpctl-zsh-completion
Fix the ZSH completion on `coredumpctl gdb <tab>`
2018-01-15 13:28:14 +04:00
Alan Jenkins 3cc9685649 core: prevent spurious retries of umount
Testing the previous commit with `systemctl stop tmp.mount` logged the
reason for failure as expected, but unexpectedly the message was repeated
32 times.

The retry is a special case for umount; it is only supposed to cover the
case where the umount command was _successful_, but there was still some
remaining mount(s) underneath.  Fix it by making sure to test the first
condition :).

Re-tested with and without a preceding `mount --bind /mnt /tmp`,
and using `findmnt` to check the end result.
2018-01-13 17:22:46 +00:00
Wieland Hoffmann a6e4952d56 zsh/coredumpctl: Never sort the completion candidates
That way, they're always sorted by date. I do not know how to make ZSH sort
them by PID through some option, but that doesn't seem very useful in the first
place.
2018-01-13 15:23:28 +01:00
Wieland Hoffmann 83701d75fb zsh/coredumpctl: Fix the completion
An output from coredumpctl list is like

> TIME                            PID   UID   GID SIG COREFILE  EXE
> Sun 2016-05-29 18:44:03 CEST  14578  1000  1000   6 none      /tmp/pacaurtmp-wieland/python33/src/Python-3.3.6/python

  ^1  ^2         ^3       ^4    ^5

, but the previous sub() command turns that into

> TIMEPID   UID   GID SIG COREFILE  EXE
> Sun2016-05-29 18:44:03 CEST  14578  1000  1000   6 none      /tmp/pacaurtmp-wieland/python33/src/Python-3.3.6/python
  ^1            ^2       ^3    ^4     ^5

so the whole pipeline generated entries like

$UID:$DESCRIPTION

but that's not useful and probably not what was supposed to happen.

This now generates entries like

$PID:$DESCRIPTION

which make everything work.

Note that with this commmit, the completions will be sorted by PID by
ZSH.
2018-01-13 15:08:36 +01:00
Alan Jenkins 5804e1b6ff core: fix output (logging) for mount units (#7603)
Documentation - systemd.exec - strongly implies mount units get logging.

It is safe for mounts to depend on systemd-journald.socket.  There is no
cyclic dependency generated.  This is because the root, -.mount, was
already deliberately set to EXEC_OUTPUT_NULL.  See comment in
mount_load_root_mount().  And /run is excluded from being a mount unit.

Nor does systemd-journald depend on /var.  It starts earlier, initially
logging to /run.

Tested before/after using `systemctl stop tmp.mount`.
2018-01-13 13:03:13 +00:00
0xAX aad67b80c5 dbus-execute: define bus_set_transient_errno() only if HAVE_SECCOMP (#7869)
in other way we will get a warning during build:

../src/core/dbus-util.h:55:13: warning: ‘bus_set_transient_errno’
defined but not used [-Wunused-function]

    int bus_set_transient_##function(
2018-01-13 08:48:53 +09:00
Max Harmathy 5bcdbb2249 login: avoid external process call
Use a shell builtin of posix shells insteaf of calling 'which'.
See also http://stackoverflow.com/a/677212
2018-01-12 18:02:57 +01:00
Michal Sekletar 8647283e45 process-util: make our freeze() routine do something useful
When we crash we freeze() our-self (or possibly we reboot the machine if
that is configured). However, calling pause() is very unhelpful thing to
do. We should at least continue to do what init systems being doing
since 70's and that is reaping zombies. Otherwise zombies start to
accumulate on the system which is a very bad thing. As that can prevent
admin from taking manual steps to reboot the machine in somewhat
graceful manner (e.g. manually stopping services, unmounting data
volumes  and calling reboot -f).

Fixes #7783
2018-01-12 17:50:02 +01:00