[systemd-commits] stable Branch 'v210-stable' - 97 commits - configure.ac hwdb/20-bluetooth-vendor-product.hwdb hwdb/20-OUI.hwdb hwdb/20-pci-vendor-model.hwdb hwdb/20-usb-vendor-model.hwdb hwdb/60-keyboard.hwdb Makefile.am man/daemon.xml man/journald.conf.xml man/sd_journal_print.xml man/sd-journal.xml man/systemctl.xml man/systemd-readahead-replay.service.xml man/systemd.service.xml man/systemd.slice.xml man/systemd.special.xml rules/50-udev-default.rules rules/60-keyboard.rules src/analyze src/backlight src/bootchart src/core src/cryptsetup src/fsck src/initctl src/journal src/libsystemd src/libsystemd-dhcp src/libudev src/login src/machine src/nspawn src/readahead src/reply-password src/run src/shared src/shutdownd src/socket-proxy src/systemctl src/test src/tmpfiles src/tty-ask-password-agent src/udev src/vconsole tmpfiles.d/systemd.conf units/cryptsetup-pre.target units/network-online.target units/systemd-nspawn at .service.in

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Jun 19 21:12:21 PDT 2014


 Makefile.am                                         |    7 
 configure.ac                                        |    2 
 hwdb/20-OUI.hwdb                                    |  450 ++++++
 hwdb/20-bluetooth-vendor-product.hwdb               |   93 +
 hwdb/20-pci-vendor-model.hwdb                       |  307 +++-
 hwdb/20-usb-vendor-model.hwdb                       | 1294 +++++++++++++++++++-
 hwdb/60-keyboard.hwdb                               |   21 
 man/daemon.xml                                      |    6 
 man/journald.conf.xml                               |    4 
 man/sd-journal.xml                                  |    6 
 man/sd_journal_print.xml                            |    5 
 man/systemctl.xml                                   |   12 
 man/systemd-readahead-replay.service.xml            |    2 
 man/systemd.service.xml                             |   14 
 man/systemd.slice.xml                               |    8 
 man/systemd.special.xml                             |   80 +
 rules/50-udev-default.rules                         |    2 
 rules/60-keyboard.rules                             |    2 
 src/analyze/analyze.c                               |    4 
 src/backlight/backlight.c                           |   97 +
 src/bootchart/svg.c                                 |    2 
 src/core/async.c                                    |   22 
 src/core/async.h                                    |    2 
 src/core/audit-fd.c                                 |    2 
 src/core/automount.c                                |   41 
 src/core/busname.c                                  |   14 
 src/core/cgroup.c                                   |   10 
 src/core/dbus-cgroup.c                              |   13 
 src/core/dbus.c                                     |    5 
 src/core/execute.c                                  |   58 
 src/core/ima-setup.c                                |    6 
 src/core/job.c                                      |    3 
 src/core/killall.c                                  |    2 
 src/core/load-fragment.c                            |    2 
 src/core/machine-id-setup.c                         |   52 
 src/core/macros.systemd.in                          |   20 
 src/core/main.c                                     |    2 
 src/core/manager.c                                  |   37 
 src/core/path.c                                     |    6 
 src/core/selinux-setup.c                            |  152 +-
 src/core/service.c                                  |   15 
 src/core/smack-setup.c                              |    2 
 src/core/socket.c                                   |   50 
 src/core/switch-root.c                              |   35 
 src/core/umount.c                                   |    8 
 src/core/unit.c                                     |   55 
 src/cryptsetup/cryptsetup-generator.c               |    2 
 src/cryptsetup/cryptsetup.c                         |   11 
 src/fsck/fsck.c                                     |    9 
 src/initctl/initctl.c                               |    5 
 src/journal/cat.c                                   |    9 
 src/journal/catalog.c                               |    8 
 src/journal/coredumpctl.c                           |    3 
 src/journal/journal-authenticate.c                  |    5 
 src/journal/journal-file.c                          |    4 
 src/journal/journal-send.c                          |   14 
 src/journal/journal-verify.c                        |   12 
 src/journal/journalctl.c                            |    5 
 src/journal/journald-console.c                      |    2 
 src/journal/journald-kmsg.c                         |   14 
 src/journal/journald-server.c                       |   22 
 src/journal/journald-stream.c                       |    7 
 src/journal/sd-journal.c                            |    3 
 src/journal/test-journal-flush.c                    |    7 
 src/journal/test-journal-verify.c                   |    2 
 src/journal/test-mmap-cache.c                       |    6 
 src/libsystemd-dhcp/dhcp-network.c                  |    4 
 src/libsystemd-dhcp/sd-dhcp-client.c                |   15 
 src/libsystemd/sd-bus/bus-container.c               |    6 
 src/libsystemd/sd-bus/bus-kernel.c                  |   26 
 src/libsystemd/sd-bus/bus-message.c                 |    4 
 src/libsystemd/sd-bus/bus-socket.c                  |    4 
 src/libsystemd/sd-bus/sd-bus.c                      |    4 
 src/libsystemd/sd-bus/sd-memfd.c                    |    4 
 src/libsystemd/sd-bus/test-bus-chat.c               |    2 
 src/libsystemd/sd-bus/test-bus-kernel-benchmark.c   |    2 
 src/libsystemd/sd-bus/test-bus-kernel.c             |    6 
 src/libsystemd/sd-event/sd-event.c                  |   31 
 src/libsystemd/sd-resolve/sd-resolve.c              |    3 
 src/libsystemd/sd-rtnl/sd-rtnl.c                    |    4 
 src/libudev/libudev-monitor.c                       |   18 
 src/login/inhibit.c                                 |    2 
 src/login/logind-button.c                           |    2 
 src/login/logind-core.c                             |    2 
 src/login/logind-inhibit.c                          |   12 
 src/login/logind-session.c                          |   86 -
 src/login/logind-session.h                          |    2 
 src/login/logind-user-dbus.c                        |    2 
 src/login/logind-user.c                             |   37 
 src/login/logind-user.h                             |    1 
 src/login/logind.c                                  |    6 
 src/login/org.freedesktop.login1.policy.in          |    2 
 src/login/pam-module.c                              |    4 
 src/login/sd-login.c                                |    8 
 src/login/test-inhibit.c                            |    4 
 src/machine/machine.c                               |   37 
 src/machine/machinectl.c                            |    6 
 src/nspawn/nspawn.c                                 |   45 
 src/readahead/readahead-collect.c                   |   22 
 src/readahead/readahead-common.c                    |    8 
 src/readahead/readahead-replay.c                    |   18 
 src/readahead/readahead.c                           |    2 
 src/reply-password/reply-password.c                 |    6 
 src/run/run.c                                       |    2 
 src/shared/ask-password-api.c                       |   17 
 src/shared/conf-files.c                             |   16 
 src/shared/conf-parser.c                            |    6 
 src/shared/fdset.c                                  |    2 
 src/shared/install.c                                |  259 ++--
 src/shared/label.c                                  |    4 
 src/shared/log.c                                    |   28 
 src/shared/logs-show.c                              |    8 
 src/shared/path-lookup.c                            |   12 
 src/shared/path-lookup.h                            |    8 
 src/shared/path-util.c                              |   74 -
 src/shared/spawn-polkit-agent.c                     |    4 
 src/shared/unit-name.c                              |   16 
 src/shared/util.c                                   |  134 +-
 src/shared/util.h                                   |   30 
 src/shared/virt.c                                   |   34 
 src/shared/watchdog.c                               |    3 
 src/shutdownd/shutdownd.c                           |    3 
 src/socket-proxy/socket-proxyd.c                    |   16 
 src/systemctl/systemctl.c                           |   66 -
 src/test/test-udev.c                                |    5 
 src/test/test-util.c                                |    2 
 src/tmpfiles/tmpfiles.c                             |   31 
 src/tty-ask-password-agent/tty-ask-password-agent.c |   27 
 src/udev/net/link-config.c                          |    5 
 src/udev/udev-builtin-keyboard.c                    |    2 
 src/udev/udev-event.c                               |   13 
 src/udev/udev-rules.c                               |    2 
 src/udev/udev.h                                     |    2 
 src/udev/udevadm-test.c                             |   13 
 src/udev/udevd.c                                    |    9 
 src/vconsole/vconsole-setup.c                       |    3 
 tmpfiles.d/systemd.conf                             |    4 
 units/cryptsetup-pre.target                         |   11 
 units/network-online.target                         |    1 
 units/systemd-nspawn at .service.in                    |    1 
 140 files changed, 3340 insertions(+), 1162 deletions(-)

New commits:
commit 969654dbb659c591454aaa3ae6a1569fa645b679
Author: Marcel Holtmann <marcel at holtmann.org>
Date:   Wed Jun 18 13:55:32 2014 +0200

    hwdb: Update database of Bluetooth company identifiers
    
    (cherry picked from commit 7cfa80f07e94c3e48703d145ef03a73dd6e7b983)

diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index a65c7db..377748a 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -115,7 +115,7 @@ bluetooth:v0024*
  ID_VENDOR_FROM_DATABASE=Alcatel
 
 bluetooth:v0025*
- ID_VENDOR_FROM_DATABASE=Philips Semiconductors
+ ID_VENDOR_FROM_DATABASE=NXP Semiconductors (formerly Philips Semiconductors)
 
 bluetooth:v0026*
  ID_VENDOR_FROM_DATABASE=C Technologies
@@ -427,7 +427,7 @@ bluetooth:v008B*
  ID_VENDOR_FROM_DATABASE=Topcorn Positioning Systems, LLC
 
 bluetooth:v008C*
- ID_VENDOR_FROM_DATABASE=Qualcomm Retail Solutions, Inc. (formerly Qualcomm Labs, Inc.)
+ ID_VENDOR_FROM_DATABASE=Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)
 
 bluetooth:v008D*
  ID_VENDOR_FROM_DATABASE=Zscan Software
@@ -1006,10 +1006,46 @@ bluetooth:v014C*
  ID_VENDOR_FROM_DATABASE=Mesh-Net Ltd
 
 bluetooth:v014D*
- ID_VENDOR_FROM_DATABASE=HUIZHOU DESAY SV AUTOMOTIVE CO., LTD.
+ ID_VENDOR_FROM_DATABASE=Huizhou Desay SV Automotive CO., LTD.
 
 bluetooth:v014E*
  ID_VENDOR_FROM_DATABASE=Tangerine, Inc.
 
 bluetooth:v014F*
  ID_VENDOR_FROM_DATABASE=B&W Group Ltd.
+
+bluetooth:v0150*
+ ID_VENDOR_FROM_DATABASE=Pioneer Corporation
+
+bluetooth:v0151*
+ ID_VENDOR_FROM_DATABASE=OnBeep
+
+bluetooth:v0152*
+ ID_VENDOR_FROM_DATABASE=Vernier Software & Technology
+
+bluetooth:v0153*
+ ID_VENDOR_FROM_DATABASE=ROL Ergo
+
+bluetooth:v0154*
+ ID_VENDOR_FROM_DATABASE=Pebble Technology
+
+bluetooth:v0155*
+ ID_VENDOR_FROM_DATABASE=NETATMO
+
+bluetooth:v0156*
+ ID_VENDOR_FROM_DATABASE=Accumulate AB
+
+bluetooth:v0157*
+ ID_VENDOR_FROM_DATABASE=Anhui Huami Information Technology Co., Ltd.
+
+bluetooth:v0158*
+ ID_VENDOR_FROM_DATABASE=Inmite s.r.o.
+
+bluetooth:v0159*
+ ID_VENDOR_FROM_DATABASE=ChefSteps, Inc.
+
+bluetooth:v015A*
+ ID_VENDOR_FROM_DATABASE=micus AG
+
+bluetooth:v015B*
+ ID_VENDOR_FROM_DATABASE=Biomedical Research Ltd.

commit cc1e6e5c1432bdeef730bfdfb09cc61d750b748d
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed Jun 18 03:37:32 2014 +0200

    rules: add loop-control and btrfs-control to "disk" group
    
    (cherry picked from commit 27e7c26268bd4c16edb92f2b8a8626b00c6f2dad)

diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index 0bccf67..23ca088 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -59,6 +59,8 @@ KERNEL=="pktcdvd", GROUP="cdrom"
 SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
 SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
 KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
+KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"
+KERNEL=="btrfs-control", GROUP="disk"
 KERNEL=="rawctl", GROUP="disk"
 SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"
 SUBSYSTEM=="aoe", GROUP="disk", MODE="0220"

commit 137cb035d2facdf2a70f0c915d6c018b6d900933
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 18 00:07:56 2014 +0200

    cryptsetup: introduce new cryptsetup-pre.traget unit so that services can make sure they are started before and stopped after any LUKS setup
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1097938
    (cherry picked from commit 9542239eaf481decca6c254dffb3f2b4e716545e)

diff --git a/Makefile.am b/Makefile.am
index 69cea75..d6729e5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3645,7 +3645,8 @@ systemgenerator_PROGRAMS += \
 	systemd-cryptsetup-generator
 
 dist_systemunit_DATA += \
-	units/cryptsetup.target
+	units/cryptsetup.target \
+	units/cryptsetup-pre.target
 
 systemd_cryptsetup_SOURCES = \
 	src/cryptsetup/cryptsetup.c
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
index 38b94a7..4dd7d97 100644
--- a/man/systemd.special.xml
+++ b/man/systemd.special.xml
@@ -52,6 +52,7 @@
                 <filename>bluetooth.target</filename>,
                 <filename>ctrl-alt-del.target</filename>,
                 <filename>cryptsetup.target</filename>,
+                <filename>cryptsetup-pre.target</filename>,
                 <filename>dbus.service</filename>,
                 <filename>dbus.socket</filename>,
                 <filename>default.target</filename>,
@@ -840,6 +841,27 @@
 
                 <variablelist>
                         <varlistentry>
+                                <term><filename>cryptsetup-pre.target</filename></term>
+                                <listitem>
+                                        <para>This passive target unit
+                                        may be pulled in by services
+                                        that want to run before any
+                                        encrypted block device is set
+                                        up. All encrypted block
+                                        devices are set up after this
+                                        target has been reached. Since
+                                        the shutdown order is
+                                        implicitly the reverse
+                                        start-up order between units
+                                        this target is particularly
+                                        useful to ensure that a
+                                        service is shut down only
+                                        after all encrypted block
+                                        devices are fully
+                                        stopped.</para>
+                                </listitem>
+                        </varlistentry>
+                        <varlistentry>
                                 <term><filename>local-fs-pre.target</filename></term>
                                 <listitem>
                                         <para>This target unit is
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 38c746b..8e44f3c 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -123,7 +123,7 @@ static int create_disk(
                 "DefaultDependencies=no\n"
                 "BindsTo=dev-mapper-%i.device\n"
                 "IgnoreOnIsolate=true\n"
-                "After=systemd-readahead-collect.service systemd-readahead-replay.service\n",
+                "After=systemd-readahead-collect.service systemd-readahead-replay.service cryptsetup-pre.target\n",
                 f);
 
         if (!nofail)
diff --git a/units/cryptsetup-pre.target b/units/cryptsetup-pre.target
new file mode 100644
index 0000000..6535341
--- /dev/null
+++ b/units/cryptsetup-pre.target
@@ -0,0 +1,11 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Encrypted Volumes (Pre)
+Documentation=man:systemd.special(7)
+RefuseManualStart=yes

commit 385d2ab37b1a00b513edf5c3888b91d91ad3aae3
Author: Denis Tikhomirov <dvtikhomirov at gmail.com>
Date:   Thu Jun 5 23:59:40 2014 +0400

    backlight: Do not clamp brightness for LEDs
    
    https://bugs.freedesktop.org/show_bug.cgi?id=77092
    
    On Thu, Jun 05, 2014 at 08:37:20AM +0200, Lennart Poettering wrote:
    > The patch is line-broken, please send an uncorrupted patch!
    I am very sorry, I forgot that my client limits line width. I will use
    mutt now on.
    > clamp_brightness() clamps the brightness value to the range of the
    > actual device. This is a recent addition that was added to deal with
    > driver updates where the resolution is changed. I don't think this part
    > should be dropped for LED devices. The clamp_brightness() call hence
    > should be called unconditionally, however, internally it should use a
    > different min_brightness value if something is an !backlight devices...
    Thank you for explanation, this sounds very reasonable to me. Please,
    see updated patch:
    
    (cherry picked from commit 4cd2b2cf8ca585d15ebc859701b346658262b5bb)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index e67032e..df3db2a 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -221,11 +221,13 @@ static unsigned get_max_brightness(struct udev_device *device) {
 
 /* Some systems turn the backlight all the way off at the lowest levels.
  * clamp_brightness clamps the saved brightness to at least 1 or 5% of
- * max_brightness.  This avoids preserving an unreadably dim screen, which
- * would otherwise force the user to disable state restoration. */
+ * max_brightness in case of 'backlight' subsystem. This avoids preserving
+ * an unreadably dim screen, which would otherwise force the user to
+ * disable state restoration. */
 static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) {
         int r;
         unsigned brightness, new_brightness, min_brightness;
+        const char *subsystem;
 
         r = safe_atou(*value, &brightness);
         if (r < 0) {
@@ -233,7 +235,12 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned
                 return;
         }
 
-        min_brightness = MAX(1U, max_brightness/20);
+        subsystem = udev_device_get_subsystem(device);
+        if (streq_ptr(subsystem, "backlight"))
+                min_brightness = MAX(1U, max_brightness/20);
+        else
+                min_brightness = 0;
+
         new_brightness = CLAMP(brightness, min_brightness, max_brightness);
         if (new_brightness != brightness) {
                 char *old_value = *value;

commit d4666a88938d3d671f7796ce650fa29ad47579cf
Author: Jani Nikula <jani.nikula at intel.com>
Date:   Wed May 7 12:01:01 2014 +0300

    backlight: handle saved brightness exceeding max brightness
    
    If too high a brightness value has been saved (e.g. due to kernel
    mechanism changing from one kernel version to another, or booting the
    userspace on another system), the brightness update fails and the
    process exits.
    
    Clamp saved brightness between the policy minimum introduced in
    
    commit 7b909d7407965c03caaba30daae7aee113627a83
    Author: Josh Triplett <josh at joshtriplett.org>
    Date:   Tue Mar 11 21:16:33 2014 -0700
    
        backlight: Avoid restoring brightness to an unreadably dim level
    
    and the absolute maximum.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=78200
    (cherry picked from commit 0c9d8f1d4b5018199cb5a9b57580dc1480a7f915)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 754a646..e67032e 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -225,7 +225,7 @@ static unsigned get_max_brightness(struct udev_device *device) {
  * would otherwise force the user to disable state restoration. */
 static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) {
         int r;
-        unsigned brightness, new_brightness;
+        unsigned brightness, new_brightness, min_brightness;
 
         r = safe_atou(*value, &brightness);
         if (r < 0) {
@@ -233,7 +233,8 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned
                 return;
         }
 
-        new_brightness = MAX3(brightness, 1U, max_brightness/20);
+        min_brightness = MAX(1U, max_brightness/20);
+        new_brightness = CLAMP(brightness, min_brightness, max_brightness);
         if (new_brightness != brightness) {
                 char *old_value = *value;
 
@@ -243,7 +244,11 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned
                         return;
                 }
 
-                log_debug("Saved brightness %s too low; increasing to %s.", old_value, *value);
+                log_info("Saved brightness %s %s to %s.", old_value,
+                         new_brightness > brightness ?
+                         "too low; increasing" : "too high; decreasing",
+                         *value);
+
                 free(old_value);
         }
 }

commit 45f427fe36a752104ba1cdad7f9b2ec7178f905a
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Apr 7 20:57:22 2014 -0400

    backlight: unify error messages
    
    (cherry picked from commit 938d2699d2e818bd996614e89ea3d668200ad2a8)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index ce0385b..754a646 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -24,6 +24,7 @@
 #include "fileio.h"
 #include "libudev.h"
 #include "udev-util.h"
+#include "def.h"
 
 static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) {
         struct udev_device *parent;
@@ -50,7 +51,7 @@ static struct udev_device *find_pci_or_platform_parent(struct udev_device *devic
                 if (!c)
                         return NULL;
 
-                c += strspn(c, "0123456789");
+                c += strspn(c, DIGITS);
                 if (*c == '-') {
                         /* A connector DRM device, let's ignore all but LVDS and eDP! */
 
@@ -67,7 +68,8 @@ static struct udev_device *find_pci_or_platform_parent(struct udev_device *devic
                         unsigned long class = 0;
 
                         if (safe_atolu(value, &class) < 0) {
-                                log_warning("Cannot parse PCI class %s of device %s:%s.", value, subsystem, sysname);
+                                log_warning("Cannot parse PCI class %s of device %s:%s.",
+                                            value, subsystem, sysname);
                                 return NULL;
                         }
 
@@ -175,7 +177,9 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
                 if (same_device(parent, other_parent)) {
                         /* Both have the same PCI parent, that means
                          * we are out. */
-                        log_debug("Skipping backlight device %s, since backlight device %s is on same PCI device and, takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other));
+                        log_debug("Skipping backlight device %s, since device %s is on same PCI device and takes precedence.",
+                                  udev_device_get_sysname(device),
+                                  udev_device_get_sysname(other));
                         return false;
                 }
 
@@ -184,7 +188,9 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
                         /* The other is connected to the platform bus
                          * and we are a PCI device, that also means we
                          * are out. */
-                        log_debug("Skipping backlight device %s, since backlight device %s is a platform device and takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other));
+                        log_debug("Skipping backlight device %s, since device %s is a platform device and takes precedence.",
+                                  udev_device_get_sysname(device),
+                                  udev_device_get_sysname(other));
                         return false;
                 }
         }
@@ -199,13 +205,14 @@ static unsigned get_max_brightness(struct udev_device *device) {
 
         max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
         if (!max_brightness_str) {
-                log_warning("Failed to read max_brightness attribute");
+                log_warning("Failed to read 'max_brightness' attribute");
                 return 0;
         }
 
         r = safe_atou(max_brightness_str, &max_brightness);
         if (r < 0) {
-                log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r));
+                log_warning("Failed to parse 'max_brightness' \"%s\": %s",
+                            max_brightness_str, strerror(-r));
                 return 0;
         }
 
@@ -262,7 +269,8 @@ int main(int argc, char *argv[]) {
 
         r = mkdir_p("/var/lib/systemd/backlight", 0755);
         if (r < 0) {
-                log_error("Failed to create backlight directory: %s", strerror(-r));
+                log_error("Failed to create backlight directory /var/lib/systemd/backlight: %s",
+                          strerror(-r));
                 return EXIT_FAILURE;
         }
 
@@ -274,7 +282,7 @@ int main(int argc, char *argv[]) {
 
         sysname = strchr(argv[2], ':');
         if (!sysname) {
-                log_error("Requires pair of subsystem and sysname for specifying backlight device.");
+                log_error("Requires a subsystem and sysname pair specifying a backlight device.");
                 return EXIT_FAILURE;
         }
 
@@ -368,7 +376,8 @@ int main(int argc, char *argv[]) {
 
                 r = udev_device_set_sysattr_value(device, "brightness", value);
                 if (r < 0) {
-                        log_error("Failed to write system attribute: %s", strerror(-r));
+                        log_error("Failed to write system 'brightness' attribute: %s",
+                                  strerror(-r));
                         return EXIT_FAILURE;
                 }
 
@@ -382,7 +391,7 @@ int main(int argc, char *argv[]) {
 
                 value = udev_device_get_sysattr_value(device, "brightness");
                 if (!value) {
-                        log_error("Failed to read system attribute");
+                        log_error("Failed to read system 'brightness' attribute");
                         return EXIT_FAILURE;
                 }
 

commit 555853f8ad1b1db461c45843310bc324bca394de
Author: Thomas Bächler <thomas at archlinux.org>
Date:   Thu Mar 27 23:41:59 2014 +0100

    backlight: do nothing if max_brightness is 0
    
    On virtually any newer Asus mainboard, the eeepc-wmi driver is loaded.
    It exposes a backlight device despite the lack of any physical backlight
    devices. This fake backlight device has max_brightness set to 0. Since
    the introduction of the clamp_brightness function, systemd-backlight
    tries to write '1' to brightness and fails.
    
    This patch changes systemd-backlight to exit gracefully when
    max_brightness is 0 before performing any action. This affects
    both the load and save actions.
    
    (cherry picked from commit 3cadce7d33e263ec7a6a83c00c11144930258b22)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index abf8bcf..ce0385b 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -192,30 +192,37 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
         return true;
 }
 
-/* Some systems turn the backlight all the way off at the lowest levels.
- * clamp_brightness clamps the saved brightness to at least 1 or 5% of
- * max_brightness.  This avoids preserving an unreadably dim screen, which
- * would otherwise force the user to disable state restoration. */
-static void clamp_brightness(struct udev_device *device, char **value) {
+static unsigned get_max_brightness(struct udev_device *device) {
         int r;
         const char *max_brightness_str;
-        unsigned brightness, max_brightness, new_brightness;
+        unsigned max_brightness;
 
         max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
         if (!max_brightness_str) {
-                log_warning("Failed to read max_brightness attribute; not checking saved brightness");
-                return;
+                log_warning("Failed to read max_brightness attribute");
+                return 0;
         }
 
-        r = safe_atou(*value, &brightness);
+        r = safe_atou(max_brightness_str, &max_brightness);
         if (r < 0) {
-                log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r));
-                return;
+                log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r));
+                return 0;
         }
 
-        r = safe_atou(max_brightness_str, &max_brightness);
+        return max_brightness;
+}
+
+/* Some systems turn the backlight all the way off at the lowest levels.
+ * clamp_brightness clamps the saved brightness to at least 1 or 5% of
+ * max_brightness.  This avoids preserving an unreadably dim screen, which
+ * would otherwise force the user to disable state restoration. */
+static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) {
+        int r;
+        unsigned brightness, new_brightness;
+
+        r = safe_atou(*value, &brightness);
         if (r < 0) {
-                log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r));
+                log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r));
                 return;
         }
 
@@ -239,6 +246,7 @@ int main(int argc, char *argv[]) {
         _cleanup_udev_device_unref_ struct udev_device *device = NULL;
         _cleanup_free_ char *saved = NULL, *ss = NULL, *escaped_ss = NULL, *escaped_sysname = NULL, *escaped_path_id = NULL;
         const char *sysname, *path_id;
+        unsigned max_brightness;
         int r;
 
         if (argc != 3) {
@@ -294,6 +302,14 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
+        /* If max_brightness is 0, then there is no actual backlight
+         * device. This happens on desktops with Asus mainboards
+         * that load the eeepc-wmi module.
+         */
+        max_brightness = get_max_brightness(device);
+        if (max_brightness == 0)
+                return EXIT_SUCCESS;
+
         escaped_ss = cescape(ss);
         if (!escaped_ss) {
                 log_oom();
@@ -348,7 +364,7 @@ int main(int argc, char *argv[]) {
                         return EXIT_FAILURE;
                 }
 
-                clamp_brightness(device, &value);
+                clamp_brightness(device, &value, max_brightness);
 
                 r = udev_device_set_sysattr_value(device, "brightness", value);
                 if (r < 0) {

commit 7bd1f7eab10b4b374b991da5cb378feb233ca0ca
Author: Josh Triplett <josh at joshtriplett.org>
Date:   Tue Mar 11 21:16:33 2014 -0700

    backlight: Avoid restoring brightness to an unreadably dim level
    
    Some systems turn the backlight all the way off at the lowest levels.
    Clamp saved brightness to at least 1 or 5% of max_brightness.  This
    avoids preserving an unreadably dim screen, which would otherwise force
    the user to disable state restoration.
    
    (cherry picked from commit 7b909d7407965c03caaba30daae7aee113627a83)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 81470b3..abf8bcf 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -192,6 +192,48 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
         return true;
 }
 
+/* Some systems turn the backlight all the way off at the lowest levels.
+ * clamp_brightness clamps the saved brightness to at least 1 or 5% of
+ * max_brightness.  This avoids preserving an unreadably dim screen, which
+ * would otherwise force the user to disable state restoration. */
+static void clamp_brightness(struct udev_device *device, char **value) {
+        int r;
+        const char *max_brightness_str;
+        unsigned brightness, max_brightness, new_brightness;
+
+        max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
+        if (!max_brightness_str) {
+                log_warning("Failed to read max_brightness attribute; not checking saved brightness");
+                return;
+        }
+
+        r = safe_atou(*value, &brightness);
+        if (r < 0) {
+                log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r));
+                return;
+        }
+
+        r = safe_atou(max_brightness_str, &max_brightness);
+        if (r < 0) {
+                log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r));
+                return;
+        }
+
+        new_brightness = MAX3(brightness, 1U, max_brightness/20);
+        if (new_brightness != brightness) {
+                char *old_value = *value;
+
+                r = asprintf(value, "%u", new_brightness);
+                if (r < 0) {
+                        log_oom();
+                        return;
+                }
+
+                log_debug("Saved brightness %s too low; increasing to %s.", old_value, *value);
+                free(old_value);
+        }
+}
+
 int main(int argc, char *argv[]) {
         _cleanup_udev_unref_ struct udev *udev = NULL;
         _cleanup_udev_device_unref_ struct udev_device *device = NULL;
@@ -306,6 +348,8 @@ int main(int argc, char *argv[]) {
                         return EXIT_FAILURE;
                 }
 
+                clamp_brightness(device, &value);
+
                 r = udev_device_set_sysattr_value(device, "brightness", value);
                 if (r < 0) {
                         log_error("Failed to write system attribute: %s", strerror(-r));

commit b8b80c8aa1effecb9c224cd3be1e8acbf7a44745
Author: Josh Triplett <josh at joshtriplett.org>
Date:   Tue Mar 11 21:09:04 2014 -0700

    backlight: Fix copy/paste error printing an unrelated error code
    
    udev_device_get_sysattr_value returns NULL on failure, but doesn't
    provide an error code; thus, when printing an error from it, don't print
    an unrelated error code from a previous call.
    
    (cherry picked from commit cddc35f75ecff63b2ffd3f8e4c863d475e7b14ca)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 86f10cc..81470b3 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -322,7 +322,7 @@ int main(int argc, char *argv[]) {
 
                 value = udev_device_get_sysattr_value(device, "brightness");
                 if (!value) {
-                        log_error("Failed to read system attribute: %s", strerror(-r));
+                        log_error("Failed to read system attribute");
                         return EXIT_FAILURE;
                 }
 

commit aa5882a2d14c8de0956be0569f20678816dfa1f5
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 17 01:37:54 2014 +0200

    install: simplify symlink --root= logic
    
    (cherry picked from commit 278fa5758c8e30f03c8c50f15873d55edfc4cbaf)

diff --git a/src/shared/install.c b/src/shared/install.c
index 625725a..bce9067 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -47,9 +47,8 @@ typedef struct {
 
 #define _cleanup_install_context_done_ _cleanup_(install_context_done)
 
-static int in_search_path(const char *path, char **search, const char *root_dir) {
+static int in_search_path(const char *path, char **search) {
         _cleanup_free_ char *parent = NULL;
-        char **i;
         int r;
 
         assert(path);
@@ -58,24 +57,7 @@ static int in_search_path(const char *path, char **search, const char *root_dir)
         if (r < 0)
                 return r;
 
-        STRV_FOREACH(i, search) {
-                _cleanup_free_ char *buf = NULL;
-                const char *p;
-
-                if (root_dir) {
-                        buf = strjoin(root_dir, "/", *i, NULL);
-                        if (!buf)
-                                return -ENOMEM;
-
-                        p = buf;
-                } else
-                        p = *i;
-
-                if (path_equal(parent, p))
-                        return 1;
-        }
-
-        return 0;
+        return strv_contains(search, parent);
 }
 
 static int lookup_paths_init_from_scope(LookupPaths *paths,
@@ -788,7 +770,7 @@ int unit_file_link(
                         continue;
                 }
 
-                q = in_search_path(*i, paths.unit_path, root_dir);
+                q = in_search_path(*i, paths.unit_path);
                 if (q < 0)
                         return q;
 
@@ -1037,6 +1019,7 @@ static int unit_file_load(
                 InstallContext *c,
                 InstallInfo *info,
                 const char *path,
+                const char *root_dir,
                 bool allow_symlink) {
 
         const ConfigTableItem items[] = {
@@ -1048,14 +1031,16 @@ static int unit_file_load(
                 { NULL, NULL, NULL, 0, NULL }
         };
 
-        int fd;
         _cleanup_fclose_ FILE *f = NULL;
-        int r;
+        int fd, r;
 
         assert(c);
         assert(info);
         assert(path);
 
+        if (!isempty(root_dir))
+                path = strappenda3(root_dir, "/", path);
+
         fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|(allow_symlink ? 0 : O_NOFOLLOW));
         if (fd < 0)
                 return -errno;
@@ -1091,30 +1076,19 @@ static int unit_file_search(
         assert(info);
         assert(paths);
 
-        if (info->path) {
-                const char *path;
-
-                if (isempty(root_dir))
-                        path = info->path;
-                else
-                        path = strappenda(root_dir, info->path);
-
-                return unit_file_load(c, info, path, allow_symlink);
-        }
+        if (info->path)
+                return unit_file_load(c, info, info->path, root_dir, allow_symlink);
 
         assert(info->name);
 
         STRV_FOREACH(p, paths->unit_path) {
                 _cleanup_free_ char *path = NULL;
 
-                if (isempty(root_dir))
-                        path = strjoin(*p, "/", info->name, NULL);
-                else
-                        path = strjoin(root_dir, "/", *p, "/", info->name, NULL);
+                path = strjoin(*p, "/", info->name, NULL);
                 if (!path)
                         return -ENOMEM;
 
-                r = unit_file_load(c, info, path, allow_symlink);
+                r = unit_file_load(c, info, path, root_dir, allow_symlink);
                 if (r >= 0) {
                         info->path = path;
                         path = NULL;
@@ -1139,14 +1113,11 @@ static int unit_file_search(
                 STRV_FOREACH(p, paths->unit_path) {
                         _cleanup_free_ char *path = NULL;
 
-                        if (isempty(root_dir))
-                                path = strjoin(*p, "/", template, NULL);
-                        else
-                                path = strjoin(root_dir, "/", *p, "/", template, NULL);
+                        path = strjoin(*p, "/", template, NULL);
                         if (!path)
                                 return -ENOMEM;
 
-                        r = unit_file_load(c, info, path, allow_symlink);
+                        r = unit_file_load(c, info, path, root_dir, allow_symlink);
                         if (r >= 0) {
                                 info->path = path;
                                 path = NULL;
@@ -1359,7 +1330,7 @@ static int install_info_symlink_link(
         assert(config_path);
         assert(i->path);
 
-        r = in_search_path(i->path, paths->unit_path, root_dir);
+        r = in_search_path(i->path, paths->unit_path);
         if (r != 0)
                 return r;
 

commit 9139b554df671481a7e03e928d661420bffb8774
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 17 00:53:49 2014 +0200

    install: make sure that --root= mode doesn't make us consider all units outside of search path
    
    (cherry picked from commit 8f294b45cbb627d31342f6a79444be59ce7e2274)

diff --git a/src/shared/install.c b/src/shared/install.c
index defcf46..625725a 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -47,6 +47,37 @@ typedef struct {
 
 #define _cleanup_install_context_done_ _cleanup_(install_context_done)
 
+static int in_search_path(const char *path, char **search, const char *root_dir) {
+        _cleanup_free_ char *parent = NULL;
+        char **i;
+        int r;
+
+        assert(path);
+
+        r = path_get_parent(path, &parent);
+        if (r < 0)
+                return r;
+
+        STRV_FOREACH(i, search) {
+                _cleanup_free_ char *buf = NULL;
+                const char *p;
+
+                if (root_dir) {
+                        buf = strjoin(root_dir, "/", *i, NULL);
+                        if (!buf)
+                                return -ENOMEM;
+
+                        p = buf;
+                } else
+                        p = *i;
+
+                if (path_equal(parent, p))
+                        return 1;
+        }
+
+        return 0;
+}
+
 static int lookup_paths_init_from_scope(LookupPaths *paths,
                                         UnitFileScope scope,
                                         const char *root_dir) {
@@ -757,7 +788,7 @@ int unit_file_link(
                         continue;
                 }
 
-                q = in_search_path(*i, paths.unit_path);
+                q = in_search_path(*i, paths.unit_path, root_dir);
                 if (q < 0)
                         return q;
 
@@ -1315,6 +1346,7 @@ static int install_info_symlink_link(
                 InstallInfo *i,
                 LookupPaths *paths,
                 const char *config_path,
+                const char *root_dir,
                 bool force,
                 UnitFileChange **changes,
                 unsigned *n_changes) {
@@ -1327,7 +1359,7 @@ static int install_info_symlink_link(
         assert(config_path);
         assert(i->path);
 
-        r = in_search_path(i->path, paths->unit_path);
+        r = in_search_path(i->path, paths->unit_path, root_dir);
         if (r != 0)
                 return r;
 
@@ -1342,6 +1374,7 @@ static int install_info_apply(
                 InstallInfo *i,
                 LookupPaths *paths,
                 const char *config_path,
+                const char *root_dir,
                 bool force,
                 UnitFileChange **changes,
                 unsigned *n_changes) {
@@ -1362,7 +1395,7 @@ static int install_info_apply(
         if (r == 0)
                 r = q;
 
-        q = install_info_symlink_link(i, paths, config_path, force, changes, n_changes);
+        q = install_info_symlink_link(i, paths, config_path, root_dir, force, changes, n_changes);
         if (r == 0)
                 r = q;
 
@@ -1402,7 +1435,7 @@ static int install_context_apply(
                 } else if (r >= 0)
                         r += q;
 
-                q = install_info_apply(i, paths, config_path, force, changes, n_changes);
+                q = install_info_apply(i, paths, config_path, root_dir, force, changes, n_changes);
                 if (r >= 0 && q < 0)
                         r = q;
         }
diff --git a/src/shared/util.c b/src/shared/util.c
index 6468056..fa57e24 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4461,22 +4461,6 @@ int dirent_ensure_type(DIR *d, struct dirent *de) {
         return 0;
 }
 
-int in_search_path(const char *path, char **search) {
-        char **i;
-        _cleanup_free_ char *parent = NULL;
-        int r;
-
-        r = path_get_parent(path, &parent);
-        if (r < 0)
-                return r;
-
-        STRV_FOREACH(i, search)
-                if (path_equal(parent, *i))
-                        return 1;
-
-        return 0;
-}
-
 int get_files_in_directory(const char *path, char ***list) {
         _cleanup_closedir_ DIR *d = NULL;
         size_t bufsize = 0, n = 0;
diff --git a/src/shared/util.h b/src/shared/util.h
index d573e4b..696bf4c 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -518,7 +518,6 @@ int glob_extend(char ***strv, const char *path);
 
 int dirent_ensure_type(DIR *d, struct dirent *de);
 
-int in_search_path(const char *path, char **search);
 int get_files_in_directory(const char *path, char ***list);
 
 char *strjoin(const char *x, ...) _sentinel_;

commit b83e096610a05b7bb3b096cebd634ef3717c4b2c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 17 00:33:39 2014 +0200

    install: make sure "systemctl disable foobar at .service" actually removes all instances
    
    (cherry picked from commit 559367add5e22bf32d14fa1496512c68488f48b0)
    
    Conflicts:
    	src/shared/install.c

diff --git a/src/shared/install.c b/src/shared/install.c
index 136e894..defcf46 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -266,8 +266,21 @@ static int remove_marked_symlinks_fd(
 
                         if (unit_name_is_instance(de->d_name) &&
                             instance_whitelist &&
-                            !strv_contains(instance_whitelist, de->d_name))
-                                continue;
+                            !strv_contains(instance_whitelist, de->d_name)) {
+                                _cleanup_free_ char *w;
+
+                                /* OK, the file is not listed directly
+                                 * in the whitelist, so let's check if
+                                 * the template of it might be
+                                 * listed. */
+
+                                w = unit_name_template(de->d_name);
+                                if (!w)
+                                        return -ENOMEM;
+
+                                if (!strv_contains(instance_whitelist, w))
+                                        continue;
+                        }
 
                         p = path_make_absolute(de->d_name, path);
                         if (!p)
@@ -296,10 +309,10 @@ static int remove_marked_symlinks_fd(
                                         continue;
                                 }
 
-                                rmdir_parents(p, config_path);
-
                                 path_kill_slashes(p);
 
+                                rmdir_parents(p, config_path);
+
                                 add_file_change(changes, n_changes, UNIT_FILE_UNLINK, p, NULL);
 
                                 if (!set_get(remove_symlinks_to, p)) {

commit ce314469055164cdc83d73c9e006ec703bc515b7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 17 00:13:48 2014 +0200

    install: when looking for a unit file for enabling, search for templates only after traversing all search directories
    
    Let's always make sure to look in all search directories for the full
    unit names first, before looking for templates for them.
    
    (cherry picked from commit e50bd775163cd96be1888943a8785a436be710e8)

diff --git a/src/shared/install.c b/src/shared/install.c
index 5eee0fa..136e894 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1048,67 +1048,69 @@ static int unit_file_search(
         assert(paths);
 
         if (info->path) {
-                char *full_path = NULL;
+                const char *path;
 
-                if (!isempty(root_dir))
-                        full_path = strappenda(root_dir, info->path);
+                if (isempty(root_dir))
+                        path = info->path;
+                else
+                        path = strappenda(root_dir, info->path);
 
-                return unit_file_load(c, info, full_path ?: info->path, allow_symlink);
+                return unit_file_load(c, info, path, allow_symlink);
         }
 
         assert(info->name);
 
         STRV_FOREACH(p, paths->unit_path) {
-                _cleanup_free_ char *path = NULL, *full_path = NULL;
+                _cleanup_free_ char *path = NULL;
 
-                path = strjoin(*p, "/", info->name, NULL);
+                if (isempty(root_dir))
+                        path = strjoin(*p, "/", info->name, NULL);
+                else
+                        path = strjoin(root_dir, "/", *p, "/", info->name, NULL);
                 if (!path)
                         return -ENOMEM;
 
-                if (!isempty(root_dir)) {
-                        full_path = strappend(root_dir, path);
-                        if (!full_path)
-                                return -ENOMEM;
-                }
-
-                r = unit_file_load(c, info, full_path ?: path, allow_symlink);
+                r = unit_file_load(c, info, path, allow_symlink);
                 if (r >= 0) {
                         info->path = path;
                         path = NULL;
-                } else if (r == -ENOENT && unit_name_is_instance(info->name)) {
-                        /* Unit file doesn't exist, however instance enablement was requested.
-                         * We will check if it is possible to load template unit file. */
-                        _cleanup_free_ char *template = NULL, *template_dir = NULL;
+                        return r;
+                }
+                if (r != -ENOENT && r != -ELOOP)
+                        return r;
+        }
 
-                        template = unit_name_template(info->name);
-                        if (!template)
-                                return -ENOMEM;
+        if (unit_name_is_instance(info->name)) {
+
+                /* Unit file doesn't exist, however instance
+                 * enablement was requested.  We will check if it is
+                 * possible to load template unit file. */
 
-                        /* We will reuse path variable since we don't need it anymore. */
-                        template_dir = path;
-                        *(strrchr(template_dir, '/') + 1) = '\0';
+                _cleanup_free_ char *template = NULL, *template_dir = NULL;
+
+                template = unit_name_template(info->name);
+                if (!template)
+                        return -ENOMEM;
 
-                        path = strappend(template_dir, template);
+                STRV_FOREACH(p, paths->unit_path) {
+                        _cleanup_free_ char *path = NULL;
+
+                        if (isempty(root_dir))
+                                path = strjoin(*p, "/", template, NULL);
+                        else
+                                path = strjoin(root_dir, "/", *p, "/", template, NULL);
                         if (!path)
                                 return -ENOMEM;
 
-                        if (!isempty(root_dir)) {
-                                free(full_path);
-                                full_path = strappend(root_dir, path);
-                                if (!full_path)
-                                        return -ENOMEM;
-                        }
-
-                        /* Let's try to load template unit. */
-                        r = unit_file_load(c, info, full_path ?: path, allow_symlink);
+                        r = unit_file_load(c, info, path, allow_symlink);
                         if (r >= 0) {
                                 info->path = path;
                                 path = NULL;
+                                return r;
                         }
+                        if (r != -ENOENT && r != -ELOOP)
+                                return r;
                 }
-
-                if (r != -ENOENT && r != -ELOOP)
-                        return r;
         }
 
         return -ENOENT;

commit 86940608966264484ca8320221cee2067ba725a4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 16 19:48:31 2014 +0200

    install: simplify and clarify disabling logic for instanced units
    
    (cherry picked from commit bcafe923a74e702abbba3655b0270febe143499f)

diff --git a/src/shared/install.c b/src/shared/install.c
index bc9599e..5eee0fa 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -194,10 +194,10 @@ static int remove_marked_symlinks_fd(
                 bool *deleted,
                 UnitFileChange **changes,
                 unsigned *n_changes,
-                char** files) {
+                char** instance_whitelist) {
 
-        int r = 0;
         _cleanup_closedir_ DIR *d = NULL;
+        int r = 0;
 
         assert(remove_symlinks_to);
         assert(fd >= 0);
@@ -252,9 +252,8 @@ static int remove_marked_symlinks_fd(
                         }
 
                         /* This will close nfd, regardless whether it succeeds or not */
-                        q = remove_marked_symlinks_fd(remove_symlinks_to, nfd, p, config_path, deleted, changes, n_changes, files);
-
-                        if (r == 0)
+                        q = remove_marked_symlinks_fd(remove_symlinks_to, nfd, p, config_path, deleted, changes, n_changes, instance_whitelist);
+                        if (q < 0 && r == 0)
                                 r = q;
 
                 } else if (de->d_type == DT_LNK) {
@@ -262,6 +261,14 @@ static int remove_marked_symlinks_fd(
                         int q;
                         bool found;
 
+                        if (!unit_name_is_valid(de->d_name, TEMPLATE_VALID))
+                                continue;
+
+                        if (unit_name_is_instance(de->d_name) &&
+                            instance_whitelist &&
+                            !strv_contains(instance_whitelist, de->d_name))
+                                continue;
+
                         p = path_make_absolute(de->d_name, path);
                         if (!p)
                                 return -ENOMEM;
@@ -280,30 +287,29 @@ static int remove_marked_symlinks_fd(
                                 set_get(remove_symlinks_to, dest) ||
                                 set_get(remove_symlinks_to, basename(dest));
 
-                        if (unit_name_is_instance(p))
-                                found = found && strv_contains(files, basename(p));
-
                         if (found) {
 
                                 if (unlink(p) < 0 && errno != ENOENT) {
 
                                         if (r == 0)
                                                 r = -errno;
-                                } else {
-                                        rmdir_parents(p, config_path);
-                                        path_kill_slashes(p);
+                                        continue;
+                                }
+
+                                rmdir_parents(p, config_path);
+
+                                path_kill_slashes(p);
 
-                                        add_file_change(changes, n_changes, UNIT_FILE_UNLINK, p, NULL);
+                                add_file_change(changes, n_changes, UNIT_FILE_UNLINK, p, NULL);
 
-                                        if (!set_get(remove_symlinks_to, p)) {
+                                if (!set_get(remove_symlinks_to, p)) {
 
-                                                q = mark_symlink_for_removal(&remove_symlinks_to, p);
-                                                if (q < 0) {
-                                                        if (r == 0)
-                                                                r = q;
-                                                } else
-                                                        *deleted = true;
-                                        }
+                                        q = mark_symlink_for_removal(&remove_symlinks_to, p);
+                                        if (q < 0) {
+                                                if (r == 0)
+                                                        r = q;
+                                        } else
+                                                *deleted = true;
                                 }
                         }
                 }
@@ -317,7 +323,7 @@ static int remove_marked_symlinks(
                 const char *config_path,
                 UnitFileChange **changes,
                 unsigned *n_changes,
-                char** files) {
+                char** instance_whitelist) {
 
         _cleanup_close_ int fd = -1;
         int r = 0;
@@ -343,7 +349,7 @@ static int remove_marked_symlinks(
                 }
 
                 /* This takes possession of cfd and closes it */
-                q = remove_marked_symlinks_fd(remove_symlinks_to, cfd, config_path, config_path, &deleted, changes, n_changes, files);
+                q = remove_marked_symlinks_fd(remove_symlinks_to, cfd, config_path, config_path, &deleted, changes, n_changes, instance_whitelist);
                 if (r == 0)
                         r = q;
         } while (deleted);

commit e4914615e7d45103034b114d8ee515e74f9c58a0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 16 17:19:30 2014 +0200

    install: various modernizations
    
    (cherry picked from commit da39f6a63e9ca59bec23cc9d1cb841703bb5ef56)

diff --git a/src/shared/install.c b/src/shared/install.c
index 9972fd7..bc9599e 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -319,7 +319,8 @@ static int remove_marked_symlinks(
                 unsigned *n_changes,
                 char** files) {
 
-        int fd, r = 0;
+        _cleanup_close_ int fd = -1;
+        int r = 0;
         bool deleted;
 
         assert(config_path);
@@ -347,8 +348,6 @@ static int remove_marked_symlinks(
                         r = q;
         } while (deleted);
 
-        safe_close(fd);
-
         return r;
 }
 
@@ -1832,11 +1831,11 @@ int unit_file_preset(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        _cleanup_lookup_paths_free_ LookupPaths paths = {};
         _cleanup_install_context_done_ InstallContext plus = {}, minus = {};
-        char **i;
-        _cleanup_free_ char *config_path = NULL;
         _cleanup_set_free_free_ Set *remove_symlinks_to = NULL;
+        _cleanup_lookup_paths_free_ LookupPaths paths = {};
+        _cleanup_free_ char *config_path = NULL;
+        char **i;
         int r, q;
 
         assert(scope >= 0);
@@ -1863,16 +1862,13 @@ int unit_file_preset(
                         r = install_info_add_auto(&plus, *i);
                 else
                         r = install_info_add_auto(&minus, *i);
-
                 if (r < 0)
                         return r;
         }
 
-        r = install_context_mark_for_removal(&minus, &paths, &remove_symlinks_to,
-                                             config_path, root_dir);
+        r = install_context_mark_for_removal(&minus, &paths, &remove_symlinks_to, config_path, root_dir);
 
-        q = remove_marked_symlinks(remove_symlinks_to, config_path,
-                                   changes, n_changes, files);
+        q = remove_marked_symlinks(remove_symlinks_to, config_path, changes, n_changes, files);
         if (r == 0)
                 r = q;
 
@@ -1901,8 +1897,6 @@ int unit_file_get_list(
 
         _cleanup_lookup_paths_free_ LookupPaths paths = {};
         char **i;
-        _cleanup_free_ char *buf = NULL;
-        _cleanup_closedir_ DIR *d = NULL;
         int r;
 
         assert(scope >= 0);
@@ -1917,22 +1911,19 @@ int unit_file_get_list(
                 return r;
 
         STRV_FOREACH(i, paths.unit_path) {
+                _cleanup_closedir_ DIR *d = NULL;
+                _cleanup_free_ char *buf = NULL;
                 const char *units_dir;
 
-                free(buf);
-                buf = NULL;
-
-                if (root_dir) {
-                        if (asprintf(&buf, "%s/%s", root_dir, *i) < 0)
+                if (!isempty(root_dir)) {
+                        buf = strjoin(root_dir, "/", *i, NULL);
+                        if (!buf)
                                 return -ENOMEM;
 
                         units_dir = buf;
                 } else
                         units_dir = *i;
 
-                if (d)
-                        closedir(d);
-
                 d = opendir(units_dir);
                 if (!d) {
                         if (errno == ENOENT)
@@ -1962,15 +1953,9 @@ int unit_file_get_list(
                         if (hashmap_get(h, de->d_name))
                                 continue;
 
-                        r = dirent_ensure_type(d, de);
-                        if (r < 0) {
-                                if (r == -ENOENT)
-                                        continue;
-
-                                return r;
-                        }
+                        dirent_ensure_type(d, de);
 
-                        if (de->d_type != DT_LNK && de->d_type != DT_REG)
+                        if (!IN_SET(de->d_type, DT_LNK, DT_REG))
                                 continue;
 
                         f = new0(UnitFileList, 1);

commit 2b44d8fbbdd47d3398d67859ea58a2b537f57ed5
Author: Frederic Crozat <fcrozat at suse.com>
Date:   Mon Jun 16 18:49:12 2014 +0200

    bootchart: set white background
    
     In programs like eog and gimp the transparant background did not
    look very good.
    
    Similar fix from the one done in systemd-analyze (418e3750)
    
    (cherry picked from commit a7997073ac07add6cb30dcd9491c0179b2d6ad52)

diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 7438e47..3ff1ff3 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -123,6 +123,7 @@ static void svg_header(void) {
         svg("<defs>\n  <style type=\"text/css\">\n    <![CDATA[\n");
 
         svg("      rect       { stroke-width: 1; }\n");
+        svg("      rect.bg    { fill: rgb(255,255,255); }\n");
         svg("      rect.cpu   { fill: rgb(64,64,240); stroke-width: 0; fill-opacity: 0.7; }\n");
         svg("      rect.wait  { fill: rgb(240,240,0); stroke-width: 0; fill-opacity: 0.7; }\n");
         svg("      rect.bi    { fill: rgb(240,128,128); stroke-width: 0; fill-opacity: 0.7; }\n");
@@ -1269,6 +1270,7 @@ void svg_do(const char *build) {
 
         /* after this, we can draw the header with proper sizing */
         svg_header();
+        svg("<rect class=\"bg\" width=\"100%%\" height=\"100%%\" />\n\n");
 
         svg("<g transform=\"translate(10,400)\">\n");
         svg_io_bi_bar();

commit f5fbcb6e048cd8601a8dc6e04a915523f7d170d2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 17 01:56:44 2014 +0200

    conf-files: fix when for --root= logic
    
    This is based on parts of similar patches from Michael Marineau and
    Lukas Nykrin, but simply uses strappenda3().
    
    (cherry picked from commit cebed5005b5ede17fc52ab50c054fca73bc938b8)

diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 5201782..59bc8ce 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -37,10 +37,20 @@
 #include "hashmap.h"
 #include "conf-files.h"
 
-static int files_add(Hashmap *h, const char *dirpath, const char *suffix) {
+static int files_add(Hashmap *h, const char *dirpath, const char *suffix, const char *root) {
         _cleanup_closedir_ DIR *dir = NULL;
 
-        dir = opendir(dirpath);
+        assert(dirpath);
+        assert(suffix);
+
+        if (isempty(root))
+                dir = opendir(dirpath);
+        else {
+                const char *p;
+
+                p = strappenda3(root, "/", dirpath);
+                dir = opendir(p);
+        }
         if (!dir) {
                 if (errno == ENOENT)
                         return 0;
@@ -108,7 +118,7 @@ static int conf_files_list_strv_internal(char ***strv, const char *suffix, const
                 return -ENOMEM;
 
         STRV_FOREACH(p, dirs) {
-                r = files_add(fh, *p, suffix);
+                r = files_add(fh, *p, suffix, root);
                 if (r == -ENOMEM) {
                         hashmap_free_free(fh);
                         return r;

commit fe2be3dd40bf95911d410abae1a7c4ad7ab7323d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 16 17:01:26 2014 +0200

    unit-name: fix detection of unit templates/instances
    
    We need to check for the last dot, not the first one in a unit name, for
    the suffix. Correct that.
    
    (cherry picked from commit 6ef9eeed61a291cc42b7d911f5cf5a4deca742a3)

diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 2924c47..fb0a5ab 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -337,7 +337,7 @@ char *unit_name_path_unescape(const char *f) {
 }
 
 bool unit_name_is_template(const char *n) {
-        const char *p;
+        const char *p, *e;
 
         assert(n);
 
@@ -345,11 +345,15 @@ bool unit_name_is_template(const char *n) {
         if (!p)
                 return false;
 
-        return p[1] == '.';
+        e = strrchr(p+1, '.');
+        if (!e)
+                return false;
+
+        return e == p + 1;
 }
 
 bool unit_name_is_instance(const char *n) {
-        const char *p;
+        const char *p, *e;
 
         assert(n);
 
@@ -357,7 +361,11 @@ bool unit_name_is_instance(const char *n) {
         if (!p)
                 return false;
 
-        return p[1] != '.';
+        e = strrchr(p+1, '.');
+        if (!e)
+                return false;
+
+        return e > p + 1;
 }
 
 char *unit_name_replace_instance(const char *f, const char *i) {

commit 4f0b9b433473d4f2b24675253064fd098d21e5a6
Author: Harald Hoyer <harald at redhat.com>
Date:   Thu Mar 6 16:35:02 2014 +0100

    systemctl: for switch-root check, if we switch to a systemd init
    
    If "systemctl switch-root" is called with a specific "INIT" or
    /proc/cmdline contains "init=", then systemd would not serialize
    itsself.
    
    Let systemctl check, if the new init is in the standard systemd
    installation path and if so, clear the INIT parameter,
    to let systemd serialize itsself.
    
    (cherry picked from commit f39d4a08e746e703d562076a0f622eb91dbdcd3e)
    
    For strappenda3, and it seems a good fix in general.

diff --git a/src/shared/util.h b/src/shared/util.h
index 5d2bbfb..d573e4b 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -806,6 +806,19 @@ int unlink_noerrno(const char *path);
                 _c_;                                    \
         })
 
+#define strappenda3(a, b, c)                                    \
+        ({                                                      \
+                const char *_a_ = (a), *_b_ = (b), *_c_ = (c);  \
+                char *_d_;                                      \
+                size_t _x_, _y_, _z_;                           \
+                _x_ = strlen(_a_);                              \
+                _y_ = strlen(_b_);                              \
+                _z_ = strlen(_c_);                              \
+                _d_ = alloca(_x_ + _y_ + _z_ + 1);              \
+                strcpy(stpcpy(stpcpy(_d_, _a_), _b_), _c_);     \
+                _d_;                                            \
+        })
+
 #define procfs_file_alloca(pid, field)                                  \
         ({                                                              \
                 pid_t _pid_ = (pid);                                    \
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9cd1867..d4a9334 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4453,8 +4453,8 @@ static int show_environment(sd_bus *bus, char **args) {
 
 static int switch_root(sd_bus *bus, char **args) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        _cleanup_free_ char *init = NULL;
-        const char *root;
+        _cleanup_free_ char *cmdline_init = NULL;
+        const char *root, *init;
         unsigned l;
         int r;
 
@@ -4467,20 +4467,33 @@ static int switch_root(sd_bus *bus, char **args) {
         root = args[1];
 
         if (l >= 3)
-                init = strdup(args[2]);
+                init = args[2];
         else {
-                parse_env_file("/proc/cmdline", WHITESPACE,
-                               "init", &init,
-                               NULL);
+                r = parse_env_file("/proc/cmdline", WHITESPACE,
+                                   "init", &cmdline_init,
+                                   NULL);
+                if (r < 0)
+                        log_debug("Failed to parse /proc/cmdline: %s", strerror(-r));
 
-                if (!init)
-                        init = strdup("");
+                init = cmdline_init;
         }
 
-        if (!init)
-                return log_oom();
+        if (isempty(init))
+                init = NULL;
+
+        if (init) {
+                const char *root_systemd_path = NULL, *root_init_path = NULL;
+
+                root_systemd_path = strappenda(root, "/" SYSTEMD_BINARY_PATH);
+                root_init_path = strappenda3(root, "/", init);
+
+                /* If the passed init is actually the same as the
+                 * systemd binary, then let's suppress it. */
+                if (files_same(root_init_path, root_systemd_path) > 0)
+                        init = NULL;
+        }
 
-        log_debug("switching root - root: %s; init: %s", root, init);
+        log_debug("Switching root - root: %s; init: %s", root, strna(init));
 
         r = sd_bus_call_method(
                         bus,

commit ac0c2a0e3cd29f5f6d80bdb9ae4ffbd94e15707e
Author: Harald Hoyer <harald at redhat.com>
Date:   Thu Mar 6 09:12:57 2014 +0100

    util: add files_same() helper function
    
    files_same() returns
         1, if the files are the same
         0, if the files have different inode/dev numbers
     errno, for any stat error
    
    (cherry picked from commit 9d9951a460a90ef0e1e0384742cefdcf85193f8c)

diff --git a/src/shared/util.c b/src/shared/util.c
index c3f1ed2..6468056 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3204,19 +3204,27 @@ bool on_tty(void) {
         return cached_on_tty;
 }
 
-int running_in_chroot(void) {
-        struct stat a = {}, b = {};
+int files_same(const char *filea, const char *fileb) {
+        struct stat a, b;
 
-        /* Only works as root */
-        if (stat("/proc/1/root", &a) < 0)
+        if (stat(filea, &a) < 0)
                 return -errno;
 
-        if (stat("/", &b) < 0)
+        if (stat(fileb, &b) < 0)
                 return -errno;
 
-        return
-                a.st_dev != b.st_dev ||
-                a.st_ino != b.st_ino;
+        return a.st_dev == b.st_dev &&
+               a.st_ino == b.st_ino;
+}
+
+int running_in_chroot(void) {
+        int ret;
+
+        ret = files_same("/proc/1/root", "/");
+        if (ret < 0)
+                return ret;
+
+        return ret == 0;
 }
 
 static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
diff --git a/src/shared/util.h b/src/shared/util.h
index 38d6494..5d2bbfb 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -445,6 +445,8 @@ static inline const char *ansi_highlight_off(void) {
         return on_tty() ? ANSI_HIGHLIGHT_OFF : "";
 }
 
+int files_same(const char *filea, const char *fileb);
+
 int running_in_chroot(void);
 
 char *ellipsize(const char *s, size_t length, unsigned percent);

commit 1762262e61d16e77a9446b7588f7828f70cd9cbb
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 16 13:20:38 2014 +0200

    tmpfiles: set up selinux label proeprly when creating fifos
    
    (cherry picked from commit 45c196a76b2d883552c90807386d9bed40da822b)
    
    Conflicts:
    	src/shared/util.c

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 5fd23f4..d9e3edd 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -702,9 +702,11 @@ static int create_item(Item *i) {
 
         case CREATE_FIFO:
 
+                label_context_set(i->path, S_IFIFO);
                 RUN_WITH_UMASK(0000) {
                         r = mkfifo(i->path, i->mode);
                 }
+                label_context_clear();
 
                 if (r < 0 && errno != EEXIST) {
                         log_error("Failed to create fifo %s: %m", i->path);

commit 2ea8cba266174f4c4afe7b0a5fbbfebf93fb37cc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 13 19:05:22 2014 +0200

    rpm: don't hardcode the binary paths in the macros, rely on $PATH
    
    this gives us a little bit more freedom to move things around later on,
    as we don't hardcode the systemd paths in old RPMs that shall work with
    new systemds.
    
    (cherry picked from commit 8cf7c96517c3688d29b30651adcda9e71e7fcb07)

diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in
index 89b4825..167016a 100644
--- a/src/core/macros.systemd.in
+++ b/src/core/macros.systemd.in
@@ -37,42 +37,42 @@ Requires(postun): systemd \
 %systemd_post() \
 if [ $1 -eq 1 ] ; then \
         # Initial installation \
-        @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
+        systemctl preset %{?*} >/dev/null 2>&1 || : \
 fi \
 %{nil}
 
 %systemd_preun() \
 if [ $1 -eq 0 ] ; then \
         # Package removal, not upgrade \
-        @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
-        @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
+        systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
+        systemctl stop %{?*} > /dev/null 2>&1 || : \
 fi \
 %{nil}
 
 %systemd_postun() \
- at rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
+systemctl daemon-reload >/dev/null 2>&1 || : \
 %{nil}
 
 %systemd_postun_with_restart() \
- at rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
+systemctl daemon-reload >/dev/null 2>&1 || : \
 if [ $1 -ge 1 ] ; then \
         # Package upgrade, not uninstall \
-        @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
+        systemctl try-restart %{?*} >/dev/null 2>&1 || : \
 fi \
 %{nil}
 
 %udev_hwdb_update() \
- at rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
+udevadm hwdb --update >/dev/null 2>&1 || : \
 %{nil}
 
 %udev_rules_update() \
- at rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \
+udevadm control --reload >/dev/null 2>&1 || : \
 %{nil}
 
 %journal_catalog_update() \
- at rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \
+journalctl --update-catalog >/dev/null 2>&1 || : \
 %{nil}
 
 %tmpfiles_create() \
- at rootbindir@/systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
+systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
 %{nil}

commit bcb667c211614b38870aced0703c6f93b0d198eb
Author: Andreas Henriksson <andreas at fatal.se>
Date:   Fri Jun 13 18:48:18 2014 +0200

    install: fix invalid free() in unit_file_mask()
    
    int unit_file_mask(...) in ./src/shared/install.c calls
    get_config_path(...) which can in 4 error cases return without setting
    "ret", and thus "prefix" can be uninitialized when unit_file_mask(...)
    finishes (which it does directly after the error is returned from
    get_config_path(...)).
    
    (cherry picked from commit 223217749e57996336d5730b0a28716cca56d45d)

diff --git a/src/shared/install.c b/src/shared/install.c
index 71392f3..9972fd7 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -565,7 +565,7 @@ int unit_file_mask(
                 unsigned *n_changes) {
 
         char **i;
-        _cleanup_free_ char *prefix;
+        _cleanup_free_ char *prefix = NULL;
         int r;
 
         assert(scope >= 0);

commit 4a6f3f091ad79f4777bcead7813da1900585bb5a
Author: Andreas Henriksson <andreas at fatal.se>
Date:   Fri Jun 13 18:48:21 2014 +0200

    udev: fix invalid free() in enable_name_policy()
    
    static bool enable_name_policy(...) in ./src/udev/net/link-config.c
    calls proc_cmdline(...) to get "line" initialized, but
    proc_cmdline(...) does not guarantee that atleast when both
    conditions (detect_container(NULL) > 0) and
    read_full_file(...) returned < 0.
    
    (cherry picked from commit f8a0bb5285024b6ce372c3157e761e6543ebdcd2)

diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 133926f..d58a81e 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -184,7 +184,7 @@ failure:
 }
 
 static bool enable_name_policy(void) {
-        _cleanup_free_ char *line;
+        _cleanup_free_ char *line = NULL;
         char *w, *state;
         int r;
         size_t l;

commit 89655d12976c14a2fc6b6c2b91164b9246898560
Author: Andreas Henriksson <andreas at fatal.se>
Date:   Fri Jun 13 18:48:19 2014 +0200

    core: fix invalid free() in killall()
    
    static int killall(....) in ./src/core/killall.c tries to get "s"
    initialized by calling get_process_comm(...) which calls
    read_one_line_file(...) which if it fails will mean it is left
    uninitialized.
    It is then used in argument to strna(s) call where it is
    dereferenced(!), in addition to nothing else initializing it before
    the scope it is in finishes.
    
    (cherry picked from commit 3e09eb5c83e56bc0184bd9d9c44f76047464f77c)

diff --git a/src/core/killall.c b/src/core/killall.c
index 57ed41c..eab48f7 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -168,7 +168,7 @@ static int killall(int sig, Set *pids, bool send_sighup) {
                         continue;
 
                 if (sig == SIGKILL) {
-                        _cleanup_free_ char *s;
+                        _cleanup_free_ char *s = NULL;
 
                         get_process_comm(pid, &s);
                         log_notice("Sending SIGKILL to PID "PID_FMT" (%s).", pid, strna(s));

commit 406be70b2f9adaa7dc4168dd51ac8e3cfe41bcb3
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 11 14:58:32 2014 +0200

    units: order network-online.target after network.target
    
    There might be implementations around where the network-online logic
    might not talk to any network configuration service (and thus not have
    to wait for it), hence let's explicitly order network-online.target
    after network.target to avoid any ambiguities.
    
    (cherry picked from commit 58e027023b47b32e42cf93dd4a629b869ee1ef25)
    
    Conflicts:
    	units/systemd-networkd-wait-online.service.in

diff --git a/units/network-online.target b/units/network-online.target
index a40c44c..67bc4fa 100644
--- a/units/network-online.target
+++ b/units/network-online.target
@@ -9,3 +9,4 @@
 Description=Network is Online
 Documentation=man:systemd.special(7)
 Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
+After=network.target

commit 00d967b989929e176e940345bbf3ffa65832b15f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 10 22:48:56 2014 +0200

    label: when clearing selinux context, don't mangle errno
    
    (cherry picked from commit 874f1947e33922f08c578696af5b628a0f67fec2)

diff --git a/src/shared/label.c b/src/shared/label.c
index 70e5c85..c416899 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -295,6 +295,8 @@ int label_socket_set(const char *label) {
 void label_context_clear(void) {
 
 #ifdef HAVE_SELINUX
+        PROTECT_ERRNO;
+
         if (!use_selinux())
                 return;
 
@@ -305,6 +307,8 @@ void label_context_clear(void) {
 void label_socket_clear(void) {
 
 #ifdef HAVE_SELINUX
+        PROTECT_ERRNO;
+
         if (!use_selinux())
                 return;
 
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 2a48180..5fd23f4 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -461,20 +461,21 @@ static int item_set_perms(Item *i, const char *path) {
 }
 
 static int write_one_file(Item *i, const char *path) {
-        int e, flags;
+        int flags;
         int fd = -1;
         struct stat st;
         int r = 0;
 
+        assert(i);
+        assert(path);
+
         flags = i->type == CREATE_FILE ? O_CREAT|O_APPEND :
                 i->type == TRUNCATE_FILE ? O_CREAT|O_TRUNC : 0;
 
         RUN_WITH_UMASK(0) {
                 label_context_set(path, S_IFREG);
                 fd = open(path, flags|O_NDELAY|O_CLOEXEC|O_WRONLY|O_NOCTTY|O_NOFOLLOW, i->mode);
-                e = errno;
                 label_context_clear();
-                errno = e;
         }
 
         if (fd < 0) {
@@ -636,7 +637,6 @@ static int glob_item(Item *i, int (*action)(Item *, const char *)) {
 }
 
 static int create_item(Item *i) {
-        int e;
         struct stat st;
         int r = 0;
 
@@ -732,9 +732,7 @@ static int create_item(Item *i) {
 
                 label_context_set(i->path, S_IFLNK);
                 r = symlink(i->argument, i->path);
-                e = errno;
                 label_context_clear();
-                errno = e;
 
                 if (r < 0 && errno != EEXIST) {
                         log_error("symlink(%s, %s) failed: %m", i->argument, i->path);
@@ -774,9 +772,7 @@ static int create_item(Item *i) {
                 RUN_WITH_UMASK(0000) {
                         label_context_set(i->path, file_type);
                         r = mknod(i->path, i->mode | file_type, i->major_minor);
-                        e = errno;
                         label_context_clear();
-                        errno = e;
                 }
 
                 if (r < 0 && errno != EEXIST) {

commit b4ce8bd84c2439a3e58317ec16dd86435279626d
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Tue Jun 3 19:44:03 2014 +0200

    log: honour the kernel's quiet cmdline argument
    
    It was forgotten in b1e90ec515408aec2702522f6f68c4920b56375b
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=79582
    
    (cherry picked from commit e683212f049ac5d3f95fb17300cfa2fd971f78f3)

diff --git a/src/shared/log.c b/src/shared/log.c
index f4d7a0e..b10990b 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -878,6 +878,9 @@ void log_parse_environment(void) {
                         if (l == 5 && startswith(w, "debug")) {
                                 log_set_max_level(LOG_DEBUG);
                                 break;
+                        } else if (l == 5 && startswith(w, "quiet")) {
+                                log_set_max_level(LOG_WARNING);
+                                break;
                         }
                 }
         }

commit 1f98d3636de425d9c49cd0dcb889865fbb996924
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 10 18:52:28 2014 +0200

    man: updates to the passive target section
    
    (cherry picked from commit 51cb9d734a182c4892a6b31f58d75489a2ca432b)

diff --git a/man/systemd.special.xml b/man/systemd.special.xml
index 8ccccc2..38b94a7 100644
--- a/man/systemd.special.xml
+++ b/man/systemd.special.xml
@@ -866,7 +866,13 @@
                                         will be stopped before the
                                         network -- to whatever level
                                         it might be set up then -- is
-                                        shut down. Also see <ulink
+                                        shut down. It is hence useful
+                                        when writing service files
+                                        that require network access on
+                                        shutdown, which should order
+                                        themselves after this target,
+                                        but not pull it in. Also see
+                                        <ulink
                                         url="http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
                                         Services After the Network is
                                         up</ulink> for more
@@ -882,7 +888,6 @@
                                         an LSB header referring to the
                                         <literal>$network</literal>
                                         facility.</para>
-
                                 </listitem>
                         </varlistentry>
                         <varlistentry>
@@ -896,7 +901,12 @@
                                         user/group name lookups for
                                         which
                                         <filename>nss-user-lookup.target</filename>
-                                        should be used. systemd
+                                        should be used. All services
+                                        for which the availability of
+                                        full host/network name
+                                        resolution is essential should
+                                        be ordered after this target,
+                                        but not pull it in. systemd
                                         automatically adds
                                         dependencies of type
                                         <varname>After=</varname> for
@@ -918,7 +928,16 @@
                                         host/network name lookups for
                                         which
                                         <filename>nss-lookup.target</filename>
-                                        should be used. </para>
+                                        should be used. All services
+                                        for which the availability of
+                                        the full user/group database is
+                                        essential should be ordered
+                                        after this target, but not
+                                        pull it in. Note that system
+                                        users are always resolvable,
+                                        and hence do not require any
+                                        special ordering against this
+                                        target.</para>
                                 </listitem>
                         </varlistentry>
                         <varlistentry>
@@ -943,19 +962,18 @@
                                         should use
                                         <filename>network-online.target</filename>
                                         (see above).</para>
-
-                                        <para>Again, this target unit
-                                        is <emphasis>not</emphasis>
-                                        suitable for pulling in other
-                                        units, it is only useful for
-                                        ordering.</para>
                                 </listitem>
                         </varlistentry>
                         <varlistentry>
                                 <term><filename>rpcbind.target</filename></term>
                                 <listitem>
-                                        <para>systemd automatically
-                                        adds dependencies of type
+                                        <para>The portmapper/rpcbind
+                                        pulls in this target and
+                                        orders itself before it, to
+                                        indicate its
+                                        availability. systemd
+                                        automatically adds
+                                        dependencies of type
                                         <varname>After=</varname> for
                                         this target unit to all SysV
                                         init script service units with
@@ -967,14 +985,24 @@
                         <varlistentry>
                                 <term><filename>time-sync.target</filename></term>
                                 <listitem>
-                                        <para>systemd automatically
-                                        adds dependencies of type
+                                        <para>Services responsible for
+                                        synchronizing the system clock
+                                        from a remote source (such as
+                                        NTP client implementations)
+                                        should pull in this target and
+                                        order themselves before
+                                        it. All services where correct
+                                        time is essential should be
+                                        ordered after this unit, but
+                                        not pull it in. systemd
+                                        automatically adds
+                                        dependencies of type
                                         <varname>After=</varname> for
                                         this target unit to all SysV
                                         init script service units with
                                         an LSB header referring to the
                                         <literal>$time</literal>
-                                        facility.</para>
+                                        facility. </para>
                                 </listitem>
                         </varlistentry>
                 </variablelist>

commit f22d2ebe687ad842f4bed11df918ed07a0bb3e78
Author: Thomas Blume <Thomas.Blume at suse.com>
Date:   Fri Jun 6 16:36:45 2014 +0200

    systemd-detect-virt: only discover Xen domU
    
    The current vm detection lacks the distinction between Xen dom0 and Xen domU.
    Both, dom0 and domU are running inside the hypervisor.
    Therefore systemd-detect-virt and the ConditionVirtualization directive detect
    dom0 as a virtual machine.
    
    dom0 is not using virtual devices but is accessing the real hardware.
    Therefore dom0 should be considered the virtualisation host and not a virtual
    machine.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=77271
    (cherry picked from commit 37287585b6ba9a55065c8f94458f6db3c0abe0af)

diff --git a/src/shared/virt.c b/src/shared/virt.c
index ec2ddcf..f03e790 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -149,7 +149,7 @@ static int detect_vm_dmi(const char **_id) {
 
 /* Returns a short identifier for the various VM implementations */
 int detect_vm(const char **id) {
-        _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL;
+        _cleanup_free_ char *domcap = NULL, *cpuinfo_contents = NULL;
         static thread_local int cached_found = -1;
         static thread_local const char *cached_id = NULL;
         const char *_id = NULL;
@@ -163,17 +163,37 @@ int detect_vm(const char **id) {
                 return cached_found;
         }
 
-        /* Try high-level hypervisor sysfs file first:
+        /* Try xen capabilities file first, if not found try high-level hypervisor sysfs file:
          *
-         * https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
-        r = read_one_line_file("/sys/hypervisor/type", &hvtype);
+         * https://bugs.freedesktop.org/show_bug.cgi?id=77271 */
+        r = read_one_line_file("/proc/xen/capabilities", &domcap);
         if (r >= 0) {
-                if (streq(hvtype, "xen")) {
+                char *cap, *i = domcap;
+
+                while ((cap = strsep(&i, ",")))
+                        if (streq(cap, "control_d"))
+                                break;
+
+                if (!i)  {
                         _id = "xen";
                         r = 1;
-                        goto finish;
                 }
-        } else if (r != -ENOENT)
+
+                goto finish;
+
+        } else if (r == -ENOENT) {
+                _cleanup_free_ char *hvtype = NULL;
+
+                r = read_one_line_file("/sys/hypervisor/type", &hvtype);
+                if (r >= 0) {
+                        if (streq(hvtype, "xen")) {
+                                _id = "xen";
+                                r = 1;
+                                goto finish;
+                        }
+                } else if (r != -ENOENT)
+                        return r;
+        } else
                 return r;
 
         /* this will set _id to "other" and return 0 for unknown hypervisors */

commit e3d71d5dc2872bef8dbd20b29be5f6ba444a171f
Author: Mark Eichin <eichin at thok.org>
Date:   Mon Jun 9 01:57:19 2014 -0400

    man: Searching for an explanation of what a "slice unit" was, found this, felt compelled to send in fixes for the obvious typos
    
    (cherry picked from commit 299a55075d1bf478b9190191caefd5c1b934340d)

diff --git a/man/systemd.slice.xml b/man/systemd.slice.xml
index 4d27ddf..f82e6c3 100644
--- a/man/systemd.slice.xml
+++ b/man/systemd.slice.xml
@@ -56,13 +56,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
     <para>A unit configuration file whose name ends in
     <literal>.slice</literal> encodes information about a slice which
-    is a concept for hierarchially managing resources of a group of
+    is a concept for hierarchically managing resources of a group of
     processes. This management is performed by creating a node in the
     Linux Control Group (cgroup) tree. Units that manage processes
-    (primarilly scope and service units) may be assigned to a specific
-    slice. For each slice, certain resource limits may the be set that
+    (primarily scope and service units) may be assigned to a specific
+    slice. For each slice, certain resource limits may be set that
     apply to all processes of all units contained in that
-    slice. Slices are organized hierarchially in a tree. The name of
+    slice. Slices are organized hierarchically in a tree. The name of
     the slice encodes the location in the tree. The name consists of a
     dash-separated series of names, which describes the path to the
     slice from the root slice. The root slice is named,

commit 69977785a4536a4cd77793a19d3e9c226aaa2ce2
Author: David Strauss <david at davidstrauss.net>
Date:   Mon Jun 9 15:32:03 2014 -0700

    man: clarify the effect of replace-irreversibly on future conflicting jobs
    
    (cherry picked from commit 9a92e77e4325b995288ef7cac144ecbf969886df)

diff --git a/man/systemctl.xml b/man/systemctl.xml
index 4382342..dcac12b 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -218,8 +218,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
         <para>If <literal>replace-irreversibly</literal> is specified,
         operate like <literal>replace</literal>, but also mark the new
         jobs as irreversible. This prevents future conflicting
-        transactions from replacing these jobs. The jobs can still be
-        cancelled using the <command>cancel</command> command.</para>
+        transactions from replacing these jobs (or even being enqueued
+        while the irreversible jobs are still pending). Irreversible
+        jobs can still be cancelled using the <command>cancel</command>
+        command.</para>
 
         <para><literal>isolate</literal> is only valid for start
         operations and causes all other units to be stopped when the

commit 8343042f7ab7e4621156c7a41397b22512aeb88d
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Wed May 28 12:39:38 2014 -0400

    nspawn: split long message into two lines
    
    For names like /var/lib/container/something, the message
    becomes quite long. Better to split it.
    
    Also reword the message not to suggest that ^]^]^] only works
    in the beginning.
    
    (cherry picked from commit 45f1386c9adf0e2892306e8949ca71f4a52a8d36)
    
    Conflicts:
    	src/nspawn/nspawn.c

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 6b1d0bb..8ed68d1 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1757,7 +1757,7 @@ int main(int argc, char *argv[]) {
         }
 
         if (!arg_quiet)
-                log_info("Spawning container %s on %s. Press ^] three times within 1s to abort execution.", arg_machine, arg_directory);
+                log_info("Spawning container %s on %s.\nPress ^] three times within 1s to kill container.", arg_machine, arg_directory);
 
         if (unlockpt(master) < 0) {
                 log_error("Failed to unlock tty: %m");

commit 44045f883f3911ca1bcab36250bf66c0d24bc569
Author: Mantas MikulÄ—nas <grawity at gmail.com>
Date:   Mon Jun 2 16:47:15 2014 +0300

    man: fix references to sd_journal_cutoff_realtime_usec
    
    (cherry picked from commit d275b5296958446957e98ce61213f98519e11808)

diff --git a/man/sd-journal.xml b/man/sd-journal.xml
index 7a05aee..d3dc57f 100644
--- a/man/sd-journal.xml
+++ b/man/sd-journal.xml
@@ -79,7 +79,8 @@
                 <citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                 <citerefentry><refentrytitle>sd_journal_seek_head</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                 <citerefentry><refentrytitle>sd_journal_get_cursor</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-                <citerefentry><refentrytitle>sd_journal_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+                <citerefentry><refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+                <citerefentry><refentrytitle>sd_journal_get_cutoff_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                 <citerefentry><refentrytitle>sd_journal_get_usage</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                 <citerefentry><refentrytitle>sd_journal_get_catalog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
                 and
@@ -111,7 +112,8 @@
                         <citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sd_journal_seek_head</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sd_journal_get_cursor</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-                        <citerefentry><refentrytitle>sd_journal_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>sd_journal_get_cutoff_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sd_journal_get_usage</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sd_journal_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sd_journal_query_unique</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

commit 47023e8267dafc845ed51544f193e33de6c2e350
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed Jun 4 17:55:14 2014 +0200

    hwdb: fix case-sensitive match
    
    (cherry picked from commit 4c02dd7153f970244950b5e00f7bdfea8d2ff0be)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 4735c7b..8f6b71f 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -870,7 +870,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnOQO*Inc.*:pnOQO*Model*2*:pvr*
 ###########################################################
 
 # Plantronics .Audio 626 DSP
-keyboard:usb:v047fpC006*
+keyboard:usb:v047FpC006*
  KEYBOARD_KEY_b002f=f20                                # Microphone mute button; should be micmute
 
 ###########################################################

commit db75f7e5b9f699ebd4936e9342482b6ffb67cb78
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 1 14:01:23 2014 -0400

    keyboard: add Plantronics .Audio mute button
    
    https://bugs.freedesktop.org/show_bug.cgi?id=79495
    (cherry picked from commit 9e3dbf6b2b99d0e16989d9cedb458729db5a60c3)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 5bbf0f1..4735c7b 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -866,6 +866,14 @@ keyboard:dmi:bvn*:bvr*:bd*:svnOQO*Inc.*:pnOQO*Model*2*:pvr*
  KEYBOARD_KEY_f3=volumeup
 
 ###########################################################
+# Plantronics
+###########################################################
+
+# Plantronics .Audio 626 DSP
+keyboard:usb:v047fpC006*
+ KEYBOARD_KEY_b002f=f20                                # Microphone mute button; should be micmute
+
+###########################################################
 # Quanta
 ###########################################################
 

commit 54fcd1a651e89f4dd901dbecabf212f732006423
Author: Cristian Rodríguez <crrodriguez at opensuse.org>
Date:   Thu May 29 14:17:37 2014 -0400

    tty-ask-password-agent: Do tell what directory we failed to open
    
    (cherry picked from commit 267b3e41df5a2181f2911433539f81de2fa1511a)

diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index a144bdc..fac6a22 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -501,7 +501,7 @@ static int show_passwords(void) {
                 if (errno == ENOENT)
                         return 0;
 
-                log_error("opendir(): %m");
+                log_error("opendir(/run/systemd/ask-password): %m");
                 return -errno;
         }
 

commit 55cf7f15b43583bbb17bbe7220aedefeeb39e141
Author: Cristian Rodríguez <crrodriguez at opensuse.org>
Date:   Fri May 30 13:16:56 2014 -0400

    udev-builtin-keyboard: do tell on which device EVIOCSKEYCODE failed.
    
    I am getting
    
    "Error calling EVIOCSKEYCODE (scan code 0xc022d, key code 418): Invalid
    argument", the error message does not tell on which specific device the
    problem is, add that info.
    
    (cherry picked from commit a52ec8ed881537627869afa8f0486db7e20ce2db)

diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index 614e44e..9b66bfd 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -143,7 +143,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo
                         log_debug("keyboard: mapping scan code %d (0x%x) to key code %d (0x%x)",
                                   map[i].scan, map[i].scan, map[i].key, map[i].key);
                         if (ioctl(fd, EVIOCSKEYCODE, &map[i]) < 0)
-                                log_error("Error calling EVIOCSKEYCODE (scan code 0x%x, key code %d): %m", map[i].scan, map[i].key);
+                                log_error("Error calling EVIOCSKEYCODE on device node '%s' (scan code 0x%x, key code %d): %m", node, map[i].scan, map[i].key);
                 }
 
                 /* install list of force-release codes */

commit c4a42680d72b18c5bd8717e6cff3e0df049936d9
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Sat May 31 21:36:23 2014 +0200

    util: ignore_file should not allow files ending with '~'
    
    ignore_file currently allows any file ending with '~' while it
    seems that the opposite was intended:
    a228a22fda4faa9ecb7c5a5e499980c8ae5d2a08
    
    (cherry picked from commit 93f1a06374e335e8508d89e1bdaadf45be6ab777)

diff --git a/src/shared/util.c b/src/shared/util.c
index c2191e2..c3f1ed2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1377,7 +1377,7 @@ bool ignore_file(const char *filename) {
         assert(filename);
 
         if (endswith(filename, "~"))
-                return false;
+                return true;
 
         return ignore_file_allow_backup(filename);
 }

commit 62d2980f8e487ef143f6c3b765518db46228d35e
Author: Jonathan Liu <net147 at gmail.com>
Date:   Thu May 29 01:17:25 2014 +1000

    units: use KillMode=mixed for systemd-nspawn at .service
    
    This causes the container to shut down cleanly when the service is
    stopped.
    
    (cherry picked from commit d8e40d62ab871a87fde421c4b246bb45bc3cbe2d)

diff --git a/units/systemd-nspawn at .service.in b/units/systemd-nspawn at .service.in
index ff36e90..e373628 100644
--- a/units/systemd-nspawn at .service.in
+++ b/units/systemd-nspawn at .service.in
@@ -11,6 +11,7 @@ Documentation=man:systemd-nspawn(1)
 
 [Service]
 ExecStart=@bindir@/systemd-nspawn --quiet --keep-unit --boot --link-journal=guest --directory=/var/lib/container/%i
+KillMode=mixed
 Type=notify
 
 [Install]

commit 99139fe295b7356841e8dc26b5f5766ce1f209d4
Author: Thomas Bächler <thomas at archlinux.org>
Date:   Fri Feb 21 11:55:24 2014 +0100

    analyze/run: use bus_open_transport_systemd instead of bus_open_transport
    
    Both systemd-analyze and systemd-run only access org.freedesktop.systemd1
    on the bus. This patch allows using systemd-run --user and systemd-analyze
    --user even if the user session's bus is not properly integrated with the
    systemd user unit.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=79252 and other reports...
    (cherry picked from commit 1f89214e6e990a0b552f6854f87f8514ca384956)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index b82060d..6717d1a 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -1274,7 +1274,7 @@ int main(int argc, char *argv[]) {
         if (r <= 0)
                 goto finish;
 
-        r = bus_open_transport(arg_transport, arg_host, arg_user, &bus);
+        r = bus_open_transport_systemd(arg_transport, arg_host, arg_user, &bus);
         if (r < 0) {
                 log_error("Failed to create bus connection: %s", strerror(-r));
                 goto finish;
diff --git a/src/run/run.c b/src/run/run.c
index 7f08c41..0a87df3 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -490,7 +490,7 @@ int main(int argc, char* argv[]) {
                 arg_description = description;
         }
 
-        r = bus_open_transport(arg_transport, arg_host, arg_user, &bus);
+        r = bus_open_transport_systemd(arg_transport, arg_host, arg_user, &bus);
         if (r < 0) {
                 log_error("Failed to create bus connection: %s", strerror(-r));
                 goto finish;

commit 6a5aa37d144cf0d2be355324e78ff320556628a5
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Mon May 26 20:09:45 2014 +0200

    Do not unescape unit names in [Install] section
    
    https://bugs.freedesktop.org/show_bug.cgi?id=49316
    (cherry picked from commit 000f6e5667eb4f73e137cbd0d7395a9f9db7728a)

diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 65535aa..92c1497 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -719,7 +719,7 @@ int config_parse_strv(const char *unit,
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
                 _cleanup_free_ char *n;
 
-                n = cunescape_length(w, l);
+                n = strndup(w, l);
                 if (!n)
                         return log_oom();
 

commit 8d9518eb8f0dbf20e0abfb3b97845ff1f22d8dc3
Author: Kay Sievers <kay at vrfy.org>
Date:   Mon May 26 09:30:21 2014 +0800

    udev: keyboard - also hook into "change" events
    
    Re-apply the keymaps when "udevadm trigger" is called. Hooking into
    "add" only would just remove all keymap content from the udev database
    instead of applying the new config.
    
    (cherry picked from commit 49804365ea1242456c9763058a59cf68479e07ea)

diff --git a/rules/60-keyboard.rules b/rules/60-keyboard.rules
index 4e0f366..22f71e7 100644
--- a/rules/60-keyboard.rules
+++ b/rules/60-keyboard.rules
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add", GOTO="keyboard_end"
+ACTION=="remove", GOTO="keyboard_end"
 KERNEL!="event*", GOTO="keyboard_end"
 ENV{ID_INPUT_KEY}=="", GOTO="keyboard_end"
 

commit 970e92893ea9aff1df21ad5e9a19f7d1c0fdedbe
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Sun May 25 12:16:35 2014 +0200

    keymap: Asus EeePC touchpad toggle key
    
    Originally is KEY_TOUCHPAD_TOGGLE, but X.org can't handle the big key events,
    so use the F21 convention.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=72807
    (cherry picked from commit e55edb22a71e67f01534d28f91c6aa27bba48fc1)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index f23305d..5bbf0f1 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -138,6 +138,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnASUS:pn*
  KEYBOARD_KEY_ef=mute
 
 keyboard:name:Asus WMI hotkeys:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:pvr*
+keyboard:name:Eee PC WMI hotkeys:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:pvr*
  KEYBOARD_KEY_6b=f21                                    # Touchpad Toggle
 
 ###########################################################

commit f36ed0204ee1f917f8eadc37bb655324b1e4157a
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Sun May 25 11:57:22 2014 +0200

    keymap: Add Lenovo Enhanced USB Keyboard
    
    https://bugs.freedesktop.org/show_bug.cgi?id=77234
    (cherry picked from commit d258d4967eb24122c2b1014d4e873f61b633f1d2)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 4e07a52..f23305d 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -579,6 +579,18 @@ keyboard:dmi:bvn*:bvr*:svnLENOVO*:pn*IdeaPad*Z370*:pvr*
 keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*Lenovo*V480*:pvr*
  KEYBOARD_KEY_f1=f21
 
+# enhanced USB keyboard
+keyboard:usb:v04B3p301B*
+ KEYBOARD_KEY_90001=prog1 # ThinkVantage
+ KEYBOARD_KEY_90002=screenlock
+ KEYBOARD_KEY_90003=file
+ KEYBOARD_KEY_90004=wordprocessor
+ KEYBOARD_KEY_90005=spreadsheet
+ KEYBOARD_KEY_90006=calc
+ KEYBOARD_KEY_90007=mail
+ KEYBOARD_KEY_90008=www
+
+
 ###########################################################
 # Logitech
 ###########################################################

commit b56c47689c38ea4be7d0307e1e01be5acecf73be
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 16:56:21 2014 +0900

    socket: properly handle if our service vanished during runtime
    
    (cherry picked from commit 640ace4a8de907994a1b95f6d368c3e6a8fcf60f)

diff --git a/src/core/socket.c b/src/core/socket.c
index 0c76d7f..cc384b2 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1502,6 +1502,12 @@ static void socket_enter_running(Socket *s, int cfd) {
                         }
 
                 if (!pending) {
+                        if (!UNIT_ISSET(s->service)) {
+                                log_error_unit(UNIT(s)->id, "%s: service to activate vanished, refusing activation.", UNIT(s)->id);
+                                r = -ENOENT;
+                                goto fail;
+                        }
+
                         r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, true, &error, NULL);
                         if (r < 0)
                                 goto fail;

commit 31dc5786e03bf8f00371d36ed702197ed842afe6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 16:47:46 2014 +0900

    conf-parser: never consider it an error if we cannot load a drop-in file because it is missing
    
    After all, we want to be able to boot with /etc empty one day...
    
    (cherry picked from commit 9f43a07f10639c5b41b45448e551e43914eefe32)

diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index b6aa856..65535aa 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -336,8 +336,8 @@ int config_parse(const char *unit,
         if (!f) {
                 f = ours = fopen(filename, "re");
                 if (!f) {
-                        log_error("Failed to open configuration file '%s': %m", filename);
-                        return -errno;
+                        log_full(errno == ENOENT ? LOG_DEBUG : LOG_ERR, "Failed to open configuration file '%s': %m", filename);
+                        return errno == ENOENT ? 0 : -errno;
                 }
         }
 

commit 13fc6c9bfacdca10d3e7eb73cd96515cae760734
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 16:22:48 2014 +0900

    man: update URL refernce in daemon(7)
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-May/019410.html
    (cherry picked from commit 0afedd300cbe53bd5a54aefc81cede1eae9a9ab8)

diff --git a/man/daemon.xml b/man/daemon.xml
index b772aa9..f175606 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -352,7 +352,7 @@
 
                         <para>These recommendations are similar but
                         not identical to the <ulink
-                        url="http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/LaunchOnDemandDaemons.html#//apple_ref/doc/uid/TP40001762-104738">Apple
+                        url="https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html">Apple
                         MacOS X Daemon Requirements</ulink>.</para>
                 </refsect2>
 

commit ab28d5c3ed99817a76607f88e99d6d60feaf22c2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 16:15:56 2014 +0900

    man: drop reference to file locking for PID file creation from daemon(7)
    
    File locking is usually a bad idea, don't suggest using it.
    
    (cherry picked from commit c4b834a4adfa4f858ed9fd07b300588ec1c3e20e)

diff --git a/man/daemon.xml b/man/daemon.xml
index ab58d08..b772aa9 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -158,9 +158,7 @@
                                 it is verified at the same time that
                                 the PID previously stored in the PID
                                 file no longer exists or belongs to a
-                                foreign process. Commonly, some kind of
-                                file locking is employed to implement
-                                this logic.</para></listitem>
+                                foreign process.</para></listitem>
 
                                 <listitem><para>In the daemon process,
                                 drop privileges, if possible and

commit 1be1ff309f703b077bf87020d520469d33546e03
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 10:35:28 2014 +0900

    logind: also escape external data when saving to /run
    
    Better be safe than sorry...
    
    (cherry picked from commit 558c6490b1df7f82a63d0a747fda7412c4d28b0c)

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 97b7728..4873497 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -213,7 +213,6 @@ int session_save(Session *s) {
 
         if (s->scope)
                 fprintf(f, "SCOPE=%s\n", s->scope);
-
         if (s->scope_job)
                 fprintf(f, "SCOPE_JOB=%s\n", s->scope_job);
 
@@ -229,17 +228,54 @@ int session_save(Session *s) {
         if (s->display)
                 fprintf(f, "DISPLAY=%s\n", s->display);
 
-        if (s->remote_host)
-                fprintf(f, "REMOTE_HOST=%s\n", s->remote_host);
+        if (s->remote_host) {
+                _cleanup_free_ char *escaped;
+
+                escaped = cescape(s->remote_host);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                fprintf(f, "REMOTE_HOST=%s\n", escaped);
+        }
+
+        if (s->remote_user) {
+                _cleanup_free_ char *escaped;
+
+                escaped = cescape(s->remote_user);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                fprintf(f, "REMOTE_USER=%s\n", escaped);
+        }
+
+        if (s->service) {
+                _cleanup_free_ char *escaped;
 
-        if (s->remote_user)
-                fprintf(f, "REMOTE_USER=%s\n", s->remote_user);
+                escaped = cescape(s->service);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                fprintf(f, "SERVICE=%s\n", escaped);
+        }
 
-        if (s->service)
-                fprintf(f, "SERVICE=%s\n", s->service);
+        if (s->desktop) {
+                _cleanup_free_ char *escaped;
 
-        if (s->desktop)
-                fprintf(f, "DESKTOP=%s\n", s->desktop);
+
+                escaped = cescape(s->desktop);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                fprintf(f, "DESKTOP=%s\n", escaped);
+        }
 
         if (s->seat && seat_has_vts(s->seat))
                 fprintf(f, "VTNR=%u\n", s->vtnr);

commit 0be4e0b695a297e4ad0a57860798a58053a2f916
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 10:26:23 2014 +0900

    machine: escape fields we store in /run, so that they can be properly unescaped by parse_env_file()
    
    (cherry picked from commit ca5405bb4fb1fabd1fe43e4ee23edf58914bdfae)

diff --git a/src/machine/machine.c b/src/machine/machine.c
index 9a5cc9a..0793b65 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -123,17 +123,42 @@ int machine_save(Machine *m) {
                 "NAME=%s\n",
                 m->name);
 
-        if (m->unit)
-                fprintf(f, "SCOPE=%s\n", m->unit); /* We continue to call this "SCOPE=" because it is internal only, and we want to stay compatible with old files */
+        if (m->unit) {
+                _cleanup_free_ char *escaped;
+
+                escaped = cescape(m->unit);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                fprintf(f, "SCOPE=%s\n", escaped); /* We continue to call this "SCOPE=" because it is internal only, and we want to stay compatible with old files */
+        }
 
         if (m->scope_job)
                 fprintf(f, "SCOPE_JOB=%s\n", m->scope_job);
 
-        if (m->service)
-                fprintf(f, "SERVICE=%s\n", m->service);
+        if (m->service) {
+                _cleanup_free_ char *escaped;
 
-        if (m->root_directory)
-                fprintf(f, "ROOT=%s\n", m->root_directory);
+                escaped = cescape(m->service);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+                fprintf(f, "SERVICE=%s\n", escaped);
+        }
+
+        if (m->root_directory) {
+                _cleanup_free_ char *escaped;
+
+                escaped = cescape(m->root_directory);
+                if (!escaped) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+                fprintf(f, "ROOT=%s\n", escaped);
+        }
 
         if (!sd_id128_equal(m->id, SD_ID128_NULL))
                 fprintf(f, "ID=" SD_ID128_FORMAT_STR "\n", SD_ID128_FORMAT_VAL(m->id));

commit 2b1f027f8e194fdb52bc75d3607b01232bdbee15
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 22 15:19:46 2014 +0900

    nspawn: restore journal directory is empty check
    
    This undoes part of commit e6a4a517befe559adf6d1dbbadf425c3538849c9.
    
    Instead of removing the error message about non-empty journal bind mount
    directories, simply downgrade the message to a warning and proceed.
    
    (cherry picked from commit cdb2b9d05a2f3d649f47bd2ba24eb3fe30b52e92)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 5b5a907..6b1d0bb 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1115,6 +1115,9 @@ static int setup_journal(const char *directory) {
         } else if (access(p, F_OK) < 0)
                 return 0;
 
+        if (dir_is_empty(q) == 0)
+                log_warning("%s is not empty, proceeding anyway.", q);
+
         r = mkdir_p(q, 0755);
         if (r < 0) {
                 log_error("Failed to create %s: %m", q);

commit 8113d58e81f21d21cc44eda4381f56d5c4be9005
Author: Djalal Harouni <tixxdz at opendz.org>
Date:   Fri Apr 11 01:45:52 2014 +0100

    nspawn: allow to bind mount journal on top of a non empty container journal dentry
    
    Currently if nspawn was called with --link-journal=host or
    --link-journal=auto and the right /var/log/journal/machine-id/ exists
    then the bind mount the subdirectory into the container might fail due
    to the ~/mycontainer/var/log/journal/machine-id/ of the container not
    being empty.
    
    There is no reason to check if the container journal subdir is empty
    since there will be a bind mount on top of it. The user asked for a bind
    mount so give it.
    
    Note: a next call with --link-journal=guest may fail due to the
    /var/log/journal/machine-id/ on the host not being empty.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=76193
    
    Reported-by: Tobias Hunger <tobias.hunger at gmail.com>
    (cherry picked from commit e6a4a517befe559adf6d1dbbadf425c3538849c9)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 47a51be..5b5a907 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1115,11 +1115,6 @@ static int setup_journal(const char *directory) {
         } else if (access(p, F_OK) < 0)
                 return 0;
 
-        if (dir_is_empty(q) == 0) {
-                log_error("%s not empty.", q);
-                return -ENOTEMPTY;
-        }
-
         r = mkdir_p(q, 0755);
         if (r < 0) {
                 log_error("Failed to create %s: %m", q);

commit 5e608afd723b1d0d7d2b15bf661a7628994e4e18
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed May 21 18:19:24 2014 +0900

    hwdb: update
    
    (cherry picked from commit 7ba52a1283a0864b56947fa091048e8fe31a5899)

diff --git a/hwdb/20-OUI.hwdb b/hwdb/20-OUI.hwdb
index afc0d90..6188bfc 100644
--- a/hwdb/20-OUI.hwdb
+++ b/hwdb/20-OUI.hwdb
@@ -52915,6 +52915,9 @@ OUI:0CA42A*
 OUI:0CA694*
  ID_OUI_FROM_DATABASE=Sunitec Enterprise Co.,Ltd
 
+OUI:0CAC05*
+ ID_OUI_FROM_DATABASE=Unitend Technologies Inc.
+
 OUI:0CAF5A*
  ID_OUI_FROM_DATABASE=GENUS POWER INFRASTRUCTURES LIMITED
 
@@ -53164,6 +53167,9 @@ OUI:1048B1*
 OUI:104D77*
  ID_OUI_FROM_DATABASE=Innovative Computer Engineering
 
+OUI:105172*
+ ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD
+
 OUI:1056CA*
  ID_OUI_FROM_DATABASE=Peplink International Ltd.
 
@@ -53488,6 +53494,9 @@ OUI:147373*
 OUI:147411*
  ID_OUI_FROM_DATABASE=RIM
 
+OUI:147590*
+ ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
+
 OUI:147DB3*
  ID_OUI_FROM_DATABASE=JOA TELECOM.CO.,LTD
 
@@ -53899,6 +53908,9 @@ OUI:18C8E7*
 OUI:18CC23*
  ID_OUI_FROM_DATABASE=Philio Technology Corporation
 
+OUI:18CF5E*
+ ID_OUI_FROM_DATABASE=Liteon Technology Corporation
+
 OUI:18D071*
  ID_OUI_FROM_DATABASE=DASAN SMC, Inc.
 
@@ -54517,6 +54529,9 @@ OUI:20E791*
 OUI:20EAC7*
  ID_OUI_FROM_DATABASE=SHENZHEN RIOPINE ELECTRONICS CO., LTD
 
+OUI:20ED74*
+ ID_OUI_FROM_DATABASE=Ability enterprise co.,Ltd.
+
 OUI:20EEC6*
  ID_OUI_FROM_DATABASE=Elefirst Science & Tech Co ., ltd
 
@@ -54742,6 +54757,9 @@ OUI:24CBE7*
 OUI:24CF21*
  ID_OUI_FROM_DATABASE=Shenzhen State Micro Technology Co., Ltd
 
+OUI:24D13F*
+ ID_OUI_FROM_DATABASE=MEXUS CO.,LTD
+
 OUI:24D2CC*
  ID_OUI_FROM_DATABASE=SmartDrive Systems Inc.
 
@@ -55438,6 +55456,9 @@ OUI:2CF203*
 OUI:2CF4C5*
  ID_OUI_FROM_DATABASE=Avaya, Inc
 
+OUI:2CFAA2*
+ ID_OUI_FROM_DATABASE=Alcatel-Lucent
+
 OUI:30055C*
  ID_OUI_FROM_DATABASE=Brother industries, LTD.
 
@@ -55708,6 +55729,9 @@ OUI:30F9ED*
 OUI:30FD11*
  ID_OUI_FROM_DATABASE=MACROTECH (USA) INC.
 
+OUI:3400A3*
+ ID_OUI_FROM_DATABASE=HUAWEI TECHNOLOGIES CO.,LTD
+
 OUI:340286*
  ID_OUI_FROM_DATABASE=Intel Corporate
 
@@ -56077,6 +56101,9 @@ OUI:38229D*
 OUI:3822D6*
  ID_OUI_FROM_DATABASE=H3C Technologies Co., Limited
 
+OUI:38262B*
+ ID_OUI_FROM_DATABASE=UTran Technology
+
 OUI:3826CD*
  ID_OUI_FROM_DATABASE=ANDTEK
 
@@ -56395,6 +56422,9 @@ OUI:3C404F*
 OUI:3C438E*
  ID_OUI_FROM_DATABASE=ARRIS Group, Inc.
 
+OUI:3C46D8*
+ ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
+
 OUI:3C4A92*
  ID_OUI_FROM_DATABASE=Hewlett-Packard Company
 
@@ -56710,6 +56740,9 @@ OUI:404A18*
 OUI:404D8E*
  ID_OUI_FROM_DATABASE=Shenzhen Huawei Communication Technologies Co., Ltd
 
+OUI:404EEB*
+ ID_OUI_FROM_DATABASE=Higher Way Electronic Co., Ltd.
+
 OUI:4050E0*
  ID_OUI_FROM_DATABASE=Milton Security Group LLC
 
@@ -57709,6 +57742,9 @@ OUI:4CB9C8*
 OUI:4CBAA3*
  ID_OUI_FROM_DATABASE=Bison Electronics Inc.
 
+OUI:4CBB58*
+ ID_OUI_FROM_DATABASE=Chicony Electronics Co., Ltd.
+
 OUI:4CBCA5*
  ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
 
@@ -57757,6 +57793,9 @@ OUI:4CEDDE*
 OUI:4CF02E*
  ID_OUI_FROM_DATABASE=Vifa Denmark A/S
 
+OUI:4CF2BF*
+ ID_OUI_FROM_DATABASE=Cambridge Industries(Group) Co.,Ltd.
+
 OUI:4CF45B*
  ID_OUI_FROM_DATABASE=Blue Clover Devices
 
@@ -57994,6 +58033,9 @@ OUI:50B888*
 OUI:50B8A2*
  ID_OUI_FROM_DATABASE=ImTech Technologies LLC,
 
+OUI:50BD5F*
+ ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
+
 OUI:50C006*
  ID_OUI_FROM_DATABASE=Carmanah Signs
 
@@ -58285,6 +58327,9 @@ OUI:54D1B0*
 OUI:54D46F*
  ID_OUI_FROM_DATABASE=Cisco SPVTG
 
+OUI:54DF00*
+ ID_OUI_FROM_DATABASE=Ulterius Technologies, LLC
+
 OUI:54DF63*
  ID_OUI_FROM_DATABASE=Intrakey technologies GmbH
 
@@ -58597,6 +58642,9 @@ OUI:58F6BF*
 OUI:58F98E*
  ID_OUI_FROM_DATABASE=SECUDOS GmbH
 
+OUI:58FCDB*
+ ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY  - Please see MAM public listing for more information.
+
 OUI:58FD20*
  ID_OUI_FROM_DATABASE=Bravida Sakerhet AB
 
@@ -58621,6 +58669,9 @@ OUI:5C1193*
 OUI:5C1437*
  ID_OUI_FROM_DATABASE=Thyssenkrupp Aufzugswerke GmbH
 
+OUI:5C1515*
+ ID_OUI_FROM_DATABASE=ADVAN
+
 OUI:5C15E1*
  ID_OUI_FROM_DATABASE=AIDC TECHNOLOGY (S) PTE LTD
 
@@ -58891,12 +58942,18 @@ OUI:5CF96A*
 OUI:5CF9DD*
  ID_OUI_FROM_DATABASE=Dell Inc
 
+OUI:5CF9F0*
+ ID_OUI_FROM_DATABASE=Atomos Engineering P/L
+
 OUI:5CFF35*
  ID_OUI_FROM_DATABASE=Wistron Corporation
 
 OUI:5CFFFF*
  ID_OUI_FROM_DATABASE=Shenzhen Kezhonglong Optoelectronic Technology Co., Ltd
 
+OUI:600292*
+ ID_OUI_FROM_DATABASE=PEGATRON CORPORATION
+
 OUI:6002B4*
  ID_OUI_FROM_DATABASE=Wistron NeWeb Corp.
 
@@ -59323,6 +59380,9 @@ OUI:644F74*
 OUI:644FB0*
  ID_OUI_FROM_DATABASE=Hyunjin.com
 
+OUI:645106*
+ ID_OUI_FROM_DATABASE=Hewlett Packard
+
 OUI:64517E*
  ID_OUI_FROM_DATABASE=LONG BEN (DONGGUAN) ELECTRONIC TECHNOLOGY CO.,LTD.
 
@@ -59902,6 +59962,9 @@ OUI:68FB95*
 OUI:68FCB3*
  ID_OUI_FROM_DATABASE=Next Level Security Systems, Inc.
 
+OUI:6C0273*
+ ID_OUI_FROM_DATABASE=Shenzhen Jin Yun Video Equipment Co., Ltd.
+
 OUI:6C0460*
  ID_OUI_FROM_DATABASE=RBH Access Technologies Inc.
 
@@ -60874,6 +60937,9 @@ OUI:781FDB*
 OUI:78223D*
  ID_OUI_FROM_DATABASE=Affirmed Networks
 
+OUI:7824AF*
+ ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC.
+
 OUI:782544*
  ID_OUI_FROM_DATABASE=Omnima Limited
 
@@ -60919,6 +60985,9 @@ OUI:784405*
 OUI:784476*
  ID_OUI_FROM_DATABASE=Zioncom technology co.,ltd
 
+OUI:784561*
+ ID_OUI_FROM_DATABASE=CyberTAN Technology Inc.
+
 OUI:7845C4*
  ID_OUI_FROM_DATABASE=Dell Inc
 
@@ -61024,6 +61093,9 @@ OUI:789966*
 OUI:78998F*
  ID_OUI_FROM_DATABASE=MEDILINE ITALIA SRL
 
+OUI:789CE7*
+ ID_OUI_FROM_DATABASE=Shenzhen Aikede Technology Co., Ltd
+
 OUI:789ED0*
  ID_OUI_FROM_DATABASE=Samsung Electronics
 
@@ -61480,6 +61552,9 @@ OUI:7CC8D7*
 OUI:7CCB0D*
  ID_OUI_FROM_DATABASE=Antaira Technologies, LLC
 
+OUI:7CCCB8*
+ ID_OUI_FROM_DATABASE=Intel Corporate
+
 OUI:7CCD11*
  ID_OUI_FROM_DATABASE=MS-Magnet
 
@@ -61945,6 +62020,9 @@ OUI:842F75*
 OUI:8430E5*
  ID_OUI_FROM_DATABASE=SkyHawke Technologies, LLC
 
+OUI:8432EA*
+ ID_OUI_FROM_DATABASE=ANHUI WANZTEN P&T CO., LTD
+
 OUI:843497*
  ID_OUI_FROM_DATABASE=Hewlett Packard
 
@@ -63295,6 +63373,9 @@ OUI:94CDAC*
 OUI:94CE2C*
  ID_OUI_FROM_DATABASE=Sony Mobile Communications AB
 
+OUI:94CE31*
+ ID_OUI_FROM_DATABASE=CTS Limited
+
 OUI:94D019*
  ID_OUI_FROM_DATABASE=Cydle Corp.
 
@@ -63409,6 +63490,9 @@ OUI:982CBE*
 OUI:982D56*
  ID_OUI_FROM_DATABASE=Resolution Audio
 
+OUI:982F3C*
+ ID_OUI_FROM_DATABASE=Sichuan Changhong Electric Ltd.
+
 OUI:983000*
  ID_OUI_FROM_DATABASE=Beijing KEMACOM Technologies Co., Ltd.
 
@@ -63508,6 +63592,9 @@ OUI:9876B6*
 OUI:987770*
  ID_OUI_FROM_DATABASE=Pep Digital Technology (Guangzhou) Co., Ltd
 
+OUI:987E46*
+ ID_OUI_FROM_DATABASE=Emizon Networks Limited
+
 OUI:988217*
  ID_OUI_FROM_DATABASE=Disruptive Ltd
 
@@ -64303,6 +64390,9 @@ OUI:A40BED*
 OUI:A40CC3*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
+OUI:A41242*
+ ID_OUI_FROM_DATABASE=NEC AccessTechnica, Ltd.
+
 OUI:A4134E*
  ID_OUI_FROM_DATABASE=Luxul
 
@@ -65740,6 +65830,9 @@ OUI:B4B5AF*
 OUI:B4B676*
  ID_OUI_FROM_DATABASE=Intel Corporate
 
+OUI:B4B859*
+ ID_OUI_FROM_DATABASE=Texa Spa
+
 OUI:B4B88D*
  ID_OUI_FROM_DATABASE=Thuh Company
 
@@ -65815,6 +65908,9 @@ OUI:B80305*
 OUI:B80415*
  ID_OUI_FROM_DATABASE=Bayan Audio
 
+OUI:B808CF*
+ ID_OUI_FROM_DATABASE=Intel Corporate
+
 OUI:B80B9D*
  ID_OUI_FROM_DATABASE=ROPEX Industrie-Elektronik GmbH
 
@@ -66277,6 +66373,9 @@ OUI:BC5FF4*
 OUI:BC629F*
  ID_OUI_FROM_DATABASE=Telenet Systems P. Ltd.
 
+OUI:BC671C*
+ ID_OUI_FROM_DATABASE=Cisco
+
 OUI:BC6778*
  ID_OUI_FROM_DATABASE=Apple
 
@@ -66412,6 +66511,9 @@ OUI:BCCFCC*
 OUI:BCD177*
  ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
 
+OUI:BCD1D3*
+ ID_OUI_FROM_DATABASE=Tinno Mobile Technology Corp
+
 OUI:BCD5B6*
  ID_OUI_FROM_DATABASE=d2d technologies
 
@@ -66706,6 +66808,9 @@ OUI:C0E54E*
 OUI:C0EAE4*
  ID_OUI_FROM_DATABASE=Sonicwall
 
+OUI:C0EEFB*
+ ID_OUI_FROM_DATABASE=OnePlus Tech (Shenzhen) Ltd
+
 OUI:C0F1C4*
  ID_OUI_FROM_DATABASE=Pacidal Corporation Ltd.
 
@@ -66721,6 +66826,9 @@ OUI:C0F8DA*
 OUI:C0F991*
  ID_OUI_FROM_DATABASE=GME Standard Communications P/L
 
+OUI:C40006*
+ ID_OUI_FROM_DATABASE=Lipi Data Systems Ltd.
+
 OUI:C40142*
  ID_OUI_FROM_DATABASE=MaxMedia Technology Limited
 
@@ -67885,6 +67993,9 @@ OUI:D09C30*
 OUI:D09D0A*
  ID_OUI_FROM_DATABASE=LINKCOM
 
+OUI:D0A0D6*
+ ID_OUI_FROM_DATABASE=Chengdu TD Tech Ltd.
+
 OUI:D0A311*
  ID_OUI_FROM_DATABASE=Neuberger Gebäudeautomation GmbH
 
@@ -68126,7 +68237,7 @@ OUI:D45AB2*
  ID_OUI_FROM_DATABASE=Galleon Systems
 
 OUI:D45C70*
- ID_OUI_FROM_DATABASE=Wireless Gigabit Alliance
+ ID_OUI_FROM_DATABASE=Wi-Fi Alliance
 
 OUI:D45D42*
  ID_OUI_FROM_DATABASE=Nokia Corporation
@@ -68359,6 +68470,9 @@ OUI:D808F5*
 OUI:D809C3*
  ID_OUI_FROM_DATABASE=Cercacor Labs
 
+OUI:D80CCF*
+ ID_OUI_FROM_DATABASE=C.G.V. S.A.S.
+
 OUI:D80DE3*
  ID_OUI_FROM_DATABASE=FXI TECHNOLOGIES AS
 
@@ -68386,6 +68500,9 @@ OUI:D81EDE*
 OUI:D824BD*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
+OUI:D82522*
+ ID_OUI_FROM_DATABASE=Pace plc
+
 OUI:D826B9*
  ID_OUI_FROM_DATABASE=Guangdong Coagent Electronics S &T Co., Ltd.
 
@@ -68521,6 +68638,9 @@ OUI:D89685*
 OUI:D89695*
  ID_OUI_FROM_DATABASE=Apple
 
+OUI:D896E0*
+ ID_OUI_FROM_DATABASE=Alibaba Cloud Computing Ltd.
+
 OUI:D8973B*
  ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
@@ -68941,6 +69061,9 @@ OUI:E01C41*
 OUI:E01CEE*
  ID_OUI_FROM_DATABASE=Bravo Tech, Inc.
 
+OUI:E01D38*
+ ID_OUI_FROM_DATABASE=Beijing HuaqinWorld Technology Co.,Ltd
+
 OUI:E01D3B*
  ID_OUI_FROM_DATABASE=Cambridge Industries(Group) Co.,Ltd
 
@@ -69373,6 +69496,9 @@ OUI:E47CF9*
 OUI:E47D5A*
  ID_OUI_FROM_DATABASE=Beijing Hanbang Technology Corp.
 
+OUI:E47FB2*
+ ID_OUI_FROM_DATABASE=Fujitsu Limited
+
 OUI:E48184*
  ID_OUI_FROM_DATABASE=Alcatel-Lucent
 
@@ -69829,6 +69955,9 @@ OUI:EC219F*
 OUI:EC2257*
  ID_OUI_FROM_DATABASE=JiangSu NanJing University Electronic Information Technology Co.,Ltd
 
+OUI:EC2280*
+ ID_OUI_FROM_DATABASE=D-Link International
+
 OUI:EC233D*
  ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
 
@@ -69970,6 +70099,9 @@ OUI:ECB106*
 OUI:ECB541*
  ID_OUI_FROM_DATABASE=SHINANO E and E Co.Ltd.
 
+OUI:ECB907*
+ ID_OUI_FROM_DATABASE=CloudGenix Inc
+
 OUI:ECBBAE*
  ID_OUI_FROM_DATABASE=Digivoice Tecnologia em Eletronica Ltda
 
@@ -70189,6 +70321,9 @@ OUI:F0728C*
 OUI:F073AE*
  ID_OUI_FROM_DATABASE=PEAK-System Technik
 
+OUI:F0761C*
+ ID_OUI_FROM_DATABASE=COMPAL INFORMATION (KUNSHAN) CO., LTD.
+
 OUI:F07765*
  ID_OUI_FROM_DATABASE=Sourcefire, Inc
 
@@ -70378,6 +70513,9 @@ OUI:F40321*
 OUI:F4044C*
  ID_OUI_FROM_DATABASE=ValenceTech Limited
 
+OUI:F40669*
+ ID_OUI_FROM_DATABASE=Intel Corporate
+
 OUI:F4068D*
  ID_OUI_FROM_DATABASE=devolo AG
 
@@ -70642,6 +70780,9 @@ OUI:F4EC38*
 OUI:F4F15A*
  ID_OUI_FROM_DATABASE=Apple
 
+OUI:F4F26D*
+ ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
+
 OUI:F4F5A5*
  ID_OUI_FROM_DATABASE=Nokia corporation
 
@@ -70825,6 +70966,9 @@ OUI:F871FE*
 OUI:F872EA*
  ID_OUI_FROM_DATABASE=Cisco
 
+OUI:F87394*
+ ID_OUI_FROM_DATABASE=NETGEAR INC.,
+
 OUI:F8769B*
  ID_OUI_FROM_DATABASE=Neopis Co., Ltd.
 
@@ -70915,6 +71059,9 @@ OUI:F8C001*
 OUI:F8C091*
  ID_OUI_FROM_DATABASE=Highgates Technology
 
+OUI:F8C288*
+ ID_OUI_FROM_DATABASE=Cisco
+
 OUI:F8C678*
  ID_OUI_FROM_DATABASE=Carefusion
 
@@ -71167,6 +71314,9 @@ OUI:FC683E*
 OUI:FC6C31*
  ID_OUI_FROM_DATABASE=LXinstruments GmbH
 
+OUI:FC6DC0*
+ ID_OUI_FROM_DATABASE=BME CORPORATION
+
 OUI:FC7516*
  ID_OUI_FROM_DATABASE=D-Link International
 
@@ -71319,3 +71469,6 @@ OUI:FCFBFB*
 
 OUI:FCFE77*
  ID_OUI_FROM_DATABASE=Hitachi Reftechno, Inc.
+
+OUI:FCFFAA*
+ ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY  - Please see MAL public listing for more information.
diff --git a/hwdb/20-pci-vendor-model.hwdb b/hwdb/20-pci-vendor-model.hwdb
index 2957774..62941b9 100644
--- a/hwdb/20-pci-vendor-model.hwdb
+++ b/hwdb/20-pci-vendor-model.hwdb
@@ -4205,6 +4205,9 @@ pci:v00001002d00005F57*
 pci:v00001002d00006600*
  ID_MODEL_FROM_DATABASE=Mars [Radeon HD 8670A/8670M/8750M]
 
+pci:v00001002d00006600sv0000103Csd00001952*
+ ID_MODEL_FROM_DATABASE=Mars [Radeon HD 8670A/8670M/8750M] (ProBook 455 G1)
+
 pci:v00001002d00006601*
  ID_MODEL_FROM_DATABASE=Mars [Radeon HD 8730M]
 
@@ -4292,6 +4295,12 @@ pci:v00001002d00006640*
 pci:v00001002d00006641*
  ID_MODEL_FROM_DATABASE=Saturn PRO [Radeon HD 8930M]
 
+pci:v00001002d00006646*
+ ID_MODEL_FROM_DATABASE=Bonaire XT [Radeon R9 M280X]
+
+pci:v00001002d00006647*
+ ID_MODEL_FROM_DATABASE=Bonaire PRO [Radeon R9 M270X]
+
 pci:v00001002d00006649*
  ID_MODEL_FROM_DATABASE=Bonaire [FirePro W5100]
 
@@ -6137,6 +6146,9 @@ pci:v00001002d0000683Dsv0000103Csd00006890*
 pci:v00001002d0000683Dsv00001043sd00008760*
  ID_MODEL_FROM_DATABASE=Cape Verde XT [Radeon HD 7770/8760 / R7 250X] (Radeon HD 8760 OEM)
 
+pci:v00001002d0000683Dsv00001462sd00002710*
+ ID_MODEL_FROM_DATABASE=Cape Verde XT [Radeon HD 7770/8760 / R7 250X] (R7770-PMD1GD5)
+
 pci:v00001002d0000683Dsv0000174Bsd00008304*
  ID_MODEL_FROM_DATABASE=Cape Verde XT [Radeon HD 7770/8760 / R7 250X] (Radeon HD 8760 OEM)
 
@@ -7856,6 +7868,15 @@ pci:v00001002d00006901*
 pci:v00001002d00006920*
  ID_MODEL_FROM_DATABASE=Tonga
 
+pci:v00001002d00006921*
+ ID_MODEL_FROM_DATABASE=Amethyst XT [Radeon R9 M295X]
+
+pci:v00001002d0000692B*
+ ID_MODEL_FROM_DATABASE=Tonga XT GL [FirePro W8100]
+
+pci:v00001002d0000692F*
+ ID_MODEL_FROM_DATABASE=Tonga XT GL [FirePro W8100]
+
 pci:v00001002d0000700F*
  ID_MODEL_FROM_DATABASE=RS100 AGP Bridge
 
@@ -24470,6 +24491,9 @@ pci:v000010DEd00000640*
 pci:v000010DEd00000641*
  ID_MODEL_FROM_DATABASE=G96 [GeForce 9400 GT]
 
+pci:v000010DEd00000641sv00001682sd00004009*
+ ID_MODEL_FROM_DATABASE=G96 [GeForce 9400 GT] (PV-T94G-ZAFG)
+
 pci:v000010DEd00000643*
  ID_MODEL_FROM_DATABASE=G96 [GeForce 9500 GT]
 
@@ -26306,6 +26330,9 @@ pci:v000010DEd00000FD8*
 pci:v000010DEd00000FD9*
  ID_MODEL_FROM_DATABASE=GK107M [GeForce GT 645M]
 
+pci:v000010DEd00000FDB*
+ ID_MODEL_FROM_DATABASE=GK107M
+
 pci:v000010DEd00000FDF*
  ID_MODEL_FROM_DATABASE=GK107M [GeForce GT 740M]
 
@@ -26861,6 +26888,12 @@ pci:v000010DEd00001140sv00001028sd000005E8*
 pci:v000010DEd00001140sv00001028sd000005F4*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M)
 
+pci:v000010DEd00001140sv00001028sd0000064E*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv00001028sd0000068D*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
 pci:v000010DEd00001140sv0000103Csd000018EF*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 630M)
 
@@ -27185,6 +27218,36 @@ pci:v000010DEd00001140sv000017AAsd00003803*
 pci:v000010DEd00001140sv000017AAsd00003804*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M)
 
+pci:v000010DEd00001140sv000017AAsd00003806*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M)
+
+pci:v000010DEd00001140sv000017AAsd00003808*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M)
+
+pci:v000010DEd00001140sv000017AAsd0000380D*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd0000380E*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd0000380F*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00003811*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00003812*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00003813*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00003816*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00003818*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
 pci:v000010DEd00001140sv000017AAsd00003901*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 610M / GT 620M)
 
@@ -27260,12 +27323,27 @@ pci:v000010DEd00001140sv000017AAsd0000502E*
 pci:v000010DEd00001140sv000017AAsd0000502F*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce GT 720M)
 
+pci:v000010DEd00001140sv000017AAsd00005030*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 705M)
+
+pci:v000010DEd00001140sv000017AAsd00005031*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 705M)
+
+pci:v000010DEd00001140sv000017AAsd00005032*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
+pci:v000010DEd00001140sv000017AAsd00005033*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
 pci:v000010DEd00001140sv000017AAsd0000503E*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 710M)
 
 pci:v000010DEd00001140sv000017AAsd0000503F*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
 
+pci:v000010DEd00001140sv000017AAsd00005040*
+ ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 820M)
+
 pci:v000010DEd00001140sv00001854sd00000177*
  ID_MODEL_FROM_DATABASE=GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (GeForce 710M)
 
@@ -28443,7 +28521,7 @@ pci:v000010ECd00008168sv00001043sd00008432*
  ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (P8P67 and other motherboards)
 
 pci:v000010ECd00008168sv00001043sd00008505*
- ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (P8 series motherboard)
 
 pci:v000010ECd00008168sv0000105Bsd00000D7C*
  ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (D270S/D250S Motherboard)
@@ -35300,6 +35378,9 @@ pci:v000011ABd00007810*
 pci:v000011ABd00007820*
  ID_MODEL_FROM_DATABASE=MV78200 [Discovery Innovation] ARM SoC
 
+pci:v000011ABd00007823*
+ ID_MODEL_FROM_DATABASE=MV78230 [Armada XP] ARM SoC
+
 pci:v000011ABd0000F003*
  ID_MODEL_FROM_DATABASE=GT-64010 Primary Image Piranha Image Generator
 
@@ -36602,17 +36683,20 @@ pci:v00001217d00008120*
 pci:v00001217d00008130*
  ID_MODEL_FROM_DATABASE=Integrated MS/MSPRO/xD Controller
 
+pci:v00001217d00008220*
+ ID_MODEL_FROM_DATABASE=OZ600FJ1/OZ900FJ1 SD/MMC Card Reader Controller
+
 pci:v00001217d00008221*
- ID_MODEL_FROM_DATABASE=SD/MMC Card Reader Controller
+ ID_MODEL_FROM_DATABASE=OZ600FJ0/OZ900FJ0/OZ600FJS SD/MMC Card Reader Controller
 
 pci:v00001217d00008320*
- ID_MODEL_FROM_DATABASE=OZ600 MMC/SD Controller
+ ID_MODEL_FROM_DATABASE=OZ600RJ1/OZ900RJ1 SD/MMC Card Reader Controller
 
 pci:v00001217d00008320sv00001028sd000004A3*
- ID_MODEL_FROM_DATABASE=OZ600 MMC/SD Controller (Precision M4600)
+ ID_MODEL_FROM_DATABASE=OZ600RJ1/OZ900RJ1 SD/MMC Card Reader Controller (Precision M4600)
 
 pci:v00001217d00008321*
- ID_MODEL_FROM_DATABASE=Integrated MMC/SD controller
+ ID_MODEL_FROM_DATABASE=OZ600RJ0/OZ900RJ0/OZ600RJS SD/MMC Card Reader Controller
 
 pci:v00001217d00008330*
  ID_MODEL_FROM_DATABASE=OZ600 MS/xD Controller
@@ -46403,6 +46487,9 @@ pci:v000014F1d00008800sv00000070sd00009802*
 pci:v000014F1d00008800sv00001002sd000000F8*
  ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (ATI TV Wonder Pro)
 
+pci:v000014F1d00008800sv00001002sd000000F9*
+ ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (ATI TV Wonder)
+
 pci:v000014F1d00008800sv00001002sd0000A101*
  ID_MODEL_FROM_DATABASE=CX23880/1/2/3 PCI Video and Audio Decoder (HDTV Wonder)
 
@@ -50978,6 +51065,12 @@ pci:v000018F4d00000125*
 pci:v000018F4d00000135*
  ID_MODEL_FROM_DATABASE=NT20E2-PTP Network Adapter 2x10Gb
 
+pci:v000018F4d00000145*
+ ID_MODEL_FROM_DATABASE=NT40E3-4-PTP Network Adapter 4x10Gb
+
+pci:v000018F4d00000155*
+ ID_MODEL_FROM_DATABASE=NT100E3-1-PTP Network Adapter 1x100Gb
+
 pci:v000018F6*
  ID_VENDOR_FROM_DATABASE=NextIO
 
@@ -55143,7 +55236,7 @@ pci:v00008086d00000150*
  ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
 
 pci:v00008086d00000150sv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (P8 series motherboard)
 
 pci:v00008086d00000150sv00001849sd00000150*
  ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (Motherboard)
@@ -55229,6 +55322,9 @@ pci:v00008086d0000015E*
 pci:v00008086d00000162*
  ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
 
+pci:v00008086d00000162sv00001043sd000084CA*
+ ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (P8 series motherboard)
+
 pci:v00008086d00000162sv00001849sd00000162*
  ID_MODEL_FROM_DATABASE=Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (Motherboard)
 
@@ -59061,10 +59157,10 @@ pci:v00008086d00001521sv00001028sd00000602*
  ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Gigabit 2P I350-t LOM)
 
 pci:v00008086d00001521sv00001028sd00001F60*
- ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Intel GbE 4P I350crNDC)
+ ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Gigabit 4P I350-t rNDC)
 
 pci:v00008086d00001521sv00001028sd00001F62*
- ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Intel GbE 2P I350crNDC)
+ ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Gigabit 4P X540/I350 rNDC)
 
 pci:v00008086d00001521sv00001028sd0000FF9A*
  ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection (Gigabit 4P X710/I350 rNDC)
@@ -59250,7 +59346,10 @@ pci:v00008086d00001533*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection
 
 pci:v00008086d00001533sv0000103Csd00000003*
- ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection (Ethernet Server Adapter I210-T1)
+ ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection (Ethernet I210-T1 GbE NIC)
+
+pci:v00008086d00001533sv000010A9sd0000802C*
+ ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection (UV300 BaseIO single-port GbE)
 
 pci:v00008086d00001533sv000017AAsd00001100*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection (ThinkServer Ethernet Server Adapter)
@@ -59261,15 +59360,15 @@ pci:v00008086d00001533sv00008086sd00000001*
 pci:v00008086d00001533sv00008086sd00000002*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection (Ethernet Server Adapter I210-T1)
 
-pci:v00008086d00001534*
- ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection
-
 pci:v00008086d00001536*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Fiber Network Connection
 
 pci:v00008086d00001537*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Backplane Connection
 
+pci:v00008086d00001538*
+ ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection
+
 pci:v00008086d00001539*
  ID_MODEL_FROM_DATABASE=I211 Gigabit Network Connection
 
@@ -60267,7 +60366,7 @@ pci:v00008086d00001E02*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode]
 
 pci:v00008086d00001E02sv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (P8 series motherboard)
 
 pci:v00008086d00001E02sv00001849sd00001E02*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (Motherboard)
@@ -60374,6 +60473,9 @@ pci:v00008086d00001E20sv00001043sd00001517*
 pci:v00008086d00001E20sv00001043sd00008415*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family High Definition Audio Controller (P8H77-I Motherboard)
 
+pci:v00008086d00001E20sv00001043sd00008445*
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family High Definition Audio Controller (ASUS P8Z77-V LX Motherboard)
+
 pci:v00008086d00001E20sv00001849sd00001898*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family High Definition Audio Controller (Z77 Extreme4 motherboard)
 
@@ -60387,7 +60489,7 @@ pci:v00008086d00001E22sv00001043sd00001517*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family SMBus Controller (Zenbook Prime UX31A)
 
 pci:v00008086d00001E22sv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family SMBus Controller (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family SMBus Controller (P8 series motherboard)
 
 pci:v00008086d00001E22sv00001849sd00001E22*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family SMBus Controller (Motherboard)
@@ -60411,7 +60513,7 @@ pci:v00008086d00001E26sv00001043sd00001517*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (Zenbook Prime UX31A)
 
 pci:v00008086d00001E26sv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (P8 series motherboard)
 
 pci:v00008086d00001E26sv00001849sd00001E26*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (Motherboard)
@@ -60426,7 +60528,7 @@ pci:v00008086d00001E2Dsv00001043sd00001517*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (Zenbook Prime UX31A)
 
 pci:v00008086d00001E2Dsv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (P8 series motherboard)
 
 pci:v00008086d00001E2Dsv00001849sd00001E2D*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (Motherboard)
@@ -60444,7 +60546,7 @@ pci:v00008086d00001E31sv00001043sd00001517*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB xHCI Host Controller (Zenbook Prime UX31A)
 
 pci:v00008086d00001E31sv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB xHCI Host Controller (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB xHCI Host Controller (P8 series motherboard)
 
 pci:v00008086d00001E31sv00001849sd00001E31*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family USB xHCI Host Controller (Motherboard)
@@ -60462,7 +60564,7 @@ pci:v00008086d00001E3Asv00001043sd00001517*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family MEI Controller #1 (Zenbook Prime UX31A)
 
 pci:v00008086d00001E3Asv00001043sd000084CA*
- ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family MEI Controller #1 (P8H77-I Motherboard)
+ ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family MEI Controller #1 (P8 series motherboard)
 
 pci:v00008086d00001E3Asv00001849sd00001E3A*
  ID_MODEL_FROM_DATABASE=7 Series/C210 Series Chipset Family MEI Controller #1 (Motherboard)
@@ -60488,6 +60590,9 @@ pci:v00008086d00001E43*
 pci:v00008086d00001E44*
  ID_MODEL_FROM_DATABASE=Z77 Express Chipset LPC Controller
 
+pci:v00008086d00001E44sv00001043sd000084CA*
+ ID_MODEL_FROM_DATABASE=Z77 Express Chipset LPC Controller (P8 series motherboard)
+
 pci:v00008086d00001E44sv00001849sd00001E44*
  ID_MODEL_FROM_DATABASE=Z77 Express Chipset LPC Controller (Motherboard)
 
diff --git a/hwdb/20-usb-vendor-model.hwdb b/hwdb/20-usb-vendor-model.hwdb
index 52586bc..05f267d 100644
--- a/hwdb/20-usb-vendor-model.hwdb
+++ b/hwdb/20-usb-vendor-model.hwdb
@@ -41163,7 +41163,7 @@ usb:v1234pED02*
  ID_MODEL_FROM_DATABASE=Emotiv EPOC Developer Headset Wireless Dongle
 
 usb:v1235*
- ID_VENDOR_FROM_DATABASE=Novation EMS
+ ID_VENDOR_FROM_DATABASE=Focusrite-Novation
 
 usb:v1235p0001*
  ID_MODEL_FROM_DATABASE=ReMOTE Audio/XStation First Edition
@@ -41729,6 +41729,9 @@ usb:v12D1p155A*
 usb:v12D1p1575*
  ID_MODEL_FROM_DATABASE=K5150 LTE modem
 
+usb:v12D1p15CA*
+ ID_MODEL_FROM_DATABASE=E3131 3G/UMTS/HSPA+ Modem (Mass Storage Mode)
+
 usb:v12D1p1805*
  ID_MODEL_FROM_DATABASE=AT&T Go Phone U2800A phone
 
@@ -41744,6 +41747,12 @@ usb:v12D1p1C20*
 usb:v12D1p1D50*
  ID_MODEL_FROM_DATABASE=ET302s TD-SCDMA/TD-HSDPA Mobile Broadband
 
+usb:v12D1p1F01*
+ ID_MODEL_FROM_DATABASE=E353/E3131 (Mass storage mode)
+
+usb:v12D1p1F16*
+ ID_MODEL_FROM_DATABASE=K5150 LTE modem (Mass Storage Mode)
+
 usb:v12D1p380B*
  ID_MODEL_FROM_DATABASE=WiMAX USB modem(s)
 
@@ -41762,6 +41771,12 @@ usb:v12D6p0888*
 usb:v12D7*
  ID_VENDOR_FROM_DATABASE=BETTER WIRE FACTORY CO., LTD.
 
+usb:v12D8*
+ ID_VENDOR_FROM_DATABASE=Araneus Information Systems Oy
+
+usb:v12D8p0001*
+ ID_MODEL_FROM_DATABASE=Alea I True Random Number Generator
+
 usb:v12E6*
  ID_VENDOR_FROM_DATABASE=Waldorf Music GmbH
 
@@ -41805,7 +41820,7 @@ usb:v1307p0163*
  ID_MODEL_FROM_DATABASE=256MB/512MB/1GB Flash Drive
 
 usb:v1307p0165*
- ID_MODEL_FROM_DATABASE=2GB/4GB Flash Drive
+ ID_MODEL_FROM_DATABASE=2GB/4GB/8GB Flash Drive
 
 usb:v1307p0190*
  ID_MODEL_FROM_DATABASE=Ut190 8 GB Flash Drive with MicroSD reader
@@ -41846,6 +41861,51 @@ usb:v1312*
 usb:v1313*
  ID_VENDOR_FROM_DATABASE=ThorLabs
 
+usb:v1313p0010*
+ ID_MODEL_FROM_DATABASE=LC1 Linear Camera (Jungo)
+
+usb:v1313p0011*
+ ID_MODEL_FROM_DATABASE=SP1 Spectrometer (Jungo)
+
+usb:v1313p0012*
+ ID_MODEL_FROM_DATABASE=SP2 Spectrometer (Jungo)
+
+usb:v1313p0110*
+ ID_MODEL_FROM_DATABASE=LC1 Linear Camera (VISA)
+
+usb:v1313p0111*
+ ID_MODEL_FROM_DATABASE=SP1 Spectrometer (VISA)
+
+usb:v1313p0112*
+ ID_MODEL_FROM_DATABASE=SP2 Spectrometer (VISA)
+
+usb:v1313p8001*
+ ID_MODEL_FROM_DATABASE=TXP-Series Slot (TXP5001, TXP5004)
+
+usb:v1313p8012*
+ ID_MODEL_FROM_DATABASE=BC106 Camera Beam Profiler
+
+usb:v1313p8013*
+ ID_MODEL_FROM_DATABASE=WFS10 Wavefront Sensor
+
+usb:v1313p8017*
+ ID_MODEL_FROM_DATABASE=BC206 Camera Beam Profiler
+
+usb:v1313p8019*
+ ID_MODEL_FROM_DATABASE=BP2 Multi Slit Beam Profiler
+
+usb:v1313p8020*
+ ID_MODEL_FROM_DATABASE=PM300 Optical Power Meter
+
+usb:v1313p8021*
+ ID_MODEL_FROM_DATABASE=PM300E Optical Power and Energy Meter
+
+usb:v1313p8022*
+ ID_MODEL_FROM_DATABASE=PM320E Optical Power and Energy Meter
+
+usb:v1313p8030*
+ ID_MODEL_FROM_DATABASE=ER100 Extinction Ratio Meter
+
 usb:v1313p8070*
  ID_MODEL_FROM_DATABASE=PM100D
 
@@ -41975,6 +42035,18 @@ usb:v1342p0204*
 usb:v1342p0304*
  ID_MODEL_FROM_DATABASE=EasiDock Ethernet
 
+usb:v1343*
+ ID_VENDOR_FROM_DATABASE=Citizen Systems
+
+usb:v1343p0003*
+ ID_MODEL_FROM_DATABASE=CX / DNP DS40
+
+usb:v1343p0004*
+ ID_MODEL_FROM_DATABASE=CX-W / DNP DS80
+
+usb:v1343p0005*
+ ID_MODEL_FROM_DATABASE=CY / DNP DSRX
+
 usb:v1345*
  ID_VENDOR_FROM_DATABASE=Sino Lite Technology Corp.
 
@@ -42002,6 +42074,12 @@ usb:v1347p0403*
 usb:v1347p0404*
  ID_MODEL_FROM_DATABASE=G2/G3/G4 CCD-F KAF CCD
 
+usb:v1347p0405*
+ ID_MODEL_FROM_DATABASE=Gx CCD-I CCD
+
+usb:v1347p0406*
+ ID_MODEL_FROM_DATABASE=Gx CCD-F CCD
+
 usb:v1347p0410*
  ID_MODEL_FROM_DATABASE=G1-0400 CCD
 
@@ -42149,6 +42227,9 @@ usb:v138Ap003C*
 usb:v138Ap003D*
  ID_MODEL_FROM_DATABASE=VFS491
 
+usb:v138Ap0050*
+ ID_MODEL_FROM_DATABASE=Swipe Fingerprint Sensor
+
 usb:v138E*
  ID_VENDOR_FROM_DATABASE=Jungo LTD
 
@@ -42161,6 +42242,9 @@ usb:v1390*
 usb:v1390p0001*
  ID_MODEL_FROM_DATABASE=GO 520 T/GO 630/ONE XL (v9)
 
+usb:v1390p5454*
+ ID_MODEL_FROM_DATABASE=Blue & Me 2
+
 usb:v1391*
  ID_VENDOR_FROM_DATABASE=IdealTEK, Inc.
 
@@ -42263,6 +42347,15 @@ usb:v13B1p0039*
 usb:v13B1p003A*
  ID_MODEL_FROM_DATABASE=AE2500 802.11abgn Wireless Adapter [Broadcom BCM43236]
 
+usb:v13B1p003B*
+ ID_MODEL_FROM_DATABASE=AE3000 802.11abgn (3x3) Wireless Adapter [Ralink RT3573]
+
+usb:v13B1p003E*
+ ID_MODEL_FROM_DATABASE=AE6000 802.11a/b/g/n/ac Wireless Adapter [MediaTek MT7610U]
+
+usb:v13B1p003F*
+ ID_MODEL_FROM_DATABASE=WUSB6300 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]
+
 usb:v13B1p13B1*
  ID_MODEL_FROM_DATABASE=WUSB200: Wireless-G Business Network Adapter with Rangebooster
 
@@ -42446,6 +42539,12 @@ usb:v13D3p3315*
 usb:v13D3p3375*
  ID_MODEL_FROM_DATABASE=Atheros AR3012 Bluetooth 4.0 Adapter
 
+usb:v13D3p3392*
+ ID_MODEL_FROM_DATABASE=Azurewave 43228+20702
+
+usb:v13D3p3394*
+ ID_MODEL_FROM_DATABASE=Bluetooth
+
 usb:v13D3p5070*
  ID_MODEL_FROM_DATABASE=Webcam
 
@@ -42458,6 +42557,9 @@ usb:v13D3p5115*
 usb:v13D3p5116*
  ID_MODEL_FROM_DATABASE=Integrated Webcam
 
+usb:v13D3p5122*
+ ID_MODEL_FROM_DATABASE=2M Integrated Webcam
+
 usb:v13D3p5126*
  ID_MODEL_FROM_DATABASE=PC Cam
 
@@ -42524,6 +42626,9 @@ usb:v13FDp0840*
 usb:v13FDp0841*
  ID_MODEL_FROM_DATABASE=Samsung SE-T084M DVD-RW
 
+usb:v13FDp1040*
+ ID_MODEL_FROM_DATABASE=INIC-1511L PATA Bridge
+
 usb:v13FDp1340*
  ID_MODEL_FROM_DATABASE=Hi-Speed USB to SATA Bridge
 
@@ -42533,9 +42638,15 @@ usb:v13FDp160F*
 usb:v13FDp1640*
  ID_MODEL_FROM_DATABASE=INIC-1610L SATA Bridge
 
+usb:v13FDp1669*
+ ID_MODEL_FROM_DATABASE=INIC-1609PN
+
 usb:v13FDp1840*
  ID_MODEL_FROM_DATABASE=INIC-1608 SATA bridge
 
+usb:v13FDp1E40*
+ ID_MODEL_FROM_DATABASE=INIC-1610P SATA bridge
+
 usb:v13FE*
  ID_VENDOR_FROM_DATABASE=Kingston Technology Company Inc.
 
@@ -42555,10 +42666,10 @@ usb:v13FEp1E50*
  ID_MODEL_FROM_DATABASE=U3 Smart Drive
 
 usb:v13FEp1F00*
- ID_MODEL_FROM_DATABASE=DataTraveler 2.0 4GB Flash Drive / Patriot Xporter 32GB (PEF32GUSB) Flash Drive
+ ID_MODEL_FROM_DATABASE=Kingston DataTraveler / Patriot Xporter
 
 usb:v13FEp1F23*
- ID_MODEL_FROM_DATABASE=2Gb
+ ID_MODEL_FROM_DATABASE=PS2232 flash drive controller
 
 usb:v13FEp2240*
  ID_MODEL_FROM_DATABASE=microSD card reader
@@ -42569,12 +42680,18 @@ usb:v13FEp3100*
 usb:v13FEp3123*
  ID_MODEL_FROM_DATABASE=Verbatim STORE N GO 4GB
 
+usb:v13FEp3600*
+ ID_MODEL_FROM_DATABASE=flash drive (4GB, EMTEC)
+
 usb:v13FEp3800*
  ID_MODEL_FROM_DATABASE=Rage XT Flash Drive
 
 usb:v13FEp3E00*
  ID_MODEL_FROM_DATABASE=Flash Drive
 
+usb:v13FEp5000*
+ ID_MODEL_FROM_DATABASE=USB flash drive (32 GB SHARKOON Accelerate)
+
 usb:v13FEp5100*
  ID_MODEL_FROM_DATABASE=Flash Drive
 
@@ -42674,6 +42791,12 @@ usb:v1415p2000*
 usb:v1419*
  ID_VENDOR_FROM_DATABASE=ABILITY ENTERPRISE CO., LTD.
 
+usb:v1421*
+ ID_VENDOR_FROM_DATABASE=Sensor Technology
+
+usb:v1421p0605*
+ ID_MODEL_FROM_DATABASE=Sentech Camera
+
 usb:v1429*
  ID_VENDOR_FROM_DATABASE=Vega Technologies Industrial (Austria) Co.
 
@@ -42776,6 +42899,18 @@ usb:v1457p5118*
 usb:v1457p5119*
  ID_MODEL_FROM_DATABASE=OpenMoko Neo1973 u-boot cdc_acm serial port
 
+usb:v1457p511A*
+ ID_MODEL_FROM_DATABASE=HXD8 u-boot usbtty CDC ACM Mode
+
+usb:v1457p511B*
+ ID_MODEL_FROM_DATABASE=SMDK2440 u-boot usbtty CDC ACM mode
+
+usb:v1457p511C*
+ ID_MODEL_FROM_DATABASE=SMDK2443 u-boot usbtty CDC ACM mode
+
+usb:v1457p511D*
+ ID_MODEL_FROM_DATABASE=QT2410 u-boot usbtty CDC ACM mode
+
 usb:v1457p5120*
  ID_MODEL_FROM_DATABASE=OpenMoko Neo1973 u-boot usbtty generic serial
 
@@ -42935,6 +43070,9 @@ usb:v148E*
 usb:v148F*
  ID_VENDOR_FROM_DATABASE=Ralink Technology, Corp.
 
+usb:v148Fp1000*
+ ID_MODEL_FROM_DATABASE=Motorola BC4 Bluetooth 3.0+HS Adapter
+
 usb:v148Fp1706*
  ID_MODEL_FROM_DATABASE=RT2500USB Wireless Adapter
 
@@ -42983,6 +43121,9 @@ usb:v148Fp5372*
 usb:v148Fp5572*
  ID_MODEL_FROM_DATABASE=RT5572 Wireless Adapter
 
+usb:v148Fp7601*
+ ID_MODEL_FROM_DATABASE=MT7601U Wireless Adapter
+
 usb:v148Fp9020*
  ID_MODEL_FROM_DATABASE=RT2500USB Wireless Adapter
 
@@ -42998,6 +43139,15 @@ usb:v1491p0020*
 usb:v1493*
  ID_VENDOR_FROM_DATABASE=Suunto
 
+usb:v1493p0010*
+ ID_MODEL_FROM_DATABASE=Bluebird [Ambit]
+
+usb:v1493p0019*
+ ID_MODEL_FROM_DATABASE=Duck [Ambit2]
+
+usb:v1493p001A*
+ ID_MODEL_FROM_DATABASE=Colibri [Ambit2 S]
+
 usb:v1497*
  ID_VENDOR_FROM_DATABASE=Panstrong Company Ltd.
 
@@ -43118,6 +43268,9 @@ usb:v14CD*
 usb:v14CDp121C*
  ID_MODEL_FROM_DATABASE=microSD card reader
 
+usb:v14CDp121F*
+ ID_MODEL_FROM_DATABASE=microSD CardReader SY-T18
+
 usb:v14CDp123A*
  ID_MODEL_FROM_DATABASE=SD/MMC/RS-MMC Card Reader
 
@@ -43131,7 +43284,7 @@ usb:v14CDp6116*
  ID_MODEL_FROM_DATABASE=M6116 SATA Bridge
 
 usb:v14CDp6600*
- ID_MODEL_FROM_DATABASE=USB 2.0 IDE DEVICE
+ ID_MODEL_FROM_DATABASE=M110E PATA bridge
 
 usb:v14CDp6700*
  ID_MODEL_FROM_DATABASE=Card Reader
@@ -43166,6 +43319,9 @@ usb:v14E1*
 usb:v14E1p5000*
  ID_MODEL_FROM_DATABASE=PenMount 5000 Touch Controller
 
+usb:v14E4*
+ ID_VENDOR_FROM_DATABASE=Broadcom Corp.
+
 usb:v14E5*
  ID_VENDOR_FROM_DATABASE=SAIN Information & Communications Co., Ltd.
 
@@ -43214,6 +43370,15 @@ usb:v1501*
 usb:v1509*
  ID_VENDOR_FROM_DATABASE=First International Computer, Inc.
 
+usb:v1509p0A01*
+ ID_MODEL_FROM_DATABASE=LI-3100 Area Meter
+
+usb:v1509p0A02*
+ ID_MODEL_FROM_DATABASE=LI-7000 CO2/H2O Gas Analyzer
+
+usb:v1509p0A03*
+ ID_MODEL_FROM_DATABASE=C-DiGit Blot Scanner
+
 usb:v1509p9242*
  ID_MODEL_FROM_DATABASE=eHome Infrared Transceiver
 
@@ -43253,6 +43418,12 @@ usb:v1518p0001*
 usb:v1518p0002*
  ID_MODEL_FROM_DATABASE=HDReye (before firmware loads)
 
+usb:v1519*
+ ID_VENDOR_FROM_DATABASE=Comneon
+
+usb:v1519p0020*
+ ID_MODEL_FROM_DATABASE=HSIC Device
+
 usb:v1520*
  ID_VENDOR_FROM_DATABASE=Bitwire Corp.
 
@@ -43280,6 +43451,15 @@ usb:v1529p3100*
 usb:v152A*
  ID_VENDOR_FROM_DATABASE=Thesycon Systemsoftware & Consulting GmbH
 
+usb:v152Ap8400*
+ ID_MODEL_FROM_DATABASE=INI DVS128
+
+usb:v152Ap840D*
+ ID_MODEL_FROM_DATABASE=INI DAViS
+
+usb:v152Ap841A*
+ ID_MODEL_FROM_DATABASE=INI DAViS FX3
+
 usb:v152D*
  ID_VENDOR_FROM_DATABASE=JMicron Technology Corp. / JMicron USA Technology Corp.
 
@@ -43337,6 +43517,9 @@ usb:v1532p0007*
 usb:v1532p0013*
  ID_MODEL_FROM_DATABASE=Orochi mouse
 
+usb:v1532p0015*
+ ID_MODEL_FROM_DATABASE=Naga Mouse
+
 usb:v1532p0016*
  ID_MODEL_FROM_DATABASE=DeathAdder Mouse
 
@@ -43364,9 +43547,21 @@ usb:v1532p0102*
 usb:v1532p0109*
  ID_MODEL_FROM_DATABASE=Lycosa Keyboard
 
+usb:v1532p0113*
+ ID_MODEL_FROM_DATABASE=RZ07-0074 Gaming Keypad [Orbweaver]
+
 usb:v1532p0300*
  ID_MODEL_FROM_DATABASE=RZ06-0063 Motion Sensing Controllers [Hydra]
 
+usb:v153B*
+ ID_VENDOR_FROM_DATABASE=TerraTec Electronic GmbH
+
+usb:v153Bp1181*
+ ID_MODEL_FROM_DATABASE=Cinergy S2 PCIe Dual Port 1
+
+usb:v153Bp1182*
+ ID_MODEL_FROM_DATABASE=Cinergy S2 PCIe Dual Port 2
+
 usb:v1546*
  ID_VENDOR_FROM_DATABASE=U-Blox AG
 
@@ -43388,12 +43583,18 @@ usb:v154B*
 usb:v154Bp0010*
  ID_MODEL_FROM_DATABASE=USB 2.0 Flash Drive
 
+usb:v154Bp0048*
+ ID_MODEL_FROM_DATABASE=Flash Drive
+
 usb:v154Bp004D*
  ID_MODEL_FROM_DATABASE=8 GB Flash Drive
 
 usb:v154Bp0057*
  ID_MODEL_FROM_DATABASE=32GB Micro Slide Attache Flash Drive
 
+usb:v154Bp007A*
+ ID_MODEL_FROM_DATABASE=8GB Classic Attache Flash Drive
+
 usb:v154Bp6545*
  ID_MODEL_FROM_DATABASE=FD Device
 
@@ -43530,7 +43731,10 @@ usb:v15A2p0052*
  ID_MODEL_FROM_DATABASE=i.MX50 SystemOnChip in RecoveryMode
 
 usb:v15A2p0054*
- ID_MODEL_FROM_DATABASE=i.MX6Q SystemOnChip in RecoveryMode
+ ID_MODEL_FROM_DATABASE=i.MX 6Dual/6Quad SystemOnChip in RecoveryMode
+
+usb:v15A2p0061*
+ ID_MODEL_FROM_DATABASE=i.MX 6Solo/6DualLite SystemOnChip in RecoveryMode
 
 usb:v15A4*
  ID_VENDOR_FROM_DATABASE=Afatech Technologies, Inc.
@@ -43640,6 +43844,9 @@ usb:v15C2p0036*
 usb:v15C2p0038*
  ID_MODEL_FROM_DATABASE=GD01 MX LCD Display/IR Receiver
 
+usb:v15C2p0042*
+ ID_MODEL_FROM_DATABASE=Antec Veris Multimedia Station E-Z IR Receiver
+
 usb:v15C2pFFDA*
  ID_MODEL_FROM_DATABASE=iMON PAD Remote Controller
 
@@ -43724,6 +43931,9 @@ usb:v15D9p0A4C*
 usb:v15D9p0A4D*
  ID_MODEL_FROM_DATABASE=Optical Mouse
 
+usb:v15D9p0A4F*
+ ID_MODEL_FROM_DATABASE=Optical Mouse
+
 usb:v15DC*
  ID_VENDOR_FROM_DATABASE=Hynix Semiconductor Inc.
 
@@ -44507,6 +44717,15 @@ usb:v1690p0740*
 usb:v1690p0901*
  ID_MODEL_FROM_DATABASE=Voyager 205 ADSL Router
 
+usb:v1690p2000*
+ ID_MODEL_FROM_DATABASE=naturaSign Pad Standard
+
+usb:v1690p2001*
+ ID_MODEL_FROM_DATABASE=naturaSign Pad Standard
+
+usb:v1690pFE12*
+ ID_MODEL_FROM_DATABASE=Bootloader
+
 usb:v1696*
  ID_VENDOR_FROM_DATABASE=Hitachi Video and Information System, Inc.
 
@@ -44669,6 +44888,9 @@ usb:v16C0p06B4*
 usb:v16C0p06B5*
  ID_MODEL_FROM_DATABASE=USB2LPT with 3 interfaces (native, HID, printer)
 
+usb:v16C0p0762*
+ ID_MODEL_FROM_DATABASE=Osmocom SIMtrace
+
 usb:v16C0p076B*
  ID_MODEL_FROM_DATABASE=OpenPCD 13.56MHz RFID Reader
 
@@ -44759,6 +44981,15 @@ usb:v16D0p075D*
 usb:v16D0p080A*
  ID_MODEL_FROM_DATABASE=S2E1 Interface
 
+usb:v16D0p0870*
+ ID_MODEL_FROM_DATABASE=Kaufmann Automotive GmbH, RKS+CAN Interface
+
+usb:v16D1*
+ ID_VENDOR_FROM_DATABASE=Suprema Inc.
+
+usb:v16D1p0401*
+ ID_MODEL_FROM_DATABASE=SUP-SFR400(A) BioMini Fingerprint Reader
+
 usb:v16D3*
  ID_VENDOR_FROM_DATABASE=Frontline Test Equipment, Inc.
 
@@ -44774,6 +45005,9 @@ usb:v16D5p6501*
 usb:v16D5p6502*
  ID_MODEL_FROM_DATABASE=CDMA/UMTS/GPRS modem
 
+usb:v16D5p6603*
+ ID_MODEL_FROM_DATABASE=ADU-890WH modem
+
 usb:v16D6*
  ID_VENDOR_FROM_DATABASE=JABLOCOM s.r.o.
 
@@ -44870,6 +45104,18 @@ usb:v170Bp0011*
 usb:v170D*
  ID_VENDOR_FROM_DATABASE=Avnera
 
+usb:v1711*
+ ID_VENDOR_FROM_DATABASE=Leica Microsystems
+
+usb:v1711p3020*
+ ID_MODEL_FROM_DATABASE=IC80 HD Camera
+
+usb:v1724*
+ ID_VENDOR_FROM_DATABASE=Meyer Instruments (MIS)
+
+usb:v1724p0115*
+ ID_MODEL_FROM_DATABASE=PAXcam5
+
 usb:v1725*
  ID_VENDOR_FROM_DATABASE=Vitesse Semiconductor
 
@@ -44957,9 +45203,21 @@ usb:v1737p0078*
 usb:v1737p0079*
  ID_MODEL_FROM_DATABASE=WUSB600N v2 Dual-Band Wireless-N Network Adapter [Ralink RT3572]
 
+usb:v173D*
+ ID_VENDOR_FROM_DATABASE=QSENN
+
+usb:v173Dp0002*
+ ID_MODEL_FROM_DATABASE=GP-K7000 keyboard
+
 usb:v1740*
  ID_VENDOR_FROM_DATABASE=Senao
 
+usb:v1740p0100*
+ ID_MODEL_FROM_DATABASE=EUB1200AC AC1200 DB Wireless Adapter [Realtek RTL8812AU]
+
+usb:v1740p0600*
+ ID_MODEL_FROM_DATABASE=EUB600v1 802.11abgn Wireless Adapter [Ralink RT3572]
+
 usb:v1740p0605*
  ID_MODEL_FROM_DATABASE=LevelOne WUA-0605 N_Max Wireless USB Adapter
 
@@ -45002,14 +45260,20 @@ usb:v1743*
 usb:v1748*
  ID_VENDOR_FROM_DATABASE=MQP Electronics
 
+usb:v1748p0101*
+ ID_MODEL_FROM_DATABASE=Packet-Master USB12
+
 usb:v174C*
  ID_VENDOR_FROM_DATABASE=ASMedia Technology Inc.
 
 usb:v174Cp5106*
  ID_MODEL_FROM_DATABASE=Transcend StoreJet 25M3
 
+usb:v174Cp5136*
+ ID_MODEL_FROM_DATABASE=ASM1053 SATA 6Gb/s bridge
+
 usb:v174Cp55AA*
- ID_MODEL_FROM_DATABASE=ASMedia 2105 SATA bridge
+ ID_MODEL_FROM_DATABASE=ASM1051 SATA 3Gb/s bridge
 
 usb:v174F*
  ID_VENDOR_FROM_DATABASE=Syntek
@@ -45137,6 +45401,9 @@ usb:v1781p0C31*
 usb:v1781p0C9F*
  ID_MODEL_FROM_DATABASE=USBtiny
 
+usb:v1781p1EEF*
+ ID_MODEL_FROM_DATABASE=OpenAPC SecuKey
+
 usb:v1782*
  ID_VENDOR_FROM_DATABASE=Spreadtrum Communications Inc.
 
@@ -45206,6 +45473,9 @@ usb:v17A0p0100*
 usb:v17A0p0101*
  ID_MODEL_FROM_DATABASE=UB1 boundary microphone
 
+usb:v17A0p0120*
+ ID_MODEL_FROM_DATABASE=Meteorite condenser microphone
+
 usb:v17A0p0200*
  ID_MODEL_FROM_DATABASE=StudioDock monitors (internal hub)
 
@@ -45221,6 +45491,9 @@ usb:v17A0p0301*
 usb:v17A0p0302*
  ID_MODEL_FROM_DATABASE=GoMic compact condenser microphone
 
+usb:v17A0p0303*
+ ID_MODEL_FROM_DATABASE=C01U Pro condenser microphone
+
 usb:v17A0p0304*
  ID_MODEL_FROM_DATABASE=Q2U handheld mic with XLR
 
@@ -45371,6 +45644,9 @@ usb:v17E9p037C*
 usb:v17E9p037D*
  ID_MODEL_FROM_DATABASE=Plugable USB2-HDMI-165
 
+usb:v17E9p410A*
+ ID_MODEL_FROM_DATABASE=HDMI Adapter
+
 usb:v17E9p430A*
  ID_MODEL_FROM_DATABASE=HP Port Replicator (Composite Device)
 
@@ -45383,6 +45659,9 @@ usb:v17EB*
 usb:v17EF*
  ID_VENDOR_FROM_DATABASE=Lenovo
 
+usb:v17EFp1000*
+ ID_MODEL_FROM_DATABASE=Hub
+
 usb:v17EFp1003*
  ID_MODEL_FROM_DATABASE=Integrated Smart Card Reader
 
@@ -45395,6 +45674,9 @@ usb:v17EFp1008*
 usb:v17EFp100A*
  ID_MODEL_FROM_DATABASE=ThinkPad Mini Dock Plus Series 3
 
+usb:v17EFp304B*
+ ID_MODEL_FROM_DATABASE=AX88179 Gigabit Ethernet [ThinkPad OneLink GigaLAN]
+
 usb:v17EFp3815*
  ID_MODEL_FROM_DATABASE=ChipsBnk 2GB USB Stick
 
@@ -45455,6 +45737,12 @@ usb:v17EFp6009*
 usb:v17EFp6014*
  ID_MODEL_FROM_DATABASE=Mini Wireless Keyboard N5901
 
+usb:v17EFp6025*
+ ID_MODEL_FROM_DATABASE=ThinkPad Travel Mouse
+
+usb:v17EFp7203*
+ ID_MODEL_FROM_DATABASE=Ethernet adapter [U2L 100P-Y1]
+
 usb:v17EFp7423*
  ID_MODEL_FROM_DATABASE=IdeaPad A1 Tablet
 

commit 22a7aa6f79d91769ac9a19edaba2b27813dd2654
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon May 19 09:03:20 2014 +0900

    logind: fix Display property of user objects
    
    When we dropped support for creating a per-user to the "main" X11
    display we stopped returning useful data in the "Display" user property.
    With this change this is fixed and we again expose an appropriate
    (graphical session) in the property that is useful as the "main" one, if
    one is needed.
    
    (cherry picked from commit 952d32609f9bceee444fa2690afb4d28539b4b92)

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index b14fadd..97b7728 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -545,6 +545,8 @@ int session_start(Session *s) {
 
         s->started = true;
 
+        user_elect_display(s->user);
+
         /* Save data */
         session_save(s);
         user_save(s->user);
@@ -553,7 +555,7 @@ int session_start(Session *s) {
 
         /* Send signals */
         session_send_signal(s, true);
-        user_send_changed(s->user, "Sessions", NULL);
+        user_send_changed(s->user, "Sessions", "Display", NULL);
         if (s->seat) {
                 if (s->seat->active == s)
                         seat_send_changed(s->seat, "Sessions", "ActiveSession", NULL);
@@ -612,6 +614,8 @@ int session_stop(Session *s, bool force) {
 
         s->stopping = true;
 
+        user_elect_display(s->user);
+
         session_save(s);
         user_save(s->user);
 
@@ -660,7 +664,7 @@ int session_finalize(Session *s) {
         }
 
         user_save(s->user);
-        user_send_changed(s->user, "Sessions", NULL);
+        user_send_changed(s->user, "Sessions", "Display", NULL);
 
         return r;
 }
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index c9af5eb..5eee8bd 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -59,6 +59,8 @@ typedef enum SessionType {
         _SESSION_TYPE_INVALID = -1
 } SessionType;
 
+#define SESSION_TYPE_IS_GRAPHICAL(type) IN_SET(type, SESSION_X11, SESSION_WAYLAND)
+
 enum KillWho {
         KILL_LEADER,
         KILL_ALL,
diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c
index 18eea89..fa01030 100644
--- a/src/login/logind-user-dbus.c
+++ b/src/login/logind-user-dbus.c
@@ -220,7 +220,7 @@ const sd_bus_vtable user_vtable[] = {
         SD_BUS_PROPERTY("RuntimePath", "s", NULL, offsetof(User, runtime_path), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Service", "s", NULL, offsetof(User, service), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Slice", "s", NULL, offsetof(User, slice), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("Display", "(so)", property_get_display, 0, SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("Display", "(so)", property_get_display, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_PROPERTY("State", "s", property_get_state, 0, 0),
         SD_BUS_PROPERTY("Sessions", "a(so)", property_get_sessions, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_PROPERTY("IdleHint", "b", property_get_idle_hint, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 4af0e90..fa31e77 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -681,6 +681,43 @@ int user_kill(User *u, int signo) {
         return manager_kill_unit(u->manager, u->slice, KILL_ALL, signo, NULL);
 }
 
+void user_elect_display(User *u) {
+        Session *graphical = NULL, *text = NULL, *s;
+
+        assert(u);
+
+        /* This elects a primary session for each user, which we call
+         * the "display". We try to keep the assignment stable, but we
+         * "upgrade" to better choices. */
+
+        LIST_FOREACH(sessions_by_user, s, u->sessions) {
+
+                if (s->class != SESSION_USER)
+                        continue;
+
+                if (s->stopping)
+                        continue;
+
+                if (SESSION_TYPE_IS_GRAPHICAL(s->type))
+                        graphical = s;
+                else
+                        text = s;
+        }
+
+        if (graphical &&
+            (!u->display ||
+             u->display->class != SESSION_USER ||
+             u->display->stopping ||
+             !SESSION_TYPE_IS_GRAPHICAL(u->display->type)))
+                u->display = graphical;
+
+        if (text &&
+            (!u->display ||
+             u->display->class != SESSION_USER ||
+             u->display->stopping))
+                u->display = text;
+}
+
 static const char* const user_state_table[_USER_STATE_MAX] = {
         [USER_OFFLINE] = "offline",
         [USER_OPENING] = "opening",
diff --git a/src/login/logind-user.h b/src/login/logind-user.h
index f237d2a..4e0568f 100644
--- a/src/login/logind-user.h
+++ b/src/login/logind-user.h
@@ -80,6 +80,7 @@ int user_save(User *u);
 int user_load(User *u);
 int user_kill(User *u, int signo);
 int user_check_linger_file(User *u);
+void user_elect_display(User *u);
 
 extern const sd_bus_vtable user_vtable[];
 int user_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);

commit 1edfeba28e2c63f0c69eeade570c0aae4af41f42
Author: Marcel Holtmann <marcel at holtmann.org>
Date:   Fri May 16 15:57:35 2014 -0700

    hwdb: Update database of Bluetooth company identifiers
    
    (cherry picked from commit 24e29480bd800d3acdb3087e5863440bd0dd1d80)

diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index 28aa2a7..a65c7db 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -961,4 +961,55 @@ bluetooth:v013D*
  ID_VENDOR_FROM_DATABASE=WirelessWERX
 
 bluetooth:v013E*
- ID_VENDOR_FROM_DATABASE=nimai
+ ID_VENDOR_FROM_DATABASE=Nod, Inc.
+
+bluetooth:v013F*
+ ID_VENDOR_FROM_DATABASE=B&B Manufacturing Company
+
+bluetooth:v0140*
+ ID_VENDOR_FROM_DATABASE=Alpine Electronics (China) Co., Ltd
+
+bluetooth:v0141*
+ ID_VENDOR_FROM_DATABASE=FedEx Services
+
+bluetooth:v0142*
+ ID_VENDOR_FROM_DATABASE=Grape Systems Inc.
+
+bluetooth:v0143*
+ ID_VENDOR_FROM_DATABASE=Bkon Connect
+
+bluetooth:v0144*
+ ID_VENDOR_FROM_DATABASE=Lintech GmbH
+
+bluetooth:v0145*
+ ID_VENDOR_FROM_DATABASE=Novatel Wireless
+
+bluetooth:v0146*
+ ID_VENDOR_FROM_DATABASE=Ciright
+
+bluetooth:v0147*
+ ID_VENDOR_FROM_DATABASE=Mighty Cast, Inc.
+
+bluetooth:v0148*
+ ID_VENDOR_FROM_DATABASE=Ambimat Electronics
+
+bluetooth:v0149*
+ ID_VENDOR_FROM_DATABASE=Perytons Ltd.
+
+bluetooth:v014A*
+ ID_VENDOR_FROM_DATABASE=Tivoli Audio, LLC
+
+bluetooth:v014B*
+ ID_VENDOR_FROM_DATABASE=Master Lock
+
+bluetooth:v014C*
+ ID_VENDOR_FROM_DATABASE=Mesh-Net Ltd
+
+bluetooth:v014D*
+ ID_VENDOR_FROM_DATABASE=HUIZHOU DESAY SV AUTOMOTIVE CO., LTD.
+
+bluetooth:v014E*
+ ID_VENDOR_FROM_DATABASE=Tangerine, Inc.
+
+bluetooth:v014F*
+ ID_VENDOR_FROM_DATABASE=B&W Group Ltd.

commit f5ad306cb9ea1dea38a934b6b07901de1257a3fa
Author: Will Woods <wwoods at redhat.com>
Date:   Fri Apr 25 18:26:34 2014 -0400

    core: let selinux_setup() load policy more than once
    
    When you switch-root into a new root that has SELinux policy, you're
    supposed to to run selinux_init_load_policy() to set up SELinux and load
    policy. Normally this gets handled by selinux_setup().
    
    But if SELinux was already initialized, selinux_setup() skips loading
    policy and returns 0. So if you load policy normally, and then you
    switch-root to a new root that has new policy, selinux_setup() never
    loads the new policy. What gives?
    
    As far as I can tell, this check is an artifact of how selinux_setup()
    worked when it was first written (see commit c4dcdb9 / systemd v12):
    
      * when systemd starts, run selinux_setup()
      * if selinux_setup() loads policy OK, restart systemd
    
    So the "if policy already loaded, skip load and return 0" check was
    there to prevent an infinite re-exec loop.
    
    Modern systemd only calls selinux_setup() on initial load and after
    switch-root, and selinux_setup() no longer restarts systemd, so we don't
    need that check to guard against the infinite loop anymore.
    
    So: this patch removes the "return 0", thus allowing selinux_setup() to
    actually perform SELinux setup after switch-root.
    
    We still want to check to see if SELinux is initialized, because if
    selinux_init_load_policy() fails *but* SELinux is initialized that means
    we still have (old) policy active. So we don't need to halt if
    enforce=1.
    
    (cherry picked from commit 68d3acaccbd26ecfbc5881fea75968fa4abcc565)

diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c
index 6d8bc89..b419a27 100644
--- a/src/core/selinux-setup.c
+++ b/src/core/selinux-setup.c
@@ -51,6 +51,7 @@ int selinux_setup(bool *loaded_policy) {
         security_context_t con;
         int r;
         union selinux_callback cb;
+        bool initialized = false;
 
         assert(loaded_policy);
 
@@ -68,13 +69,8 @@ int selinux_setup(bool *loaded_policy) {
         /* Already initialized by somebody else? */
         r = getcon_raw(&con);
         if (r == 0) {
-                bool initialized;
-
                 initialized = !streq(con, "kernel");
                 freecon(con);
-
-                if (initialized)
-                        return 0;
         }
 
         /* Make sure we have no fds open while loading the policy and
@@ -116,8 +112,12 @@ int selinux_setup(bool *loaded_policy) {
                 log_open();
 
                 if (enforce > 0) {
-                        log_error("Failed to load SELinux policy. Freezing.");
-                        return -EIO;
+                        if (!initialized) {
+                                log_error("Failed to load SELinux policy. Freezing.");
+                                return -EIO;
+                        }
+
+                        log_warning("Failed to load new SELinux policy. Continuing with old policy.");
                 } else
                         log_debug("Unable to load SELinux policy. Ignoring.");
         }

commit 31b1d7a4f7358cdbc632e4cd2b61bef8fa34d281
Author: Will Woods <wwoods at redhat.com>
Date:   Fri Apr 25 18:26:33 2014 -0400

    core: reindent {selinux, ima, smack}-setup.c
    
    7-space indentation is just too weird to leave alone.
    Make it 8 spaces, as per CODING_STYLE. No other changes.
    
    (cherry picked from commit 4ab72d6fb499c2b4d8baced9fa94a8bbfa5a4b3d)
    
    Conflicts:
    	src/core/ima-setup.c
    
    [zj: just selinux-setup.c, as needed for futher commits.]

diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c
index 9a5d6b2..6d8bc89 100644
--- a/src/core/selinux-setup.c
+++ b/src/core/selinux-setup.c
@@ -46,82 +46,82 @@ static int null_log(int type, const char *fmt, ...) {
 int selinux_setup(bool *loaded_policy) {
 
 #ifdef HAVE_SELINUX
-       int enforce = 0;
-       usec_t before_load, after_load;
-       security_context_t con;
-       int r;
-       union selinux_callback cb;
-
-       assert(loaded_policy);
-
-       /* Turn off all of SELinux' own logging, we want to do that */
-       cb.func_log = null_log;
-       selinux_set_callback(SELINUX_CB_LOG, cb);
-
-       /* Don't load policy in the initrd if we don't appear to have
-        * it.  For the real root, we check below if we've already
-        * loaded policy, and return gracefully.
-        */
-       if (in_initrd() && access(selinux_path(), F_OK) < 0)
-               return 0;
-
-       /* Already initialized by somebody else? */
-       r = getcon_raw(&con);
-       if (r == 0) {
-               bool initialized;
-
-               initialized = !streq(con, "kernel");
-               freecon(con);
-
-               if (initialized)
-                       return 0;
-       }
-
-       /* Make sure we have no fds open while loading the policy and
-        * transitioning */
-       log_close();
-
-       /* Now load the policy */
-       before_load = now(CLOCK_MONOTONIC);
-       r = selinux_init_load_policy(&enforce);
-       if (r == 0) {
-               char timespan[FORMAT_TIMESPAN_MAX];
-               char *label;
-
-               retest_selinux();
-
-               /* Transition to the new context */
-               r = label_get_create_label_from_exe(SYSTEMD_BINARY_PATH, &label);
-               if (r < 0 || label == NULL) {
-                       log_open();
-                       log_error("Failed to compute init label, ignoring.");
-               } else {
-                       r = setcon(label);
-
-                       log_open();
-                       if (r < 0)
-                               log_error("Failed to transition into init label '%s', ignoring.", label);
-
-                       label_free(label);
-               }
-
-               after_load = now(CLOCK_MONOTONIC);
-
-               log_info("Successfully loaded SELinux policy in %s.",
-                        format_timespan(timespan, sizeof(timespan), after_load - before_load, 0));
-
-               *loaded_policy = true;
-
-       } else {
-               log_open();
-
-               if (enforce > 0) {
-                       log_error("Failed to load SELinux policy. Freezing.");
-                       return -EIO;
-               } else
-                       log_debug("Unable to load SELinux policy. Ignoring.");
-       }
+        int enforce = 0;
+        usec_t before_load, after_load;
+        security_context_t con;
+        int r;
+        union selinux_callback cb;
+
+        assert(loaded_policy);
+
+        /* Turn off all of SELinux' own logging, we want to do that */
+        cb.func_log = null_log;
+        selinux_set_callback(SELINUX_CB_LOG, cb);
+
+        /* Don't load policy in the initrd if we don't appear to have
+         * it.  For the real root, we check below if we've already
+         * loaded policy, and return gracefully.
+         */
+        if (in_initrd() && access(selinux_path(), F_OK) < 0)
+                return 0;
+
+        /* Already initialized by somebody else? */
+        r = getcon_raw(&con);
+        if (r == 0) {
+                bool initialized;
+
+                initialized = !streq(con, "kernel");
+                freecon(con);
+
+                if (initialized)
+                        return 0;
+        }
+
+        /* Make sure we have no fds open while loading the policy and
+         * transitioning */
+        log_close();
+
+        /* Now load the policy */
+        before_load = now(CLOCK_MONOTONIC);
+        r = selinux_init_load_policy(&enforce);
+        if (r == 0) {
+                char timespan[FORMAT_TIMESPAN_MAX];
+                char *label;
+
+                retest_selinux();
+
+                /* Transition to the new context */
+                r = label_get_create_label_from_exe(SYSTEMD_BINARY_PATH, &label);
+                if (r < 0 || label == NULL) {
+                        log_open();
+                        log_error("Failed to compute init label, ignoring.");
+                } else {
+                        r = setcon(label);
+
+                        log_open();
+                        if (r < 0)
+                                log_error("Failed to transition into init label '%s', ignoring.", label);
+
+                        label_free(label);
+                }
+
+                after_load = now(CLOCK_MONOTONIC);
+
+                log_info("Successfully loaded SELinux policy in %s.",
+                         format_timespan(timespan, sizeof(timespan), after_load - before_load, 0));
+
+                *loaded_policy = true;
+
+        } else {
+                log_open();
+
+                if (enforce > 0) {
+                        log_error("Failed to load SELinux policy. Freezing.");
+                        return -EIO;
+                } else
+                        log_debug("Unable to load SELinux policy. Ignoring.");
+        }
 #endif
 
-       return 0;
+        return 0;
 }

commit e0036127752b25d87405e3ee508d4dbe41a23b7d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 16 19:37:19 2014 +0200

    nspawn: properly format container_uuid in UUID format
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-April/018971.html
    (cherry picked from commit 9f24adc288de142d6606fde3c5a5971613f3b6b9)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 056daf2..47a51be 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -741,6 +741,15 @@ static int setup_resolv_conf(const char *dest) {
         return 0;
 }
 
+static char* id128_format_as_uuid(sd_id128_t id, char s[37]) {
+
+        snprintf(s, 37,
+                 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+                 SD_ID128_FORMAT_VAL(id));
+
+        return s;
+}
+
 static int setup_boot_id(const char *dest) {
         _cleanup_free_ char *from = NULL, *to = NULL;
         sd_id128_t rnd = {};
@@ -766,10 +775,7 @@ static int setup_boot_id(const char *dest) {
                 return r;
         }
 
-        snprintf(as_uuid, sizeof(as_uuid),
-                 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-                 SD_ID128_FORMAT_VAL(rnd));
-        char_array_0(as_uuid);
+        id128_format_as_uuid(rnd, as_uuid);
 
         r = write_string_file(from, as_uuid);
         if (r < 0) {
@@ -2038,7 +2044,9 @@ int main(int argc, char *argv[]) {
                         }
 
                         if (!sd_id128_equal(arg_uuid, SD_ID128_NULL)) {
-                                if (asprintf((char**)(envp + n_env++), "container_uuid=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid)) < 0) {
+                                char as_uuid[37];
+
+                                if (asprintf((char**)(envp + n_env++), "container_uuid=%s", id128_format_as_uuid(arg_uuid, as_uuid)) < 0) {
                                         log_oom();
                                         goto child_fail;
                                 }

commit 430015550fe479455aeba7b4362bfa578cf75e2b
Author: Mantas MikulÄ—nas <grawity at gmail.com>
Date:   Wed Apr 30 19:53:13 2014 +0300

    man: update journald rate limit defaults
    
    This brings the man page back into sync with the actual code.
    
    (cherry picked from commit 8f18f550e7023948f199616fdfbb0f09711fd615)

diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index a814ec1..0e38e73 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -190,8 +190,8 @@
                                 limiting is applied per-service, so
                                 that two services which log do not
                                 interfere with each other's
-                                limits. Defaults to 200 messages in
-                                10s. The time specification for
+                                limits. Defaults to 1000 messages in
+                                30s. The time specification for
                                 <varname>RateLimitInterval=</varname>
                                 may be specified in the following
                                 units: <literal>s</literal>,

commit 3d3e1a52a3636ea38dcf6c7ac3eed0b444dfb054
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 16 16:51:42 2014 +0200

    build-sys: at configure check for verifying that ln supports --relative
    
    (cherry picked from commit 446883528524429283626208928b51f49f28f810)

diff --git a/configure.ac b/configure.ac
index b275ccb..b70c57d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,8 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
 
 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
 
+AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
+
 M4_DEFINES=
 
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line

commit 78db70d9c7da6ad48291047bad1ab2f4e80795e7
Author: Alison Chaiken <alison_chaiken at mentor.com>
Date:   Fri May 16 09:25:53 2014 +0200

    man: readahead: fix cmdline switch inconsistency between readahead.c and docs
    
    Source code has "files-max" and XML has --max-files.
    
    (cherry picked from commit 332bc31992acffc6f32e194c0122e01607bd0e27)

diff --git a/man/systemd-readahead-replay.service.xml b/man/systemd-readahead-replay.service.xml
index 67b41f5..669fe78 100644
--- a/man/systemd-readahead-replay.service.xml
+++ b/man/systemd-readahead-replay.service.xml
@@ -117,7 +117,7 @@
 
                 <variablelist>
                         <varlistentry>
-                                <term><option>--max-files=</option></term>
+                                <term><option>--files-max=</option></term>
 
                                 <listitem><para>Maximum number of
                                 files to read ahead. Only valid
diff --git a/src/readahead/readahead.c b/src/readahead/readahead.c
index d6729ec..73cf538 100644
--- a/src/readahead/readahead.c
+++ b/src/readahead/readahead.c
@@ -42,7 +42,7 @@ static int help(void) {
                "Collect read-ahead data on early boot.\n\n"
                "  -h --help                 Show this help\n"
                "     --version              Show package version\n"
-               "     --max-files=INT        Maximum number of files to read ahead\n"
+               "     --files-max=INT        Maximum number of files to read ahead\n"
                "     --file-size-max=BYTES  Maximum size of files to read ahead\n"
                "     --timeout=USEC         Maximum time to spend collecting data\n\n\n",
                program_invocation_short_name);

commit e3f71240733a153605a68e521ef5892e3cdf88f7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 16 01:33:22 2014 +0200

    man: clarify that the ExecReload= command should be synchronous
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-May/019054.html
    (cherry picked from commit 33169701b0640d3629d4c36cf8c71dc26d2cb7e1)

diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 5b3afb8..f14d2b9 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -519,6 +519,20 @@ ExecStart=/bin/echo $ONE $TWO ${TWO}</programlisting>
                                 following:</para>
 
                                 <programlisting>/bin/kill -HUP $MAINPID</programlisting>
+
+                                <para>Note however that reloading a
+                                daemon by sending a signal (as with
+                                the example line above) is usually not
+                                a good choice, because this is an
+                                asynchronous operation and hence not
+                                suitable to order reloads of multiple
+                                services against each other. It is
+                                strongly recommended to set
+                                <varname>ExecReload=</varname> to a
+                                command that no only triggers a
+                                configuration reload of the daemon,
+                                but also synchronously waits for it
+                                complete.</para>
                                 </listitem>
                         </varlistentry>
 

commit 75ee3c9da1441e0f67d502e56e9167f0ef23201b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 16 01:15:03 2014 +0200

    core: make sure to serialize jobs for all units
    
    Previously we wouldn't serialize jobs for units that themselves have
    nothing to serialize.
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-May/019051.html
    (cherry picked from commit 9bdb98c59451ed090f8d35d470a54710f389ce71)

diff --git a/src/core/manager.c b/src/core/manager.c
index 2f9ea1f..c62af40 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2109,9 +2109,6 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) {
                 if (u->id != t)
                         continue;
 
-                if (!unit_can_serialize(u))
-                        continue;
-
                 /* Start marker */
                 fputs(u->id, f);
                 fputc('\n', f);
diff --git a/src/core/unit.c b/src/core/unit.c
index f3a6def..31a8815 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2231,25 +2231,25 @@ bool unit_can_serialize(Unit *u) {
 }
 
 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs) {
-        ExecRuntime *rt;
         int r;
 
         assert(u);
         assert(f);
         assert(fds);
 
-        if (!unit_can_serialize(u))
-                return 0;
-
-        r = UNIT_VTABLE(u)->serialize(u, f, fds);
-        if (r < 0)
-                return r;
+        if (unit_can_serialize(u)) {
+                ExecRuntime *rt;
 
-        rt = unit_get_exec_runtime(u);
-        if (rt) {
-                r = exec_runtime_serialize(rt, u, f, fds);
+                r = UNIT_VTABLE(u)->serialize(u, f, fds);
                 if (r < 0)
                         return r;
+
+                rt = unit_get_exec_runtime(u);
+                if (rt) {
+                        r = exec_runtime_serialize(rt, u, f, fds);
+                        if (r < 0)
+                                return r;
+                }
         }
 
         dual_timestamp_serialize(f, "inactive-exit-timestamp", &u->inactive_exit_timestamp);
@@ -2311,17 +2311,14 @@ void unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value) {
 }
 
 int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
-        size_t offset;
         ExecRuntime **rt = NULL;
+        size_t offset;
         int r;
 
         assert(u);
         assert(f);
         assert(fds);
 
-        if (!unit_can_serialize(u))
-                return 0;
-
         offset = UNIT_VTABLE(u)->exec_runtime_offset;
         if (offset > 0)
                 rt = (ExecRuntime**) ((uint8_t*) u + offset);
@@ -2446,17 +2443,19 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
                         continue;
                 }
 
-                if (rt) {
-                        r = exec_runtime_deserialize_item(rt, u, l, v, fds);
+                if (unit_can_serialize(u)) {
+                        if (rt) {
+                                r = exec_runtime_deserialize_item(rt, u, l, v, fds);
+                                if (r < 0)
+                                        return r;
+                                if (r > 0)
+                                        continue;
+                        }
+
+                        r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds);
                         if (r < 0)
                                 return r;
-                        if (r > 0)
-                                continue;
                 }
-
-                r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds);
-                if (r < 0)
-                        return r;
         }
 }
 

commit 219b39885311455d16fd03922e043f93d8c35595
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 15 18:30:07 2014 +0200

    logind: bring polkit policy for hibernate in line with suspend/poweroff/reboot
    
    THere's no reason why hibernate should be better protected then
    suspendor poweroff, so sync the policies.
    
    (cherry picked from commit 301f9684e6465df5d0590f6c571fe3229ded966d)

diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in
index b96d32d..b8e90f1 100644
--- a/src/login/org.freedesktop.login1.policy.in
+++ b/src/login/org.freedesktop.login1.policy.in
@@ -254,7 +254,7 @@
                 <defaults>
                         <allow_any>auth_admin_keep</allow_any>
                         <allow_inactive>auth_admin_keep</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
+                        <allow_active>yes</allow_active>
                 </defaults>
                 <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.hibernate</annotate>
         </action>

commit ea74f003b0cbc37e76a2ad72460bfb317b880147
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue May 13 23:22:13 2014 +0200

    core: close socket fds asynchronously
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
    (cherry picked from commit 574634bcacb01efe15ca2742effd461a5b7afb5f)

diff --git a/src/core/service.c b/src/core/service.c
index 3c39798..1971e3c 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <sys/reboot.h>
 
+#include "async.h"
 #include "manager.h"
 #include "unit.h"
 #include "service.h"
@@ -226,7 +227,7 @@ static void service_close_socket_fd(Service *s) {
         if (s->socket_fd < 0)
                 return;
 
-        s->socket_fd = safe_close(s->socket_fd);
+        s->socket_fd = asynchronous_close(s->socket_fd);
 }
 
 static void service_connection_unref(Service *s) {
@@ -2685,7 +2686,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
                         log_debug_unit(u->id, "Failed to parse socket-fd value %s", value);
                 else {
 
-                        safe_close(s->socket_fd);
+                        asynchronous_close(s->socket_fd);
                         s->socket_fd = fdset_remove(fds, fd);
                 }
         } else if (streq(key, "main-exec-status-pid")) {

commit 43f1b28bc457c92f85332dda752d5426cde466ae
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 2 17:56:05 2014 +0200

    async: add asynchronous close() call
    
    (cherry picked from commit 8a474b0c04a5a3608dda53edc1ddaa932ba177bf)

diff --git a/src/core/async.c b/src/core/async.c
index af527be..3876ded 100644
--- a/src/core/async.c
+++ b/src/core/async.c
@@ -24,6 +24,7 @@
 
 #include "async.h"
 #include "log.h"
+#include "util.h"
 
 int asynchronous_job(void* (*func)(void *p), void *arg) {
         pthread_attr_t a;
@@ -70,3 +71,24 @@ int asynchronous_sync(void) {
 
         return asynchronous_job(sync_thread, NULL);
 }
+
+static void *close_thread(void *p) {
+        safe_close(PTR_TO_INT(p));
+        return NULL;
+}
+
+int asynchronous_close(int fd) {
+        int r;
+
+        /* This is supposed to behave similar to safe_close(), but
+         * actually invoke close() asynchronously, so that it will
+         * never block. Ideally the kernel would have an API for this,
+         * but it doesn't, so we work around it, and hide this as a
+         * far away as we can. */
+
+        r = asynchronous_job(close_thread, INT_TO_PTR(fd));
+        if (r < 0)
+                safe_close(fd);
+
+        return -1;
+}
diff --git a/src/core/async.h b/src/core/async.h
index 6601b4d..7f1ef79 100644
--- a/src/core/async.h
+++ b/src/core/async.h
@@ -22,4 +22,6 @@
 ***/
 
 int asynchronous_job(void* (*func)(void *p), void *arg);
+
 int asynchronous_sync(void);
+int asynchronous_close(int fd);

commit 4529ad1defde79e74797b494ab3ac924ce06ff2a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 18 19:22:43 2014 +0100

    util: replace close_nointr_nofail() by a more useful safe_close()
    
    safe_close() automatically becomes a NOP when a negative fd is passed,
    and returns -1 unconditionally. This makes it easy to write lines like
    this:
    
            fd = safe_close(fd);
    
    Which will close an fd if it is open, and reset the fd variable
    correctly.
    
    By making use of this new scheme we can drop a > 200 lines of code that
    was required to test for non-negative fds or to reset the closed fd
    variable afterwards.
    
    (cherry-picked from commit 03e334a1c7dc8c20c38902aa039440763acc9b17)

diff --git a/src/core/audit-fd.c b/src/core/audit-fd.c
index 5955bd8..4326d17 100644
--- a/src/core/audit-fd.c
+++ b/src/core/audit-fd.c
@@ -55,7 +55,7 @@ int get_audit_fd(void) {
 void close_audit_fd(void) {
 
         if (initialized && audit_fd >= 0)
-                close_nointr_nofail(audit_fd);
+                safe_close(audit_fd);
 
         initialized = true;
         audit_fd = -ECONNRESET;
diff --git a/src/core/automount.c b/src/core/automount.c
index 889b20e..77d80b2 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -90,9 +90,7 @@ static void unmount_autofs(Automount *a) {
         automount_send_ready(a, -EHOSTDOWN);
 
         a->pipe_event_source = sd_event_source_unref(a->pipe_event_source);
-
-        close_nointr_nofail(a->pipe_fd);
-        a->pipe_fd = -1;
+        a->pipe_fd = safe_close(a->pipe_fd);
 
         /* If we reload/reexecute things we keep the mount point
          * around */
@@ -310,8 +308,7 @@ static int open_dev_autofs(Manager *m) {
 
         init_autofs_dev_ioctl(&param);
         if (ioctl(m->dev_autofs_fd, AUTOFS_DEV_IOCTL_VERSION, &param) < 0) {
-                close_nointr_nofail(m->dev_autofs_fd);
-                m->dev_autofs_fd = -1;
+                m->dev_autofs_fd = safe_close(m->dev_autofs_fd);
                 return -errno;
         }
 
@@ -411,8 +408,9 @@ static int autofs_send_ready(int dev_autofs_fd, int ioctl_fd, uint32_t token, in
 }
 
 int automount_send_ready(Automount *a, int status) {
-        int ioctl_fd, r;
+        _cleanup_close_ int ioctl_fd = -1;
         unsigned token;
+        int r;
 
         assert(a);
         assert(status <= 0);
@@ -421,10 +419,8 @@ int automount_send_ready(Automount *a, int status) {
                 return 0;
 
         ioctl_fd = open_ioctl_fd(UNIT(a)->manager->dev_autofs_fd, a->where, a->dev_id);
-        if (ioctl_fd < 0) {
-                r = ioctl_fd;
-                goto fail;
-        }
+        if (ioctl_fd < 0)
+                return ioctl_fd;
 
         if (status)
                 log_debug_unit(UNIT(a)->id, "Sending failure: %s", strerror(-status));
@@ -450,18 +446,15 @@ int automount_send_ready(Automount *a, int status) {
                         r = k;
         }
 
-fail:
-        if (ioctl_fd >= 0)
-                close_nointr_nofail(ioctl_fd);
-
         return r;
 }
 
 static void automount_enter_waiting(Automount *a) {
+        _cleanup_close_ int ioctl_fd = -1;
         int p[2] = { -1, -1 };
         char name[32], options[128];
         bool mounted = false;
-        int r, ioctl_fd = -1, dev_autofs_fd;
+        int r, dev_autofs_fd;
         struct stat st;
 
         assert(a);
@@ -500,8 +493,7 @@ static void automount_enter_waiting(Automount *a) {
 
         mounted = true;
 
-        close_nointr_nofail(p[1]);
-        p[1] = -1;
+        p[1] = safe_close(p[1]);
 
         if (stat(a->where, &st) < 0) {
                 r = -errno;
@@ -528,9 +520,6 @@ static void automount_enter_waiting(Automount *a) {
          * the direct mount will not receive events from the
          * kernel. */
 
-        close_nointr_nofail(ioctl_fd);
-        ioctl_fd = -1;
-
         r = sd_event_add_io(UNIT(a)->manager->event, &a->pipe_event_source, p[0], EPOLLIN, automount_dispatch_io, a);
         if (r < 0)
                 goto fail;
@@ -543,10 +532,7 @@ static void automount_enter_waiting(Automount *a) {
         return;
 
 fail:
-        assert_se(close_pipe(p) == 0);
-
-        if (ioctl_fd >= 0)
-                close_nointr_nofail(ioctl_fd);
+        close_pipe(p);
 
         if (mounted)
                 repeat_unmount(a->where);
@@ -713,9 +699,7 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu
                 if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                         log_debug_unit(u->id, "Failed to parse pipe-fd value %s", value);
                 else {
-                        if (a->pipe_fd >= 0)
-                                close_nointr_nofail(a->pipe_fd);
-
+                        safe_close(a->pipe_fd);
                         a->pipe_fd = fdset_remove(fds, fd);
                 }
         } else
@@ -809,8 +793,7 @@ fail:
 static void automount_shutdown(Manager *m) {
         assert(m);
 
-        if (m->dev_autofs_fd >= 0)
-                close_nointr_nofail(m->dev_autofs_fd);
+        m->dev_autofs_fd = safe_close(m->dev_autofs_fd);
 }
 
 static void automount_reset_failed(Unit *u) {
diff --git a/src/core/busname.c b/src/core/busname.c
index bca2145..69d6e80 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -56,11 +56,7 @@ static void busname_done(Unit *u) {
         unit_ref_unset(&n->service);
 
         n->event_source = sd_event_source_unref(n->event_source);
-
-        if (n->starter_fd >= 0) {
-                close_nointr_nofail(n->starter_fd);
-                n->starter_fd = -1;
-        }
+        n->starter_fd = safe_close(n->starter_fd);
 }
 
 static int busname_add_default_default_dependencies(BusName *n) {
@@ -122,8 +118,6 @@ static int busname_add_extras(BusName *n) {
         return 0;
 }
 
-
-
 static int busname_verify(BusName *n) {
         char *e;
 
@@ -202,8 +196,7 @@ static void busname_close_fd(BusName *n) {
         if (n->starter_fd <= 0)
                 return;
 
-        close_nointr_nofail(n->starter_fd);
-        n->starter_fd = -1;
+        n->starter_fd = safe_close(n->starter_fd);
 }
 
 static int busname_watch_fd(BusName *n) {
@@ -453,8 +446,7 @@ static int busname_deserialize_item(Unit *u, const char *key, const char *value,
                 if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                         log_debug_unit(u->id, "Failed to parse starter fd value %s", value);
                 else {
-                        if (n->starter_fd >= 0)
-                                close_nointr_nofail(n->starter_fd);
+                        safe_close(n->starter_fd);
                         n->starter_fd = fdset_remove(fds, fd);
                 }
         } else
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index e762bbf..5c9ef02 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -860,8 +860,7 @@ int manager_setup_cgroup(Manager *m) {
         }
 
         /* 5. And pin it, so that it cannot be unmounted */
-        if (m->pin_cgroupfs_fd >= 0)
-                close_nointr_nofail(m->pin_cgroupfs_fd);
+        safe_close(m->pin_cgroupfs_fd);
 
         m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK);
         if (m->pin_cgroupfs_fd < 0) {
@@ -886,10 +885,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
         if (delete && m->cgroup_root)
                 cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
 
-        if (m->pin_cgroupfs_fd >= 0) {
-                close_nointr_nofail(m->pin_cgroupfs_fd);
-                m->pin_cgroupfs_fd = -1;
-        }
+        m->pin_cgroupfs_fd = safe_close(m->pin_cgroupfs_fd);
 
         free(m->cgroup_root);
         m->cgroup_root = NULL;
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 1059415..fe1c6e9 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -1080,10 +1080,7 @@ void bus_done(Manager *m) {
         if (m->private_listen_event_source)
                 m->private_listen_event_source = sd_event_source_unref(m->private_listen_event_source);
 
-        if (m->private_listen_fd >= 0) {
-                close_nointr_nofail(m->private_listen_fd);
-                m->private_listen_fd = -1;
-        }
+        m->private_listen_fd = safe_close(m->private_listen_fd);
 }
 
 int bus_fdset_add_all(Manager *m, FDSet *fds) {
diff --git a/src/core/execute.c b/src/core/execute.c
index bb06507..a5fe0c9 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -121,7 +121,7 @@ static int shift_fds(int fds[], unsigned n_fds) {
                         if ((nfd = fcntl(fds[i], F_DUPFD, i+3)) < 0)
                                 return -errno;
 
-                        close_nointr_nofail(fds[i]);
+                        safe_close(fds[i]);
                         fds[i] = nfd;
 
                         /* Hmm, the fd we wanted isn't free? Then
@@ -207,7 +207,7 @@ static int open_null_as(int flags, int nfd) {
 
         if (fd != nfd) {
                 r = dup2(fd, nfd) < 0 ? -errno : nfd;
-                close_nointr_nofail(fd);
+                safe_close(fd);
         } else
                 r = nfd;
 
@@ -232,12 +232,12 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
 
         r = connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
         if (r < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         if (shutdown(fd, SHUT_RD) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -261,7 +261,7 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
 
         if (fd != nfd) {
                 r = dup2(fd, nfd) < 0 ? -errno : nfd;
-                close_nointr_nofail(fd);
+                safe_close(fd);
         } else
                 r = nfd;
 
@@ -278,7 +278,7 @@ static int open_terminal_as(const char *path, mode_t mode, int nfd) {
 
         if (fd != nfd) {
                 r = dup2(fd, nfd) < 0 ? -errno : nfd;
-                close_nointr_nofail(fd);
+                safe_close(fd);
         } else
                 r = nfd;
 
@@ -338,7 +338,7 @@ static int setup_input(const ExecContext *context, int socket_fd, bool apply_tty
 
                 if (fd != STDIN_FILENO) {
                         r = dup2(fd, STDIN_FILENO) < 0 ? -errno : STDIN_FILENO;
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                 } else
                         r = STDIN_FILENO;
 
@@ -502,7 +502,7 @@ static int setup_confirm_stdio(int *_saved_stdin,
         }
 
         if (fd >= 2)
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
         *_saved_stdin = saved_stdin;
         *_saved_stdout = saved_stdout;
@@ -510,20 +510,15 @@ static int setup_confirm_stdio(int *_saved_stdin,
         return 0;
 
 fail:
-        if (saved_stdout >= 0)
-                close_nointr_nofail(saved_stdout);
-
-        if (saved_stdin >= 0)
-                close_nointr_nofail(saved_stdin);
-
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(saved_stdout);
+        safe_close(saved_stdin);
+        safe_close(fd);
 
         return r;
 }
 
 _printf_(1, 2) static int write_confirm_message(const char *format, ...) {
-        int fd;
+        _cleanup_close_ int fd = -1;
         va_list ap;
 
         assert(format);
@@ -536,8 +531,6 @@ _printf_(1, 2) static int write_confirm_message(const char *format, ...) {
         vdprintf(fd, format, ap);
         va_end(ap);
 
-        close_nointr_nofail(fd);
-
         return 0;
 }
 
@@ -559,11 +552,8 @@ static int restore_confirm_stdio(int *saved_stdin,
                 if (dup2(*saved_stdout, STDOUT_FILENO) < 0)
                         r = -errno;
 
-        if (*saved_stdin >= 0)
-                close_nointr_nofail(*saved_stdin);
-
-        if (*saved_stdout >= 0)
-                close_nointr_nofail(*saved_stdout);
+        safe_close(*saved_stdin);
+        safe_close(*saved_stdout);
 
         return r;
 }
@@ -1002,10 +992,9 @@ static int apply_seccomp(ExecContext *c) {
 static void do_idle_pipe_dance(int idle_pipe[4]) {
         assert(idle_pipe);
 
-        if (idle_pipe[1] >= 0)
-                close_nointr_nofail(idle_pipe[1]);
-        if (idle_pipe[2] >= 0)
-                close_nointr_nofail(idle_pipe[2]);
+
+        safe_close(idle_pipe[1]);
+        safe_close(idle_pipe[2]);
 
         if (idle_pipe[0] >= 0) {
                 int r;
@@ -1020,12 +1009,11 @@ static void do_idle_pipe_dance(int idle_pipe[4]) {
                         fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT2_USEC);
                 }
 
-                close_nointr_nofail(idle_pipe[0]);
+                safe_close(idle_pipe[0]);
 
         }
 
-        if (idle_pipe[3] >= 0)
-                close_nointr_nofail(idle_pipe[3]);
+        safe_close(idle_pipe[3]);
 }
 
 static int build_environment(
@@ -2545,9 +2533,7 @@ int exec_runtime_deserialize_item(ExecRuntime **rt, Unit *u, const char *key, co
                 if (safe_atoi(value, &fd) < 0 || !fdset_contains(fds, fd))
                         log_debug_unit(u->id, "Failed to parse netns socket value %s", value);
                 else {
-                        if ((*rt)->netns_storage_socket[0] >= 0)
-                                close_nointr_nofail((*rt)->netns_storage_socket[0]);
-
+                        safe_close((*rt)->netns_storage_socket[0]);
                         (*rt)->netns_storage_socket[0] = fdset_remove(fds, fd);
                 }
         } else if (streq(key, "netns-socket-1")) {
@@ -2560,9 +2546,7 @@ int exec_runtime_deserialize_item(ExecRuntime **rt, Unit *u, const char *key, co
                 if (safe_atoi(value, &fd) < 0 || !fdset_contains(fds, fd))
                         log_debug_unit(u->id, "Failed to parse netns socket value %s", value);
                 else {
-                        if ((*rt)->netns_storage_socket[1] >= 0)
-                                close_nointr_nofail((*rt)->netns_storage_socket[1]);
-
+                        safe_close((*rt)->netns_storage_socket[1]);
                         (*rt)->netns_storage_socket[1] = fdset_remove(fds, fd);
                 }
         } else
diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c
index 7f8ec23..ed65096 100644
--- a/src/core/ima-setup.c
+++ b/src/core/ima-setup.c
@@ -47,7 +47,7 @@ int ima_setup(void) {
        struct stat st;
        ssize_t policy_size = 0, written = 0;
        char *policy;
-       int policyfd = -1, imafd = -1;
+       _cleanup_close_ int policyfd = -1, imafd = -1;
        int result = 0;
 
        if (stat(IMA_POLICY_PATH, &st) < 0)
@@ -98,10 +98,6 @@ int ima_setup(void) {
 out_mmap:
        munmap(policy, policy_size);
 out:
-       if (policyfd >= 0)
-                close_nointr_nofail(policyfd);
-       if (imafd >= 0)
-                close_nointr_nofail(imafd);
        if (result)
                 return result;
 #endif /* HAVE_IMA */
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 027ec5f..2129eba 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2701,7 +2701,7 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
         f = fdopen(fd, "re");
         if (!f) {
                 r = -errno;
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return r;
         }
 
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index 602be3b..e3f7d3f 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -73,7 +73,7 @@ static int generate(char id[34]) {
         fd = open("/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
         if (fd >= 0) {
                 k = loop_read(fd, id, 33, false);
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
                 if (k == 33 && id[32] == '\n') {
 
@@ -118,7 +118,7 @@ static int generate(char id[34]) {
                         fd = open("/sys/class/dmi/id/product_uuid", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
                         if (fd >= 0) {
                                 k = loop_read(fd, uuid, 36, false);
-                                close_nointr_nofail(fd);
+                                safe_close(fd);
 
                                 if (k >= 36) {
                                         r = shorten_uuid(id, uuid);
@@ -205,8 +205,7 @@ int machine_id_setup(void) {
                         return 0;
         }
 
-        close_nointr_nofail(fd);
-        fd = -1;
+        fd = safe_close(fd);
 
         /* Hmm, we couldn't write it? So let's write it to
          * /run/machine-id as a replacement */
diff --git a/src/core/main.c b/src/core/main.c
index f383364..8417e7a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -234,7 +234,7 @@ static int console_setup(bool do_reset) {
         if (r < 0)
                 log_error("Failed to reset /dev/console: %s", strerror(-r));
 
-        close_nointr_nofail(tty_fd);
+        safe_close(tty_fd);
         return r;
 }
 
diff --git a/src/core/manager.c b/src/core/manager.c
index 5689e60..2f9ea1f 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -248,8 +248,7 @@ static int manager_setup_time_change(Manager *m) {
 
         if (timerfd_settime(m->time_change_fd, TFD_TIMER_ABSTIME|TFD_TIMER_CANCEL_ON_SET, &its, NULL) < 0) {
                 log_debug("Failed to set up TFD_TIMER_CANCEL_ON_SET, ignoring: %m");
-                close_nointr_nofail(m->time_change_fd);
-                m->time_change_fd = -1;
+                m->time_change_fd = safe_close(m->time_change_fd);
                 return 0;
         }
 
@@ -785,14 +784,10 @@ void manager_free(Manager *m) {
         sd_event_source_unref(m->idle_pipe_event_source);
         sd_event_source_unref(m->run_queue_event_source);
 
-        if (m->signal_fd >= 0)
-                close_nointr_nofail(m->signal_fd);
-        if (m->notify_fd >= 0)
-                close_nointr_nofail(m->notify_fd);
-        if (m->time_change_fd >= 0)
-                close_nointr_nofail(m->time_change_fd);
-        if (m->kdbus_fd >= 0)
-                close_nointr_nofail(m->kdbus_fd);
+        safe_close(m->signal_fd);
+        safe_close(m->notify_fd);
+        safe_close(m->time_change_fd);
+        safe_close(m->kdbus_fd);
 
         manager_close_idle_pipe(m);
 
@@ -1746,9 +1741,7 @@ static int manager_dispatch_time_change_fd(sd_event_source *source, int fd, uint
 
         /* Restart the watch */
         m->time_change_event_source = sd_event_source_unref(m->time_change_event_source);
-
-        close_nointr_nofail(m->time_change_fd);
-        m->time_change_fd = -1;
+        m->time_change_fd = safe_close(m->time_change_fd);
 
         manager_setup_time_change(m);
 
@@ -2032,7 +2025,7 @@ int manager_open_serialization(Manager *m, FILE **_f) {
 
         f = fdopen(fd, "w+");
         if (!f) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -2253,11 +2246,8 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                         if (safe_atoi(l + 10, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                                 log_debug("Failed to parse notify fd: %s", l + 10);
                         else {
-                                if (m->notify_fd >= 0) {
-                                        m->notify_event_source = sd_event_source_unref(m->notify_event_source);
-                                        close_nointr_nofail(m->notify_fd);
-                                }
-
+                                m->notify_event_source = sd_event_source_unref(m->notify_event_source);
+                                safe_close(m->notify_fd);
                                 m->notify_fd = fdset_remove(fds, fd);
                         }
 
@@ -2279,9 +2269,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                         if (safe_atoi(l + 9, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                                 log_debug("Failed to parse kdbus fd: %s", l + 9);
                         else {
-                                if (m->kdbus_fd >= 0)
-                                        close_nointr_nofail(m->kdbus_fd);
-
+                                safe_close(m->kdbus_fd);
                                 m->kdbus_fd = fdset_remove(fds, fd);
                         }
 
diff --git a/src/core/path.c b/src/core/path.c
index 1d6c6cc..6fea791 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -152,11 +152,7 @@ void path_spec_unwatch(PathSpec *s) {
         assert(s);
 
         s->event_source = sd_event_source_unref(s->event_source);
-
-        if (s->inotify_fd >= 0) {
-                close_nointr_nofail(s->inotify_fd);
-                s->inotify_fd = -1;
-        }
+        s->inotify_fd = safe_close(s->inotify_fd);
 }
 
 int path_spec_fd_event(PathSpec *s, uint32_t revents) {
diff --git a/src/core/service.c b/src/core/service.c
index 6079881..3c39798 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -226,8 +226,7 @@ static void service_close_socket_fd(Service *s) {
         if (s->socket_fd < 0)
                 return;
 
-        close_nointr_nofail(s->socket_fd);
-        s->socket_fd = -1;
+        s->socket_fd = safe_close(s->socket_fd);
 }
 
 static void service_connection_unref(Service *s) {
@@ -2686,8 +2685,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
                         log_debug_unit(u->id, "Failed to parse socket-fd value %s", value);
                 else {
 
-                        if (s->socket_fd >= 0)
-                                close_nointr_nofail(s->socket_fd);
+                        safe_close(s->socket_fd);
                         s->socket_fd = fdset_remove(fds, fd);
                 }
         } else if (streq(key, "main-exec-status-pid")) {
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index a68605c..5f6dabf 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -87,7 +87,7 @@ static int write_rules(const char* dstpath, const char* srcdir) {
                 if (!policy) {
                         if (r == 0)
                                 r = -errno;
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         log_error("Failed to open %s: %m", entry->d_name);
                         continue;
                 }
diff --git a/src/core/socket.c b/src/core/socket.c
index 0ccda2f..0c76d7f 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -119,9 +119,7 @@ void socket_free_ports(Socket *s) {
 
                 sd_event_source_unref(p->event_source);
 
-                if (p->fd >= 0)
-                        close_nointr_nofail(p->fd);
-
+                safe_close(p->fd);
                 free(p->path);
                 free(p);
         }
@@ -706,7 +704,7 @@ static void socket_close_fds(Socket *s) {
                 if (p->fd < 0)
                         continue;
 
-                close_nointr_nofail(p->fd);
+                p->fd = safe_close(p->fd);
 
                 /* One little note: we should never delete any sockets
                  * in the file system here! After all some other
@@ -715,8 +713,6 @@ static void socket_close_fds(Socket *s) {
                  * we delete sockets in the file system before we
                  * create a new one, not after we stopped using
                  * one! */
-
-                p->fd = -1;
         }
 }
 
@@ -886,9 +882,7 @@ static int fifo_address_create(
 
 fail:
         label_context_clear();
-
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -923,8 +917,7 @@ static int special_address_create(
         return 0;
 
 fail:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -983,9 +976,7 @@ static int mq_address_create(
         return 0;
 
 fail:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
-
+        safe_close(fd);
         return r;
 }
 
@@ -1475,7 +1466,7 @@ static void socket_enter_running(Socket *s, int cfd) {
                 log_debug_unit(UNIT(s)->id, "Suppressing connection request on %s since unit stop is scheduled.", UNIT(s)->id);
 
                 if (cfd >= 0)
-                        close_nointr_nofail(cfd);
+                        safe_close(cfd);
                 else  {
                         /* Flush all sockets by closing and reopening them */
                         socket_close_fds(s);
@@ -1523,7 +1514,7 @@ static void socket_enter_running(Socket *s, int cfd) {
 
                 if (s->n_connections >= s->max_connections) {
                         log_warning_unit(UNIT(s)->id, "%s: Too many incoming connections (%u)", UNIT(s)->id, s->n_connections);
-                        close_nointr_nofail(cfd);
+                        safe_close(cfd);
                         return;
                 }
 
@@ -1538,7 +1529,7 @@ static void socket_enter_running(Socket *s, int cfd) {
 
                         /* ENOTCONN is legitimate if TCP RST was received.
                          * This connection is over, but the socket unit lives on. */
-                        close_nointr_nofail(cfd);
+                        safe_close(cfd);
                         return;
                 }
 
@@ -1589,9 +1580,7 @@ fail:
                          bus_error_message(&error, r));
 
         socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES);
-
-        if (cfd >= 0)
-                close_nointr_nofail(cfd);
+        safe_close(cfd);
 }
 
 static void socket_run_next(Socket *s) {
@@ -1822,8 +1811,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
                                         break;
 
                         if (p) {
-                                if (p->fd >= 0)
-                                        close_nointr_nofail(p->fd);
+                                safe_close(p->fd);
                                 p->fd = fdset_remove(fds, fd);
                         }
                 }
@@ -1842,8 +1830,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
                                         break;
 
                         if (p) {
-                                if (p->fd >= 0)
-                                        close_nointr_nofail(p->fd);
+                                safe_close(p->fd);
                                 p->fd = fdset_remove(fds, fd);
                         }
                 }
@@ -1862,8 +1849,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
                                         break;
 
                         if (p) {
-                                if (p->fd >= 0)
-                                        close_nointr_nofail(p->fd);
+                                safe_close(p->fd);
                                 p->fd = fdset_remove(fds, fd);
                         }
                 }
@@ -1881,8 +1867,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
                                         break;
 
                         if (p) {
-                                if (p->fd >= 0)
-                                        close_nointr_nofail(p->fd);
+                                safe_close(p->fd);
                                 p->fd = fdset_remove(fds, fd);
                         }
                 }
@@ -1900,8 +1885,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
                                         break;
 
                         if (p) {
-                                if (p->fd >= 0)
-                                        close_nointr_nofail(p->fd);
+                                safe_close(p->fd);
                                 p->fd = fdset_remove(fds, fd);
                         }
                 }
diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index ce0e41d..518ec1f 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -41,11 +41,10 @@ int switch_root(const char *new_root) {
                 "/sys\0"
                 "/run\0";
 
-        int r, old_root_fd = -1;
+        _cleanup_close_ int old_root_fd = -1;
         struct stat new_root_stat;
         bool old_root_remove;
-        const char *i;
-        _cleanup_free_ char *temporary_old_root = NULL;
+        const char *i, *temporary_old_root;
 
         if (path_equal(new_root, "/"))
                 return 0;
@@ -56,16 +55,13 @@ int switch_root(const char *new_root) {
          * directory we choose for this, but it should be more likely
          * than not that /mnt exists and is suitable as mount point
          * and is on the same fs as the old root dir */
-        temporary_old_root = strappend(new_root, "/mnt");
-        if (!temporary_old_root)
-                return -ENOMEM;
+        temporary_old_root = strappenda(new_root, "/mnt");
 
         old_root_remove = in_initrd();
 
         if (stat(new_root, &new_root_stat) < 0) {
-                r = -errno;
                 log_error("Failed to stat directory %s: %m", new_root);
-                goto fail;
+                return -errno;
         }
 
         /* Work-around for a kernel bug: for some reason the kernel
@@ -104,9 +100,8 @@ int switch_root(const char *new_root) {
         }
 
         if (chdir(new_root) < 0) {
-                r = -errno;
                 log_error("Failed to change directory to %s: %m", new_root);
-                goto fail;
+                return -errno;
         }
 
         if (old_root_remove) {
@@ -123,27 +118,23 @@ int switch_root(const char *new_root) {
                 /* Immediately get rid of the old root. Since we are
                  * running off it we need to do this lazily. */
                 if (umount2(temporary_old_root, MNT_DETACH) < 0) {
-                        r = -errno;
                         log_error("Failed to umount old root dir %s: %m", temporary_old_root);
-                        goto fail;
+                        return -errno;
                 }
 
         } else if (mount(new_root, "/", NULL, MS_MOVE, NULL) < 0) {
-                r = -errno;
                 log_error("Failed to mount moving %s to /: %m", new_root);
-                goto fail;
+                return -errno;
         }
 
         if (chroot(".") < 0) {
-                r = -errno;
                 log_error("Failed to change root: %m");
-                goto fail;
+                return -errno;
         }
 
         if (chdir("/") < 0) {
-                r = -errno;
                 log_error("Failed to change directory: %m");
-                goto fail;
+                return -errno;
         }
 
         if (old_root_fd >= 0) {
@@ -157,11 +148,5 @@ int switch_root(const char *new_root) {
                 }
         }
 
-        r = 0;
-
-fail:
-        if (old_root_fd >= 0)
-                close_nointr_nofail(old_root_fd);
-
-        return r;
+        return 0;
 }
diff --git a/src/core/umount.c b/src/core/umount.c
index 2d166c1..d1258f0 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -329,14 +329,14 @@ static int dm_list_get(MountPoint **head) {
 }
 
 static int delete_loopback(const char *device) {
-        int fd, r;
+        _cleanup_close_ int fd = -1;
+        int r;
 
-        if ((fd = open(device, O_RDONLY|O_CLOEXEC)) < 0)
+        fd = open(device, O_RDONLY|O_CLOEXEC);
+        if (fd < 0)
                 return errno == ENOENT ? 0 : -errno;
 
         r = ioctl(fd, LOOP_CLR_FD, 0);
-        close_nointr_nofail(fd);
-
         if (r >= 0)
                 return 1;
 
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 4a5f6b1..869ae92 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -137,7 +137,7 @@ static int process_progress(int fd) {
 
         f = fdopen(fd, "r");
         if (!f) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -324,15 +324,12 @@ int main(int argc, char *argv[]) {
         } else if (pid == 0) {
                 /* Child */
                 if (progress_pipe[0] >= 0)
-                        close_nointr_nofail(progress_pipe[0]);
+                        safe_close(progress_pipe[0]);
                 execv(cmdline[0], (char**) cmdline);
                 _exit(8); /* Operational error */
         }
 
-        if (progress_pipe[1] >= 0) {
-                close_nointr_nofail(progress_pipe[1]);
-                progress_pipe[1] = -1;
-        }
+        progress_pipe[1] = safe_close(progress_pipe[1]);
 
         if (progress_pipe[0] >= 0) {
                 process_progress(progress_pipe[0]);
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index 468df35..f9613ea 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -245,7 +245,7 @@ static void fifo_free(Fifo *f) {
                 if (f->server)
                         epoll_ctl(f->server->epoll_fd, EPOLL_CTL_DEL, f->fd, NULL);
 
-                close_nointr_nofail(f->fd);
+                safe_close(f->fd);
         }
 
         free(f);
@@ -257,8 +257,7 @@ static void server_done(Server *s) {
         while (s->fifos)
                 fifo_free(s->fifos);
 
-        if (s->epoll_fd >= 0)
-                close_nointr_nofail(s->epoll_fd);
+        safe_close(s->epoll_fd);
 
         if (s->bus) {
                 sd_bus_flush(s->bus);
diff --git a/src/journal/cat.c b/src/journal/cat.c
index 02b7564..60625cb 100644
--- a/src/journal/cat.c
+++ b/src/journal/cat.c
@@ -152,7 +152,7 @@ int main(int argc, char *argv[]) {
         }
 
         if (fd >= 3)
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
         fd = -1;
 
@@ -170,11 +170,8 @@ int main(int argc, char *argv[]) {
         log_error("Failed to execute process: %s", strerror(-r));
 
 finish:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
-
-        if (saved_stderr >= 0)
-                close_nointr_nofail(saved_stderr);
+        safe_close(fd);
+        safe_close(saved_stderr);
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }
diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index 469719a..f03357d 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -485,18 +485,18 @@ static int open_mmap(const char *database, int *_fd, struct stat *_st, void **_p
                 return -errno;
 
         if (fstat(fd, &st) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         if (st.st_size < (off_t) sizeof(CatalogHeader)) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -EINVAL;
         }
 
         p = mmap(NULL, PAGE_ALIGN(st.st_size), PROT_READ, MAP_SHARED, fd, 0);
         if (p == MAP_FAILED) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -507,7 +507,7 @@ static int open_mmap(const char *database, int *_fd, struct stat *_st, void **_p
             h->incompatible_flags != 0 ||
             le64toh(h->n_items) <= 0 ||
             st.st_size < (off_t) (le64toh(h->header_size) + le64toh(h->catalog_item_size) * le64toh(h->n_items))) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 munmap(p, st.st_size);
                 return -EBADMSG;
         }
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 3bceb48..bf943bc 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -490,8 +490,7 @@ static int run_gdb(sd_journal *j) {
                 goto finish;
         }
 
-        close_nointr_nofail(fd);
-        fd = -1;
+        fd = safe_close(fd);
 
         pid = fork();
         if (pid < 0) {
diff --git a/src/journal/journal-authenticate.c b/src/journal/journal-authenticate.c
index f416b79..5ab1982 100644
--- a/src/journal/journal-authenticate.c
+++ b/src/journal/journal-authenticate.c
@@ -418,10 +418,9 @@ finish:
         if (m)
                 munmap(m, PAGE_ALIGN(sizeof(FSSHeader)));
 
-        if (fd >= 0)
-                close_nointr_nofail(fd);
-
+        safe_close(fd);
         free(p);
+
         return r;
 }
 
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index c27289c..49d47cb 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -133,9 +133,7 @@ void journal_file_close(JournalFile *f) {
         if (f->header)
                 munmap(f->header, PAGE_ALIGN(sizeof(Header)));
 
-        if (f->fd >= 0)
-                close_nointr_nofail(f->fd);
-
+        safe_close(f->fd);
         free(f->path);
 
         if (f->mmap)
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index ca9199f..d92e84b 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -66,7 +66,7 @@ retry:
         fd_inc_sndbuf(fd, SNDBUF_SIZE);
 
         if (!__sync_bool_compare_and_swap(&fd_plus_one, 0, fd+1)) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 goto retry;
         }
 
@@ -316,7 +316,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
 
         n = writev(buffer_fd, w, j);
         if (n < 0) {
-                close_nointr_nofail(buffer_fd);
+                safe_close(buffer_fd);
                 return -errno;
         }
 
@@ -336,7 +336,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
         mh.msg_controllen = cmsg->cmsg_len;
 
         k = sendmsg(fd, &mh, MSG_NOSIGNAL);
-        close_nointr_nofail(buffer_fd);
+        safe_close(buffer_fd);
 
         if (k < 0)
                 return -errno;
@@ -412,12 +412,12 @@ _public_ int sd_journal_stream_fd(const char *identifier, int priority, int leve
 
         r = connect(fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
         if (r < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         if (shutdown(fd, SHUT_RD) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -445,12 +445,12 @@ _public_ int sd_journal_stream_fd(const char *identifier, int priority, int leve
 
         r = loop_write(fd, header, l, false);
         if (r < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return (int) r;
         }
 
         if ((size_t) r != l) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 9434cc9..31bae5a 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -1222,9 +1222,9 @@ int journal_file_verify(
         mmap_cache_close_fd(f->mmap, entry_fd);
         mmap_cache_close_fd(f->mmap, entry_array_fd);
 
-        close_nointr_nofail(data_fd);
-        close_nointr_nofail(entry_fd);
-        close_nointr_nofail(entry_array_fd);
+        safe_close(data_fd);
+        safe_close(entry_fd);
+        safe_close(entry_array_fd);
 
         if (first_contained)
                 *first_contained = le64toh(f->header->head_entry_realtime);
@@ -1247,17 +1247,17 @@ fail:
 
         if (data_fd >= 0) {
                 mmap_cache_close_fd(f->mmap, data_fd);
-                close_nointr_nofail(data_fd);
+                safe_close(data_fd);
         }
 
         if (entry_fd >= 0) {
                 mmap_cache_close_fd(f->mmap, entry_fd);
-                close_nointr_nofail(entry_fd);
+                safe_close(entry_fd);
         }
 
         if (entry_array_fd >= 0) {
                 mmap_cache_close_fd(f->mmap, entry_array_fd);
-                close_nointr_nofail(entry_array_fd);
+                safe_close(entry_array_fd);
         }
 
         return r;
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index d49cb07..86453e6 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1290,7 +1290,7 @@ static int setup_keys(void) {
         n = now(CLOCK_REALTIME);
         n /= arg_interval;
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
         fd = mkostemp_safe(k, O_WRONLY|O_CLOEXEC);
         if (fd < 0) {
                 log_error("Failed to open %s: %m", k);
@@ -1389,8 +1389,7 @@ static int setup_keys(void) {
         r = 0;
 
 finish:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         if (k) {
                 unlink(k);
diff --git a/src/journal/journald-console.c b/src/journal/journald-console.c
index 35da52a..3db5fc5 100644
--- a/src/journal/journald-console.c
+++ b/src/journal/journald-console.c
@@ -107,5 +107,5 @@ void server_forward_console(
         if (writev(fd, iovec, n) < 0)
                 log_debug("Failed to write to %s for logging: %m", tty);
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 }
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 05b128f..35948ea 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -428,19 +428,14 @@ int server_open_dev_kmsg(Server *s) {
         return 0;
 
 fail:
-        if (s->dev_kmsg_event_source)
-                s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source);
-
-        if (s->dev_kmsg_fd >= 0) {
-                close_nointr_nofail(s->dev_kmsg_fd);
-                s->dev_kmsg_fd = -1;
-        }
+        s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source);
+        s->dev_kmsg_fd = safe_close(s->dev_kmsg_fd);
 
         return r;
 }
 
 int server_open_kernel_seqnum(Server *s) {
-        int fd;
+        _cleanup_close_ int fd;
         uint64_t *p;
 
         assert(s);
@@ -457,18 +452,15 @@ int server_open_kernel_seqnum(Server *s) {
 
         if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
                 log_error("Failed to allocate sequential number file, ignoring: %m");
-                close_nointr_nofail(fd);
                 return 0;
         }
 
         p = mmap(NULL, sizeof(uint64_t), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
         if (p == MAP_FAILED) {
                 log_error("Failed to map sequential number file, ignoring: %m");
-                close_nointr_nofail(fd);
                 return 0;
         }
 
-        close_nointr_nofail(fd);
         s->kernel_seqnum = p;
 
         return 0;
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 96ef66d..1d9c35b 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1435,8 +1435,7 @@ static int server_open_hostname(Server *s) {
                 if (r == -EPERM) {
                         log_warning("Failed to register hostname fd in event loop: %s. Ignoring.",
                                         strerror(-r));
-                        close_nointr_nofail(s->hostname_fd);
-                        s->hostname_fd = -1;
+                        s->hostname_fd = safe_close(s->hostname_fd);
                         return 0;
                 }
 
@@ -1644,20 +1643,11 @@ void server_done(Server *s) {
         sd_event_source_unref(s->hostname_event_source);
         sd_event_unref(s->event);
 
-        if (s->syslog_fd >= 0)
-                close_nointr_nofail(s->syslog_fd);
-
-        if (s->native_fd >= 0)
-                close_nointr_nofail(s->native_fd);
-
-        if (s->stdout_fd >= 0)
-                close_nointr_nofail(s->stdout_fd);
-
-        if (s->dev_kmsg_fd >= 0)
-                close_nointr_nofail(s->dev_kmsg_fd);
-
-        if (s->hostname_fd >= 0)
-                close_nointr_nofail(s->hostname_fd);
+        safe_close(s->syslog_fd);
+        safe_close(s->native_fd);
+        safe_close(s->stdout_fd);
+        safe_close(s->dev_kmsg_fd);
+        safe_close(s->hostname_fd);
 
         if (s->rate_limit)
                 journal_rate_limit_free(s->rate_limit);
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 36fc755..84e7bce 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -337,8 +337,7 @@ void stdout_stream_free(StdoutStream *s) {
                 s->event_source = sd_event_source_unref(s->event_source);
         }
 
-        if (s->fd >= 0)
-                close_nointr_nofail(s->fd);
+        safe_close(s->fd);
 
 #ifdef HAVE_SELINUX
         if (s->security_context)
@@ -373,13 +372,13 @@ static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revent
 
         if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) {
                 log_warning("Too many stdout streams, refusing connection.");
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return 0;
         }
 
         stream = new0(StdoutStream, 1);
         if (!stream) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return log_oom();
         }
 
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 2dbfda0..d6c13c3 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1850,8 +1850,7 @@ _public_ void sd_journal_close(sd_journal *j) {
         hashmap_free(j->directories_by_path);
         hashmap_free(j->directories_by_wd);
 
-        if (j->inotify_fd >= 0)
-                close_nointr_nofail(j->inotify_fd);
+        safe_close(j->inotify_fd);
 
         if (j->mmap) {
                 log_debug("mmap cache statistics: %u hit, %u miss", mmap_cache_get_hit(j->mmap), mmap_cache_get_missed(j->mmap));
diff --git a/src/journal/test-journal-verify.c b/src/journal/test-journal-verify.c
index 0540074..3b181c6 100644
--- a/src/journal/test-journal-verify.c
+++ b/src/journal/test-journal-verify.c
@@ -48,7 +48,7 @@ static void bit_toggle(const char *fn, uint64_t p) {
         r = pwrite(fd, &b, 1, p/8);
         assert(r == 1);
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 }
 
 static int raw_verify(const char *fn, const char *verification_key) {
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index 7d03bfe..b7bb260 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -72,9 +72,9 @@ int main(int argc, char *argv[]) {
 
         mmap_cache_unref(m);
 
-        close_nointr_nofail(x);
-        close_nointr_nofail(y);
-        close_nointr_nofail(z);
+        safe_close(x);
+        safe_close(y);
+        safe_close(z);
 
         return 0;
 }
diff --git a/src/libsystemd-dhcp/dhcp-network.c b/src/libsystemd-dhcp/dhcp-network.c
index 934e8bf..29e915c 100644
--- a/src/libsystemd-dhcp/dhcp-network.c
+++ b/src/libsystemd-dhcp/dhcp-network.c
@@ -52,7 +52,7 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link)
                 return -errno;
 
         if (bind(s, &link->sa, sizeof(link->ll)) < 0) {
-                close_nointr_nofail(s);
+                safe_close(s);
                 return -errno;
         }
 
@@ -73,7 +73,7 @@ int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port)
                 return -errno;
 
         if (bind(s, &src.sa, sizeof(src.in)) < 0) {
-                close_nointr_nofail(s);
+                safe_close(s);
                 return -errno;
         }
 
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c b/src/libsystemd-dhcp/sd-dhcp-client.c
index 0c82260..7b2f24b 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-client.c
@@ -175,9 +175,7 @@ static int client_stop(sd_dhcp_client *client, int error) {
         client->receive_message =
                 sd_event_source_unref(client->receive_message);
 
-        if (client->fd >= 0)
-                close(client->fd);
-        client->fd = -1;
+        client->fd = safe_close(client->fd);
 
         client->timeout_resend = sd_event_source_unref(client->timeout_resend);
 
@@ -527,12 +525,8 @@ static int client_timeout_t2(sd_event_source *s, uint64_t usec, void *userdata)
         sd_dhcp_client *client = userdata;
         int r;
 
-        if (client->fd >= 0) {
-                client->receive_message =
-                        sd_event_source_unref(client->receive_message);
-                close(client->fd);
-                client->fd = -1;
-        }
+        client->receive_message = sd_event_source_unref(client->receive_message);
+        client->fd = safe_close(client->fd);
 
         client->state = DHCP_STATE_REBINDING;
         client->attempt = 1;
@@ -828,8 +822,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
 
                         client->receive_message =
                                 sd_event_source_unref(client->receive_message);
-                        close(client->fd);
-                        client->fd = -1;
+                        client->fd = safe_close(client->fd);
                 }
 
                 r = 0;
diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c
index d330363..2cd0e1f 100644
--- a/src/libsystemd/sd-bus/bus-container.c
+++ b/src/libsystemd/sd-bus/bus-container.c
@@ -154,8 +154,7 @@ int bus_container_connect_kernel(sd_bus *b) {
         if (child == 0) {
                 pid_t grandchild;
 
-                close_nointr_nofail(pair[0]);
-                pair[0] = -1;
+                pair[0] = safe_close(pair[0]);
 
                 r = namespace_enter(pidnsfd, mntnsfd, rootfd);
                 if (r < 0)
@@ -202,8 +201,7 @@ int bus_container_connect_kernel(sd_bus *b) {
                 _exit(si.si_status);
         }
 
-        close_nointr_nofail(pair[1]);
-        pair[1] = -1;
+        pair[1] = safe_close(pair[1]);
 
         r = wait_for_terminate(child, &si);
         if (r < 0)
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 297ea2d..436d469 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -810,7 +810,7 @@ static void close_kdbus_msg(sd_bus *bus, struct kdbus_msg *k) {
                 if (d->type == KDBUS_ITEM_FDS)
                         close_many(d->fds, (d->size - offsetof(struct kdbus_item, fds)) / sizeof(int));
                 else if (d->type == KDBUS_ITEM_PAYLOAD_MEMFD)
-                        close_nointr_nofail(d->memfd.fd);
+                        safe_close(d->memfd.fd);
         }
 }
 
@@ -1164,7 +1164,7 @@ static void close_and_munmap(int fd, void *address, size_t size) {
         if (size > 0)
                 assert_se(munmap(address, PAGE_ALIGN(size)) >= 0);
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 }
 
 void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated) {
@@ -1312,14 +1312,14 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
         make->flags = KDBUS_MAKE_POLICY_OPEN | (world ? KDBUS_MAKE_ACCESS_WORLD : 0);
 
         if (ioctl(fd, KDBUS_CMD_BUS_MAKE, make) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         /* The higher 32bit of the flags field are considered
          * 'incompatible flags'. Refuse them all for now. */
         if (make->flags > 0xFFFFFFFFULL) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTSUP;
         }
 
@@ -1328,7 +1328,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
 
                 p = strjoin("/dev/kdbus/", n->str, "/bus", NULL);
                 if (!p) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -ENOMEM;
                 }
 
@@ -1368,7 +1368,7 @@ int bus_kernel_create_starter(const char *bus, const char *name) {
         hello->pool_size = KDBUS_POOL_SIZE;
 
         if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -1376,12 +1376,12 @@ int bus_kernel_create_starter(const char *bus, const char *name) {
          * 'incompatible flags'. Refuse them all for now. */
         if (hello->bus_flags > 0xFFFFFFFFULL ||
             hello->conn_flags > 0xFFFFFFFFULL) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTSUP;
         }
 
         if (!bloom_validate_parameters((size_t) hello->bloom.size, (unsigned) hello->bloom.n_hash)) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTSUP;
         }
 
@@ -1413,14 +1413,14 @@ int bus_kernel_create_domain(const char *name, char **s) {
         make->flags = KDBUS_MAKE_POLICY_OPEN | KDBUS_MAKE_ACCESS_WORLD;
 
         if (ioctl(fd, KDBUS_CMD_DOMAIN_MAKE, make) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         /* The higher 32bit of the flags field are considered
          * 'incompatible flags'. Refuse them all for now. */
         if (make->flags > 0xFFFFFFFFULL) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTSUP;
         }
 
@@ -1429,7 +1429,7 @@ int bus_kernel_create_domain(const char *name, char **s) {
 
                 p = strappend("/dev/kdbus/domain/", name);
                 if (!p) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -ENOMEM;
                 }
 
@@ -1459,7 +1459,7 @@ int bus_kernel_create_monitor(const char *bus) {
         hello->pool_size = KDBUS_POOL_SIZE;
 
         if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -1467,7 +1467,7 @@ int bus_kernel_create_monitor(const char *bus) {
          * 'incompatible flags'. Refuse them all for now. */
         if (hello->bus_flags > 0xFFFFFFFFULL ||
             hello->conn_flags > 0xFFFFFFFFULL) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTSUP;
         }
 
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index e32f2b8..4fcc693 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -70,7 +70,7 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) {
                         if (part->mapped > 0)
                                 assert_se(munmap(part->data, part->mapped) == 0);
 
-                        close_nointr_nofail(part->memfd);
+                        safe_close(part->memfd);
                 }
 
         } else if (part->munmap_this)
@@ -1274,7 +1274,7 @@ static int message_push_fd(sd_bus_message *m, int fd) {
         f = realloc(m->fds, sizeof(int) * (m->n_fds + 1));
         if (!f) {
                 m->poisoned = true;
-                close_nointr_nofail(copy);
+                safe_close(copy);
                 return -ENOMEM;
         }
 
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index 0c4b6af..8c594e7 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -750,7 +750,7 @@ int bus_socket_exec(sd_bus *b) {
                 assert_se(dup3(s[1], STDOUT_FILENO, 0) == STDOUT_FILENO);
 
                 if (s[1] != STDIN_FILENO && s[1] != STDOUT_FILENO)
-                        close_nointr_nofail(s[1]);
+                        safe_close(s[1]);
 
                 fd_cloexec(STDIN_FILENO, false);
                 fd_cloexec(STDOUT_FILENO, false);
@@ -767,7 +767,7 @@ int bus_socket_exec(sd_bus *b) {
                 _exit(EXIT_FAILURE);
         }
 
-        close_nointr_nofail(s[1]);
+        safe_close(s[1]);
         b->output_fd = b->input_fd = s[0];
 
         bus_socket_setup(b);
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 9640985..3946067 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -62,10 +62,10 @@ static void bus_close_fds(sd_bus *b) {
         detach_io_events(b);
 
         if (b->input_fd >= 0)
-                close_nointr_nofail(b->input_fd);
+                safe_close(b->input_fd);
 
         if (b->output_fd >= 0 && b->output_fd != b->input_fd)
-                close_nointr_nofail(b->output_fd);
+                safe_close(b->output_fd);
 
         b->input_fd = b->output_fd = -1;
 }
diff --git a/src/libsystemd/sd-bus/sd-memfd.c b/src/libsystemd/sd-bus/sd-memfd.c
index 7c71476..8183ba6 100644
--- a/src/libsystemd/sd-bus/sd-memfd.c
+++ b/src/libsystemd/sd-bus/sd-memfd.c
@@ -106,7 +106,7 @@ _public_ int sd_memfd_new(sd_memfd **m, const char *name) {
 
         n = new0(struct sd_memfd, 1);
         if (!n) {
-                close_nointr_nofail(cmd->fd);
+                safe_close(cmd->fd);
                 return -ENOMEM;
         }
 
@@ -143,7 +143,7 @@ _public_ void sd_memfd_free(sd_memfd *m) {
         if (m->f)
                 fclose(m->f);
         else
-                close_nointr_nofail(m->fd);
+                safe_close(m->fd);
 
         free(m);
 }
diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c
index 113d15b..1b9d98f 100644
--- a/src/libsystemd/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/sd-bus/test-bus-chat.c
@@ -232,7 +232,7 @@ static int server(sd_bus *bus) {
 
                         if (write(fd, &x, 1) < 0) {
                                 log_error("Failed to write to fd: %m");
-                                close_nointr_nofail(fd);
+                                safe_close(fd);
                                 goto fail;
                         }
 
diff --git a/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c b/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
index bfeee59..90257d4 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
@@ -270,7 +270,7 @@ int main(int argc, char *argv[]) {
                 CPU_SET(0, &cpuset);
                 pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
 
-                close_nointr_nofail(bus_ref);
+                safe_close(bus_ref);
                 sd_bus_unref(b);
 
                 switch (mode) {
diff --git a/src/libsystemd/sd-bus/test-bus-kernel.c b/src/libsystemd/sd-bus/test-bus-kernel.c
index 2f0f5aa..34d000f 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel.c
@@ -137,14 +137,12 @@ int main(int argc, char *argv[]) {
 
         assert_se(write(pipe_fds[1], "x", 1) == 1);
 
-        close_nointr_nofail(pipe_fds[1]);
-        pipe_fds[1] = -1;
+        pipe_fds[1] = safe_close(pipe_fds[1]);
 
         r = sd_bus_message_append(m, "h", pipe_fds[0]);
         assert_se(r >= 0);
 
-        close_nointr_nofail(pipe_fds[0]);
-        pipe_fds[0] = -1;
+        pipe_fds[0] = safe_close(pipe_fds[0]);
 
         r = sd_bus_send(b, m, NULL);
         assert_se(r >= 0);
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index fdf4d12..2794f56 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -331,20 +331,11 @@ static void event_free(sd_event *e) {
         if (e->default_event_ptr)
                 *(e->default_event_ptr) = NULL;
 
-        if (e->epoll_fd >= 0)
-                close_nointr_nofail(e->epoll_fd);
-
-        if (e->signal_fd >= 0)
-                close_nointr_nofail(e->signal_fd);
-
-        if (e->realtime_fd >= 0)
-                close_nointr_nofail(e->realtime_fd);
-
-        if (e->monotonic_fd >= 0)
-                close_nointr_nofail(e->monotonic_fd);
-
-        if (e->watchdog_fd >= 0)
-                close_nointr_nofail(e->watchdog_fd);
+        safe_close(e->epoll_fd);
+        safe_close(e->signal_fd);
+        safe_close(e->realtime_fd);
+        safe_close(e->monotonic_fd);
+        safe_close(e->watchdog_fd);
 
         prioq_free(e->pending);
         prioq_free(e->prepare);
@@ -691,7 +682,7 @@ static int event_setup_timer_fd(
 
         r = epoll_ctl(e->epoll_fd, EPOLL_CTL_ADD, fd, &ev);
         if (r < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -816,9 +807,7 @@ static int event_update_signal_fd(sd_event *e) {
 
         r = epoll_ctl(e->epoll_fd, EPOLL_CTL_ADD, e->signal_fd, &ev);
         if (r < 0) {
-                close_nointr_nofail(e->signal_fd);
-                e->signal_fd = -1;
-
+                e->signal_fd = safe_close(e->signal_fd);
                 return -errno;
         }
 
@@ -2288,8 +2277,7 @@ _public_ int sd_event_set_watchdog(sd_event *e, int b) {
         } else {
                 if (e->watchdog_fd >= 0) {
                         epoll_ctl(e->epoll_fd, EPOLL_CTL_DEL, e->watchdog_fd, NULL);
-                        close_nointr_nofail(e->watchdog_fd);
-                        e->watchdog_fd = -1;
+                        e->watchdog_fd = safe_close(e->watchdog_fd);
                 }
         }
 
@@ -2297,8 +2285,7 @@ _public_ int sd_event_set_watchdog(sd_event *e, int b) {
         return e->watchdog;
 
 fail:
-        close_nointr_nofail(e->watchdog_fd);
-        e->watchdog_fd = -1;
+        e->watchdog_fd = safe_close(e->watchdog_fd);
         return r;
 }
 
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index f05fe10..d810124 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -593,8 +593,7 @@ _public_ sd_resolve* sd_resolve_unref(sd_resolve *resolve) {
 
         /* Close all communication channels */
         for (i = 0; i < _FD_MAX; i++)
-                if (resolve->fds[i] >= 0)
-                        close_nointr_nofail(resolve->fds[i]);
+                safe_close(resolve->fds[i]);
 
         for (i = 0; i < QUERIES_MAX && resolve->n_queries > 0; i++)
                 if (resolve->queries[i])
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index 1b9f583..083552f 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -132,9 +132,7 @@ sd_rtnl *sd_rtnl_unref(sd_rtnl *rtnl) {
                         free(f);
                 }
 
-                if (rtnl->fd >= 0)
-                        close_nointr_nofail(rtnl->fd);
-
+                safe_close(rtnl->fd);
                 free(rtnl);
         }
 
diff --git a/src/login/logind-button.c b/src/login/logind-button.c
index 060978d..2561d13 100644
--- a/src/login/logind-button.c
+++ b/src/login/logind-button.c
@@ -72,7 +72,7 @@ void button_free(Button *b) {
         if (b->fd >= 0) {
                 /* If the device has been unplugged close() returns
                  * ENODEV, let's ignore this, hence we don't use
-                 * close_nointr_nofail() */
+                 * safe_close() */
                 close(b->fd);
         }
 
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index e4e593f..b2e6a41 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -457,7 +457,7 @@ static int vt_is_busy(unsigned int vtnr) {
         else
                 r = !!(vt_stat.v_state & (1 << vtnr));
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index d19d648..8b329ab 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -253,8 +253,7 @@ int inhibitor_load(Inhibitor *i) {
                 int fd;
 
                 fd = inhibitor_create_fifo(i);
-                if (fd >= 0)
-                        close_nointr_nofail(fd);
+                safe_close(fd);
         }
 
         return 0;
@@ -320,13 +319,8 @@ int inhibitor_create_fifo(Inhibitor *i) {
 void inhibitor_remove_fifo(Inhibitor *i) {
         assert(i);
 
-        if (i->event_source)
-                i->event_source = sd_event_source_unref(i->event_source);
-
-        if (i->fifo_fd >= 0) {
-                close_nointr_nofail(i->fifo_fd);
-                i->fifo_fd = -1;
-        }
+        i->event_source = sd_event_source_unref(i->event_source);
+        i->fifo_fd = safe_close(i->fifo_fd);
 
         if (i->fifo_path) {
                 unlink(i->fifo_path);
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 8f773d2..b14fadd 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -407,8 +407,7 @@ int session_load(Session *s) {
                    trigger the EOF. */
 
                 fd = session_create_fifo(s);
-                if (fd >= 0)
-                        close_nointr_nofail(fd);
+                safe_close(fd);
         }
 
         if (realtime) {
@@ -864,13 +863,8 @@ int session_create_fifo(Session *s) {
 static void session_remove_fifo(Session *s) {
         assert(s);
 
-        if (s->fifo_event_source)
-                s->fifo_event_source = sd_event_source_unref(s->fifo_event_source);
-
-        if (s->fifo_fd >= 0) {
-                close_nointr_nofail(s->fifo_fd);
-                s->fifo_fd = -1;
-        }
+        s->fifo_event_source = sd_event_source_unref(s->fifo_event_source);
+        s->fifo_fd = safe_close(s->fifo_fd);
 
         if (s->fifo_path) {
                 unlink(s->fifo_path);
@@ -950,7 +944,7 @@ static int session_open_vt(Session *s) {
         s->vtfd = open(path, O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY);
         if (s->vtfd < 0) {
                 log_error("cannot open VT %s of session %s: %m", path, s->id);
-                return -1;
+                return -errno;
         }
 
         return s->vtfd;
@@ -1026,6 +1020,7 @@ void session_restore_vt(Session *s) {
 
         if (read_one_line_file("/sys/module/vt/parameters/default_utf8", &utf8) >= 0 && *utf8 == '1')
                 kb = K_UNICODE;
+
         ioctl(vt, KDSKBMODE, kb);
 
         mode.mode = VT_AUTO;
@@ -1033,8 +1028,7 @@ void session_restore_vt(Session *s) {
 
         fchown(vt, 0, -1);
 
-        close_nointr_nofail(vt);
-        s->vtfd = -1;
+        s->vtfd = safe_close(s->vtfd);
 }
 
 bool session_is_controller(Session *s, const char *sender) {
diff --git a/src/login/logind.c b/src/login/logind.c
index 3a514bb..4319b0b 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -145,8 +145,7 @@ void manager_free(Manager *m) {
         sd_event_source_unref(m->udev_vcsa_event_source);
         sd_event_source_unref(m->udev_button_event_source);
 
-        if (m->console_active_fd >= 0)
-                close_nointr_nofail(m->console_active_fd);
+        safe_close(m->console_active_fd);
 
         if (m->udev_seat_monitor)
                 udev_monitor_unref(m->udev_seat_monitor);
@@ -165,8 +164,7 @@ void manager_free(Manager *m) {
         sd_bus_unref(m->bus);
         sd_event_unref(m->event);
 
-        if (m->reserve_vt_fd >= 0)
-                close_nointr_nofail(m->reserve_vt_fd);
+        safe_close(m->reserve_vt_fd);
 
         strv_free(m->kill_only_users);
         strv_free(m->kill_exclude_users);
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 3958db0..1259457 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -484,7 +484,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
                 r = pam_set_data(handle, "systemd.session-fd", INT_TO_PTR(session_fd+1), NULL);
                 if (r != PAM_SUCCESS) {
                         pam_syslog(handle, LOG_ERR, "Failed to install session fd.");
-                        close_nointr_nofail(session_fd);
+                        safe_close(session_fd);
                         return r;
                 }
         }
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index ef67040..0b430a5 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -679,7 +679,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "seat")) {
                 k = inotify_add_watch(fd, "/run/systemd/seats/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -errno;
                 }
 
@@ -689,7 +689,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "session")) {
                 k = inotify_add_watch(fd, "/run/systemd/sessions/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -errno;
                 }
 
@@ -699,7 +699,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "uid")) {
                 k = inotify_add_watch(fd, "/run/systemd/users/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -errno;
                 }
 
@@ -709,7 +709,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "machine")) {
                 k = inotify_add_watch(fd, "/run/systemd/machines/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -errno;
                 }
 
diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c
index 70b8314..70780c3 100644
--- a/src/login/test-inhibit.c
+++ b/src/login/test-inhibit.c
@@ -101,11 +101,11 @@ int main(int argc, char*argv[]) {
         assert(fd2 >= 0);
         print_inhibitors(bus);
 
-        close_nointr_nofail(fd1);
+        safe_close(fd1);
         sleep(1);
         print_inhibitors(bus);
 
-        close_nointr_nofail(fd2);
+        safe_close(fd2);
         sleep(1);
         print_inhibitors(bus);
 
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 32f862d..dd13bcf 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -488,8 +488,7 @@ static int openpt_in_namespace(pid_t pid, int flags) {
                 return -errno;
 
         if (child == 0) {
-                close_nointr_nofail(pair[0]);
-                pair[0] = -1;
+                pair[0] = safe_close(pair[0]);
 
                 r = namespace_enter(pidnsfd, mntnsfd, rootfd);
                 if (r < 0)
@@ -513,8 +512,7 @@ static int openpt_in_namespace(pid_t pid, int flags) {
                 _exit(EXIT_SUCCESS);
         }
 
-        close_nointr_nofail(pair[1]);
-        pair[1] = -1;
+        pair[1] = safe_close(pair[1]);
 
         r = wait_for_terminate(child, &si);
         if (r < 0 || si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS) {
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 091307b..056daf2 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -958,7 +958,7 @@ static int setup_kmsg(const char *dest, int kmsg_socket) {
         /* Store away the fd in the socket, so that it stays open as
          * long as we run the child */
         k = sendmsg(kmsg_socket, &mh, MSG_DONTWAIT|MSG_NOSIGNAL);
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         if (k < 0) {
                 log_error("Failed to send FIFO fd: %m");
@@ -1838,15 +1838,13 @@ int main(int argc, char *argv[]) {
                         if (envp[n_env])
                                 n_env ++;
 
-                        close_nointr_nofail(master);
-                        master = -1;
+                        master = safe_close(master);
 
                         close_nointr(STDIN_FILENO);
                         close_nointr(STDOUT_FILENO);
                         close_nointr(STDERR_FILENO);
 
-                        close_nointr_nofail(kmsg_socket_pair[0]);
-                        kmsg_socket_pair[0] = -1;
+                        kmsg_socket_pair[0] = safe_close(kmsg_socket_pair[0]);
 
                         reset_all_signal_handlers();
 
@@ -1856,7 +1854,7 @@ int main(int argc, char *argv[]) {
                         k = open_terminal(console, O_RDWR);
                         if (k != STDIN_FILENO) {
                                 if (k >= 0) {
-                                        close_nointr_nofail(k);
+                                        safe_close(k);
                                         k = -EINVAL;
                                 }
 
@@ -1923,8 +1921,7 @@ int main(int argc, char *argv[]) {
                         if (setup_kmsg(arg_directory, kmsg_socket_pair[1]) < 0)
                                 goto child_fail;
 
-                        close_nointr_nofail(kmsg_socket_pair[1]);
-                        kmsg_socket_pair[1] = -1;
+                        kmsg_socket_pair[1] = safe_close(kmsg_socket_pair[1]);
 
                         if (setup_boot_id(arg_directory) < 0)
                                 goto child_fail;
@@ -2071,8 +2068,7 @@ int main(int argc, char *argv[]) {
                         }
 
                         eventfd_read(sync_fd, &x);
-                        close_nointr_nofail(sync_fd);
-                        sync_fd = -1;
+                        sync_fd = safe_close(sync_fd);
 
                         if (!strv_isempty(arg_setenv)) {
                                 char **n;
@@ -2144,8 +2140,7 @@ int main(int argc, char *argv[]) {
                         goto finish;
 
                 eventfd_write(sync_fd, 1);
-                close_nointr_nofail(sync_fd);
-                sync_fd = -1;
+                sync_fd = safe_close(sync_fd);
 
                 k = process_pty(master, &mask, arg_boot ? pid : 0, SIGRTMIN+3);
                 if (k < 0) {
diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c
index be92006..c1afd0d 100644
--- a/src/readahead/readahead-collect.c
+++ b/src/readahead/readahead-collect.c
@@ -176,8 +176,7 @@ finish:
         if (start != MAP_FAILED)
                 munmap(start, l);
 
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -493,16 +492,12 @@ static int collect(const char *root) {
                                 log_warning("readlink(%s) failed: %s", fn, strerror(-k));
 
                 next_iteration:
-                        if (m->fd >= 0)
-                                close_nointr_nofail(m->fd);
+                        safe_close(m->fd);
                 }
         }
 
 done:
-        if (fanotify_fd >= 0) {
-                close_nointr_nofail(fanotify_fd);
-                fanotify_fd = -1;
-        }
+        fanotify_fd = safe_close(fanotify_fd);
 
         log_debug("Writing Pack File...");
 
@@ -592,14 +587,9 @@ done:
         log_debug("Done.");
 
 finish:
-        if (fanotify_fd >= 0)
-                close_nointr_nofail(fanotify_fd);
-
-        if (signal_fd >= 0)
-                close_nointr_nofail(signal_fd);
-
-        if (inotify_fd >= 0)
-                close_nointr_nofail(inotify_fd);
+        safe_close(fanotify_fd);
+        safe_close(signal_fd);
+        safe_close(inotify_fd);
 
         if (pack) {
                 fclose(pack);
diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c
index 1edf9cc..49679fc 100644
--- a/src/readahead/readahead-common.c
+++ b/src/readahead/readahead-common.c
@@ -218,7 +218,7 @@ int open_inotify(void) {
 
         if (inotify_add_watch(fd, "/run/systemd/readahead", IN_CREATE) < 0) {
                 log_error("Failed to watch /run/systemd/readahead: %m");
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
diff --git a/src/readahead/readahead-replay.c b/src/readahead/readahead-replay.c
index cb04e5f..8dc1942 100644
--- a/src/readahead/readahead-replay.c
+++ b/src/readahead/readahead-replay.c
@@ -67,10 +67,8 @@ static int unpack_file(FILE *pack) {
                 if (errno != ENOENT && errno != EPERM && errno != EACCES && errno != ELOOP)
                         log_warning("open(%s) failed: %m", fn);
 
-        } else if (file_verify(fd, fn, arg_file_size_max, &st) <= 0) {
-                close_nointr_nofail(fd);
-                fd = -1;
-        }
+        } else if (file_verify(fd, fn, arg_file_size_max, &st) <= 0)
+                fd = safe_close(fd);
 
         if (fread(&inode, sizeof(inode), 1, pack) != 1) {
                 log_error("Premature end of pack file.");
@@ -81,10 +79,8 @@ static int unpack_file(FILE *pack) {
         if (fd >= 0) {
                 /* If the inode changed the file got deleted, so just
                  * ignore this entry */
-                if (st.st_ino != (uint64_t) inode) {
-                        close_nointr_nofail(fd);
-                        fd = -1;
-                }
+                if (st.st_ino != (uint64_t) inode)
+                        fd = safe_close(fd);
         }
 
         for (;;) {
@@ -129,8 +125,7 @@ static int unpack_file(FILE *pack) {
         }
 
 finish:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -279,8 +274,7 @@ finish:
         if (pack)
                 fclose(pack);
 
-        if (inotify_fd >= 0)
-                close_nointr_nofail(inotify_fd);
+        safe_close(inotify_fd);
 
         free(pack_fn);
 
diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c
index 2f16898..c730216 100644
--- a/src/reply-password/reply-password.c
+++ b/src/reply-password/reply-password.c
@@ -91,7 +91,8 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0)) < 0) {
+        fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
+        if (fd < 0) {
                 log_error("socket() failed: %m");
                 goto finish;
         }
@@ -102,8 +103,7 @@ int main(int argc, char *argv[]) {
         r = EXIT_SUCCESS;
 
 finish:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index 2505aa9..96f16cc 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -231,8 +231,7 @@ int ask_password_tty(
         r = 0;
 
 finish:
-        if (notify >= 0)
-                close_nointr_nofail(notify);
+        safe_close(notify);
 
         if (ttyfd >= 0) {
 
@@ -241,7 +240,7 @@ finish:
                         tcsetattr(ttyfd, TCSADRAIN, &old_termios);
                 }
 
-                close_nointr_nofail(ttyfd);
+                safe_close(ttyfd);
         }
 
         return r;
@@ -295,7 +294,7 @@ static int create_socket(char **name) {
         return fd;
 
 fail:
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -526,19 +525,15 @@ int ask_password_agent(
         r = 0;
 
 finish:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         if (socket_name) {
                 unlink(socket_name);
                 free(socket_name);
         }
 
-        if (socket_fd >= 0)
-                close_nointr_nofail(socket_fd);
-
-        if (signal_fd >= 0)
-                close_nointr_nofail(signal_fd);
+        safe_close(socket_fd);
+        safe_close(signal_fd);
 
         if (f)
                 fclose(f);
diff --git a/src/shared/fdset.c b/src/shared/fdset.c
index fd27398..a2c861d 100644
--- a/src/shared/fdset.c
+++ b/src/shared/fdset.c
@@ -82,7 +82,7 @@ int fdset_put_dup(FDSet *s, int fd) {
 
         r = fdset_put(s, copy);
         if (r < 0) {
-                close_nointr_nofail(copy);
+                safe_close(copy);
                 return r;
         }
 
diff --git a/src/shared/install.c b/src/shared/install.c
index 94ca732..71392f3 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -207,7 +207,7 @@ static int remove_marked_symlinks_fd(
 
         d = fdopendir(fd);
         if (!d) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -247,7 +247,7 @@ static int remove_marked_symlinks_fd(
 
                         p = path_make_absolute(de->d_name, path);
                         if (!p) {
-                                close_nointr_nofail(nfd);
+                                safe_close(nfd);
                                 return -ENOMEM;
                         }
 
@@ -347,7 +347,7 @@ static int remove_marked_symlinks(
                         r = q;
         } while (deleted);
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }
@@ -370,7 +370,7 @@ static int find_symlinks_fd(
 
         d = fdopendir(fd);
         if (!d) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -406,7 +406,7 @@ static int find_symlinks_fd(
 
                         p = path_make_absolute(de->d_name, path);
                         if (!p) {
-                                close_nointr_nofail(nfd);
+                                safe_close(nfd);
                                 return -ENOMEM;
                         }
 
@@ -1013,7 +1013,7 @@ static int unit_file_load(
 
         f = fdopen(fd, "re");
         if (!f) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOMEM;
         }
 
diff --git a/src/shared/log.c b/src/shared/log.c
index 8d1067c..f4d7a0e 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -62,7 +62,7 @@ void log_close_console(void) {
 
         if (getpid() == 1) {
                 if (console_fd >= 3)
-                        close_nointr_nofail(console_fd);
+                        safe_close(console_fd);
 
                 console_fd = -1;
         }
@@ -84,12 +84,7 @@ static int log_open_console(void) {
 }
 
 void log_close_kmsg(void) {
-
-        if (kmsg_fd < 0)
-                return;
-
-        close_nointr_nofail(kmsg_fd);
-        kmsg_fd = -1;
+        kmsg_fd = safe_close(kmsg_fd);
 }
 
 static int log_open_kmsg(void) {
@@ -105,12 +100,7 @@ static int log_open_kmsg(void) {
 }
 
 void log_close_syslog(void) {
-
-        if (syslog_fd < 0)
-                return;
-
-        close_nointr_nofail(syslog_fd);
-        syslog_fd = -1;
+        syslog_fd = safe_close(syslog_fd);
 }
 
 static int create_log_socket(int type) {
@@ -152,7 +142,7 @@ static int log_open_syslog(void) {
         }
 
         if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) {
-                close_nointr_nofail(syslog_fd);
+                safe_close(syslog_fd);
 
                 /* Some legacy syslog systems still use stream
                  * sockets. They really shouldn't. But what can we
@@ -180,12 +170,7 @@ fail:
 }
 
 void log_close_journal(void) {
-
-        if (journal_fd < 0)
-                return;
-
-        close_nointr_nofail(journal_fd);
-        journal_fd = -1;
+        journal_fd = safe_close(journal_fd);
 }
 
 static int log_open_journal(void) {
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index f9fa978..9f4771b 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -1154,8 +1154,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
         if (child == 0) {
                 int fd;
 
-                close_nointr_nofail(pair[0]);
-                pair[0] = -1;
+                pair[0] = safe_close(pair[0]);
 
                 r = namespace_enter(pidnsfd, mntnsfd, rootfd);
                 if (r < 0)
@@ -1166,7 +1165,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
                         _exit(EXIT_FAILURE);
 
                 k = loop_read(fd, buf, 36, false);
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 if (k != 36)
                         _exit(EXIT_FAILURE);
 
@@ -1177,8 +1176,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
                 _exit(EXIT_SUCCESS);
         }
 
-        close_nointr_nofail(pair[1]);
-        pair[1] = -1;
+        pair[1] = safe_close(pair[1]);
 
         r = wait_for_terminate(child, &si);
         if (r < 0 || si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS)
diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c
index f9e52cd..fccf1e9 100644
--- a/src/shared/spawn-polkit-agent.c
+++ b/src/shared/spawn-polkit-agent.c
@@ -61,7 +61,7 @@ int polkit_agent_open(void) {
                        POLKIT_AGENT_BINARY_PATH, "--notify-fd", notify_fd, "--fallback", NULL);
 
         /* Close the writing side, because that's the one for the agent */
-        close_nointr_nofail(pipe_fd[1]);
+        safe_close(pipe_fd[1]);
 
         if (r < 0)
                 log_error("Failed to fork TTY ask password agent: %s", strerror(-r));
@@ -69,7 +69,7 @@ int polkit_agent_open(void) {
                 /* Wait until the agent closes the fd */
                 fd_wait_for_event(pipe_fd[0], POLLHUP, (usec_t) -1);
 
-        close_nointr_nofail(pipe_fd[0]);
+        safe_close(pipe_fd[0]);
 
         return r;
 }
diff --git a/src/shared/util.c b/src/shared/util.c
index a136355..c2191e2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -182,13 +182,22 @@ int close_nointr(int fd) {
                 return -errno;
 }
 
-void close_nointr_nofail(int fd) {
-        PROTECT_ERRNO;
+int safe_close(int fd) {
+
+        /*
+         * Like close_nointr() but cannot fail. Guarantees errno is
+         * unchanged. Is a NOP with negative fds passed, and returns
+         * -1, so that it can be used in this syntax:
+         *
+         * fd = safe_close(fd);
+         */
 
-        /* like close_nointr() but cannot fail, and guarantees errno
-         * is unchanged */
+        if (fd >= 0) {
+                PROTECT_ERRNO;
+                assert_se(close_nointr(fd) == 0);
+        }
 
-        assert_se(close_nointr(fd) == 0);
+        return -1;
 }
 
 void close_many(const int fds[], unsigned n_fd) {
@@ -197,7 +206,7 @@ void close_many(const int fds[], unsigned n_fd) {
         assert(fds || n_fd <= 0);
 
         for (i = 0; i < n_fd; i++)
-                close_nointr_nofail(fds[i]);
+                safe_close(fds[i]);
 }
 
 int unlink_noerrno(const char *path) {
@@ -1712,16 +1721,13 @@ finish:
 }
 
 int reset_terminal(const char *name) {
-        int fd, r;
+        _cleanup_close_ int fd = -1;
 
         fd = open_terminal(name, O_RDWR|O_NOCTTY|O_CLOEXEC);
         if (fd < 0)
                 return fd;
 
-        r = reset_terminal_fd(fd, true);
-        close_nointr_nofail(fd);
-
-        return r;
+        return reset_terminal_fd(fd, true);
 }
 
 int open_terminal(const char *name, int mode) {
@@ -1760,12 +1766,12 @@ int open_terminal(const char *name, int mode) {
 
         r = isatty(fd);
         if (r < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
         if (!r) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -ENOTTY;
         }
 
@@ -1954,11 +1960,10 @@ int acquire_terminal(
                  * ended our handle will be dead. It's important that
                  * we do this after sleeping, so that we don't enter
                  * an endless loop. */
-                close_nointr_nofail(fd);
+                safe_close(fd);
         }
 
-        if (notify >= 0)
-                close_nointr_nofail(notify);
+        safe_close(notify);
 
         r = reset_terminal_fd(fd, true);
         if (r < 0)
@@ -1967,11 +1972,8 @@ int acquire_terminal(
         return fd;
 
 fail:
-        if (fd >= 0)
-                close_nointr_nofail(fd);
-
-        if (notify >= 0)
-                close_nointr_nofail(notify);
+        safe_close(fd);
+        safe_close(notify);
 
         return r;
 }
@@ -2279,7 +2281,7 @@ int make_stdio(int fd) {
         t = dup3(fd, STDERR_FILENO, 0);
 
         if (fd >= 3)
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
         if (r < 0 || s < 0 || t < 0)
                 return -errno;
@@ -2657,7 +2659,7 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct
 
         d = fdopendir(fd);
         if (!d) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
                 return errno == ENOENT ? 0 : -errno;
         }
@@ -2753,7 +2755,7 @@ int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root
         assert(fd >= 0);
 
         if (fstatfs(fd, &s) < 0) {
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -errno;
         }
 
@@ -2762,7 +2764,7 @@ int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root
          * non-state data */
         if (!is_temporary_fs(&s)) {
                 log_error("Attempted to remove disk file system, and we can't allow that.");
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return -EPERM;
         }
 
@@ -2808,13 +2810,13 @@ static int rm_rf_internal(const char *path, bool only_dirs, bool delete_root, bo
 
         if (!dangerous) {
                 if (fstatfs(fd, &s) < 0) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -errno;
                 }
 
                 if (!is_temporary_fs(&s)) {
                         log_error("Attempted to remove disk file system, and we can't allow that.");
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return -EPERM;
                 }
         }
@@ -3327,7 +3329,7 @@ char *ellipsize(const char *s, size_t length, unsigned percent) {
 }
 
 int touch(const char *path) {
-        int fd;
+        _cleanup_close_ int fd;
 
         assert(path);
 
@@ -3339,7 +3341,6 @@ int touch(const char *path) {
         if (fd < 0)
                 return -errno;
 
-        close_nointr_nofail(fd);
         return 0;
 }
 
@@ -3502,7 +3503,7 @@ DIR *xopendirat(int fd, const char *name, int flags) {
 
         d = fdopendir(nfd);
         if (!d) {
-                close_nointr_nofail(nfd);
+                safe_close(nfd);
                 return NULL;
         }
 
@@ -4000,16 +4001,13 @@ int terminal_vhangup_fd(int fd) {
 }
 
 int terminal_vhangup(const char *name) {
-        int fd, r;
+        _cleanup_close_ int fd;
 
         fd = open_terminal(name, O_RDWR|O_NOCTTY|O_CLOEXEC);
         if (fd < 0)
                 return fd;
 
-        r = terminal_vhangup_fd(fd);
-        close_nointr_nofail(fd);
-
-        return r;
+        return terminal_vhangup_fd(fd);
 }
 
 int vt_disallocate(const char *name) {
@@ -4036,7 +4034,7 @@ int vt_disallocate(const char *name) {
                            "\033[H"    /* move home */
                            "\033[2J",  /* clear screen */
                            10, false);
-                close_nointr_nofail(fd);
+                safe_close(fd);
 
                 return 0;
         }
@@ -4057,7 +4055,7 @@ int vt_disallocate(const char *name) {
                 return fd;
 
         r = ioctl(fd, VT_DISALLOCATE, u);
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         if (r >= 0)
                 return 0;
@@ -4076,7 +4074,7 @@ int vt_disallocate(const char *name) {
                    "\033[H"   /* move home */
                    "\033[3J", /* clear screen including scrollback, requires Linux 2.6.40 */
                    10, false);
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         return 0;
 }
@@ -5653,7 +5651,7 @@ int on_ac_power(void) {
                 if (n != 6 || memcmp(contents, "Mains\n", 6))
                         continue;
 
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 fd = openat(device, "online", O_RDONLY|O_CLOEXEC|O_NOCTTY);
                 if (fd < 0) {
                         if (errno == ENOENT)
diff --git a/src/shared/util.h b/src/shared/util.h
index 8dff0bc..38d6494 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -142,7 +142,8 @@ char *endswith(const char *s, const char *postfix) _pure_;
 bool first_word(const char *s, const char *word) _pure_;
 
 int close_nointr(int fd);
-void close_nointr_nofail(int fd);
+int safe_close(int fd);
+
 void close_many(const int fds[], unsigned n_fd);
 
 int parse_size(const char *t, off_t base, off_t *size);
@@ -607,8 +608,7 @@ static inline void freep(void *p) {
         struct __useless_struct_to_allow_trailing_semicolon__
 
 static inline void closep(int *fd) {
-        if (*fd >= 0)
-                close_nointr_nofail(*fd);
+        safe_close(*fd);
 }
 
 static inline void umaskp(mode_t *u) {
diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c
index ddbe7af..ba9ad9b 100644
--- a/src/shared/watchdog.c
+++ b/src/shared/watchdog.c
@@ -164,6 +164,5 @@ void watchdog_close(bool disarm) {
                 }
         }
 
-        close_nointr_nofail(watchdog_fd);
-        watchdog_fd = -1;
+        watchdog_fd = safe_close(watchdog_fd);
 }
diff --git a/src/shutdownd/shutdownd.c b/src/shutdownd/shutdownd.c
index 4a17198..0c746d1 100644
--- a/src/shutdownd/shutdownd.c
+++ b/src/shutdownd/shutdownd.c
@@ -438,8 +438,7 @@ int main(int argc, char *argv[]) {
 finish:
 
         for (i = 0; i < _FD_MAX; i++)
-                if (pollfd[i].fd >= 0)
-                        close_nointr_nofail(pollfd[i].fd);
+                safe_close(pollfd[i].fd);
 
         if (unlink_nologin)
                 unlink("/run/nologin");
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index a42e5ae..c172beb 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -76,10 +76,8 @@ static void connection_free(Connection *c) {
         sd_event_source_unref(c->server_event_source);
         sd_event_source_unref(c->client_event_source);
 
-        if (c->server_fd >= 0)
-                close_nointr_nofail(c->server_fd);
-        if (c->client_fd >= 0)
-                close_nointr_nofail(c->client_fd);
+        safe_close(c->server_fd);
+        safe_close(c->client_fd);
 
         close_pipe(c->server_to_client_buffer);
         close_pipe(c->client_to_server_buffer);
@@ -224,8 +222,7 @@ static int connection_shovel(
                                 shoveled = true;
                         } else if (z == 0 || errno == EPIPE || errno == ECONNRESET) {
                                 *from_source = sd_event_source_unref(*from_source);
-                                close_nointr_nofail(*from);
-                                *from = -1;
+                                *from = safe_close(*from);
                         } else if (errno != EAGAIN && errno != EINTR) {
                                 log_error("Failed to splice: %m");
                                 return -errno;
@@ -239,8 +236,7 @@ static int connection_shovel(
                                 shoveled = true;
                         } else if (z == 0 || errno == EPIPE || errno == ECONNRESET) {
                                 *to_source = sd_event_source_unref(*to_source);
-                                close_nointr_nofail(*to);
-                                *to = -1;
+                                *to = safe_close(*to);
                         } else if (errno != EAGAIN && errno != EINTR) {
                                 log_error("Failed to splice: %m");
                                 return -errno;
@@ -396,7 +392,7 @@ static int add_connection_socket(Context *context, sd_event *event, int fd) {
 
         if (set_size(context->connections) > CONNECTIONS_MAX) {
                 log_warning("Hit connection limit, refusing connection.");
-                close_nointr_nofail(fd);
+                safe_close(fd);
                 return 0;
         }
 
@@ -482,7 +478,7 @@ static int accept_cb(sd_event_source *s, int fd, uint32_t revents, void *userdat
                 r = add_connection_socket(context, sd_event_source_get_event(s), nfd);
                 if (r < 0) {
                         log_error("Failed to accept connection, ignoring: %s", strerror(-r));
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                 }
         }
 
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 74f83a2..3f6af67 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -67,7 +67,7 @@ static void test_close_many(void) {
         assert_se(fcntl(fds[1], F_GETFD) == -1);
         assert_se(fcntl(fds[2], F_GETFD) >= 0);
 
-        close_nointr_nofail(fds[2]);
+        safe_close(fds[2]);
 
         unlink(name0);
         unlink(name1);
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 8211ff4..2a48180 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -492,7 +492,7 @@ static int write_one_file(Item *i, const char *path) {
 
                 unescaped = cunescape(i->argument);
                 if (unescaped == NULL) {
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return log_oom();
                 }
 
@@ -501,12 +501,12 @@ static int write_one_file(Item *i, const char *path) {
 
                 if (n < 0 || (size_t) n < l) {
                         log_error("Failed to write file %s: %s", path, n < 0 ? strerror(-n) : "Short write");
-                        close_nointr_nofail(fd);
+                        safe_close(fd);
                         return n < 0 ? n : -EIO;
                 }
         }
 
-        close_nointr_nofail(fd);
+        safe_close(fd);
 
         if (stat(path, &st) < 0) {
                 log_error("stat(%s) failed: %m", path);
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 5acb417..a144bdc 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -234,11 +234,8 @@ static int ask_password_plymouth(
         r = 0;
 
 finish:
-        if (notify >= 0)
-                close_nointr_nofail(notify);
-
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(notify);
+        safe_close(fd);
 
         free(packet);
 
@@ -372,7 +369,7 @@ static int parse_password(const char *filename, char **wall) {
                         r = ask_password_tty(message, not_after, filename, &password);
 
                         if (arg_console) {
-                                close_nointr_nofail(tty_fd);
+                                safe_close(tty_fd);
                                 release_terminal();
                         }
 
@@ -419,8 +416,7 @@ static int parse_password(const char *filename, char **wall) {
 finish:
         fclose(f);
 
-        if (socket_fd >= 0)
-                close_nointr_nofail(socket_fd);
+        safe_close(socket_fd);
 
         free(packet);
         free(socket_name);
@@ -492,7 +488,7 @@ static bool wall_tty_match(const char *path) {
                 return true;
 
         /* What, we managed to open the pipe? Then this tty is filtered. */
-        close_nointr_nofail(fd);
+        safe_close(fd);
         return false;
 }
 
@@ -614,14 +610,9 @@ static int watch_passwords(void) {
         r = 0;
 
 finish:
-        if (notify >= 0)
-                close_nointr_nofail(notify);
-
-        if (signal_fd >= 0)
-                close_nointr_nofail(signal_fd);
-
-        if (tty_block_fd >= 0)
-                close_nointr_nofail(tty_block_fd);
+        safe_close(notify);
+        safe_close(signal_fd);
+        safe_close(tty_block_fd);
 
         return r;
 }
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 05225e0..133926f 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -127,8 +127,7 @@ void link_config_ctx_free(link_config_ctx *ctx) {
         if (!ctx)
                 return;
 
-        if (ctx->ethtool_fd >= 0)
-                close_nointr_nofail(ctx->ethtool_fd);
+        safe_close(ctx->ethtool_fd);
 
         sd_rtnl_unref(ctx->rtnl);
 
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 1bbf737..0f2b706 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -301,8 +301,7 @@ finish:
         free(vc_font_map);
         free(vc_font_unimap);
 
-        if (fd >= 0)
-                close_nointr_nofail(fd);
+        safe_close(fd);
 
         return r;
 }

commit c90de781c83e8543366102b9268a07f4fc7432c5
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Apr 17 22:12:25 2014 -0400

    Make sure that keys are properly removed from hashmap
    
    This is a speculative fix for https://bugzilla.redhat.com/show_bug.cgi?id=1088865.
    Even though I cannot find a code path that where this would be
    an issue, for consistency, if we assume that cgroup_path might have
    been set before we got to unit_deserialize, we should make sure that
    the unit is removed from the hashmap before we free the key. This seems
    to be the only place where the key could be prematurely freed, leading to
    hashmap corruption.
    
    (cherry picked from commit 4e595329a93ed190795c2e24bf132d5028ec6a72)

diff --git a/src/core/unit.c b/src/core/unit.c
index 5e6e2ca..f3a6def 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2431,10 +2431,18 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
                         if (!s)
                                 return -ENOMEM;
 
-                        free(u->cgroup_path);
-                        u->cgroup_path = s;
+                        if (u->cgroup_path) {
+                                void *p;
+
+                                p = hashmap_remove(u->manager->cgroup_unit, u->cgroup_path);
+                                log_info("Removing cgroup_path %s from hashmap (%p)",
+                                         u->cgroup_path, p);
+                                free(u->cgroup_path);
+                        }
 
+                        u->cgroup_path = s;
                         assert(hashmap_put(u->manager->cgroup_unit, s, u) == 1);
+
                         continue;
                 }
 

commit fd516dfa0612d2a169158bbed6f8994f47f3e6ce
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Apr 24 01:44:10 2014 -0400

    Make systemctl --root look for files in the proper places
    
    Running systemctl enable/disable/set-default/... with the --root
    option under strace reveals that it accessed various files and
    directories in the main fs, and not underneath the specified root.
    This can lead to correct results only when the layout and
    configuration in the container are identical, which often is not the
    case. Fix this by adding the specified root to all file access
    operations.
    
    This patch does not handle some corner cases: symlinks which point
    outside of the specified root might be interpreted differently than
    they would be by the kernel if the specified root was the real root.
    But systemctl does not create such symlinks by itself, and I think
    this is enough of a corner case not to be worth the additional
    complexity of reimplementing link chasing in systemd.
    
    Also, simplify the code in a few places and remove an hypothetical
    memory leak on error.
    
    (cherry picked from commit 12ed81d9c88406234c20e9261ae8c8b992d8bc4d)
    
    Conflicts:
    	TODO

diff --git a/src/core/manager.c b/src/core/manager.c
index fed0a45..5689e60 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -952,6 +952,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
 
         r = lookup_paths_init(
                         &m->lookup_paths, m->running_as, true,
+                        NULL,
                         m->generator_unit_path,
                         m->generator_unit_path_early,
                         m->generator_unit_path_late);
@@ -2364,6 +2365,7 @@ int manager_reload(Manager *m) {
 
         q = lookup_paths_init(
                         &m->lookup_paths, m->running_as, true,
+                        NULL,
                         m->generator_unit_path,
                         m->generator_unit_path_early,
                         m->generator_unit_path_late);
diff --git a/src/shared/install.c b/src/shared/install.c
index 5f6f280..94ca732 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -47,7 +47,9 @@ typedef struct {
 
 #define _cleanup_install_context_done_ _cleanup_(install_context_done)
 
-static int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope) {
+static int lookup_paths_init_from_scope(LookupPaths *paths,
+                                        UnitFileScope scope,
+                                        const char *root_dir) {
         assert(paths);
         assert(scope >= 0);
         assert(scope < _UNIT_FILE_SCOPE_MAX);
@@ -57,6 +59,7 @@ static int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope)
         return lookup_paths_init(paths,
                                  scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
                                  scope == UNIT_FILE_USER,
+                                 root_dir,
                                  NULL, NULL, NULL);
 }
 
@@ -703,7 +706,7 @@ int unit_file_link(
         assert(scope >= 0);
         assert(scope < _UNIT_FILE_SCOPE_MAX);
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1475,7 +1478,7 @@ int unit_file_enable(
         assert(scope >= 0);
         assert(scope < _UNIT_FILE_SCOPE_MAX);
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1515,7 +1518,7 @@ int unit_file_disable(
         assert(scope >= 0);
         assert(scope < _UNIT_FILE_SCOPE_MAX);
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1579,7 +1582,7 @@ int unit_file_set_default(
         if (unit_name_to_type(file) != UNIT_TARGET)
                 return -EINVAL;
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1619,7 +1622,7 @@ int unit_file_get_default(
         assert(scope < _UNIT_FILE_SCOPE_MAX);
         assert(name);
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1677,12 +1680,13 @@ UnitFileState unit_file_get_state(
         if (!unit_name_is_valid(name, TEMPLATE_VALID))
                 return -EINVAL;
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
         STRV_FOREACH(i, paths.unit_path) {
                 struct stat st;
+                char *partial;
 
                 free(path);
                 path = NULL;
@@ -1691,10 +1695,14 @@ UnitFileState unit_file_get_state(
                         asprintf(&path, "%s/%s/%s", root_dir, *i, name);
                 else
                         asprintf(&path, "%s/%s", *i, name);
-
                 if (!path)
                         return -ENOMEM;
 
+                if (root_dir)
+                        partial = path + strlen(root_dir) + 1;
+                else
+                        partial = path;
+
                 /*
                  * Search for a unit file in our default paths, to
                  * be sure, that there are no broken symlinks.
@@ -1726,7 +1734,7 @@ UnitFileState unit_file_get_state(
                 else if (r > 0)
                         return state;
 
-                r = unit_file_can_install(&paths, root_dir, path, true);
+                r = unit_file_can_install(&paths, root_dir, partial, true);
                 if (r < 0 && errno != ENOENT)
                         return r;
                 else if (r > 0)
@@ -1834,7 +1842,7 @@ int unit_file_preset(
         assert(scope >= 0);
         assert(scope < _UNIT_FILE_SCOPE_MAX);
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
@@ -1904,7 +1912,7 @@ int unit_file_get_list(
         if (root_dir && scope != UNIT_FILE_SYSTEM)
                 return -EINVAL;
 
-        r = lookup_paths_init_from_scope(&paths, scope);
+        r = lookup_paths_init_from_scope(&paths, scope, root_dir);
         if (r < 0)
                 return r;
 
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 63af43c..c6b4ba1 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -198,6 +198,7 @@ int lookup_paths_init(
                 LookupPaths *p,
                 SystemdRunningAs running_as,
                 bool personal,
+                const char *root_dir,
                 const char *generator,
                 const char *generator_early,
                 const char *generator_late) {
@@ -275,11 +276,9 @@ int lookup_paths_init(
                 }
         }
 
-        if (!path_strv_canonicalize_absolute(p->unit_path, NULL))
+        if (!path_strv_canonicalize_absolute_uniq(p->unit_path, root_dir))
                 return -ENOMEM;
 
-        strv_uniq(p->unit_path);
-
         if (!strv_isempty(p->unit_path)) {
                 _cleanup_free_ char *t = strv_join(p->unit_path, "\n\t");
                 if (!t)
@@ -331,15 +330,12 @@ int lookup_paths_init(
                                 return -ENOMEM;
                 }
 
-                if (!path_strv_canonicalize_absolute(p->sysvinit_path, NULL))
+                if (!path_strv_canonicalize_absolute_uniq(p->sysvinit_path, root_dir))
                         return -ENOMEM;
 
-                if (!path_strv_canonicalize_absolute(p->sysvrcnd_path, NULL))
+                if (!path_strv_canonicalize_absolute_uniq(p->sysvrcnd_path, root_dir))
                         return -ENOMEM;
 
-                strv_uniq(p->sysvinit_path);
-                strv_uniq(p->sysvrcnd_path);
-
                 if (!strv_isempty(p->sysvinit_path)) {
                         _cleanup_free_ char *t = strv_join(p->sysvinit_path, "\n\t");
                         if (!t)
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index a3ef824..847a52f 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -43,5 +43,11 @@ SystemdRunningAs systemd_running_as_from_string(const char *s) _pure_;
 
 int user_config_home(char **config_home);
 
-int lookup_paths_init(LookupPaths *p, SystemdRunningAs running_as, bool personal, const char *generator, const char *generator_early, const char *generator_late);
+int lookup_paths_init(LookupPaths *p,
+                      SystemdRunningAs running_as,
+                      bool personal,
+                      const char *root_dir,
+                      const char *generator,
+                      const char *generator_early,
+                      const char *generator_late);
 void lookup_paths_free(LookupPaths *p);
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index c3ccf61..ffdb754 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -167,36 +167,63 @@ char **path_strv_canonicalize_absolute(char **l, const char *prefix) {
 
         STRV_FOREACH(s, l) {
                 char *t, *u;
+                _cleanup_free_ char *orig = NULL;
 
-                if (!path_is_absolute(*s))
+                if (!path_is_absolute(*s)) {
+                        free(*s);
                         continue;
+                }
 
                 if (prefix) {
-                        t = strappend(prefix, *s);
-                        free(*s);
-                        *s = NULL;
-
+                        orig = *s;
+                        t = strappend(prefix, orig);
                         if (!t) {
                                 enomem = true;
                                 continue;
                         }
-                } else {
+                } else
                         t = *s;
-                        *s = NULL;
-                }
 
                 errno = 0;
                 u = canonicalize_file_name(t);
                 if (!u) {
-                        if (errno == ENOENT)
-                                u = t;
-                        else {
+                        if (errno == ENOENT) {
+                                if (prefix) {
+                                        u = orig;
+                                        orig = NULL;
+                                        free(t);
+                                } else
+                                        u = t;
+                        } else {
                                 free(t);
                                 if (errno == ENOMEM || errno == 0)
                                         enomem = true;
 
                                 continue;
                         }
+                } else if (prefix) {
+                        char *x;
+
+                        free(t);
+                        x = path_startswith(u, prefix);
+                        if (x) {
+                                /* restore the slash if it was lost */
+                                if (!startswith(x, "/"))
+                                        *(--x) = '/';
+
+                                t = strdup(x);
+                                free(u);
+                                if (!t) {
+                                        enomem = true;
+                                        continue;
+                                }
+                                u = t;
+                        } else {
+                                /* canonicalized path goes outside of
+                                 * prefix, keep the original path instead */
+                                u = orig;
+                                orig = NULL;
+                        }
                 } else
                         free(t);
 
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index b35cb0c..9cd1867 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4616,7 +4616,7 @@ static int enable_sysv_units(const char *verb, char **args) {
         /* Processes all SysV units, and reshuffles the array so that
          * afterwards only the native units remain */
 
-        r = lookup_paths_init(&paths, SYSTEMD_SYSTEM, false, NULL, NULL, NULL);
+        r = lookup_paths_init(&paths, SYSTEMD_SYSTEM, false, arg_root, NULL, NULL, NULL);
         if (r < 0)
                 return r;
 

commit a49631d0c3f1ba15cc353f09e9fe1af99e14e579
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Apr 21 19:17:40 2014 -0400

    shared/install: do not prefix created symlink with root path
    
    Before: /var/tmp/inst1//etc/systemd/system/default.target -> /var/tmp/inst1//usr/lib/systemd/system/graphical.target
    After: /var/tmp/inst1/etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target
    (cherry picked from commit 62b002337727093c21d020c730bd65971f7783a7)

diff --git a/src/shared/install.c b/src/shared/install.c
index f7822d4..5f6f280 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1039,67 +1039,64 @@ static int unit_file_search(
         assert(info);
         assert(paths);
 
-        if (info->path)
-                return unit_file_load(c, info, info->path, allow_symlink);
+        if (info->path) {
+                char *full_path = NULL;
+
+                if (!isempty(root_dir))
+                        full_path = strappenda(root_dir, info->path);
+
+                return unit_file_load(c, info, full_path ?: info->path, allow_symlink);
+        }
 
         assert(info->name);
 
         STRV_FOREACH(p, paths->unit_path) {
-                char *path = NULL;
-
-                if (isempty(root_dir))
-                        asprintf(&path, "%s/%s", *p, info->name);
-                else
-                        asprintf(&path, "%s/%s/%s", root_dir, *p, info->name);
+                _cleanup_free_ char *path = NULL, *full_path = NULL;
 
+                path = strjoin(*p, "/", info->name, NULL);
                 if (!path)
                         return -ENOMEM;
 
-                r = unit_file_load(c, info, path, allow_symlink);
+                if (!isempty(root_dir)) {
+                        full_path = strappend(root_dir, path);
+                        if (!full_path)
+                                return -ENOMEM;
+                }
 
-                if (r >= 0)
+                r = unit_file_load(c, info, full_path ?: path, allow_symlink);
+                if (r >= 0) {
                         info->path = path;
-                else {
-                        if (r == -ENOENT && unit_name_is_instance(info->name)) {
-                                /* Unit file doesn't exist, however instance enablement was requested.
-                                 * We will check if it is possible to load template unit file. */
-                                char *template = NULL,
-                                     *template_path = NULL,
-                                     *template_dir = NULL;
-
-                                template = unit_name_template(info->name);
-                                if (!template) {
-                                        free(path);
-                                        return -ENOMEM;
-                                }
+                        path = NULL;
+                } else if (r == -ENOENT && unit_name_is_instance(info->name)) {
+                        /* Unit file doesn't exist, however instance enablement was requested.
+                         * We will check if it is possible to load template unit file. */
+                        _cleanup_free_ char *template = NULL, *template_dir = NULL;
+
+                        template = unit_name_template(info->name);
+                        if (!template)
+                                return -ENOMEM;
 
-                                /* We will reuse path variable since we don't need it anymore. */
-                                template_dir = path;
-                                *(strrchr(path, '/') + 1) = '\0';
+                        /* We will reuse path variable since we don't need it anymore. */
+                        template_dir = path;
+                        *(strrchr(template_dir, '/') + 1) = '\0';
 
-                                template_path = strjoin(template_dir, template, NULL);
-                                if (!template_path) {
-                                        free(path);
-                                        free(template);
-                                        return -ENOMEM;
-                                }
+                        path = strappend(template_dir, template);
+                        if (!path)
+                                return -ENOMEM;
 
-                                /* Let's try to load template unit. */
-                                r = unit_file_load(c, info, template_path, allow_symlink);
-                                if (r >= 0) {
-                                        info->path = strdup(template_path);
-                                        if (!info->path) {
-                                                free(path);
-                                                free(template);
-                                                free(template_path);
-                                                return -ENOMEM;
-                                        }
-                                }
+                        if (!isempty(root_dir)) {
+                                free(full_path);
+                                full_path = strappend(root_dir, path);
+                                if (!full_path)
+                                        return -ENOMEM;
+                        }
 
-                                free(template);
-                                free(template_path);
+                        /* Let's try to load template unit. */
+                        r = unit_file_load(c, info, full_path ?: path, allow_symlink);
+                        if (r >= 0) {
+                                info->path = path;
+                                path = NULL;
                         }
-                        free(path);
                 }
 
                 if (r != -ENOENT && r != -ELOOP)

commit b55a9608057f4f4895fd7d6522d998f69baf45ee
Author: Eelco Dolstra <eelco.dolstra at logicblox.com>
Date:   Thu May 15 13:11:00 2014 +0200

    Fix typos in systemctl manpage
    
    (cherry picked from commit 1e89266b761a80da2cfc1b6e7a2a80a1855dcf7a)

diff --git a/man/systemctl.xml b/man/systemctl.xml
index 43ad4b1..4382342 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -423,7 +423,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
           safe option to request an immediate reboot. If
           <option>--force</option> is specified twice for these
           operations, they will be executed immediately without
-          terminating any processes or umounting any file
+          terminating any processes or unmounting any file
           systems. Warning: specifying <option>--force</option> twice
           with any of these operations might result in data
           loss.</para>
@@ -1032,7 +1032,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
             activation of the unit, including manual activation. Use
             this option with care. This honors the
             <option>--runtime</option> option to only mask temporarily
-            until the next reoobt of the system.</para>
+            until the next reboot of the system.</para>
           </listitem>
         </varlistentry>
 
@@ -1394,7 +1394,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
     <refsect2>
       <title>Parameter Syntax</title>
 
-      <para>Unit ommands listed above take either a single unit name
+      <para>Unit commands listed above take either a single unit name
       (designated as <replaceable>NAME</replaceable>), or multiple
       unit specifications (designated as
       <replaceable>PATTERN</replaceable>...). In the first case, the

commit 6c160b0f7a5581e2c5ae76f57e9e8a6dd0db0ceb
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri May 16 23:46:48 2014 +0200

    udev: avoid use of uninitialized err
    
    After 1ea972174baba40dbc80c51cbfc4edc49764b59b err is no longer
    set unless we hit a special case. Initialize it to 0 and remove
    a check that will never fail.
    
    (cherry picked from commit bf9bead187802a52a1f376a03caee762d663e945)
    
    Conflicts:
    	src/udev/udevd.c

diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 93afca1..73afa6f 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -272,7 +272,7 @@ static void worker_new(struct event *event)
                 for (;;) {
                         struct udev_event *udev_event;
                         struct worker_message msg;
-                        int err;
+                        int err = 0;
 
                         log_debug("seq %llu running", udev_device_get_seqnum(dev));
                         udev_event = udev_event_new(dev);
@@ -293,7 +293,7 @@ static void worker_new(struct event *event)
                         udev_event_execute_run(udev_event, &sigmask_orig);
 
                         /* apply/restore inotify watch */
-                        if (err == 0 && udev_event->inotify_watch) {
+                        if (udev_event->inotify_watch) {
                                 udev_watch_begin(udev, dev);
                                 udev_device_update_db(dev);
                         }

commit 59c91436bbadecec9f49dba82735ea1347316c70
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed May 14 00:34:49 2014 +0200

    udev: do not skip the execution of RUN when renaming a network device fails
    
    (cherry picked from commit 1ea972174baba40dbc80c51cbfc4edc49764b59b)

diff --git a/src/test/test-udev.c b/src/test/test-udev.c
index b064744..b057cc8 100644
--- a/src/test/test-udev.c
+++ b/src/test/test-udev.c
@@ -155,9 +155,8 @@ int main(int argc, char *argv[]) {
                 }
         }
 
-        err = udev_event_execute_rules(event, rules, &sigmask_orig);
-        if (err == 0)
-                udev_event_execute_run(event, NULL);
+        udev_event_execute_rules(event, rules, &sigmask_orig);
+        udev_event_execute_run(event, NULL);
 out:
         if (event != NULL && event->fd_signal >= 0)
                 close(event->fd_signal);
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 2cab42b..5213a4a 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -776,13 +776,12 @@ static int rename_netif(struct udev_event *event)
         return r;
 }
 
-int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigmask)
+void udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigmask)
 {
         struct udev_device *dev = event->dev;
-        int err = 0;
 
         if (udev_device_get_subsystem(dev) == NULL)
-                return -1;
+                return;
 
         if (streq(udev_device_get_action(dev), "remove")) {
                 udev_device_read_db(dev, NULL);
@@ -816,9 +815,10 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
                     event->name != NULL && !streq(event->name, udev_device_get_sysname(dev))) {
                         char syspath[UTIL_PATH_SIZE];
                         char *pos;
+                        int r;
 
-                        err = rename_netif(event);
-                        if (err == 0) {
+                        r = rename_netif(event);
+                        if (r >= 0) {
                                 log_debug("renamed netif to '%s'", event->name);
 
                                 /* remember old name */
@@ -881,7 +881,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
                 udev_device_unref(event->dev_db);
                 event->dev_db = NULL;
         }
-        return err;
 }
 
 void udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask)
diff --git a/src/udev/udev.h b/src/udev/udev.h
index 936adfb..62538bc 100644
--- a/src/udev/udev.h
+++ b/src/udev/udev.h
@@ -84,7 +84,7 @@ int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string,
 int udev_event_spawn(struct udev_event *event,
                      const char *cmd, char **envp, const sigset_t *sigmask,
                      char *result, size_t ressize);
-int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigset);
+void udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigset);
 void udev_event_execute_run(struct udev_event *event, const sigset_t *sigset);
 int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]);
 
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c
index 6cd311b..6a2f548 100644
--- a/src/udev/udevadm-test.c
+++ b/src/udev/udevadm-test.c
@@ -43,7 +43,6 @@ static int adm_test(struct udev *udev, int argc, char *argv[])
         _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
         _cleanup_udev_event_unref_ struct udev_event *event = NULL;
         sigset_t mask, sigmask_orig;
-        int err;
         int rc = 0, c;
 
         static const struct option options[] = {
@@ -139,18 +138,16 @@ static int adm_test(struct udev *udev, int argc, char *argv[])
                 goto out;
         }
 
-        err = udev_event_execute_rules(event, rules, &sigmask_orig);
+        udev_event_execute_rules(event, rules, &sigmask_orig);
 
         udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
                 printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
 
-        if (err == 0) {
-                udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
-                        char program[UTIL_PATH_SIZE];
+        udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
+                char program[UTIL_PATH_SIZE];
 
-                        udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
-                        printf("run: '%s'\n", program);
-                }
+                udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
+                printf("run: '%s'\n", program);
         }
 out:
         if (event != NULL && event->fd_signal >= 0)
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index f21c227..93afca1 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -288,10 +288,9 @@ static void worker_new(struct event *event)
                                 udev_event->exec_delay = exec_delay;
 
                         /* apply rules, create node, symlinks */
-                        err = udev_event_execute_rules(udev_event, rules, &sigmask_orig);
+                        udev_event_execute_rules(udev_event, rules, &sigmask_orig);
 
-                        if (err == 0)
-                                udev_event_execute_run(udev_event, &sigmask_orig);
+                        udev_event_execute_run(udev_event, &sigmask_orig);
 
                         /* apply/restore inotify watch */
                         if (err == 0 && udev_event->inotify_watch) {

commit 81d4159e6eadb34c25a5643ad95730da2f6f2d69
Author: Tom Gundersen <teg at jklm.no>
Date:   Mon May 12 21:26:54 2014 +0200

    core: sysvcompat - $network should be equivalent to network-online, rather than network target
    
    Most likely the  facility needed is actual connectivity, rather than whether or not the
    network managment daemon is running.
    
    We also need to explicitly pull in the network-online.target, as it is not active by
    default.
    
    This means {systemd-networkd,NetworkManager}-wait-online.service, can be enabled by default
    as part of network-online.target, and only delay boot when some service actively pulls it in.
    
    See: <https://bugzilla.gnome.org/show_bug.cgi?id=728965>
    
    Cc: Pavel Å imerda <psimerda at redhat.com>
    Cc: Michal Sekletar <msekleta at redhat.com>
    (cherry picked from commit 0404c609f399b2092a3de52eef9d75b0dc12e94c)

diff --git a/src/core/service.c b/src/core/service.c
index c55bf2d..6079881 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -386,7 +386,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
         static const char * const table[] = {
                 /* LSB defined facilities */
                 "local_fs",             NULL,
-                "network",              SPECIAL_NETWORK_TARGET,
+                "network",              SPECIAL_NETWORK_ONLINE_TARGET,
                 "named",                SPECIAL_NSS_LOOKUP_TARGET,
                 "portmap",              SPECIAL_RPCBIND_TARGET,
                 "remote_fs",            SPECIAL_REMOTE_FS_TARGET,
@@ -855,7 +855,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                         if (r == 0)
                                                 continue;
 
-                                        r = unit_add_dependency_by_name(u, startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true);
+                                        if (streq(m, SPECIAL_NETWORK_ONLINE_TARGET) && !startswith_no_case(t, "X-Start-Before:"))
+                                                /* the network-online target is special, as it needs to be actively pulled in */
+                                                r = unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_WANTS, m, NULL, true);
+                                        else
+                                                r = unit_add_dependency_by_name(u, startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true);
 
                                         if (r < 0)
                                                 log_error_unit(u->id, "[%s:%u] Failed to add dependency on %s, ignoring: %s",

commit 03513a460ed96d623b817d7114a73e1817fad92d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue May 13 16:40:53 2014 +0200

    replace more dup() by F_DUPFD_CLOEXEC
    
    (cherry picked from commit ead349509e325aad720bb0349521a9e56e2ac7c0)

diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 48c2ec4..ae3afdf 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -64,7 +64,7 @@ static int inhibit(sd_bus *bus, sd_bus_error *error) {
         if (r < 0)
                 return r;
 
-        r = dup(fd);
+        r = fcntl(fd, F_DUPFD_CLOEXEC, 3);
         if (r < 0)
                 return -errno;
 
diff --git a/src/shared/install.c b/src/shared/install.c
index 92811b5..f7822d4 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -332,7 +332,7 @@ static int remove_marked_symlinks(
                 int q, cfd;
                 deleted = false;
 
-                cfd = dup(fd);
+                cfd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
                 if (cfd < 0) {
                         r = -errno;
                         break;

commit 67eb48925cfd116fc4de9610d37acc59a18df5e4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue May 13 16:35:34 2014 +0200

    pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html
    (cherry picked from commit 85c08dc013f9f99b58bc9b79284af0b35304237b)

diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 195d4d5..3958db0 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -475,7 +475,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
         }
 
         if (session_fd >= 0) {
-                session_fd = dup(session_fd);
+                session_fd = fcntl(session_fd, F_DUPFD_CLOEXEC, 3);
                 if (session_fd < 0) {
                         pam_syslog(handle, LOG_ERR, "Failed to dup session fd: %m");
                         return PAM_SESSION_ERR;

commit 9ceee7ebb5d14e78f786b1f4fcff54e366a2e233
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue May 13 12:23:14 2014 +0200

    udev: rename netif - properly break lines in kmsg
    
    Before:
    
    30,997,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
    30,998,1175077801,c;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6
    
    After:
    
    30,834,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6
    30,835,4732949,-;systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
    30,988,1175077801,-;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6
    
    (cherry picked from commit 1514d70819246df8d1cd1388216ef91d8276fd52)

diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 5998be2..2cab42b 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -771,7 +771,7 @@ static int rename_netif(struct udev_event *event)
                 log_error("error changing net interface name %s to %s: %s",
                           oldname, name, strerror(-r));
         else
-                print_kmsg("renamed network interface %s to %s", oldname, name);
+                print_kmsg("renamed network interface %s to %s\n", oldname, name);
 
         return r;
 }

commit 022dcd0d94978162b46b4f894521589ed3eb5371
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat May 10 03:44:25 2014 +0200

    systemctl: return an error code is status fails
    
    This got lost in the refactoring in f74294c1dabb4.
    
    Also make sure that the return code corresponds to the *first* failure,
    not the last.
    
    https://lists.fedoraproject.org/pipermail/devel/2014-May/199080.html
    (cherry picked from commit 5bb75bc745557d5141066dee796b329507b0c634)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 12432dd..b35cb0c 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3824,7 +3824,7 @@ static int show_all(
         _cleanup_free_ UnitInfo *unit_infos = NULL;
         const UnitInfo *u;
         unsigned c;
-        int r;
+        int r, ret = 0;
 
         r = get_unit_list(bus, &reply, &unit_infos, NULL);
         if (r < 0)
@@ -3846,9 +3846,11 @@ static int show_all(
                 r = show_one(verb, bus, p, show_properties, new_line, ellipsized);
                 if (r != 0)
                         return r;
+                else if (r > 0 && ret == 0)
+                        ret = r;
         }
 
-        return 0;
+        return ret;
 }
 
 static int cat(sd_bus *bus, char **args) {
@@ -3993,7 +3995,12 @@ static int show(sd_bus *bus, char **args) {
                                 }
                         }
 
-                        show_one(args[0], bus, unit, show_properties, &new_line, &ellipsized);
+                        r = show_one(args[0], bus, unit, show_properties,
+                                     &new_line, &ellipsized);
+                        if (r < 0)
+                                return r;
+                        else if (r > 0 && ret == 0)
+                                ret = r;
                 }
 
                 if (!strv_isempty(patterns)) {
@@ -4010,7 +4017,12 @@ static int show(sd_bus *bus, char **args) {
                                 if (!unit)
                                         return log_oom();
 
-                                show_one(args[0], bus, unit, show_properties, &new_line, &ellipsized);
+                                r = show_one(args[0], bus, unit, show_properties,
+                                             &new_line, &ellipsized);
+                                if (r < 0)
+                                        return r;
+                                else if (r > 0 && ret == 0)
+                                        ret = r;
                         }
                 }
         }

commit 1b616bb22308aafb2a45b7f964cd7d485211b323
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri May 9 08:39:25 2014 -0400

    man: sd_journal_send does nothing when journald is not available
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1096067
    (cherry picked from commit bdf9fc1a940e342afb7a78075984419cb3bc3135)

diff --git a/man/sd_journal_print.xml b/man/sd_journal_print.xml
index c6f204b..8aac68f 100644
--- a/man/sd_journal_print.xml
+++ b/man/sd_journal_print.xml
@@ -218,6 +218,11 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
                 errno-style error code. The
                 <citerefentry><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>
                 variable itself is not altered.</para>
+
+                <para>If
+                <citerefentry><refentrytitle>systemd-journald</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+                is not running (the socket is not present), those
+                functions do nothing, and also return 0.</para>
         </refsect1>
 
         <refsect1>

commit d7c1de4f3635830d28d6c61f3d1cae2a9474ffd8
Author: Łukasz Stelmach <l.stelmach at samsung.com>
Date:   Thu May 8 12:57:26 2014 +0200

    core: check the right variable for failed open()
    
    (cherry picked from commit cd7affaeea16d3904354b810a292e594dfef25dd)

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 1327486..e762bbf 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -864,7 +864,7 @@ int manager_setup_cgroup(Manager *m) {
                 close_nointr_nofail(m->pin_cgroupfs_fd);
 
         m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK);
-        if (r < 0) {
+        if (m->pin_cgroupfs_fd < 0) {
                 log_error("Failed to open pin file: %m");
                 return -errno;
         }

commit 65d593c63301cd4deeef72f027901a4511e07f0c
Author: Kay Sievers <kay at vrfy.org>
Date:   Mon May 5 14:23:10 2014 +0200

    hwdb: update
    
    (cherry picked from commit 61fb23db45c626d92b4e33f09b9287f58a3625a5)

diff --git a/hwdb/20-OUI.hwdb b/hwdb/20-OUI.hwdb
index 17794ed..afc0d90 100644
--- a/hwdb/20-OUI.hwdb
+++ b/hwdb/20-OUI.hwdb
@@ -13940,7 +13940,7 @@ OUI:000063*
  ID_OUI_FROM_DATABASE=BARCO CONTROL ROOMS GMBH
 
 OUI:000064*
- ID_OUI_FROM_DATABASE=YOKOGAWA DIGITAL COMPUTER CORP
+ ID_OUI_FROM_DATABASE=Yokogawa Electric Corporation
 
 OUI:000065*
  ID_OUI_FROM_DATABASE=Network General Corporation
@@ -14927,7 +14927,7 @@ OUI:0001AE*
  ID_OUI_FROM_DATABASE=Trex Enterprises
 
 OUI:0001AF*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:0001B0*
  ID_OUI_FROM_DATABASE=Fulltek Technology Co., Ltd.
@@ -18272,7 +18272,7 @@ OUI:00060A*
  ID_OUI_FROM_DATABASE=Blue2space
 
 OUI:00060B*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:00060C*
  ID_OUI_FROM_DATABASE=Melco Industries, Inc.
@@ -20441,7 +20441,7 @@ OUI:0008F8*
  ID_OUI_FROM_DATABASE=UTC CCS
 
 OUI:0008F9*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:0008FA*
  ID_OUI_FROM_DATABASE=Karl E.Brinkmann GmbH
@@ -46612,6 +46612,9 @@ OUI:0064A6*
 OUI:00664B*
  ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
 
+OUI:006B8E*
+ ID_OUI_FROM_DATABASE=Shanghai Feixun Communication Co.,Ltd.
+
 OUI:006B9E*
  ID_OUI_FROM_DATABASE=VIZIO Inc
 
@@ -46850,7 +46853,7 @@ OUI:008041*
  ID_OUI_FROM_DATABASE=VEB KOMBINAT ROBOTRON
 
 OUI:008042*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:008043*
  ID_OUI_FROM_DATABASE=NETWORLD, INC.
@@ -49919,7 +49922,7 @@ OUI:00C0F8*
  ID_OUI_FROM_DATABASE=ABOUT COMPUTING INC.
 
 OUI:00C0F9*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:00C0FA*
  ID_OUI_FROM_DATABASE=CANARY COMMUNICATIONS, INC.
@@ -50957,7 +50960,7 @@ OUI:00E034*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
 OUI:00E035*
- ID_OUI_FROM_DATABASE=Emerson Network Power
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:00E036*
  ID_OUI_FROM_DATABASE=PIONEER CORPORATION
@@ -52477,6 +52480,9 @@ OUI:0838A5*
 OUI:083AB8*
  ID_OUI_FROM_DATABASE=Shinoda Plasma Co., Ltd.
 
+OUI:083D88*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:083E0C*
  ID_OUI_FROM_DATABASE=ARRIS Group, Inc.
 
@@ -52495,9 +52501,6 @@ OUI:084027*
 OUI:08482C*
  ID_OUI_FROM_DATABASE=Raycore Taiwan Co., LTD.
 
-OUI:084929*
- ID_OUI_FROM_DATABASE=CYBATI
-
 OUI:084E1C*
  ID_OUI_FROM_DATABASE=H2A Systems, LLC
 
@@ -52867,6 +52870,9 @@ OUI:0C8910*
 OUI:0C8BFD*
  ID_OUI_FROM_DATABASE=Intel Corporate
 
+OUI:0C8C8F*
+ ID_OUI_FROM_DATABASE=Kamo Technology Limited
+
 OUI:0C8CDC*
  ID_OUI_FROM_DATABASE=Suunto Oy
 
@@ -53515,6 +53521,9 @@ OUI:1499E2*
 OUI:149FE8*
  ID_OUI_FROM_DATABASE=Lenovo Mobile Communication Technology Ltd.
 
+OUI:14A364*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:14A62C*
  ID_OUI_FROM_DATABASE=S.M. Dezac S.A.
 
@@ -54403,6 +54412,9 @@ OUI:20918A*
 OUI:2091D9*
  ID_OUI_FROM_DATABASE=I'M SPA
 
+OUI:20934D*
+ ID_OUI_FROM_DATABASE=Fujian Star-net Communication Co., Ltd
+
 OUI:209AE9*
  ID_OUI_FROM_DATABASE=Volacomm Co., Ltd
 
@@ -54598,6 +54610,9 @@ OUI:24470E*
 OUI:24497B*
  ID_OUI_FROM_DATABASE=Innovative Converged Devices Inc
 
+OUI:244F1D*
+ ID_OUI_FROM_DATABASE=iRule LLC
+
 OUI:245FDF*
  ID_OUI_FROM_DATABASE=KYOCERA Corporation
 
@@ -54751,6 +54766,9 @@ OUI:24DEC6*
 OUI:24E271*
  ID_OUI_FROM_DATABASE=Qingdao Hisense Communications Co.,Ltd
 
+OUI:24E314*
+ ID_OUI_FROM_DATABASE=Apple
+
 OUI:24E6BA*
  ID_OUI_FROM_DATABASE=JSC Zavod im. Kozitsky
 
@@ -54829,6 +54847,9 @@ OUI:2826A6*
 OUI:28285D*
  ID_OUI_FROM_DATABASE=ZyXEL Communications Corporation
 
+OUI:2829CC*
+ ID_OUI_FROM_DATABASE=Corsa Technology Incorporated
+
 OUI:2829D9*
  ID_OUI_FROM_DATABASE=GlobalBeiMing technology (Beijing)Co. Ltd
 
@@ -55087,12 +55108,18 @@ OUI:28E14C*
 OUI:28E297*
  ID_OUI_FROM_DATABASE=Shanghai InfoTM Microelectronics Co.,Ltd.
 
+OUI:28E31F*
+ ID_OUI_FROM_DATABASE=Xiaomi inc.
+
 OUI:28E347*
  ID_OUI_FROM_DATABASE=Liteon Technology Corporation
 
 OUI:28E608*
  ID_OUI_FROM_DATABASE=Tokheim
 
+OUI:28E6E9*
+ ID_OUI_FROM_DATABASE=SIS Sat Internet Services GmbH
+
 OUI:28E794*
  ID_OUI_FROM_DATABASE=Microtime Computer Inc.
 
@@ -55225,6 +55252,9 @@ OUI:2C534A*
 OUI:2C542D*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
+OUI:2C54CF*
+ ID_OUI_FROM_DATABASE=LG Electronics
+
 OUI:2C553C*
  ID_OUI_FROM_DATABASE=Gainspeed, Inc.
 
@@ -55330,6 +55360,9 @@ OUI:2CA835*
 OUI:2CAB25*
  ID_OUI_FROM_DATABASE=Shenzhen Gongjin Electronics Co.,Ltd
 
+OUI:2CABA4*
+ ID_OUI_FROM_DATABASE=Cisco SPVTG
+
 OUI:2CB05D*
  ID_OUI_FROM_DATABASE=NETGEAR
 
@@ -55456,6 +55489,9 @@ OUI:303294*
 OUI:3032D4*
  ID_OUI_FROM_DATABASE=Hanilstm Co., Ltd.
 
+OUI:303335*
+ ID_OUI_FROM_DATABASE=Boosty
+
 OUI:3037A6*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
@@ -55888,6 +55924,9 @@ OUI:34BA9A*
 OUI:34BB1F*
  ID_OUI_FROM_DATABASE=Research In Motion
 
+OUI:34BB26*
+ ID_OUI_FROM_DATABASE=Motorola Mobility LLC
+
 OUI:34BCA6*
  ID_OUI_FROM_DATABASE=Beijing Ding Qing Technology, Ltd.
 
@@ -55975,6 +56014,9 @@ OUI:34EF44*
 OUI:34EF8B*
  ID_OUI_FROM_DATABASE=NTT Communications Corporation
 
+OUI:34F0CA*
+ ID_OUI_FROM_DATABASE=Shenzhen Linghangyuan Digital Technology Co.,Ltd.
+
 OUI:34F39B*
  ID_OUI_FROM_DATABASE=WizLAN Ltd.
 
@@ -56023,6 +56065,9 @@ OUI:381766*
 OUI:38192F*
  ID_OUI_FROM_DATABASE=Nokia Corporation
 
+OUI:381C1A*
+ ID_OUI_FROM_DATABASE=Cisco
+
 OUI:381C4A*
  ID_OUI_FROM_DATABASE=SIMCom Wireless Solutions Co.,Ltd.
 
@@ -56236,6 +56281,9 @@ OUI:38F597*
 OUI:38F708*
  ID_OUI_FROM_DATABASE=National Resource Management, Inc.
 
+OUI:38F889*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:38F8B7*
  ID_OUI_FROM_DATABASE=V2COM PARTICIPACOES S.A.
 
@@ -56287,6 +56335,9 @@ OUI:3C15C2*
 OUI:3C15EA*
  ID_OUI_FROM_DATABASE=TESCOM CO., LTD.
 
+OUI:3C189F*
+ ID_OUI_FROM_DATABASE=Nokia Corporation
+
 OUI:3C18A0*
  ID_OUI_FROM_DATABASE=Luxshare Precision Industry Co.,Ltd.
 
@@ -56521,6 +56572,9 @@ OUI:3CD7DA*
 OUI:3CD92B*
  ID_OUI_FROM_DATABASE=Hewlett-Packard Company
 
+OUI:3CD9CE*
+ ID_OUI_FROM_DATABASE=Eclipse WiFi
+
 OUI:3CDF1E*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
@@ -56725,6 +56779,9 @@ OUI:407A80*
 OUI:407B1B*
  ID_OUI_FROM_DATABASE=Mettle Networks Inc.
 
+OUI:408256*
+ ID_OUI_FROM_DATABASE=Continental Automotive GmbH
+
 OUI:4083DE*
  ID_OUI_FROM_DATABASE=Motorola
 
@@ -56818,6 +56875,9 @@ OUI:40C245*
 OUI:40C4D6*
  ID_OUI_FROM_DATABASE=ChongQing Camyu Technology Development Co.,Ltd.
 
+OUI:40C62A*
+ ID_OUI_FROM_DATABASE=Shanghai Jing Ren Electronic Technology Co., Ltd.
+
 OUI:40C7C9*
  ID_OUI_FROM_DATABASE=Naviit Inc.
 
@@ -57001,6 +57061,9 @@ OUI:446132*
 OUI:44619C*
  ID_OUI_FROM_DATABASE=FONsystem co. ltd.
 
+OUI:44666E*
+ ID_OUI_FROM_DATABASE=IP-LINE
+
 OUI:446755*
  ID_OUI_FROM_DATABASE=Orbit Irrigation
 
@@ -57019,6 +57082,9 @@ OUI:44700B*
 OUI:447098*
  ID_OUI_FROM_DATABASE=MING HONG TECHNOLOGY (SHEN ZHEN) LIMITED
 
+OUI:44746C*
+ ID_OUI_FROM_DATABASE=Sony Mobile Communications AB
+
 OUI:447BC4*
  ID_OUI_FROM_DATABASE=DualShine Technology(SZ)Co.,Ltd
 
@@ -57079,6 +57145,9 @@ OUI:44A42D*
 OUI:44A689*
  ID_OUI_FROM_DATABASE=PROMAX ELECTRONICA SA
 
+OUI:44A6E5*
+ ID_OUI_FROM_DATABASE=THINKING TECHNOLOGY CO.,LTD
+
 OUI:44A7CF*
  ID_OUI_FROM_DATABASE=Murata Manufacturing Co., Ltd.
 
@@ -57178,6 +57247,9 @@ OUI:48022A*
 OUI:480362*
  ID_OUI_FROM_DATABASE=DESAY ELECTRONICS(HUIZHOU)CO.,LTD
 
+OUI:480C49*
+ ID_OUI_FROM_DATABASE=NAKAYO TELECOMMUNICATIONS,INC
+
 OUI:481249*
  ID_OUI_FROM_DATABASE=Luxcom Technologies Inc.
 
@@ -57463,6 +57535,9 @@ OUI:4C2258*
 OUI:4C2578*
  ID_OUI_FROM_DATABASE=Nokia Corporation
 
+OUI:4C26E7*
+ ID_OUI_FROM_DATABASE=Welgate Co., Ltd.
+
 OUI:4C2C80*
  ID_OUI_FROM_DATABASE=Beijing Skyway Technologies Co.,Ltd
 
@@ -57535,6 +57610,9 @@ OUI:4C63EB*
 OUI:4C64D9*
  ID_OUI_FROM_DATABASE=Guangdong Leawin Group Co., Ltd
 
+OUI:4C6E6E*
+ ID_OUI_FROM_DATABASE=Comnect Technology CO.,LTD
+
 OUI:4C72B9*
  ID_OUI_FROM_DATABASE=Pegatron Corporation
 
@@ -57565,6 +57643,9 @@ OUI:4C8093*
 OUI:4C82CF*
  ID_OUI_FROM_DATABASE=Echostar Technologies
 
+OUI:4C83DE*
+ ID_OUI_FROM_DATABASE=Cisco SPVTG
+
 OUI:4C8B30*
  ID_OUI_FROM_DATABASE=Actiontec Electronics, Inc
 
@@ -57592,6 +57673,9 @@ OUI:4C9E80*
 OUI:4C9EE4*
  ID_OUI_FROM_DATABASE=Hanyang Navicom Co.,Ltd.
 
+OUI:4C9EFF*
+ ID_OUI_FROM_DATABASE=ZyXEL Communications Corp
+
 OUI:4CA56D*
  ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
 
@@ -57775,6 +57859,9 @@ OUI:504A6E*
 OUI:504F94*
  ID_OUI_FROM_DATABASE=Loxone Electronics GmbH
 
+OUI:505065*
+ ID_OUI_FROM_DATABASE=TAKT Corporation
+
 OUI:505663*
  ID_OUI_FROM_DATABASE=Texas Instruments
 
@@ -57808,6 +57895,9 @@ OUI:506313*
 OUI:506441*
  ID_OUI_FROM_DATABASE=Greenlee
 
+OUI:506787*
+ ID_OUI_FROM_DATABASE=iTellus
+
 OUI:5067F0*
  ID_OUI_FROM_DATABASE=ZyXEL Communications Corporation
 
@@ -58693,6 +58783,12 @@ OUI:5CAC4C*
 OUI:5CB524*
  ID_OUI_FROM_DATABASE=Sony Ericsson Mobile Communications AB
 
+OUI:5CB6CC*
+ ID_OUI_FROM_DATABASE=NovaComm Technologies Inc.
+
+OUI:5CB8CB*
+ ID_OUI_FROM_DATABASE=Allis Communications
+
 OUI:5CBD9E*
  ID_OUI_FROM_DATABASE=HONGKONG MIRACLE EAGLE TECHNOLOGY(GROUP) LIMITED
 
@@ -58789,6 +58885,9 @@ OUI:5CF8A1*
 OUI:5CF938*
  ID_OUI_FROM_DATABASE=Apple, Inc
 
+OUI:5CF96A*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:5CF9DD*
  ID_OUI_FROM_DATABASE=Dell Inc
 
@@ -58927,6 +59026,9 @@ OUI:60748D*
 OUI:607688*
  ID_OUI_FROM_DATABASE=Velodyne
 
+OUI:6077E2*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:60812B*
  ID_OUI_FROM_DATABASE=Custom Control Concepts
 
@@ -59074,6 +59176,9 @@ OUI:60E00E*
 OUI:60E327*
  ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
 
+OUI:60E701*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:60E956*
  ID_OUI_FROM_DATABASE=Ayla Networks, Inc
 
@@ -59131,6 +59236,9 @@ OUI:6405BE*
 OUI:64094C*
  ID_OUI_FROM_DATABASE=Beijing Superbee Wireless Technology Co.,Ltd
 
+OUI:640980*
+ ID_OUI_FROM_DATABASE=XIAOMI Electronics,CO.,LTD
+
 OUI:640B4A*
  ID_OUI_FROM_DATABASE=Digital Telecom Technology Limited
 
@@ -59254,6 +59362,9 @@ OUI:645FFF*
 OUI:646223*
  ID_OUI_FROM_DATABASE=Cellient Co., Ltd.
 
+OUI:64649B*
+ ID_OUI_FROM_DATABASE=juniper networks
+
 OUI:6465C0*
  ID_OUI_FROM_DATABASE=Nuvon, Inc
 
@@ -59680,6 +59791,9 @@ OUI:689C5E*
 OUI:689C70*
  ID_OUI_FROM_DATABASE=Apple
 
+OUI:68A0F6*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:68A1B7*
  ID_OUI_FROM_DATABASE=Honghao Mingchuan Technology (Beijing) CO.,Ltd.
 
@@ -60130,6 +60244,9 @@ OUI:702B1D*
 OUI:702C1F*
  ID_OUI_FROM_DATABASE=Wisol
 
+OUI:702DD1*
+ ID_OUI_FROM_DATABASE=Newings Communication CO., LTD.
+
 OUI:702F4B*
  ID_OUI_FROM_DATABASE=PolyVision Inc.
 
@@ -60211,6 +60328,9 @@ OUI:705986*
 OUI:705AB6*
  ID_OUI_FROM_DATABASE=COMPAL INFORMATION (KUNSHAN) CO., LTD.
 
+OUI:705B2E*
+ ID_OUI_FROM_DATABASE=M2Communication Inc.
+
 OUI:705CAD*
  ID_OUI_FROM_DATABASE=Konami Gaming Inc
 
@@ -60568,6 +60688,9 @@ OUI:748EF8*
 OUI:748F1B*
  ID_OUI_FROM_DATABASE=MasterImage 3D
 
+OUI:748F4D*
+ ID_OUI_FROM_DATABASE=MEN Mikro Elektronik GmbH
+
 OUI:749050*
  ID_OUI_FROM_DATABASE=Renesas Electronics Corporation
 
@@ -60694,6 +60817,9 @@ OUI:74F07D*
 OUI:74F102*
  ID_OUI_FROM_DATABASE=Beijing HCHCOM Technology Co., Ltd
 
+OUI:74F413*
+ ID_OUI_FROM_DATABASE=Maxwell Forest
+
 OUI:74F612*
  ID_OUI_FROM_DATABASE=ARRIS Group, Inc.
 
@@ -61582,6 +61708,9 @@ OUI:806CBC*
 OUI:80711F*
  ID_OUI_FROM_DATABASE=Juniper Networks
 
+OUI:80717A*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:807693*
  ID_OUI_FROM_DATABASE=Newag SA
 
@@ -61633,6 +61762,9 @@ OUI:80946C*
 OUI:8096B1*
  ID_OUI_FROM_DATABASE=ARRIS Group, Inc.
 
+OUI:8096CA*
+ ID_OUI_FROM_DATABASE=Hon Hai Precision Ind Co.,Ltd
+
 OUI:80971B*
  ID_OUI_FROM_DATABASE=Altenergy Power System,Inc.
 
@@ -61699,6 +61831,9 @@ OUI:80D019*
 OUI:80D18B*
  ID_OUI_FROM_DATABASE=Hangzhou I'converge Technology Co.,Ltd
 
+OUI:80D21D*
+ ID_OUI_FROM_DATABASE=AzureWave Technologies, Inc
+
 OUI:80D433*
  ID_OUI_FROM_DATABASE=LzLabs GmbH
 
@@ -62356,6 +62491,9 @@ OUI:8C2F39*
 OUI:8C3330*
  ID_OUI_FROM_DATABASE=EmFirst Co., Ltd.
 
+OUI:8C3357*
+ ID_OUI_FROM_DATABASE=HiteVision Digital Media Technology Co.,Ltd.
+
 OUI:8C3AE3*
  ID_OUI_FROM_DATABASE=LG Electronics
 
@@ -62842,6 +62980,9 @@ OUI:90B134*
 OUI:90B21F*
  ID_OUI_FROM_DATABASE=Apple
 
+OUI:90B686*
+ ID_OUI_FROM_DATABASE=Murata Manufacturing Co., Ltd.
+
 OUI:90B8D0*
  ID_OUI_FROM_DATABASE=Joyent, Inc.
 
@@ -62887,6 +63028,9 @@ OUI:90D92C*
 OUI:90DA4E*
  ID_OUI_FROM_DATABASE=AVANU
 
+OUI:90DA6A*
+ ID_OUI_FROM_DATABASE=MCC System Co., Ltd.
+
 OUI:90DB46*
  ID_OUI_FROM_DATABASE=E-LEAD ELECTRONIC CO., LTD
 
@@ -63100,6 +63244,9 @@ OUI:94ACCA*
 OUI:94AE61*
  ID_OUI_FROM_DATABASE=Alcatel Lucent
 
+OUI:94AEE3*
+ ID_OUI_FROM_DATABASE=Belden Hirschmann Industries (Suzhou) Ltd.
+
 OUI:94B8C5*
  ID_OUI_FROM_DATABASE=RuggedCom Inc.
 
@@ -63151,6 +63298,9 @@ OUI:94CE2C*
 OUI:94D019*
  ID_OUI_FROM_DATABASE=Cydle Corp.
 
+OUI:94D60E*
+ ID_OUI_FROM_DATABASE=shenzhen yunmao information technologies co., ltd
+
 OUI:94D723*
  ID_OUI_FROM_DATABASE=Shanghai DareGlobal Technologies Co., Ltd
 
@@ -63730,6 +63880,9 @@ OUI:9CC077*
 OUI:9CC0D2*
  ID_OUI_FROM_DATABASE=Conductix-Wampfler AG
 
+OUI:9CC172*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:9CC7A6*
  ID_OUI_FROM_DATABASE=AVM GmbH
 
@@ -63799,6 +63952,9 @@ OUI:A002DC*
 OUI:A00363*
  ID_OUI_FROM_DATABASE=Robert Bosch Healthcare GmbH
 
+OUI:A00627*
+ ID_OUI_FROM_DATABASE=NEXPA System
+
 OUI:A00798*
  ID_OUI_FROM_DATABASE=Samsung Electronics
 
@@ -63898,6 +64054,9 @@ OUI:A051C6*
 OUI:A055DE*
  ID_OUI_FROM_DATABASE=Pace plc
 
+OUI:A056B2*
+ ID_OUI_FROM_DATABASE=Harman/Becker Automotive Systems GmbH
+
 OUI:A0593A*
  ID_OUI_FROM_DATABASE=V.D.S. Video Display Systems srl
 
@@ -64234,6 +64393,9 @@ OUI:A45C27*
 OUI:A45D36*
  ID_OUI_FROM_DATABASE=Hewlett Packard
 
+OUI:A45DA1*
+ ID_OUI_FROM_DATABASE=ADB Broadband Italia
+
 OUI:A46032*
  ID_OUI_FROM_DATABASE=MRV Communications (Networks) LTD
 
@@ -64312,6 +64474,9 @@ OUI:A49F89*
 OUI:A4A24A*
  ID_OUI_FROM_DATABASE=Cisco SPVTG
 
+OUI:A4A4D3*
+ ID_OUI_FROM_DATABASE=Bluebank Communication Technology Co.Ltd
+
 OUI:A4A80F*
  ID_OUI_FROM_DATABASE=Shenzhen Coship Electronics Co., Ltd.
 
@@ -64462,6 +64627,9 @@ OUI:A80600*
 OUI:A80C0D*
  ID_OUI_FROM_DATABASE=Cisco
 
+OUI:A81374*
+ ID_OUI_FROM_DATABASE=Panasonic Corporation AVC Networks Company
+
 OUI:A8154D*
  ID_OUI_FROM_DATABASE=TP-LINK TECHNOLOGIES CO.,LTD.
 
@@ -64495,6 +64663,9 @@ OUI:A82BD6*
 OUI:A830AD*
  ID_OUI_FROM_DATABASE=Wei Fang Goertek Electronics Co.,Ltd
 
+OUI:A8329A*
+ ID_OUI_FROM_DATABASE=Digicom Futuristic Technologies Ltd.
+
 OUI:A83944*
  ID_OUI_FROM_DATABASE=Actiontec Electronics, Inc
 
@@ -64582,6 +64753,9 @@ OUI:A88CEE*
 OUI:A88D7B*
  ID_OUI_FROM_DATABASE=SunDroid Global limited.
 
+OUI:A88E24*
+ ID_OUI_FROM_DATABASE=Apple
+
 OUI:A8922C*
  ID_OUI_FROM_DATABASE=LG Electronics
 
@@ -64903,6 +65077,9 @@ OUI:AC9CE4*
 OUI:ACA016*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
+OUI:ACA213*
+ ID_OUI_FROM_DATABASE=Shenzhen Bilian electronic CO.,LTD
+
 OUI:ACA22C*
  ID_OUI_FROM_DATABASE=Baycity Technologies Ltd
 
@@ -65068,6 +65245,9 @@ OUI:B01B7C*
 OUI:B01C91*
  ID_OUI_FROM_DATABASE=Elim Co
 
+OUI:B01F81*
+ ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY  - Please see MAM public listing for more information.
+
 OUI:B024F3*
  ID_OUI_FROM_DATABASE=Progeny Systems
 
@@ -65113,6 +65293,9 @@ OUI:B058C4*
 OUI:B05B1F*
  ID_OUI_FROM_DATABASE=THERMO FISHER SCIENTIFIC S.P.A.
 
+OUI:B05B67*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:B05CE5*
  ID_OUI_FROM_DATABASE=Nokia Corporation
 
@@ -65338,6 +65521,9 @@ OUI:B407F9*
 OUI:B40832*
  ID_OUI_FROM_DATABASE=TC Communications
 
+OUI:B40AC6*
+ ID_OUI_FROM_DATABASE=DEXON Systems Ltd.
+
 OUI:B40B44*
  ID_OUI_FROM_DATABASE=Smartisan Technology Co., Ltd.
 
@@ -65533,6 +65719,9 @@ OUI:B4AA4D*
 OUI:B4AB2C*
  ID_OUI_FROM_DATABASE=MtM Technology Corporation
 
+OUI:B4AE6F*
+ ID_OUI_FROM_DATABASE=Circle Reliance, Inc.
+
 OUI:B4B017*
  ID_OUI_FROM_DATABASE=Avaya, Inc
 
@@ -65566,6 +65755,9 @@ OUI:B4C810*
 OUI:B4CCE9*
  ID_OUI_FROM_DATABASE=PROSYST
 
+OUI:B4CEF6*
+ ID_OUI_FROM_DATABASE=HTC Corporation
+
 OUI:B4CFDB*
  ID_OUI_FROM_DATABASE=Shenzhen Jiuzhou Electric Co.,LTD
 
@@ -65812,6 +66004,9 @@ OUI:B898B0*
 OUI:B898F7*
  ID_OUI_FROM_DATABASE=Gionee Communication Equipment Co,Ltd.ShenZhen
 
+OUI:B89919*
+ ID_OUI_FROM_DATABASE=7signal Solutions, Inc
+
 OUI:B89AED*
  ID_OUI_FROM_DATABASE=OceanServer Technology, Inc
 
@@ -66160,6 +66355,9 @@ OUI:BC9889*
 OUI:BC99BC*
  ID_OUI_FROM_DATABASE=FonSee Technology Inc.
 
+OUI:BC9CC5*
+ ID_OUI_FROM_DATABASE=Beijing Huafei Technology Co., Ltd.
+
 OUI:BC9DA5*
  ID_OUI_FROM_DATABASE=DASCOM Europe GmbH
 
@@ -66511,6 +66709,9 @@ OUI:C0EAE4*
 OUI:C0F1C4*
  ID_OUI_FROM_DATABASE=Pacidal Corporation Ltd.
 
+OUI:C0F2FB*
+ ID_OUI_FROM_DATABASE=Apple
+
 OUI:C0F79D*
  ID_OUI_FROM_DATABASE=Powercode
 
@@ -66613,6 +66814,9 @@ OUI:C43C3C*
 OUI:C43DC7*
  ID_OUI_FROM_DATABASE=NETGEAR
 
+OUI:C44202*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:C4438F*
  ID_OUI_FROM_DATABASE=LG Electronics
 
@@ -66634,6 +66838,9 @@ OUI:C44AD0*
 OUI:C44B44*
  ID_OUI_FROM_DATABASE=Omniprint Inc.
 
+OUI:C44BD1*
+ ID_OUI_FROM_DATABASE=Wallys Communications  Teachnologies Co.,Ltd.
+
 OUI:C44E1F*
  ID_OUI_FROM_DATABASE=BlueN
 
@@ -66835,6 +67042,9 @@ OUI:C4F57C*
 OUI:C4FCE4*
  ID_OUI_FROM_DATABASE=DishTV NZ Ltd
 
+OUI:C80210*
+ ID_OUI_FROM_DATABASE=LG Innotek
+
 OUI:C80258*
  ID_OUI_FROM_DATABASE=ITW GSE ApS
 
@@ -67363,6 +67573,9 @@ OUI:CC9F35*
 OUI:CCA0E5*
  ID_OUI_FROM_DATABASE=DZG Metering GmbH
 
+OUI:CCA223*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:CCA374*
  ID_OUI_FROM_DATABASE=Guangdong Guanglian Electronic Technology Co.Ltd
 
@@ -67498,6 +67711,9 @@ OUI:CCFE3C*
 OUI:D00790*
  ID_OUI_FROM_DATABASE=Texas Instruments
 
+OUI:D00AAB*
+ ID_OUI_FROM_DATABASE=Yokogawa Digital Computer Corporation
+
 OUI:D00EA4*
  ID_OUI_FROM_DATABASE=Porsche Cars North America
 
@@ -67576,6 +67792,9 @@ OUI:D05875*
 OUI:D059C3*
  ID_OUI_FROM_DATABASE=CeraMicro Technology Corporation
 
+OUI:D059E4*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:D05A0F*
  ID_OUI_FROM_DATABASE=I-BT DIGITAL CO.,LTD
 
@@ -68248,6 +68467,9 @@ OUI:D86595*
 OUI:D866C6*
  ID_OUI_FROM_DATABASE=Shenzhen Daystar Technology Co.,ltd
 
+OUI:D866EE*
+ ID_OUI_FROM_DATABASE=BOXIN COMMUNICATION CO.,LTD.
+
 OUI:D867D9*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
@@ -68542,6 +68764,9 @@ OUI:DC49C9*
 OUI:DC4EDE*
  ID_OUI_FROM_DATABASE=SHINYEI TECHNOLOGY CO., LTD.
 
+OUI:DC537C*
+ ID_OUI_FROM_DATABASE=Compal Broadband Networks, Inc.
+
 OUI:DC5726*
  ID_OUI_FROM_DATABASE=Power-One
 
@@ -69112,6 +69337,9 @@ OUI:E45614*
 OUI:E457A8*
  ID_OUI_FROM_DATABASE=Stuart Manufacturing, Inc.
 
+OUI:E45D52*
+ ID_OUI_FROM_DATABASE=Avaya, Inc
+
 OUI:E46449*
  ID_OUI_FROM_DATABASE=ARRIS Group, Inc.
 
@@ -69298,6 +69526,9 @@ OUI:E81132*
 OUI:E81324*
  ID_OUI_FROM_DATABASE=GuangZhou Bonsoninfo System CO.,LTD
 
+OUI:E8150E*
+ ID_OUI_FROM_DATABASE=Nokia Corporation
+
 OUI:E817FC*
  ID_OUI_FROM_DATABASE=NIFTY Corporation
 
@@ -69373,6 +69604,9 @@ OUI:E85B5B*
 OUI:E85BF0*
  ID_OUI_FROM_DATABASE=Imaging Diagnostics
 
+OUI:E85D6B*
+ ID_OUI_FROM_DATABASE=Luminate Wireless
+
 OUI:E85E53*
  ID_OUI_FROM_DATABASE=Infratec Datentechnik GmbH
 
@@ -69409,6 +69643,9 @@ OUI:E878A1*
 OUI:E87AF3*
  ID_OUI_FROM_DATABASE=S5 Tech S.r.l.
 
+OUI:E8802E*
+ ID_OUI_FROM_DATABASE=Apple
+
 OUI:E880D8*
  ID_OUI_FROM_DATABASE=GNTEK Electronics Co.,Ltd.
 
@@ -69719,7 +69956,7 @@ OUI:EC9B5B*
  ID_OUI_FROM_DATABASE=Nokia Corporation
 
 OUI:EC9ECD*
- ID_OUI_FROM_DATABASE=Emerson Network Power and Embedded Computing
+ ID_OUI_FROM_DATABASE=Artesyn Embedded Technologies
 
 OUI:ECA29B*
  ID_OUI_FROM_DATABASE=Kemppi Oy
@@ -69745,6 +69982,9 @@ OUI:ECC38A*
 OUI:ECC882*
  ID_OUI_FROM_DATABASE=CISCO SYSTEMS, INC.
 
+OUI:ECCB30*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:ECCD6D*
  ID_OUI_FROM_DATABASE=Allied Telesis, Inc.
 
@@ -69763,6 +70003,9 @@ OUI:ECD925*
 OUI:ECD950*
  ID_OUI_FROM_DATABASE=IRT SA
 
+OUI:ECD9D1*
+ ID_OUI_FROM_DATABASE=Shenzhen TG-NET Botone Technology Co.,Ltd.
+
 OUI:ECDE3D*
  ID_OUI_FROM_DATABASE=Lamprey Networks, Inc.
 
@@ -70144,6 +70387,12 @@ OUI:F406A5*
 OUI:F40B93*
  ID_OUI_FROM_DATABASE=Research In Motion
 
+OUI:F40E11*
+ ID_OUI_FROM_DATABASE=IEEE REGISTRATION AUTHORITY  - Please see MAM public listing for more information.
+
+OUI:F40F1B*
+ ID_OUI_FROM_DATABASE=Cisco
+
 OUI:F40F9B*
  ID_OUI_FROM_DATABASE=WAVELINK
 
@@ -70165,6 +70414,9 @@ OUI:F41FC2*
 OUI:F42012*
  ID_OUI_FROM_DATABASE=Cuciniale GmbH
 
+OUI:F42833*
+ ID_OUI_FROM_DATABASE=MMPC Inc.
+
 OUI:F42896*
  ID_OUI_FROM_DATABASE=SPECTO PAINEIS ELETRONICOS LTDA
 
@@ -70294,6 +70546,9 @@ OUI:F499AC*
 OUI:F49F54*
  ID_OUI_FROM_DATABASE=Samsung Electronics
 
+OUI:F49FF3*
+ ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
+
 OUI:F4A294*
  ID_OUI_FROM_DATABASE=EAGLE WORLD DEVELOPMENT CO., LIMITED
 
@@ -70351,6 +70606,9 @@ OUI:F4CE46*
 OUI:F4CFE2*
  ID_OUI_FROM_DATABASE=Cisco
 
+OUI:F4D032*
+ ID_OUI_FROM_DATABASE=Yunnan Ideal Information&Technology.,Ltd
+
 OUI:F4D261*
  ID_OUI_FROM_DATABASE=SEMOCON Co., Ltd
 
@@ -70390,12 +70648,18 @@ OUI:F4F5A5*
 OUI:F4F5E8*
  ID_OUI_FROM_DATABASE=Google
 
+OUI:F4F646*
+ ID_OUI_FROM_DATABASE=Dediprog Technology Co. Ltd.
+
 OUI:F4F951*
  ID_OUI_FROM_DATABASE=Apple
 
 OUI:F4FC32*
  ID_OUI_FROM_DATABASE=Texas Instruments
 
+OUI:F4FD2B*
+ ID_OUI_FROM_DATABASE=ZOYI Company
+
 OUI:F80113*
  ID_OUI_FROM_DATABASE=Huawei Technologies Co., Ltd
 
@@ -70798,6 +71062,9 @@ OUI:FC1607*
 OUI:FC1794*
  ID_OUI_FROM_DATABASE=InterCreative Co., Ltd
 
+OUI:FC1910*
+ ID_OUI_FROM_DATABASE=Samsung Electronics Co.,Ltd
+
 OUI:FC19D0*
  ID_OUI_FROM_DATABASE=Cloud Vision Networks Technology Co.,Ltd.
 
@@ -70906,6 +71173,9 @@ OUI:FC7516*
 OUI:FC75E6*
  ID_OUI_FROM_DATABASE=Handreamnet
 
+OUI:FC790B*
+ ID_OUI_FROM_DATABASE=Hitachi High Technologies America, Inc.
+
 OUI:FC7CE7*
  ID_OUI_FROM_DATABASE=FCI USA LLC
 
@@ -70948,6 +71218,9 @@ OUI:FCA841*
 OUI:FCA9B0*
  ID_OUI_FROM_DATABASE=MIARTECH (SHANGHAI),INC.
 
+OUI:FCAA14*
+ ID_OUI_FROM_DATABASE=GIGA-BYTE TECHNOLOGY CO.,LTD.
+
 OUI:FCAD0F*
  ID_OUI_FROM_DATABASE=QTS NETWORKS
 
diff --git a/hwdb/20-pci-vendor-model.hwdb b/hwdb/20-pci-vendor-model.hwdb
index 14637d3..2957774 100644
--- a/hwdb/20-pci-vendor-model.hwdb
+++ b/hwdb/20-pci-vendor-model.hwdb
@@ -1673,6 +1673,9 @@ pci:v00001002d00001306*
 pci:v00001002d00001307*
  ID_MODEL_FROM_DATABASE=Kaveri
 
+pci:v00001002d00001308*
+ ID_MODEL_FROM_DATABASE=Kaveri HDMI/DP Audio Controller
+
 pci:v00001002d00001309*
  ID_MODEL_FROM_DATABASE=Kaveri [Radeon R7 Graphics]
 
@@ -4268,6 +4271,9 @@ pci:v00001002d00006611sv00001B0Asd000090D3*
 pci:v00001002d00006613*
  ID_MODEL_FROM_DATABASE=Oland PRO [Radeon R7 240]
 
+pci:v00001002d00006613sv00001682sd00007240*
+ ID_MODEL_FROM_DATABASE=Oland PRO [Radeon R7 240] (R7 240 2048 MB)
+
 pci:v00001002d00006620*
  ID_MODEL_FROM_DATABASE=Mars
 
@@ -6024,31 +6030,31 @@ pci:v00001002d00006819sv0000174Bsd0000E221*
  ID_MODEL_FROM_DATABASE=Pitcairn PRO [Radeon HD 7850] (Radeon HD 7850 2GB GDDR5 DVI-I/DVI-D/HDMI/DP)
 
 pci:v00001002d00006820*
- ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M]
+ ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X]
 
 pci:v00001002d00006820sv0000103Csd00001851*
- ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M] (Radeon HD 7750M)
+ ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X] (Radeon HD 7750M)
 
 pci:v00001002d00006820sv000017AAsd00003801*
- ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M] (Radeon R9 M275)
+ ID_MODEL_FROM_DATABASE=Venus XTX [Radeon HD 8890M / R9 M275X] (Radeon R9 M275)
 
 pci:v00001002d00006821*
- ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M]
+ ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X]
 
 pci:v00001002d00006821sv00001002sd0000031E*
- ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M] (FirePro SX4000)
+ ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X] (FirePro SX4000)
 
 pci:v00001002d00006821sv00001028sd000005CC*
- ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M] (FirePro M5100)
+ ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X] (FirePro M5100)
 
 pci:v00001002d00006821sv00001028sd000015CC*
- ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M] (FirePro M5100)
+ ID_MODEL_FROM_DATABASE=Venus XT [Radeon HD 8870M / R9 M270X] (FirePro M5100)
 
 pci:v00001002d00006822*
  ID_MODEL_FROM_DATABASE=Venus PRO [Radeon E8860]
 
 pci:v00001002d00006823*
- ID_MODEL_FROM_DATABASE=Venus PRO [Radeon HD 8850M]
+ ID_MODEL_FROM_DATABASE=Venus PRO [Radeon HD 8850M / R9 M265X]
 
 pci:v00001002d00006825*
  ID_MODEL_FROM_DATABASE=Heathrow XT [Radeon HD 7870M]
@@ -7770,64 +7776,73 @@ pci:v00001002d000068F9sv000017AFsd00003014*
  ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 5000/6000/7350/8350 Series] (Radeon HD 6350)
 
 pci:v00001002d000068FA*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350]
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220]
 
 pci:v00001002d000068FAsv00001019sd00000019*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001019sd00000021*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001019sd00000022*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001019sd00000026*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 8350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 8350)
 
 pci:v00001002d000068FAsv0000103Csd00002ADF*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350A)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350A)
 
 pci:v00001002d000068FAsv0000103Csd00002AE8*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350A)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350A)
 
 pci:v00001002d000068FAsv00001043sd00008350*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 8350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 8350)
 
 pci:v00001002d000068FAsv00001462sd00002128*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001462sd00002184*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001462sd00002186*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001462sd00002495*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001462sd0000B490*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv00001642sd00003985*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
+
+pci:v00001002d000068FAsv0000174Bsd00003510*
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 8350)
+
+pci:v00001002d000068FAsv0000174Bsd00003521*
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon R5 220)
+
+pci:v00001002d000068FAsv0000174Bsd00003522*
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon R5 220)
 
 pci:v00001002d000068FAsv0000174Bsd00007350*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv0000174Bsd00008153*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 8350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 8350)
 
 pci:v00001002d000068FAsv0000174Bsd0000E127*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv0000174Bsd0000E153*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv0000174Bsd0000E180*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FAsv000017AFsd00003015*
- ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350] (Radeon HD 7350)
+ ID_MODEL_FROM_DATABASE=Cedar [Radeon HD 7350/8350 / R5 220] (Radeon HD 7350)
 
 pci:v00001002d000068FE*
  ID_MODEL_FROM_DATABASE=Cedar LE
@@ -8886,7 +8901,7 @@ pci:v00001002d0000980A*
  ID_MODEL_FROM_DATABASE=Wrestler [Radeon HD 7290]
 
 pci:v00001002d00009830*
- ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8400]
+ ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8400 / R3 Series]
 
 pci:v00001002d00009831*
  ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8400E]
@@ -8904,13 +8919,13 @@ pci:v00001002d00009835*
  ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8310E]
 
 pci:v00001002d00009836*
- ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8280]
+ ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8280 / R3 Series]
 
 pci:v00001002d00009837*
  ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8280E]
 
 pci:v00001002d00009838*
- ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8240]
+ ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8240 / R3 Series]
 
 pci:v00001002d00009839*
  ID_MODEL_FROM_DATABASE=Kabini [Radeon HD 8180]
@@ -10724,6 +10739,33 @@ pci:v00001022d00001418*
 pci:v00001022d00001419*
  ID_MODEL_FROM_DATABASE=Family 15h (Models 10h-1fh) I/O Memory Management Unit
 
+pci:v00001022d0000141A*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 0
+
+pci:v00001022d0000141B*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 1
+
+pci:v00001022d0000141C*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 2
+
+pci:v00001022d0000141D*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 3
+
+pci:v00001022d0000141E*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 4
+
+pci:v00001022d0000141F*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Function 5
+
+pci:v00001022d00001422*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Root Complex
+
+pci:v00001022d00001423*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) I/O Memory Management Unit
+
+pci:v00001022d00001426*
+ ID_MODEL_FROM_DATABASE=Family 15h (Models 30h-3fh) Processor Root Port
+
 pci:v00001022d00001439*
  ID_MODEL_FROM_DATABASE=Family 16h Processor Functions 5:1
 
@@ -17621,6 +17663,9 @@ pci:v00001093d000071BC*
 pci:v00001093d000071D0*
  ID_MODEL_FROM_DATABASE=PXI-6143
 
+pci:v00001093d000071DC*
+ ID_MODEL_FROM_DATABASE=PCI-1588
+
 pci:v00001093d00007260*
  ID_MODEL_FROM_DATABASE=PXI-5142
 
@@ -17639,6 +17684,9 @@ pci:v00001093d000072AA*
 pci:v00001093d000072AB*
  ID_MODEL_FROM_DATABASE=PCI-5105
 
+pci:v00001093d000072B8*
+ ID_MODEL_FROM_DATABASE=PXI-6682
+
 pci:v00001093d0000730F*
  ID_MODEL_FROM_DATABASE=PXI-5922EX
 
@@ -17708,6 +17756,9 @@ pci:v00001093d000073F0*
 pci:v00001093d000073F1*
  ID_MODEL_FROM_DATABASE=PCI-5153
 
+pci:v00001093d00007405*
+ ID_MODEL_FROM_DATABASE=PXIe-6674T
+
 pci:v00001093d0000745E*
  ID_MODEL_FROM_DATABASE=PXI-5153EX
 
@@ -17726,6 +17777,12 @@ pci:v00001093d00007539*
 pci:v00001093d0000753A*
  ID_MODEL_FROM_DATABASE=NI 9159
 
+pci:v00001093d000075E5*
+ ID_MODEL_FROM_DATABASE=PXI-6683
+
+pci:v00001093d000075E6*
+ ID_MODEL_FROM_DATABASE=PXI-6683H
+
 pci:v00001093d00007626*
  ID_MODEL_FROM_DATABASE=NI 9154
 
@@ -28100,6 +28157,9 @@ pci:v000010EC*
 pci:v000010ECd00000139*
  ID_MODEL_FROM_DATABASE=RTL-8139/8139C/8139C+ Ethernet Controller
 
+pci:v000010ECd00005208*
+ ID_MODEL_FROM_DATABASE=RTS5208 PCI Express Card Reader
+
 pci:v000010ECd00005209*
  ID_MODEL_FROM_DATABASE=RTS5209 PCI Express Card Reader
 
@@ -28128,7 +28188,7 @@ pci:v000010ECd00005249sv0000103Csd00001909*
  ID_MODEL_FROM_DATABASE=RTS5249 PCI Express Card Reader (ZBook 15)
 
 pci:v000010ECd00005288*
- ID_MODEL_FROM_DATABASE=Barossa PCI Express Card Reader
+ ID_MODEL_FROM_DATABASE=RTS5288 PCI Express Card Reader
 
 pci:v000010ECd00008029*
  ID_MODEL_FROM_DATABASE=RTL-8029(AS)
@@ -32153,6 +32213,9 @@ pci:v00001131d00007160*
 pci:v00001131d00007160sv00001458sd00009009*
  ID_MODEL_FROM_DATABASE=SAA7160 (E8000 DVB-T/Analog TV/FM tuner)
 
+pci:v00001131d00007160sv00001461sd00001455*
+ ID_MODEL_FROM_DATABASE=SAA7160 (AVerTV Hybrid Speedy PCI-E (H788))
+
 pci:v00001131d00007162*
  ID_MODEL_FROM_DATABASE=SAA7162
 
@@ -34691,6 +34754,9 @@ pci:v000011ABd00002A42*
 pci:v000011ABd00002A43*
  ID_MODEL_FROM_DATABASE=88W8366 [TopDog] 802.11n Wireless
 
+pci:v000011ABd00002A55*
+ ID_MODEL_FROM_DATABASE=88W8864 [Avastar] 802.11ac Wireless
+
 pci:v000011ABd00002B36*
  ID_MODEL_FROM_DATABASE=88W8764 [Avastar] 802.11n Wireless
 
@@ -36536,6 +36602,9 @@ pci:v00001217d00008120*
 pci:v00001217d00008130*
  ID_MODEL_FROM_DATABASE=Integrated MS/MSPRO/xD Controller
 
+pci:v00001217d00008221*
+ ID_MODEL_FROM_DATABASE=SD/MMC Card Reader Controller
+
 pci:v00001217d00008320*
  ID_MODEL_FROM_DATABASE=OZ600 MMC/SD Controller
 
@@ -43278,7 +43347,13 @@ pci:v00001469*
  ID_VENDOR_FROM_DATABASE=Cleveland Motion Controls
 
 pci:v0000146A*
- ID_VENDOR_FROM_DATABASE=IFR
+ ID_VENDOR_FROM_DATABASE=Aeroflex
+
+pci:v0000146Ad00003010*
+ ID_MODEL_FROM_DATABASE=3010 RF Synthesizer
+
+pci:v0000146Ad00003A11*
+ ID_MODEL_FROM_DATABASE=3011A PXI RF Synthesizer
 
 pci:v0000146B*
  ID_VENDOR_FROM_DATABASE=Parascan Technologies Ltd
@@ -52409,6 +52484,9 @@ pci:v00001AB8d00004006*
 pci:v00001AB9*
  ID_VENDOR_FROM_DATABASE=Espia Srl
 
+pci:v00001AC8*
+ ID_VENDOR_FROM_DATABASE=Aeroflex Gaisler
+
 pci:v00001ACC*
  ID_VENDOR_FROM_DATABASE=Point of View BV
 
@@ -52724,9 +52802,15 @@ pci:v00001B4Bd000091A0*
 pci:v00001B4Bd000091A4*
  ID_MODEL_FROM_DATABASE=88SE912x IDE Controller
 
+pci:v00001B4Bd00009220*
+ ID_MODEL_FROM_DATABASE=88SE9220 PCIe 2.0 x2 2-port SATA 6 Gb/s RAID Controller
+
 pci:v00001B4Bd00009230*
  ID_MODEL_FROM_DATABASE=88SE9230 PCIe SATA 6Gb/s Controller
 
+pci:v00001B4Bd00009235*
+ ID_MODEL_FROM_DATABASE=88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller
+
 pci:v00001B4Bd00009445*
  ID_MODEL_FROM_DATABASE=88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller
 
@@ -54693,7 +54777,7 @@ pci:v00006688*
  ID_VENDOR_FROM_DATABASE=Zycoo Co., Ltd
 
 pci:v00006688d00001200*
- ID_MODEL_FROM_DATABASE=CooVOX TDM Analog Module
+ ID_MODEL_FROM_DATABASE=CooVox TDM Analog Module
 
 pci:v00006688d00001400*
  ID_MODEL_FROM_DATABASE=CooVOX TDM GSM Module
@@ -59066,8 +59150,11 @@ pci:v00008086d00001522sv00008086sd000000A4*
 pci:v00008086d00001523*
  ID_MODEL_FROM_DATABASE=I350 Gigabit Backplane Connection
 
+pci:v00008086d00001523sv00001028sd00000060*
+ ID_MODEL_FROM_DATABASE=I350 Gigabit Backplane Connection (Gigabit 2P I350 LOM)
+
 pci:v00008086d00001523sv00001028sd00001F9B*
- ID_MODEL_FROM_DATABASE=I350 Gigabit Backplane Connection (Gigabit 4P I350 bNDC)
+ ID_MODEL_FROM_DATABASE=I350 Gigabit Backplane Connection (Gigabit 4P I350-t bNDC)
 
 pci:v00008086d00001523sv0000103Csd00001784*
  ID_MODEL_FROM_DATABASE=I350 Gigabit Backplane Connection (Ethernet 1Gb 2-port 361FLB Adapter)
@@ -59183,9 +59270,6 @@ pci:v00008086d00001536*
 pci:v00008086d00001537*
  ID_MODEL_FROM_DATABASE=I210 Gigabit Backplane Connection
 
-pci:v00008086d00001538*
- ID_MODEL_FROM_DATABASE=I210 Gigabit Network Connection
-
 pci:v00008086d00001539*
  ID_MODEL_FROM_DATABASE=I211 Gigabit Network Connection
 
@@ -59270,6 +59354,12 @@ pci:v00008086d0000155Dsv00008086sd00000002*
 pci:v00008086d00001560*
  ID_MODEL_FROM_DATABASE=Ethernet Controller X540
 
+pci:v00008086d0000156F*
+ ID_MODEL_FROM_DATABASE=Ethernet Connection I219-LM
+
+pci:v00008086d00001570*
+ ID_MODEL_FROM_DATABASE=Ethernet Connection I219-V
+
 pci:v00008086d00001571*
  ID_MODEL_FROM_DATABASE=XL710 X710 Virtual Function
 
@@ -59316,16 +59406,16 @@ pci:v00008086d00001581sv00001028sd00001F98*
  ID_MODEL_FROM_DATABASE=Ethernet Controller X710 for 10Gbe backplane (Ethernet 10G 4P X710-k bNDC)
 
 pci:v00008086d00001583*
- ID_MODEL_FROM_DATABASE=Ethernet Controller LX710 for 40GbE QSFP+
+ ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+
 
 pci:v00008086d00001583sv00008086sd00000001*
- ID_MODEL_FROM_DATABASE=Ethernet Controller LX710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q2)
+ ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q2)
 
 pci:v00008086d00001583sv00008086sd00000002*
- ID_MODEL_FROM_DATABASE=Ethernet Controller LX710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q2)
+ ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q2)
 
 pci:v00008086d00001583sv00008086sd00000003*
- ID_MODEL_FROM_DATABASE=Ethernet Controller LX710 for 40GbE QSFP+ (Ethernet I/O Module XL710-Q2)
+ ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+ (Ethernet I/O Module XL710-Q2)
 
 pci:v00008086d00001584*
  ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+
diff --git a/hwdb/20-usb-vendor-model.hwdb b/hwdb/20-usb-vendor-model.hwdb
index 014c628..52586bc 100644
--- a/hwdb/20-usb-vendor-model.hwdb
+++ b/hwdb/20-usb-vendor-model.hwdb
@@ -21,7 +21,7 @@ usb:v0004*
  ID_VENDOR_FROM_DATABASE=Nebraska Furniture Mart
 
 usb:v0011*
- ID_VENDOR_FROM_DATABASE=Unknown manufacturer
+ ID_VENDOR_FROM_DATABASE=Unknown
 
 usb:v0011p7788*
  ID_MODEL_FROM_DATABASE=Flash mass storage drive
@@ -275,6 +275,9 @@ usb:v03EBp2110*
 usb:v03EBp2122*
  ID_MODEL_FROM_DATABASE=XMEGA-A1 Explained evaluation kit
 
+usb:v03EBp2141*
+ ID_MODEL_FROM_DATABASE=ICE debugger
+
 usb:v03EBp2310*
  ID_MODEL_FROM_DATABASE=EVK11xx evaluation board
 
@@ -455,6 +458,9 @@ usb:v03F0p0121*
 usb:v03F0p0122*
  ID_MODEL_FROM_DATABASE=HID Internet Keyboard
 
+usb:v03F0p0139*
+ ID_MODEL_FROM_DATABASE=Barcode Scanner 4430
+
 usb:v03F0p0201*
  ID_MODEL_FROM_DATABASE=ScanJet 6200c
 
@@ -782,6 +788,9 @@ usb:v03F0p1517*
 usb:v03F0p1524*
  ID_MODEL_FROM_DATABASE=Smart Card Keyboard - KR
 
+usb:v03F0p1539*
+ ID_MODEL_FROM_DATABASE=Mini Magnetic Stripe Reader
+
 usb:v03F0p1602*
  ID_MODEL_FROM_DATABASE=PhotoSmart 330 series
 
@@ -893,6 +902,9 @@ usb:v03F0p1D02*
 usb:v03F0p1D17*
  ID_MODEL_FROM_DATABASE=LaserJet 1320
 
+usb:v03F0p1D24*
+ ID_MODEL_FROM_DATABASE=Barcode scanner
+
 usb:v03F0p1E02*
  ID_MODEL_FROM_DATABASE=PhotoSmart A320 Printer series
 
@@ -935,6 +947,9 @@ usb:v03F0p2012*
 usb:v03F0p201D*
  ID_MODEL_FROM_DATABASE=un2400 Gobi Wireless Modem (QDL mode)
 
+usb:v03F0p2039*
+ ID_MODEL_FROM_DATABASE=Cashdrawer
+
 usb:v03F0p2102*
  ID_MODEL_FROM_DATABASE=PhotoSmart 7345
 
@@ -1008,7 +1023,7 @@ usb:v03F0p2505*
  ID_MODEL_FROM_DATABASE=ScanJet 3770
 
 usb:v03F0p2512*
- ID_MODEL_FROM_DATABASE=OfficeJet Pro L7300
+ ID_MODEL_FROM_DATABASE=OfficeJet Pro L7300 / Compaq LA2405 series monitor
 
 usb:v03F0p2514*
  ID_MODEL_FROM_DATABASE=4-port hub
@@ -1046,6 +1061,9 @@ usb:v03F0p2704*
 usb:v03F0p2717*
  ID_MODEL_FROM_DATABASE=Color LaserJet 2830
 
+usb:v03F0p2724*
+ ID_MODEL_FROM_DATABASE=Magnetic Stripe Reader IDRA-334133-HP
+
 usb:v03F0p2811*
  ID_MODEL_FROM_DATABASE=PSC-2100
 
@@ -1424,6 +1442,9 @@ usb:v03F0p5817*
 usb:v03F0p5911*
  ID_MODEL_FROM_DATABASE=PhotoSmart C6180
 
+usb:v03F0p5912*
+ ID_MODEL_FROM_DATABASE=Officejet Pro 8600
+
 usb:v03F0p5A11*
  ID_MODEL_FROM_DATABASE=PhotoSmart C7100 series
 
@@ -1532,6 +1553,9 @@ usb:v03F0p6B02*
 usb:v03F0p6B11*
  ID_MODEL_FROM_DATABASE=Photosmart C4500 series
 
+usb:v03F0p6C11*
+ ID_MODEL_FROM_DATABASE=Photosmart C4480
+
 usb:v03F0p6C17*
  ID_MODEL_FROM_DATABASE=Color LaserJet 4610
 
@@ -1913,6 +1937,9 @@ usb:v03FC*
 usb:v03FD*
  ID_VENDOR_FROM_DATABASE=Xilinx, Inc.
 
+usb:v03FDp0008*
+ ID_MODEL_FROM_DATABASE=Platform Cable USB II
+
 usb:v03FE*
  ID_VENDOR_FROM_DATABASE=Farallon Comunications
 
@@ -2012,6 +2039,9 @@ usb:v0403p0232*
 usb:v0403p1060*
  ID_MODEL_FROM_DATABASE=JTAG adapter
 
+usb:v0403p1234*
+ ID_MODEL_FROM_DATABASE=IronLogic RFID Adapter [Z-2 USB]
+
 usb:v0403p6001*
  ID_MODEL_FROM_DATABASE=FT232 USB-Serial (UART) IC
 
@@ -2084,12 +2114,18 @@ usb:v0403p8B2B*
 usb:v0403p8B2C*
  ID_MODEL_FROM_DATABASE=Alpermann+Velte TCC70
 
+usb:v0403p9132*
+ ID_MODEL_FROM_DATABASE=LCD and Temperature Interface
+
 usb:v0403p9133*
  ID_MODEL_FROM_DATABASE=CallerID
 
 usb:v0403p9135*
  ID_MODEL_FROM_DATABASE=Rotary Pub alarm
 
+usb:v0403p9136*
+ ID_MODEL_FROM_DATABASE=Pulsecounter
+
 usb:v0403p9E90*
  ID_MODEL_FROM_DATABASE=Marvell OpenRD Base/Client
 
@@ -2291,6 +2327,9 @@ usb:v0403pEF10*
 usb:v0403pF070*
  ID_MODEL_FROM_DATABASE=Serial Converter 422/485 [Vardaan VEUSB422R3]
 
+usb:v0403pF0E9*
+ ID_MODEL_FROM_DATABASE=Tagsys L-P101
+
 usb:v0403pF1A0*
  ID_MODEL_FROM_DATABASE=Asix PRESTO Programmer
 
@@ -2999,6 +3038,9 @@ usb:v040Ap4021*
 usb:v040Ap4022*
  ID_MODEL_FROM_DATABASE=1400 Digital Photo Printer
 
+usb:v040Ap402B*
+ ID_MODEL_FROM_DATABASE=Photo Printer 6850
+
 usb:v040Ap402E*
  ID_MODEL_FROM_DATABASE=605 Photo Printer
 
@@ -4379,6 +4421,9 @@ usb:v0424p7500*
 usb:v0424p9512*
  ID_MODEL_FROM_DATABASE=SMC9512/9514 USB Hub
 
+usb:v0424p9514*
+ ID_MODEL_FROM_DATABASE=SMC9514 Hub
+
 usb:v0424pA700*
  ID_MODEL_FROM_DATABASE=2 Port Hub
 
@@ -5219,6 +5264,9 @@ usb:v0451p2046*
 usb:v0451p2077*
  ID_MODEL_FROM_DATABASE=TUSB2077 Hub
 
+usb:v0451p2F90*
+ ID_MODEL_FROM_DATABASE=SM-USB-DIG
+
 usb:v0451p3410*
  ID_MODEL_FROM_DATABASE=TUSB3410 Microcontroller
 
@@ -5534,6 +5582,9 @@ usb:v0458p5003*
 usb:v0458p5004*
  ID_MODEL_FROM_DATABASE=G-pen Tablet
 
+usb:v0458p505E*
+ ID_MODEL_FROM_DATABASE=Genius iSlim 330
+
 usb:v0458p6001*
  ID_MODEL_FROM_DATABASE=GF3000F Ethernet Adapter
 
@@ -5600,6 +5651,24 @@ usb:v0458p705A*
 usb:v0458p705C*
  ID_MODEL_FROM_DATABASE=Genius iSlim 1300AF
 
+usb:v0458p7061*
+ ID_MODEL_FROM_DATABASE=Genius iLook 1321 V2
+
+usb:v0458p7066*
+ ID_MODEL_FROM_DATABASE=Acer Crystal Eye Webcam
+
+usb:v0458p7067*
+ ID_MODEL_FROM_DATABASE=Genius iSlim 1300AF V2
+
+usb:v0458p7068*
+ ID_MODEL_FROM_DATABASE=Genius eFace 1325R
+
+usb:v0458p706D*
+ ID_MODEL_FROM_DATABASE=Genius iSlim 2000AF V2
+
+usb:v0458p7076*
+ ID_MODEL_FROM_DATABASE=Genius FaceCam 312
+
 usb:v0458p7079*
  ID_MODEL_FROM_DATABASE=FaceCam 2025R
 
@@ -5609,6 +5678,12 @@ usb:v0458p707F*
 usb:v0458p7088*
  ID_MODEL_FROM_DATABASE=WideCam 1050
 
+usb:v0458p7089*
+ ID_MODEL_FROM_DATABASE=Genius FaceCam 320
+
+usb:v0458p708C*
+ ID_MODEL_FROM_DATABASE=Genius WideCam F100
+
 usb:v0459*
  ID_VENDOR_FROM_DATABASE=Adobe Systems, Inc.
 
@@ -6017,6 +6092,15 @@ usb:v045Ep02B0*
 usb:v045Ep02B6*
  ID_MODEL_FROM_DATABASE=Xbox 360 / Bluetooth Wireless Headset
 
+usb:v045Ep02BE*
+ ID_MODEL_FROM_DATABASE=Kinect for Windows NUI Audio
+
+usb:v045Ep02BF*
+ ID_MODEL_FROM_DATABASE=Kinect for Windows NUI Camera
+
+usb:v045Ep02C2*
+ ID_MODEL_FROM_DATABASE=Kinect for Windows NUI Motor
+
 usb:v045Ep0400*
  ID_MODEL_FROM_DATABASE=Windows Powered Pocket PC 2002
 
@@ -6866,6 +6950,9 @@ usb:v046Dp0830*
 usb:v046Dp0840*
  ID_MODEL_FROM_DATABASE=QuickCam Express
 
+usb:v046Dp0843*
+ ID_MODEL_FROM_DATABASE=Webcam C930e
+
 usb:v046Dp0850*
  ID_MODEL_FROM_DATABASE=QuickCam Web
 
@@ -7169,6 +7256,12 @@ usb:v046Dp0A1F*
 usb:v046Dp0A29*
  ID_MODEL_FROM_DATABASE=H600 [Wireless Headset]
 
+usb:v046Dp0A38*
+ ID_MODEL_FROM_DATABASE=Headset H340
+
+usb:v046Dp0A4D*
+ ID_MODEL_FROM_DATABASE=G430 Surround Sound Gaming Headset
+
 usb:v046Dp0B02*
  ID_MODEL_FROM_DATABASE=C-UV35 [Bluetooth Mini-Receiver] (HID proxy mode)
 
@@ -7650,7 +7743,7 @@ usb:v046DpC31B*
  ID_MODEL_FROM_DATABASE=Compact Keyboard K300
 
 usb:v046DpC31C*
- ID_MODEL_FROM_DATABASE=Keyboard K120 for Business
+ ID_MODEL_FROM_DATABASE=Keyboard K120
 
 usb:v046DpC31D*
  ID_MODEL_FROM_DATABASE=Media Keyboard K200
@@ -7751,6 +7844,9 @@ usb:v046DpC529*
 usb:v046DpC52B*
  ID_MODEL_FROM_DATABASE=Unifying Receiver
 
+usb:v046DpC52D*
+ ID_MODEL_FROM_DATABASE=R700 Remote Presenter receiver
+
 usb:v046DpC52E*
  ID_MODEL_FROM_DATABASE=MK260 Wireless Combo Receiver
 
@@ -7760,6 +7856,18 @@ usb:v046DpC52F*
 usb:v046DpC532*
  ID_MODEL_FROM_DATABASE=Unifying Receiver
 
+usb:v046DpC603*
+ ID_MODEL_FROM_DATABASE=3Dconnexion Spacemouse Plus XT
+
+usb:v046DpC605*
+ ID_MODEL_FROM_DATABASE=3Dconnexion CADman
+
+usb:v046DpC606*
+ ID_MODEL_FROM_DATABASE=3Dconnexion Spacemouse Classic
+
+usb:v046DpC621*
+ ID_MODEL_FROM_DATABASE=3Dconnexion Spaceball 5000
+
 usb:v046DpC623*
  ID_MODEL_FROM_DATABASE=3Dconnexion Space Traveller 3D Mouse
 
@@ -7772,9 +7880,18 @@ usb:v046DpC626*
 usb:v046DpC627*
  ID_MODEL_FROM_DATABASE=3Dconnexion Space Explorer 3D Mouse
 
+usb:v046DpC628*
+ ID_MODEL_FROM_DATABASE=3Dconnexion Space Navigator for Notebooks
+
 usb:v046DpC629*
  ID_MODEL_FROM_DATABASE=3Dconnexion SpacePilot Pro 3D Mouse
 
+usb:v046DpC62B*
+ ID_MODEL_FROM_DATABASE=3Dconnexion Space Mouse Pro
+
+usb:v046DpC640*
+ ID_MODEL_FROM_DATABASE=NuLOOQ navigator
+
 usb:v046DpC702*
  ID_MODEL_FROM_DATABASE=Cordless Presenter
 
@@ -8609,6 +8726,9 @@ usb:v0480p0011*
 usb:v0480p0014*
  ID_MODEL_FROM_DATABASE=InTouch Module
 
+usb:v0480p0100*
+ ID_MODEL_FROM_DATABASE=Stor.E Slim USB 3.0
+
 usb:v0480pA006*
  ID_MODEL_FROM_DATABASE=External Disk 1.5TB
 
@@ -10043,6 +10163,9 @@ usb:v04A9p2225*
 usb:v04A9p2228*
  ID_MODEL_FROM_DATABASE=CanoScan 4400F
 
+usb:v04A9p2229*
+ ID_MODEL_FROM_DATABASE=CanoScan 8600F
+
 usb:v04A9p2602*
  ID_MODEL_FROM_DATABASE=MultiPASS C555
 
@@ -10988,6 +11111,9 @@ usb:v04A9p3233*
 usb:v04A9p3234*
  ID_MODEL_FROM_DATABASE=PowerShot SX150 IS
 
+usb:v04A9p3235*
+ ID_MODEL_FROM_DATABASE=PowerShot ELPH 510 HS / IXUS 1100 HS
+
 usb:v04A9p3236*
  ID_MODEL_FROM_DATABASE=PowerShot S100
 
@@ -11057,12 +11183,18 @@ usb:v04A9p325B*
 usb:v04A9p325C*
  ID_MODEL_FROM_DATABASE=PowerShot SX500 IS
 
+usb:v04A9p325E*
+ ID_MODEL_FROM_DATABASE=PowerShot N
+
 usb:v04A9p325F*
  ID_MODEL_FROM_DATABASE=PowerShot SX280 HS
 
 usb:v04A9p3260*
  ID_MODEL_FROM_DATABASE=PowerShot SX270 HS
 
+usb:v04A9p3261*
+ ID_MODEL_FROM_DATABASE=PowerShot A3500 IS
+
 usb:v04A9p3262*
  ID_MODEL_FROM_DATABASE=PowerShot A2600
 
@@ -11087,6 +11219,15 @@ usb:v04A9p3277*
 usb:v04A9p327D*
  ID_MODEL_FROM_DATABASE=Powershot ELPH 115 IS / IXUS 132
 
+usb:v04A9p3288*
+ ID_MODEL_FROM_DATABASE=Powershot ELPH 135 / IXUS 145
+
+usb:v04A9p3289*
+ ID_MODEL_FROM_DATABASE=PowerShot ELPH 340 HS / IXUS 265 HS
+
+usb:v04A9p328A*
+ ID_MODEL_FROM_DATABASE=PowerShot ELPH 150 IS / IXUS 155
+
 usb:v04AA*
  ID_VENDOR_FROM_DATABASE=DaeWoo Telecom, Ltd
 
@@ -11471,6 +11612,9 @@ usb:v04B4p2050*
 usb:v04B4p2830*
  ID_MODEL_FROM_DATABASE=Opera1 DVB-S (cold state)
 
+usb:v04B4p4235*
+ ID_MODEL_FROM_DATABASE=Monitor 02 Driver
+
 usb:v04B4p4381*
  ID_MODEL_FROM_DATABASE=SCAPS USC-1 Scanner Controller
 
@@ -12407,6 +12551,9 @@ usb:v04C5p10AE*
 usb:v04C5p10AF*
  ID_MODEL_FROM_DATABASE=fi-4220C2
 
+usb:v04C5p10C7*
+ ID_MODEL_FROM_DATABASE=fi-60f scanner
+
 usb:v04C5p10E0*
  ID_MODEL_FROM_DATABASE=fi-5120c Scanner
 
@@ -12981,7 +13128,7 @@ usb:v04D9p2519*
  ID_MODEL_FROM_DATABASE=Shenzhen LogoTech 2.4GHz receiver
 
 usb:v04D9p2832*
- ID_MODEL_FROM_DATABASE=1channel Telephone line recorder
+ ID_MODEL_FROM_DATABASE=HT82A832R Audio MCU
 
 usb:v04D9p2834*
  ID_MODEL_FROM_DATABASE=HT82A834R Audio MCU
@@ -13070,6 +13217,9 @@ usb:v04DAp2374*
 usb:v04DAp2451*
  ID_MODEL_FROM_DATABASE=HDC-SD9
 
+usb:v04DAp245B*
+ ID_MODEL_FROM_DATABASE=HC-X920K (3MOS Full HD video camcorder)
+
 usb:v04DAp2497*
  ID_MODEL_FROM_DATABASE=HDC-TM700
 
@@ -13535,6 +13685,9 @@ usb:v04E8p1006*
 usb:v04E8p130C*
  ID_MODEL_FROM_DATABASE=NX100
 
+usb:v04E8p1F05*
+ ID_MODEL_FROM_DATABASE=S2 Portable [JMicron] (500GB)
+
 usb:v04E8p1F06*
  ID_MODEL_FROM_DATABASE=HX-MU064DA portable harddisk
 
@@ -13670,6 +13823,9 @@ usb:v04E8p3310*
 usb:v04E8p3315*
  ID_MODEL_FROM_DATABASE=ML-2540 Series Laser Printer
 
+usb:v04E8p331E*
+ ID_MODEL_FROM_DATABASE=M262x/M282x Xpress Series Laser Printer
+
 usb:v04E8p3409*
  ID_MODEL_FROM_DATABASE=SCX-4216F Scanner
 
@@ -13718,6 +13874,9 @@ usb:v04E8p3420*
 usb:v04E8p3426*
  ID_MODEL_FROM_DATABASE=SCX-4500 Laser Printer
 
+usb:v04E8p342D*
+ ID_MODEL_FROM_DATABASE=SCX-4x28 Series
+
 usb:v04E8p344F*
  ID_MODEL_FROM_DATABASE=SCX-3400 Series
 
@@ -14058,7 +14217,7 @@ usb:v04E8p685B*
  ID_MODEL_FROM_DATABASE=GT-I9100 Phone [Galaxy S II] (mass storage mode)
 
 usb:v04E8p685C*
- ID_MODEL_FROM_DATABASE=GT-I9250 Phone [Galaxy Nexus]
+ ID_MODEL_FROM_DATABASE=GT-I9250 Phone [Galaxy Nexus] (Mass storage mode)
 
 usb:v04E8p685D*
  ID_MODEL_FROM_DATABASE=GT-I9100 Phone [Galaxy S II] (Download mode)
@@ -14067,7 +14226,10 @@ usb:v04E8p685E*
  ID_MODEL_FROM_DATABASE=GT-I9100 / GT-C3350 Phones (USB Debugging mode)
 
 usb:v04E8p6860*
- ID_MODEL_FROM_DATABASE=GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1]
+ ID_MODEL_FROM_DATABASE=GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1] , GT-I9500 [Galaxy S 4]
+
+usb:v04E8p6863*
+ ID_MODEL_FROM_DATABASE=GT-I9500 [Galaxy S4] / GT-I9250 [Galaxy Nexus] (network tethering)
 
 usb:v04E8p6865*
  ID_MODEL_FROM_DATABASE=GT-I9300 Phone [Galaxy S III] (PTP mode)
@@ -14075,6 +14237,9 @@ usb:v04E8p6865*
 usb:v04E8p6866*
  ID_MODEL_FROM_DATABASE=GT-I9300 Phone [Galaxy S III] (debugging mode)
 
+usb:v04E8p6868*
+ ID_MODEL_FROM_DATABASE=Escape Composite driver for Android Phones: Modem+Diagnostic+ADB
+
 usb:v04E8p6875*
  ID_MODEL_FROM_DATABASE=GT-B3710 Standalone LTE device (Commercial)
 
@@ -14342,6 +14507,12 @@ usb:v04F2pB057*
 usb:v04F2pB059*
  ID_MODEL_FROM_DATABASE=CKF7037 HP webcam
 
+usb:v04F2pB064*
+ ID_MODEL_FROM_DATABASE=CNA7137 Integrated Webcam
+
+usb:v04F2pB070*
+ ID_MODEL_FROM_DATABASE=Camera
+
 usb:v04F2pB071*
  ID_MODEL_FROM_DATABASE=2.0M UVC Webcam / CNF7129
 
@@ -14411,6 +14582,9 @@ usb:v04F2pB2B0*
 usb:v04F2pB2B9*
  ID_MODEL_FROM_DATABASE=Lenovo Integrated Camera UVC
 
+usb:v04F2pB2DA*
+ ID_MODEL_FROM_DATABASE=thinkpad t430s camera
+
 usb:v04F2pB2EA*
  ID_MODEL_FROM_DATABASE=Integrated Camera [ThinkPad]
 
@@ -14420,6 +14594,9 @@ usb:v04F2pB330*
 usb:v04F2pB354*
  ID_MODEL_FROM_DATABASE=UVC 1.00 device HD UVC WebCam
 
+usb:v04F2pB394*
+ ID_MODEL_FROM_DATABASE=Integrated Camera
+
 usb:v04F3*
  ID_VENDOR_FROM_DATABASE=Elan Microelectronics Corp.
 
@@ -15038,6 +15215,9 @@ usb:v04F9p01EB*
 usb:v04F9p01F4*
  ID_MODEL_FROM_DATABASE=MFC-5890CN
 
+usb:v04F9p0217*
+ ID_MODEL_FROM_DATABASE=MFC-8480DN
+
 usb:v04F9p0223*
  ID_MODEL_FROM_DATABASE=DCP-365CN
 
@@ -15158,9 +15338,15 @@ usb:v04FCp5331*
 usb:v04FCp5360*
  ID_MODEL_FROM_DATABASE=Sunplus Generic Digital Camera
 
+usb:v04FCp5563*
+ ID_MODEL_FROM_DATABASE=Digital Media Player MP3/WMA [The Sharper Image]
+
 usb:v04FCp5720*
  ID_MODEL_FROM_DATABASE=Card Reader Driver
 
+usb:v04FCp6333*
+ ID_MODEL_FROM_DATABASE=Siri A9 UVC chipset
+
 usb:v04FCp7333*
  ID_MODEL_FROM_DATABASE=Finet Technology Palmpix DC-85
 
@@ -15239,6 +15425,18 @@ usb:v0502p3325*
 usb:v0502p3341*
  ID_MODEL_FROM_DATABASE=Iconia tablet A500
 
+usb:v0502p33C3*
+ ID_MODEL_FROM_DATABASE=Liquid Gallant Duo E350
+
+usb:v0502p33C4*
+ ID_MODEL_FROM_DATABASE=Liquid Gallant Duo E350 (debug mode)
+
+usb:v0502p33C7*
+ ID_MODEL_FROM_DATABASE=Liquid Gallant Duo E350 (USB tethering)
+
+usb:v0502p33C8*
+ ID_MODEL_FROM_DATABASE=Liquid Gallant Duo E350 (debug mode, USB tethering)
+
 usb:v0502pD001*
  ID_MODEL_FROM_DATABASE=Divio NW801/DVC-V6+ Digital Camera
 
@@ -15446,6 +15644,9 @@ usb:v050Dp0416*
 usb:v050Dp0551*
  ID_MODEL_FROM_DATABASE=F6C550-AVR UPS
 
+usb:v050Dp065A*
+ ID_MODEL_FROM_DATABASE=F8T065BF Mini Bluetooth 4.0 Adapter
+
 usb:v050Dp0706*
  ID_MODEL_FROM_DATABASE=2-N-1 7-Port Hub (Lower half)
 
@@ -15497,6 +15698,9 @@ usb:v050Dp2103*
 usb:v050Dp21F1*
  ID_MODEL_FROM_DATABASE=N300 WLAN N Adapter [ISY]
 
+usb:v050Dp21F2*
+ ID_MODEL_FROM_DATABASE=RTL8192CU 802.11n WLAN Adapter [ISY IWL 4000]
+
 usb:v050Dp258A*
  ID_MODEL_FROM_DATABASE=F5U258 Host to Host cable
 
@@ -15728,6 +15932,9 @@ usb:v0525p1200*
 usb:v0525p1265*
  ID_MODEL_FROM_DATABASE=File-backed Storage Gadget
 
+usb:v0525p3424*
+ ID_MODEL_FROM_DATABASE=Lumidigm Venus fingerprint sensor
+
 usb:v0525pA0F0*
  ID_MODEL_FROM_DATABASE=Cambridge Electronic Devices Power1401 mk 2
 
@@ -16655,6 +16862,9 @@ usb:v054Cp035B*
 usb:v054Cp035C*
  ID_MODEL_FROM_DATABASE=NWZ-A726/A728/A729
 
+usb:v054Cp035F*
+ ID_MODEL_FROM_DATABASE=UP-DR200 Photo Printer
+
 usb:v054Cp0382*
  ID_MODEL_FROM_DATABASE=Memory Stick PRO-HG Duo Adaptor (MSAC-UAH1)
 
@@ -16694,9 +16904,18 @@ usb:v054Cp0485*
 usb:v054Cp04CB*
  ID_MODEL_FROM_DATABASE=WALKMAN NWZ-E354
 
+usb:v054Cp0541*
+ ID_MODEL_FROM_DATABASE=DSC-HX100V [Cybershot Digital Still Camera]
+
+usb:v054Cp0689*
+ ID_MODEL_FROM_DATABASE=Walkman NWZ-B173F
+
 usb:v054Cp06BB*
  ID_MODEL_FROM_DATABASE=WALKMAN NWZ-F805
 
+usb:v054Cp088C*
+ ID_MODEL_FROM_DATABASE=Portable Headphone Amplifier
+
 usb:v054Cp1000*
  ID_MODEL_FROM_DATABASE=Wireless Buzz! Receiver
 
@@ -16721,6 +16940,12 @@ usb:v0550p0004*
 usb:v0550p0005*
  ID_MODEL_FROM_DATABASE=InkJet Color Printer
 
+usb:v0550p000B*
+ ID_MODEL_FROM_DATABASE=Workcentre 24
+
+usb:v0550p014E*
+ ID_MODEL_FROM_DATABASE=CM215b Printer
+
 usb:v0551*
  ID_VENDOR_FROM_DATABASE=CompuTrend Systems, Inc.
 
@@ -17306,6 +17531,9 @@ usb:v056Ap0069*
 usb:v056Ap0081*
  ID_MODEL_FROM_DATABASE=Graphire Wireless 6x8
 
+usb:v056Ap0084*
+ ID_MODEL_FROM_DATABASE=Wireless adapter for Bamboo tablets
+
 usb:v056Ap0090*
  ID_MODEL_FROM_DATABASE=TPC90
 
@@ -17372,6 +17600,9 @@ usb:v056Ap00D1*
 usb:v056Ap00D3*
  ID_MODEL_FROM_DATABASE=Bamboo Fun (CTH-661)
 
+usb:v056Ap00D4*
+ ID_MODEL_FROM_DATABASE=Bamboo Pen (CTL-460)
+
 usb:v056Ap00D6*
  ID_MODEL_FROM_DATABASE=Bamboo Pen & Touch (CTH-460)
 
@@ -17390,6 +17621,12 @@ usb:v056Ap00F6*
 usb:v056Ap00F8*
  ID_MODEL_FROM_DATABASE=Cintiq 24HD touch (DTH-2400) tablet
 
+usb:v056Ap0307*
+ ID_MODEL_FROM_DATABASE=Cintiq Companion Hybrid 13HD (DTH-A1300) tablet
+
+usb:v056Ap0309*
+ ID_MODEL_FROM_DATABASE=Cintiq Companion Hybrid 13HD (DTH-A1300) touchscreen
+
 usb:v056Ap0400*
  ID_MODEL_FROM_DATABASE=PenPartner 4x5
 
@@ -18719,6 +18956,9 @@ usb:v0586p341E*
 usb:v0586p341F*
  ID_MODEL_FROM_DATABASE=NWD2205 802.11n Wireless N Adapter [Realtek RTL8192CU]
 
+usb:v0586p3425*
+ ID_MODEL_FROM_DATABASE=NWD6505 802.11a/b/g/n/ac Wireless Adapter [MediaTek MT7610U]
+
 usb:v0586p343E*
  ID_MODEL_FROM_DATABASE=N220 802.11bgn Wireless Adapter
 
@@ -18737,9 +18977,15 @@ usb:v058A*
 usb:v058B*
  ID_VENDOR_FROM_DATABASE=Infineon Technologies
 
+usb:v058Bp0015*
+ ID_MODEL_FROM_DATABASE=Flash Loader utility
+
 usb:v058Bp001C*
  ID_MODEL_FROM_DATABASE=Flash Drive
 
+usb:v058Bp0041*
+ ID_MODEL_FROM_DATABASE=Flash Loader utility
+
 usb:v058C*
  ID_VENDOR_FROM_DATABASE=In Focus Systems
 
@@ -18855,7 +19101,7 @@ usb:v058Fp6366*
  ID_MODEL_FROM_DATABASE=Multi Flash Reader
 
 usb:v058Fp6377*
- ID_MODEL_FROM_DATABASE=Multimedia Card Reader
+ ID_MODEL_FROM_DATABASE=AU6375 4-LUN card reader
 
 usb:v058Fp6386*
  ID_MODEL_FROM_DATABASE=Memory Card
@@ -18926,12 +19172,18 @@ usb:v058Fp9510*
 usb:v058Fp9520*
  ID_MODEL_FROM_DATABASE=EMV Certified Smart Card Reader
 
+usb:v058Fp9540*
+ ID_MODEL_FROM_DATABASE=AU9540 Smartcard Reader
+
 usb:v058Fp9720*
  ID_MODEL_FROM_DATABASE=USB-Serial Adapter
 
 usb:v058FpA014*
  ID_MODEL_FROM_DATABASE=Asus Integrated Webcam
 
+usb:v058FpB002*
+ ID_MODEL_FROM_DATABASE=Acer Integrated Webcam
+
 usb:v0590*
  ID_VENDOR_FROM_DATABASE=Omron Corp.
 
@@ -18983,6 +19235,9 @@ usb:v0596p0002*
 usb:v0596p0500*
  ID_MODEL_FROM_DATABASE=PCT Multitouch HID Controller
 
+usb:v0596p0543*
+ ID_MODEL_FROM_DATABASE=DELL XPS touchscreen
+
 usb:v0597*
  ID_VENDOR_FROM_DATABASE=Trisignal Communications
 
@@ -19055,6 +19310,9 @@ usb:v059Bp0061*
 usb:v059Bp006D*
  ID_MODEL_FROM_DATABASE=HipZip MP3 Player
 
+usb:v059Bp0070*
+ ID_MODEL_FROM_DATABASE=eGo Portable Hard Drive
+
 usb:v059Bp007C*
  ID_MODEL_FROM_DATABASE=Ultra Max USB/1394
 
@@ -19163,9 +19421,15 @@ usb:v059Fp0323*
 usb:v059Fp0421*
  ID_MODEL_FROM_DATABASE=Big Disk G465
 
+usb:v059Fp0525*
+ ID_MODEL_FROM_DATABASE=BigDisk Extreme 500
+
 usb:v059Fp0641*
  ID_MODEL_FROM_DATABASE=Mobile Hard Drive
 
+usb:v059Fp0829*
+ ID_MODEL_FROM_DATABASE=BigDisk Extreme+
+
 usb:v059Fp100C*
  ID_MODEL_FROM_DATABASE=Rugged Triple Interface Mobile Hard Drive
 
@@ -19190,6 +19454,9 @@ usb:v059Fp1049*
 usb:v059Fp1052*
  ID_MODEL_FROM_DATABASE=P'9220 Mobile Drive
 
+usb:v059Fp1064*
+ ID_MODEL_FROM_DATABASE=Rugged 16 and 32 GB
+
 usb:v059FpA601*
  ID_MODEL_FROM_DATABASE=HardDrive
 
@@ -19464,7 +19731,7 @@ usb:v05ACp0225*
  ID_MODEL_FROM_DATABASE=Internal Keyboard/Trackpad (JIS)
 
 usb:v05ACp0229*
- ID_MODEL_FROM_DATABASE=Internal Keyboard/Trackpad (MacBook Pro) (ANSI)
+ ID_MODEL_FROM_DATABASE=Internal Keyboard/Trackpad (ANSI)
 
 usb:v05ACp022A*
  ID_MODEL_FROM_DATABASE=Internal Keyboard/Trackpad (MacBook Pro) (ISO)
@@ -19545,7 +19812,7 @@ usb:v05ACp0302*
  ID_MODEL_FROM_DATABASE=Optical Mouse [Fujitsu]
 
 usb:v05ACp0304*
- ID_MODEL_FROM_DATABASE=Optical USB Mouse [Mitsumi]
+ ID_MODEL_FROM_DATABASE=Mighty Mouse [Mitsumi, M1152]
 
 usb:v05ACp0306*
  ID_MODEL_FROM_DATABASE=Optical USB Mouse [Fujitsu]
@@ -19577,6 +19844,9 @@ usb:v05ACp1003*
 usb:v05ACp1006*
  ID_MODEL_FROM_DATABASE=Hub in Aluminum Keyboard
 
+usb:v05ACp1008*
+ ID_MODEL_FROM_DATABASE=Mini DisplayPort to Dual-Link DVI Adapter
+
 usb:v05ACp1101*
  ID_MODEL_FROM_DATABASE=Speakers
 
@@ -19670,6 +19940,9 @@ usb:v05ACp1265*
 usb:v05ACp1266*
  ID_MODEL_FROM_DATABASE=iPod Nano 6.Gen
 
+usb:v05ACp1267*
+ ID_MODEL_FROM_DATABASE=iPod Nano 7.Gen
+
 usb:v05ACp1281*
  ID_MODEL_FROM_DATABASE=Apple Mobile Device [Recovery Mode]
 
@@ -19700,6 +19973,9 @@ usb:v05ACp1299*
 usb:v05ACp129A*
  ID_MODEL_FROM_DATABASE=iPad
 
+usb:v05ACp129C*
+ ID_MODEL_FROM_DATABASE=iPhone 4(CDMA)
+
 usb:v05ACp129E*
  ID_MODEL_FROM_DATABASE=iPod Touch 4.Gen
 
@@ -19712,15 +19988,30 @@ usb:v05ACp12A0*
 usb:v05ACp12A2*
  ID_MODEL_FROM_DATABASE=iPad 2 (3G; 64GB)
 
+usb:v05ACp12A3*
+ ID_MODEL_FROM_DATABASE=iPad 2 (CDMA)
+
+usb:v05ACp12A4*
+ ID_MODEL_FROM_DATABASE=iPad 3 (wifi)
+
+usb:v05ACp12A5*
+ ID_MODEL_FROM_DATABASE=iPad 3 (CDMA)
+
 usb:v05ACp12A6*
  ID_MODEL_FROM_DATABASE=iPad 3 (3G, 16 GB)
 
+usb:v05ACp12A8*
+ ID_MODEL_FROM_DATABASE=iPhone5/5C/5S
+
 usb:v05ACp12A9*
  ID_MODEL_FROM_DATABASE=iPad 2
 
 usb:v05ACp12AA*
  ID_MODEL_FROM_DATABASE=iPod Touch 5.Gen [A1421]
 
+usb:v05ACp12AB*
+ ID_MODEL_FROM_DATABASE=iPad 4 (WiFi, 32GB)
+
 usb:v05ACp1300*
  ID_MODEL_FROM_DATABASE=iPod Shuffle
 
@@ -19742,6 +20033,15 @@ usb:v05ACp1402*
 usb:v05ACp1500*
  ID_MODEL_FROM_DATABASE=SuperDrive [A1379]
 
+usb:v05ACp8005*
+ ID_MODEL_FROM_DATABASE=OHCI Root Hub Simulation
+
+usb:v05ACp8006*
+ ID_MODEL_FROM_DATABASE=EHCI Root Hub Simulation
+
+usb:v05ACp8007*
+ ID_MODEL_FROM_DATABASE=XHCI Root Hub USB 2.0 Simulation
+
 usb:v05ACp8202*
  ID_MODEL_FROM_DATABASE=HCF V.90 Data/Fax Modem
 
@@ -19838,6 +20138,9 @@ usb:v05ACp8510*
 usb:v05ACp911C*
  ID_MODEL_FROM_DATABASE=Hub in A1082 [Cinema HD Display 23"]
 
+usb:v05ACp9127*
+ ID_MODEL_FROM_DATABASE=Hub in Thunderbolt Display
+
 usb:v05ACp912F*
  ID_MODEL_FROM_DATABASE=Hub in 30" Cinema Display
 
@@ -20042,6 +20345,9 @@ usb:v05C6p9202*
 usb:v05C6p9203*
  ID_MODEL_FROM_DATABASE=Gobi Wireless Modem
 
+usb:v05C6p9205*
+ ID_MODEL_FROM_DATABASE=Gobi 2000
+
 usb:v05C6p9211*
  ID_MODEL_FROM_DATABASE=Acer Gobi Wireless Modem (QDL mode)
 
@@ -20123,9 +20429,18 @@ usb:v05C8p021A*
 usb:v05C8p0318*
  ID_MODEL_FROM_DATABASE=Webcam
 
+usb:v05C8p0361*
+ ID_MODEL_FROM_DATABASE=SunplusIT INC. HP Truevision HD Webcam
+
+usb:v05C8p036E*
+ ID_MODEL_FROM_DATABASE=Webcam
+
 usb:v05C8p0403*
  ID_MODEL_FROM_DATABASE=Webcam
 
+usb:v05C8p041B*
+ ID_MODEL_FROM_DATABASE=HP 2.0MP High Definition Webcam
+
 usb:v05C9*
  ID_VENDOR_FROM_DATABASE=Semtech Corp.
 
@@ -20861,6 +21176,9 @@ usb:v05DCp4D12*
 usb:v05DCp4D30*
  ID_MODEL_FROM_DATABASE=MP3 Player
 
+usb:v05DCpA209*
+ ID_MODEL_FROM_DATABASE=JumpDrive S70
+
 usb:v05DCpA300*
  ID_MODEL_FROM_DATABASE=JumpDrive2
 
@@ -20921,6 +21239,9 @@ usb:v05DCpA701*
 usb:v05DCpA731*
  ID_MODEL_FROM_DATABASE=JumpDrive FireFly
 
+usb:v05DCpA768*
+ ID_MODEL_FROM_DATABASE=JumpDrive Retrax
+
 usb:v05DCpA790*
  ID_MODEL_FROM_DATABASE=JumpDrive 2GB
 
@@ -20930,6 +21251,9 @@ usb:v05DCpA811*
 usb:v05DCpA813*
  ID_MODEL_FROM_DATABASE=16gB flash thumb drive
 
+usb:v05DCpA815*
+ ID_MODEL_FROM_DATABASE=JumpDrive V10
+
 usb:v05DCpB002*
  ID_MODEL_FROM_DATABASE=USB CF Reader
 
@@ -20939,6 +21263,9 @@ usb:v05DCpB018*
 usb:v05DCpB047*
  ID_MODEL_FROM_DATABASE=SDHC Reader [RW047-7000]
 
+usb:v05DCpBA02*
+ ID_MODEL_FROM_DATABASE=Workflow CFR1
+
 usb:v05DCpC753*
  ID_MODEL_FROM_DATABASE=JumpDrive TwistTurn
 
@@ -21084,7 +21411,7 @@ usb:v05E3p0607*
  ID_MODEL_FROM_DATABASE=Logitech G110 Hub
 
 usb:v05E3p0608*
- ID_MODEL_FROM_DATABASE=USB-2.0 4-Port HUB
+ ID_MODEL_FROM_DATABASE=Hub
 
 usb:v05E3p0610*
  ID_MODEL_FROM_DATABASE=4-port hub
@@ -21158,6 +21485,9 @@ usb:v05E3p0718*
 usb:v05E3p0719*
  ID_MODEL_FROM_DATABASE=SATA adapter
 
+usb:v05E3p0722*
+ ID_MODEL_FROM_DATABASE=SD/MMC card reader
+
 usb:v05E3p0723*
  ID_MODEL_FROM_DATABASE=GL827L SD/MMC/MS Flash Card Reader
 
@@ -21170,9 +21500,18 @@ usb:v05E3p0727*
 usb:v05E3p0731*
  ID_MODEL_FROM_DATABASE=GL3310 SATA 3Gb/s Bridge Controller
 
+usb:v05E3p0732*
+ ID_MODEL_FROM_DATABASE=All-in-One Cardreader
+
 usb:v05E3p0736*
  ID_MODEL_FROM_DATABASE=microSD Reader/Writer
 
+usb:v05E3p0741*
+ ID_MODEL_FROM_DATABASE=microSD Card Reader
+
+usb:v05E3p0743*
+ ID_MODEL_FROM_DATABASE=SDXC and microSDXC CardReader
+
 usb:v05E3p0760*
  ID_MODEL_FROM_DATABASE=USB 2.0 Card Reader/Writer
 
@@ -21296,6 +21635,9 @@ usb:v05F3p0081*
 usb:v05F3p00FF*
  ID_MODEL_FROM_DATABASE=VEC Footpedal
 
+usb:v05F3p0203*
+ ID_MODEL_FROM_DATABASE=Y-mouse Keyboard & Mouse Adapter
+
 usb:v05F3p020B*
  ID_MODEL_FROM_DATABASE=PS2 Adapter
 
@@ -21410,6 +21752,9 @@ usb:v05FEp0014*
 usb:v05FEp1010*
  ID_MODEL_FROM_DATABASE=Optical Wireless
 
+usb:v05FEp2001*
+ ID_MODEL_FROM_DATABASE=Microsoft Wireless Receiver 700
+
 usb:v05FF*
  ID_VENDOR_FROM_DATABASE=LeCroy Corp.
 
@@ -21434,6 +21779,9 @@ usb:v0603*
 usb:v0603p00F1*
  ID_MODEL_FROM_DATABASE=Keyboard
 
+usb:v0603p00F2*
+ ID_MODEL_FROM_DATABASE=Keyboard (Labtec Ultra Flat Keyboard)
+
 usb:v0603p6871*
  ID_MODEL_FROM_DATABASE=Mouse
 
@@ -21491,6 +21839,9 @@ usb:v060Bp2231*
 usb:v060Bp2270*
  ID_MODEL_FROM_DATABASE=Gigabyte K8100 Aivia Gaming Keyboard
 
+usb:v060Bp5253*
+ ID_MODEL_FROM_DATABASE=Thermaltake MEKA G-Unit Gaming Keyboard
+
 usb:v060Bp5811*
  ID_MODEL_FROM_DATABASE=ACK-571U Wireless Keyboard
 
@@ -21911,6 +22262,9 @@ usb:v064EpA110*
 usb:v064EpA114*
  ID_MODEL_FROM_DATABASE=Lemote Webcam
 
+usb:v064EpA116*
+ ID_MODEL_FROM_DATABASE=UVC 1.3MPixel WebCam
+
 usb:v064EpA136*
  ID_MODEL_FROM_DATABASE=Asus Integrated Webcam [CN031B]
 
@@ -22893,7 +23247,7 @@ usb:v068Ep00F4*
  ID_MODEL_FROM_DATABASE=Combatstick
 
 usb:v068Ep00FA*
- ID_MODEL_FROM_DATABASE=Flight Sim Pedals
+ ID_MODEL_FROM_DATABASE=Ch Throttle Quadrant
 
 usb:v068Ep00FF*
  ID_MODEL_FROM_DATABASE=Flight Sim Yoke
@@ -22955,6 +23309,9 @@ usb:v0698p9999*
 usb:v0699*
  ID_VENDOR_FROM_DATABASE=Tektronix, Inc.
 
+usb:v0699p0347*
+ ID_MODEL_FROM_DATABASE=AFG 3022B
+
 usb:v069A*
  ID_VENDOR_FROM_DATABASE=Askey Computer Corp.
 
@@ -23486,6 +23843,9 @@ usb:v06C2*
 usb:v06C2p0030*
  ID_MODEL_FROM_DATABASE=PhidgetRFID
 
+usb:v06C2p0031*
+ ID_MODEL_FROM_DATABASE=RFID reader
+
 usb:v06C2p0038*
  ID_MODEL_FROM_DATABASE=4-Motor PhidgetServo v3.0
 
@@ -23789,6 +24149,12 @@ usb:v06D3p0394*
 usb:v06D3p03A1*
  ID_MODEL_FROM_DATABASE=CP9550D/DW Port
 
+usb:v06D3p3B30*
+ ID_MODEL_FROM_DATABASE=CP-D70DW / CP-D707DW
+
+usb:v06D3p3B31*
+ ID_MODEL_FROM_DATABASE=CP-K60DW-S
+
 usb:v06D4*
  ID_VENDOR_FROM_DATABASE=Cisco Systems
 
@@ -24575,6 +24941,9 @@ usb:v072Fp1000*
 usb:v072Fp1001*
  ID_MODEL_FROM_DATABASE=PLDT Drive
 
+usb:v072Fp2200*
+ ID_MODEL_FROM_DATABASE=ACR122U
+
 usb:v072Fp8002*
  ID_MODEL_FROM_DATABASE=AET63 BioTRUSTKey
 
@@ -25046,6 +25415,12 @@ usb:v0765*
 usb:v0765p5001*
  ID_MODEL_FROM_DATABASE=Huey PRO Colorimeter
 
+usb:v0765p5020*
+ ID_MODEL_FROM_DATABASE=i1 Display Pro
+
+usb:v0765p6003*
+ ID_MODEL_FROM_DATABASE=ColorMunki Smile
+
 usb:v0765pD094*
  ID_MODEL_FROM_DATABASE=X-Rite DTP94 [Quato Silver Haze Pro]
 
@@ -25325,12 +25700,24 @@ usb:v0781p5530*
 usb:v0781p5567*
  ID_MODEL_FROM_DATABASE=Cruzer Blade
 
+usb:v0781p556C*
+ ID_MODEL_FROM_DATABASE=Ultra
+
+usb:v0781p556D*
+ ID_MODEL_FROM_DATABASE=Memory Vault
+
 usb:v0781p5571*
  ID_MODEL_FROM_DATABASE=Cruzer Fit
 
+usb:v0781p5576*
+ ID_MODEL_FROM_DATABASE=Cruzer Facet
+
 usb:v0781p5580*
  ID_MODEL_FROM_DATABASE=SDCZ80 Flash Drive
 
+usb:v0781p5581*
+ ID_MODEL_FROM_DATABASE=Ultra
+
 usb:v0781p5E10*
  ID_MODEL_FROM_DATABASE=Encrypted
 
@@ -25830,7 +26217,7 @@ usb:v07AAp001A*
  ID_MODEL_FROM_DATABASE=ULUSB-11 Key
 
 usb:v07AAp001C*
- ID_MODEL_FROM_DATABASE=CG-WLUSB2GTST 802.11g Wireless Adapter [Intersil ISL3887]
+ ID_MODEL_FROM_DATABASE=CG-WLUSB2GT 802.11g Wireless Adapter [Intersil ISL3880]
 
 usb:v07AAp002E*
  ID_MODEL_FROM_DATABASE=CG-WLUSB2GPX [Ralink RT2571W]
@@ -26114,6 +26501,9 @@ usb:v07B4p0114*
 usb:v07B4p0118*
  ID_MODEL_FROM_DATABASE=Mju Mini Digital/Mju Digital 500 Camera / Stylus 850 SW
 
+usb:v07B4p0125*
+ ID_MODEL_FROM_DATABASE=Tough TG-1 Camera
+
 usb:v07B4p0184*
  ID_MODEL_FROM_DATABASE=P-S100 port
 
@@ -26441,6 +26831,9 @@ usb:v07C4pA400*
 usb:v07C4pA600*
  ID_MODEL_FROM_DATABASE=Card Reader
 
+usb:v07C4pA604*
+ ID_MODEL_FROM_DATABASE=12-in-1 Card Reader
+
 usb:v07C4pAD01*
  ID_MODEL_FROM_DATABASE=Mass Storage Device
 
@@ -26474,6 +26867,9 @@ usb:v07C4pC010*
 usb:v07C5*
  ID_VENDOR_FROM_DATABASE=APG Cash Drawer
 
+usb:v07C5p0500*
+ ID_MODEL_FROM_DATABASE=Cash Drawer
+
 usb:v07C6*
  ID_VENDOR_FROM_DATABASE=ShareWave, Inc.
 
@@ -27140,6 +27536,9 @@ usb:v0803*
 usb:v0803p1300*
  ID_MODEL_FROM_DATABASE=V92 Faxmodem
 
+usb:v0803p3095*
+ ID_MODEL_FROM_DATABASE=V.92 56K Mini External Modem Model 3095
+
 usb:v0803p4310*
  ID_MODEL_FROM_DATABASE=4410a Wireless-G Adapter [Intersil ISL3887]
 
@@ -27713,6 +28112,9 @@ usb:v0846p9018*
 usb:v0846p9020*
  ID_MODEL_FROM_DATABASE=WNA3100(v1) Wireless-N 300 [Broadcom BCM43231]
 
+usb:v0846p9021*
+ ID_MODEL_FROM_DATABASE=WNA3100M(v1) Wireless-N 300 [Realtek RTL8192CU]
+
 usb:v0846p9030*
  ID_MODEL_FROM_DATABASE=WNA1100 Wireless-N 150 [Atheros AR9271]
 
@@ -27722,9 +28124,21 @@ usb:v0846p9040*
 usb:v0846p9041*
  ID_MODEL_FROM_DATABASE=WNA1000M 802.11bgn [Realtek RTL8188CUS]
 
+usb:v0846p9042*
+ ID_MODEL_FROM_DATABASE=On Networks N150MA 802.11bgn [Realtek RTL8188CUS]
+
+usb:v0846p9050*
+ ID_MODEL_FROM_DATABASE=A6200 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]
+
+usb:v0846p9052*
+ ID_MODEL_FROM_DATABASE=A6100 AC600 DB Wireless Adapter [Realtek RTL8811AU]
+
 usb:v0846pA001*
  ID_MODEL_FROM_DATABASE=PA101 10 Mbps HPNA Home Phoneline RJ-1
 
+usb:v0846pF001*
+ ID_MODEL_FROM_DATABASE=On Networks N300MA 802.11bgn [Realtek RTL8192CU]
+
 usb:v084D*
  ID_VENDOR_FROM_DATABASE=Minton Optic Industry Co., Inc.
 
@@ -27875,8 +28289,17 @@ usb:v085Ap8027*
 usb:v085C*
  ID_VENDOR_FROM_DATABASE=ColorVision, Inc.
 
+usb:v085Cp0100*
+ ID_MODEL_FROM_DATABASE=Spyder 1
+
 usb:v085Cp0200*
- ID_MODEL_FROM_DATABASE=Monitor Spyder
+ ID_MODEL_FROM_DATABASE=Spyder 2
+
+usb:v085Cp0300*
+ ID_MODEL_FROM_DATABASE=Spyder 3
+
+usb:v085Cp0400*
+ ID_MODEL_FROM_DATABASE=Spyder 4
 
 usb:v0862*
  ID_VENDOR_FROM_DATABASE=Teletrol Systems, Inc.
@@ -28127,6 +28550,12 @@ usb:v0892*
 usb:v0892p0101*
  ID_MODEL_FROM_DATABASE=Smartdio Reader/Writer
 
+usb:v0894*
+ ID_VENDOR_FROM_DATABASE=TSI Incorporated
+
+usb:v0894p0010*
+ ID_MODEL_FROM_DATABASE=Remote NDIS Network Device
+
 usb:v0897*
  ID_VENDOR_FROM_DATABASE=Lauterbach
 
@@ -28181,6 +28610,18 @@ usb:v08A9p0015*
 usb:v08AE*
  ID_VENDOR_FROM_DATABASE=Macally (Mace Group, Inc.)
 
+usb:v08B0*
+ ID_VENDOR_FROM_DATABASE=Metrohm
+
+usb:v08B0p0006*
+ ID_MODEL_FROM_DATABASE=814 Sample Processor
+
+usb:v08B0p0015*
+ ID_MODEL_FROM_DATABASE=857 Titrando
+
+usb:v08B0p001A*
+ ID_MODEL_FROM_DATABASE=852 Titrando
+
 usb:v08B4*
  ID_VENDOR_FROM_DATABASE=Sorenson Vision, Inc.
 
@@ -29036,6 +29477,12 @@ usb:v0906*
 usb:v0908*
  ID_VENDOR_FROM_DATABASE=Siemens AG
 
+usb:v0908p01F4*
+ ID_MODEL_FROM_DATABASE=SIMATIC NET CP 5711
+
+usb:v0908p01FE*
+ ID_MODEL_FROM_DATABASE=SIMATIC NET PC Adapter A2
+
 usb:v0908p2701*
  ID_MODEL_FROM_DATABASE=ShenZhen SANZHAI Technology Co.,Ltd Spy Pen VGA
 
@@ -29285,12 +29732,18 @@ usb:v091Ep23CC*
 usb:v091Ep2459*
  ID_MODEL_FROM_DATABASE=GPSmap 62/78 series
 
+usb:v091Ep2491*
+ ID_MODEL_FROM_DATABASE=Edge 800
+
 usb:v091Ep2519*
  ID_MODEL_FROM_DATABASE=eTrex 30
 
 usb:v091Ep2535*
  ID_MODEL_FROM_DATABASE=Edge 800
 
+usb:v091Ep253C*
+ ID_MODEL_FROM_DATABASE=GPSmap 62sc
+
 usb:v091Ep255B*
  ID_MODEL_FROM_DATABASE=Nuvi 2505LM
 
@@ -29315,12 +29768,18 @@ usb:v0922p0007*
 usb:v0922p0009*
  ID_MODEL_FROM_DATABASE=LabelWriter 310
 
+usb:v0922p0019*
+ ID_MODEL_FROM_DATABASE=LabelWriter 400
+
 usb:v0922p001A*
  ID_MODEL_FROM_DATABASE=LabelWriter 400 Turbo
 
 usb:v0922p0020*
  ID_MODEL_FROM_DATABASE=LabelWriter 450
 
+usb:v0922p1001*
+ ID_MODEL_FROM_DATABASE=LabelManager PnP
+
 usb:v0923*
  ID_VENDOR_FROM_DATABASE=IC Media Corp.
 
@@ -29363,6 +29822,9 @@ usb:v0925*
 usb:v0925p0005*
  ID_MODEL_FROM_DATABASE=Gamtec.,Ltd SmartJoy PLUS Adapter
 
+usb:v0925p03E8*
+ ID_MODEL_FROM_DATABASE=Wii Classic Controller Adapter
+
 usb:v0925p3881*
  ID_MODEL_FROM_DATABASE=Saleae Logic
 
@@ -29417,6 +29879,9 @@ usb:v0930p000C*
 usb:v0930p0010*
  ID_MODEL_FROM_DATABASE=Gigabeat S (mtp)
 
+usb:v0930p0200*
+ ID_MODEL_FROM_DATABASE=Integrated Bluetooth (Taiyo Yuden)
+
 usb:v0930p0301*
  ID_MODEL_FROM_DATABASE=PCX1100U Cable Modem (WDM)
 
@@ -29483,6 +29948,9 @@ usb:v0930p070B*
 usb:v0930p0A07*
  ID_MODEL_FROM_DATABASE=WLM-10U1 802.11abgn Wireless Adapter [Ralink RT3572]
 
+usb:v0930p0A13*
+ ID_MODEL_FROM_DATABASE=AX88179 Gigabit Ethernet [Toshiba]
+
 usb:v0930p0B05*
  ID_MODEL_FROM_DATABASE=PX1220E-1G25 External hard drive
 
@@ -29691,7 +30159,7 @@ usb:v0939*
  ID_VENDOR_FROM_DATABASE=Lumberg, Inc.
 
 usb:v0939p0B15*
- ID_MODEL_FROM_DATABASE=Toshiba Stor.E Alu 2 1TB (PX1710E-1HJ0)
+ ID_MODEL_FROM_DATABASE=Toshiba Stor.E Alu 2
 
 usb:v093A*
  ID_VENDOR_FROM_DATABASE=Pixart Imaging, Inc.
@@ -29753,6 +30221,9 @@ usb:v093Ap260F*
 usb:v093Ap2621*
  ID_MODEL_FROM_DATABASE=PAC731x Trust Webcam
 
+usb:v093Ap2622*
+ ID_MODEL_FROM_DATABASE=Webcam Genius
+
 usb:v093Ap2624*
  ID_MODEL_FROM_DATABASE=Webcam
 
@@ -29951,6 +30422,9 @@ usb:v0951p1653*
 usb:v0951p1656*
  ID_MODEL_FROM_DATABASE=DataTraveler Ultimate G2
 
+usb:v0951p1665*
+ ID_MODEL_FROM_DATABASE=Digital DataTraveler SE9 64GB
+
 usb:v0951p1689*
  ID_MODEL_FROM_DATABASE=DataTraveler SE9
 
@@ -29993,6 +30467,9 @@ usb:v0957p0200*
 usb:v0957p0202*
  ID_MODEL_FROM_DATABASE=E-Video DC-350 Camera
 
+usb:v0957p0407*
+ ID_MODEL_FROM_DATABASE=33220A Waveform Generator
+
 usb:v0957p0518*
  ID_MODEL_FROM_DATABASE=82357B GPIB Interface
 
@@ -30033,7 +30510,7 @@ usb:v095Dp0001*
  ID_MODEL_FROM_DATABASE=Polycom ViaVideo
 
 usb:v0967*
- ID_VENDOR_FROM_DATABASE=Acer (??)
+ ID_VENDOR_FROM_DATABASE=Acer NeWeb Corp.
 
 usb:v0967p0204*
  ID_MODEL_FROM_DATABASE=WarpLink 802.11b Adapter
@@ -30056,6 +30533,12 @@ usb:v096Ep0807*
 usb:v0971*
  ID_VENDOR_FROM_DATABASE=Gretag-Macbeth AG
 
+usb:v0971p2000*
+ ID_MODEL_FROM_DATABASE=i1 Pro
+
+usb:v0971p2001*
+ ID_MODEL_FROM_DATABASE=i1 Monitor
+
 usb:v0971p2003*
  ID_MODEL_FROM_DATABASE=Eye-One display
 
@@ -30063,7 +30546,7 @@ usb:v0971p2005*
  ID_MODEL_FROM_DATABASE=Huey
 
 usb:v0971p2007*
- ID_MODEL_FROM_DATABASE=ColorMunki
+ ID_MODEL_FROM_DATABASE=ColorMunki Photo
 
 usb:v0973*
  ID_VENDOR_FROM_DATABASE=Schlumberger
@@ -30182,6 +30665,9 @@ usb:v099Ap0638*
 usb:v099Ap610C*
  ID_MODEL_FROM_DATABASE=EL-610 Super Mini Electron luminescent Keyboard
 
+usb:v099Ap713A*
+ ID_MODEL_FROM_DATABASE=WK-713 Multimedia Keyboard
+
 usb:v099Ap7160*
  ID_MODEL_FROM_DATABASE=Hyper Slim Keyboard
 
@@ -30375,7 +30861,10 @@ usb:v09D3*
  ID_VENDOR_FROM_DATABASE=Com One
 
 usb:v09D3p0001*
- ID_MODEL_FROM_DATABASE=ISDN TA
+ ID_MODEL_FROM_DATABASE=ISDN TA / Light Rider 128K
+
+usb:v09D3p000B*
+ ID_MODEL_FROM_DATABASE=Bluetooth Adapter class 1 [BlueLight]
 
 usb:v09D7*
  ID_VENDOR_FROM_DATABASE=Novatel Wireless
@@ -30596,6 +31085,12 @@ usb:v0A07p00DA*
 usb:v0A0B*
  ID_VENDOR_FROM_DATABASE=Cybex Computer Products Co.
 
+usb:v0A0D*
+ ID_VENDOR_FROM_DATABASE=Servergy, Inc
+
+usb:v0A0Dp2514*
+ ID_MODEL_FROM_DATABASE=CTS-1000 Internal Hub
+
 usb:v0A11*
  ID_VENDOR_FROM_DATABASE=Xentec, Inc.
 
@@ -30887,6 +31382,9 @@ usb:v0A48p5024*
 usb:v0A48p5025*
  ID_MODEL_FROM_DATABASE=Mass Storage Device
 
+usb:v0A4A*
+ ID_VENDOR_FROM_DATABASE=Ploytec GmbH
+
 usb:v0A4B*
  ID_VENDOR_FROM_DATABASE=Fujitsu Media Devices, Ltd
 
@@ -31217,6 +31715,9 @@ usb:v0A5CpBD11*
 usb:v0A5CpBD13*
  ID_MODEL_FROM_DATABASE=BCM4323 802.11abgn Wireless Adapter
 
+usb:v0A5CpBD16*
+ ID_MODEL_FROM_DATABASE=BCM4319 802.11bgn Wireless Adapter
+
 usb:v0A5CpBD17*
  ID_MODEL_FROM_DATABASE=BCM43236 802.11abgn Wireless Adapter
 
@@ -31775,6 +32276,9 @@ usb:v0AC8pC33F*
 usb:v0AC8pC429*
  ID_MODEL_FROM_DATABASE=Lenovo ThinkCentre Web Camera
 
+usb:v0AC8pC42D*
+ ID_MODEL_FROM_DATABASE=Lenovo IdeaCentre Web Camera
+
 usb:v0AC9*
  ID_VENDOR_FROM_DATABASE=Micro Solutions, Inc.
 
@@ -31823,6 +32327,9 @@ usb:v0ACDp0630*
 usb:v0ACDp0810*
  ID_MODEL_FROM_DATABASE=SecurePIN (IDPA-506100Y) PIN Pad
 
+usb:v0ACDp2030*
+ ID_MODEL_FROM_DATABASE=ValueMag Magnetic Stripe Reader
+
 usb:v0ACE*
  ID_VENDOR_FROM_DATABASE=ZyDAS
 
@@ -32024,6 +32531,12 @@ usb:v0AF9p0010*
 usb:v0AF9p0011*
  ID_MODEL_FROM_DATABASE=Micro Innovations IC50C Webcam
 
+usb:v0AFA*
+ ID_VENDOR_FROM_DATABASE=DMC Co., Ltd.
+
+usb:v0AFAp07D2*
+ ID_MODEL_FROM_DATABASE=Controller Board for Projected Capacitive Touch Screen DUS3000
+
 usb:v0AFC*
  ID_VENDOR_FROM_DATABASE=Zaptronix Ltd
 
@@ -32042,6 +32555,9 @@ usb:v0B00*
 usb:v0B05*
  ID_VENDOR_FROM_DATABASE=ASUSTek Computer, Inc.
 
+usb:v0B05p0001*
+ ID_MODEL_FROM_DATABASE=MeMO Pad HD 7 (CD-ROM mode)
+
 usb:v0B05p1101*
  ID_MODEL_FROM_DATABASE=Mass Storage (UISDMC4S)
 
@@ -32147,6 +32663,9 @@ usb:v0B05p1784*
 usb:v0B05p1786*
  ID_MODEL_FROM_DATABASE=USB-N10 802.11n Network Adapter [Realtek RTL8188SU]
 
+usb:v0B05p1788*
+ ID_MODEL_FROM_DATABASE=BT-270 Bluetooth Adapter
+
 usb:v0B05p1791*
  ID_MODEL_FROM_DATABASE=WL-167G v3 802.11n Adapter [Realtek RTL8188SU]
 
@@ -32159,12 +32678,18 @@ usb:v0B05p179E*
 usb:v0B05p179F*
  ID_MODEL_FROM_DATABASE=Eee Note EA800 (tablet mode)
 
+usb:v0B05p17A0*
+ ID_MODEL_FROM_DATABASE=Xonar U3 sound card
+
 usb:v0B05p17A1*
  ID_MODEL_FROM_DATABASE=Eee Note EA800 (mass storage mode)
 
 usb:v0B05p17AB*
  ID_MODEL_FROM_DATABASE=USB-N13 802.11n Network Adapter (rev. B1) [Realtek RTL8192CU]
 
+usb:v0B05p17C9*
+ ID_MODEL_FROM_DATABASE=USB-AC53 802.11a/b/g/n/ac Wireless Adapter [Broadcom BCM43526]
+
 usb:v0B05p4C80*
  ID_MODEL_FROM_DATABASE=Transformer Pad TF300TG
 
@@ -32183,6 +32708,12 @@ usb:v0B05p4D01*
 usb:v0B05p4DAF*
  ID_MODEL_FROM_DATABASE=Transformer Pad Infinity TF700 (Fastboot)
 
+usb:v0B05p5410*
+ ID_MODEL_FROM_DATABASE=MeMO Pad HD 7 (MTP mode)
+
+usb:v0B05p5412*
+ ID_MODEL_FROM_DATABASE=MeMO Pad HD 7 (PTP mode)
+
 usb:v0B05p6101*
  ID_MODEL_FROM_DATABASE=Cable Modem
 
@@ -32228,9 +32759,15 @@ usb:v0B0E*
 usb:v0B0Ep0420*
  ID_MODEL_FROM_DATABASE=Jabra SPEAK 510
 
+usb:v0B0Ep094D*
+ ID_MODEL_FROM_DATABASE=GN Netcom / Jabra REVO Wireless
+
 usb:v0B0Ep1022*
  ID_MODEL_FROM_DATABASE=Jabra PRO 9450, Type 9400BS (DECT Headset)
 
+usb:v0B0Ep2007*
+ ID_MODEL_FROM_DATABASE=GN 2000 Stereo Corded Headset
+
 usb:v0B0Ep620C*
  ID_MODEL_FROM_DATABASE=Jabra BT620s
 
@@ -32291,6 +32828,9 @@ usb:v0B33*
 usb:v0B33p0020*
  ID_MODEL_FROM_DATABASE=ShuttleXpress
 
+usb:v0B33p0700*
+ ID_MODEL_FROM_DATABASE=RollerMouse Pro
+
 usb:v0B37*
  ID_VENDOR_FROM_DATABASE=Hitachi ULSI Systems Co., Ltd
 
@@ -32687,6 +33227,9 @@ usb:v0B95p1720*
 usb:v0B95p1780*
  ID_MODEL_FROM_DATABASE=AX88178
 
+usb:v0B95p1790*
+ ID_MODEL_FROM_DATABASE=AX88179 Gigabit Ethernet
+
 usb:v0B95p7720*
  ID_MODEL_FROM_DATABASE=AX88772
 
@@ -32786,6 +33329,9 @@ usb:v0BAFp011B*
 usb:v0BAFp0121*
  ID_MODEL_FROM_DATABASE=USR5423 802.11bg Wireless Adapter [ZyDAS ZD1211B]
 
+usb:v0BAFp0303*
+ ID_MODEL_FROM_DATABASE=USR5637 56K Faxmodem
+
 usb:v0BAFp6112*
  ID_MODEL_FROM_DATABASE=FaxModem Model 5633
 
@@ -33332,6 +33878,9 @@ usb:v0BB4p0C01*
 usb:v0BB4p0C02*
  ID_MODEL_FROM_DATABASE=Dream / ADP1 / G1 / Magic / Tattoo (Debug)
 
+usb:v0BB4p0C03*
+ ID_MODEL_FROM_DATABASE=Android Phone [Fairphone First Edition (FP1)]
+
 usb:v0BB4p0C13*
  ID_MODEL_FROM_DATABASE=Diamond
 
@@ -33371,6 +33920,12 @@ usb:v0BB4p0CA2*
 usb:v0BB4p0CA5*
  ID_MODEL_FROM_DATABASE=Android Phone [Evo Shift 4G]
 
+usb:v0BB4p0CAE*
+ ID_MODEL_FROM_DATABASE=T-Mobile MyTouch 4G Slide [Doubleshot]
+
+usb:v0BB4p0DEA*
+ ID_MODEL_FROM_DATABASE=M7_UL [HTC One]
+
 usb:v0BB4p0FF8*
  ID_MODEL_FROM_DATABASE=Desire HD (Tethering Mode)
 
@@ -33443,18 +33998,33 @@ usb:v0BC2p2320*
 usb:v0BC2p3008*
  ID_MODEL_FROM_DATABASE=FreeAgent Desk 1TB
 
+usb:v0BC2p3101*
+ ID_MODEL_FROM_DATABASE=FreeAgent XTreme 640GB
+
+usb:v0BC2p3312*
+ ID_MODEL_FROM_DATABASE=SRD00F2 [Expansion Desktop Drive 2TB]
+
 usb:v0BC2p3320*
  ID_MODEL_FROM_DATABASE=SRD00F2 [Expansion Desktop Drive]
 
 usb:v0BC2p3332*
  ID_MODEL_FROM_DATABASE=Expansion
 
+usb:v0BC2p5020*
+ ID_MODEL_FROM_DATABASE=FreeAgent GoFlex
+
 usb:v0BC2p5021*
  ID_MODEL_FROM_DATABASE=FreeAgent GoFlex USB 2.0
 
+usb:v0BC2p5030*
+ ID_MODEL_FROM_DATABASE=FreeAgent GoFlex Upgrade Cable STAE104
+
 usb:v0BC2p5031*
  ID_MODEL_FROM_DATABASE=FreeAgent GoFlex USB 3.0
 
+usb:v0BC2p5070*
+ ID_MODEL_FROM_DATABASE=FreeAgent GoFlex Desk
+
 usb:v0BC2p50A1*
  ID_MODEL_FROM_DATABASE=FreeAgent GoFlex Desk
 
@@ -33476,6 +34046,9 @@ usb:v0BC2pA0A1*
 usb:v0BC2pA0A4*
  ID_MODEL_FROM_DATABASE=Backup Plus Desktop Drive
 
+usb:v0BC2pAB00*
+ ID_MODEL_FROM_DATABASE=Slim Portable Drive
+
 usb:v0BC3*
  ID_VENDOR_FROM_DATABASE=IPWireless, Inc.
 
@@ -33650,6 +34223,12 @@ usb:v0BDAp0184*
 usb:v0BDAp0186*
  ID_MODEL_FROM_DATABASE=Card Reader
 
+usb:v0BDAp0301*
+ ID_MODEL_FROM_DATABASE=multicard reader
+
+usb:v0BDAp1724*
+ ID_MODEL_FROM_DATABASE=RTL8723AU 802.11n WLAN Adapter
+
 usb:v0BDAp2831*
  ID_MODEL_FROM_DATABASE=RTL2831U DVB-T
 
@@ -33707,6 +34286,9 @@ usb:v0BDAp8198*
 usb:v0BDAp8199*
  ID_MODEL_FROM_DATABASE=RTL8187SU 802.11g WLAN Adapter
 
+usb:v0BDAp8812*
+ ID_MODEL_FROM_DATABASE=RTL8812AU 802.11a/b/g/n/ac WLAN Adapter
+
 usb:v0BDB*
  ID_VENDOR_FROM_DATABASE=Ericsson Business Mobile Networks BV
 
@@ -34038,7 +34620,7 @@ usb:v0C24p0019*
  ID_MODEL_FROM_DATABASE=Bluetooth Device
 
 usb:v0C24p0021*
- ID_MODEL_FROM_DATABASE=Bluetooth Device
+ ID_MODEL_FROM_DATABASE=Bluetooth Device (V2.1+EDR)
 
 usb:v0C24p0C24*
  ID_MODEL_FROM_DATABASE=Bluetooth Device(SAMPLE)
@@ -34142,6 +34724,9 @@ usb:v0C45*
 usb:v0C45p0011*
  ID_MODEL_FROM_DATABASE=EBUDDY
 
+usb:v0C45p0520*
+ ID_MODEL_FROM_DATABASE=MaxTrack Wireless Mouse
+
 usb:v0C45p1018*
  ID_MODEL_FROM_DATABASE=Compact Flash storage memory card reader
 
@@ -34496,9 +35081,15 @@ usb:v0C45p62C0*
 usb:v0C45p62E0*
  ID_MODEL_FROM_DATABASE=MSI Starcam Racer
 
+usb:v0C45p6300*
+ ID_MODEL_FROM_DATABASE=PC Microscope camera
+
 usb:v0C45p6310*
  ID_MODEL_FROM_DATABASE=Sonix USB 2.0 Camera
 
+usb:v0C45p6340*
+ ID_MODEL_FROM_DATABASE=Camera
+
 usb:v0C45p6341*
  ID_MODEL_FROM_DATABASE=Defender G-Lens 2577 HD720p Camera
 
@@ -34526,6 +35117,12 @@ usb:v0C45p6419*
 usb:v0C45p641D*
  ID_MODEL_FROM_DATABASE=1.3 MPixel Integrated Webcam
 
+usb:v0C45p643F*
+ ID_MODEL_FROM_DATABASE=Dell Integrated HD Webcam
+
+usb:v0C45p644D*
+ ID_MODEL_FROM_DATABASE=1.3 MPixel Integrated Webcam
+
 usb:v0C45p6480*
  ID_MODEL_FROM_DATABASE=Sonix 1.3 MP Laptop Integrated Webcam
 
@@ -34535,6 +35132,9 @@ usb:v0C45p648B*
 usb:v0C45p64BD*
  ID_MODEL_FROM_DATABASE=Sony Visual Communication Camera
 
+usb:v0C45p7401*
+ ID_MODEL_FROM_DATABASE=TEMPer Temperature Sensor
+
 usb:v0C45p7402*
  ID_MODEL_FROM_DATABASE=TEMPerHUM Temperature & Humidity Sensor
 
@@ -35390,6 +35990,9 @@ usb:v0CF3p3000*
 usb:v0CF3p3002*
  ID_MODEL_FROM_DATABASE=AR3011 Bluetooth
 
+usb:v0CF3p3004*
+ ID_MODEL_FROM_DATABASE=AR3012 Bluetooth 4.0
+
 usb:v0CF3p3005*
  ID_MODEL_FROM_DATABASE=AR3011 Bluetooth
 
@@ -35564,6 +36167,15 @@ usb:v0D35*
 usb:v0D3A*
  ID_VENDOR_FROM_DATABASE=Posiflex Technologies, Inc.
 
+usb:v0D3Ap0206*
+ ID_MODEL_FROM_DATABASE=Series 3xxx Cash Drawer
+
+usb:v0D3Ap0207*
+ ID_MODEL_FROM_DATABASE=Series 3xxx Cash Drawer
+
+usb:v0D3Ap0500*
+ ID_MODEL_FROM_DATABASE=Magnetic Stripe Reader
+
 usb:v0D3C*
  ID_VENDOR_FROM_DATABASE=Sri Cable Technology, Ltd
 
@@ -35573,6 +36185,9 @@ usb:v0D3D*
 usb:v0D3Dp0001*
  ID_MODEL_FROM_DATABASE=HID Keyboard
 
+usb:v0D3Dp0040*
+ ID_MODEL_FROM_DATABASE=PS/2 Adapter
+
 usb:v0D3E*
  ID_VENDOR_FROM_DATABASE=Fitcom, inc.
 
@@ -35651,6 +36266,9 @@ usb:v0D49p7010*
 usb:v0D49p7100*
  ID_MODEL_FROM_DATABASE=OneTouch II 300GB External Hard Disk
 
+usb:v0D49p7310*
+ ID_MODEL_FROM_DATABASE=OneTouch 4
+
 usb:v0D49p7410*
  ID_MODEL_FROM_DATABASE=Mobile Hard Disk Drive (1TB)
 
@@ -35858,6 +36476,9 @@ usb:v0D78*
 usb:v0D7A*
  ID_VENDOR_FROM_DATABASE=MARX Datentechnik GmbH
 
+usb:v0D7Ap0001*
+ ID_MODEL_FROM_DATABASE=CrypToken
+
 usb:v0D7B*
  ID_VENDOR_FROM_DATABASE=Wellco Technology Co., Ltd
 
@@ -36404,6 +37025,12 @@ usb:v0DB7*
 usb:v0DB7p0002*
  ID_MODEL_FROM_DATABASE=Goldpfeil P-LAN
 
+usb:v0DBA*
+ ID_VENDOR_FROM_DATABASE=Digidesign
+
+usb:v0DBAp3000*
+ ID_MODEL_FROM_DATABASE=Mbox 2
+
 usb:v0DBC*
  ID_VENDOR_FROM_DATABASE=A&D Medical
 
@@ -36776,6 +37403,9 @@ usb:v0DF6p0060*
 usb:v0DF6p0062*
  ID_MODEL_FROM_DATABASE=WLA-5000 802.11abgn [Ralink RT3572]
 
+usb:v0DF6p0072*
+ ID_MODEL_FROM_DATABASE=AX88179 Gigabit Ethernet [Sitecom]
+
 usb:v0DF6p061C*
  ID_MODEL_FROM_DATABASE=LN-028 Network USB 2.0 Adapter
 
@@ -37253,6 +37883,9 @@ usb:v0E79p14AD*
 usb:v0E79p150E*
  ID_MODEL_FROM_DATABASE=80 G9
 
+usb:v0E79p3001*
+ ID_MODEL_FROM_DATABASE=40 Titanium
+
 usb:v0E7B*
  ID_VENDOR_FROM_DATABASE=On-Tech Industry Co., Ltd
 
@@ -37292,9 +37925,15 @@ usb:v0E8Dp1806*
 usb:v0E8Dp1836*
  ID_MODEL_FROM_DATABASE=Samsung SE-S084 Super WriteMaster Slim External DVD writer
 
+usb:v0E8Dp2000*
+ ID_MODEL_FROM_DATABASE=MT65xx Preloader
+
 usb:v0E8Dp3329*
  ID_MODEL_FROM_DATABASE=Qstarz BT-Q1000XT
 
+usb:v0E8Dp763E*
+ ID_MODEL_FROM_DATABASE=MT7630e Bluetooth Adapter
+
 usb:v0E8F*
  ID_VENDOR_FROM_DATABASE=GreenAsia Inc.
 
@@ -37302,7 +37941,7 @@ usb:v0E8Fp0003*
  ID_MODEL_FROM_DATABASE=MaxFire Blaze2
 
 usb:v0E8Fp0012*
- ID_MODEL_FROM_DATABASE=USB Wireless 2.4GHz Gamepad
+ ID_MODEL_FROM_DATABASE=Joystick/Gamepad
 
 usb:v0E8Fp0016*
  ID_MODEL_FROM_DATABASE=4 port USB 1.1 hub UH-174
@@ -37436,9 +38075,18 @@ usb:v0EB7*
 usb:v0EB8*
  ID_VENDOR_FROM_DATABASE=Mettler Toledo
 
+usb:v0EB8p2200*
+ ID_MODEL_FROM_DATABASE=Ariva Scale
+
 usb:v0EB8pF000*
  ID_MODEL_FROM_DATABASE=PS60 Scale
 
+usb:v0EBB*
+ ID_VENDOR_FROM_DATABASE=Thermo Fisher Scientific
+
+usb:v0EBBp0002*
+ ID_MODEL_FROM_DATABASE=FT-IR Spectrometer
+
 usb:v0EBE*
  ID_VENDOR_FROM_DATABASE=VWeb Corp.
 
@@ -37559,6 +38207,12 @@ usb:v0EEFp0001*
 usb:v0EEFp0002*
  ID_MODEL_FROM_DATABASE=Touchscreen Controller(Professional)
 
+usb:v0EEFp7200*
+ ID_MODEL_FROM_DATABASE=Touchscreen Controller
+
+usb:v0EEFpA802*
+ ID_MODEL_FROM_DATABASE=eGalaxTouch EXC7920
+
 usb:v0EF0*
  ID_VENDOR_FROM_DATABASE=Hitachi Cable, Ltd
 
@@ -37670,6 +38324,12 @@ usb:v0F12*
 usb:v0F13*
  ID_VENDOR_FROM_DATABASE=Acetek Technology Co., Ltd
 
+usb:v0F14*
+ ID_VENDOR_FROM_DATABASE=Ingenico
+
+usb:v0F14p0012*
+ ID_MODEL_FROM_DATABASE=Vital'Act 3S
+
 usb:v0F18*
  ID_VENDOR_FROM_DATABASE=Finger Lakes Instrumentation
 
@@ -37754,6 +38414,12 @@ usb:v0F37*
 usb:v0F38*
  ID_VENDOR_FROM_DATABASE=Nien-Yi Industrial Corp.
 
+usb:v0F39*
+ ID_VENDOR_FROM_DATABASE=TG3 Electronics
+
+usb:v0F39p0876*
+ ID_MODEL_FROM_DATABASE=Keyboard [87 Francium Pro]
+
 usb:v0F3D*
  ID_VENDOR_FROM_DATABASE=Airprime, Incorporated
 
@@ -37841,6 +38507,9 @@ usb:v0F63*
 usb:v0F63p0010*
  ID_MODEL_FROM_DATABASE=Leapster Explorer
 
+usb:v0F63p0022*
+ ID_MODEL_FROM_DATABASE=Leap Reader
+
 usb:v0F63p0500*
  ID_MODEL_FROM_DATABASE=Fly Fusion
 
@@ -37928,6 +38597,9 @@ usb:v0F6Ep0404*
 usb:v0F73*
  ID_VENDOR_FROM_DATABASE=DFI
 
+usb:v0F78*
+ ID_VENDOR_FROM_DATABASE=Guntermann & Drunck GmbH
+
 usb:v0F7C*
  ID_VENDOR_FROM_DATABASE=DQ Technology, Inc.
 
@@ -38064,7 +38736,7 @@ usb:v0FCAp8001*
  ID_MODEL_FROM_DATABASE=Blackberry Handheld
 
 usb:v0FCAp8004*
- ID_MODEL_FROM_DATABASE=Blackberry Handheld
+ ID_MODEL_FROM_DATABASE=Blackberry
 
 usb:v0FCAp8007*
  ID_MODEL_FROM_DATABASE=Blackberry Handheld
@@ -38147,6 +38819,12 @@ usb:v0FCEp3138*
 usb:v0FCEp3149*
  ID_MODEL_FROM_DATABASE=Xperia X8
 
+usb:v0FCEp514F*
+ ID_MODEL_FROM_DATABASE=Xperia arc S [Adb-Enable Mode]
+
+usb:v0FCEp5169*
+ ID_MODEL_FROM_DATABASE=Xperia S [Adb-Enable Mode]
+
 usb:v0FCEp5177*
  ID_MODEL_FROM_DATABASE=Xperia Ion [Debug Mode]
 
@@ -38309,6 +38987,9 @@ usb:v0FCEpE166*
 usb:v0FCEpE167*
  ID_MODEL_FROM_DATABASE=XPERIA mini
 
+usb:v0FCEpF0FA*
+ ID_MODEL_FROM_DATABASE=Liveview micro display MN800 in DFU mode
+
 usb:v0FCF*
  ID_VENDOR_FROM_DATABASE=Dynastream Innovations, Inc.
 
@@ -38316,13 +38997,16 @@ usb:v0FCFp1003*
  ID_MODEL_FROM_DATABASE=ANT Development Board
 
 usb:v0FCFp1004*
- ID_MODEL_FROM_DATABASE=ANT2USB
+ ID_MODEL_FROM_DATABASE=ANTUSB Stick
 
 usb:v0FCFp1006*
  ID_MODEL_FROM_DATABASE=ANT Development Board
 
 usb:v0FCFp1008*
- ID_MODEL_FROM_DATABASE=Mini stick Suunto
+ ID_MODEL_FROM_DATABASE=ANTUSB2 Stick
+
+usb:v0FCFp1009*
+ ID_MODEL_FROM_DATABASE=ANTUSB-m Stick
 
 usb:v0FD0*
  ID_VENDOR_FROM_DATABASE=Tulip Computers B.V.
@@ -38378,6 +39062,12 @@ usb:v0FDAp0100*
 usb:v0FDC*
  ID_VENDOR_FROM_DATABASE=Micro Plus
 
+usb:v0FDE*
+ ID_VENDOR_FROM_DATABASE=Oregon Scientific
+
+usb:v0FDEpCA01*
+ ID_MODEL_FROM_DATABASE=WMRS200 weather station
+
 usb:v0FE0*
  ID_VENDOR_FROM_DATABASE=Osterhout Design Group
 
@@ -38471,6 +39161,9 @@ usb:v0FFF*
 usb:v1000*
  ID_VENDOR_FROM_DATABASE=Speed Tech Corp.
 
+usb:v1000p153B*
+ ID_MODEL_FROM_DATABASE=TerraTec Electronic GmbH
+
 usb:v1001*
  ID_VENDOR_FROM_DATABASE=Ritronics Components (S) Pte., Ltd
 
@@ -38504,6 +39197,9 @@ usb:v1004p618E*
 usb:v1004p618F*
  ID_MODEL_FROM_DATABASE=Ally/Optimus One
 
+usb:v1004p61C5*
+ ID_MODEL_FROM_DATABASE=P880 / Charge only
+
 usb:v1004p61C6*
  ID_MODEL_FROM_DATABASE=Vortex (msc)
 
@@ -38514,7 +39210,7 @@ usb:v1004p61F1*
  ID_MODEL_FROM_DATABASE=Optimus Android Phone [LG Software mode]
 
 usb:v1004p61F9*
- ID_MODEL_FROM_DATABASE=V909 G-Slate
+ ID_MODEL_FROM_DATABASE=Optimus (Various Models) MTP Mode
 
 usb:v1004p61FC*
  ID_MODEL_FROM_DATABASE=Optimus 3
@@ -38528,9 +39224,15 @@ usb:v1004p6300*
 usb:v1004p631C*
  ID_MODEL_FROM_DATABASE=Optimus Android Phone [MTP mode]
 
+usb:v1004p631D*
+ ID_MODEL_FROM_DATABASE=Optimus Android Phone (Camera/PTP Mode)
+
 usb:v1004p631E*
  ID_MODEL_FROM_DATABASE=Optimus Android Phone [Camera/PTP mode]
 
+usb:v1004p631F*
+ ID_MODEL_FROM_DATABASE=Optimus Android Phone (Charge Mode)
+
 usb:v1004p6356*
  ID_MODEL_FROM_DATABASE=Optimus Android Phone [Virtual CD mode]
 
@@ -38540,6 +39242,9 @@ usb:v1004p6800*
 usb:v1004p7000*
  ID_MODEL_FROM_DATABASE=LG LDP-7024D(LD)USB
 
+usb:v1004p91C8*
+ ID_MODEL_FROM_DATABASE=P880 / USB tethering
+
 usb:v1004pA400*
  ID_MODEL_FROM_DATABASE=Renoir (KC910)
 
@@ -38742,13 +39447,13 @@ usb:v1033p0068*
  ID_MODEL_FROM_DATABASE=3,5'' HDD case MD-231
 
 usb:v1038*
- ID_VENDOR_FROM_DATABASE=Ideazon, Inc.
+ ID_VENDOR_FROM_DATABASE=SteelSeries ApS
 
 usb:v1038p0100*
- ID_MODEL_FROM_DATABASE=Zboard
+ ID_MODEL_FROM_DATABASE=Ideazon Zboard
 
 usb:v1038p1361*
- ID_MODEL_FROM_DATABASE=Sensei
+ ID_MODEL_FROM_DATABASE=Ideazon Sensei
 
 usb:v1039*
  ID_VENDOR_FROM_DATABASE=devolo AG
@@ -38946,28 +39651,37 @@ usb:v1058p0704*
  ID_MODEL_FROM_DATABASE=Passport External HDD
 
 usb:v1058p070A*
- ID_MODEL_FROM_DATABASE=My Passport Essential SE
+ ID_MODEL_FROM_DATABASE=My Passport Essential SE, My Passport for Mac (WDBAAB)
 
 usb:v1058p071A*
  ID_MODEL_FROM_DATABASE=My Passport
 
 usb:v1058p0730*
- ID_MODEL_FROM_DATABASE=My Passport
+ ID_MODEL_FROM_DATABASE=My Passport Essential (WDBACY)
 
 usb:v1058p0740*
  ID_MODEL_FROM_DATABASE=My Passport
 
+usb:v1058p0741*
+ ID_MODEL_FROM_DATABASE=My Passport Ultra
+
 usb:v1058p0742*
  ID_MODEL_FROM_DATABASE=My Passport Essential SE
 
 usb:v1058p0748*
- ID_MODEL_FROM_DATABASE=My Passport 1TB USB 3.0
+ ID_MODEL_FROM_DATABASE=My Passport (WDBKXH)
+
+usb:v1058p0810*
+ ID_MODEL_FROM_DATABASE=My Passport Ultra
 
 usb:v1058p0900*
  ID_MODEL_FROM_DATABASE=MyBook Essential External HDD
 
 usb:v1058p0901*
- ID_MODEL_FROM_DATABASE=MyBook External HDD
+ ID_MODEL_FROM_DATABASE=My Book Essential Edition (Green Ring)
+
+usb:v1058p0902*
+ ID_MODEL_FROM_DATABASE=My Book Pro Edition
 
 usb:v1058p0903*
  ID_MODEL_FROM_DATABASE=My Book Premium Edition
@@ -38976,20 +39690,32 @@ usb:v1058p0910*
  ID_MODEL_FROM_DATABASE=MyBook Essential External HDD
 
 usb:v1058p1001*
- ID_MODEL_FROM_DATABASE=External Hard Disk [Elements]
+ ID_MODEL_FROM_DATABASE=Elements Desktop (WDE1U)
 
 usb:v1058p1003*
  ID_MODEL_FROM_DATABASE=Elements 1000 GB
 
 usb:v1058p1010*
- ID_MODEL_FROM_DATABASE=Elements External HDD
+ ID_MODEL_FROM_DATABASE=Elements Portable (WDBAAR)
 
 usb:v1058p1021*
- ID_MODEL_FROM_DATABASE=Elements 2TB
+ ID_MODEL_FROM_DATABASE=Elements Desktop (WDBAAU)
 
 usb:v1058p1023*
  ID_MODEL_FROM_DATABASE=Elements SE
 
+usb:v1058p1048*
+ ID_MODEL_FROM_DATABASE=Elements Portable (WDBU6Y)
+
+usb:v1058p10A2*
+ ID_MODEL_FROM_DATABASE=Elements SE Portable (WDBPCK)
+
+usb:v1058p10A8*
+ ID_MODEL_FROM_DATABASE=Elements Portable (WDBUZG)
+
+usb:v1058p1100*
+ ID_MODEL_FROM_DATABASE=My Book Essential Edition 2.0 (WDH1U)
+
 usb:v1058p1103*
  ID_MODEL_FROM_DATABASE=My Book Studio
 
@@ -39272,6 +39998,9 @@ usb:v106Fp0009*
 usb:v106Fp000A*
  ID_MODEL_FROM_DATABASE=CR10x Coin Recycler
 
+usb:v106Fp000C*
+ ID_MODEL_FROM_DATABASE=Xchange
+
 usb:v1076*
  ID_VENDOR_FROM_DATABASE=GCT Semiconductor, Inc.
 
@@ -39335,6 +40064,12 @@ usb:v1099*
 usb:v109A*
  ID_VENDOR_FROM_DATABASE=DATASOFT Systems GmbH
 
+usb:v109B*
+ ID_VENDOR_FROM_DATABASE=Hisense
+
+usb:v109Bp9118*
+ ID_MODEL_FROM_DATABASE=Medion P4013 Mobile
+
 usb:v109F*
  ID_VENDOR_FROM_DATABASE=eSOL Co., Ltd
 
@@ -39458,6 +40193,15 @@ usb:v10BF*
 usb:v10BFp0001*
  ID_MODEL_FROM_DATABASE=SmartHome PowerLinc
 
+usb:v10C3*
+ ID_VENDOR_FROM_DATABASE=Universal Laser Systems, Inc.
+
+usb:v10C3p00A4*
+ ID_MODEL_FROM_DATABASE=ULS PLS Series Laser Engraver Firmware Loader
+
+usb:v10C3p00A5*
+ ID_MODEL_FROM_DATABASE=ULS Print Support
+
 usb:v10C4*
  ID_VENDOR_FROM_DATABASE=Cygnal Integrated Products, Inc.
 
@@ -39509,6 +40253,12 @@ usb:v10C4p8461*
 usb:v10C4p8477*
  ID_MODEL_FROM_DATABASE=Balluff RFID Reader
 
+usb:v10C4p8496*
+ ID_MODEL_FROM_DATABASE=SiLabs Cypress FW downloader
+
+usb:v10C4p8497*
+ ID_MODEL_FROM_DATABASE=SiLabs Cypress EVB
+
 usb:v10C4p8605*
  ID_MODEL_FROM_DATABASE=dilitronics ESoLUX solar lighting controller
 
@@ -39527,6 +40277,9 @@ usb:v10C4p8863*
 usb:v10C4p8897*
  ID_MODEL_FROM_DATABASE=C8051F38x HDMI Splitter [UHBX]
 
+usb:v10C4p8918*
+ ID_MODEL_FROM_DATABASE=C8051F38x HDMI Audio Extractor [VSA-HA-DP]
+
 usb:v10C4pEA60*
  ID_MODEL_FROM_DATABASE=CP210x UART Bridge / myAVR mySmartUSB light
 
@@ -39908,6 +40661,9 @@ usb:v1141*
 usb:v1142*
  ID_VENDOR_FROM_DATABASE=CyberScan Technologies, Inc.
 
+usb:v1142p0709*
+ ID_MODEL_FROM_DATABASE=Cyberview High Speed Scanner
+
 usb:v1145*
  ID_VENDOR_FROM_DATABASE=Japan Radio Company
 
@@ -39938,6 +40694,9 @@ usb:v114D*
 usb:v114F*
  ID_VENDOR_FROM_DATABASE=Wavecom
 
+usb:v114Fp1234*
+ ID_MODEL_FROM_DATABASE=Fastrack Xtend FXT001 Modem
+
 usb:v115B*
  ID_VENDOR_FROM_DATABASE=Salix Technology Co., Ltd.
 
@@ -40128,7 +40887,7 @@ usb:v1199p683A*
  ID_MODEL_FROM_DATABASE=MC8785 Device
 
 usb:v1199p683C*
- ID_MODEL_FROM_DATABASE=MC8790 Device
+ ID_MODEL_FROM_DATABASE=Mobile Broadband 3G/UMTS (MC8790 Device)
 
 usb:v1199p6850*
  ID_MODEL_FROM_DATABASE=AirCard 880 Device
@@ -40196,6 +40955,12 @@ usb:v1199p9009*
 usb:v1199p900A*
  ID_MODEL_FROM_DATABASE=Gobi 2000 Wireless Modem
 
+usb:v1199p9055*
+ ID_MODEL_FROM_DATABASE=Gobi 9x15 Multimode 3G/4G LTE Modem (NAT mode)
+
+usb:v1199p9057*
+ ID_MODEL_FROM_DATABASE=Gobi 9x15 Multimode 3G/4G LTE Modem (IP passthrough mode)
+
 usb:v119A*
  ID_VENDOR_FROM_DATABASE=ZHAN QI Technology Co., Ltd
 
@@ -40238,12 +41003,30 @@ usb:v11ACp6565*
 usb:v11B0*
  ID_VENDOR_FROM_DATABASE=ATECH FLASH TECHNOLOGY
 
+usb:v11B0p6208*
+ ID_MODEL_FROM_DATABASE=PRO-28U
+
+usb:v11BE*
+ ID_VENDOR_FROM_DATABASE=R&D International NV
+
+usb:v11BEpF0A0*
+ ID_MODEL_FROM_DATABASE=Martin Maxxyz DMX
+
 usb:v11C5*
  ID_VENDOR_FROM_DATABASE=Inmax
 
 usb:v11C5p0521*
  ID_MODEL_FROM_DATABASE=IMT-0521 Smartcard Reader
 
+usb:v11CA*
+ ID_VENDOR_FROM_DATABASE=VeriFone Inc
+
+usb:v11CAp0207*
+ ID_MODEL_FROM_DATABASE=PIN Pad VX 810
+
+usb:v11CAp0220*
+ ID_MODEL_FROM_DATABASE=PIN Pad VX 805
+
 usb:v11DB*
  ID_VENDOR_FROM_DATABASE=Topfield Co., Ltd.
 
@@ -40274,6 +41057,9 @@ usb:v11F5p0005*
 usb:v11F5p0008*
  ID_MODEL_FROM_DATABASE=UMTS/HSDPA Data Card
 
+usb:v11F5p0101*
+ ID_MODEL_FROM_DATABASE=RCU Connect
+
 usb:v11F6*
  ID_VENDOR_FROM_DATABASE=Prolific
 
@@ -40284,7 +41070,7 @@ usb:v11F7*
  ID_VENDOR_FROM_DATABASE=Alcatel (?)
 
 usb:v11F7p02DF*
- ID_MODEL_FROM_DATABASE=TD10 Mobile phone USB cable
+ ID_MODEL_FROM_DATABASE=Serial cable (v2) for TD-10 Mobile Phone
 
 usb:v1203*
  ID_VENDOR_FROM_DATABASE=TSC Auto ID Technology Co., Ltd
@@ -40352,6 +41138,9 @@ usb:v1228p0012*
 usb:v1228p0015*
  ID_MODEL_FROM_DATABASE=TPaq21/MPaq21 Datalogger
 
+usb:v1228p584C*
+ ID_MODEL_FROM_DATABASE=XL2 Logger
+
 usb:v1230*
  ID_VENDOR_FROM_DATABASE=Chipidea-Microelectronica, S.A.
 
@@ -40377,20 +41166,110 @@ usb:v1235*
  ID_VENDOR_FROM_DATABASE=Novation EMS
 
 usb:v1235p0001*
- ID_MODEL_FROM_DATABASE=ReMOTE Audio/XStation
+ ID_MODEL_FROM_DATABASE=ReMOTE Audio/XStation First Edition
 
 usb:v1235p0002*
  ID_MODEL_FROM_DATABASE=Speedio
 
 usb:v1235p0003*
- ID_MODEL_FROM_DATABASE=ReMOTE ZeRO SL
+ ID_MODEL_FROM_DATABASE=RemoteSL + ZeroSL
+
+usb:v1235p0004*
+ ID_MODEL_FROM_DATABASE=ReMOTE LE
+
+usb:v1235p0005*
+ ID_MODEL_FROM_DATABASE=XIOSynth [First Edition]
+
+usb:v1235p0006*
+ ID_MODEL_FROM_DATABASE=XStation
+
+usb:v1235p0007*
+ ID_MODEL_FROM_DATABASE=XIOSynth
+
+usb:v1235p0008*
+ ID_MODEL_FROM_DATABASE=ReMOTE SL Compact
+
+usb:v1235p0009*
+ ID_MODEL_FROM_DATABASE=nIO
+
+usb:v1235p000A*
+ ID_MODEL_FROM_DATABASE=Nocturn
+
+usb:v1235p000B*
+ ID_MODEL_FROM_DATABASE=ReMOTE SL MkII
+
+usb:v1235p000C*
+ ID_MODEL_FROM_DATABASE=ZeRO MkII
+
+usb:v1235p000E*
+ ID_MODEL_FROM_DATABASE=Launchpad
+
+usb:v1235p0010*
+ ID_MODEL_FROM_DATABASE=Saffire 6
+
+usb:v1235p0011*
+ ID_MODEL_FROM_DATABASE=Ultranova
+
+usb:v1235p0012*
+ ID_MODEL_FROM_DATABASE=Nocturn Keyboard
+
+usb:v1235p0013*
+ ID_MODEL_FROM_DATABASE=VRM Box
+
+usb:v1235p0014*
+ ID_MODEL_FROM_DATABASE=VRM Box Audio Class (2-out)
+
+usb:v1235p0015*
+ ID_MODEL_FROM_DATABASE=Dicer
+
+usb:v1235p0016*
+ ID_MODEL_FROM_DATABASE=Ultranova
+
+usb:v1235p0018*
+ ID_MODEL_FROM_DATABASE=Twitch
+
+usb:v1235p0019*
+ ID_MODEL_FROM_DATABASE=Impulse 25
+
+usb:v1235p001A*
+ ID_MODEL_FROM_DATABASE=Impulse 49
+
+usb:v1235p001B*
+ ID_MODEL_FROM_DATABASE=Impulse 61
 
 usb:v1235p4661*
  ID_MODEL_FROM_DATABASE=ReMOTE25
 
+usb:v1235p8000*
+ ID_MODEL_FROM_DATABASE=Scarlett 18i6
+
+usb:v1235p8002*
+ ID_MODEL_FROM_DATABASE=Scarlett 8i6
+
 usb:v1235p8006*
  ID_MODEL_FROM_DATABASE=Focusrite Scarlett 2i2
 
+usb:v1235p8008*
+ ID_MODEL_FROM_DATABASE=Saffire 6
+
+usb:v1235p800A*
+ ID_MODEL_FROM_DATABASE=Scarlett 2i4
+
+usb:v1235p800C*
+ ID_MODEL_FROM_DATABASE=Scarlett 18i20
+
+usb:v1235p800E*
+ ID_MODEL_FROM_DATABASE=iTrack Solo
+
+usb:v1235p8010*
+ ID_MODEL_FROM_DATABASE=Forte
+
+usb:v1235p8012*
+ ID_MODEL_FROM_DATABASE=Scarlett 6i6
+
+usb:v1235p8014*
+ ID_MODEL_FROM_DATABASE=Scarlett 18i8
+
 usb:v1241*
  ID_VENDOR_FROM_DATABASE=Belkin
 
@@ -40410,7 +41289,7 @@ usb:v1241p1166*
  ID_MODEL_FROM_DATABASE=MI-2150 Trust Mouse
 
 usb:v1241p1177*
- ID_MODEL_FROM_DATABASE=F8E842-DL Mouse
+ ID_MODEL_FROM_DATABASE=Mouse [HT82M21A]
 
 usb:v1241p1503*
  ID_MODEL_FROM_DATABASE=Keyboard
@@ -40463,6 +41342,9 @@ usb:v125Fp312A*
 usb:v125Fp312B*
  ID_MODEL_FROM_DATABASE=Superior S102 Pro
 
+usb:v125FpA22A*
+ ID_MODEL_FROM_DATABASE=DashDrive Elite HE720 500GB
+
 usb:v125FpA91A*
  ID_MODEL_FROM_DATABASE=Portable HDD CH91
 
@@ -40478,6 +41360,9 @@ usb:v125FpC93A*
 usb:v125FpC96A*
  ID_MODEL_FROM_DATABASE=C906 Flash Drive
 
+usb:v125FpCB10*
+ ID_MODEL_FROM_DATABASE=Dash Drive UV100
+
 usb:v1260*
  ID_VENDOR_FROM_DATABASE=Standard Microsystems Corp.
 
@@ -40637,6 +41522,9 @@ usb:v1283p0150*
 usb:v1286*
  ID_VENDOR_FROM_DATABASE=Marvell Semiconductor, Inc.
 
+usb:v1286p00BC*
+ ID_MODEL_FROM_DATABASE=Marvell JTAG Probe
+
 usb:v1286p1FAB*
  ID_MODEL_FROM_DATABASE=88W8338 [Libertas] 802.11g
 
@@ -40733,6 +41621,12 @@ usb:v12C4p0006*
 usb:v12C4p0008*
  ID_MODEL_FROM_DATABASE=Teleprompter Foot Control (v1)
 
+usb:v12CF*
+ ID_VENDOR_FROM_DATABASE=DEXIN
+
+usb:v12CFp0170*
+ ID_MODEL_FROM_DATABASE=Tt eSPORTS BLACK Gaming mouse
+
 usb:v12D1*
  ID_VENDOR_FROM_DATABASE=Huawei Technologies Co., Ltd.
 
@@ -40802,9 +41696,15 @@ usb:v12D1p14CF*
 usb:v12D1p14D1*
  ID_MODEL_FROM_DATABASE=K3770 3G Modem (Mass Storage Mode)
 
+usb:v12D1p14DB*
+ ID_MODEL_FROM_DATABASE=E353/E3131
+
 usb:v12D1p14F1*
  ID_MODEL_FROM_DATABASE=Gobi 3000 HSPA+ Modem
 
+usb:v12D1p14FE*
+ ID_MODEL_FROM_DATABASE=Modem (Mass Storage Mode)
+
 usb:v12D1p1501*
  ID_MODEL_FROM_DATABASE=Pulse
 
@@ -40826,6 +41726,9 @@ usb:v12D1p1521*
 usb:v12D1p155A*
  ID_MODEL_FROM_DATABASE=R205 Mobile WiFi (CD-ROM mode)
 
+usb:v12D1p1575*
+ ID_MODEL_FROM_DATABASE=K5150 LTE modem
+
 usb:v12D1p1805*
  ID_MODEL_FROM_DATABASE=AT&T Go Phone U2800A phone
 
@@ -41376,7 +42279,7 @@ usb:v13BA*
  ID_VENDOR_FROM_DATABASE=PCPlay
 
 usb:v13BAp0001*
- ID_MODEL_FROM_DATABASE=König Electronic CMP-KEYPAD12 Numeric Keypad
+ ID_MODEL_FROM_DATABASE=Konig Electronic CMP-KEYPAD12 Numeric Keypad
 
 usb:v13BAp0017*
  ID_MODEL_FROM_DATABASE=PS/2 Keyboard+Mouse Adapter
@@ -44096,6 +44999,9 @@ usb:v1740p9801*
 usb:v1743*
  ID_VENDOR_FROM_DATABASE=General Atomics
 
+usb:v1748*
+ ID_VENDOR_FROM_DATABASE=MQP Electronics
+
 usb:v174C*
  ID_VENDOR_FROM_DATABASE=ASMedia Technology Inc.
 
@@ -46569,7 +47475,7 @@ usb:v1C7B*
  ID_VENDOR_FROM_DATABASE=LUXSHARE PRECISION INDUSTRY (SHENZHEN) CO., LTD.
 
 usb:v1C83*
- ID_VENDOR_FROM_DATABASE=Schomäcker GmbH
+ ID_VENDOR_FROM_DATABASE=Schomaecker GmbH
 
 usb:v1C83p0001*
  ID_MODEL_FROM_DATABASE=RS150 V2
@@ -47678,6 +48584,12 @@ usb:v2047*
 usb:v2047p0200*
  ID_MODEL_FROM_DATABASE=MSP430 USB HID Bootstrap Loader
 
+usb:v2047p0855*
+ ID_MODEL_FROM_DATABASE=Invensense Embedded MotionApp HID Sensor
+
+usb:v2047p0964*
+ ID_MODEL_FROM_DATABASE=Inventio Software MSP430
+
 usb:v2080*
  ID_VENDOR_FROM_DATABASE=Barnes & Noble
 

commit 0ade4b119d9d00252ce51f85b9b9019d0717c183
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Apr 28 18:11:40 2014 +0200

    machine-id: only look into KVM uuid when we are not running in a
    container
    
    (cherry picked from commit 0b36bbc42d3a408531517a02acaf56105b863d55)
    
    Conflicts:
    	src/core/machine-id-setup.c

diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index 1b55da7..602be3b 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -88,29 +88,6 @@ static int generate(char id[34]) {
                 }
         }
 
-        /* If that didn't work, see if we are running in qemu/kvm and a
-         * machine ID was passed in via -uuid on the qemu/kvm command
-         * line */
-
-        r = detect_vm(&vm_id);
-        if (r > 0 && streq(vm_id, "kvm")) {
-                char uuid[37];
-
-                fd = open("/sys/class/dmi/id/product_uuid", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
-                if (fd >= 0) {
-                        k = loop_read(fd, uuid, 36, false);
-                        close_nointr_nofail(fd);
-
-                        if (k >= 36) {
-                                r = shorten_uuid(id, uuid);
-                                if (r >= 0) {
-                                        log_info("Initializing machine ID from KVM UUID.");
-                                        return 0;
-                                }
-                        }
-                }
-        }
-
         /* If that didn't work either, see if we are running in a
          * container, and a machine ID was passed in via
          * $container_uuid the way libvirt/LXC does it */
@@ -128,6 +105,30 @@ static int generate(char id[34]) {
                                 }
                         }
                 }
+
+        } else {
+                /* If we are not running in a container, see if we are
+                 * running in qemu/kvm and a machine ID was passed in
+                 * via -uuid on the qemu/kvm command line */
+
+                r = detect_vm(&vm_id);
+                if (r > 0 && streq(vm_id, "kvm")) {
+                        char uuid[37];
+
+                        fd = open("/sys/class/dmi/id/product_uuid", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
+                        if (fd >= 0) {
+                                k = loop_read(fd, uuid, 36, false);
+                                close_nointr_nofail(fd);
+
+                                if (k >= 36) {
+                                        r = shorten_uuid(id, uuid);
+                                        if (r >= 0) {
+                                                log_info("Initializing machine ID from KVM UUID.");
+                                                return 0;
+                                        }
+                                }
+                        }
+                }
         }
 
         /* If that didn't work, generate a random machine id */

commit ae6feb2a01f6954af682bc3580c95d99721dcf46
Author: Michael Marineau <michael.marineau at coreos.com>
Date:   Mon May 12 09:26:16 2014 +0200

    job: always add waiting jobs to run queue during coldplug
    
    commit 20a83d7bf was not equivalent to the original bug fix proposed by
    Michal Sekletar <msekleta at redhat.com>. The committed version only added
    the job to the run queue if the job had a timeout, which most jobs do
    not have. Just re-ordering the code gets us the intended functionality
    
    (cherry picked from commit 1727a595225132eb73ec134b6979d9c713b42e8c)
    
    Conflicts:
    	src/core/job.c

diff --git a/src/core/job.c b/src/core/job.c
index 6f99c9b..c219dc0 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -1051,15 +1051,15 @@ int job_coldplug(Job *j) {
 
         assert(j);
 
+        if (j->state == JOB_WAITING)
+                job_add_to_run_queue(j);
+
         if (j->begin_usec == 0 || j->unit->job_timeout == 0)
                 return 0;
 
         if (j->timer_event_source)
                 j->timer_event_source = sd_event_source_unref(j->timer_event_source);
 
-        if (j->state == JOB_WAITING)
-                job_add_to_run_queue(j);
-
         r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
         if (r < 0)
                 log_debug("Failed to restart timeout for job: %s", strerror(-r));

commit 39cdf9313c28c3853aa001bbb522f71703cbfcc3
Author: Brandon Philips <brandon at ifup.co>
Date:   Fri Apr 25 09:31:59 2014 -0600

    job: add waiting jobs to run queue in unit_coldplug
    
    When we have job installed and added to run queue for service which is
    still in dead state and systemd initiates reload then after reload we
    never add deserialized job to the run queue again. This is caused by
    check in service_coldplug() where we check if deserialized state is
    something else than dead state, which is not the case thus we never call
    service_set_state() and finally unit_notify() where we would have added
    job to the run queue.
    
    Thanks to Michal Sekletar <msekleta at redhat.com> for the original patch.
    
    (cherry picked from commit 20a83d7bf4542875f8033b68682a4da4993010e8)
    
    Conflicts:
    	src/core/job.c

diff --git a/src/core/job.c b/src/core/job.c
index 0cd4397..6f99c9b 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -1057,6 +1057,9 @@ int job_coldplug(Job *j) {
         if (j->timer_event_source)
                 j->timer_event_source = sd_event_source_unref(j->timer_event_source);
 
+        if (j->state == JOB_WAITING)
+                job_add_to_run_queue(j);
+
         r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
         if (r < 0)
                 log_debug("Failed to restart timeout for job: %s", strerror(-r));

commit 83d57a349f1e099c1c45abfa6a116ad4979eb6f2
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Apr 25 19:58:21 2014 -0400

    test-journal-flush: avoid predictable names in /var/tmp
    
    (cherry picked from commit dfd9cf7f0b257d38f5527989dd9315e767fbe41b)

diff --git a/src/journal/test-journal-flush.c b/src/journal/test-journal-flush.c
index e61e87a..0ca24e0 100644
--- a/src/journal/test-journal-flush.c
+++ b/src/journal/test-journal-flush.c
@@ -27,13 +27,14 @@
 
 int main(int argc, char *argv[]) {
 
-        char fn[sizeof("/var/tmp/test-journal-flush-")-1 + DECIMAL_STR_MAX(pid_t) + sizeof(".journal")];
+        char dn[] = "/var/tmp/test-journal-flush.XXXXXX", *fn;
         JournalFile *new_journal = NULL;
         sd_journal *j = NULL;
         unsigned n = 0;
         int r;
 
-        sprintf(fn, "/var/tmp/test-journal-flush-%lu.journal", (unsigned long) getpid());
+        assert_se(mkdtemp(dn));
+        fn = strappend(dn, "/test.journal");
 
         r = journal_file_open(fn, O_CREAT|O_RDWR, 0644, false, false, NULL, NULL, NULL, &new_journal);
         assert_se(r >= 0);
@@ -67,5 +68,7 @@ int main(int argc, char *argv[]) {
 
         journal_file_close(new_journal);
 
+        assert_se(rmdir(dn) == 0);
+
         return 0;
 }

commit 68216517d2d292dd9d334415f2ca06322cfa341e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Apr 25 13:26:37 2014 +0200

    core: make sure we always write changed cgroup attributes to the cgroupfs
    
    (cherry picked from commit 3051f1871ea2d9a36b423207221e461cc27e577c)

diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index 775825b..5b1c4e3 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -173,6 +173,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->cpu_accounting = b;
+                        u->cgroup_realized_mask &= ~CGROUP_CPUACCT;
                         unit_write_drop_in_private(u, mode, name, b ? "CPUAccounting=yes" : "CPUAccounting=no");
                 }
 
@@ -192,6 +193,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->cpu_shares = ul;
+                        u->cgroup_realized_mask &= ~CGROUP_CPU;
                         unit_write_drop_in_private_format(u, mode, name, "CPUShares=%lu", ul);
                 }
 
@@ -206,6 +208,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->blockio_accounting = b;
+                        u->cgroup_realized_mask &= ~CGROUP_BLKIO;
                         unit_write_drop_in_private(u, mode, name, b ? "BlockIOAccounting=yes" : "BlockIOAccounting=no");
                 }
 
@@ -225,6 +228,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->blockio_weight = ul;
+                        u->cgroup_realized_mask &= ~CGROUP_BLKIO;
                         unit_write_drop_in_private_format(u, mode, name, "BlockIOWeight=%lu", ul);
                 }
 
@@ -294,6 +298,8 @@ int bus_cgroup_set_property(
                                                 cgroup_context_free_blockio_device_bandwidth(c, a);
                         }
 
+                        u->cgroup_realized_mask &= ~CGROUP_BLKIO;
+
                         f = open_memstream(&buf, &size);
                         if (!f)
                                 return -ENOMEM;
@@ -375,6 +381,8 @@ int bus_cgroup_set_property(
                                         cgroup_context_free_blockio_device_weight(c, c->blockio_device_weights);
                         }
 
+                        u->cgroup_realized_mask &= ~CGROUP_BLKIO;
+
                         f = open_memstream(&buf, &size);
                         if (!f)
                                 return -ENOMEM;
@@ -398,6 +406,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->memory_accounting = b;
+                        u->cgroup_realized_mask &= ~CGROUP_MEMORY;
                         unit_write_drop_in_private(u, mode, name, b ? "MemoryAccounting=yes" : "MemoryAccounting=no");
                 }
 
@@ -412,6 +421,7 @@ int bus_cgroup_set_property(
 
                 if (mode != UNIT_CHECK) {
                         c->memory_limit = limit;
+                        u->cgroup_realized_mask &= ~CGROUP_MEMORY;
                         unit_write_drop_in_private_format(u, mode, name, "%s=%" PRIu64, name, limit);
                 }
 
@@ -433,6 +443,7 @@ int bus_cgroup_set_property(
                         char *buf;
 
                         c->device_policy = p;
+                        u->cgroup_realized_mask &= ~CGROUP_DEVICE;
 
                         buf = strappenda("DevicePolicy=", policy);
                         unit_write_drop_in_private(u, mode, name, buf);
@@ -511,6 +522,8 @@ int bus_cgroup_set_property(
                                         cgroup_context_free_device_allow(c, c->device_allow);
                         }
 
+                        u->cgroup_realized_mask &= ~CGROUP_DEVICE;
+
                         f = open_memstream(&buf, &size);
                         if (!f)
                                 return -ENOMEM;

commit 0f1f10d8032cb43da304cbd0727203454c79768a
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Apr 20 13:57:26 2014 -0400

    udev: warn when name_to_handle_at is not implemented
    
    We have a bunch of reports from people who have a custom kernel and
    are confused why udev is not running. Issue a warning on
    error. Barring an error in the code, the only error that is possible
    is ENOSYS.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1072966
    (cherry picked from commit e6c474723dc66cd4765fd09453d6b48bd5905ba4)

diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index e045298..1afae14 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -119,8 +119,11 @@ static bool udev_has_devtmpfs(struct udev *udev) {
         int r;
 
         r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0);
-        if (r < 0)
+        if (r < 0) {
+                if (errno != EOPNOTSUPP)
+                        udev_err(udev, "name_to_handle_at on /dev: %m\n");
                 return false;
+        }
 
         f = fopen("/proc/self/mountinfo", "re");
         if (!f)

commit aa8c95a158ada263eb0ddc53643bf94517290871
Author: Robert Milasan <rmilasan at suse.com>
Date:   Thu Apr 24 11:23:33 2014 +0200

    udev: increase the size of RESULT buffer
    
    Under some conditions, in udev_rules_apply_to_event the fact that
    result is 1024 bytes, creates problems if the output of the running
    command/app is bigger then 1024 bytes.
    
    (cherry picked from commit 209b031e4fb7b50fc1812fc7c6ea59ca2f5d0c78)

diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 0bed570..3723f76 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2027,7 +2027,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                 case TK_M_PROGRAM: {
                         char program[UTIL_PATH_SIZE];
                         char **envp;
-                        char result[UTIL_PATH_SIZE];
+                        char result[UTIL_LINE_SIZE];
 
                         free(event->program_result);
                         event->program_result = NULL;

commit 19ef179118bcf92b7290669edf7e38e12f1a80d6
Author: David Härdeman <david at hardeman.nu>
Date:   Tue Mar 25 11:05:28 2014 +0100

    Fix keysize handling in cryptsetup (bits vs. bytes)
    
    The command line key-size is in bits but the libcryptsetup API expects bytes.
    
    Note that the modulo 8 check is in the original cryptsetup binary as well, so
    it's no new limitation.
    
    (v2: changed the point at which the /= 8 is performed, rebased, removed tabs)
    
    (cherry picked from commit 6131a78b4d247618715e042e14ad682f678d3b32)
    
    Conflicts:
    	src/cryptsetup/cryptsetup.c

diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 033c0cd..72f23b9 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -88,6 +88,13 @@ static int parse_one_option(const char *option) {
                         return 0;
                 }
 
+                if (opt_key_size % 8) {
+                        log_error("size= not a multiple of 8, ignoring.");
+                        return 0;
+                }
+
+                opt_key_size /= 8;
+
         } else if (startswith(option, "key-slot=")) {
 
                 opt_type = CRYPT_LUKS1;
@@ -407,7 +414,7 @@ static int attach_luks_or_plain(struct crypt_device *cd,
                 /* for CRYPT_PLAIN limit reads
                  * from keyfile to key length, and
                  * ignore keyfile-size */
-                opt_keyfile_size = opt_key_size / 8;
+                opt_keyfile_size = opt_key_size;
 
                 /* In contrast to what the name
                  * crypt_setup() might suggest this
@@ -570,7 +577,7 @@ int main(int argc, char *argv[]) {
                 else
                         until = 0;
 
-                opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
+                opt_key_size = (opt_key_size > 0 ? opt_key_size : (256 / 8));
 
                 if (key_file) {
                         struct stat st;

commit bfea58f4bfef547f4ea19959716b99199e180ed9
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Apr 24 08:11:39 2014 +0200

    errno: make sure to handle the 3 errnos that are aliases for others properly
    
    (cherry picked from commit 0d522a7a0547982eae9ab1b5971e4bed9c2fbc7c)

diff --git a/Makefile.am b/Makefile.am
index e8f2687..69cea75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1072,7 +1072,7 @@ BUILT_SOURCES += \
 
 src/shared/errno-list.txt:
 	$(AM_V_at)$(MKDIR_P) $(dir $@)
-	$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+[0-9]/ { print $$2; }'  > $@
+	$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }'  > $@
 
 src/shared/errno-from-name.gperf: src/shared/errno-list.txt
 	$(AM_V_at)$(MKDIR_P) $(dir $@)
@@ -1084,7 +1084,7 @@ src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
 
 src/shared/errno-to-name.h: src/shared/errno-list.txt
 	$(AM_V_at)$(MKDIR_P) $(dir $@)
-	$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
+	$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
 
 # ------------------------------------------------------------------------------
 systemd_SOURCES = \

commit 6b494ffbcb54873508b6ca18ec93dfa20221d542
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Apr 24 07:46:31 2014 +0200

    util: make sure all our name_to_handle_at() code makes use of file_handle_union
    
    (cherry picked from commit 21749924e12201d8f5210c5dc9695e18fd16bb93)

diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 85b1e40..e045298 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -108,17 +108,20 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev)
 
 /* we consider udev running when /dev is on devtmpfs */
 static bool udev_has_devtmpfs(struct udev *udev) {
-        union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ, };
-        int mount_id;
+
+        union file_handle_union h = {
+                .handle.handle_bytes = MAX_HANDLE_SZ
+        };
+
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX], *e;
+        int mount_id;
         int r;
 
         r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0);
         if (r < 0)
                 return false;
 
-
         f = fopen("/proc/self/mountinfo", "re");
         if (!f)
                 return false;
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index bdc54a9..c3ccf61 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -324,11 +324,15 @@ bool path_equal(const char *a, const char *b) {
 }
 
 int path_is_mount_point(const char *t, bool allow_symlink) {
-        char *parent;
-        int r;
-        struct file_handle *h;
+
+        union file_handle_union h = {
+                .handle.handle_bytes = MAX_HANDLE_SZ
+        };
+
         int mount_id, mount_id_parent;
+        char *parent;
         struct stat a, b;
+        int r;
 
         /* We are not actually interested in the file handles, but
          * name_to_handle_at() also passes us the mount ID, hence use
@@ -337,12 +341,9 @@ int path_is_mount_point(const char *t, bool allow_symlink) {
         if (path_equal(t, "/"))
                 return 1;
 
-        h = alloca(MAX_HANDLE_SZ);
-        h->handle_bytes = MAX_HANDLE_SZ;
-
-        r = name_to_handle_at(AT_FDCWD, t, h, &mount_id, allow_symlink ? AT_SYMLINK_FOLLOW : 0);
+        r = name_to_handle_at(AT_FDCWD, t, &h.handle, &mount_id, allow_symlink ? AT_SYMLINK_FOLLOW : 0);
         if (r < 0) {
-                if (errno == ENOSYS || errno == ENOTSUP)
+                if (IN_SET(errno, ENOSYS, EOPNOTSUPP))
                         /* This kernel or file system does not support
                          * name_to_handle_at(), hence fallback to the
                          * traditional stat() logic */
@@ -358,15 +359,14 @@ int path_is_mount_point(const char *t, bool allow_symlink) {
         if (r < 0)
                 return r;
 
-        h->handle_bytes = MAX_HANDLE_SZ;
-        r = name_to_handle_at(AT_FDCWD, parent, h, &mount_id_parent, 0);
+        h.handle.handle_bytes = MAX_HANDLE_SZ;
+        r = name_to_handle_at(AT_FDCWD, parent, &h.handle, &mount_id_parent, 0);
         free(parent);
-
         if (r < 0) {
                 /* The parent can't do name_to_handle_at() but the
                  * directory we are interested in can? If so, it must
                  * be a mount point */
-                if (errno == ENOTSUP)
+                if (errno == EOPNOTSUPP)
                         return 1;
 
                 return -errno;
@@ -393,7 +393,6 @@ fallback:
 
         r = lstat(parent, &b);
         free(parent);
-
         if (r < 0)
                 return -errno;
 

commit 6e150a59cacafbb2c339e0854f449d63ef919a4f
Author: Jeffrey Clark <h0tw1r3 at gmail.com>
Date:   Wed Apr 23 22:37:43 2014 +0200

    analyze: fix plot with bad y size
    
    systemd-analyze plot > test.svg produces output with all y and height
    element attributes equal to zero. This of course causes the resulting
    svg to appear blank (zero height). Bug does not affect x86. Looks like
    a compiler optimization may be the culprit.
    
    https://github.com/archlinuxarm/PKGBUILDs/issues/815
    (cherry picked from commit a213b7e977221ca96bbc1b19a5a879c912ba2488)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 3d2d08f..b82060d 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -43,7 +43,7 @@
 #include "pager.h"
 
 #define SCALE_X (0.1 / 1000.0)   /* pixels per us */
-#define SCALE_Y 20.0
+#define SCALE_Y (20.0)
 
 #define compare(a, b) (((a) > (b))? 1 : (((b) > (a))? -1 : 0))
 

commit 733f75b87834a47c24889c3ac471b4de6b6cb153
Author: Ray Strode <rstrode at redhat.com>
Date:   Tue Apr 22 13:27:58 2014 -0400

    login: give session ownership of VT
    
    The tty associated with a VT should be owned by the owner of the session
    running on the VT. This is important for supporting a socket activated X
    server, since the X server will open the tty itself.
    
    This commit makes sure to chown the tty any time a session is
    created and and chown it back to root any time the session
    is removed. This behavior is copied from /bin/login.
    
    (cherry picked from commit d6176c6c97bf0614c2e7caaf2156bf813b39337a)
    
    Conflicts:
    	src/login/logind-session.c

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 3700522..8f773d2 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -974,6 +974,10 @@ void session_mute_vt(Session *s) {
         if (vt < 0)
                 return;
 
+        r = fchown(vt, s->user->uid, -1);
+        if (r < 0)
+                goto error;
+
         r = ioctl(vt, KDSKBMODE, K_OFF);
         if (r < 0)
                 goto error;
@@ -1027,6 +1031,8 @@ void session_restore_vt(Session *s) {
         mode.mode = VT_AUTO;
         ioctl(vt, VT_SETMODE, &mode);
 
+        fchown(vt, 0, -1);
+
         close_nointr_nofail(vt);
         s->vtfd = -1;
 }

commit 7441fde630653de5d016a5cbb0360cad2fa31533
Author: Michael Olbrich <m.olbrich at pengutronix.de>
Date:   Tue Mar 25 14:15:44 2014 +0100

    systemctl: delete REBOOT_PARAM_FILE if no parameter is specified
    
    And move it to sperate function.
    
    (cherry picked from commit c5220a940d00fc2520c702104939d0a4cf637254)
    
    Conflicts:
    	src/shared/util.c

diff --git a/src/shared/util.c b/src/shared/util.c
index a01de19..a136355 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -6308,3 +6308,19 @@ const char* personality_to_string(unsigned long p) {
 
         return NULL;
 }
+
+int update_reboot_param_file(const char *param)
+{
+        int r = 0;
+
+        if (param) {
+
+                r = write_string_file(REBOOT_PARAM_FILE, param);
+                if (r < 0)
+                        log_error("Failed to write reboot param to "
+                                  REBOOT_PARAM_FILE": %s", strerror(-r));
+        } else
+                unlink(REBOOT_PARAM_FILE);
+
+        return r;
+}
diff --git a/src/shared/util.h b/src/shared/util.h
index 98a7485..8dff0bc 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -886,6 +886,8 @@ unsigned long personality_from_string(const char *p);
 const char *personality_to_string(unsigned long);
 
 union file_handle_union {
-  struct file_handle handle;
-  char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
+        struct file_handle handle;
+        char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
 };
+
+int update_reboot_param_file(const char *param);
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9ae8ab7..12432dd 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5621,13 +5621,10 @@ static int halt_parse_argv(int argc, char *argv[]) {
                 }
         }
 
-        if (arg_action == ACTION_REBOOT && argc == optind + 1) {
-                r = write_string_file(REBOOT_PARAM_FILE, argv[optind]);
-                if (r < 0) {
-                        log_error("Failed to write reboot param to "
-                                  REBOOT_PARAM_FILE": %s", strerror(-r));
+        if (arg_action == ACTION_REBOOT && (argc == optind || argc == optind + 1)) {
+                r = update_reboot_param_file(argc == optind + 1 ? argv[optind] : NULL);
+                if (r < 0)
                         return r;
-                }
         } else if (optind < argc) {
                 log_error("Too many arguments.");
                 return -EINVAL;

commit 91795825a093331ef136be1d630c5fcad299dfe8
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Sat Apr 19 13:22:35 2014 -0400

    implement a union to pad out file_handle
    
    Cases where name_to_handle_at is used allocated the full struct to be
    MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong
    since handle_bytes should describe the length of the flexible array
    member and not the whole struct.
    
    Define a union type which includes sufficient padding to allow
    assignment of MAX_HANDLE_SZ to be correct.
    
    (cherry picked from commit 370c860f748d149097710dc7952a64f627db9de7)
    
    Conflicts:
    	src/shared/util.h

diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index ba1b04d..85b1e40 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -108,15 +108,13 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev)
 
 /* we consider udev running when /dev is on devtmpfs */
 static bool udev_has_devtmpfs(struct udev *udev) {
-        struct file_handle *h;
+        union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ, };
         int mount_id;
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX], *e;
         int r;
 
-        h = alloca(MAX_HANDLE_SZ);
-        h->handle_bytes = MAX_HANDLE_SZ;
-        r = name_to_handle_at(AT_FDCWD, "/dev", h, &mount_id, 0);
+        r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0);
         if (r < 0)
                 return false;
 
diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c
index aea1fbe..1edf9cc 100644
--- a/src/readahead/readahead-common.c
+++ b/src/readahead/readahead-common.c
@@ -75,7 +75,7 @@ int fs_on_ssd(const char *p) {
         if (major(st.st_dev) == 0) {
                 _cleanup_fclose_ FILE *f = NULL;
                 int mount_id;
-                struct file_handle *h;
+                union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ, };
 
                 /* Might be btrfs, which exposes "ssd" as mount flag if it is on ssd.
                  *
@@ -83,9 +83,7 @@ int fs_on_ssd(const char *p) {
                  * and then lookup the mount ID in mountinfo to find
                  * the mount options. */
 
-                h = alloca(MAX_HANDLE_SZ);
-                h->handle_bytes = MAX_HANDLE_SZ;
-                r = name_to_handle_at(AT_FDCWD, p, h, &mount_id, AT_SYMLINK_FOLLOW);
+                r = name_to_handle_at(AT_FDCWD, p, &h.handle, &mount_id, AT_SYMLINK_FOLLOW);
                 if (r < 0)
                         return false;
 
diff --git a/src/shared/util.h b/src/shared/util.h
index aeb359b..98a7485 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -22,6 +22,7 @@
 ***/
 
 #include <alloca.h>
+#include <fcntl.h>
 #include <inttypes.h>
 #include <time.h>
 #include <sys/time.h>
@@ -883,3 +884,8 @@ int fd_warn_permissions(const char *path, int fd);
 
 unsigned long personality_from_string(const char *p);
 const char *personality_to_string(unsigned long);
+
+union file_handle_union {
+  struct file_handle handle;
+  char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
+};
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 6e36dc7..8211ff4 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -216,19 +216,16 @@ static bool unix_socket_alive(const char *fn) {
 }
 
 static int dir_is_mount_point(DIR *d, const char *subdir) {
-        struct file_handle *h;
+        union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ };
         int mount_id_parent, mount_id;
         int r_p, r;
 
-        h = alloca(MAX_HANDLE_SZ);
-
-        h->handle_bytes = MAX_HANDLE_SZ;
-        r_p = name_to_handle_at(dirfd(d), ".", h, &mount_id_parent, 0);
+        r_p = name_to_handle_at(dirfd(d), ".", &h.handle, &mount_id_parent, 0);
         if (r_p < 0)
                 r_p = -errno;
 
-        h->handle_bytes = MAX_HANDLE_SZ;
-        r = name_to_handle_at(dirfd(d), subdir, h, &mount_id, 0);
+        h.handle.handle_bytes = MAX_HANDLE_SZ;
+        r = name_to_handle_at(dirfd(d), subdir, &h.handle, &mount_id, 0);
         if (r < 0)
                 r = -errno;
 

commit ea082a72550975b831076e135f89c035259fdca8
Author: Greg KH <gregkh at linuxfoundation.org>
Date:   Tue Apr 15 14:12:01 2014 -0700

    tmpfiles: fix permissions on new journal files
    
    When starting up journald on a new system, set the proper permissions on
    the system.journal files, not only on the journal directory.
    
    (cherry picked from commit a606871da508995f5ede113a8fc6538afd98966c)

diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf
index 7c6d6b9..c470045 100644
--- a/tmpfiles.d/systemd.conf
+++ b/tmpfiles.d/systemd.conf
@@ -23,6 +23,6 @@ d /run/systemd/machines 0755 root root -
 d /run/systemd/shutdown 0755 root root -
 
 m /var/log/journal 2755 root systemd-journal - -
-m /var/log/journal/%m 2755 root systemd-journal - -
+Z /var/log/journal/%m 2755 root systemd-journal - -
 m /run/log/journal 2755 root systemd-journal - -
-m /run/log/journal/%m 2755 root systemd-journal - -
+Z /run/log/journal/%m 2755 root systemd-journal - -



More information about the systemd-commits mailing list