|
|
71e593 |
From f47940356462a3f477fe462e71d7680c959300db Mon Sep 17 00:00:00 2001
|
|
|
71e593 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
71e593 |
Date: Wed, 14 Nov 2018 11:48:08 +0100
|
|
|
71e593 |
Subject: [PATCH] sss_iface: prevent from using invalid names that start with
|
|
|
71e593 |
digits
|
|
|
71e593 |
|
|
|
71e593 |
https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
|
|
|
71e593 |
|
|
|
71e593 |
- Bus names that start with a colon (':') character are unique connection names. Other bus names are called well-known bus names.
|
|
|
71e593 |
- Bus names are composed of 1 or more elements separated by a period ('.') character. All elements must contain at least one character.
|
|
|
71e593 |
- Each element must only contain the ASCII characters "[A-Z][a-z][0-9]_-", with "-" discouraged in new bus names. Only elements that are part of a unique connection name may begin with a digit, elements in other bus names must not begin with a digit.
|
|
|
71e593 |
- Bus names must contain at least one '.' (period) character (and thus at least two elements).
|
|
|
71e593 |
- Bus names must not begin with a '.' (period) character.
|
|
|
71e593 |
- Bus names must not exceed the maximum name length (255).
|
|
|
71e593 |
|
|
|
71e593 |
Resolves:
|
|
|
71e593 |
https://pagure.io/SSSD/sssd/issue/3872
|
|
|
71e593 |
|
|
|
71e593 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
71e593 |
---
|
|
|
71e593 |
src/sss_iface/sss_iface.c | 8 ++++++--
|
|
|
71e593 |
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
71e593 |
|
|
|
71e593 |
diff --git a/src/sss_iface/sss_iface.c b/src/sss_iface/sss_iface.c
|
|
|
71e593 |
index 644abd71c..e20c14fea 100644
|
|
|
71e593 |
--- a/src/sss_iface/sss_iface.c
|
|
|
71e593 |
+++ b/src/sss_iface/sss_iface.c
|
|
|
71e593 |
@@ -56,7 +56,9 @@ sss_iface_domain_bus(TALLOC_CTX *mem_ctx,
|
|
|
71e593 |
return NULL;
|
|
|
71e593 |
}
|
|
|
71e593 |
|
|
|
71e593 |
- bus_name = talloc_asprintf(mem_ctx, "sssd.domain.%s", safe_name);
|
|
|
71e593 |
+ /* Parts of bus names must not start with digit thus we concatenate
|
|
|
71e593 |
+ * the name with underscore instead of period. */
|
|
|
71e593 |
+ bus_name = talloc_asprintf(mem_ctx, "sssd.domain_%s", safe_name);
|
|
|
71e593 |
talloc_free(safe_name);
|
|
|
71e593 |
|
|
|
71e593 |
return bus_name;
|
|
|
71e593 |
@@ -66,7 +68,9 @@ char *
|
|
|
71e593 |
sss_iface_proxy_bus(TALLOC_CTX *mem_ctx,
|
|
|
71e593 |
uint32_t id)
|
|
|
71e593 |
{
|
|
|
71e593 |
- return talloc_asprintf(mem_ctx, "sssd.proxy.%"PRIu32, id);
|
|
|
71e593 |
+ /* Parts of bus names must not start with digit thus we concatenate
|
|
|
71e593 |
+ * the name with underscore instead of period. */
|
|
|
71e593 |
+ return talloc_asprintf(mem_ctx, "sssd.proxy_%"PRIu32, id);
|
|
|
71e593 |
}
|
|
|
71e593 |
|
|
|
71e593 |
errno_t
|
|
|
71e593 |
--
|
|
|
71e593 |
2.19.1
|
|
|
71e593 |
|