[systemd-commits] 22 commits - configure.ac Makefile.am man/os-release.xml man/systemd.unit.xml po/POTFILES.in src/hostname src/libsystemd src/libudev src/locale src/login src/machine src/nspawn src/run src/shared src/test src/timedate src/timesync src/tmpfiles src/udev TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Dec 25 08:13:40 PST 2014


 Makefile.am                         |    2 
 TODO                                |    2 
 configure.ac                        |   13 ---
 man/os-release.xml                  |   19 ++---
 man/systemd.unit.xml                |   10 ++
 po/POTFILES.in                      |    1 
 src/hostname/hostnamed.c            |    1 
 src/libsystemd/sd-bus/bus-objects.c |    2 
 src/libsystemd/sd-bus/bus-util.c    |    1 
 src/libudev/libudev-monitor.c       |   24 +++---
 src/locale/localed.c                |    1 
 src/login/logind-dbus.c             |    1 
 src/login/logind-seat-dbus.c        |    1 
 src/login/logind-session-dbus.c     |    1 
 src/login/logind-user-dbus.c        |    1 
 src/login/pam_systemd.c             |    1 
 src/machine/machine-dbus.c          |    1 
 src/machine/machined-dbus.c         |    1 
 src/nspawn/nspawn.c                 |    2 
 src/run/run.c                       |   12 +--
 src/shared/cap-list.c               |    4 +
 src/shared/cap-list.h               |    1 
 src/test/test-cap-list.c            |    7 +-
 src/timedate/timedated.c            |    1 
 src/timesync/timesyncd-manager.c    |    6 -
 src/tmpfiles/tmpfiles.c             |    1 
 src/udev/ata_id/ata_id.c            |  124 +++++++++++++++---------------------
 27 files changed, 103 insertions(+), 138 deletions(-)

New commits:
commit b7a4d8de9273fab20e1e32e4846b6a866884e07a
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 25 11:12:54 2014 -0500

    man: add a note why %U,%h,%s are mostly useless
    
    The reasons were already given in the description of %U, but the
    are easy to overlook, and it's better to be explicit to avoid
    confusion.

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 2e298ca..1afa600 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -1556,6 +1556,16 @@
                     </tbody>
                   </tgroup>
                 </table>
+
+		<para>Please note that specifiers
+		<literal>%U</literal>, <literal>%h</literal>,
+		<literal>%s</literal> are mostly useless when systemd
+		is running in system mode.  PID 1 cannot query the
+		user account database for information, so the
+		specifiers only work as shortcuts for things which are
+		already specified in a different way in the unit
+		file. They are fully functional when systemd is
+		running in <option>--user</option> mode.</para>
         </refsect1>
 
         <refsect1>

commit aa1aad74e6b14730542c26a7c17c5d06c62b6089
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 25 10:52:38 2014 -0500

    run: uninitialized variable

diff --git a/src/run/run.c b/src/run/run.c
index b183e4e..22abb0e 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -423,16 +423,12 @@ static int transient_cgroup_set_properties(sd_bus_message *m) {
 }
 
 static int transient_kill_set_properties(sd_bus_message *m) {
-        int r;
         assert(m);
 
-        if (arg_send_sighup) {
-                r = sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", arg_send_sighup);
-                if (r < 0)
-                        return r;
-        }
-
-        return r;
+        if (arg_send_sighup)
+                return sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", arg_send_sighup);
+        else
+                return 0;
 }
 
 static int transient_service_set_properties(sd_bus_message *m, char **argv, const char *pty_path) {

commit 3dd0bbeb153040ca59899f770e5b0714947ea3cb
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 25 10:44:34 2014 -0500

    ata_id: remove temp variable to kill warning
    
    src/udev/ata_id/ata_id.c:503:24: warning: assignment from incompatible pointer type
             identify_words = &identify.wyde;
                            ^

diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index 97d1dc4..e6344f9 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -415,7 +415,6 @@ int main(int argc, char *argv[])
                 uint16_t wyde[256];
                 uint64_t octa[64];
         } identify;
-        uint16_t *identify_words;
         char model[41];
         char model_enc[256];
         char serial[21];
@@ -500,7 +499,6 @@ int main(int argc, char *argv[])
                         return 2;
                 }
         }
-        identify_words = &identify.wyde;
 
         memcpy (model, id.model, 40);
         model[40] = '\0';
@@ -614,7 +612,8 @@ int main(int argc, char *argv[])
                  * the device does not claim compliance with the Serial ATA specification and words
                  * 76 through 79 are not valid and shall be ignored.
                  */
