Commit Graph

34918 Commits

Author SHA1 Message Date
Lennart Poettering c633b0a642 update TODO 2018-09-12 21:39:14 +02:00
afg 27b620b7db nspawn: use copy-static if systemd-resolved is up and image is writable 2018-09-12 20:48:21 +02:00
Lennart Poettering b0b3ba69c0
Merge pull request #10061 from xnox/fix-logindless-scheduled-shutdown
Fix logindless scheduled shutdown
2018-09-12 20:45:31 +02:00
Lennart Poettering b2b9edd4d1
Merge pull request #10060 from yuwata/property-take-value
bus-util: make --property= optionaly take value
2018-09-12 20:17:53 +02:00
Filipe Brandenburger 49cdae63d1 test: use ${builddir}/systemd-runtest.env for $SYSTEMD_CATALOG_DIR
This makes it so that tests no longer need to know the absolute paths to the
source and build dirs, instead using the systemd-runtest.env file to get these
paths when running from the build tree.

Confirmed that test-catalog works on `ninja test`, when called standalone and
also when the environment file is not present, in which case it will use the
installed location under /usr/lib/systemd/catalog.

The location can now also be overridden for this test by setting the
$SYSTEMD_CATALOG_DIR environment variable.
2018-09-12 09:49:03 -07:00
Filipe Brandenburger e2d413707f test: use ${builddir}/systemd-runtest.env to set $SYSTEMD_TEST_DATA
This simplifies get_testdata_dir() to simply checking for an environment
variable, with an additional function to locate a systemd-runtest.env file in
the same directory as the test binary and reading environment variable
assignments from that file if it exists.

This makes it possible to:
- Run `ninja test` from the build dir and have it use ${srcdir}/test for
  test unit definitions.
- Run a test directly, such as `build/test-execute` and have it locate
  them correctly.
- Run installed tests (from systemd-tests package) and locate the test
  units in the installed location (/usr/lib/systemd/tests/testdata), in
  which case the absence of the systemd-runtest.env file will have
  get_testdata_dir() use the installed location hardcoded into the
  binaries.

