diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-03 17:57:29 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-04 13:58:15 +0200 |
commit | e7e61c777e13e0bb07d29b5d1b53e21ca199bf0f (patch) | |
tree | 8df9ba7219d20459d7cfd2d267022acd2c32d545 /src | |
parent | 366c3020ca995563d2be1bb871a1164cca2f5427 (diff) | |
download | sssd-e7e61c777e13e0bb07d29b5d1b53e21ca199bf0f.tar.gz sssd-e7e61c777e13e0bb07d29b5d1b53e21ca199bf0f.tar.xz sssd-e7e61c777e13e0bb07d29b5d1b53e21ca199bf0f.zip |
LDAP: Do not print verbose DEBUG messages from providers that don't set UUID
https://fedorahosted.org/sssd/ticket/2666
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb_ops.c | 7 | ||||
-rw-r--r-- | src/tests/cmocka/test_sysdb_utils.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 9afb0d7d7..d34583787 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -3795,7 +3795,12 @@ errno_t sysdb_handle_original_uuid(const char *orig_name, struct ldb_message_element *el; char guid_str_buf[GUID_STR_BUF_SIZE]; - if (orig_name == NULL || src_attrs == NULL || src_name == NULL + if (orig_name == NULL) { + /* This provider doesn't handle UUIDs */ + return ENOENT; + } + + if (src_attrs == NULL || src_name == NULL || dest_attrs == NULL || dest_name == NULL) { return EINVAL; } diff --git a/src/tests/cmocka/test_sysdb_utils.c b/src/tests/cmocka/test_sysdb_utils.c index 1e9baa88c..b791f14b7 100644 --- a/src/tests/cmocka/test_sysdb_utils.c +++ b/src/tests/cmocka/test_sysdb_utils.c @@ -45,7 +45,7 @@ static void test_sysdb_handle_original_uuid(void **state) struct ldb_val guid_val = {bin_guid, 16}; ret = sysdb_handle_original_uuid(NULL, NULL, NULL, NULL, NULL); - assert_int_equal(ret, EINVAL); + assert_int_equal(ret, ENOENT); src_attrs = sysdb_new_attrs(NULL); assert_non_null(src_attrs); @@ -63,6 +63,14 @@ static void test_sysdb_handle_original_uuid(void **state) ret = sysdb_attrs_add_string(src_attrs, "UUID", IPA_UUID); assert_int_equal(ret, EOK); + ret = sysdb_handle_original_uuid(NULL, src_attrs, "GUID", + dest_attrs, "def"); + assert_int_equal(ret, ENOENT); + + ret = sysdb_handle_original_uuid("objectGUID", NULL, "GUID", + dest_attrs, "def"); + assert_int_equal(ret, EINVAL); + ret = sysdb_handle_original_uuid("objectGUID", src_attrs, "GUID", dest_attrs, "def"); assert_int_equal(ret, EOK); |