-                word = identify_words[76];
+
+                word = identify.wyde[76];
                 if (word != 0x0000 && word != 0xffff) {
                         printf("ID_ATA_SATA=1\n");
                         /*
@@ -631,7 +630,7 @@ int main(int argc, char *argv[])
                 }
 
                 /* Word 217 indicates the nominal media rotation rate of the device */
-                word = identify_words[217];
+                word = identify.wyde[217];
                 if (word == 0x0001)
                         printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */
                 else if (word >= 0x0401 && word <= 0xfffe)
@@ -642,16 +641,16 @@ int main(int argc, char *argv[])
                  * format. Word 108 bits (15:12) shall contain 5h, indicating that the naming authority is IEEE.
                  * All other values are reserved.
                  */
-                word = identify_words[108];
+                word = identify.wyde[108];
                 if ((word & 0xf000) == 0x5000)
                         printf("ID_WWN=0x%1$"PRIu64"x\n"
                                "ID_WWN_WITH_EXTENSION=0x%1$"PRIu64"x\n",
                                identify.octa[108/4]);
 
                 /* from Linux's include/linux/ata.h */
-                if (identify_words[0] == 0x848a ||
-                    identify_words[0] == 0x844a ||
-                    (identify_words[83] & 0xc004) == 0x4004)
+                if (identify.wyde[0] == 0x848a ||
+                    identify.wyde[0] == 0x844a ||
+                    (identify.wyde[83] & 0xc004) == 0x4004)
                         printf("ID_ATA_CFA=1\n");
         } else {
                 if (serial[0] != '\0')

commit 11c6f693e94e9013c8df91210b8b0e2e343de809
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 25 10:42:23 2014 -0500

    ata_id: modernize

diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index fc13819..97d1dc4 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -43,6 +43,7 @@
 
 #include "libudev.h"
 #include "libudev-private.h"
+#include "udev-util.h"
 #include "log.h"
 
 #define COMMAND_TIMEOUT_MSEC (30 * 1000)
@@ -407,7 +408,7 @@ out:
 
 int main(int argc, char *argv[])
 {
-        struct udev *udev;
+        _cleanup_udev_unref_ struct udev *udev = NULL;
         struct hd_driveid id;
         union {
                 uint8_t  byte[512];
@@ -421,9 +422,8 @@ int main(int argc, char *argv[])
         char revision[9];
         const char *node = NULL;
         int export = 0;
-        int fd;
+        _cleanup_close_ int fd = -1;
         uint16_t word;
-        int rc = 0;
         int is_packet_device = 0;
         static const struct option options[] = {
                 { "export", no_argument, NULL, 'x' },
@@ -436,7 +436,7 @@ int main(int argc, char *argv[])
 
         udev = udev_new();
         if (udev == NULL)
-                goto exit;
+                return 0;
 
         while (1) {
                 int option;
@@ -453,22 +453,20 @@ int main(int argc, char *argv[])
                         printf("Usage: ata_id [--export] [--help] <device>\n"
                                "  --export    print values as environment keys\n"
                                "  --help      print this help text\n\n");
-                        goto exit;
+                        return 0;
                 }
         }
 
         node = argv[optind];
         if (node == NULL) {
                 log_error("no node specified");
-                rc = 1;
-                goto exit;
+                return 1;
         }
 
         fd = open(node, O_RDONLY|O_NONBLOCK|O_CLOEXEC);
         if (fd < 0) {
                 log_error("unable to open '%s'", node);
-                rc = 1;
-                goto exit;
+                return 1;
         }
 
         if (disk_identify(udev, fd, identify.byte, &is_packet_device) == 0) {
@@ -499,8 +497,7 @@ int main(int argc, char *argv[])
                 /* If this fails, then try HDIO_GET_IDENTITY */
                 if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) {
                         log_debug_errno(errno, "HDIO_GET_IDENTITY failed for '%s': %m", node);
-                        rc = 2;
-                        goto close;
+                        return 2;
                 }
         }
         identify_words = &identify.wyde;
@@ -553,8 +550,8 @@ int main(int argc, char *argv[])
                 }
 
                 if (id.command_set_1 & (1<<5)) {
-                        printf ("ID_ATA_WRITE_CACHE=1\n");
-                        printf ("ID_ATA_WRITE_CACHE_ENABLED=%d\n", (id.cfs_enable_1 & (1<<5)) ? 1 : 0);
+                        printf("ID_ATA_WRITE_CACHE=1\n");
+                        printf("ID_ATA_WRITE_CACHE_ENABLED=%d\n", (id.cfs_enable_1 & (1<<5)) ? 1 : 0);
                 }
                 if (id.command_set_1 & (1<<10)) {
                         printf("ID_ATA_FEATURE_SET_HPA=1\n");
@@ -635,13 +632,10 @@ int main(int argc, char *argv[])
 
                 /* Word 217 indicates the nominal media rotation rate of the device */
                 word = identify_words[217];
-                if (word != 0x0000) {
-                        if (word == 0x0001) {
-                                printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */
-                        } else if (word >= 0x0401 && word <= 0xfffe) {
-                                printf ("ID_ATA_ROTATION_RATE_RPM=%d\n", word);
-                        }
-                }
+                if (word == 0x0001)
+                        printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */
+                else if (word >= 0x0401 && word <= 0xfffe)
+                        printf ("ID_ATA_ROTATION_RATE_RPM=%d\n", word);
 
                 /*
                  * Words 108-111 contain a mandatory World Wide Name (WWN) in the NAA IEEE Registered identifier
@@ -649,33 +643,22 @@ int main(int argc, char *argv[])
                  * All other values are reserved.
                  */
                 word = identify_words[108];
-                if ((word & 0xf000) == 0x5000) {
-                        uint64_t wwwn;
-
-                        wwwn = identify.octa[108/4];
-                        printf("ID_WWN=0x%llx\n", (unsigned long long int) wwwn);
-                        /* ATA devices have no vendor extension */
-                        printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn);
-                }
+                if ((word & 0xf000) == 0x5000)
+                        printf("ID_WWN=0x%1$"PRIu64"x\n"
+                               "ID_WWN_WITH_EXTENSION=0x%1$"PRIu64"x\n",
+                               identify.octa[108/4]);
 
                 /* from Linux's include/linux/ata.h */
-                if (identify_words[0] == 0x848a || identify_words[0] == 0x844a) {
+                if (identify_words[0] == 0x848a ||
+                    identify_words[0] == 0x844a ||
+                    (identify_words[83] & 0xc004) == 0x4004)
                         printf("ID_ATA_CFA=1\n");
-                } else {
-                        if ((identify_words[83] & 0xc004) == 0x4004) {
-                                printf("ID_ATA_CFA=1\n");
-                        }
-                }
         } else {
                 if (serial[0] != '\0')
                         printf("%s_%s\n", model, serial);
                 else
                         printf("%s\n", model);
         }
