[SSSD] [PATCH] Fixing critical format string issues.

Lukas Slebodnik lslebodn at redhat.com
Mon May 20 07:41:02 UTC 2013


On (18/05/13 18:55), Jakub Hrozek wrote:
>On Fri, May 17, 2013 at 07:29:01PM +0200, Lukas Slebodnik wrote:
>> On (17/05/13 18:50), Lukas Slebodnik wrote:
>> >ehlo,
>> >
>> >This week Ondra fix segfault, which was caused by missing argument
>> >in debug message.
>> >>             ("nsupdate_get_addrs_done failed: [%d]: [%s]\n",
>> >>               sss_strerror(ret)));
>> >
>> >I was working on another ticket and I spotted similar bug.
>> >So I decided to enable printf format checking in debug_fn.
>> >There was a huge number of warnings. Attached patch fixes the most critical.
>> >--missing argument(s).
>> >--format '%s', but argument is integer.
>> >--wrong format string, example: '%\n'
>> >
>> >There are another 150 warnings, but they aren't critical.
>> >for example:
>> >format '%d' expects argument of type 'int', but argument 2 has type 'size_t'
>> >
>
>Hi,
>
>this is a really good patch that fixes many potentially bad issues.
>
>I think we should still fix these eventually, for instance for size_t,
>we should use the %z conversion.
>
>> I forgot to wrote in the first mail:
>> Remaining warnings are not critical, but they are. So I don't want to pollute
>> output from compiler with warnings, therefore patch did not enable
>> printf format checking in debug_fn.
>> 
>
>What if we enabled the warnings only if SSSD was compiled with a certain
>preprocessor directive? Then the developers would see if they introduce
>any new warning, but compiling the "production" code that runs with
>debug_level=0 anyway would not produce any warnings.
>
I think we should fix all warnings, because it is hard to find new introduced
warning among another 150 "integer format warnings"
(int -> {size_t, uint32_t, long ...})

Should I file a ticket?

>About the patch - almost ack. Please squash the attached patch to fix
>some debug levels and I'll ack.
Thank you. Patch squashed.
I squased another patch to improve readability.

--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -850,8 +850,8 @@ static void simple_bind_done(struct sdap_op *op,
                 talloc_zfree(nval);
                 if (ret != EOK) {
                     DEBUG(SSSDBG_MINOR_FAILURE,
-                          ("Could not convert control response to an integer. "
-                           "[%s]\n", strerror(ret)));
+                          ("Couldn't convert control response "
+                           "to an integer [%s].\n", strerror(ret)));
                     goto done;
                 }

LS
-------------- next part --------------
>From 90e10d4a4cbbf89c9fbc72133c849caff6204ab1 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 17 May 2013 17:36:38 +0200
Subject: [PATCH] Fixing critical format string issues.

--missing arguments.
--format '%s', but argument is integer.
--wrong format string, examle: '%\n'
---
 src/db/sysdb_idmap.c                          |  3 ++-
 src/providers/krb5/krb5_child.c               |  4 +++-
 src/providers/krb5/krb5_utils.c               |  4 ++--
 src/providers/ldap/ldap_init.c                |  4 +++-
 src/providers/ldap/sdap_async.c               |  3 ++-
 src/providers/ldap/sdap_async_connection.c    |  4 ++--
 src/providers/ldap/sdap_async_groups.c        |  3 ++-
 src/providers/ldap/sdap_async_initgroups_ad.c |  2 +-
 src/resolv/async_resolv.c                     |  6 ++++--
 src/responder/common/responder_common.c       |  5 +++--
 src/responder/nss/nsssrv_cmd.c                | 15 ++++++++++-----
 src/responder/nss/nsssrv_services.c           |  2 +-
 src/responder/pam/pam_LOCAL_domain.c          |  2 +-
 src/responder/pam/pamsrv_cmd.c                |  4 +++-
 src/responder/pam/pamsrv_dp.c                 |  6 ++++--
 src/responder/sudo/sudosrv_get_sudorules.c    |  5 +++--
 src/sbus/sssd_dbus_server.c                   |  5 +++--
 src/tools/files.c                             |  6 +++---
 src/tools/sss_seed.c                          |  2 +-
 src/tools/sss_userdel.c                       |  6 ++++--
 src/tools/tools_mc_util.c                     |  3 ++-
 src/tools/tools_util.c                        |  3 ++-
 22 files changed, 61 insertions(+), 36 deletions(-)

diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c
index 612a42aaed7fd30d71d322a47db12a9b52640d87..7b46ae66b3e53e0a48a854c6899141362ce3d979 100644
--- a/src/db/sysdb_idmap.c
+++ b/src/db/sysdb_idmap.c
@@ -196,7 +196,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
         if (slice_num != old_slice) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   ("Detected attempt to change slice value for sid [%s] "
-                   "This will break existing users. Refusing to perform.\n"));
+                   "This will break existing users. Refusing to perform.\n",
+                   dom_sid));
             ret = EINVAL;
             goto done;
         }
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 831905afb4dbe736094c7c94487ff644bed3e055..4626f59ff48fada92e1b38033dfc910c181af7c4 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -2029,7 +2029,9 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline)
         } else if (strcasecmp(use_fast_str, "demand") == 0) {
             kerr = k5c_setup_fast(kr, lifetime_str, true);
         } else {
-            DEBUG(1, ("Unsupported value [%s] for krb5_use_fast.\n"));
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  ("Unsupported value [%s] for krb5_use_fast.\n",
+                   use_fast_str));
             return EINVAL;
         }
     }
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 524568939507dac497ebf373612c40dfac6bf74c..1883d785e6746c45e51c8b0fabe01afbad688d6d 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -858,7 +858,7 @@ cc_file_check_existing(const char *location, uid_t uid,
 
     filename = sss_krb5_residual_check_type(location, SSS_KRB5_TYPE_FILE);
     if (!filename) {
-        DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n"));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n", location));
         return EINVAL;
     }
 
@@ -922,7 +922,7 @@ cc_file_remove(const char *location)
 
     filename = sss_krb5_residual_check_type(location, SSS_KRB5_TYPE_FILE);
     if (!filename) {
-        DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n"));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n", location));
         return EINVAL;
     }
 
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 0884a85c7d9db2c7c777caf0baebf59217076982..12b204c89b6ab772db0bca39a73a3de42b2db69a 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -317,7 +317,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx,
     }
 
     if (order_list_len > LDAP_ACCESS_LAST) {
-        DEBUG(1, ("Currently only [%d] different access rules are supported.\n"));
+        DEBUG(SSSDBG_CRIT_FAILURE,
+              ("Currently only [%d] different access rules are supported.\n",
+               LDAP_ACCESS_LAST));
         ret = EINVAL;
         goto done;
     }
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index afa2904f478757fc15b5a54a411656bc7caa0bf0..5eac1d4366a077d5dadd1fb619f5cd1c998e103e 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -2228,7 +2228,8 @@ sdap_attrs_add_ldap_attr(struct sysdb_attrs *ldap_attrs,
     ret = sysdb_attrs_get_el(ldap_attrs, attr_name, &el);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, ("Could not get %s from the "
-              "list of the LDAP attributes [%d]: %s\n", ret, strerror(ret)));
+              "list of the LDAP attributes [%d]: %s\n",
+              attr_name, ret, strerror(ret)));
         return ret;
     }
 
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 39a3ce9469e603bdd192266aec8d70aa78e4d967..4f6986fcf84b098c5b861e461998a8358543a870 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -850,8 +850,8 @@ static void simple_bind_done(struct sdap_op *op,
                 talloc_zfree(nval);
                 if (ret != EOK) {
                     DEBUG(SSSDBG_MINOR_FAILURE,
-                          ("Could not convert control response to an integer. ",
-                           "[%s]\n", strerror(ret)));
+                          ("Couldn't convert control response "
+                           "to an integer [%s].\n", strerror(ret)));
                     goto done;
                 }
 
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index cb30d4bb4aeca107c2bf68acee94cb622bb94328..dc7fba42678e50f367704e03b1a5d476a61f6c56 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -2052,7 +2052,8 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
             ret = EINVAL;
         }
         if (ret != EOK) {
-            DEBUG(1, ("User entry %s has no originalDN attribute\n", i));
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  ("User entry %d has no originalDN attribute\n", i));
             goto done;
         }
         original_dn = (const char *) el->values[0].data;
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
index a3f6694aaab3526c38357ce8981a8d41e357e5a5..c2dec37363e3138128b059d616ab82d7f337e01f 100644
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
@@ -569,7 +569,7 @@ done:
         sret = sysdb_transaction_cancel(state->sysdb);
         DEBUG(SSSDBG_FATAL_FAILURE,
               ("Could not cancel transaction! [%s]\n",
-               sret));
+               strerror(sret)));
     }
 
     if (ret == EOK) {
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index ad9d58297d0701e2a48ef86179c93c71320654fb..f1e577e8a86407500c10a636b284eddc7fe93642 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -645,7 +645,8 @@ resolv_copy_hostent_ares(TALLOC_CTX *mem_ctx, struct hostent *src,
                                 &((struct ares_addr6ttl *) ares_ttl_data)[i]);
                 break;
             default:
-                DEBUG(1, ("Unknown address family %d\n"));
+                DEBUG(SSSDBG_CRIT_FAILURE,
+                      ("Unknown address family %d\n", family));
                 goto fail;
             }
 
