summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-06-21 11:50:44 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-25 15:31:32 +0200
commit07065554c8963e2aa9fc227a51480135bc4d5130 (patch)
treeb31d781af0ae6fd120d31468cfa6b705af132e1d
parent07d82f79d2970a08628ebf71343441ec55faa6fa (diff)
downloadsssd-07065554c8963e2aa9fc227a51480135bc4d5130.tar.gz
sssd-07065554c8963e2aa9fc227a51480135bc4d5130.tar.xz
sssd-07065554c8963e2aa9fc227a51480135bc4d5130.zip
fix dead code in fail_over_srv.c
https://fedorahosted.org/sssd/ticket/1969 The dead code is in fo_discover_servers_primary_done(). By fixing it I have also added a debug message on ret != EOK. This change is done also in fo_discover_servers_backup_done().
-rw-r--r--src/providers/fail_over_srv.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/providers/fail_over_srv.c b/src/providers/fail_over_srv.c
index 96c8248fc..78cd6cc45 100644
--- a/src/providers/fail_over_srv.c
+++ b/src/providers/fail_over_srv.c
@@ -292,17 +292,16 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq)
&state->num_primary_servers);
talloc_zfree(subreq);
if (ret != EOK) {
- goto done;
+ DEBUG(SSSDBG_OP_FAILURE, ("Unable to retrieve primary servers "
+ "[%d]: %s\n", ret, sss_strerror(ret)));
+ if (ret != ERR_SRV_NOT_FOUND && ret != ERR_SRV_LOOKUP_ERROR) {
+ /* abort on system error */
+ goto done;
+ }
}
if (state->backup_domain == NULL) {
DEBUG(SSSDBG_TRACE_FUNC, ("No backup domain specified\n"));
-
- if (ret == ERR_SRV_NOT_FOUND || ret == ERR_SRV_LOOKUP_ERROR) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to retrieve primary nor "
- "backup servers [%d]: %s\n", ret, sss_strerror(ret)));
- }
-
goto done;
}
@@ -360,12 +359,14 @@ static void fo_discover_servers_backup_done(struct tevent_req *subreq)
&state->backup_servers,
&state->num_backup_servers);
talloc_zfree(subreq);
- if (ret == ERR_SRV_NOT_FOUND || ret == ERR_SRV_LOOKUP_ERROR) {
- /* we have successfully fetched primary servers, so we will
- * finish the request normally */
+ if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to retrieve backup servers "
"[%d]: %s\n", ret, sss_strerror(ret)));
- ret = EOK;
+ if (ret == ERR_SRV_NOT_FOUND || ret == ERR_SRV_LOOKUP_ERROR) {
+ /* we have successfully fetched primary servers, so we will
+ * finish the request normally on non system error */
+ ret = EOK;
+ }
}
if (ret != EOK) {