-close:
-        close(fd);
-exit:
-        udev_unref(udev);
-        log_close();
-        return rc;
+
+        return 0;
 }

commit f2c0b4f1b1340426d2cc42948964af55be35feb3
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:48 2014 -0800

    pam_systemd: remove spurious include of <sys/capability.h>
    
    It does not use any functions or constants from libcap directly.
    
    Tested that "pam_systemd.la" builds cleanly and works after this change.

diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
index 111e2b7..d5b29c8 100644
--- a/src/login/pam_systemd.c
+++ b/src/login/pam_systemd.c
@@ -24,7 +24,6 @@
 #include <sys/file.h>
 #include <pwd.h>
 #include <endian.h>
-#include <sys/capability.h>
 
 #include <security/pam_modules.h>
 #include <security/_pam_macros.h>

commit 88c49117685837fd1b9a43e4578238a825c8bcab
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:47 2014 -0800

    timedated: remove spurious include of <sys/capability.h>
    
    It does not use any functions from libcap directly. The CAP_SYS_TIME constant
    in use by this file comes from <linux/capability.h> imported through "missing.h".
    
    Tested that "systemd-timedated" builds cleanly and works after this change.

diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index bf567a1..d507200 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -22,7 +22,6 @@
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/capability.h>
 
 #include "sd-id128.h"
 #include "sd-messages.h"

commit 8ea763865ffe1e5462d9921c01f4b135e1008d59
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:46 2014 -0800

    localed: remove spurious include of <sys/capability.h>
    
    It does not use any functions from libcap directly. The CAP_SYS_ADMIN constant
    in use by this file comes from <linux/capability.h> imported through "missing.h".
    
    Tested that "systemd-localed" builds cleanly and works after this change.

diff --git a/src/locale/localed.c b/src/locale/localed.c
index 0aaa63d..0723541 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -23,7 +23,6 @@
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/capability.h>
 
 #include "sd-bus.h"
 

commit 946be29c98e1797f2e0912c5f2da31ee3816ee58
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:50 2014 -0800

    bus: remove spurious include of <sys/capability.h>
    
    They do not use any functions from libcap directly. The CAP_SYS_ADMIN constant
    in use by bus-objects.c comes from <linux/capability.h> imported through
    "missing.h". The "missing.h" header is imported through "util.h" which gets
    imported in "bus-util.h".
    
    Tested that everything builds cleanly after this change.

diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 6162d12..e64743f 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -19,8 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/capability.h>
-
 #include "strv.h"
 #include "set.h"
 #include "bus-internal.h"
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
index 389b6ad..2c3da3c 100644
--- a/src/libsystemd/sd-bus/bus-util.c
+++ b/src/libsystemd/sd-bus/bus-util.c
@@ -20,7 +20,6 @@
 ***/
 
 #include <sys/socket.h>
-#include <sys/capability.h>
 
 #include "systemd/sd-daemon.h"
 