@@ -1484,7 +1485,8 @@ resolv_get_sockaddr_address_index(TALLOC_CTX *mem_ctx,
             ((struct sockaddr_in6 *) sockaddr)->sin6_port = (in_port_t) htons(port);
             break;
         default:
-            DEBUG(1, ("Unknown address family %d\n"));
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  ("Unknown address family %d\n", hostent->family));
             return NULL;
     }
 
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 54701d6f2b1bfaf914cddb8909296b0c45233605..4a878c675f8632bea5d9ba5cda667dcfc50a3566 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -462,8 +462,9 @@ static void accept_fd_handler(struct tevent_context *ev,
     if (!cctx->cfde) {
         close(cctx->cfd);
         talloc_free(cctx);
-        DEBUG(2, ("Failed to queue client handler%\n",
-                accept_ctx->is_private ? " on privileged pipe" : ""));
+        DEBUG(SSSDBG_OP_FAILURE,
+              ("Failed to queue client handler%s\n",
+               accept_ctx->is_private ? " on privileged pipe" : ""));
         return;
     }
 
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index c409e794716c8763ea78b029d777be96cd4ef3a5..57b5786f3106d3f9c307b25c1940520fd03be0c2 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -1123,7 +1123,8 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx)
         }
         break;
     default:
-        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+                                    dctx->cmdctx->cmd));
         ret = EINVAL;
     }
 
@@ -1202,7 +1203,8 @@ static void nss_cmd_getbynam_done(struct tevent_req *req)
         }
         break;
     default:
-        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+                                     dctx->cmdctx->cmd));
         ret = EINVAL;
     }
 
@@ -1407,7 +1409,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx)
         }
         break;
     default:
-        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+                                    dctx->cmdctx->cmd));
         ret = EINVAL;
         goto done;
     }
@@ -1452,7 +1455,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx)
         }
         break;
     default:
-        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+                                    dctx->cmdctx->cmd));
         ret = EINVAL;
     }
 
@@ -1513,7 +1517,8 @@ static void nss_cmd_getbyid_done(struct tevent_req *req)
         }
         break;
     default:
-        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+                                    dctx->cmdctx->cmd));
         ret = EINVAL;
     }
 
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index 99fc67e7f875d736c52ba320f5705685f2cc7181..42a1deedaa42527089309a13687cd441cbd096bf 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -658,7 +658,7 @@ fill_service(struct sss_packet *packet,
         port = (uint16_t) ldb_msg_find_attr_as_uint(msg, SYSDB_SVC_PORT, 0);
         if (!port) {
             DEBUG(SSSDBG_CRIT_FAILURE,
-                  ("No port for service [%s]. Skipping\n"));
+                  ("No port for service [%s]. Skipping\n", tmpstr));
 
         }
 
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c
index 4aec3e4df8313a36ad18ef9d5ea93e14a845fe5c..e7776cba3b74a86ef63dad30f08b4436a59a89be 100644
--- a/src/responder/pam/pam_LOCAL_domain.c
+++ b/src/responder/pam/pam_LOCAL_domain.c
@@ -332,7 +332,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
             break;
         default:
             lreq->error = EINVAL;
-            DEBUG(1, ("Unknown PAM task [%d].\n"));
+            DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown PAM task [%d].\n", pd->cmd));
     }
 
 done:
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 8350f655453d6777eebccac277547f1ee1bd12df..ff86a13a5ac13856a65d1618056caf4657cb473a 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -416,7 +416,9 @@ static errno_t filter_responses(struct confdb_ctx *cdb,
 
                     break;
                 default:
-                    DEBUG(7, ("User info type [%d] not filtered.\n"));
+                    DEBUG(SSSDBG_TRACE_LIBS,
+                          ("User info type [%d] not filtered.\n",
+                           user_info_type));
             }
         } else if (resp->type & SSS_SERVER_INFO) {
             resp->do_not_send_to_client = true;
diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c
index 46c54dadda8ab2083984cc228a9a36283fff3a94..d5a52446fe74d1f2cd883a9692c3df69185b070a 100644
--- a/src/responder/pam/pamsrv_dp.c
+++ b/src/responder/pam/pamsrv_dp.c
@@ -117,8 +117,10 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout)
     res = sss_dp_get_domain_conn(preq->cctx->rctx,
                                  preq->domain->conn_name, &be_conn);
     if (res != EOK) {
-        DEBUG(1, ("The Data Provider connection for %s is not available!"
-                  " This maybe a bug, it shouldn't happen!\n", preq->domain));
+        DEBUG(SSSDBG_CRIT_FAILURE,
+              ("The Data Provider connection for %s is not available!"
+               " This maybe a bug, it shouldn't happen!\n",
+               preq->domain->conn_name));
         return EIO;
     }
 
diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
index ab363da6a96e6f87706cd2e32e60485b37d026eb..e84631e3db310f5eea265ea57adcbfb5854e3226 100644
--- a/src/responder/sudo/sudosrv_get_sudorules.c
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
@@ -564,7 +564,8 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
                                        NULL, &groupnames);
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
-                 ("Unable to retrieve user info [%d]: %s\n", strerror(ret)));
+                 ("Unable to retrieve user info [%d]: %s\n",
+                  ret, strerror(ret)));
             goto done;
         }
         flags = SYSDB_SUDO_FILTER_USERINFO | SYSDB_SUDO_FILTER_INCLUDE_ALL;
@@ -582,7 +583,7 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
                                             &rules, &num_rules);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-             ("Unable to retrieve sudo rules [%d]: %s\n", strerror(ret)));
+             ("Unable to retrieve sudo rules [%d]: %s\n", ret, strerror(ret)));
         goto done;
     }
 