Explicit setting of $SYSTEMD_TEST_DATA still overrides the contents of
systemd-runtest.env.
2018-09-12 09:49:03 -07:00
Filipe Brandenburger 55890a40c3 test: remove support for suffix in get_testdata_dir()
Instead, use path_join() in callers wherever needed.
2018-09-12 09:49:03 -07:00
Zbigniew Jędrzejewski-Szmek 87ead8e298 Set theme jekyll-theme-slate 2018-09-12 11:51:27 +02:00
Yu Watanabe f28255e2d5 bash-completion: systemctl: re-implement __filter_units_by_properties()
This also unifies __filter_units_by_property() and
__filter_units_by_properties(), and makes completion for 'restart',
'reload' or 'stop' show more candidates.
2018-09-12 14:17:22 +09:00
Yu Watanabe eda193578e bus-util: make --property= optionally take value 2018-09-12 12:11:25 +09:00
Michael Biebl 878f2dae77
Merge pull request #10046 from yuwata/fix-10045
test: use installed catalogs when test-catalog is not located at build dir
2018-09-11 23:30:16 +02:00
Dimitri John Ledkov 940bec70bb systemctl: correctly proceed to immediate shutdown if scheduling fails
Actually check the return code from logind_schedule_shutdown() and proceed to
immediate shutdown if that fails. Negative return codes can be returned if
systemctl is compiled without logind support, or if logind otherwise failed
(either too old, disabled/masked, or it is incomplete
systemd-shim/systemd-service implementation).
2018-09-11 10:41:56 +01:00
Thomas Haller a507737e5c dhcp: fix assertion starting DHCP client without MAC address (#10054)
An assertion in dhcp_network_bind_raw_socket() is triggered when
starting an sd_dhcp_client without setting a MAC address first.

  - sd_dhcp_client_start()
    - client_start()
      - client_start_delayed()
        - dhcp_network_bind_raw_socket()

In that case, the arp-type and MAC address is still unset. Note that
dhcp_network_bind_raw_socket() already checks for a valid arp-type
and MAC address below, so we should just gracefully return -EINVAL.

Maybe sd_dhcp_client_start() should fail earlier when starting without
MAC address. But the failure here will be correctly propagated and
the start aborted.

Fixes: 76253e73f9
2018-09-11 09:45:47 +09:00
Yu Watanabe d9b6baa699 test: make test-catalog relocatable
Fixes #10045.
2018-09-11 09:19:36 +09:00
Yu Watanabe 8cb10a4f4d test: introduce test_is_running_from_builddir() 2018-09-11 09:17:22 +09:00
Dariusz Gadomski c6d7a5e9a3 hwdb: Update PNP IDs of Goldstar (now: LG Electronics). (#10051)
hwdb: Update PNP IDs of Goldstar (now: LG Electronics)
2018-09-11 00:35:30 +02:00
Franck Bui 03d0f4b58e nspawn: always use mode 555 for /sys
When a network namespace is needed, /sys is mounted as tmpfs (see commit
d8fc6a000f for details).

But in this case mode 755 was used as initial permissions for /sys whereas the
default mode for sysfs is 555.

In practice using 755 doesn't have any impact because /sys is mounted read-only
too but for consistency, let's use the correct mode.

Fixes: #10050
2018-09-11 00:34:00 +02:00
Dimitri John Ledkov cf9cda441a Revert "systemctl: if no logind, don't try to schedule shutdown"
This reverts commit c68867da32.
2018-09-10 19:54:12 +01:00
Dimitri John Ledkov 7f56c3d46e Revert "systemctl: fix compilation w/o logind"
This reverts commit 807690fb7f.
2018-09-10 19:53:59 +01:00
Jürg Billeter da0da5eccf pam_systemd: support use in PID namespaces
Pass 0 as leader PID to CreateSession to let logind use the PID from the
D-Bus credentials. This allows use of pam_systemd in PID namespaces.
2018-09-10 19:04:21 +02:00
Zbigniew Jędrzejewski-Szmek 3c83f15967
Merge pull request #10037 from filbranden/docs2
Moving docs around and starting conversion to Markdown
2018-09-09 21:01:17 +02:00
Filipe Brandenburger bf7efeb16f build-sys: Use common gcc argument detection for negative warning flags.
Starting with meson 0.46, it is able to detect these argument correctly.

See this commit in meson codebase for more details:
695b8f3a03

We already carry a requirement for meson_version : '>= 0.46', so we can be sure
our build system will include this commit.

Tested by building systemd using a cloned meson synced to the 0.46.0 tag,
confirmed the warnings were detected correctly in that case. The meson messages included this snippet:

> Compiler for C supports arguments -Wno-unused-parameter -Wunused-parameter: YES
> Compiler for C supports arguments -Wno-missing-field-initializers -Wmissing-field-initializers: YES
> Compiler for C supports arguments -Wno-unused-result -Wunused-result: YES
> Compiler for C supports arguments -Wno-format-signedness -Wformat-signedness: YES
> Compiler for C supports arguments -Wno-error=nonnull -Werror=nonnull: YES
> Compiler for C supports arguments -Wno-maybe-uninitialized -Wmaybe-uninitialized: YES
2018-09-09 20:57:08 +02:00
Zbigniew Jędrzejewski-Szmek 5e5796e3e1
Merge pull request #10042 from jwrdegoede/hwdb-sensors4
Hwdb sensors4
2018-09-09 20:39:23 +02:00
Hans de Goede f253cee808 hwdb: Add accelerometer orientation quirk for the Onda v975w tablet
Add accelerometer orientation quirk for the Onda v975w tablet.
2018-09-09 16:02:58 +02:00
Hans de Goede f0545adcd3 hwdb: Add accelerometer orientation quirk for the Connect Tablet9 tablet
Add accelerometer orientation quirk for the Connect Tablet9 tablet.
2018-09-09 16:02:58 +02:00
Hans de Goede a8b33d5cfd hwdb: Add accelerometer orientation quirk for the HP Pavilion x2 - 10-n000nd
Add accelerometer orientation quirk for the HP Pavilion x2 - 10-n000nd 2-in-1.
2018-09-09 16:02:58 +02:00
Hans de Goede a4d08d24e6 hwdb: Add accelerometer orientation quirk for the Chuwi Vi10 tablet
Add accelerometer orientation quirk for the Chuwi Vi10 (CWI505) tablet.

While at it also update the Chuwi Hi8 Pri comment to include the
CWI model-number.
2018-09-09 15:41:28 +02:00
Filipe Brandenburger b6dc0d7d01 docs: convert TRANSLATORS to Markdown
Also expand it to cover typical tasks of creating new translations, updating
existing ones and compiling them (which can be useful to check syntax.)
2018-09-08 13:40:19 -07:00
Filipe Brandenburger 1d1cb1683e docs: convert DISTRO_PORTING to Markdown 2018-09-08 13:39:03 -07:00
Filipe Brandenburger c2beadcd34 docs: move markdown docs from .github/ to docs/
The GitHub guide on contributing file says: "Decide whether to store your
contributing guidelines in your repository's root, docs, or .github directory."

https://help.github.com/articles/setting-guidelines-for-repository-contributors/#adding-a-contributing-file

But there's really no advantage to keeping it in the hidden .github/, since
these are public and really belong together with the other documentation.

We can still keep the issue templates under .github/, since they are not really
documentation on their own.

Updated the links pointing to CONTRIBUTING.md to refer to the one in docs/.
2018-09-08 13:39:03 -07:00
Filipe Brandenburger 9e825ebf4f docs: move doc/ to docs/
The docs/ directory is special in GitHub, since it can be used to serve GitHub
Pages from, so there's a benefit to switching to it in order to expose it
directly as a website.

Updated references to it from the documentations themselves, from the
CONTRIBUTING.md file and from Meson build files.
2018-09-08 13:39:03 -07:00
Zbigniew Jędrzejewski-Szmek 9d0798a2ed
Merge pull request #9832 from yuwata/fix-9831
network: fixes related to setting MTU
2018-09-08 17:17:07 +02:00
Zbigniew Jędrzejewski-Szmek a5404992cc
Merge pull request #9942 from lucaswerkmeister/9939
seccomp: fix #9939 and allow specifying multiple errnos for syscall
2018-09-08 12:08:54 +02:00
Filipe Brandenburger 8794164fed build-sys: disable -Wmaybe-uninitialized
Compiler flag -Wmaybe-uninitialized is quite noisy and produces many false
positives, especially when optimization flags are enabled (tested gcc 8.2.1),
so let's just disable it in systemd build.

For example, with CFLAGS=-O2, the build produces 11 such warnings and the
default CFLAGS of Fedora's rpmbuild warns about it in 176 places. A look at a
sample of those shows that most are false positives, where the compiler just
can't figure it out correctly. (While fixing those would be nice, I'm not sure
it's a good use of our time.)

The noisy [-Wmaybe-uninitialized] warnings are not just an annoyance, since
they make it harder to spot warnings that indicate actual problems (such as
variable declared but not used.) Silencing those is beneficial, so that
contributors would see warnings where there are actually actionable problems,
so there's a better chance of having those issues addressed before a PR is
pushed.

Tested:
  $ CFLAGS='-O2 -Wp,-D_FORTIFY_SOURCE=2' meson build/
  $ ninja -C build/

(NOTE: -Wp,-D_FORTIFY_SOURCE=2 prevents [-Wstringop-truncation] warnings.)

With the commands above, the build will not produce any [-Wmaybe-uninitialized]
warnings (or any other warnings), which is not really the case before this commit.

Also tested with rpmbuild on Fedora, after this commit there are no warnings
produced in the build step.
2018-09-08 12:05:56 +02:00
Evgeny Vereshchagin 231dca5579 tests: put fuzz_journald_processing_function in a .c file 2018-09-08 12:05:14 +02:00
Wyatt Ward c155a05549 hwdb: Add hwdb entry for X220 tablet (#10036) 2018-09-08 15:18:44 +09:00
Lucas Werkmeister 9d7fe7c65a seccomp: permit specifying multiple errnos for a syscall
If more than one errno is specified for a syscall in SystemCallFilter=,
use the last one instead of reporting an error. This is especially
useful when used with system call sets:

    SystemCallFilter=@privileged:EPERM @reboot

This will block any system call requiring super-user capabilities with
EPERM, except for attempts to reboot the system, which will immediately
terminate the process. (@reboot is included in @privileged.)

This also effectively fixes #9939, since specifying different errnos for
“the same syscall” (same pseudo syscall number) is no longer an error.
2018-09-07 21:44:13 +02:00
Yu Watanabe 6e222ac9d9 gitignore: add nspawn image lock and mkosi temporary files 2018-09-07 20:00:22 +02:00
Yu Watanabe e8596ca5c4 backlight: do not unref parent device
Fixes double-free introduced by 9aadd28149.
2018-09-07 20:00:01 +02:00
Filipe Brandenburger 3f9233e401 po: update Brazilian Portuguese translation 2018-09-07 19:37:55 +02:00
Julian Andres Klode abcf95e95e man: Document networkd states in networkctl(1) (#10033)
The manpage gives example outputs with the states, but it never
explains what the states are.

Fixes #575
2018-09-07 16:39:44 +02:00
Wyatt Ward b9d365e6e2 hwdb: Added entry for X200 Tablet/X201 Tablet so their pointing sticks would be recognized. They share parts with normal X200 and X201's. (#10029) 2018-09-07 10:35:55 +09:00
Yu Watanabe 3457a7a939
Merge pull request #10009 from evverx/rework-journald-fuzzers
Add a fuzzer for server_process_native_message
2018-09-05 11:46:17 +09:00
Yu Watanabe 53253d9c54 sd-dhcp6: set requested time for DUID-LLT
Follow-up for 7e90a499ab.
2018-09-04 13:07:37 -07:00
Yu Watanabe 339697f081 sd-dhcp: drop meaningless checking
mac_addr is not dynamically allocated.

Fixes CID 1395162 and 1395164.
2018-09-04 13:07:37 -07:00
Trevonn 862764560b hwdb: add Logitech G703 Wired/Wireless (#10005) 2018-09-04 18:47:08 +02:00
Network Silence 973de224dc hwdb: Synaptics touchpad edge fix for HP Pavilion G6 (#10008) 2018-09-04 18:46:07 +02:00
Michal Sekletar 70f5f48eb8 cryptsetup-generator: introduce basic keydev support
Dracut has a support for unlocking encrypted drives with keyfile stored
on the external drive. This support is included in the generated initrd
only if systemd module is not included.

When systemd is used in initrd then attachment of encrypted drives is
handled by systemd-cryptsetup tools. Our generator has support for
keyfile, however, it didn't support keyfile on the external block
device (keydev).

This commit introduces basic keydev support. Keydev can be specified per
luks.uuid on the kernel command line. Keydev is automatically mounted
during boot and we look for keyfile in the keydev
mountpoint (i.e. keyfile path is prefixed with the keydev mount point
path). After crypt device is attached we automatically unmount
where keyfile resides.

Example:
        rd.luks.key=70bc876b-f627-4038-9049-3080d79d2165=/key:LABEL=KEYDEV
2018-09-04 16:54:53 +02:00
Michael Biebl b711aee08f
Merge pull request #10007 from keszybz/fix-no-logind
systemctl: fix compilation w/o logind
2018-09-04 16:18:02 +02:00
Zbigniew Jędrzejewski-Szmek 807690fb7f systemctl: fix compilation w/o logind
Fixes #10006.
2018-09-04 09:34:16 +02:00