commit 9bb0c7cfbb253c5b983efaed51a65bcbf422d8d7
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:49 2014 -0800

    machined: remove spurious include of <sys/capability.h>
    
    They do not use any functions from libcap directly. The CAP_KILL constant in
    use by these files comes from <linux/capability.h> imported through
    "missing.h".
    
    Tested that "systemd-machined" builds cleanly and works after this change.

diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index e63b7ad..31a6fc4 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 #include <arpa/inet.h>
 
 #include "bus-util.h"
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index e264dac..1ca2c95 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -23,7 +23,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <pwd.h>
-#include <sys/capability.h>
 
 #include "sd-id128.h"
 #include "sd-messages.h"

commit ffbc903f030d9acd2c40e4defd8e549b046ec520
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:45 2014 -0800

    hostnamed: remove spurious include of <sys/capability.h>
    
    It does not use any functions from libcap directly. The CAP_SYS_ADMIN constant
    in use by this file comes from <linux/capability.h> imported through "missing.h".
    
    Tested that "systemd-hostnamed" builds cleanly and works after this change.

diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index ef45e56..b230ff6 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -23,7 +23,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/utsname.h>
-#include <sys/capability.h>
 
 #include "util.h"
 #include "strv.h"

commit 2395eb17ebd1033e53989e4a9b8745f921a7d965
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:44 2014 -0800

    tmpfiles: remove spurious include of <sys/capability.h>
    
    It does not use any functions from libcap directly. The CAP_MKNOD constant in
    use by this file comes from <linux/capability.h> imported through "missing.h".
    
    Tested that "systemd-tmpfiles" builds cleanly and works after this change.

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index d40bd96..44ea51e 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -38,7 +38,6 @@
 #include <sys/param.h>
 #include <glob.h>
 #include <fnmatch.h>
-#include <sys/capability.h>
 #include <sys/xattr.h>
 
 #include "log.h"

commit d920e59c7df63300e5b5191d2a4be7b3baac6ea8
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:43 2014 -0800

    logind: remove spurious include of <sys/capability.h>
    
    They do not use any functions from libcap directly. The CAP_* constants in use
    through these files come from "missing.h" which will import <linux/capability.h>
    and complement it with CAP_* constants not defined by the current kernel
    headers. The "missing.h" header is imported through "util.h" which gets
    imported in "logind.h".
    
    Tested that "systemd-logind" builds cleanly and works after this change.

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 8ea653f..c0d1309 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -23,7 +23,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <pwd.h>
-#include <sys/capability.h>
 
 #include "sd-id128.h"
 #include "sd-messages.h"
diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c
index ff87f0f..a99d008 100644
--- a/src/login/logind-seat-dbus.c
+++ b/src/login/logind-seat-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "util.h"
 #include "bus-util.h"
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index 8607d03..4e75d5b 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "util.h"
 #include "strv.h"
diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c
index 51793f6..812a19f 100644
--- a/src/login/logind-user-dbus.c
+++ b/src/login/logind-user-dbus.c
@@ -21,7 +21,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/capability.h>
 
 #include "strv.h"
 #include "bus-util.h"

commit f01ae8260d90ccff2f299242cd370ab58ea723f0
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:38:42 2014 -0800

    nspawn: remove spurious include of <sys/capability.h>
    
    It does not use any functions from libcap directly. The CAP_* constants in use
    through this file come from "missing.h" which will import <linux/capability.h>
    and complement it with CAP_* constants not defined by the current kernel
    headers.
    
    Add an explicit import of our "capability.h" since it does use the function
    capability_bounding_set_drop from that header file. Previously, that header was
    implicitly imported through through "cap-list.h".
    
    Tested that "systemd-nspawn" builds cleanly and works after this change.

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 0dd12ad..04396eb 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -31,7 +31,6 @@
 #include <stdio.h>
 #include <errno.h>
 #include <sys/prctl.h>
-#include <sys/capability.h>
 #include <getopt.h>
 #include <termios.h>
 #include <sys/signalfd.h>
@@ -90,6 +89,7 @@
 #include "base-filesystem.h"
 #include "barrier.h"
 #include "event-util.h"
+#include "capability.h"
 #include "cap-list.h"
 #include "btrfs-util.h"
 

commit 321a3f5133a415ad9c95e15e95e46556c08973aa
Author: Mantas Mikulėnas <grawity at gmail.com>
Date:   Wed Dec 24 14:46:20 2014 +0200

    doc: os-release: mention all shell characters that must be escaped
    
    Since the manpage already talks about shell-compatibility, it should be
    more accurate about what needs to be escaped and how.

diff --git a/man/os-release.xml b/man/os-release.xml
index b298304..b4cbeba 100644
--- a/man/os-release.xml
+++ b/man/os-release.xml
@@ -68,17 +68,16 @@
                 (this means variable expansion is explicitly not
                 supported), allowing applications to read the file
                 without implementing a shell compatible execution
