From 8ceb36c6a0bc19a3016432dca357af7ea0d3b5ff Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Fri, 12 Feb 2010 14:15:27 +0100
Subject: [PATCH] Supress warnings with -O2

---
 server/db/sysdb.c                 |    8 ++++----
 server/ldb_modules/memberof.c     |    2 +-
 server/providers/krb5/krb5_auth.c |    7 ++++---
 server/responder/pam/pamsrv_cmd.c |    3 ++-
 server/util/find_uid.c            |    2 +-
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index 88d6011..b3f81a0 100644
--- a/server/db/sysdb.c
+++ b/server/db/sysdb.c
@@ -1188,7 +1188,7 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
             if (ret != LDB_SUCCESS) {
                 DEBUG(0, ("WARNING: Could not remove entry %s,"
                           " from old ldb file! (%d [%s])\n",
-                          ldb_dn_get_linearized(msg->dn),
+                          ldb_dn_get_linearized(orig_dn),
                           ret, ldb_errstring(ldb)));
             }
         }
@@ -1200,21 +1200,21 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
         if (ret != LDB_SUCCESS) {
             DEBUG(9, ("WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
-                      ldb_dn_get_linearized(msg->dn),
+                      ldb_dn_get_linearized(groups_dn),
                       ret, ldb_errstring(ldb)));
         }
         ret = ldb_delete(ldb, users_dn);
         if (ret != LDB_SUCCESS) {
             DEBUG(9, ("WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
-                      ldb_dn_get_linearized(msg->dn),
+                      ldb_dn_get_linearized(users_dn),
                       ret, ldb_errstring(ldb)));
         }
         ret = ldb_delete(ldb, domain_dn);
         if (ret != LDB_SUCCESS) {
             DEBUG(9, ("WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
-                      ldb_dn_get_linearized(msg->dn),
+                      ldb_dn_get_linearized(domain_dn),
                       ret, ldb_errstring(ldb)));
         }
 
diff --git a/server/ldb_modules/memberof.c b/server/ldb_modules/memberof.c
index b8ab1bc..e0a241a 100644
--- a/server/ldb_modules/memberof.c
+++ b/server/ldb_modules/memberof.c
@@ -1922,7 +1922,7 @@ static int mbof_del_mod_entry(struct mbof_del_operation *delop)
     struct ldb_request *mod_req;
     struct ldb_message *msg;
     struct ldb_message_element *el;
-    struct ldb_dn **diff;
+    struct ldb_dn **diff = NULL;
     const char *name;
     const char *val;
     int i, j, k;
diff --git a/server/providers/krb5/krb5_auth.c b/server/providers/krb5/krb5_auth.c
index 6adaab9..6b6554a 100644
--- a/server/providers/krb5/krb5_auth.c
+++ b/server/providers/krb5/krb5_auth.c
@@ -761,7 +761,8 @@ static void get_user_attr_done(void *pvt, int err, struct ldb_result *res)
     ret = krb5_setup(be_req, &kr);
     if (ret != EOK) {
         DEBUG(1, ("krb5_setup failed.\n"));
-        goto failed;
+        krb_reply(be_req, dp_err, pam_status);
+        return;
     }
 
     pd = kr->pd;
@@ -972,8 +973,8 @@ static void krb5_child_done(struct tevent_req *req)
     struct pam_data *pd = kr->pd;
     struct be_req *be_req = kr->req;
     int ret;
-    uint8_t *buf;
-    ssize_t len;
+    uint8_t *buf = NULL;
+    ssize_t len = -1;
     ssize_t pref_len;
     int p;
     int32_t *msg_status;
diff --git a/server/responder/pam/pamsrv_cmd.c b/server/responder/pam/pamsrv_cmd.c
index c204e0a..45049ff 100644
--- a/server/responder/pam/pamsrv_cmd.c
+++ b/server/responder/pam/pamsrv_cmd.c
@@ -505,7 +505,8 @@ static void pam_reply(struct pam_auth_req *preq)
                     if (ret != EOK) {
                         DEBUG(0, ("Fatal: Sysdb CTX not found for "
                                   "domain [%s]!\n", preq->domain->name));
-                        goto done;
+                        sss_cmd_done(preq->cctx, preq);
+                        return;
                     }
 
                     pctx = talloc_get_type(preq->cctx->rctx->pvt_ctx,
diff --git a/server/util/find_uid.c b/server/util/find_uid.c
index 63907f1..965966e 100644
--- a/server/util/find_uid.c
+++ b/server/util/find_uid.c
@@ -184,7 +184,7 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid)
     DIR *proc_dir = NULL;
     struct dirent *dirent;
     int ret;
-    pid_t pid;
+    pid_t pid = -1;
     uid_t uid;
 
     hash_key_t key;
-- 
1.6.6

