[systemd-commits] stable Branch 'v216-stable' - 9 commits - hwdb/60-keyboard.hwdb shell-completion/zsh src/journal src/login src/shared src/sysv-generator src/timesync src/tmpfiles

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Jan 22 07:58:48 PST 2015


 hwdb/60-keyboard.hwdb               |    6 ++++--
 shell-completion/zsh/_systemctl.in  |    2 +-
 src/journal/journald-syslog.c       |    6 +++---
 src/login/logind-session-device.c   |    2 +-
 src/shared/util.c                   |    4 ++++
 src/sysv-generator/sysv-generator.c |   21 ++++++++++++++++++---
 src/timesync/timesyncd-manager.c    |    3 ++-
 src/tmpfiles/tmpfiles.c             |    8 +++-----
 8 files changed, 36 insertions(+), 16 deletions(-)

New commits:
commit 2b5a60aca874ab526d33912391ea491c267d246f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jan 22 11:36:02 2015 +1000

    logind: fix sd_eviocrevoke ioctl call
    
    If the third argument is non-null, the kernel will always error out with
    EINVAL and devices won't get revoked.
    
    Reported-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 8dbce34b0373923c7aa7d795024bbedb0a85c7ea)

diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index 932abb8..c2de862 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -107,7 +107,7 @@ static int sd_eviocrevoke(int fd) {
 
         assert(fd >= 0);
 
-        r = ioctl(fd, EVIOCREVOKE, 1);
+        r = ioctl(fd, EVIOCREVOKE, NULL);
         if (r < 0) {
                 r = -errno;
                 if (r == -EINVAL && !warned) {

commit 8874d83156b00e483e5d5d4a264a536355efaf07
Author: Cristian Rodríguez <crrodriguez at opensuse.org>
Date:   Wed Jan 14 02:51:41 2015 -0300

    sysv-generator: only allow regular files in enumerate_sysv()
    
    Otherwise, if the directory contains other directories we fail
    at fopen in load_sysv() with EISDIR.
    
    (cherry picked from commit 0814f65ec6feba5efcf0f5b14c054f3c40e4cd8f)
    
    Conflicts:
    	src/sysv-generator/sysv-generator.c

diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 6bb9ca0..c97db79 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -745,8 +745,10 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
                         struct stat st;
                         int r;
 
-                        if (ignore_file(de->d_name))
-                                continue;
+                        dirent_ensure_type(d, de);
+
+                        if (!dirent_is_file(de))
+                            continue;
 
                         if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
                                 log_warning("stat() failed on %s/%s: %s",

commit 02df84807928361cc5dc546cbf85c0b1d6049c85
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Jan 9 01:27:31 2015 -0500

    tmpfiles: make sure not to concatenate non-absolute path
    
    If the path is absolute was only checked later.
    Also do not check if path if absolute if we just
    specified it starting with a slash.
    
    (cherry picked from commit 222c47f47615a275b9a9862a45f9b91b01eb8be5)

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 2904138..2f63722 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -1259,7 +1259,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
 
         case CREATE_SYMLINK:
                 if (!i->argument) {
-                        i->argument = strappend("/usr/share/factory", i->path);
+                        i->argument = strappend("/usr/share/factory/", i->path);
                         if (!i->argument)
                                 return log_oom();
                 }
@@ -1274,12 +1274,10 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
 
         case COPY_FILES:
                 if (!i->argument) {
-                        i->argument = strappend("/usr/share/factory", i->path);
+                        i->argument = strappend("/usr/share/factory/", i->path);
                         if (!i->argument)
                                 return log_oom();
-                }
-
-                if (!path_is_absolute(i->argument)) {
+                } else if (!path_is_absolute(i->argument)) {
                         log_error("[%s:%u] Source path is not absolute.", fname, line);
                         return -EBADMSG;
                 }

commit 1fe702291728a81388305a797329e5ac4956b8c4
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Wed Jan 21 15:26:13 2015 +0100

    util: Add some missing hidden_file() suffixes
    
    dpkg itself also uses *.dpkg-dist, while .dpkg-{bak,backup,remove} are being
    used by dpkg-maintscript-helper.
    
    (cherry picked from commit c7088e4999f2e5dd33259948c806f4e2706e77ce)

diff --git a/src/shared/util.c b/src/shared/util.c
index 688aa8b..6f22f2b 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1441,6 +1441,10 @@ _pure_ static bool ignore_file_allow_backup(const char *filename) {
                 endswith(filename, ".dpkg-old") ||
                 endswith(filename, ".dpkg-new") ||
                 endswith(filename, ".dpkg-tmp") ||
+                endswith(filename, ".dpkg-dist") ||
+                endswith(filename, ".dpkg-bak") ||
+                endswith(filename, ".dpkg-backup") ||
+                endswith(filename, ".dpkg-remove") ||
                 endswith(filename, ".swp");
 }
 

commit cd1694328b8e947875bdd7a7356fbf798a52e18f
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Tue Jan 20 16:41:31 2015 +0100

    sysv-generator: Handle .sh suffixes when translating Provides:
    
    When deciding whether the provided name equals the file name in
    sysv_translate_facility(), also consider them equal if the file name has a
    ".sh" suffix.
    
    This was uncovered by commit b7e7184 which then created a symlink
    "<name>.service" to itself for ".sh" suffixed init.d scripts.
    
    For additional robustness, refuse to create symlinks to itself in add_alias().
    
    Add test case which reproduces the bug.
    
    https://bugs.debian.org/775889
    (cherry picked from commit 29e0e6d8c1f7f648b7c998880d034eaa3e58c53a)
    
    Conflicts:
    	test/sysv-generator-test.py

diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index bf49b24..6bb9ca0 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -119,6 +119,11 @@ static int add_alias(const char *service, const char *alias) {
         assert(service);
         assert(alias);
 
+        if (streq(service, alias)) {
+                log_error("Ignoring creation of an alias %s for itself", service);
+                return 0;
+        }
+
         link = strjoin(arg_dest, "/", alias, NULL);
         if (!link)
                 return log_oom();
@@ -268,6 +273,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
         unsigned i;
         char *r;
         const char *n;
+        _cleanup_free_ char *filename_no_sh = NULL;
 
         assert(name);
         assert(_r);
@@ -289,6 +295,13 @@ static int sysv_translate_facility(const char *name, const char *filename, char
                 goto finish;
         }
 
+        /* strip ".sh" suffix from file name for comparison */
+        filename_no_sh = strdup(filename);
+        if (!filename_no_sh)
+                return -ENOMEM;
+        if (endswith(filename, ".sh"))
+                filename_no_sh[strlen(filename)-3] = '\0';
+
         /* If we don't know this name, fallback heuristics to figure
          * out whether something is a target or a service alias. */
 
@@ -298,7 +311,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
 
                 /* Facilities starting with $ are most likely targets */
                 r = unit_name_build(n, NULL, ".target");
-        } else if (filename && streq(name, filename))
+        } else if (filename && streq(name, filename_no_sh))
                 /* Names equaling the file name of the services are redundant */
                 return 0;
         else

commit 260a413d76d67aeb7c20108ac1f40e677f26811d
Author: Christian Seiler <christian at iwakd.de>
Date:   Tue Jan 13 11:53:25 2015 +0100

    journal: Fix syslog forwarding without CAP_SYS_ADMIN
    
    In case CAP_SYS_ADMIN is missing (like in containers), one cannot fake pid in
    struct ucred (uid/gid are fine if CAP_SETUID/CAP_SETGID are present).
    
    Ensure that journald will try again to forward the messages to syslog without
    faking the SCM_CREDENTIALS pid (which isn't guaranteed to succeed anyway, since
    it also does the same thing if the process has already exited).
    
    With this patch, journald will no longer silently discard messages
    that are supposed to be sent to syslog in these situations.
    
    https://bugs.debian.org/775067
    (cherry picked from commit ccf23ad5faf228d450d263d7291156a948b61af2)

diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
index 79c07ff..7ca0147 100644
--- a/src/journal/journald-syslog.c
+++ b/src/journal/journald-syslog.c
@@ -85,12 +85,12 @@ static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned
                 return;
         }
 
-        if (ucred && errno == ESRCH) {
+        if (ucred && (errno == ESRCH || errno == EPERM)) {
                 struct ucred u;
 
                 /* Hmm, presumably the sender process vanished
-                 * by now, so let's fix it as good as we
-                 * can, and retry */
+                 * by now, or we don't have CAP_SYS_AMDIN, so
+                 * let's fix it as good as we can, and retry */
 
                 u = *ucred;
                 u.pid = getpid();

commit ca6494000fc1f396853baeeaaf880f8bf9b7d48f
Author: Wieland Hoffmann <themineo at gmail.com>
Date:   Sat Jan 17 02:10:42 2015 +0100

    zsh-completion: Do not interpret escape sequences in _filter_units_by_property
    
    This makes all functions that rely on _filter_units_by_property() (like
    _systemctl_{stop,kill,try_restart}) work with unit names that contain backslash
    escaped sequences (like automount units with spaces that are escaped to
    "\x20").
    
    (cherry picked from commit e37b56c7355a9b84ac1e1893ab828b19aa1dc217)

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 0ee4856..acc0bb7 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -136,7 +136,7 @@ _filter_units_by_property() {
     unit=${units[i]}
     prop=${(f)"$(_call_program units "$service show --no-pager --property="$property" ${unit} 2>/dev/null")"}
     if [[ "${prop}" = "$property=$value" ]]; then
-      echo " ${unit}"
+      echo -E - " ${unit}"
     fi
   done
 }

commit 26ba2d214376ba0ebcf8b1b0dedca2fb5fb5733a
Author: Topi Miettinen <toiwoton at gmail.com>
Date:   Sun Jan 18 16:01:25 2015 +0200

    timesyncd: consider too long packets as invalid
    
    If the received NTP message from server didn't fit to our buffer, either
    it is doing something nasty or we don't know the protocol. Consider the
    packet as invalid.
    
    (David: add parantheses around conditional)
    
    (cherry picked from commit 43fcd650e5cb0836cfc9f667ed74b3bc0283a81c)

diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index 3ae01eb..7c5632b 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -534,7 +534,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
                 return manager_connect(m);
         }
 
-        if (iov.iov_len < sizeof(struct ntp_msg)) {
+        /* Too short or too long packet? */
+        if (iov.iov_len < sizeof(struct ntp_msg) || (msghdr.msg_flags & MSG_TRUNC)) {
                 log_warning("Invalid response from server. Disconnecting.");
                 return manager_connect(m);
         }

commit 413b5781796351af0f66cf53f99f2e226d23b629
Author: Maxim Mikityanskiy <maxtram95 at gmail.com>
Date:   Sat Jan 17 11:27:12 2015 -0500

    hwdb: restore comments about MSI devices
    
    Some time ago 95-keymap.rules was replaced by
    60-keyboard.hwdb. Original comments for MSI laptops (that were in
    95-keymap.rules) were removed, but I think they are important for
    understanding what's going on.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=88412
    (cherry picked from commit 288026bda90245ae6523441ce308d58ad1caefc8)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index f27eb7e..c6c07e8 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -800,14 +800,16 @@ keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnGE70*:pvr*
 keyboard:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*:pvr*
  KEYBOARD_KEY_c2=ejectcd
 
-#
+# some MSI models generate ACPI/input events on the LNXVIDEO input devices,
+# plus some extra synthesized ones on atkbd as an echo of actually changing the
+# brightness; so ignore those atkbd ones, to avoid loops
 keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U-100*:pvr*
 keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U100*:pvr*
 keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*N033:*
  KEYBOARD_KEY_f7=reserved
  KEYBOARD_KEY_f8=reserved
 
-#
+# MSI Wind U90/U100 generates separate touchpad on/off keycodes so ignore touchpad toggle keycode
 keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:*
  KEYBOARD_KEY_e4=reserved
 



More information about the systemd-commits mailing list