-                engine. Variable assignment values should be enclosed
-                in double or single quotes if they include spaces,
+                engine. Variable assignment values must be enclosed in
+                double or single quotes if they include spaces,
                 semicolons or other special characters outside of A-Z,
-                a-z, 0-9. All strings should be in UTF-8 format, and
-                non-printable characters should not be used. If double
-                or single quotes or backslashes are to be used within
-                variable assignments, they should be escaped with
-                backslashes, following shell style. It is not
-                supported to concatenate multiple individually quoted
-                strings. Lines beginning with "#" shall be ignored as
-                comments.</para>
+                a-z, 0-9.  Shell special characters ("$", quotes,
+                backslash, backtick) must be escaped with backslashes,
+                following shell style.  All strings should be in UTF-8
+                format, and non-printable characters should not be used.
+                It is not supported to concatenate multiple individually
+                quoted strings. Lines beginning with "#" shall be
+                ignored as comments.</para>
 
                 <para>The file <filename>/etc/os-release</filename>
                 takes precedence over

commit 7115e487cd1881ae4934317ac5f91ee11d5e1a75
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:59:15 2014 -0800

    build-sys: remove references to dbusinterfacedir
    
    This directory is not used by systemd.
    
    Tested by running a full build, running `make install` and comparing the file
    list in the target trees and making sure that `make distcheck` still works.

