Commit graph

32275 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 8f7cbe730a TODO: drop one item
C.f. 7cb609115c.
2018-02-20 17:25:05 +01:00
Lennart Poettering 00f5ad93b5 core: change KeyringMode= to "shared" by default for non-service units in the system manager (#8172)
Before this change all unit types would default to "private" in the
system service manager and "inherit" to in the user service manager.

With this change this is slightly altered: non-service units of the
system service manager are now run with KeyringMode=shared. This appears
to be the more appropriate choice as isolation is not as desirable for
mount tools, which regularly consume key material. After all mounts are
a shared resource themselves as they appear system-wide hence it makes a
lot of sense to share their key material too.

Fixes: #8159
2018-02-20 08:53:34 +01:00
Peter Hutterer 6f58ff2325 hwdb: add axis override for Dell Inspiron MM061 touchpad (#8226)
https://bugzilla.redhat.com/show_bug.cgi?id=1545389
2018-02-20 16:27:48 +09:00
Alexis Jeandet 12873b6c80 meson: Multi-lines string should use ''' with meson (#8225)
This breaks with latest version of meson:
https://hephaistos.lpp.polytechnique.fr/teamcity/viewLog.html?buildId=11653&buildTypeId=mesonbuild_SystemdNightly&tab=buildLog&state=1059#_state=1059&guest=true
2018-02-20 10:36:41 +09:00
Yu Watanabe 2e536e6d1a
Merge pull request #8223 from jwrdegoede/hwdb-keyboard-touchpad-toggle
hwdb: 60-keyboard add mapping for the touchpad-toggle hotkey on 2 laptops
2018-02-20 10:34:53 +09:00
Daniel Mouritzen cd44919cc4 hwdb: Logitech M305 Wireless Optical Mouse dpi data (#8217)
Closes #8208
2018-02-20 10:33:10 +09:00
Hans de Goede d4a5df521d hwdb: Add quirk to fix mapping of T-bao Tbook air touchpad toggle key
The touchpad toggle key (Fn + Esc) on the T-bao Tbook air sends CTRL +
META + scancode 0x76 without this quirk. With this quirk it sends CTRL +
META + F21, with F21 mapping to XF86TouchpadToggle, which is what we want.

Note that the CTRL + META modifiers being send together with the F21 are
still somewhat unusual, userspace will need to be thought to deal with
this as there is nothing we can do about this at the hwdb level. Note at
least one other laptop also sends CTRL + META + F21 instead of just F21.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2018-02-19 20:20:40 +01:00
Hans de Goede a9186f27ad hwdb: Add quirk to fix mapping of VIOS LTH17 touchpad toggle key
The touchpad toggle key (Fn + F6) on the VIOS LTH17 sends CTRL + META + F24
without this quirk. With this quirk it sends CTRL + META + F21, with F21
mapping to XF86TouchpadToggle, which is what we want.

Note that the CTRL + META modifiers being send together with the F21 are
still somewhat unusual, userspace will need to be thought to deal with
this as there is nothing we can do about this at the hwdb level. Note at
least one other laptop also sends CTRL + META + F21 instead of just F21.
2018-02-19 20:20:40 +01:00
Lennart Poettering 30663b6c25
Merge pull request #8199 from keszybz/small-things
Sundry small cleanups
2018-02-19 16:55:10 +01:00
Zbigniew Jędrzejewski-Szmek e2cbc803f0 tests: add a simple test for utf8_n_codepoints() 2018-02-19 15:18:54 +01:00
Zbigniew Jędrzejewski-Szmek f95dbcc27b Some comment adjustments
Follow up for review of #8184.
2018-02-19 15:18:54 +01:00
Zbigniew Jędrzejewski-Szmek f4aa0bde1c core: drop obsolete comment
https://github.com/systemd/systemd/pull/8125#pullrequestreview-96894581
2018-02-19 15:18:54 +01:00
Zbigniew Jędrzejewski-Szmek 56c8d7444a pid1: do not initialize join_controllers by default
We're moving towards unified cgroup hierarchy where this is not necessary.
This makes main.c a bit simpler.
2018-02-19 15:18:54 +01:00
Zbigniew Jędrzejewski-Szmek 9ecdba8cb7 Move config_parse_join_controllers to shared, add test
config_parse_join_controllers would free the destination argument on failure,
which is contrary to our normal style, where failed parsing has no effect.
Moving it to shared also allows a test to be added.
2018-02-19 15:02:13 +01:00
Zbigniew Jędrzejewski-Szmek b48382e4e0 shared/conf-parser: define a macro for the repeating argument set
The arguments have to be indentical everywhere, so let's use a macro to
make things more readable. But only in the headers, in the .c files let's
keep them verbose so that it's easy to see the argument list.
2018-02-19 15:02:13 +01:00
Zbigniew Jędrzejewski-Szmek 6fb05b0799 test-process-util: one more (void) 2018-02-19 15:02:13 +01:00
Zbigniew Jędrzejewski-Szmek cb51ee7a6e Add some handling to remaining unlinkat calls
Coverity now started warning about this ("Calling unlinkat without checking
return value (as is done elsewhere 12 out of 15 times).", and it is right:
most of the time we should at list print a log message so people can figure
out something is wrong when this happens.

v2:
- use warning level in journald too (this is unlikely to happen ever, so it
  should be safe to something that is visible by default).
2018-02-19 15:00:00 +01:00
Yu Watanabe f99fdc3e14 bootspec: accept tab as the separataor in sd-boot config (#8165)
In the parse logic `line_get_key_value()` in sd-boot treats spaces
and tabs are valid spacing between key and value in the line.
So, let's use the same logic for `bootctl` and the others which read
sd-boot configs.

Fixes #8154.
2018-02-19 14:26:01 +01:00
Caio Marcelo de Oliveira Filho 2f62cf3552 meson: apply defaults if /etc/login.defs doesn't exist
Apply defaults for system_{uid,gid}_max even if the /etc/login.defs file
doesn't exist (e.g. in Clear Linux with no changes).

awk returns an empty string in case the file doesn't exist, causing meson to
fail in to_int(). So set the default if output is empty. This makes the BEGIN{}
blocks unnecessary, so remove them.
2018-02-19 12:59:37 +01:00
Iago López Galeiras 574432f889 job: truncate unit description
The comment above says we're truncating the string but that's not true,
an assert will fail in xsprintf if the description is longer than
LINE_MAX.

Let's use snprintf instead of xsprintf to make sure it's truncated.
We'll cast its result to void to tell static checkers we're fine with
truncation.
2018-02-19 12:37:30 +01:00
Марко М. Костић (Marko M. Kostić) 9371f858a5 po: update Serbian translation 2018-02-19 11:59:26 +01:00
Caio Marcelo de Oliveira Filho 9e70f2f818 meson: use multiline string syntax (#8214)
The single quote working with multiple lines is likely to be unintended. With
current versions of meson, it also causes error messages after it to report the
wrong line number. Use the documented syntax instead.
2018-02-19 18:37:19 +09:00
Michael Biebl ba3182b91a
Merge pull request #8202 from keszybz/avoid-msgmerge
Replace msgmerge use by gettext-domain= references
2018-02-18 19:56:50 +01:00
Zbigniew Jędrzejewski-Szmek b0faead250 meson: fix systemd-pot target when polkit-devel is not installed
To successfully extract strings from our .policy files, gettext needs
polkit.{its,loc} files provided by policykit-devel. When that package is not
installed, systemd-pot would fail to extract strings:

[0/1] Running external command systemd-pot.
xgettext: warning: file 'src/core/org.freedesktop.systemd1.policy.in.in' extension 'policy' is unknown; will try C
xgettext: warning: file 'src/hostname/org.freedesktop.hostname1.policy.in' extension 'policy' is unknown; will try C
...

We now don't need the .its and .loc files for normal building, but they are
still useful when generating the .pot file, because that way we avoid the
dependency on sufficiently new polkit. We just need to tell i18n to pass their
location to xgettext.
2018-02-18 17:53:41 +01:00
Michael Biebl d4d4688122 l10n: Update POTFILES.in and POTFILES.skip
We no longer use .in suffixes for .policy files.

Follow-up for commit 9b3cff199d and
70886abbde.
2018-02-18 17:50:51 +01:00
Evgeny Vereshchagin 31ce89e7d9 tests: reset _found at the end of each iteration (#8195)
This makes `inst_rules` really print all rules it skips.
2018-02-16 14:26:26 +01:00
Zbigniew Jędrzejewski-Szmek 9e8f3893e3 mkosi: remove intltool from deps
intltool is unnecessary since c81217920e.
But we still need gettext, because we use msgformat to generate .mo files.
(I tried to make meson depend on it, at least in Fedora:
 https://bugzilla.redhat.com/show_bug.cgi?id=1545926, but that didn't fly,
 and in Debian at least meson also has no dependency on the tools used by
 its i18n module, so we need to add our own dependency anyway.)

Closes #8192.
2018-02-16 13:01:12 +01:00
Zbigniew Jędrzejewski-Szmek 9b3cff199d meson: drop unnecessary "transformation" of policy files
Those files don't contain any @variables@, so the configuration step was just
copying them to build/. Let's avoid that, and fix their suffixes while at it.
2018-02-16 13:01:12 +01:00
Zbigniew Jędrzejewski-Szmek 70886abbde meson: drop double .in suffix for o.fd.systemd1.policy file
This file is now undergoing just one transformation, so drop the unnecessary
suffix.
2018-02-16 13:01:12 +01:00
Gunnar Hjalmarsson 264d8dcc16 Gettextize policy files
* Don't merge translations into the files
* Add gettext-domain="systemd" to description and message

Closes #8162, replaces #8118.
2018-02-16 13:00:52 +01:00
Zbigniew Jędrzejewski-Szmek af229d7a5b login,user-sessions: always warn when we fail to remove nologin file
This usually is very annoying to users who then cannot log in, so
make sure we always warn if that happens (selinux, or whatever other reason).

This reverts a790812cb3.
2018-02-16 10:44:22 +01:00
Dimitri John Ledkov 9c869ff6bf test/test-functions: Debian/Ubuntu, now ship 95-dm-notify.rules, copy it
This fixes cryptsetup tests on recent Ubuntu/Debian systems (current
development series).

Bug-Launchpad: https://launchpad.net/bugs/1749432
2018-02-15 17:48:31 +01:00
Lennart Poettering a94ab7acfd
Merge pull request #8175 from keszybz/gc-cleanup
Garbage collection cleanup
2018-02-15 17:47:37 +01:00
Lennart Poettering 476f65f98a
Merge pull request #8188 from keszybz/coverity-fixes
Coverity fixes
2018-02-15 17:23:03 +01:00
Lennart Poettering 476a8618fc
Merge pull request #8150 from poettering/memory-accounting-by-default
pid1: turn memory accounting on by default now
2018-02-15 17:22:36 +01:00
Zbigniew Jędrzejewski-Szmek 730f40eb57 Merge pull request #8184 from poettering/color-ask-pw
Trivial merge conflict resolved locally.
2018-02-15 17:14:59 +01:00
Zbigniew Jędrzejewski-Szmek 648461c07d Merge pull request #8125 from poettering/cgroups-migrate
Trivial merge conflict resolved locally.
2018-02-15 16:15:45 +01:00
Zbigniew Jędrzejewski-Szmek 554ce41f61 machined: change check_gc to may_gc everywhere 2018-02-15 14:09:40 +01:00
Zbigniew Jędrzejewski-Szmek 5c093a2368 logind: change check_gc to may_gc everywhere 2018-02-15 14:09:40 +01:00
Zbigniew Jędrzejewski-Szmek f698d99cd5 pid1: also show gc status for jobs like we do for units 2018-02-15 14:09:40 +01:00
Zbigniew Jędrzejewski-Szmek 2ab3050f6e pid1: rename job_check_gc to job_may_gc
The reasoning is the same as for unit_can_gc.

v2:
- rename can_gc to may_gc
2018-02-15 14:09:40 +01:00
Zbigniew Jędrzejewski-Szmek 1bdf279002 pid1: properly remove references to the unit from gc queue during final cleanup
When various references to the unit were dropped during cleanup in unit_free(),
add_to_gc_queue() could be called on this unit. If the unit was previously in
the gc queue (at the time when unit_free() was called on it), this wouldn't
matter, because it'd have in_gc_queue still set even though it was already
removed from the queue. But if it wasn't set, then the unit could be added to
the queue. Then after unit_free() would deallocate the unit, we would be left
with a dangling pointer in gc_queue.

A unit could be added to the gc queue in two places called from unit_free():
in the job_install calls, and in unit_ref_unset(). The first was OK, because
it was above the LIST_REMOVE(gc_queue,...) call, but the second was not, because
it was after that. Move the all LIST_REMOVE() calls down.
2018-02-15 14:03:53 +01:00
Zbigniew Jędrzejewski-Szmek a946fa9bb9 pid1: free basic unit information at the very end, before freeing the unit
We would free stuff like the names of the unit first, and then recurse
into other structures to remove the unit from there. Technically this
was OK, since the code did not access the name, but this makes debugging
harder. And if any log messages are added in any of those functions, they
are likely to access u->id and such other basic information about the unit.
So let's move the removal of this "basic" information towards the end
of unit_free().
2018-02-15 13:32:59 +01:00
Zbigniew Jędrzejewski-Szmek 2641f02e23 pid1: fix collection of cycles of units which reference one another
A .socket will reference a .service unit, by registering a UnitRef with the
.service unit. If this .service unit has the .socket unit listed in Wants or
Sockets or such, a cycle will be created. We would not free this cycle
properly, because we treated any unit with non-empty refs as uncollectable. To
solve this issue, treats refs with UnitRef in u->refs_by_target similarly to
the refs in u->dependencies, and check if the "other" unit is known to be
needed. If it is not needed, do not treat the reference from it as preventing
the unit we are looking at from being freed.
2018-02-15 13:32:53 +01:00
Zbigniew Jędrzejewski-Szmek 7f7d01ed58 pid1: include the source unit in UnitRef
No functional change.

The source unit manages the reference. It allocates the UnitRef structure and
registers it in the target unit, and then the reference must be destroyed
before the source unit is destroyed. Thus, is should be OK to include the
pointer to the source unit, it should be live as long as the reference exists.

v2:
- rename refs to refs_by_target
2018-02-15 13:27:06 +01:00
Zbigniew Jędrzejewski-Szmek f2f725e5cc pid1: rename unit_check_gc to unit_may_gc
"check" is unclear: what is true, what is false? Let's rename to "can_gc" and
revert the return value ("positive" values are easier to grok).

v2:
- rename from unit_can_gc to unit_may_gc
2018-02-15 13:04:12 +01:00
Jakub Filak f45b801551 coredump: accept hostname on command line (#8033)
This commint adds a new command line parameter to sytemd-coredump. The
parameter should be mappend to core_pattern's placeholder %h - hostname.

The field _HOSTNAME holds the name from the kernel's namespaces which might be
different then the one comming from process' namespaces.

It is true that the real hostname is usually available in the field
COREDUMP_ENVIRON (environment variables) but I believe it is more reliable to
use the value passed by kernel.

----

The length of iovec is no longer static and hence I corrected the declarations
of the functions set_iovec_field and set_iovec_field_free.

Thank you @yuwata and @poettering!
2018-02-15 12:12:46 +01:00
Zbigniew Jędrzejewski-Szmek 444d586333 meson: add -Dmemory-accounting-default=true|false
This makes it easy to set the default for distributions and users which want to
default to off because they primarily use older kernels.
2018-02-15 12:02:41 +01:00
Zbigniew Jędrzejewski-Szmek 1b11339179 udevadm: fix fd leak on oom
Unlikely, but let's be correct.

CID #1386003.
2018-02-15 11:49:40 +01:00
Thomas Haller 2e016b98c3 dhcp6: fix uninitialized variable in returning from client_parse_message() (#8187)
Compiler warns about this with -Werror=maybe-uninitialized.

Fixes: 3bc424a3cc
2018-02-15 10:49:55 +01:00