dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0024-DEBUG-changed-debug_prg_name-format.patch

836b22
From 225fe9950f2807d5fb226f6b3be1ff4cefd731f0 Mon Sep 17 00:00:00 2001
836b22
From: Alexey Tikhonov <atikhono@redhat.com>
836b22
Date: Tue, 5 May 2020 19:34:47 +0200
836b22
Subject: [PATCH 24/25] DEBUG: changed "debug_prg_name" format
836b22
MIME-Version: 1.0
836b22
Content-Type: text/plain; charset=UTF-8
836b22
Content-Transfer-Encoding: 8bit
836b22
836b22
Removed wrapping "[sssd[...]]" from "debug_prg_name" as this doesn't
836b22
carry any information but eats 8 characters of debug line.
836b22
For example instead of `[[sssd[ldap_child[12492]]]]` logs will have
836b22
`[ldap_child[12492]]`
836b22
836b22
I also was considering to remove "debug_prg_name" from the output
836b22
completely but gave up this idea. It makes sense to have program name
836b22
in the output to be able to combine few logs together (sorted by
836b22
timestamp).
836b22
836b22
Reviewed-by: Pawel Polawski <ppolawsk@redhat.com>
836b22
(cherry picked from commit 00e7b1ada3d1c1071eac79b65c17cd2701c2ae6a)
836b22
836b22
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
836b22
836b22
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
836b22
---
836b22
 src/p11_child/p11_child_common.c  | 2 +-
836b22
 src/providers/ad/ad_gpo_child.c   | 2 +-
836b22
 src/providers/data_provider_be.c  | 2 +-
836b22
 src/providers/ipa/selinux_child.c | 2 +-
836b22
 src/providers/krb5/krb5_child.c   | 8 ++++----
836b22
 src/providers/ldap/ldap_child.c   | 4 ++--
836b22
 src/providers/proxy/proxy_child.c | 2 +-
836b22
 src/responder/autofs/autofssrv.c  | 2 +-
836b22
 src/responder/ifp/ifpsrv.c        | 2 +-
836b22
 src/responder/kcm/kcm.c           | 2 +-
836b22
 src/responder/nss/nsssrv.c        | 2 +-
836b22
 src/responder/pac/pacsrv.c        | 2 +-
836b22
 src/responder/pam/pamsrv.c        | 2 +-
836b22
 src/responder/secrets/secsrv.c    | 2 +-
836b22
 src/responder/ssh/sshsrv.c        | 2 +-
836b22
 src/responder/sudo/sudosrv.c      | 2 +-
836b22
 src/util/util_watchdog.c          | 2 +-
836b22
 17 files changed, 21 insertions(+), 21 deletions(-)
836b22
836b22
diff --git a/src/p11_child/p11_child_common.c b/src/p11_child/p11_child_common.c
836b22
index 125430d13..49d268e5a 100644
836b22
--- a/src/p11_child/p11_child_common.c
836b22
+++ b/src/p11_child/p11_child_common.c
836b22
@@ -294,7 +294,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     DEBUG_INIT(debug_level);
836b22
 
