Commit graph

17419 commits

Author SHA1 Message Date
Ivan Shapovalov bd6bcce4d7 fstab-generator: do not skip Before= ordering for noauto mountpoints (#5547) 2017-04-24 18:38:53 +02:00
Michal Sekletar f934644424 sd-journal: return SD_JOURNAL_INVALIDATE only if journal files were actually deleted/moved (#5580)
When caller invokes sd_journal_open() we usually open at least one
directory with journal files. add_root_directory() function increments
current_invalidate_counter. After sd_journal_open() returns
current_invalidate_counter != last_invalidate_counter.

After caller waits for journal events (e.g. waits for new messages in
journal) then it usually calls sd_journal_process(). However, on first
call to sd_journal_process(), function determine_change() returns
SD_JOURNAL_INVALIDATE even though no journal files were
deleted/moved. This is because current_invalidate_counter !=
last_invalidate_counter.

After the fix we make sure counters has the same value before we begin
processing inotify events.
2017-04-24 18:33:12 +02:00
Matija Skala a45e7bb408 redirect stdout/stderr back when closing the pager (#5661) 2017-04-24 18:30:50 +02:00
Danielle Church 42d43f214e load-fragment: resolve specifiers in BindPaths/BindReadOnlyPaths (#5687) 2017-04-24 18:23:35 +02:00
Djalal Harouni 74e941c022 Merge pull request #5774 from keszybz/printf-annotations
Printf annotation improvements
2017-04-23 01:03:42 +02:00
Martin Pitt 56744c037d Merge pull request #5756 from keszybz/make-cleanups
Various meson-independent cleanups from the meson patchset
2017-04-21 21:36:56 +02:00
Yu Watanabe 301fb51922 kernel-install: remove unneeded modules.* files created by depmod (#5766)
Fixes #5765.
2017-04-21 14:03:17 -04:00
Zbigniew Jędrzejewski-Szmek ae2173d66b coredump: fix non-literal string used in printf
This was exposed by the previous commit. This could be potentially
unpleasant, but we are saved by the fact that this code path was only
taken for journald crashes, where we control COMM and know that it doesn't
contain any special characters. Use log_dispatch which does not do any
format processing to push the message out.
2017-04-21 13:39:50 -04:00
Zbigniew Jędrzejewski-Szmek 93484b4790 basic/log: expose log_dispatch
This is useful when we want to avoid printf formatting on the message.
It's nicer than using log_struct with "%s" as the format, because printf
is slow and with a large message (like from a backtrace) this would require
extra unnecessary memory.

I'm not exposing all the fields in the wrapper: only level and errno.
Those are the most likely to be useful.
2017-04-21 13:39:03 -04:00
Zbigniew Jędrzejewski-Szmek ba360bb05c tree-wide: mark log_struct with _printf_ and fix fallout
log_struct takes multiple format strings, each one followed by arguments.
The _printf_ annotation is not sufficiently flexible to express this,
but we can still annotate the first format string, though not its
arguments (because their number is unknown).

With the annotation, the places which specified the message id or similar
as the first pattern cause a warning from -Wformat-nonliteral. This can
be trivially fixed by putting the MESSAGE= first.

This change will help find issues where a non-literal is erroneously used
as the pattern.
2017-04-21 13:37:04 -04:00
Zbigniew Jędrzejewski-Szmek c8304ba902 µhttpd-util: use #pragma to silence warning about nonliteral pattern
This is safe, because we're taking a pattern which was already marked with
_printf_ and appending a literal string.
2017-04-21 13:36:48 -04:00
Zbigniew Jędrzejewski-Szmek 62cc1c55cb bus: include sd-{bus,messages}.h the same as other systemd headers
This is our own header, we should include use the local-include syntax
("" not <>), to make it clear we are including the one from the build tree.
All other includes of files from src/systemd/ use this scheme.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 58eb279840 microhttpd-util: silence warnings about deprecated options
C.f. 21b6ff3684.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 4fa3993be9 test-exec-util: drop duplicate const
gcc-7 warns about this with -Wduplicate-decl-specifier.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 5224c2c706 basic/random-util: add new header for getrandom()
There's some confusion: older man pages specify that linux/random.h
contains getrandom, but newer glibc has it in sys/random.h. Detect if
the newer header is available and include it. We still need the older
header for the flags.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek d1c536f502 libshared: fix compilation without libblkid
This reverts a75e27eb. a75e27eb fixed the case of libcryptsetup=no, libblkid=yes,
but broke the case of libcryptsetup=no, libblkid=yes. Instead of trying to define
the function only when used, which would result in too much ifdeffery, just silence
the warning.
2017-04-21 12:05:55 -04:00
Zbigniew Jędrzejewski-Szmek 4ca0d5ca4a basic/missing.h: drop inclusion of macro.h
It's not necessary for anything.
2017-04-21 12:05:55 -04:00
Susant Sahani 28959f7d3e networkd: route - support 'onlink' routes (#5734)
This work based on Tom's original patch
teg@1312172

By setting GatewayOnlink=yes, the kernel will assume that the gateway is onlink
even if there is no route to it.

Resolves issue #1283.
2017-04-21 11:22:30 +02:00
Susant Sahani c8b2118405 networkd: vlan add GVRP support (#5761)
Add support to configure GVRP.

Closes #5760
2017-04-21 11:01:59 +02:00
iplayinsun 41c237af80 core: move checking default_dependencies into target_add_default_dependencies. (#5762)
Almost units check default_dependencies within [unit]_add_default_dependencies
except target unit.
2017-04-21 11:00:47 +02:00
Benjamin Gilbert a2c74c0ce8 ima: Ensure policy exists before asking the kernel to load it (#5777)
e8e42b31c5 added support for having the
kernel load the IMA policy directly, but didn't check that the policy
file exists.  If not, this produced a kernel message:

    IMA: policy update failed
2017-04-21 10:53:40 +02:00
Zbigniew Jędrzejewski-Szmek 032b75419d basic/log: fix _printf_ annotation on log_object_internalv
Fixup for 4b58153dd2.

I saw this because of a clang warning. With gcc the -Wformat-nonliteral warning
doesn't seem to work as expected.

In two places, a string constructed with strjoina is used as the pattern. This
is safe, because we're taking a pattern which was already marked with _printf_
and prepending a known value to it.  Those places are marked with #pragma to
silence the warning.
2017-04-20 14:42:43 -04:00
Zbigniew Jędrzejewski-Szmek ccc717fa5c test-compress*: silence warning about unused definitions when w/o both xz and lz4
I think it's nice to mark the test as skipped instead of omitting
it entirely, hence #ifdefs in the code instead of excluding the test
in Makefile.am/meson.build.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek f96c10bdca rc-local-generator: drop duplicate definitions for rc.local
We always define those paths in the configure scripts.
2017-04-19 19:27:01 -04:00
Zbigniew Jędrzejewski-Szmek f8bde603fd basic/def.h: drop TTY_GID definition
We already provide a definition through the configuration system, this
one is duplicate.
2017-04-19 19:27:01 -04:00
Yu Watanabe da4128543f tree-wide: fix wrong indent (#5757)
Fixes wrong indent introduced by the commit 43688c49d1.
2017-04-19 08:48:29 +02:00
Lennart Poettering 948a3241de Merge pull request #5708 from vcatechnology/arm-cross-compile
ARM32 cross-compile fixes
2017-04-17 15:49:06 +02:00
slodki b0d08b056e loginctl: fix typo causing ignoring multiple session IDs (#5732)
Fixes #5733
2017-04-13 12:34:59 +02:00
Djalal Harouni 67d293da11 Merge pull request #5690 from yuwata/fix-5621
core: downgrade error message if command is prefixed with `-` and the…
2017-04-12 20:22:03 +02:00
Dimitri John Ledkov b56be2966a networkd: Add bridge port priority setting (#5545)
Allow setting bridge port priority in the Bridge section of the network file,
similar to e.g. port path cost setting.

Set the default to an invalid value of 128, and only set the port priority when
it's not 128. Unlike e.g. path cost, zero is a valid priority value.

Add a networkd-test.py to check that bridge port priority is correctly set.

Incidently, fix bridge port cost type and document valid ranges.
2017-04-11 23:17:31 +02:00
Yu Watanabe c258349f1a tmpfiles: downgrade error message when operation is not supported (#5692)
Fixes #5607
2017-04-10 13:22:18 +02:00
Evgeny Vereshchagin c9b0610856 core: fix values of BindPaths and BindReadOnlyPaths properties on 32-bit platforms (#5713)
$ busctl get-property \
    org.freedesktop.systemd1 \
    /org/freedesktop/systemd1/unit/run_2dr471de87550554a6dbb165501c33c5dab_2eservice \
    org.freedesktop.systemd1.Service BindReadOnlyPaths

a(ssbt) 1 "/etc" "/etc" false 9228635523571007488

The correct values are 0 and 16384
2017-04-10 13:20:17 +02:00
umuttl ddbf0d4b92 core: downgrade legit error logs (#5705)
manager_sync_bus_names() function retrieves the dbus names
and compares it with unit bus names. It could be right
after the list is retrieved, the dbus peer is disconnected.
In this case it is really not an ERROR print if
sd_bus_get_name_creds() or sd_bus_creds_get_unique_name()
fail.
2017-04-10 13:12:25 +02:00
Nathaniel R. Lewis f472d466ec Remove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)
At present, devices implementing the BTN_DPAD_UP/DOWN/LEFT/RIGHT
codes will be incorrectly classified as key devices.  This causes
devices respecting the Linux gamepad spec (such as the DS3 as of
kernel 4.12) to be classified as keyboards by X11.

This is caused by the test_key function checking all codes on
[KEY_OK, BTN_TRIGGER_HAPPY).  Unfortunately the BTN_DPAD_* codes
are placed between KEY_LIGHTS_TOGGLE and KEY_ALS_TOGGLE.  This
patch splits the upper key block check into the block before and
after the BTN_DPAD_* codes.  An array is used to avoid dedicated,
per block loops in the event that more event codes are added in
the future.
2017-04-06 21:13:14 +02:00
Matt Clarkson 6b5cf3ea62 build-sys: correct blkid.h includes
When using pkg-config to determine the include flags for blkid the
flags are returned as:

    $ pkg-config blkid --cflags
    -I/usr/include/blkid -I/usr/include/uuid

We use the <blkid/blkid.h> include which would be correct when using
the default compiler /usr/include header search path. However, when
cross-compiling the blkid.h will not be installed at /usr/include and
highly likely in a temporary system root. It is futher compounded if
the cross-compile packages are split up and the blkid package is not
available in the same sysroot as the compiler.

Regardless of the compilation setup, the correct include path should be
<blkid.h> if using the pkg-config returned CFLAGS.
2017-04-06 14:33:02 +01:00
Lennart Poettering 6cb484cc06 Merge pull request #5706 from keszybz/make-cleanups
Move busctl to its own dir and other cleanups
2017-04-05 12:10:11 +02:00
afrantzis 5e8273acac logind: Stopped inhibitions should be considered inactive (#5698) 2017-04-05 10:32:55 +02:00
Zbigniew Jędrzejewski-Szmek 65fbd93915 udev: rename gperf struct name to match other headers
This makes it easier to use the same generator script as for other
gperf scripts. With automake each gperf file had it's own rule, but
with meson I'm trying to use one script, and this inconsistency made
that harder.
2017-04-04 20:36:09 -04:00
Zbigniew Jędrzejewski-Szmek 948aaa7c52 tree-wide: standardize on $(PACKAGE_VERSION) for the version string
We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents.
$(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and
drop the other define.
2017-04-04 20:36:09 -04:00
Zbigniew Jędrzejewski-Szmek 79f1c8f619 build-sys: use a single ENABLE_LOGIND conditional
We used ENABLE_LOGIND for the automake conditional, and HAVE_LOGIND
for the ifdef. That wasn't wrong, but it certainly was confusing.

Also, move the ifdeffery to avoid warning about unused static function
logind_set_wall_message() when logind is disabled.
2017-04-04 20:36:09 -04:00
Zbigniew Jędrzejewski-Szmek a75e27eb70 shared/dissect-image: fix warning about unused function when !HAVE_BLKID 2017-04-04 20:36:09 -04:00
Zbigniew Jędrzejewski-Szmek 3bcaf458f6 Move busctl sources to src/busctl
busctl is not part of libsystemd, and should not be stored under libsystemd.
In particular this is confusing because busctl is linked with libshared, but
stuff in libsystemd is not supposed to depend on libshared.
2017-04-04 20:36:09 -04:00
Yu Watanabe 4d8b0f0f7a core: downgrade error message if command is prefixed with - and the command is not found
Fixes #5621
2017-04-03 15:38:37 +09:00
Lennart Poettering 88be0aa226 Merge pull request #5589 from jasonreeder/claimed_address_fix
libsystemd-network: sd-ipv4ll: acquire new address after claimed addr…
2017-04-01 11:41:58 +02:00
Jason Reeder 0698ff4184 libsystemd-network: sd-ipv4ll: acquire new address after claimed address conflict
If a conflict occurs on a claimed ipv4ll address, the device releases
the address and then does not attempt to acquire a new ipv4ll
address. According to RFC3927, releasing the address in this
situation is correct. However, this should be followed by an attempt
to configure a new ipv4ll address.

This commit restarts the ipv4ll address acquisition state machine
after releasing the conflicting address.

From RFC3927 Section 2.5 conflict defense method (b):
...
However, if this is not the first conflicting ARP packet the host has
seen, and the time recorded for the previous conflicting ARP packet is
recent, within DEFEND_INTERVAL seconds, then the host MUST immediately
cease using this address and configure a new IPv4 Link-Local address
as described above.
...

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
2017-03-31 15:40:18 -05:00
Jason Reeder 5e25a13a05 libsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after conflict
After an ipv4ll claimed address conflict occurs a new address needs
to be chosen and then the acquisition state machine needs to be
restarted.

This commit adds a function (sd_ipv4ll_restart) that clears the
previously acquired address (ll->address) and then calls the existing
sd_ipv4ll_start function to choose the new address and start the
acquisition.

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
2017-03-31 15:29:00 -05:00
David Michael 7357272ed1 nspawn: check if the DNS stub is listening for requests 2017-03-31 11:34:32 -07:00
David Michael 7ed1565a9d resolved: add a DNSStubListener property to Manager 2017-03-31 11:33:58 -07:00
Franck Bui 765a00b98d udev: net_id - support predictable ifnames on vio buses (#5675)
For IBM PowerVM Virtual I/O network devices, we can build predictable names
based on the slot number passed as part of the OF "reg" property.  Valid slot
numbers range between 2-32767, so we only need the bottom half of the unit
address passed.

For example:

  /proc/device-tree/vdevice/l-lan@30000002
  /proc/device-tree/vdevice/vnic@30000005

would initially map to something like:

  /sys/devices/vio/30000002/net/eth0
  /sys/devices/vio/30000005/net/eth1

and would then translate to env2 and env5

This patch ignores the bus number, as there should only ever be one bus, and
then remove leading zeros.
2017-03-31 16:32:09 +02:00
hendrikw01 6554550f35 networkd: RFC compliant autonomous prefix handling (#5636)
Previously, `lifetime_valid` of a Router Advertisement was not handled
the way RFC4862 has specified.

In particular: Sections 5.5.3.d and  5.5.3.e
2017-03-31 15:10:59 +02:00