Commit graph

32285 commits

Author SHA1 Message Date
Lennart Poettering 4c2e1b399f xattr-util: use crtime/btime if statx() is available for implementation of fd_setcrtime() and friends
The Linux kernel exposes the birth time now for files through statx()
hence make use of it where available. We keep the xattr logic in place
for this however, since only a subset of file systems on Linux currently
expose the birth time. NFS and tmpfs for example do not support it. OTOH
there are other file systems that do support the birth time but might
not support xattrs (smb…), hence make the best of the two, in particular
in order to deal with journal files copied between file system types and
to maintain compatibility with older file systems that are updated to
newer version of the file system.
2018-02-20 15:41:49 +01:00
Lennart Poettering 1133dea477 xattr-util: support AT_EMPTY_PATH in fgetxattrat_fake()
Let's expose fstatat() like behaviour if AT_EMPTY_PATH is defined.

Also, check the specified flags returning EINVAL on the flags we don't
emulate.
2018-02-20 15:39:31 +01:00
Lennart Poettering 8fc58f1ad3 journal-file: fix typo in log message 2018-02-20 15:39:31 +01:00
Lennart Poettering 7f7210c210 io-util: add an unlikely decorator for a test that should never hold 2018-02-20 15:39:31 +01:00
Lennart Poettering 8ac2f74fb6 tree-wide: make use of fsync_directory_of_file() all over the place
Let's make use this at various places we call fsync(), to make things
fully reliable, as the kernel devs suggest to first fsync() files and
then fsync() the directories they are located in.
2018-02-20 15:39:31 +01:00
Lennart Poettering 11b29a96e9 fs-util: move fsync_directory_of_file() into generic code
This function used by the journal code is pretty useful generically,
let's move it to fs-util.c to make it useful for other code too.
2018-02-20 15:39:31 +01:00
Lennart Poettering 3cc4411403 stat-util: unify code that checks whether something is a regular file
Let's add a common implementation for regular file checks, that are
careful to return the right error code (EISDIR/EISLNK/EBADFD) when we
are encountering a wrong file node.
2018-02-20 15:39:31 +01:00
Lennart Poettering 9c66f52813 sd-journal: when picking up a new file, compare inode/device info with previous open file by same name
Let's make sure we aren't confused if a journal file is replaced by a
different one (for example due to rotation) if we are in a q overflow:
let's compare the inode/device information, and if it changed replace
any open file object as needed.

Fixes: #8198
2018-02-20 15:39:31 +01:00
Lennart Poettering fc1813c0fe sd-journal: rename add_file() → add_file_by_name()
Let's be more careful with the naming, and indicate that the function
is about *named* journal files, and will validate the name as needed.
(in opposition to add_any_file() which doesn't care about names)
2018-02-20 15:39:30 +01:00
Lennart Poettering 817b1c5b1e journal-file: add O_NONBLOCK for paranoia when opening journal files 2018-02-20 15:39:21 +01:00
Lennart Poettering 8d6a4d33e1 journal-file: refuse opening non-regular journal files
Let's check the file node type when we open/stat journal files: refuse
anything that is not a regular file...
2018-02-20 12:53:10 +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