Logs from confdb with missing '\n' in the DEBUG statements annoyed me so
I decided to fix them. I also made a quick grep through the code and
found other places so I fixed them too.

Martin
>From d297fd987da1d512ef98666aae051e9b0133c4e5 Mon Sep 17 00:00:00 2001
From: Martin Nagy <mn...@redhat.com>
Date: Wed, 3 Mar 2010 08:33:22 +0100
Subject: [PATCH] Add forgotten \n in DEBUG statements

Logs from confdb with missing '\n' in the DEBUG statements annoyed me so
I decided to fix them. I also made a quick grep through the code and
found other places so I fixed them too.
---
 src/confdb/confdb.c                     |   14 +++++++-------
 src/db/sysdb.c                          |    8 ++++----
 src/db/sysdb_ops.c                      |    4 ++--
 src/monitor/monitor.c                   |    6 +++---
 src/providers/krb5/krb5_auth.c          |    2 +-
 src/providers/proxy.c                   |    2 +-
 src/responder/common/responder_common.c |    4 ++--
 src/responder/common/responder_dp.c     |    6 +++---
 src/responder/nss/nsssrv_cmd.c          |    4 ++--
 src/responder/nss/nsssrv_nc.c           |    2 +-
 src/responder/pam/pam_LOCAL_domain.c    |    2 +-
 src/sbus/sssd_dbus_server.c             |    4 ++--
 src/tests/ipa_timerules-tests.c         |    4 ++--
 src/tests/resolv-tests.c                |    2 +-
 src/tools/files.c                       |    2 +-
 15 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index c46b765..877b80a 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -207,7 +207,7 @@ int confdb_add_param(struct confdb_ctx *cdb,
 done:
     talloc_free(tmp_ctx);
     if (ret != EOK) {
-        DEBUG(1, ("Failed to add [%s] to [%s], error [%d] (%s)",
+        DEBUG(1, ("Failed to add [%s] to [%s], error [%d] (%s)\n",
                   attribute, section, ret, strerror(ret)));
     }
     return ret;
@@ -283,7 +283,7 @@ int confdb_get_param(struct confdb_ctx *cdb,
 done:
     talloc_free(tmp_ctx);
     if (ret != EOK) {
-        DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)",
+        DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
                   attribute, section, ret, strerror(ret)));
     }
     return ret;
@@ -333,7 +333,7 @@ int confdb_get_string(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
 
 failed:
     talloc_free(values);
-    DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)",
+    DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
@@ -381,7 +381,7 @@ int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
 
 failed:
     talloc_free(values);
-    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)",
+    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
@@ -424,7 +424,7 @@ long confdb_get_long(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
 
 failed:
     talloc_free(values);
-    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)",
+    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
@@ -473,7 +473,7 @@ int confdb_get_bool(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
 
 failed:
     talloc_free(values);
-    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)",
+    DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
@@ -509,7 +509,7 @@ int confdb_get_string_as_list(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
 done:
     talloc_free(values);
     if (ret != EOK && ret != ENOENT) {
-        DEBUG(2, ("Failed to get [%s] from [%s], error [%d] (%s)",
+        DEBUG(2, ("Failed to get [%s] from [%s], error [%d] (%s)\n",
                   attribute, section, ret, strerror(ret)));
     }
     return ret;
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index b3f81a0..1253843 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -1629,7 +1629,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
     while ((ldif = ldb_ldif_read_string(ctx->ldb, &base_ldif))) {
         ret = ldb_add(ctx->ldb, ldif->msg);
         if (ret != LDB_SUCCESS) {
-            DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+            DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n",
                       ret, ldb_errstring(ctx->ldb), domain->name));
             ret = EIO;
             goto done;
@@ -1657,7 +1657,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
     /* do a synchronous add */
     ret = ldb_add(ctx->ldb, msg);
     if (ret != LDB_SUCCESS) {
-        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n",
                   ret, ldb_errstring(ctx->ldb), domain->name));
         ret = EIO;
         goto done;
@@ -1685,7 +1685,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
     /* do a synchronous add */
     ret = ldb_add(ctx->ldb, msg);
     if (ret != LDB_SUCCESS) {
-        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n",
                   ret, ldb_errstring(ctx->ldb), domain->name));
         ret = EIO;
         goto done;
@@ -1713,7 +1713,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
     /* do a synchronous add */
     ret = ldb_add(ctx->ldb, msg);
     if (ret != LDB_SUCCESS) {
-        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+        DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n",
                   ret, ldb_errstring(ctx->ldb), domain->name));
         ret = EIO;
         goto done;
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 33cfd91..618b810 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -147,7 +147,7 @@ static int sldb_request_callback(struct ldb_request *ldbreq,
     int err;
 
     if (!ldbreply) {
-        DEBUG(6, ("Error: Missing ldbreply"));
+        DEBUG(6, ("Error: Missing ldbreply\n"));
         ERROR_OUT(err, EIO, fail);
     }
 
@@ -1314,7 +1314,7 @@ static void sysdb_get_new_id_base(struct tevent_req *subreq)
     case LDB_REPLY_ENTRY:
         if (state->base) {
             DEBUG(1, ("More than one reply for a base search ?! "
-                      "DB seems corrupted, aborting."));
+                      "DB seems corrupted, aborting.\n"));
             tevent_req_error(req, EFAULT);
             return;
         }
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index ddbfb6a..cd1c6f7 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -350,7 +350,7 @@ static int mark_service_as_started(struct mt_svc *svc)
         /* check if all providers are up */
         for (iter = ctx->svc_list; iter; iter = iter->next) {
             if (iter->provider && !iter->svc_started) {
-                DEBUG(5, ("Still waiting on %s provider.", iter->name));
+                DEBUG(5, ("Still waiting on %s provider.\n", iter->name));
                 break;
             }
         }