diff --git a/src/sbus/sssd_dbus_server.c b/src/sbus/sssd_dbus_server.c
index 2255d196352b5768241629327497b5e56f78d015..3ada25b6127ba23db8f03e7d02c16b43cd542056 100644
--- a/src/sbus/sssd_dbus_server.c
+++ b/src/sbus/sssd_dbus_server.c
@@ -165,8 +165,9 @@ remove_socket_symlink(const char *symlink_name)
     ret = unlink(symlink_name);
     if (ret != 0) {
         ret = errno;
-        DEBUG(2, ("unlink failed to remove [%s] [%d]: %s\n",
-                   symlink, ret, strerror(ret)));
+        DEBUG(SSSDBG_CRIT_FAILURE,
+              ("unlink failed to remove [%s] [%d]: %s\n",
+               symlink_name, ret, strerror(ret)));
         return ret;
     }
 
diff --git a/src/tools/files.c b/src/tools/files.c
index 186f18b9bb241e39720da3e26476879e6cf09bd2..1c1b0855869d784959d274e5bd52b930d0d51887 100644
--- a/src/tools/files.c
+++ b/src/tools/files.c
@@ -208,7 +208,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx,
             if (parent_dev && parent_dev != statres.st_dev) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       ("Directory %s is on different filesystem, "
-                       "will not follow\n"));
+                       "will not follow\n", result->d_name));
                 ret = EFAULT;
                 goto fail;
             }
@@ -588,8 +588,8 @@ copy_entry(struct copy_ctx *cctx,
                        &st);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
-                    ("Could recursively copy '%s' to '%s': %s\n",
-                    src_ent_path, dest_dir_fd, strerror(ret)));
+                    ("Couldn't recursively copy '%s' to '%s': %s\n",
+                    src_ent_path, dest_ent_path, strerror(ret)));
             goto done;
         }
     } else if (S_ISREG(st.st_mode)) {
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 846a447231336f56a9507cc18d36adc3a307ec16..75f7e8c520593a0eeb5133ce8749106f951a98cf 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -789,7 +789,7 @@ int main(int argc, const char **argv)
     /* initialize seed context and parse options */
     ret = seed_init(sctx, argc, argv, &sctx);
     if (ret != EOK) {
-        DEBUG(SSSDBG_OP_FAILURE,("Seed init failed [%d][%d]\n",
+        DEBUG(SSSDBG_OP_FAILURE,("Seed init failed [%d][%s]\n",
                                  ret, strerror(ret)));
         goto done;
     }
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c
index ac87a736049bf0af442206ea7949b36fa0c763b8..d61a457118d4e5d98d81ff8fb5ce317c5ccb67b9 100644
--- a/src/tools/sss_userdel.c
+++ b/src/tools/sss_userdel.c
@@ -96,8 +96,10 @@ static int kick_user(struct tools_ctx *tctx)
     } else {
         /* parent */
         if (pid == -1) {
-            DEBUG(1, ("fork failed [%d]: %s\n"));
-            return errno;
+            ret = errno;
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  ("fork failed [%d]: %s\n", ret, strerror(ret)));
+            return ret;
         }
 
         while((child_pid = waitpid(pid, &status, 0)) > 0) {
diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c
index b563fac3c8c0697898fbf03e1ad0b95b129fc0ac..33d5d26dbefaa547da3a5c49947793b485896e83 100644
--- a/src/tools/tools_mc_util.c
+++ b/src/tools/tools_mc_util.c
@@ -117,7 +117,8 @@ done:
             if (pret == -1) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       ("Failed to unlink file %s. "
-                       "Will be unlinked later by sssd_nss.\n"));
+                       "Will be unlinked later by sssd_nss.\n",
+                       mc_filename));
             }
         }
     }
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 1ad5326e39f919a5e75c8394403fc9df690bc453..6798b6589668b1335a7a5ada59b08cf92a2bbf1f 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -532,8 +532,9 @@ int run_userdel_cmd(struct tools_ctx *tctx)
     } else {
         /* parent */
         if (pid == -1) {
-            DEBUG(1, ("fork failed [%d]: %s\n"));
             ret = errno;
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  ("fork failed [%d]: %s\n", ret, strerror(ret)));
             goto done;
         }
 
-- 
1.8.1.4



More information about the sssd-devel mailing list