summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-09-24 09:54:45 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-09-28 13:36:11 -0400
commitf7fa22da5d865221f84371d6b522444e1591164c (patch)
treed7cb422a5a3e43405dc5efc963a1add223ccd884
parent047332ebbe8397a70c92e5e3a5fbd40a9d00d0b5 (diff)
downloadsssd-f7fa22da5d865221f84371d6b522444e1591164c.tar.gz
sssd-f7fa22da5d865221f84371d6b522444e1591164c.tar.xz
sssd-f7fa22da5d865221f84371d6b522444e1591164c.zip
Suppress some 'may be used uninitialized' warnings
Additionally the handling of errno and the errno_t return value of functions is fixed in krb5_common.c.
-rw-r--r--src/providers/krb5/krb5_common.c18
-rw-r--r--src/providers/ldap/sdap_access.c2
-rw-r--r--src/providers/proxy/proxy_auth.c2
-rw-r--r--src/tests/auth-tests.c2
4 files changed, 15 insertions, 9 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index e5471e3f1..d41fdb9df 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -172,8 +172,8 @@ errno_t write_krb5info_file(const char *realm, const char *server,
fd = mkstemp(tmp_name);
if (fd == -1) {
- DEBUG(1, ("mkstemp failed [%d][%s].\n", errno, strerror(errno)));
ret = errno;
+ DEBUG(1, ("mkstemp failed [%d][%s].\n", ret, strerror(ret)));
goto done;
}
@@ -184,7 +184,8 @@ errno_t write_krb5info_file(const char *realm, const char *server,
if (errno == EINTR || errno == EAGAIN) {
continue;
}
- DEBUG(1, ("write failed [%d][%s].\n", errno, strerror(errno)));
+ ret = errno;
+ DEBUG(1, ("write failed [%d][%s].\n", ret, strerror(ret)));
goto done;
}
else {
@@ -195,24 +196,28 @@ errno_t write_krb5info_file(const char *realm, const char *server,
if (written != server_len) {
DEBUG(1, ("Write error, wrote [%d] bytes, expected [%d]\n",
written, server_len));
+ ret = EIO;
goto done;
}
ret = fchmod(fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (ret == -1) {
- DEBUG(1, ("fchmod failed [%d][%s].\n", errno, strerror(errno)));
+ ret = errno;
+ DEBUG(1, ("fchmod failed [%d][%s].\n", ret, strerror(ret)));
goto done;
}
ret = close(fd);
if (ret == -1) {
- DEBUG(1, ("close failed [%d][%s].\n", errno, strerror(errno)));
+ ret = errno;
+ DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret)));
goto done;
}
ret = rename(tmp_name, krb5info_name);
if (ret == -1) {
- DEBUG(1, ("rename failed [%d][%s].\n", errno, strerror(errno)));
+ ret = errno;
+ DEBUG(1, ("rename failed [%d][%s].\n", ret, strerror(ret)));
goto done;
}
@@ -249,7 +254,8 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server)
if (inet_ntop(srvaddr->h_addrtype, srvaddr->h_addr_list[0],
address, 128) == NULL) {
- DEBUG(1, ("inet_ntop failed [%d][%s].\n", errno, strerror(errno)));
+ ret = errno;
+ DEBUG(1, ("inet_ntop failed [%d][%s].\n", ret, strerror(ret)));
return;
}
diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c
index 90b537119..4a30b74be 100644
--- a/src/providers/ldap/sdap_access.c
+++ b/src/providers/ldap/sdap_access.c
@@ -452,7 +452,7 @@ static errno_t sdap_access_recv(struct tevent_req *req, int *pam_status)
static void sdap_access_done(struct tevent_req *req)
{
errno_t ret;
- int pam_status;
+ int pam_status = PAM_SYSTEM_ERR;
struct be_req *breq =
tevent_req_callback_data(req, struct be_req);
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c
index a78de3126..64b38cbed 100644
--- a/src/providers/proxy/proxy_auth.c
+++ b/src/providers/proxy/proxy_auth.c
@@ -711,7 +711,7 @@ static void proxy_child_done(struct tevent_req *req)
{
struct proxy_client_ctx *client_ctx =
tevent_req_callback_data(req, struct proxy_client_ctx);
- struct pam_data *pd;
+ struct pam_data *pd = NULL;
char *password;
int ret;
struct tevent_immediate *imm;
diff --git a/src/tests/auth-tests.c b/src/tests/auth-tests.c
index a3de43c47..bae0794c3 100644
--- a/src/tests/auth-tests.c
+++ b/src/tests/auth-tests.c
@@ -161,7 +161,7 @@ static void do_failed_login_test(uint32_t failed_login_attempts,
int expected_counter,
time_t expected_delay)
{
- struct sysdb_test_ctx *test_ctx;
+ struct sysdb_test_ctx *test_ctx = NULL;
int ret;
const char *val[2];
val[1] = NULL;