@@ -1659,7 +1659,7 @@ static void config_file_changed(struct tevent_context *ev,
 
     te = tevent_add_timer(ev, ev, tv, process_config_file, file_ctx);
     if (!te) {
-        DEBUG(0, ("Unable to queue config file update! Exiting."));
+        DEBUG(0, ("Unable to queue config file update! Exiting.\n"));
         kill(getpid(), SIGTERM);
         return;
     }
@@ -1881,7 +1881,7 @@ static void poll_config_file(struct tevent_context *ev,
     file_ctx->timer = tevent_add_timer(ev, file_ctx->parent_ctx, tv,
                              poll_config_file, file_ctx);
     if (!file_ctx->timer) {
-        DEBUG(0, ("Error: Config file no longer monitored for changes!"));
+        DEBUG(0, ("Error: Config file no longer monitored for changes!\n"));
     }
 }
 
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index 0e5230c..bec907b 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -135,7 +135,7 @@ static errno_t check_if_ccache_file_is_used(uid_t uid, const char *ccname,
     filename = ccname + offset;
 
     if (filename[0] != '/') {
-        DEBUG(1, ("Only absolute path names are allowed"));
+        DEBUG(1, ("Only absolute path names are allowed.\n"));
         return EINVAL;
     }
 
diff --git a/src/providers/proxy.c b/src/providers/proxy.c
index 12bb25e..9b5ba4b 100644
--- a/src/providers/proxy.c
+++ b/src/providers/proxy.c
@@ -224,7 +224,7 @@ static void proxy_pam_handler(struct be_req *req) {
                 }
                 break;
             default:
-                DEBUG(1, ("unknown PAM call"));
+                DEBUG(1, ("unknown PAM call\n"));
                 pam_status=PAM_ABORT;
         }
 
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index ca830e4..f524afb 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -207,7 +207,7 @@ static void accept_priv_fd_handler(struct tevent_context *ev,
     len = sizeof(cctx->addr);
     cctx->cfd = accept(rctx->priv_lfd, (struct sockaddr *)&cctx->addr, &len);
     if (cctx->cfd == -1) {
-        DEBUG(1, ("Accept failed [%s]", strerror(errno)));
+        DEBUG(1, ("Accept failed [%s]\n", strerror(errno)));
         talloc_free(cctx);
         return;
     }
@@ -260,7 +260,7 @@ static void accept_fd_handler(struct tevent_context *ev,
     len = sizeof(cctx->addr);
     cctx->cfd = accept(rctx->lfd, (struct sockaddr *)&cctx->addr, &len);
     if (cctx->cfd == -1) {
-        DEBUG(1, ("Accept failed [%s]", strerror(errno)));
+        DEBUG(1, ("Accept failed [%s]\n", strerror(errno)));
         talloc_free(cctx);
         return;
     }
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index 782befb..d5a4ca7 100644
--- a/src/responder/common/responder_dp.c
+++ b/src/responder/common/responder_dp.c
@@ -366,7 +366,7 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
         value.ptr = sdp_req;
         hret = hash_enter(dp_requests, &key, &value);
         if (hret != HASH_SUCCESS) {
-            DEBUG(0, ("Could not store request query (%s)",
+            DEBUG(0, ("Could not store request query (%s)\n",
                       hash_error_string(hret)));
             talloc_zfree(sdp_req);
             ret = EIO;
@@ -379,7 +379,7 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
         sdp_req->tev = tevent_add_timer(sdp_req->ev, sdp_req, tv,
                                         sdp_req_timeout, sdp_req);
         if (!sdp_req->tev) {
-            DEBUG(0, ("Out of Memory!?"));
+            DEBUG(0, ("Out of Memory!?\n"));
             talloc_zfree(sdp_req);
             ret = ENOMEM;
             goto done;
@@ -498,7 +498,7 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx,
                                          sss_dp_send_acct_callback,
                                          sdp_req, NULL);
     if (!dbret) {
-        DEBUG(0, ("Could not queue up pending request!"));
+        DEBUG(0, ("Could not queue up pending request!\n"));
         talloc_zfree(sdp_req);
         dbus_pending_call_cancel(pending_reply);
         dbus_message_unref(msg);
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 46d4a23..c43a544 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -75,13 +75,13 @@ static int nss_cmd_send_error(struct nss_cmd_ctx *cmdctx, int err)
 }
 
 #define NSS_CMD_FATAL_ERROR(cctx) do { \
-    DEBUG(1,("Fatal error, killing connection!")); \
+    DEBUG(1,("Fatal error, killing connection!\n")); \
     talloc_free(cctx); \
     return; \
 } while(0)
 
 #define NSS_CMD_FATAL_ERROR_CODE(cctx, ret) do { \
-    DEBUG(1,("Fatal error, killing connection!")); \
+    DEBUG(1,("Fatal error, killing connection!\n")); \
     talloc_free(cctx); \
     return ret; \
 } while(0)
diff --git a/src/responder/nss/nsssrv_nc.c b/src/responder/nss/nsssrv_nc.c
index 1fa7d61..8d8ef01 100644
--- a/src/responder/nss/nsssrv_nc.c
+++ b/src/responder/nss/nsssrv_nc.c
@@ -141,7 +141,7 @@ static int nss_ncache_set_str(struct nss_nc_ctx *ctx,
 
     ret = tdb_store(ctx->tdb, key, data, TDB_REPLACE);
     if (ret != 0) {
-        DEBUG(1, ("Negative cache failed to set entry: [%s]",
+        DEBUG(1, ("Negative cache failed to set entry: [%s]\n",
                   tdb_errorstr(ctx->tdb)));
         ret = EFAULT;
     }
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c
index 34f0c8d..a598e77 100644
--- a/src/responder/pam/pam_LOCAL_domain.c
+++ b/src/responder/pam/pam_LOCAL_domain.c
@@ -265,7 +265,7 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq)
 
     if (strlen(newauthtok) == 0) {
         /* TODO: should we allow null passwords via a config option ? */
-        DEBUG(1, ("Empty passwords are not allowed!"));
+        DEBUG(1, ("Empty passwords are not allowed!\n"));
         ret = EINVAL;
         goto done;
     }
diff --git a/src/sbus/sssd_dbus_server.c b/src/sbus/sssd_dbus_server.c
index 98c308e..1bb58d4 100644
--- a/src/sbus/sssd_dbus_server.c
+++ b/src/sbus/sssd_dbus_server.c
@@ -165,7 +165,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx,
                                             sbus_toggle_watch,
                                             server, NULL);
     if (!dbret) {
-        DEBUG(4, ("Error setting up D-BUS server watch functions"));
+        DEBUG(4, ("Error setting up D-BUS server watch functions\n"));
         talloc_free(server);
         return EIO;
     }
@@ -177,7 +177,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx,
                                               sbus_toggle_timeout,
                                               server, NULL);
     if (!dbret) {
-        DEBUG(4,("Error setting up D-BUS server timeout functions"));
+        DEBUG(4,("Error setting up D-BUS server timeout functions\n"));
         dbus_server_set_watch_functions(server->dbus.server,
                                         NULL, NULL, NULL, NULL, NULL);
         talloc_free(server);
diff --git a/src/tests/ipa_timerules-tests.c b/src/tests/ipa_timerules-tests.c
index 0a7be90..86b7b98 100644
--- a/src/tests/ipa_timerules-tests.c
+++ b/src/tests/ipa_timerules-tests.c
@@ -56,10 +56,10 @@ int str2time_t(const char *fmt, const char *str, time_t *out)
     if(!err || err[0] != '\0')
         return EINVAL;
 
-    DEBUG(9, ("after strptime: %s", asctime(&stm)));
+    DEBUG(9, ("after strptime: %s\n", asctime(&stm)));
     stm.tm_isdst = -1;
     *out = mktime(&stm);
-    DEBUG(9, ("after mktime: %s", ctime(out)));
+    DEBUG(9, ("after mktime: %s\n", ctime(out)));
     return (*out == -1) ? EINVAL : EOK;
 }
 
diff --git a/src/tests/resolv-tests.c b/src/tests/resolv-tests.c
index e93d0f1..d140036 100644
--- a/src/tests/resolv-tests.c
+++ b/src/tests/resolv-tests.c
@@ -211,7 +211,7 @@ static void test_negative(struct tevent_req *req)
                                              &status, NULL, &hostent);
      talloc_zfree(req);
      if (recv_status == EOK) {
-         DEBUG(7, ("resolv_gethostbyname_recv succeeded in a negative test"));
+         DEBUG(7, ("resolv_gethostbyname_recv succeeded in a negative test\n"));
          return;
      }
 
diff --git a/src/tools/files.c b/src/tools/files.c
index 6c64470..90920b6 100644
--- a/src/tools/files.c
+++ b/src/tools/files.c
@@ -172,7 +172,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx,
     rootdir = opendir(root);
     if (rootdir == NULL) {
         ret = errno;
-        DEBUG(1, ("Cannot open directory %s [%d][%s]",
+        DEBUG(1, ("Cannot open directory %s [%d][%s]\n",
                   root, ret, strerror(ret)));
         goto fail;
     }
-- 
1.6.2.5

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to