On 07/12/2016 12:01 PM, Pavel Březina wrote:
On 07/12/2016 11:54 AM, Jakub Hrozek wrote:
On Tue, Jul 12, 2016 at 11:52:05AM +0200, Pavel Březina wrote:
On 07/12/2016 10:20 AM, Petr Cech wrote:
Hello list,

there is simple patch for [1].

I prepared two version:
a) the first is for changing the message,
b) the second is for removing.

I looked at the code -- I think it could be useful to know what type of
direction we have. But I agree that it could be really confusing if we
see 'trust direction not set'.

So I vote for removing.
Please do you have any other opinion?


[1] https://fedorahosted.org/sssd/ticket/3090

Regards

I think this is something that should not be removed. But we may move
it to
a higher debug level.

I think a better message might be:
Trust type of [%s]: %s

And in ipa_trust_dir2str() change "trust direction not set" to "not
set".

I haven't looked at the code in a long time, but my intent was to only
print the message on the server, not the clients, because the trust
direction is always not set for the clients and that's confusing people
who review the logs.

We can print it only in server mode, i.e. id_ctx->sever_mode != NULL.

Hello,

thanks all for comments.

There is fixed patch attached.

Regards

--
Petr^4 Čech
>From e52642f2f1c4b4ed7a1ab74b3e051ce006eac78e Mon Sep 17 00:00:00 2001
From: Petr Cech <[email protected]>
Date: Tue, 12 Jul 2016 10:03:56 +0200
Subject: [PATCH] IPA: Changing of confusing debug message

This debug message used to confuse our users. So this patch changes it.
Old version: "Trust direction of %s is %s\n"
New version: "Trust type of [%s]: %s\n"

Resolves:
https://fedorahosted.org/sssd/ticket/3090
---
 src/providers/ipa/ipa_subdomains.c        | 7 +++++--
 src/providers/ipa/ipa_subdomains_server.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 4e5bceb8c761bf4476928168d620baf2beb62ad5..61380db01f57be7e67af7be7f5a9d2bb12997d5b 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -435,8 +435,11 @@ static errno_t ipa_subdom_store(struct sss_domain_info *parent,
         goto done;
     }
 
-    DEBUG(SSSDBG_FUNC_DATA,
-          "Trust direction of %s is %s\n", name, ipa_trust_dir2str(direction));
+    if (id_ctx->server_mode != NULL) {
+        DEBUG(SSSDBG_FUNC_DATA, "Trust type of [%s]: %s\n",
+                                name, ipa_trust_dir2str(direction));
+    }
+
     ret = sysdb_subdomain_store(parent->sysdb, name, realm, flat,
                                 id, mpg, enumerate, forest,
                                 direction, alternative_domain_suffixes);
diff --git a/src/providers/ipa/ipa_subdomains_server.c b/src/providers/ipa/ipa_subdomains_server.c
index 43636098f6928006db0e0a9c05f2e39f8427d705..a2fed36fbec59100ecca0c1a7d7ca0b3c61f51a1 100644
--- a/src/providers/ipa/ipa_subdomains_server.c
+++ b/src/providers/ipa/ipa_subdomains_server.c
@@ -117,7 +117,7 @@ const char *ipa_trust_dir2str(uint32_t direction)
     } else if (direction & LSA_TRUST_DIRECTION_INBOUND) {
         return "one-way inbound: local domain trusts the remote domain";
     } else if (direction == 0) {
-        return "trust direction not set";
+        return "not set";
     }
 
     return "unknown";
-- 
2.7.4

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to