[systemd-commits] 3 commits - TODO src/libsystemd-network src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jan 28 08:48:44 PST 2015


 TODO                                   |    8 ++++++++
 src/libsystemd-network/sd-dhcp-lease.c |   14 ++++++++++++++
 src/shared/util.c                      |    5 +++++
 3 files changed, 27 insertions(+)

New commits:
commit 40672b99c7da7efd317fc31612504fe7d5ab0b65
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 28 17:48:05 2015 +0100

    util: add comment explaining hostname_is_valid()

diff --git a/src/shared/util.c b/src/shared/util.c
index 891182a..11cab6d 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4248,6 +4248,11 @@ bool hostname_is_valid(const char *s) {
         if (isempty(s))
                 return false;
 
+        /* Doesn't accept empty hostnames, hostnames with trailing or
+         * leading dots, and hostnames with multiple dots in a
+         * sequence. Also ensures that the length stays below
+         * HOST_NAME_MAX. */
+
         for (p = s, dot = true; *p; p++) {
                 if (*p == '.') {
                         if (dot)

commit 477e75ef9ea6bb2e7e8cc76278c442942110f227
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 28 17:48:01 2015 +0100

    update TODO

diff --git a/TODO b/TODO
index 7f5db20..3073c07 100644
--- a/TODO
+++ b/TODO
@@ -31,6 +31,14 @@ External:
 
 Features:
 
+* The udev blkid built-in should expose a property that reflects
+  whether media was sensed in USB CF/SD card readers. This should then
+  be used to control SYSTEMD_READY=1/0 so that USB card readers aren't
+  picked up by systemd unless they contain a medium. This would mirror
+  the behaviour we already have for CD drives.
+
+* We should remove really old cruft from cdrom_id
+
 * nspawn: emulate /dev/kmsg using CUSE and turn off the syslog syscall
   with seccomp. That should provide us with a useful log buffer that
   systemd can log to during early boot, and disconnect container logs

commit f50f01f4b738f2f00b30d0e02e8cf54ab99a9f27
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jan 28 17:47:37 2015 +0100

    sd-dhcp: chop of trailing dot of DHCP supplied host and domain nams

diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 00fef16..34aa36c 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -497,11 +497,20 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option,
         case DHCP_OPTION_DOMAIN_NAME:
         {
                 _cleanup_free_ char *domainname = NULL;
+                char *e;
 
                 r = lease_parse_string(option, len, &domainname);
                 if (r < 0)
                         return r;
 
+                /* Chop off trailing dot of domain name that some DHCP
+                 * servers send us back. Internally we want to store
+                 * host names without trailing dots and
+                 * host_name_is_valid() doesn't accept them. */
+                e = endswith(domainname, ".");
+                if (e)
+                        *e = 0;
+
                 if (!hostname_is_valid(domainname) || is_localhost(domainname))
                         break;
 
@@ -514,11 +523,16 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option,
         case DHCP_OPTION_HOST_NAME:
         {
                 _cleanup_free_ char *hostname = NULL;
+                char *e;
 
                 r = lease_parse_string(option, len, &hostname);
                 if (r < 0)
                         return r;
 
+                e = endswith(hostname, ".");
+                if (e)
+                        *e = 0;
+
                 if (!hostname_is_valid(hostname) || is_localhost(hostname))
                         break;
 



More information about the systemd-commits mailing list