File 0043-DEBUG-changed-debug_prg_name-format.patch of Package sssd.25316
From 00efb140cce3cfdc65e595af3de0844ed4ba2d6e Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Tue, 5 May 2020 19:34:47 +0200
Subject: [PATCH 4/5] DEBUG: changed "debug_prg_name" format
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Removed wrapping "[sssd[...]]" from "debug_prg_name" as this doesn't
carry any information but eats 8 characters of debug line.
For example instead of `[[sssd[ldap_child[12492]]]]` logs will have
`[ldap_child[12492]]`
I also was considering to remove "debug_prg_name" from the output
completely but gave up this idea. It makes sense to have program name
in the output to be able to combine few logs together (sorted by
timestamp).
Reviewed-by: Pawel Polawski <ppolawsk@redhat.com>
(cherry picked from commit 00e7b1ada3d1c1071eac79b65c17cd2701c2ae6a)
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
---
src/p11_child/p11_child_nss.c | 2 +-
src/providers/ad/ad_gpo_child.c | 2 +-
src/providers/data_provider_be.c | 2 +-
src/providers/ipa/selinux_child.c | 2 +-
src/providers/krb5/krb5_child.c | 8 ++++----
src/providers/ldap/ldap_child.c | 4 ++--
src/providers/proxy/proxy_child.c | 2 +-
src/responder/autofs/autofssrv.c | 2 +-
src/responder/ifp/ifpsrv.c | 2 +-
src/responder/kcm/kcm.c | 2 +-
src/responder/nss/nsssrv.c | 2 +-
src/responder/pac/pacsrv.c | 2 +-
src/responder/pam/pamsrv.c | 2 +-
src/responder/secrets/secsrv.c | 2 +-
src/responder/ssh/sshsrv.c | 2 +-
src/responder/sudo/sudosrv.c | 2 +-
src/util/util_watchdog.c | 2 +-
17 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/p11_child/p11_child_nss.c b/src/p11_child/p11_child_nss.c
index a2e523853..dd69a9665 100644
--- a/src/p11_child/p11_child_nss.c
+++ b/src/p11_child/p11_child_nss.c
@@ -757,7 +757,7 @@ int main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
- debug_prg_name = talloc_asprintf(NULL, "[sssd[p11_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "p11_child[%d]", getpid());
if (debug_prg_name == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
goto fail;
diff --git a/src/providers/ad/ad_gpo_child.c b/src/providers/ad/ad_gpo_child.c
index a0bd6e13a..eb311c9df 100644
--- a/src/providers/ad/ad_gpo_child.c
+++ b/src/providers/ad/ad_gpo_child.c
@@ -733,7 +733,7 @@ main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
- debug_prg_name = talloc_asprintf(NULL, "[sssd[gpo_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "gpo_child[%d]", getpid());
if (debug_prg_name == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
goto fail;
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index e8cddd976..586a4be21 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -586,7 +586,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- srv_name = talloc_asprintf(NULL, "sssd[be[%s]]", be_domain);
+ srv_name = talloc_asprintf(NULL, "be[%s]", be_domain);
if (!srv_name) return 2;
confdb_path = talloc_asprintf(NULL, CONFDB_DOMAIN_PATH_TMPL, be_domain);
diff --git a/src/providers/ipa/selinux_child.c b/src/providers/ipa/selinux_child.c
index a601b28c4..5ec79b3df 100644
--- a/src/providers/ipa/selinux_child.c
+++ b/src/providers/ipa/selinux_child.c
@@ -242,7 +242,7 @@ int main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
- debug_prg_name = talloc_asprintf(NULL, "[sssd[selinux_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "selinux_child[%d]", getpid());
if (debug_prg_name == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
goto fail;
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index a578930a9..12324e10e 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -2644,9 +2644,9 @@ static krb5_error_code check_fast_ccache(TALLOC_CTX *mem_ctx,
goto done;
case 0:
/* Child */
- debug_prg_name = talloc_asprintf(NULL, "[sssd[krb5_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "krb5_child[%d]", getpid());
if (debug_prg_name == NULL) {
- debug_prg_name = "[sssd[krb5_child]]";
+ debug_prg_name = "krb5_child";
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
/* Try to carry on */
}
@@ -3269,9 +3269,9 @@ int main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
- debug_prg_name = talloc_asprintf(NULL, "[sssd[krb5_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "krb5_child[%d]", getpid());
if (!debug_prg_name) {
- debug_prg_name = "[sssd[krb5_child]]";
+ debug_prg_name = "krb5_child";
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
ret = ENOMEM;
goto done;
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 4558fd7c4..eb61eec4b 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -645,9 +645,9 @@ int main(int argc, const char *argv[])
DEBUG_INIT(debug_level);
- debug_prg_name = talloc_asprintf(NULL, "[sssd[ldap_child[%d]]]", getpid());
+ debug_prg_name = talloc_asprintf(NULL, "ldap_child[%d]", getpid());
if (!debug_prg_name) {
- debug_prg_name = "[sssd[ldap_child]]";
+ debug_prg_name = "ldap_child";
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
goto fail;
}
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c
index f5f2e8d0a..106cc983d 100644
--- a/src/providers/proxy/proxy_child.c
+++ b/src/providers/proxy/proxy_child.c
@@ -565,7 +565,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- srv_name = talloc_asprintf(NULL, "sssd[proxy_child[%s]]", domain);
+ srv_name = talloc_asprintf(NULL, "proxy_child[%s]", domain);
if (!srv_name) return 2;
conf_entry = talloc_asprintf(NULL, CONFDB_DOMAIN_PATH_TMPL, domain);
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index 7d236f4d9..e6499949c 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -225,7 +225,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[autofs]", 0, uid, gid,
+ ret = server_setup("autofs", 0, uid, gid,
CONFDB_AUTOFS_CONF_ENTRY, &main_ctx);
if (ret != EOK) {
return 2;
diff --git a/src/responder/ifp/ifpsrv.c b/src/responder/ifp/ifpsrv.c
index d71475e84..2bd4e3703 100644
--- a/src/responder/ifp/ifpsrv.c
+++ b/src/responder/ifp/ifpsrv.c
@@ -395,7 +395,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[ifp]", 0, 0, 0,
+ ret = server_setup("ifp", 0, 0, 0,
CONFDB_IFP_CONF_ENTRY, &main_ctx);
if (ret != EOK) return 2;
diff --git a/src/responder/kcm/kcm.c b/src/responder/kcm/kcm.c
index a482234c8..2fbdef4bf 100644
--- a/src/responder/kcm/kcm.c
+++ b/src/responder/kcm/kcm.c
@@ -298,7 +298,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[kcm]", 0, uid, gid, CONFDB_KCM_CONF_ENTRY,
+ ret = server_setup("kcm", 0, uid, gid, CONFDB_KCM_CONF_ENTRY,
&main_ctx);
if (ret != EOK) return 2;
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index d6c5a08a9..d49d93acc 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -483,7 +483,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[nss]", 0, uid, gid, CONFDB_NSS_CONF_ENTRY,
+ ret = server_setup("nss", 0, uid, gid, CONFDB_NSS_CONF_ENTRY,
&main_ctx);
if (ret != EOK) return 2;
diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c
index ab61e6230..dbf3bc11c 100644
--- a/src/responder/pac/pacsrv.c
+++ b/src/responder/pac/pacsrv.c
@@ -249,7 +249,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[pac]", 0, uid, gid,
+ ret = server_setup("pac", 0, uid, gid,
CONFDB_PAC_CONF_ENTRY, &main_ctx);
if (ret != EOK) return 2;
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index 86d04e400..802d0230f 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -417,7 +417,7 @@ int main(int argc, const char *argv[])
}
}
- ret = server_setup("sssd[pam]", 0, uid, gid, CONFDB_PAM_CONF_ENTRY, &main_ctx);
+ ret = server_setup("pam", 0, uid, gid, CONFDB_PAM_CONF_ENTRY, &main_ctx);
if (ret != EOK) return 2;
ret = die_if_parent_died();
diff --git a/src/responder/secrets/secsrv.c b/src/responder/secrets/secsrv.c
index 7a736a228..e3c0418a1 100644
--- a/src/responder/secrets/secsrv.c
+++ b/src/responder/secrets/secsrv.c
@@ -363,7 +363,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[secrets]", 0, uid, gid, CONFDB_SEC_CONF_ENTRY,
+ ret = server_setup("secrets", 0, uid, gid, CONFDB_SEC_CONF_ENTRY,
&main_ctx);
if (ret != EOK) return 2;
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
index 795dca2c9..5f481aebd 100644
--- a/src/responder/ssh/sshsrv.c
+++ b/src/responder/ssh/sshsrv.c
@@ -217,7 +217,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[ssh]", 0, uid, gid,
+ ret = server_setup("ssh", 0, uid, gid,
CONFDB_SSH_CONF_ENTRY, &main_ctx);
if (ret != EOK) {
return 2;
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
index e87a24499..376c4dbec 100644
--- a/src/responder/sudo/sudosrv.c
+++ b/src/responder/sudo/sudosrv.c
@@ -219,7 +219,7 @@ int main(int argc, const char *argv[])
sss_set_logger(opt_logger);
- ret = server_setup("sssd[sudo]", 0, uid, gid, CONFDB_SUDO_CONF_ENTRY,
+ ret = server_setup("sudo", 0, uid, gid, CONFDB_SUDO_CONF_ENTRY,
&main_ctx);
if (ret != EOK) {
return 2;
diff --git a/src/util/util_watchdog.c b/src/util/util_watchdog.c
index 599b7fc40..86d9fbc6d 100644
--- a/src/util/util_watchdog.c
+++ b/src/util/util_watchdog.c
@@ -158,7 +158,7 @@ static void watchdog_fd_read_handler(struct tevent_context *ev,
"[%d]: %s\n", ret, sss_strerror(ret));
orderly_shutdown(1);
}
- if (strncmp(debug_prg_name, "sssd[be[", sizeof("sssd[be[") - 1) == 0) {
+ if (strncmp(debug_prg_name, "be[", sizeof("be[") - 1) == 0) {
kill(getpid(), SIGUSR2);
DEBUG(SSSDBG_IMPORTANT_INFO, "SIGUSR2 sent to %s\n", debug_prg_name);
}
--
2.32.0