On (03/06/15 17:58), Jakub Hrozek wrote:
I think ENOENT in this case is better because the caller might (and
does) special-case the value to handle "no UUID" case separately.
From 762d47583e799bb956564ead9418a64a8dd494e1 Mon Sep 17 00:00:00
2001
From: Jakub Hrozek <jhrozek(a)redhat.com>
Date: Wed, 3 Jun 2015 17:57:29 +0200
Subject: [PATCH] LDAP: Do not print verbose DEBUG messages from providers that
^^^^
changes are in sydb and not in LDAP
don't set UUID
https://fedorahosted.org/sssd/ticket/2666
---
src/db/sysdb_ops.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 9afb0d7d74cdbc91570f4fe6485790d2a4eeb4be..d34583787f1fce9bd07e272ae7549b8bd4f0b7dd
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;
}
sh$ ./test_sysdb_utils
[==========] Running 1 test(s).
[ RUN ] test_sysdb_handle_original_uuid
0x2 != 0x16
../sssd/src/tests/cmocka/test_sysdb_utils.c:48: error: Failure!
[ FAILED ] test_sysdb_handle_original_uuid
[==========] 1 test(s) run.
[ PASSED ] 0 test(s).
[ FAILED ] 1 test(s), listed below:
[ FAILED ] test_sysdb_handle_original_uuid
1 FAILED TEST(S)
LS