Commit Graph

39056 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 631427d622 TODO: add some bootctl items 2019-03-20 13:17:27 +01:00
Zbigniew Jędrzejewski-Szmek 17b70256f2
Merge pull request #12028 from poettering/start-limit-hit
core: some start limit checking improvements + refactoring
2019-03-19 13:40:55 +01:00
Zbigniew Jędrzejewski-Szmek 11dce8e29b Revert "Revert "units: lock down logind with fs namespacing options""
This reverts commit 28f38a7634.

The revert was done because Ubuntu CI was completely broken with it. Let's see
if it fares better now.
2019-03-19 10:58:49 +01:00
Lennart Poettering 928df2c251 units: turn off keyring handling for user@.service
This service uses PAM anyway, hence let pam_keyring set things up for
us. Moreover, this way we ensure that the invocation ID is not set for
this service as key, and thus can't confuse the user service's
invocation ID.

Fixes: #11649
2019-03-19 10:58:20 +01:00
dana 4890482531 journalctl: support `-b all` to negate effect of -b
Also fix an issue where -b without argument didn't always behave as -b0
2019-03-19 10:48:26 +01:00
Hugo Kindel b5587fa994 systemd-cgls: typo error in help command
Correct a small typo error happening on two lines of the help command:
"specifified" instead of "specified".
2019-03-19 10:27:28 +01:00
Claudius Ellsel f674c16835 Change Razer Abyssus DPI in 70-mouse.hwdb (#12029)
As discussed in https://gitlab.freedesktop.org/libinput/libinput/issues/198#note_100642 the DPI for the Razer Abyssus mouse is not 3500 by default, but around 1600-1700 when measured with the mouse-dpi-tool.

So I have done some measurements now and always got a value of about 21000 device units on a distance of 12.5 inch. This would result in a calculated resolution of about 1680 DPI. Since such an odd number does not occur in the hwdb file I decided to round to 1600 DPI.
2019-03-19 10:30:22 +10:00
Lennart Poettering 0f6e58f637 hwdb: fix trailing newline issue 2019-03-18 16:06:36 +01:00
Lennart Poettering 9adb695987 core: split error list in comment for unit_start() in two 2019-03-18 16:06:36 +01:00
Lennart Poettering 36c4dc089e core: change emergency_action() to return void
The function so far always returned -ECANCELLED, which is ignored in all
cases the function is invoked, except one: in unit_test_start_limit()
where -ECANCELLED is returned when the start limit is hit, which is part
of unit_start()'s protocol of return values.

Since the emergency_action() logic should be relatively generic and is
used in many places, let's drop the return value from it, since it's
constant anyway, and in alll cases useless. Instead, let's return it in
unit_test_start_limit(), where it's part of the protocol.

No change in behaviour.
2019-03-18 16:06:36 +01:00
Lennart Poettering 2de9b9793b core: check start limit on condition checks too
Let's add a safety precaution: if the start condition checks for a unit
are tested too often and fail each time, let's rate limit this too.

This should add extra safety in case people define .path, .timer or
.automount units that trigger a service that as a conditoin that always
fails.
2019-03-18 16:06:36 +01:00
Lennart Poettering 5766aca8d2 core: modernize unit_start() a bit
No change in behaviour, just a re-line-breaking of the various comments
to our current coding style, and some use of SYNTHETIC_ERRNO().
2019-03-18 16:06:36 +01:00
Lennart Poettering a4191c9fb5 core: unify code for checking whether unit to trigger is loaded 2019-03-18 16:06:36 +01:00
Lennart Poettering 97a3f4ee05 core: rename unit_{start_limit|condition|assert}_test() to unit_test_xyz()
Just some renaming, no change in behaviour.

Background: I'd like to add more functions unit_test_xyz() that test
various things, hence let's streamline the naming a bit.
2019-03-18 16:06:36 +01:00
Lennart Poettering 9e30cf74ce core: add comment explaining ECOMM return value of unit_start()
we explain all other return values, explain these ones too.
2019-03-18 16:06:36 +01:00
Zbigniew Jędrzejewski-Szmek 3dec520197 bus: fix memleak on invalid message
Introduced in 6d586a1371.
Reported by Felix Riemann in https://bugzilla.redhat.com/show_bug.cgi?id=1685286.

Reproducer:
for i in `seq 1 100`; do gdbus call --session -d org.freedesktop.systemd1 -m org.freedesktop.systemd1.Manager.StartUnit -o "/$(for x in `seq 0 28000`; do echo -n $x; done)" & done
2019-03-18 15:25:26 +01:00
Topi Miettinen ebcf697685 tree-wide: fix false search hits with ppp (typos) 2019-03-18 14:25:56 +01:00
AndreyYashkin ef57c69b78 Update 60-sensor.hwdb for Acer Acer One 10 S1002
Tested on GNOME iio-sensor-proxy. With this config touchscreen auto-rotation works fine.
2019-03-18 10:39:31 +01:00
Zbigniew Jędrzejewski-Szmek bcaabf481d fuzz-calendarspec: actually run the second part of the fuzzer
https://github.com/systemd/systemd/pull/11975#issuecomment-473467475
2019-03-16 18:13:17 +01:00
Lennart Poettering d449d63a0d
Merge pull request #11975 from keszybz/fuzzer-fixes-n
Fixes for a few fuzzer issues
2019-03-15 17:34:37 +01:00
Lennart Poettering 95658673a0
Merge pull request #12016 from yuwata/fix-two-memleaks-found-by-oss-fuzz
Fix two memleaks found by oss fuzz
2019-03-15 17:33:48 +01:00
Lennart Poettering 4209f6619d
Merge pull request #12015 from keszybz/fix-tests-in-rawhide
Fix compilation and tests in Fedora rawhide
2019-03-15 17:33:20 +01:00
Lennart Poettering f0e3650de1 man: clarify that /run/media/system/ is where mounts are placed by default
Prompted by the discussions on: https://github.com/systemd/systemd/issues/11982#issuecomment-472781806
2019-03-15 16:37:17 +01:00
Yu Watanabe 50969cff60 network: clear previous assignment
Prompted by oss-fuzz#13719.
2019-03-16 00:12:25 +09:00
Yu Watanabe c7a67ba5eb fuzz: add testcase for oss-fuzz#13691 2019-03-15 23:54:30 +09:00
Yu Watanabe 1d0c1146ea nspawn: fix memleak
Fixes oss-fuzz#13691.
2019-03-15 23:53:05 +09:00
Yu Watanabe 5ba40bb2cc fuzz: add a testcase for oss-fuzz#13719 2019-03-15 23:47:41 +09:00
Zbigniew Jędrzejewski-Szmek 7acf581a58 Handle or voidify all calls to close_all_fds()
In activate, it is important that we close the fds. In other cases, meh.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek 054d871d41 test-execute: block /sys not /proc
As explained in the previous commit, blocking /proc can cause us
to go into a long loop or fail the test.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek 6a461d1f59 basic/fd-util: refuse "infinite" loop in close_all_fds()
I had a test machine with ulimit -n set to 1073741816 through pam
("session required pam_limits.so set_all", which copies the limits from PID 1,
left over from testing of #10921).

test-execute would "hang" and then fail with a timeout when running
exec-inaccessiblepaths-proc.service. It turns out that the problem was in
close_all_fds(), which would go to the fallback path of doing close()
1073741813 times. Let's just fail if we hit this case. This only matters
for cases where both /proc is inaccessible, and the *soft* limit has been
raised.

  (gdb) bt
  #0  0x00007f7e2e73fdc8 in close () from target:/lib64/libc.so.6
  #1  0x00007f7e2e42cdfd in close_nointr ()
     from target:/home/zbyszek/src/systemd-work3/build-rawhide/src/shared/libsystemd-shared-241.so
  #2  0x00007f7e2e42d525 in close_all_fds ()
     from target:/home/zbyszek/src/systemd-work3/build-rawhide/src/shared/libsystemd-shared-241.so
  #3  0x0000000000426e53 in exec_child ()
  #4  0x0000000000429578 in exec_spawn ()
  #5  0x00000000004ce1ab in service_spawn ()
  #6  0x00000000004cff77 in service_enter_start ()
  #7  0x00000000004d028f in service_enter_start_pre ()
  #8  0x00000000004d16f2 in service_start ()
  #9  0x00000000004568f4 in unit_start ()
  #10 0x0000000000416987 in test ()
  #11 0x0000000000417632 in test_exec_inaccessiblepaths ()
  #12 0x0000000000419362 in run_tests ()
  #13 0x0000000000419632 in main ()
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek 9efb96315a test-execute: allow filtering test cases by pattern
When debugging failure in one of the cases, it's annoying to have to wade
through the output from all the other cases. Let's allow picking select
cases.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek 67fb5f338f seccomp: allow shmat to be a separate syscall on architectures which use a multiplexer
After
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817,
those syscalls have their separate numbers and we can block them.
But glibc might still use the old ones. So let's just do a best-effort
block and not assume anything about how effective it is.
2019-03-15 15:46:41 +01:00
Yu Watanabe 5f07d640ca network: clear previous assignment
Fixes oss-fuzz#13719.
2019-03-15 23:44:51 +09:00
Zbigniew Jędrzejewski-Szmek e55bdf9b6c seccomp: shm{get,at,dt} now have their own numbers everywhere
E.g. on i686:

(previously)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmdt) = -222

(now)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmdt) = 398