diff --git a/configure.ac b/configure.ac
index f20c0e7..2348dac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1270,11 +1270,6 @@ AC_ARG_WITH([dbussystemservicedir],
         [],
         [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
 
-AC_ARG_WITH([dbusinterfacedir],
-        AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
-        [],
-        [with_dbusinterfacedir=${datadir}/dbus-1/interfaces])
-
 AC_ARG_WITH([bashcompletiondir],
         AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
         [],
@@ -1373,7 +1368,6 @@ test -z "$enable_debug" && enable_debug="none"
 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
-AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
 AC_SUBST([pamlibdir], [$with_pamlibdir])
@@ -1476,7 +1470,6 @@ AC_MSG_RESULT([
         D-Bus policy dir:        ${with_dbuspolicydir}
         D-Bus session dir:       ${with_dbussessionservicedir}
         D-Bus system dir:        ${with_dbussystemservicedir}
-        D-Bus interfaces dir:    ${with_dbusinterfacedir}
         Bash completions dir:    ${with_bashcompletiondir}
         Zsh completions dir:     ${with_zshcompletiondir}
         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}

commit 977db91c29083478c6fb7c7bf033e14c567df5d5
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 10:59:14 2014 -0800

    build-sys: do not use pkgconfig dbus-1.pc to find dbus directories
    
    Do not use the dbus-1.pc pkgconfig settings to determine dbus directories. Use
    directories relative to ${sysconfdir} and ${datadir} instead.
    
    This approach was suggested by Simon McVittie in:
    http://lists.freedesktop.org/archives/systemd-devel/2014-October/024388.html
    
    Tested by building and installing systemd without the dbus-devel installed.
    Without this patch, the dbus files and directories end up in the root of the
    filesystem. With this patch, they end up in the same locations as previously
    (assuming default ${sysconfdir} and ${datadir}) whether dbus-devel is present
    or not. Also made sure that `make check` works without dbus-devel installed.

diff --git a/TODO b/TODO
index 32c1061..d5b7ff2 100644
--- a/TODO
+++ b/TODO
@@ -140,8 +140,6 @@ Features:
 
 * systemd --user should issue sd_notify() upon reaching basic.target, not on becoming idle
 
-* configure.ac pretends dbus was optional but actually hardcodes use of dbus' pkg-config file to determine various dbus dirs such as policy and activation dirs
-
 * consider showing the unit names during boot up in the status output, not just the unit descriptions
 
 * dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from?
diff --git a/configure.ac b/configure.ac
index 0e72166..f20c0e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1258,22 +1258,22 @@ AC_SUBST(TTY_GID)
 AC_ARG_WITH([dbuspolicydir],
         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
         [],
-        [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
+        [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
 
 AC_ARG_WITH([dbussessionservicedir],
         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
         [],
-        [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)])
+        [with_dbussessionservicedir=${datadir}/dbus-1/services])
 
 AC_ARG_WITH([dbussystemservicedir],
         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
         [],
-        [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
+        [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
 
 AC_ARG_WITH([dbusinterfacedir],
         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
         [],
-        [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
+        [with_dbusinterfacedir=${datadir}/dbus-1/interfaces])
 
 AC_ARG_WITH([bashcompletiondir],
         AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),

commit fa66b606b1a79530bc0d7f70ff30955232e40694
Author: Cristian Rodríguez <crrodriguez at opensuse.org>
Date:   Tue Dec 23 17:52:51 2014 -0300

    timesync: remove square(), use pow instead
    
    In any case, the compiler generates the same code inline and never
    actually calls the library function.

diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index ef5854d..117ea8c 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -147,10 +147,6 @@ static double ts_to_d(const struct timespec *ts) {
         return ts->tv_sec + (1.0e-9 * ts->tv_nsec);
 }
 
-static double square(double d) {
-        return d * d;
-}
-
 static int manager_timeout(sd_event_source *source, usec_t usec, void *userdata) {
         _cleanup_free_ char *pretty = NULL;
         Manager *m = userdata;
@@ -428,7 +424,7 @@ static bool manager_sample_spike_detection(Manager *m, double offset, double del
 
         j = 0;
         for (i = 0; i < ELEMENTSOF(m->samples); i++)
-                j += square(m->samples[i].offset - m->samples[idx_min].offset);
+                j += pow(m->samples[i].offset - m->samples[idx_min].offset, 2);
         m->samples_jitter = sqrt(j / (ELEMENTSOF(m->samples) - 1));
 
         /* ignore samples when resyncing */

commit 097df453dab149f6b45f1b30510363acd8f11593
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 13:51:40 2014 -0800

    test: do not use last cap from kernel in test-cap-list
    
    The new test-cap-list introduced in commit 2822da4fb7f891 uses the included
    table of capabilities. However, it uses cap_last_cap() which probes the kernel
    for the last available capability. On an older kernel (e.g. 3.10 from RHEL 7)
    that causes the test to fail with the following message:
    
        Assertion '!capability_to_name(cap_last_cap()+1)' failed at src/test/test-cap-list.c:30, function main(). Aborting.
    
    Fix it by exporting the size of the static table and using it in the test
    instead of the dynamic one from the current kernel.
    
    Tested by successfully running ./test-cap-list and the whole `make check` test
    suite with this patch on a RHEL 7 host.

diff --git a/src/shared/cap-list.c b/src/shared/cap-list.c
index 56d1488..8033e8c 100644
--- a/src/shared/cap-list.c
+++ b/src/shared/cap-list.c
@@ -60,3 +60,7 @@ int capability_from_name(const char *name) {
 
         return sc->id;
 }
+
+int capability_list_length(void) {
+        return (int) ELEMENTSOF(capability_names);
+}
diff --git a/src/shared/cap-list.h b/src/shared/cap-list.h
index c699e46..9824fad 100644
--- a/src/shared/cap-list.h
+++ b/src/shared/cap-list.h
@@ -23,3 +23,4 @@
 
 const char *capability_to_name(int id);
 int capability_from_name(const char *name);
+int capability_list_length(void);
diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c
index 7c5ae18..4e75136 100644
--- a/src/test/test-cap-list.c
+++ b/src/test/test-cap-list.c
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "util.h"
 #include "log.h"
 #include "cap-list.h"
 #include "capability.h"
@@ -27,9 +28,9 @@ int main(int argc, char *argv[]) {
         int i;
 
         assert_se(!capability_to_name(-1));
-        assert_se(!capability_to_name(cap_last_cap()+1));
+        assert_se(!capability_to_name(capability_list_length()));
 
-        for (i = 0; i <= (int) cap_last_cap(); i++) {
+        for (i = 0; i < capability_list_length(); i++) {
                 const char *n;
 
                 assert_se(n = capability_to_name(i));
@@ -45,7 +46,7 @@ int main(int argc, char *argv[]) {
         assert_se(capability_from_name("15") == 15);
         assert_se(capability_from_name("-1") == -EINVAL);
 
-        for (i = 0; i <= (int) cap_last_cap(); i++) {
+        for (i = 0; i < capability_list_length(); i++) {
                 _cleanup_cap_free_charp_ char *a = NULL;
                 const char *b;
                 unsigned u;

commit 6024a6e302bad6bcf073fa84a41a6123305dc845
Author: Shawn Paul Landden <shawn at churchofgit.com>
Date:   Tue Dec 23 15:04:37 2014 -0800

    udev: fix another strict aliasing issue

diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index 89628c9..fc13819 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -409,7 +409,11 @@ int main(int argc, char *argv[])
 {
         struct udev *udev;
         struct hd_driveid id;
-        uint8_t identify[512];
+        union {
+                uint8_t  byte[512];
+                uint16_t wyde[256];
+                uint64_t octa[64];
+        } identify;
         uint16_t *identify_words;
         char model[41];
         char model_enc[256];
@@ -467,30 +471,30 @@ int main(int argc, char *argv[])
                 goto exit;
         }
 
-        if (disk_identify(udev, fd, identify, &is_packet_device) == 0) {
+        if (disk_identify(udev, fd, identify.byte, &is_packet_device) == 0) {
                 /*
                  * fix up only the fields from the IDENTIFY data that we are going to
                  * use and copy it into the hd_driveid struct for convenience
                  */
-                disk_identify_fixup_string(identify,  10, 20); /* serial */
-                disk_identify_fixup_string(identify,  23,  8); /* fwrev */
-                disk_identify_fixup_string(identify,  27, 40); /* model */
-                disk_identify_fixup_uint16(identify,  0);      /* configuration */
-                disk_identify_fixup_uint16(identify,  75);     /* queue depth */
-                disk_identify_fixup_uint16(identify,  75);     /* SATA capabilities */
-                disk_identify_fixup_uint16(identify,  82);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  83);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  84);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  85);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  86);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  87);     /* command set supported */
-                disk_identify_fixup_uint16(identify,  89);     /* time required for SECURITY ERASE UNIT */
-                disk_identify_fixup_uint16(identify,  90);     /* time required for enhanced SECURITY ERASE UNIT */
-                disk_identify_fixup_uint16(identify,  91);     /* current APM values */
-                disk_identify_fixup_uint16(identify,  94);     /* current AAM value */
-                disk_identify_fixup_uint16(identify, 128);     /* device lock function */
-                disk_identify_fixup_uint16(identify, 217);     /* nominal media rotation rate */
-                memcpy(&id, identify, sizeof id);
+                disk_identify_fixup_string(identify.byte,  10, 20); /* serial */
+                disk_identify_fixup_string(identify.byte,  23,  8); /* fwrev */
+                disk_identify_fixup_string(identify.byte,  27, 40); /* model */
+                disk_identify_fixup_uint16(identify.byte,  0);      /* configuration */
+                disk_identify_fixup_uint16(identify.byte,  75);     /* queue depth */
+                disk_identify_fixup_uint16(identify.byte,  75);     /* SATA capabilities */
+                disk_identify_fixup_uint16(identify.byte,  82);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  83);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  84);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  85);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  86);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  87);     /* command set supported */
+                disk_identify_fixup_uint16(identify.byte,  89);     /* time required for SECURITY ERASE UNIT */
+                disk_identify_fixup_uint16(identify.byte,  90);     /* time required for enhanced SECURITY ERASE UNIT */
+                disk_identify_fixup_uint16(identify.byte,  91);     /* current APM values */
+                disk_identify_fixup_uint16(identify.byte,  94);     /* current AAM value */
+                disk_identify_fixup_uint16(identify.byte, 128);     /* device lock function */
+                disk_identify_fixup_uint16(identify.byte, 217);     /* nominal media rotation rate */
+                memcpy(&id, identify.byte, sizeof id);
         } else {
                 /* If this fails, then try HDIO_GET_IDENTITY */
                 if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) {
@@ -499,7 +503,7 @@ int main(int argc, char *argv[])
                         goto close;
                 }
         }
-        identify_words = (uint16_t *) identify;
+        identify_words = &identify.wyde;
 
         memcpy (model, id.model, 40);
         model[40] = '\0';
@@ -613,7 +617,7 @@ int main(int argc, char *argv[])
                  * the device does not claim compliance with the Serial ATA specification and words
                  * 76 through 79 are not valid and shall be ignored.
                  */
-                word = *((uint16_t *) identify + 76);
+                word = identify_words[76];
                 if (word != 0x0000 && word != 0xffff) {
                         printf("ID_ATA_SATA=1\n");
                         /*
@@ -630,7 +634,7 @@ int main(int argc, char *argv[])
                 }
 
                 /* Word 217 indicates the nominal media rotation rate of the device */
-                word = *((uint16_t *) identify + 217);
+                word = identify_words[217];
                 if (word != 0x0000) {
                         if (word == 0x0001) {
                                 printf ("ID_ATA_ROTATION_RATE_RPM=0\n"); /* non-rotating e.g. SSD */
@@ -644,17 +648,11 @@ int main(int argc, char *argv[])
                  * format. Word 108 bits (15:12) shall contain 5h, indicating that the naming authority is IEEE.
                  * All other values are reserved.
                  */
-                word = *((uint16_t *) identify + 108);
+                word = identify_words[108];
                 if ((word & 0xf000) == 0x5000) {
                         uint64_t wwwn;
 
-                        wwwn   = *((uint16_t *) identify + 108);
-                        wwwn <<= 16;
-                        wwwn  |= *((uint16_t *) identify + 109);
-                        wwwn <<= 16;
-                        wwwn  |= *((uint16_t *) identify + 110);
-                        wwwn <<= 16;
-                        wwwn  |= *((uint16_t *) identify + 111);
+                        wwwn = identify.octa[108/4];
                         printf("ID_WWN=0x%llx\n", (unsigned long long int) wwwn);
                         /* ATA devices have no vendor extension */
                         printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn);

commit bf3dd6b1a73a22d86688ec1ceecea12cb4151fe8
Author: Shawn Paul Landden <shawn at churchofgit.com>
Date:   Tue Dec 23 15:04:36 2014 -0800

    libudev: fix strict aliasing violation

diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index e8d6b4a..484fefe 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -582,7 +582,10 @@ _public_ struct udev_device *udev_monitor_receive_device(struct udev_monitor *ud
         struct cmsghdr *cmsg;
         union sockaddr_union snl;
         struct ucred *cred;
-        char buf[8192];
+        union {
+                struct udev_monitor_netlink_header nlh;
+                char raw[8192];
+        } buf;
         ssize_t buflen;
         ssize_t bufpos;
 
@@ -642,29 +645,26 @@ retry:
         if (udev_device == NULL)
                 return NULL;
 
-        if (memcmp(buf, "libudev", 8) == 0) {
-                struct udev_monitor_netlink_header *nlh;
-
+        if (memcmp(buf.raw, "libudev", 8) == 0) {
                 /* udev message needs proper version magic */
-                nlh = (struct udev_monitor_netlink_header *) buf;
-                if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) {
+                if (buf.nlh.magic != htonl(UDEV_MONITOR_MAGIC)) {
                         log_debug("unrecognized message signature (%x != %x)",
-                                 nlh->magic, htonl(UDEV_MONITOR_MAGIC));
+                                 buf.nlh.magic, htonl(UDEV_MONITOR_MAGIC));
                         udev_device_unref(udev_device);
                         return NULL;
                 }
-                if (nlh->properties_off+32 > (size_t)buflen) {
+                if (buf.nlh.properties_off+32 > (size_t)buflen) {
                         udev_device_unref(udev_device);
                         return NULL;
                 }
 
-                bufpos = nlh->properties_off;
+                bufpos = buf.nlh.properties_off;
 
                 /* devices received from udev are always initialized */
                 udev_device_set_is_initialized(udev_device);
         } else {
                 /* kernel message with header */
-                bufpos = strlen(buf) + 1;
+                bufpos = strlen(buf.raw) + 1;
                 if ((size_t)bufpos < sizeof("a@/d") || bufpos >= buflen) {
                         log_debug("invalid message length");
                         udev_device_unref(udev_device);
@@ -672,7 +672,7 @@ retry:
                 }
 
                 /* check message header */
-                if (strstr(buf, "@/") == NULL) {
+                if (strstr(buf.raw, "@/") == NULL) {
                         log_debug("unrecognized message header");
                         udev_device_unref(udev_device);
                         return NULL;
@@ -685,7 +685,7 @@ retry:
                 char *key;
                 size_t keylen;
 
-                key = &buf[bufpos];
+                key = &buf.raw[bufpos];
                 keylen = strlen(key);
                 if (keylen == 0)
                         break;

commit e7aa89f9096de9e0173260267ed3f1914f860ebc
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 15:03:21 2014 -0800

    build-sys: update path in reference to sd-lldp.h
    
    The file was moved from src/libsystemd-network to src/systemd in commit
    7a6f1457462840 ("sd-lldp: minor header cleanup").
    
    This fixes "make distcheck".

diff --git a/Makefile.am b/Makefile.am
index fd1a8a5..f71bc9a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3055,6 +3055,7 @@ libsystemd_network_la_SOURCES = \
 	src/systemd/sd-dhcp6-client.h \
 	src/systemd/sd-dhcp6-lease.h \
 	src/systemd/sd-pppoe.h \
+	src/systemd/sd-lldp.h \
 	src/libsystemd-network/sd-dhcp-client.c \
 	src/libsystemd-network/sd-dhcp-server.c \
 	src/libsystemd-network/dhcp-network.c \
@@ -3090,7 +3091,6 @@ libsystemd_network_la_SOURCES = \
 	src/libsystemd-network/lldp-internal.h \
 	src/libsystemd-network/lldp-internal.c \
 	src/libsystemd-network/lldp-util.h \
-	src/libsystemd-network/sd-lldp.h \
 	src/libsystemd-network/sd-lldp.c
 
 libsystemd_network_la_LIBADD = \

commit 3fd1957f0d76a840b531aac2da56c55020271aae
Author: Filipe Brandenburger <filbranden at google.com>
Date:   Tue Dec 23 15:02:14 2014 -0800

    machined: add org.freedesktop.machine1.policy.in to POTFILES.in
    
    The new polkit file was introduced in commit d04c1fb8e21560 ("machined:
    introduce polkit for OpenLogin() call").

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2829c87..344c307 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,6 @@
 src/hostname/org.freedesktop.hostname1.policy.in
 src/locale/org.freedesktop.locale1.policy.in
 src/login/org.freedesktop.login1.policy.in
+src/machine/org.freedesktop.machine1.policy.in
 src/timedate/org.freedesktop.timedate1.policy.in
 src/core/org.freedesktop.systemd1.policy.in.in



More information about the systemd-commits mailing list