Lennart Poettering [Mon, 18 Dec 2017 19:10:13 +0000 (20:10 +0100)]
sd-bus: add APIs to request/release names asynchronously
They do the same thing as their synchronous counterparts, but only
enqueue the operation, thus removing synchronization points during
service initialization.
If the callback function is passed as NULL we'll fallback to generic
implementations of the reply handlers, that terminate the connection if
the requested name cannot be acquired, under the assumption that not
being able to acquire the name is a technical problem.
Lennart Poettering [Mon, 18 Dec 2017 13:48:16 +0000 (14:48 +0100)]
bus-control: remove kdbus indirection cruft
When kdbus was still around we always had two implementations of the
various control calls: one for dbus1 and one for kdbus. Let'sget rid of
this, simplify things, and just merge the wrappers that used to
multiplex this with the implementations.
No change in behaviour, just some merging of functions
Lennart Poettering [Mon, 18 Dec 2017 13:21:34 +0000 (14:21 +0100)]
sd-bus: get rid of kdbus flags cruft
We only need three bits from the old kdbus flags cruft, hence let's make
them proper booleans.
Lennart Poettering [Fri, 15 Dec 2017 21:19:34 +0000 (22:19 +0100)]
busctl: add a new --watch-bind switch
This is useful for testing, and early-boot scripting.
Lennart Poettering [Mon, 18 Dec 2017 12:53:12 +0000 (13:53 +0100)]
sd-bus: start reply callback timeouts only when the connection is established
Currently, reply callback timeouts are started the instant the method
calls are enqueued, which can be very early on. For example, the Hello()
method call is enqueued right when sd_bus_start() is called, i.e. before
the socket connection and everything is established.
With this change we instead start the method timeout the moment we
actually leave the authentication phase of the connection. This way, the
timeout the kernel applies on socket connecting, and we apply on the
authentication phase no longer runs in parallel to the Hello() method
call, but all three run serially one after the other, which is
definitely a cleaner approach.
Moreover, this makes the "watch bind" feature a lot more useful, as it
allows enqueuing method calls while we are still waiting for inotify
events, without them timeouting until the connection is actually
established, i.e. when the method call actually has a chance of being
actually run.
This is a change of behaviour of course, but I think the new behaviour
is much better than the old one, since we don't race timeouts against
each other anymore...
Lennart Poettering [Fri, 15 Dec 2017 21:24:52 +0000 (22:24 +0100)]
sd-bus: optionally, use inotify to wait for bus sockets to appear
This adds a "watch-bind" feature to sd-bus connections. If set and the
AF_UNIX socket we are connecting to doesn't exist yet, we'll establish
an inotify watch instead, and wait for the socket to appear. In other
words, a missing AF_UNIX just makes connecting slower.
This is useful for daemons such as networkd or resolved that shall be
able to run during early-boot, before dbus-daemon is up, and want to
connect to dbus-daemon as soon as it becomes ready.
Lennart Poettering [Wed, 27 Dec 2017 17:22:31 +0000 (18:22 +0100)]
bus: touch() the AF_UNIX sockets we listen() on after the fact
We'd like to use inotify to get notified when AF_UNIX sockets become
connectable. That happens at the moment of listen(), but this is doesn't
necessarily create in a watchable inotify event. Hence, let's synthesize
one whenever we generically create a socket, or when we know we created
it for a D-Bus server.
Ideally we wouldn't have to do this, and the kernel would generate an
event anyway for this. Doing this explicitly isn't too bad however, as
the event is still nicely associated with the AF_UNIX socket node, and
we generate all D-Bus sockets in our code hence it's safe.
Lennart Poettering [Wed, 27 Dec 2017 16:18:02 +0000 (17:18 +0100)]
socket-util: explicitly ensure there's one trailing NUL byte on AF_UNIX socket addresses
AF_UNIX socket addresses aren't necessarily NUL terminated, however
they are usually used as strings which are assumed to be NUL terminated.
Let's hence add an extra byte to the end of the sockaddr_un structure,
that contains this NUL byte, simply for safety reasons.
Note that actually this patch changes exactly nothing IRL, as the other
sockaddr structures already are large enough to accomodate for an extra
NUL byte. The size of the union hence doesn't change at all by doing
this. The entire value of this patch is hence in the philosophical
feeling of safety, and by making something explicit that before was
implicit.
Lennart Poettering [Wed, 27 Dec 2017 16:02:36 +0000 (17:02 +0100)]
socket-util: use parse_ip_port() for parsing IP ports
Let's unify some code here, and also use parse_ip_port() for all our IP
port parsing needs in socket_address_parse().
Lennart Poettering [Wed, 27 Dec 2017 15:59:44 +0000 (16:59 +0100)]
socket-label: tweak socket_address_listen() a bit
This changes two things when binding to AF_UNIX file system sockets:
1. When wethe socket already exists in the fs, and unlink() on it fails,
don't bother to bind() a second time: since nothing changed it won't
work either.
2. Also use SELinux-aware bind() for the second attempt.
Lennart Poettering [Wed, 27 Dec 2017 15:50:24 +0000 (16:50 +0100)]
socket-label: simplify things a bit by using socket_address_get_path()
Let's make this more generic and descriptive, and let's reuse our
existing utility functions.
Lennart Poettering [Wed, 27 Dec 2017 15:20:28 +0000 (16:20 +0100)]
fs-util: rework touch_file() so that it can touch socket file nodes
Let's rework touch_file() so that it works correctly on sockets, fifos,
and device nodes: let's open an O_PATH file descriptor first and operate
based on that, if we can. This is usually the better option as it this
means we can open AF_UNIX nodes in the file system, and update their
timestamps and ownership correctly. It also means we can correctly touch
symlinks and block/character devices without triggering their drivers.
Moreover, by operating on an O_PATH fd we can make sure that we
operate on the same inode the whole time, and it can't be swapped out in
the middle.
While we are at it, rework the call so that we try to adjust as much as
we can before returning on error. This is a good idea as we call the
function quite often without checking its result, and hence it's best to
leave the files around in the most "correct" fashion possible.
Lennart Poettering [Fri, 15 Dec 2017 21:24:16 +0000 (22:24 +0100)]
sd-bus: when attached to an sd-event loop, disconnect on processing errors
If we can't process the bus for some reason we shouldn't just disable
the event source, but log something and give up on the connection. Hence
do that, and disconnect.
Lennart Poettering [Tue, 12 Dec 2017 22:26:36 +0000 (23:26 +0100)]
sd-bus: propagate handling errors for Hello method reply directly
Currently, when sd-bus is used to issue a method call, and we get a
reply and the specified reply handler fails, we log this locally at
debug priority and proceed. The idea is that a bad server-side reply
should not be fatal for the program, except when the developer
explicitly terminates the event loop.
The reply to the initial Hello() method call we issue when joining a bus
should not be handled like that however. Instead, propagate the error
immediately, as anything that is wrong with the Hello() reply should be
considered a fatal connection problem.
Lennart Poettering [Tue, 12 Dec 2017 22:26:08 +0000 (23:26 +0100)]
sd-bus: minor coding style fix
Lennart Poettering [Tue, 12 Dec 2017 22:24:44 +0000 (23:24 +0100)]
sd-bus: cast some syscall invocations explicitly to (void)
Let's clarify that we knowingly ignore the return values.
Lennart Poettering [Tue, 12 Dec 2017 22:23:25 +0000 (23:23 +0100)]
sd-bus: when debug logging about messages, show the same bits of it everywhere
Also, include the message signature everywhere.
Lennart Poettering [Tue, 12 Dec 2017 22:21:09 +0000 (23:21 +0100)]
io-util: make flush_fd() return how many bytes where flushed
This is useful so that callers know whether anything at all and how much
was flushed.
This patches through users of this functions to ensure that the return
values > 0 which may be returned now are not propagated in public APIs.
Also, users that ignore the return value are changed to do so explicitly
now.
John Lin [Fri, 5 Jan 2018 12:15:42 +0000 (20:15 +0800)]
install: search preset files in /run (#7715)
According to systemd.preset(5), presets files in /run should take
effect. However, before this patch, preset files in /run were
ignored.
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jan 2018 11:38:29 +0000 (12:38 +0100)]
Merge pull request #7763 from yuwata/fix-7761
Revert "core/execute: RuntimeDirectory= or friends requires mount namespace"
Bruce A. Johnson [Fri, 5 Jan 2018 09:02:38 +0000 (04:02 -0500)]
systemd-udevd: fix speed/duplex processing with valid .link files (#7808)
Including BitsPerSecond or Duplex values in .link files did not work when
set_slinksettings was called because the routine was not copying the base
parameters to the structure given to ioctl. As a result, EINVAL was always
reported, and no change occurred on the Ethernet device.
Alexis Deruelle [Fri, 5 Jan 2018 00:17:17 +0000 (01:17 +0100)]
Touchpad range : add another Macbook4,1 variant (#7749)
#Add "Early 2008 Core 2 Duo/Penryn" Macbook4,1 match string to the existing touchpad range definition
##Symptoms
* Jerky/Jumpy cursor motion using touchpad
* "Axis value outside expected range" message in Xorg.0.log
##Fix
I followed the instructions described here :https://wayland.freedesktop.org/libinput/doc/latest/absolute_coordinate_ranges.html and came up with the following :
evdev:input:b0003v05ACp022A*
EVDEV_ABS_00=256:1469:12
EVDEV_ABS_01=256:829:12
The ranges and resolutions are the same as stated in the existing definition (+/- 2) so only add the match string.
Hans de Goede [Thu, 4 Jan 2018 18:43:27 +0000 (19:43 +0100)]
hwdb: Add accel mount settings for Asus T200TA 2-in-1 (#7810)
Add accel mount settings for the INVN6500 accelerometer found in
Asus T200TA 2-in-1 devices to 60-sensor.hwdb.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 14:25:07 +0000 (15:25 +0100)]
Merge pull request #7767 from poettering/fork-wait
A variety of smaller improvements all over the place
Lennart Poettering [Thu, 4 Jan 2018 14:20:29 +0000 (15:20 +0100)]
Merge pull request #7805 from keszybz/coverity-prep
Two small workarounds to help coverity
Lennart Poettering [Thu, 4 Jan 2018 12:52:50 +0000 (13:52 +0100)]
NEWS: add in a missing change back from 229 (#7804)
See:
https://lists.freedesktop.org/archives/systemd-devel/2017-July/039255.html
http://fromthecodefront.blogspot.de/2017/07/systemd-pitfalls.html
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 08:45:23 +0000 (09:45 +0100)]
coverity: don't use (void)0 under coverity
I'm not sure why this is needed, but apparrently coverity doesn't like
(void)0. With this change, coverity can (almost) build systemd:
CFLAGS='-D_Float128="long double"' meson cov-build -Dman=false && \
CCACHE_DISABLE=1 COVERITY_UNSUPPORTED=1 cov-build --dir cov-int ninja -C cov-build
Patch originially by Marek Cermak <macermak@redhat.com>.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 12:27:51 +0000 (13:27 +0100)]
test-routing-policy-rule: split out fd assignment from assert_se
It's ugly that parentheses need to be used. Let's just split it out.
Incidentally, this will make coverity happy, because it doesn't grok
assert_se().
Lennart Poettering [Sat, 30 Dec 2017 14:21:12 +0000 (15:21 +0100)]
update TODO
Lennart Poettering [Sat, 30 Dec 2017 14:44:29 +0000 (15:44 +0100)]
fileio: minor tweak to executable_is_script()
If read_line() returns ENOBFUS this means the line was overly long. When
we use this for checking whether an executable is a script, then this
shouldn't be propagated as-is, but simply as "this is not a script".
Lennart Poettering [Sat, 30 Dec 2017 14:42:03 +0000 (15:42 +0100)]
fileio: tweak write_string_stream_ts() to write out trailing \n in one go even if buffering is off
This tweaks write_string_stream_ts() in one minor way: when stdio
buffering has been turned off, let's append the newline we shall append
to the buffer we write ourselves so that the kernel only gets one
syscall for the result. When buffering is enabled stdio will take care
of that anyway.
Follow-up for #7750.
Lennart Poettering [Sat, 30 Dec 2017 14:20:38 +0000 (15:20 +0100)]
sd-bus: port one use of SO_PEERCRED by getpeercred()
Lennart Poettering [Sat, 30 Dec 2017 14:19:53 +0000 (15:19 +0100)]
sd-bus: let's use mfree() where we can
Lennart Poettering [Sat, 30 Dec 2017 14:19:15 +0000 (15:19 +0100)]
sd-bus: use SO_PEERGROUPS when available to identify groups of peer
Lennart Poettering [Sat, 30 Dec 2017 14:17:39 +0000 (15:17 +0100)]
journald: introduce new uid_for_system_journal() helper
We use the same check at two places, let's add a tiny helper function
for it, since it's not entirely trivialy, and we changes this before
multiple times, and it's a good thing if we can change it at one place
only instead of multiple.
Lennart Poettering [Sat, 30 Dec 2017 14:15:44 +0000 (15:15 +0100)]
socket-util: slight rework of getpeersec()
Let's call getsockopt() in a loop, so that we can deal correctly with
the label changing while we are trying to read it.
(also, while we are at it, let's make sure that there's always one
trailing NUL byte at the end of the buffer, after all SO_PEERSEC has
zero documentation, and multiple implementing backends, hence let's
better be safe than sorry)
Lennart Poettering [Sat, 30 Dec 2017 14:15:03 +0000 (15:15 +0100)]
tree-wide: use {pid,uid,gid}_is_valid() where appropriate
Also, drop UID/GID validity checks from getpeercred() as the kernel will
never pass us invalid UID/GID on userns, but the overflow UID/GID
instead. Add a comment about this.
Lennart Poettering [Sat, 30 Dec 2017 13:07:33 +0000 (14:07 +0100)]
calenderspec: when normalizing, flush out UTC timezone
Lennart Poettering [Sat, 30 Dec 2017 13:05:41 +0000 (14:05 +0100)]
user-util: minor updates of in_gid()
Let's use newa() and use the right type for storing sysconf() return
values.
Lennart Poettering [Sat, 30 Dec 2017 13:02:36 +0000 (14:02 +0100)]
socket-util: add new getpeergroups() call
It's a wrapper around the new SO_PEERGROUPS sockopt, similar in style as
getpeersec() and getpeercred().
Lennart Poettering [Fri, 29 Dec 2017 20:21:54 +0000 (21:21 +0100)]
tree-wide: in all threads we fork off in library code, block all signals
This ensures that in all threads we fork off in the background in our
code we mask out all signals, so that our thread won't end up getting
signals delivered the main process should be getting.
We always set the signal mask before forking off the thread, so that the
thread has the right mask set from its earliest existance on.
Lennart Poettering [Fri, 29 Dec 2017 17:52:20 +0000 (18:52 +0100)]
process-util: add new FORK_NEW_MOUNTNS flag to safe_fork()
That way we can move one more code location to use safe_fork()
Lennart Poettering [Fri, 29 Dec 2017 17:14:37 +0000 (18:14 +0100)]
pager: let's move static variables up, to the rest of them
let's keep static variables together, and before the function
definitions.
Lennart Poettering [Fri, 29 Dec 2017 17:13:38 +0000 (18:13 +0100)]
pager,agent: insist that we are called from the main thread
We maintain static process-wide variables in these subsystems without
locking, hence let's refuse operation unless we are called from the main
thread (which we do anyway) just as a safety precaution.
Lennart Poettering [Fri, 29 Dec 2017 17:12:30 +0000 (18:12 +0100)]
tree-wide: use EXIT_SUCCESS when comparing child process exit statuses
When we check the exit status of a subprocess, let's compare it with
EXIT_SUCCESS rather than 0 when looking for success.
This clarifies in code what kind of variable we are looking at and what
we are doing.
Lennart Poettering [Fri, 29 Dec 2017 17:09:16 +0000 (18:09 +0100)]
tree-wide: unify the process name we pass to wait_for_terminate_and_check() with the one we pass to safe_fork()
Lennart Poettering [Fri, 29 Dec 2017 17:07:00 +0000 (18:07 +0100)]
tree-wide: make use of wait_for_terminate_and_check() at various places
Using wait_for_terminate_and_check() instead of wait_for_terminate()
let's us simplify, shorten and unify the return value checking and
logging of waitid(). Hence, let's use it all over the place.
Lennart Poettering [Fri, 29 Dec 2017 17:01:37 +0000 (18:01 +0100)]
process-spec: add another flag FORK_WAIT to safe_fork()
This new flag will cause safe_fork() to wait for the forked off child
before returning. This allows us to unify a number of cases where we
immediately wait on the forked off child, witout running any code in the
parent after the fork, and without direct interest in the precise exit
status of the process, except recgonizing EXIT_SUCCESS vs everything
else.
Lennart Poettering [Fri, 29 Dec 2017 16:11:49 +0000 (17:11 +0100)]
exec-util: drop redundant log message in do_spawn()
safe_fork() logs that anyway, hence no need to do this twice.
Lennart Poettering [Wed, 27 Dec 2017 23:51:19 +0000 (00:51 +0100)]
process-util: rework wait_for_terminate_and_warn() to take a flags parameter
This renames wait_for_terminate_and_warn() to
wait_for_terminate_and_check(), and adds a flags parameter, that
controls how much to log: there's one flag that means we log about
abnormal stuff, and another one that controls whether we log about
non-zero exit codes. Finally, there's a shortcut flag value for logging
in both cases, as that's what we usually use.
All callers are accordingly updated. At three occasions duplicate logging
is removed, i.e. where the old function was called but logged in the
caller, too.
Lennart Poettering [Wed, 27 Dec 2017 20:49:19 +0000 (21:49 +0100)]
process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN logging
Lennart Poettering [Fri, 29 Dec 2017 15:45:04 +0000 (16:45 +0100)]
raw-clone: beef up raw_clone() wrapper a bit
First of all, let's return pid_t, which appears to be the correct type
given that we return PIDs, and it#s what fork() uses too.
Most importantly though, flush out our PID cache, so that the call
becomes compatible with our getpid_cached() logic.
Lennart Poettering [Fri, 29 Dec 2017 11:16:05 +0000 (12:16 +0100)]
vconsole-setup: add some void casts
Lennart Poettering [Thu, 4 Jan 2018 12:24:40 +0000 (13:24 +0100)]
ip-address-access: let's exit the loop after invalidating our entry a (#7803)
CID#1382967
Mike Gilbert [Thu, 4 Jan 2018 12:14:20 +0000 (07:14 -0500)]
meson: don't search PATH for telinit (#7770)
On a typical system running systemd, the telinit in PATH is very likely to be a symlink
to systemctl. Setting TELINIT to this may result in an infinite recursion if telinit is called
and sd_booted() == 0. This may commonly occur in a chroot environment.
Bug: https://bugs.gentoo.org/642724
[zj:
The path was originally hardcoded as "/lib/upstart/telinit", but was made configurable without
changing the default in
4ad61fd1806dde23d2c99043b4bed91a196d2c82. Then the default was
changed to `/lib/sysvinit/telinit` in
abaaabf40a9891014ed4c402d7beb5a67ac256b1. Then it
started being autodetected when meson support was added in
5c23128daba7236a6080383b2a5649033cfef85c. This patch restores the behaviour that was
implemented in configure.ac at the time of its removal.]
Lennart Poettering [Thu, 4 Jan 2018 11:55:21 +0000 (12:55 +0100)]
main: don't bother with the return value of invoke_mainloop() (#7802)
We don't use the return value, and we don't have to, as the call already
initializes &ret, which is the one we return as exit code from the
process.
CID#1384230
Lennart Poettering [Thu, 4 Jan 2018 11:38:27 +0000 (12:38 +0100)]
Merge pull request #7801 from keszybz/docs-and-coverity
Docs and coverity
Shawn Landden [Thu, 4 Jan 2018 11:37:15 +0000 (03:37 -0800)]
fix machinectl shell (in machined) (#7785)
4c253ed broke machined
$machinectl shell arch
Failed to get shell PTY: Input/output error
Closes: #7779
v2: do not drop DEATHSIG flag
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:29:36 +0000 (11:29 +0100)]
core: fix mac_selinux_setup return value check
Introduced in
74da609f0d0f9112047dd746188469df3692ad4a. CID #1384210.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:19:55 +0000 (11:19 +0100)]
core: double free in bus_timer_set_transient_property
Introduced in
3e3c5a4571d. CID #1384233.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:12:57 +0000 (11:12 +0100)]
run: double free
Introduced in
f2b9f2c83e5b4035b22eb2f610531fce275bf55f. CID #1384218.
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:11:16 +0000 (11:11 +0100)]
test-sizeof: also add uid_t
We had gid_t, and pid_t, but not uid_t. Add for completeness.
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jan 2018 14:57:11 +0000 (15:57 +0100)]
man: drop --arch from debootstrap invocation
Nowadays people use systemd on many different architectures, so we
shouldn't presuppose that they are using amd64. debootstrap defaults
to the native architecture and this should be good enough.
Patrik Flykt [Thu, 4 Jan 2018 10:02:52 +0000 (12:02 +0200)]
dhcp6: Fix DHCPv6 client file descriptor and event handling (#7796)
Close DHCPv6 client socket file descriptor when
sd_dhcp6_client_stop() is called and not when client_reset() is
called. If left in client_reset(), any internal temporary stopping
of the DHCPv6 client with client_stop() will call client_reset()
after which the DHCPv6 client will not be able to receive any further
DHCPv6 messages.
Similarly, client_start() needs to enable events for the DHCPv6
socket file descriptor since a call to client_stop() will call
client_reset() which will remove it from the main loop. Events should
be turned off when no DHCPv6 messages are expected.
George G [Thu, 4 Jan 2018 07:53:44 +0000 (07:53 +0000)]
README: EXT4_POSIX_ACL -> EXT4_FS_POSIX_ACL (#7799)
EXT4_POSIX_ACL doesn't exist.
Lennart Poettering [Wed, 3 Jan 2018 17:43:14 +0000 (18:43 +0100)]
Merge pull request #7793 from rojkov/fix-6456
resolved: fix refcounting DnsScope's conflict_queue
Lennart Poettering [Wed, 3 Jan 2018 17:41:32 +0000 (18:41 +0100)]
Merge pull request #7759 from yuwata/dbus-api
DBus-API: add more options in transient units
Lennart Poettering [Wed, 3 Jan 2018 17:37:00 +0000 (18:37 +0100)]
Merge pull request #7705 from keszybz/redo-linking
Redo linking
Yu Watanabe [Sat, 30 Dec 2017 09:38:26 +0000 (18:38 +0900)]
execute: make "runtime" argument const in exec_needs_mount_namespace()
The argument can be const, then let's make so.
Yu Watanabe [Wed, 3 Jan 2018 15:20:44 +0000 (00:20 +0900)]
core: RuntimeDirectory= does not request new mount namespace
Now RuntimeDirectory= does not create 'private' directory.
Thus, it is not neccessary to request new mount namespace.
Follow-up for
8092a48cc1d1fb20b66371576754df831d30a43b.
Yu Watanabe [Wed, 3 Jan 2018 15:16:53 +0000 (00:16 +0900)]
Revert "core/execute: RuntimeDirectory= or friends requires mount namespace"
This reverts commit
652bb2637aee54e3503a22d2928a929ecd7a84b3.
Fixes #7761.
Paul Cercueil [Wed, 3 Jan 2018 14:54:06 +0000 (15:54 +0100)]
hwdb: Add accelerometer orientation entry for Teclast X98 Plus II tablet (#7766)
Boucman [Wed, 3 Jan 2018 14:52:13 +0000 (15:52 +0100)]
fix systemd-analyze time when default.target is not reached (#7764)
Also, better error messages.
Dmitry Rozhkov [Wed, 3 Jan 2018 13:00:27 +0000 (15:00 +0200)]
resolved: use DNS_ANSWER_FOREACH instead of for
Dmitry Rozhkov [Wed, 3 Jan 2018 12:42:13 +0000 (14:42 +0200)]
resolved: skip conflict notifications for DNS-SD PTR RRs
Enumerating DNS-SD PTR resource records are a special case and
are supposed to have non-unique keys pointing to services of the
same type running on different hosts. There's no need for them
to be checked for conflicts.
Thus don't check for conflicts such RRs.
Dmitry Rozhkov [Wed, 3 Jan 2018 12:26:53 +0000 (14:26 +0200)]
resolved: fix refcounting DnsScope's conflict_queue
Refcounting for a RR's key is done separately from refcounting
for the RR itself, but in dns_scope_notify_conflict() we don't
do that. This may lead to a situation when a RR key put in the
conflict_queue hash as a value's key gets freed upon
cache reduction when it's still referenced by the hash.
Thus increase refcount for the key when putting it into the hash
and unreference it upon removing from the hash.
Closes #6456
Zbigniew Jędrzejewski-Szmek [Wed, 20 Dec 2017 08:12:08 +0000 (09:12 +0100)]
meson: add a single .h file to shared libs with no sources
Otherwise stuff doesn't build on old Ubuntu with meson-0.42.1-1~xenial.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 21:46:01 +0000 (22:46 +0100)]
meson: use a convenience lib for shared resolve files
This reduces the man=false meson target count from 1281 to 1253.
--
A fully scientific test:
git grep _sources, :/*.build|cut -d: -f2|tr -d ' '|sort|uniq -c
reveals that libudev_sources is the only source list now reused twice. There's
some ugly circular dependency between libudev and libshared, and anyway I'm not
sure if we don't want to use different compilation options (LOG_REALM_…) in
those two cases, so I'm leaving that alone for now.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 19:54:46 +0000 (20:54 +0100)]
meson: rename libudev_internal to libudev_static and link into libudev
This reduces the meson man=false target count to 1281.
v2:
- link test-engine with libshared instead of libsystemd_static
Previous version built fine on F27, but fails on F26 with the following error:
/usr/bin/ld: /tmp/ccr8HRGw.ltrans6.ltrans.o: undefined reference to symbol '__start_BUS_ERROR_MAP@@SD_SHARED'
/home/zbyszek/fedora/systemd/systemd-
9d5aae75c64f5583a110f03b94816aacc03bbf4d/x86_64-redhat-linux-gnu/src/shared/libsystemd-shared-236.so: error adding symbols: DSO missing from command line
v3:
- add libudev_basic
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:38:43 +0000 (19:38 +0100)]
meson: use a convenience lib for journal user sources
Instead of compiling those files twice, once for libsystemd and once for
libshared, compile once as a static archive and then link into both.
This reduce the meson target for man=no compile to 1291.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:14:03 +0000 (19:14 +0100)]
meson: link libsystemd_static in libshared instead of recompiling
This is similar to the great-grandpa commit. This time the number
of meson targets compilation without man is reduced from 1347 to 1302.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:06:56 +0000 (19:06 +0100)]
Move gcrypt-util to basic/
We were including gcrypt-util.[ch] by hand in the few places where it
was used. Create a convenience library to avoid compiling the same
files multiple times.
v2:
- use a separate static library instead of mergin into libbasic
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 13:19:46 +0000 (14:19 +0100)]
meson: link libbasic and libshared_static into libshared
gcrypt_util_sources had to be moved because otherwise they appeared twice
in libshared.so halfproducts, causing an error.
-fvisibility=default is added to libbasic, libshared_static so that the symbols
appear properly in the exported symbol list in libshared.
The advantage is that files are not compiled twice. When configured with -Dman=false,
the ninja target list is reduced from 1588 to 1347 targets. The difference in compilation
time is small (<10%). I think this is because of -O0 and ccache and multiple cores, and
in different settings the compilation time could be reduced. The main advantage is that
errors and warnings are not reported twice.
Yu Watanabe [Tue, 2 Jan 2018 17:30:16 +0000 (02:30 +0900)]
dbus-cgroup: simplify bus_cgroup_set_property()
Yu Watanabe [Tue, 2 Jan 2018 17:28:17 +0000 (02:28 +0900)]
dbus-cgroup: add missing space
Yu Watanabe [Fri, 29 Dec 2017 14:05:37 +0000 (23:05 +0900)]
doc: update TRANSIENT-SETTINGS.md
Yu Watanabe [Mon, 1 Jan 2018 17:11:26 +0000 (02:11 +0900)]
bus-unit-util: support more options set to transient unit
Yu Watanabe [Mon, 1 Jan 2018 15:50:19 +0000 (00:50 +0900)]
bus-unit-util: use struct __useless_struct_to_allow_trailing_semicolon__ in DEFINE_BUS_APPEND_PARSE{,_PTR} macro
Yu Watanabe [Mon, 1 Jan 2018 17:25:57 +0000 (02:25 +0900)]
dbus-path: add Paths= option to set path specs in transient path unit
Yu Watanabe [Tue, 2 Jan 2018 17:32:10 +0000 (02:32 +0900)]
dbus-service: expose *ExitStatus= settings on bus
Mike Gilbert [Sat, 30 Dec 2017 17:48:20 +0000 (12:48 -0500)]
basic: detect_vm_cpuid: fix hypervisor detection
The __get_cpuid() function only calls __cpuid() if __get_cpuid_max()
returns a value that is less than or equal to the leaf value.
In QEMU/KVM, I found that the special hypervisor leaf value (0x40000000U)
is always larger than the value retured by __get_cpuid_max().
Avoid this problem by calling the __cpuid() macro directly once we have
checked the hypervisor bit from leaf 1.
Fixes:
d31b0033b7743393562a2e9d3c1e74afea981c13
Yu Watanabe [Mon, 1 Jan 2018 16:40:06 +0000 (01:40 +0900)]
dbus-service: support more options in transient service unit
Yu Watanabe [Mon, 1 Jan 2018 17:25:04 +0000 (02:25 +0900)]
dbus-socket: simplify bus_socket_set_transient_property()
Yu Watanabe [Mon, 1 Jan 2018 15:55:44 +0000 (00:55 +0900)]
dbus-execute: simplify bus_exec_context_set_transient_property()
Yu Watanabe [Fri, 29 Dec 2017 08:23:25 +0000 (17:23 +0900)]
core: rename bus_exec_command_set_transient_property() to bus_set_transient_exec_command()
Yu Watanabe [Mon, 1 Jan 2018 15:26:34 +0000 (00:26 +0900)]
dbus-unit: support more options in transient units
Yu Watanabe [Fri, 29 Dec 2017 08:13:23 +0000 (17:13 +0900)]
core: rename dbus property StartLimitIntervalSec= to StartLimitIntervalUSec=
StartLimitIntervalSec= and DefaultStartLimitIntervalSec= are the
last options whose suffix is 'Sec' instead of 'USec'.
All the other option has suffix 'USec'. So, let's rename them.
Yu Watanabe [Fri, 29 Dec 2017 08:11:42 +0000 (17:11 +0900)]
nsflags: add namespace_flag_to_string_many_with_check()
The function will be used in later commits.
Yu Watanabe [Fri, 29 Dec 2017 08:09:53 +0000 (17:09 +0900)]
dbus-timer: add TimersMonotonic= and TimersCalendar= to set timer in transient timer unit
This also obsoletes OnActiveSec= or their friends
Yu Watanabe [Fri, 29 Dec 2017 08:08:22 +0000 (17:08 +0900)]
dbus-scope: simplify bus_scope_set_transient_property()