The relevant commit seems to be
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817.
2019-03-15 15:28:43 +01:00
Zbigniew Jędrzejewski-Szmek a75fcef8fb shared/bootspec: avoid signed-unsigned comparison
../src/shared/bootspec.c: In function ‘find_sections’:
../src/shared/bootspec.c:425:23: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  425 |                 if (n != size)
      |                       ^~
2019-03-15 15:28:43 +01:00
Lennart Poettering 75910ed9f4
Merge pull request #12012 from keszybz/generator-man-docs
Generator and documentation improvements
2019-03-15 14:45:00 +01:00
Zbigniew Jędrzejewski-Szmek d323a99001 man: reorder and add examples to systemd-analyze(1)
The number of verbs supported by systemd-analyze has grown quite a bit, and the
man page has become an unreadable wall of text. Let's put each verb in a
separate subsection, grouping similar verbs together, and add a lot of examples
to guide the user.
2019-03-15 13:55:24 +01:00
Zbigniew Jędrzejewski-Szmek 827f62c3f2 man,units: document what user "default.target" is a bit 2019-03-15 13:55:24 +01:00
Lennart Poettering 9bbd37845c
Merge pull request #11988 from keszybz/test-binaries-installation
Install more requires binaries for tests
2019-03-15 13:06:11 +01:00
Lennart Poettering 1aac9f5dee
Merge pull request #12009 from mrc0mmand/bump-partition-size-for-TEST-02-CRYPTSETUP
test: fix LUKS2 support
2019-03-15 13:01:24 +01:00
Zbigniew Jędrzejewski-Szmek dea4bef0a2
Merge pull request #11658 from yuwata/systemd-id128
id128: several cleanups
2019-03-15 11:18:28 +01:00
Yu Watanabe 58a6c57b75 bash-completion: add systemd-id128 support 2019-03-15 18:54:53 +09:00
Yu Watanabe 8efb042e0c sd-id128: split the logic obtaining invocation ID from sd_id128_get_invocation() 2019-03-15 18:53:23 +09:00
Yu Watanabe 9363e2f499 id128: no command accepts additional arguments 2019-03-15 18:53:23 +09:00
Zbigniew Jędrzejewski-Szmek 2fffb93b32 analyze: reword explanation in critical-chain header
Let's try to make it a bit clearer.
2019-03-15 10:17:46 +01:00
Frantisek Sumsal 5b69d297c1 test: use PBKDF2 instead of Argon2 in cryptsetup...
to reduce memory requirements for volume manipulation. Also,
to further improve the test performance, reduce number of PBKDF
iterations to 1000 (allowed minimum).
2019-03-15 10:05:33 +01:00
Zbigniew Jędrzejewski-Szmek 9c5ac5ebba man: tell generator writers to provide authorship and source information
Our generators always put a comment who generated the file, but we didn't
recommend it to others.

Let's also strengthen the advice to use SourcePath=.
2019-03-15 08:19:07 +01:00
Zbigniew Jędrzejewski-Szmek 00068caf36 fstab-generator: do not print double header
$ /run/systemd/generator/dev-mapper-fedora_krowka\x2dswap.swap
  # Automatically generated by systemd-fstab-generator

  # Automatically generated by systemd-fstab-generator

  [Unit]
  ...
2019-03-15 08:04:54 +01:00
Frantisek Sumsal 32983312ed test: bump the second partition size to 50MB
10MB is not enough for a LUKS2 partition.
2019-03-15 06:12:23 +01:00
Zbigniew Jędrzejewski-Szmek de04bbdce1 tree-wide: spell "lifecycle" without hyphen everywhere
We had 10 instances of unhyphentated spelling, and 4 of the hyphenated one.
Consistency trumps ispell.
2019-03-14 22:47:44 +01:00