]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #4119 from keszybz/drop-more-kdbus
authorEvgeny Vereshchagin <evvers@ya.ru>
Sat, 10 Sep 2016 06:26:43 +0000 (09:26 +0300)
committerGitHub <noreply@github.com>
Sat, 10 Sep 2016 06:26:43 +0000 (09:26 +0300)
Drop more kdbus functionality

src/core/dbus-unit.c
src/core/service.c
src/shared/dns-domain.c
src/test/test-dns-domain.c

index 1b86bdde438f75358b652009311a76a23f51a3ae..5020dfba4b0e8cb92c06cc4148bc3fbe623ae76c 100644 (file)
@@ -1167,7 +1167,7 @@ void bus_unit_send_removed_signal(Unit *u) {
         int r;
         assert(u);
 
-        if (!u->sent_dbus_new_signal)
+        if (!u->sent_dbus_new_signal || u->in_dbus_queue)
                 bus_unit_send_change_signal(u);
 
         if (!u->id)
index 57f8d90ee5bf13305c0eda533348fa2c6602c132..99a70395fc6cc85fe4a94cef1eeef00aca943ddb 100644 (file)
@@ -1261,8 +1261,7 @@ static int service_spawn(
 
                         /* ENOTCONN is legitimate if the endpoint disappeared on shutdown.
                          * This connection is over, but the socket unit lives on. */
-                        if (r != -ENOTCONN ||
-                            (c != s->exec_command[SERVICE_EXEC_STOP] && c != s->exec_command[SERVICE_EXEC_STOP_POST]))
+                        if (r != -ENOTCONN || !IN_SET(s->control_command_id, SERVICE_EXEC_STOP, SERVICE_EXEC_STOP_POST))
                                 return r;
                 }
 
index 835557c6b2c67ed4e6ffba61e810c8ba4d391f81..892f0aadf586a89a7439e37313b81007b465a74f 100644 (file)
@@ -131,6 +131,10 @@ int dns_label_unescape(const char **name, char *dest, size_t sz) {
         if (r == 0 && *n)
                 return -EINVAL;
 
+        /* More than one trailing dot? */
+        if (*n == '.')
+                return -EINVAL;
+
         if (sz >= 1 && d)
                 *d = 0;
 
index a9d09f59bcb4eb005542c011e373f0104a5d1ef7..e2f097c95e2ab1ce6fd664c035cb3626afefdea0 100644 (file)
@@ -48,6 +48,7 @@ static void test_dns_label_unescape(void) {
         test_dns_label_unescape_one("..", "", 20, -EINVAL);
         test_dns_label_unescape_one(".foobar", "", 20, -EINVAL);
         test_dns_label_unescape_one("foobar.", "foobar", 20, 6);
+        test_dns_label_unescape_one("foobar..", "foobar", 20, -EINVAL);
 }
 
 static void test_dns_name_to_wire_format_one(const char *what, const char *expect, size_t buffer_sz, int ret) {
@@ -359,6 +360,7 @@ static void test_dns_name_is_valid_one(const char *s, int ret) {
 static void test_dns_name_is_valid(void) {
         test_dns_name_is_valid_one("foo", 1);
         test_dns_name_is_valid_one("foo.", 1);
+        test_dns_name_is_valid_one("foo..", 0);
         test_dns_name_is_valid_one("Foo", 1);
         test_dns_name_is_valid_one("foo.bar", 1);
         test_dns_name_is_valid_one("foo.bar.baz", 1);
@@ -366,6 +368,7 @@ static void test_dns_name_is_valid(void) {
         test_dns_name_is_valid_one("foo..bar", 0);
         test_dns_name_is_valid_one(".foo.bar", 0);
         test_dns_name_is_valid_one("foo.bar.", 1);
+        test_dns_name_is_valid_one("foo.bar..", 0);
         test_dns_name_is_valid_one("\\zbar", 0);
         test_dns_name_is_valid_one("รค", 1);
         test_dns_name_is_valid_one("\n", 0);