Michael Olbrich [Tue, 14 Apr 2015 20:01:48 +0000 (22:01 +0200)]
automount: add expire support
Kay Sievers [Tue, 21 Apr 2015 17:47:00 +0000 (19:47 +0200)]
build-sys: efi - use $EFI_LIB_DIR
https://bugs.freedesktop.org/show_bug.cgi?id=89982
Kay Sievers [Tue, 21 Apr 2015 17:44:27 +0000 (19:44 +0200)]
build-sys: add missing file
Ronny Chevalier [Tue, 21 Apr 2015 17:27:59 +0000 (19:27 +0200)]
test: test-path and test-execute only need units in test/
Kay Sievers [Tue, 21 Apr 2015 17:21:56 +0000 (19:21 +0200)]
delete unused LICENSE.MIT
Lennart Poettering [Tue, 21 Apr 2015 16:08:09 +0000 (18:08 +0200)]
random-seed: minor cleanups, in particular when it comes to logging
Lennart Poettering [Tue, 21 Apr 2015 16:05:44 +0000 (18:05 +0200)]
tree-wide: get rid of more strerror() calls
Lennart Poettering [Tue, 21 Apr 2015 15:43:31 +0000 (17:43 +0200)]
networkd-fdb: indentation/whitespace fixes
Lennart Poettering [Tue, 21 Apr 2015 15:40:18 +0000 (17:40 +0200)]
networkd: improve how networkd logs things
This makes adds a couple of fixes:
- Introduces log_netdev_error_errno() and friends, which takes an error
number, and matches what log_link_error_errno() and friends do.
- Replaces a lof ot strerror() usage with log_netdev_error_errno(),
log_link_error_errno() and log_erro_errno()
- Uppercases the first character of many log messages, after all this is
supposed to be english language
- Drops manual negating of error codes before passing them to log
functions, the log functions all do that internally anyway.
Some other minor fixes.
Behaviour should not change really.
Lennart Poettering [Tue, 21 Apr 2015 15:28:16 +0000 (17:28 +0200)]
tmpfiles: make /home and /var btrfs subvolumes by default when booted up with them missing
This way the root subvolume can be left read-only easily, and variable
and user data writable with explicit quota set.
Lennart Poettering [Tue, 21 Apr 2015 15:26:56 +0000 (17:26 +0200)]
tmpfiles: there's no systemd-forbid-user-logins.service service
Lennart Poettering [Tue, 21 Apr 2015 15:26:04 +0000 (17:26 +0200)]
log: move log_syntax() into src/shared/log.c, and make it more similar to the other log functions
Lennart Poettering [Tue, 21 Apr 2015 11:21:44 +0000 (13:21 +0200)]
udevadm: enclose invocation of unlinkat() with a (void) cast
Let's make Coverity happy about this one.
Tom Gundersen [Tue, 21 Apr 2015 12:41:13 +0000 (14:41 +0200)]
sd-device: set_syspath - return ENODEV when passed something that is not a device
Susant Sahani [Tue, 21 Apr 2015 08:04:05 +0000 (13:34 +0530)]
networkd man: fix man and config name.
Rename bond confs and man as well.
[tomegun: dropped a stray comma]
Benjamin Tissoires [Mon, 20 Apr 2015 22:01:53 +0000 (18:01 -0400)]
hwdb: add Chromebook pixel (2015) resolution fix
The atmel driver sets a default resolution of 20 for each touchpads it
creates. On this model, 10 is more appropriate.
The resolution is not set for the touchscreen by the kernel, so match
the name to both touchpad and touchscreen.
Benjamin Tissoires [Mon, 20 Apr 2015 22:01:52 +0000 (18:01 -0400)]
hwdb: add evdev entry for the Lenovo X230 series touchpad
The Lenovo X230 advertize a vertical resolution of 136, which gives a true
size of 31 mm. The actual physical size of the touchpad is 40 mm, so
override the resolution to 100.
Hans de Goede [Fri, 17 Apr 2015 14:48:09 +0000 (16:48 +0200)]
hwdb: Add entries for the pointingstick on 2 Dell Latitudes
The pointingstick of the Dell Latitude E6400 is somewhat slow by default,
whereas the pointingstick of the Dell Latitude D620 is much too fast by
default, set POINTINGSTICK_CONST_ACCEL for both of them to adjust for this.
Hans de Goede [Fri, 17 Apr 2015 14:48:08 +0000 (16:48 +0200)]
hwdb: Add entries for the trackpoint on 2 Thinkpads
Lenovo has changed the sensitivity of the trackpoint on the x240 / T440s / T540
generation of Thinkpads, making them somewhat insensitive by default, add a
hwdb entry to tweak the sensitivity setting.
The ThinkPad X200s is way way too slow by default and unless you push the
trackpoint quite hard only sends delta events in the 1-2 range, tweak the
sensitivity to make it send a wider range of deltas and apply a const accel
factor to make it have a more reasonable speed by default.
Hans de Goede [Fri, 17 Apr 2015 14:48:07 +0000 (16:48 +0200)]
udev: keyboard-builtin: Add support for setting IBM trackpoint sensitivity
IBM / Lenovo trackpoints allow specifying a sensitivity setting through a
ps/2 command, which changes the range of the deltas sent when using the
trackpoint.
On some models with normal usage only deltas of 1 or 2 are send, resulting in
there only being 2 mouse cursor movement speeds, rather than the expected fluid
scale. Changing the sensitivity to a higher level than the bootup default fixes
this.
This commit adds support for setting a POINTINGSTICK_SENSITIVITY value
in hwdb to allow changing the sensitivity on boot through udev / hwdb.
Hans de Goede [Fri, 17 Apr 2015 14:48:06 +0000 (16:48 +0200)]
udev: Add hwdb file for setting pointingstick properties
There is quite a wide spread in the delta events generated by pointingsticks,
some generate deltas of 1-2 under normal use, while others generate deltas
from 1-20.
This commit adds a hwdb file which allows specifying a per model
POINTINGSTICK_CONST_ACCEL value which can be used by the userspace input stack
to normalize the deltas so that all pointingsticks get the same feeling ootb.
The hwdb matching re-uses the existing 60-evdev.rules.
Lubomir Rintel [Mon, 13 Apr 2015 17:46:59 +0000 (19:46 +0200)]
importd: add CAP_DAC_OVERRIDE capability
Fedora's filesystem package ships /usr/bin (and other directories) which are
not writable by its owner. machinectl pull-dkr (and possibly others) are not
able to extract those:
14182 mkdirat(3, "usr", 0700) = 0
14182 mkdirat(3, "usr/bin", 0500) = 0
14182 openat(3, "usr/bin/[", O_WRONLY|O_CREAT|O_EXCL|O_NOCTTY|O_NONBLOCK|O_CLOEXEC, 0700) = -1 EACCES (Permission denied)
...
Lennart Poettering [Tue, 21 Apr 2015 00:21:01 +0000 (02:21 +0200)]
service: transition through SIGKILL states only when SIGKILL is enabled
If there's no remaining process to kill, skip the SIGKILL states if
SIGKILL is disabled.
Effectively this doesn't change much since if there's nothing to kill
with SIGTERM or SIGABRT then there's also nothing to kill with SIGKILL.
However, this avoids confusion with the state engine jumping through
SIGKILL states for no reason...
Lennart Poettering [Tue, 21 Apr 2015 00:20:15 +0000 (02:20 +0200)]
service: timeout on SIGABRT should also be considered an error to remember
Lennart Poettering [Tue, 21 Apr 2015 00:19:58 +0000 (02:19 +0200)]
service: make more use of IN_SET() macro
Lennart Poettering [Tue, 21 Apr 2015 00:18:31 +0000 (02:18 +0200)]
service: list states always in the same order
Lennart Poettering [Tue, 21 Apr 2015 00:17:01 +0000 (02:17 +0200)]
service: make kill operation mapping explicit
Lennart Poettering [Mon, 20 Apr 2015 23:26:59 +0000 (01:26 +0200)]
networkd: fix confusion between log_netdev_error() but log_warning_netdev()
We should always name the object first, the level second, like
everywhere else in the sources.
Lennart Poettering [Mon, 20 Apr 2015 23:10:19 +0000 (01:10 +0200)]
tmpfiles: consider an argument of "-" as non-specified
Lennart Poettering [Mon, 20 Apr 2015 22:58:08 +0000 (00:58 +0200)]
sd-bus: when augmenting creds, remember which ones were augmented
Also, when we do permissions checks using creds, verify that we don't do
so based on augmented creds, as extra safety check.
Lennart Poettering [Mon, 20 Apr 2015 22:53:43 +0000 (00:53 +0200)]
sd-bus: augmenting cgroups-based creds when we have the cgroup path already is free
Lennart Poettering [Mon, 20 Apr 2015 22:52:24 +0000 (00:52 +0200)]
sd-bus: when augmenting creds, don't override any creds in any case
Let's better be safe than sorry.
Lennart Poettering [Mon, 20 Apr 2015 22:50:43 +0000 (00:50 +0200)]
sd-bus: when copying creds objects, make sure we copy even the implicit well known names
Lennart Poettering [Mon, 20 Apr 2015 18:57:04 +0000 (20:57 +0200)]
dhcp6: remove unnecessary if check
Lennart Poettering [Mon, 20 Apr 2015 18:56:44 +0000 (20:56 +0200)]
update TODO
Lennart Poettering [Mon, 20 Apr 2015 18:56:17 +0000 (20:56 +0200)]
CODING_STYLE: document how destructors should work
Susant Sahani [Mon, 9 Mar 2015 09:58:29 +0000 (15:28 +0530)]
networkd: Add support for bond option.
This patch adds configurational support for bond option.
Test conf:
bond.netdev
---
[NetDev]
Name=bond1
Kind=bond
[Bond]
ArpAllTargets=all
PrimaryReselect=better
ArpIntervalSec=10s
ArpIpTargets= 192.168.8.102 192.168.8.101 192.168.8.102
---
$cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 10000
ARP IP target/s (n.n.n.n form): 192.168.8.100, 192.168.8.101, 192.168.8.102
Susant Sahani [Thu, 5 Mar 2015 16:32:47 +0000 (22:02 +0530)]
networkd vxlan: Add support for enabling UDP checksums
Add UDPCheckSum option to enable transmitting UDP checksums when doing
VXLAN/IPv4. Add UDP6ZeroChecksumRx, and UDP6ZeroChecksumTx
options to enable sending zero checksums and receiving zero
checksums in VXLAN/IPv6
[tomegun: rebase manpage due to whitespace changes]
Nir Soffer [Sun, 19 Apr 2015 00:41:26 +0000 (03:41 +0300)]
udev: settle should return immediately when timeout is 0
udevadm manual says:
A value of 0 will check if the queue is empty and always return
immediately.
However, currently we ignore the deadline if the value is 0, and wait
without any limit.
Zero timeout behaved according to the documentation until commit
ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it
seems that the behavior change was unintended.
This patch restores the documented behavior.
Raul Gutierrez S [Mon, 20 Apr 2015 05:27:45 +0000 (22:27 -0700)]
util: fix typo
Martin Pitt [Sat, 18 Apr 2015 21:38:13 +0000 (22:38 +0100)]
exit-status: Fix "NOTINSSTALLED" typo
Martin Pitt [Thu, 16 Apr 2015 11:44:07 +0000 (06:44 -0500)]
cryptsetup: Implement offset and skip options
These are useful for plain devices as they don't have any metadata by
themselves. Instead of using an unreliable hardcoded device name in crypttab
you can then put static metadata at the start of the partition for a stable
UUID or label.
https://bugs.freedesktop.org/show_bug.cgi?id=87717
https://bugs.debian.org/751707
https://launchpad.net/bugs/953875
David Herrmann [Fri, 17 Apr 2015 12:06:31 +0000 (14:06 +0200)]
sd-device: simplify enumerator hacks
Boolean arithmetic is great, use it!
if (a && !b)
return 1;
if (!a && b)
return -1,
is equivalent to
if (a != b)
return a - b;
Furthermore:
r = false;
if (condition)
r = true;
is equivalent to:
r = condition;
Tom Gundersen [Fri, 17 Apr 2015 12:53:02 +0000 (14:53 +0200)]
sd-device: uniformly handle missing devices
sd_device_new_from_* now returns -ENODEV when the device does not exist, and the enumerator
silently drops these errors as missing devices is exepected.
Tom Gundersen [Fri, 17 Apr 2015 12:11:00 +0000 (14:11 +0200)]
sd-device: enumerator - match only on initialized devices by default
It is still possible to include uninitialized ones, but now that is opt-in. In most
cases people only want initialized devices. Exception is if you want to work without
udev running.
Suggested by David Herrmann.
Tom Gundersen [Fri, 17 Apr 2015 11:50:10 +0000 (13:50 +0200)]
sd-device: enumerator - don't expose add_device()
This is rarely, if ever, used. Drop it from the new public API and only keep it for
the legacy API.
Suggested by David Herrmann.
Tom Gundersen [Tue, 14 Apr 2015 14:25:06 +0000 (16:25 +0200)]
libudev: make libudev-enumerate a thin wrapper around sd-device
Tom Gundersen [Tue, 14 Apr 2015 14:22:39 +0000 (16:22 +0200)]
sd-device: add device-enumerator library
Tom Gundersen [Fri, 10 Apr 2015 18:39:43 +0000 (20:39 +0200)]
shared: move assert_return_errno() from libudev
This should not be used for any new code, as we don't set errno in new code,
but there are several legacy users, so let's keep it in shared.
Lennart Poettering [Thu, 16 Apr 2015 15:27:51 +0000 (17:27 +0200)]
sd-bus: add more comments to the credential decision logic
Zbigniew Jędrzejewski-Szmek [Thu, 16 Apr 2015 12:10:33 +0000 (08:10 -0400)]
core: fix spurious warning about cpuacct-usage-base deserialization
The key was parsed properly, but the warning was still generated.
Zbigniew Jędrzejewski-Szmek [Wed, 15 Apr 2015 12:20:22 +0000 (08:20 -0400)]
udev-builtin-usb_id: fix inverted condition
Fix for
4beac74e69.
Thanks, Ronny!
Zbigniew Jędrzejewski-Szmek [Tue, 24 Feb 2015 01:06:00 +0000 (20:06 -0500)]
selinux: use different log priorites for log messages
When selinux calls our callback with a log message, it specifies the
type as AVC or INFO/WARNING/ERROR. The question is how to map this to
audit types and/or log priorities. SELINUX_AVC maps to AUDIT_USER_AVC
reasonably, but for the other messages we have no idea, hence we use
AUDIT_USER_AVC for everything. When not using audit logging, we can
map those selinux levels to LOG_INFO/WARNING/ERROR etc.
Also update comment which was not valid anymore in light of journald
sucking in audit logs, and was actually wrong from the beginning —
libselinux uses the callback for everything, not just avcs.
This stemmed out of https://bugzilla.redhat.com/show_bug.cgi?id=1195330,
but does not solve it.
Zbigniew Jędrzejewski-Szmek [Wed, 15 Apr 2015 01:47:20 +0000 (20:47 -0500)]
systemctl: avoid bumping NOFILE rlimit unless needed
We actually only use the journal when showing status. Move setrlimit call
so it is only called for status.
https://bugzilla.redhat.com/show_bug.cgi?id=1184712
Zbigniew Jędrzejewski-Szmek [Tue, 14 Apr 2015 16:39:40 +0000 (12:39 -0400)]
sd-device: fix typo
Zbigniew Jędrzejewski-Szmek [Mon, 6 Apr 2015 19:42:18 +0000 (15:42 -0400)]
udev-builtin-usb_id: simplification
Thomas Hindoe Paaboel Andersen [Tue, 14 Apr 2015 16:24:00 +0000 (18:24 +0200)]
test-dhcp6-client: don't unref the event twice
Thomas Hindoe Paaboel Andersen [Tue, 14 Apr 2015 16:02:15 +0000 (18:02 +0200)]
sd-dhcp6-client: unref lease when freeing the client
Tom Gundersen [Tue, 14 Apr 2015 14:55:18 +0000 (16:55 +0200)]
sd-devcie: fix typo
Tom Gundersen [Tue, 14 Apr 2015 14:05:53 +0000 (16:05 +0200)]
sd-device: fix reading of subsystem
Tom Gundersen [Tue, 14 Apr 2015 13:15:49 +0000 (15:15 +0200)]
sd-device: allow uevent files to be write-only
Lennart Poettering [Tue, 14 Apr 2015 13:48:26 +0000 (15:48 +0200)]
udev: downgrade a few warnings to debug messages
https://bugs.freedesktop.org/show_bug.cgi?id=89885
Hans de Goede [Mon, 13 Apr 2015 09:15:01 +0000 (11:15 +0200)]
input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboard
The Trust TB7300 (relabelled Waltop?) tablet has a scrollwheel which shows
up as a /dev/input/event# node all by itself. Currently input_id does not
set any ID_INPUT_FOO attr on this causing it it to not be recognized by
Xorg / libinput.
This commit fixes this by marking it with ID_INPUT_KEY.
Reported-by: Sjoerd Timmer <themba@randomdata.nl>
Hans de Goede [Mon, 13 Apr 2015 09:15:00 +0000 (11:15 +0200)]
udev: input_id: Make test_pointer / test_keys return if they've found anything
Make test_pointer / test_keys return a boolean indicating whether or not
they've set any properties on the device.
Peter Hutterer [Mon, 13 Apr 2015 23:22:50 +0000 (09:22 +1000)]
udev: input_id: whitespace fixes
Remove whitespaces before opening parentheses, mostly before test_bit.
Thomas Hindoe Paaboel Andersen [Mon, 13 Apr 2015 21:33:24 +0000 (23:33 +0200)]
test-ipv4ll: clean up the event
shuts up valgrind/sanitizers
Goffredo Baroncelli [Sun, 12 Apr 2015 18:30:28 +0000 (20:30 +0200)]
tmpfiles: Add +C attrib to the journal files directories
Add the +C file attribute (NOCOW) to the journal directories, so that
the flag is inherited automatically for new journal files created in
them. The journal write pattern is problematic on btrfs file systems as
it results in badly fragmented files when copy-on-write (COW) is used:
the performances decreases substantially over time.
To avoid this issue, this tmpfile.d snippet sets the NOCOW attribute to
the journal files directories, so newly created journal files inherit
the NCOOW attribute that disables copy-on-write.
Be aware that the NOCOW file attribute also disables btrfs checksumming
for these files, and thus prevents btrfs from rebuilding corrupted files
on a RAID filesystem.
In a single disk filesystems (or filesystems without redundancy) it is
safe to use the NOCOW flags without drawbacks, since the journal files
contain their own checksumming.
Lennart Poettering [Mon, 13 Apr 2015 13:23:42 +0000 (15:23 +0200)]
update TODO
Lennart Poettering [Mon, 13 Apr 2015 13:23:37 +0000 (15:23 +0200)]
man: slightly fewer paragraphs can help readability
Lennart Poettering [Mon, 13 Apr 2015 13:23:07 +0000 (15:23 +0200)]
man: fix examples indentation in tmpfiles.d(5)
Lennart Poettering [Mon, 13 Apr 2015 13:22:50 +0000 (15:22 +0200)]
man: add information about more lines to explanation of argument field
Lennart Poettering [Mon, 13 Apr 2015 13:18:09 +0000 (15:18 +0200)]
man: document which tmpfiles line types follow symlinks
Generally, we will not follow symlinks, except for "w".
Avoid documentation for now for fifo, device node, directory lines,
which currently follow symlinks but better shouldn't.
Lennart Poettering [Mon, 13 Apr 2015 13:16:54 +0000 (15:16 +0200)]
tmpfiles: don't follow symlinks when adjusting ACLs, fille attributes, access modes or ownership
Martin Pitt [Mon, 13 Apr 2015 11:34:14 +0000 (06:34 -0500)]
hwdb: Fix wireless switch on Dell Latitude
It does not generate a release event.
https://launchpad.net/bugs/1441849
Zbigniew Jędrzejewski-Szmek [Mon, 13 Apr 2015 02:46:37 +0000 (22:46 -0400)]
journal-gatewayd: use (void) to silence coverity
CID #996297.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Apr 2015 02:43:08 +0000 (22:43 -0400)]
journal: use (void) to silence coverity
This shouldn't really fail and anyway not much we can do about it.
CID #996292, #996294, #996295.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Apr 2015 02:41:20 +0000 (22:41 -0400)]
pam_system: use (void) to silence coverity
CID #996284.
Zbigniew Jędrzejewski-Szmek [Mon, 13 Apr 2015 01:47:58 +0000 (21:47 -0400)]
man: add link to glib in sd_event_run(3)
Piotr Drąg [Sat, 11 Apr 2015 23:45:11 +0000 (01:45 +0200)]
po: update Polish translation
https://bugs.freedesktop.org/show_bug.cgi?id=89989
Zbigniew Jędrzejewski-Szmek [Sun, 12 Apr 2015 20:05:10 +0000 (16:05 -0400)]
sysv-generator: free memory allocated for service stubs
Zbigniew Jędrzejewski-Szmek [Sun, 12 Apr 2015 20:04:51 +0000 (16:04 -0400)]
shared/hashmap: normalize whitespace
Zbigniew Jędrzejewski-Szmek [Sun, 12 Apr 2015 15:52:06 +0000 (11:52 -0400)]
sysv-generator: always log on oom
This code appears to follow the following convention:
- all errors are logged at point of origin
- oom errors abort execution, non-oom errors are logged but
execution continues.
Make sure all ooms result in a log message, and remove warning which could
not be reached. Downgrade non-fatal errors to warnings.
Zbigniew Jędrzejewski-Szmek [Sun, 12 Apr 2015 15:17:22 +0000 (11:17 -0400)]
sysv-generator: split out two nested blocks into functions
No functional change intended. Just splitting this out to make
it easier to edit in the future.
Lennart Poettering [Sun, 12 Apr 2015 18:15:08 +0000 (20:15 +0200)]
dhcp: yes, infiniband has the larger MAC address length, but let the compuler figure that out...
Lennart Poettering [Sun, 12 Apr 2015 18:01:07 +0000 (20:01 +0200)]
efi-boot-generator: need need to proceed if /boot is already a mount point
Tobias Hunger [Fri, 10 Apr 2015 23:52:50 +0000 (01:52 +0200)]
gpt-generator: Find device on a stateless system
A stateless system has a tmpfs as root file system. That obviously
does not have any block device associated with it. So try falling back
to the device of the /usr filesystem if the root filesystem fails.
Simon Farnsworth [Wed, 25 Mar 2015 17:00:09 +0000 (17:00 +0000)]
python-systemd: fix is_socket_inet to cope with ports
Just a couple of trivial oversights.
Tobias Hunger [Sat, 11 Apr 2015 00:13:31 +0000 (02:13 +0200)]
efi-boot-generator: Continue if /boot does not exist
/boot does not exist on a stateless system, so do not get
confused by that.
Zbigniew Jędrzejewski-Szmek [Sat, 11 Apr 2015 23:39:30 +0000 (19:39 -0400)]
bus-util: add articles to explanation messages
We are talking about one member of a group of things (resource limits, signals,
timeouts), without specifying which one. An indenfinite article is in order.
When we are talking about the control process, it's a specific one, so the
definite article is used.
Zbigniew Jędrzejewski-Szmek [Sat, 11 Apr 2015 16:00:27 +0000 (12:00 -0400)]
sysv-generator: free LookupPaths also on error
Followup for
7a03974a6f.
Zbigniew Jędrzejewski-Szmek [Sat, 11 Apr 2015 15:38:34 +0000 (11:38 -0400)]
udev-builtin-keyboard: make error messages more standard
- No need to add "Error, " prefix, we already have that as metadata.
- Also use double quotes for path names, as in most other places.
- Remove stray newline at end of message.
- Downgrade error messages after which we continue to warnings.
Zbigniew Jędrzejewski-Szmek [Sat, 11 Apr 2015 15:05:39 +0000 (11:05 -0400)]
rules: finish incomplete rename
Fixup for
51c0c2869845a058268d54c3111d55d0dd485704.
Zbigniew Jędrzejewski-Szmek [Fri, 10 Apr 2015 22:57:05 +0000 (18:57 -0400)]
tmpfiles: use qsort_safe
Thomas Hindoe Paaboel Andersen [Sat, 11 Apr 2015 11:45:46 +0000 (13:45 +0200)]
sysv-generator: fix mem leaks
David Herrmann [Fri, 10 Apr 2015 15:44:30 +0000 (17:44 +0200)]
bus: implement bus_path_{en,de}code_unique()
Whenever we provide a bus API that allows clients to create and manage
server-side objects, we need to provide a unique name for these objects.
There are two ways to provide them:
1) Let the server choose a name and return it as method reply.
2) Let the client pass its name of choice in the method arguments.
The first method is the easiest one to implement. However, it suffers from
a race condition: If a client creates an object asynchronously, it cannot
destroy that object until it received the method reply. It cannot know the
name of the new object, thus, it cannot destroy it. Furthermore, this
method enforces a round-trip. If the client _depends_ on the method call
to succeed (eg., it would close() the connection if it failed), the client
usually has no reason to wait for the method reply. Instead, the client
can immediately schedule further method calls on the newly created object
(in case the API guarantees in-order method-call handling).
The second method fixes both problems: The client passes an object name
with the method-call. The server uses it to create the object. Therefore,
the client can schedule object destruction even if the object-creation
hasn't finished, yet (again, requiring in-order method-call handling).
Furthermore, the client can schedule further method calls on the newly
created object, before the constructor returned.
There're two problems to solve, though:
1) Object names are usually defined via dbus object paths, which are
usually globally namespaced. Therefore, multiple clients must be able
to choose unique object names without interference.
2) If multiple libraries share the same bus connection, they must be
able to choose unique object names without interference.
The first problem is solved easily by prefixing a name with the
unique-bus-name of a connection. The server side must enforce this and
reject any other name.
The second problem is solved by providing unique suffixes from within
sd-bus. As long as sd-bus always returns a fresh new ID, if requested,
multiple libraries will never interfere. This implementation re-uses
bus->cookie as ID generator, which already provides unique IDs for each
bus connection.
This patch introduces two new helpers:
bus_path_encode_unique(sd_bus *bus,
const char *prefix,
const char *sender_id,
const char *external_id,
char **ret_path);
This creates a new object-path via the template
'/prefix/sender_id/external_id'. That is, it appends two new labels to
the given prefix. If 'sender_id' is NULL, it will use
bus->unique_name, if 'external_id' is NULL, it will allocate a fresh,
unique cookie from bus->cookie.
bus_path_decode_unique(const char *path,
const char *prefix,
char **ret_sender,
char **ret_external);
This reverses what bus_path_encode_unique() did. It parses 'path' from
the template '/prefix/sender/external' and returns both suffix-labels
in 'ret_sender' and 'ret_external'. In case the template does not
match, 0 is returned and both output arguments are set to NULL.
Otherwise, 1 is returned and the output arguments contain the decoded
labels.
Note: Client-side allocated IDs are inspired by the Wayland protocol
(which itself was inspired by X11). Wayland uses those IDs heavily
to avoid round-trips. Clients can create server-side objects and
send method calls without any round-trip and waiting for any object
IDs to be returned. But unlike Wayland, DBus uses gobally namespaced
object names. Therefore, we have to add the extra step by adding the
unique-name of the bus connection.
David Herrmann [Fri, 10 Apr 2015 15:43:04 +0000 (17:43 +0200)]
bus: implement bus_label_unescape_n()
This is like bus_label_unescape() but takes a maximum length instead of
relying on NULL-terminated strings. This is highly useful to unescape
labels that are not at the end of a path.
David Herrmann [Fri, 10 Apr 2015 09:15:12 +0000 (11:15 +0200)]
hashmap: return NULL from destructor
We _always_ return NULL from destructors to allow direct assignments to
the variable holding the object. Especially on hashmaps, which treat NULL
as empty hashmap, this is pretty neat.
Daniel Drake [Mon, 6 Apr 2015 22:03:43 +0000 (16:03 -0600)]
udevd: fix synchronization with settle when handling inotify events
udev uses inotify to implement a scheme where when the user closes
a writable device node, a change uevent is forcefully generated.
In the case of block devices, it actually requests a partition rescan.
This currently can't be synchronized with "udevadm settle", i.e. this
is not reliable in a script:
sfdisk --change-id /dev/sda 1 81
udevadm settle
mount /dev/sda1 /foo
The settle call doesn't synchronize there, so at the same time we try
to mount the device, udevd is busy removing the partition device nodes and
readding them again. The mount call often happens in that moment where the
partition node has been removed but not readded yet.
This exact issue was fixed long ago:
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=
bb38678e3ccc02bcd970ccde3d8166a40edf92d3
but that fix is no longer valid now that sequence numbers are no longer
used.
Fix this by forcing another mainloop iteration after handling inotify events
before unblocking settle. If the inotify event caused us to generate a
"change" event, we'll pick that up in the following loop iteration, before
we reach the end of the loop where we respond to settle's control message,
unblocking it.
Gavin Li [Tue, 7 Apr 2015 10:30:10 +0000 (03:30 -0700)]
hwdb: add Samsung ATIV Book 6 / 8
This adds support for the keyboard illumination keys and fixes
Fn+F1.
Marc-Antoine Perennou [Wed, 8 Apr 2015 20:33:54 +0000 (22:33 +0200)]
build: allow setting OBJCOPY