>From 39e1bc1b57774f3860fc4ff1e37413a46abd2ad0 Mon Sep 17 00:00:00 2001
From: Pavel Reichl <preichl@redhat.com>
Date: Wed, 26 Feb 2014 17:04:11 +0000
Subject: [PATCH 4/4] NSS: Some minor code style improvements

---
 src/responder/nss/nsssrv_netgroup.c | 50 ++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index fae603b9b4fca5449d28b2b890df158c53919e10..c8668451bc34e7b09fbabc4111b26706e5aabd08 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -52,7 +52,7 @@ static errno_t get_netgroup_entry(struct nss_ctx *nctx,
 
     DEBUG(SSSDBG_CRIT_FAILURE,
           "Unexpected error reading from netgroup hash [%d][%s]\n",
-              hret, hash_error_string(hret));
+          hret, hash_error_string(hret));
     return EIO;
 }
 
@@ -91,6 +91,7 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx,
                                            const char *rawname,
                                            struct nss_cmd_ctx *cmdctx);
 static void nss_cmd_setnetgrent_done(struct tevent_req *req);
+
 int nss_cmd_setnetgrent(struct cli_ctx *client)
 {
     struct nss_cmd_ctx *cmdctx;
@@ -138,16 +139,16 @@ done:
     return nss_cmd_done(cmdctx, ret);
 }
 
-static int netgr_hash_remove (TALLOC_CTX *ctx)
+static int netgr_hash_remove(TALLOC_CTX *ctx)
 {
     int hret;
     hash_key_t key;
     struct getent_ctx *netgr =
-            talloc_get_type(ctx, struct getent_ctx);
+        talloc_get_type(ctx, struct getent_ctx);
 
     if (netgr->lookup_table == NULL) {
         DEBUG(SSSDBG_TRACE_LIBS, "netgroup [%s] was already removed\n",
-                                  netgr->name);
+              netgr->name);
         return EOK;
     }
 
@@ -159,7 +160,7 @@ static int netgr_hash_remove (TALLOC_CTX *ctx)
     if (hret != HASH_SUCCESS) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not remove key [%s] from table! [%d][%s]\n",
-                  netgr->name, hret, hash_error_string(hret));
+              netgr->name, hret, hash_error_string(hret));
         return -1;
     }
     return 0;
@@ -216,8 +217,9 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx,
         goto error;
     }
 
-    DEBUG(SSSDBG_CONF_SETTINGS, "Requesting info for netgroup [%s] from [%s]\n",
-              state->netgr_shortname, domname?domname:"<ALL>");
+    DEBUG(SSSDBG_CONF_SETTINGS,
+          "Requesting info for netgroup [%s] from [%s]\n",
+          state->netgr_shortname, domname?domname:"<ALL>");
 
     if (domname) {
         dctx->domain = responder_get_domain(client->rctx, domname);
@@ -367,7 +369,7 @@ static errno_t setnetgrent_retry(struct tevent_req *req)
         step_ctx->rctx = client->rctx;
         step_ctx->check_next = cmdctx->check_next;
         step_ctx->name =
-                talloc_strdup(step_ctx, state->netgr->name);
+            talloc_strdup(step_ctx, state->netgr->name);
         if (!step_ctx->name) {
             ret = ENOMEM;
             goto done;
@@ -425,7 +427,7 @@ static void set_netgr_lifetime(uint32_t lifetime,
     if (!te) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not set up life timer for setnetgrent result object. "
-                  "Entries may become stale.\n");
+              "Entries may become stale.\n");
     }
 }
 
@@ -512,8 +514,9 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
                                      &netgr->entries);
         if (ret == ENOENT) {
             /* This netgroup was not found in this domain */
-            DEBUG(SSSDBG_OP_FAILURE, "No results for netgroup %s (domain %s)\n",
-                      name, dom->name);
+            DEBUG(SSSDBG_OP_FAILURE,
+                  "No results for netgroup %s (domain %s)\n",
+                  name, dom->name);
 
             if (!step_ctx->dctx->check_provider) {
                 if (step_ctx->check_next) {
@@ -554,7 +557,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
 
         /* Results found */
         DEBUG(SSSDBG_TRACE_FUNC, "Returning info for netgroup [%s@%s]\n",
-                  name, dom->name);
+              name, dom->name);
         netgr->ready = true;
         netgr->found = true;
         if (step_ctx->nctx->cache_refresh_percent) {
@@ -589,7 +592,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
 
         ret = set_netgroup_entry(step_ctx->nctx, netgr);
         if (ret != EOK) {
-            DEBUG(SSSDBG_CRIT_FAILURE, "set_netgroup_entry failed, ignored.\n");
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  "set_netgroup_entry failed, ignored.\n");
         }
         set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr);
     }
@@ -609,9 +613,9 @@ static void lookup_netgr_dp_callback(uint16_t err_maj, uint32_t err_min,
     if (err_maj) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Unable to get information from Data Provider\n"
-                  "Error: %u, %u, %s\n"
-                  "Will try to return what we have in cache\n",
-                  (unsigned int)err_maj, (unsigned int)err_min, err_msg);
+              "Error: %u, %u, %s\n"
+              "Will try to return what we have in cache\n",
+              (unsigned int)err_maj, (unsigned int)err_min, err_msg);
         /* Loop to the next domain if possible */
         if (cmdctx->check_next && get_next_domain(dctx->domain, false)) {
             dctx->domain = get_next_domain(dctx->domain, false);
@@ -752,7 +756,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client)
         return EOK;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n",
-                  ret, strerror(ret));
+              ret, strerror(ret));
 
         return nss_cmd_done(cmdctx, ret);
     }
@@ -805,7 +809,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setnetgrent failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+              "[%d][%s]\n", ret, strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -821,11 +825,11 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
         /* Critical error. This should never happen */
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setnetgrent returned success without creating "
-                  "result object.\n");
+              "result object.\n");
         NSS_CMD_FATAL_ERROR(cmdctx);
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n",
-                  ret, strerror(ret));
+              ret, strerror(ret));
 
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
@@ -834,7 +838,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
         /* Critical error. This should never happen */
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setnetgrent returned success without creating "
-                  "result object.\n");
+              "result object.\n");
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -842,7 +846,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Immediate retrieval failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+              "[%d][%s]\n", ret, strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 }
@@ -996,7 +1000,7 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client,
         } else {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Unexpected value type for netgroup entry. "
-                      "Please check your cache.\n");
+                  "Please check your cache.\n");
             continue;
         }
 
-- 
1.8.4.2