836b22
-    debug_prg_name = talloc_asprintf(NULL, "[sssd[p11_child[%d]]]", getpid());
836b22
+    debug_prg_name = talloc_asprintf(NULL, "p11_child[%d]", getpid());
836b22
     if (debug_prg_name == NULL) {
836b22
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
         goto fail;
836b22
diff --git a/src/providers/ad/ad_gpo_child.c b/src/providers/ad/ad_gpo_child.c
836b22
index a0bd6e13a..eb311c9df 100644
836b22
--- a/src/providers/ad/ad_gpo_child.c
836b22
+++ b/src/providers/ad/ad_gpo_child.c
836b22
@@ -733,7 +733,7 @@ main(int argc, const char *argv[])
836b22
 
836b22
     DEBUG_INIT(debug_level);
836b22
 
836b22
-    debug_prg_name = talloc_asprintf(NULL, "[sssd[gpo_child[%d]]]", getpid());
836b22
+    debug_prg_name = talloc_asprintf(NULL, "gpo_child[%d]", getpid());
836b22
     if (debug_prg_name == NULL) {
836b22
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
         goto fail;
836b22
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
836b22
index d13654b8b..fb72d99e3 100644
836b22
--- a/src/providers/data_provider_be.c
836b22
+++ b/src/providers/data_provider_be.c
836b22
@@ -613,7 +613,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    srv_name = talloc_asprintf(NULL, "sssd[be[%s]]", be_domain);
836b22
+    srv_name = talloc_asprintf(NULL, "be[%s]", be_domain);
836b22
     if (!srv_name) return 2;
836b22
 
836b22
     confdb_path = talloc_asprintf(NULL, CONFDB_DOMAIN_PATH_TMPL, be_domain);
836b22
diff --git a/src/providers/ipa/selinux_child.c b/src/providers/ipa/selinux_child.c
836b22
index 925591ec9..bd4c4b528 100644
836b22
--- a/src/providers/ipa/selinux_child.c
836b22
+++ b/src/providers/ipa/selinux_child.c
836b22
@@ -252,7 +252,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     DEBUG_INIT(debug_level);
836b22
 
836b22
-    debug_prg_name = talloc_asprintf(NULL, "[sssd[selinux_child[%d]]]", getpid());
836b22
+    debug_prg_name = talloc_asprintf(NULL, "selinux_child[%d]", getpid());
836b22
     if (debug_prg_name == NULL) {
836b22
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
         goto fail;
836b22
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
836b22
index ae63b14d1..47eb181ba 100644
836b22
--- a/src/providers/krb5/krb5_child.c
836b22
+++ b/src/providers/krb5/krb5_child.c
836b22
@@ -2674,9 +2674,9 @@ static krb5_error_code check_fast_ccache(TALLOC_CTX *mem_ctx,
836b22
             goto done;
836b22
         case 0:
836b22
             /* Child */
836b22
-            debug_prg_name = talloc_asprintf(NULL, "[sssd[krb5_child[%d]]]", getpid());
836b22
+            debug_prg_name = talloc_asprintf(NULL, "krb5_child[%d]", getpid());
836b22
             if (debug_prg_name == NULL) {
836b22
-                debug_prg_name = "[sssd[krb5_child]]";
836b22
+                debug_prg_name = "krb5_child";
836b22
                 DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
                 /* Try to carry on */
836b22
             }
836b22
@@ -3285,9 +3285,9 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     DEBUG_INIT(debug_level);
836b22
 
836b22
-    debug_prg_name = talloc_asprintf(NULL, "[sssd[krb5_child[%d]]]", getpid());
836b22
+    debug_prg_name = talloc_asprintf(NULL, "krb5_child[%d]", getpid());
836b22
     if (!debug_prg_name) {
836b22
-        debug_prg_name = "[sssd[krb5_child]]";
836b22
+        debug_prg_name = "krb5_child";
836b22
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
         ret = ENOMEM;
836b22
         goto done;
836b22
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
836b22
index 368bb91e1..ff2371855 100644
836b22
--- a/src/providers/ldap/ldap_child.c
836b22
+++ b/src/providers/ldap/ldap_child.c
836b22
@@ -633,9 +633,9 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     DEBUG_INIT(debug_level);
836b22
 
836b22
-    debug_prg_name = talloc_asprintf(NULL, "[sssd[ldap_child[%d]]]", getpid());
836b22
+    debug_prg_name = talloc_asprintf(NULL, "ldap_child[%d]", getpid());
836b22
     if (!debug_prg_name) {
836b22
-        debug_prg_name = "[sssd[ldap_child]]";
836b22
+        debug_prg_name = "ldap_child";
836b22
         DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
836b22
         goto fail;
836b22
     }
836b22
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c
836b22
index f5f2e8d0a..106cc983d 100644
836b22
--- a/src/providers/proxy/proxy_child.c
836b22
+++ b/src/providers/proxy/proxy_child.c
836b22
@@ -565,7 +565,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    srv_name = talloc_asprintf(NULL, "sssd[proxy_child[%s]]", domain);
836b22
+    srv_name = talloc_asprintf(NULL, "proxy_child[%s]", domain);
836b22
     if (!srv_name) return 2;
836b22
 
836b22
     conf_entry = talloc_asprintf(NULL, CONFDB_DOMAIN_PATH_TMPL, domain);
836b22
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
836b22
index 922da5fd4..5755a3ee5 100644
836b22
--- a/src/responder/autofs/autofssrv.c
836b22
+++ b/src/responder/autofs/autofssrv.c
836b22
@@ -235,7 +235,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[autofs]", 0, uid, gid,
836b22
+    ret = server_setup("autofs", 0, uid, gid,
836b22
                        CONFDB_AUTOFS_CONF_ENTRY, &main_ctx);
836b22
     if (ret != EOK) {
836b22
         return 2;
836b22
diff --git a/src/responder/ifp/ifpsrv.c b/src/responder/ifp/ifpsrv.c
836b22
index d71475e84..2bd4e3703 100644
836b22
--- a/src/responder/ifp/ifpsrv.c
836b22
+++ b/src/responder/ifp/ifpsrv.c
836b22
@@ -395,7 +395,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[ifp]", 0, 0, 0,
836b22
+    ret = server_setup("ifp", 0, 0, 0,
836b22
                        CONFDB_IFP_CONF_ENTRY, &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
diff --git a/src/responder/kcm/kcm.c b/src/responder/kcm/kcm.c
836b22
index a482234c8..2fbdef4bf 100644
836b22
--- a/src/responder/kcm/kcm.c
836b22
+++ b/src/responder/kcm/kcm.c
836b22
@@ -298,7 +298,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[kcm]", 0, uid, gid, CONFDB_KCM_CONF_ENTRY,
836b22
+    ret = server_setup("kcm", 0, uid, gid, CONFDB_KCM_CONF_ENTRY,
836b22
                        &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
836b22
index d9fe28708..d429dabcf 100644
836b22
--- a/src/responder/nss/nsssrv.c
836b22
+++ b/src/responder/nss/nsssrv.c
836b22
@@ -583,7 +583,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[nss]", 0, uid, gid, CONFDB_NSS_CONF_ENTRY,
836b22
+    ret = server_setup("nss", 0, uid, gid, CONFDB_NSS_CONF_ENTRY,
836b22
                        &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c
836b22
index ab61e6230..dbf3bc11c 100644
836b22
--- a/src/responder/pac/pacsrv.c
836b22
+++ b/src/responder/pac/pacsrv.c
836b22
@@ -249,7 +249,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[pac]", 0, uid, gid,
836b22
+    ret = server_setup("pac", 0, uid, gid,
836b22
                        CONFDB_PAC_CONF_ENTRY, &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
836b22
index fb799d28b..1804497a3 100644
836b22
--- a/src/responder/pam/pamsrv.c
836b22
+++ b/src/responder/pam/pamsrv.c
836b22
@@ -444,7 +444,7 @@ int main(int argc, const char *argv[])
836b22
         }
836b22
     }
836b22
 
836b22
-    ret = server_setup("sssd[pam]", 0, uid, gid, CONFDB_PAM_CONF_ENTRY, &main_ctx);
836b22
+    ret = server_setup("pam", 0, uid, gid, CONFDB_PAM_CONF_ENTRY, &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
     ret = die_if_parent_died();
836b22
diff --git a/src/responder/secrets/secsrv.c b/src/responder/secrets/secsrv.c
836b22
index 7a736a228..e3c0418a1 100644
836b22
--- a/src/responder/secrets/secsrv.c
836b22
+++ b/src/responder/secrets/secsrv.c
836b22
@@ -363,7 +363,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[secrets]", 0, uid, gid, CONFDB_SEC_CONF_ENTRY,
836b22
+    ret = server_setup("secrets", 0, uid, gid, CONFDB_SEC_CONF_ENTRY,
836b22
                        &main_ctx);
836b22
     if (ret != EOK) return 2;
836b22
 
836b22
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
836b22
index 9f1f618f2..458f60c0d 100644
836b22
--- a/src/responder/ssh/sshsrv.c
836b22
+++ b/src/responder/ssh/sshsrv.c
836b22
@@ -229,7 +229,7 @@ int main(int argc, const char *argv[])
836b22
 
836b22
     sss_set_logger(opt_logger);
836b22
 
836b22
-    ret = server_setup("sssd[ssh]", 0, uid, gid,
836b22
+    ret = server_setup("ssh", 0, uid, gid,
836b22
                        CONFDB_SSH_CONF_ENTRY, &main_ctx);
836b22
     if (ret != EOK) {
836b22
         return 2;
836b22
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
836b22
index 82315e0a8..921941c49 100644
836b22
--- a/src/responder/sudo/sudosrv.c
836b22
+++ b/src/responder/sudo/sudosrv.c
836b22
@@ -242,7 +242,7 @@ int main(int argc, const char *argv[])
836b22
         }
836b22
     }
836b22
 
836b22
-    ret = server_setup("sssd[sudo]", 0, uid, gid, CONFDB_SUDO_CONF_ENTRY,
836b22
+    ret = server_setup("sudo", 0, uid, gid, CONFDB_SUDO_CONF_ENTRY,
836b22
                        &main_ctx);
836b22
     if (ret != EOK) {
836b22
         return 2;
836b22
diff --git a/src/util/util_watchdog.c b/src/util/util_watchdog.c
836b22
index ae249c2ca..0a4d83505 100644
836b22
--- a/src/util/util_watchdog.c
836b22
+++ b/src/util/util_watchdog.c
836b22
@@ -158,7 +158,7 @@ static void watchdog_fd_read_handler(struct tevent_context *ev,
836b22
               "[%d]: %s\n", ret, sss_strerror(ret));
836b22
         orderly_shutdown(1);
836b22
     }
836b22
-    if (strncmp(debug_prg_name, "sssd[be[", sizeof("sssd[be[") - 1) == 0) {
836b22
+    if (strncmp(debug_prg_name, "be[", sizeof("be[") - 1) == 0) {
836b22
         kill(getpid(), SIGUSR2);
836b22
         DEBUG(SSSDBG_IMPORTANT_INFO, "SIGUSR2 sent to %s\n", debug_prg_name);
836b22
     }
836b22
-- 
836b22
2.21.1
836b22