diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/providers/ldap/sdap_async_connection.c | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.zip |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/providers/ldap/sdap_async_connection.c')
-rw-r--r-- | src/providers/ldap/sdap_async_connection.c | 264 |
1 files changed, 132 insertions, 132 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index 0a7746088..2494837eb 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -41,7 +41,7 @@ errno_t deref_string_to_val(const char *str, int *val) } else if (strcasecmp(str, "always") == 0) { *val = LDAP_DEREF_ALWAYS; } else { - DEBUG(1, ("Illegal deref option [%s].\n", str)); + DEBUG(1, "Illegal deref option [%s].\n", str); return EINVAL; } @@ -125,7 +125,7 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx, timeout); if (subreq == NULL) { ret = ENOMEM; - DEBUG(1, ("sss_ldap_init_send failed.\n")); + DEBUG(1, "sss_ldap_init_send failed.\n"); goto fail; } @@ -164,14 +164,14 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ret = sss_ldap_init_recv(subreq, &state->sh->ldap, &sd); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("sdap_async_connect_call request failed.\n")); + DEBUG(1, "sdap_async_connect_call request failed.\n"); tevent_req_error(req, ret); return; } ret = setup_ldap_connection_callbacks(state->sh, state->ev); if (ret != EOK) { - DEBUG(1, ("setup_ldap_connection_callbacks failed.\n")); + DEBUG(1, "setup_ldap_connection_callbacks failed.\n"); goto fail; } @@ -181,7 +181,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (sd != -1) { ret = sdap_call_conn_cb(state->uri, sd, state->sh); if (ret != EOK) { - DEBUG(1, ("sdap_call_conn_cb failed.\n")); + DEBUG(1, "sdap_call_conn_cb failed.\n"); goto fail; } } @@ -190,7 +190,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ver = LDAP_VERSION3; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_PROTOCOL_VERSION, &ver); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set ldap version to 3\n")); + DEBUG(1, "Failed to set ldap version to 3\n"); goto fail; } @@ -198,7 +198,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) * to handle EINTR during poll(). */ ret = ldap_set_option(state->sh->ldap, LDAP_OPT_RESTART, LDAP_OPT_ON); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set restart option.\n")); + DEBUG(1, "Failed to set restart option.\n"); } /* Set Network Timeout */ @@ -206,8 +206,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) tv.tv_usec = 0; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_NETWORK_TIMEOUT, &tv); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set network timeout to %d\n", - dp_opt_get_int(state->opts->basic, SDAP_NETWORK_TIMEOUT))); + DEBUG(1, "Failed to set network timeout to %d\n", + dp_opt_get_int(state->opts->basic, SDAP_NETWORK_TIMEOUT)); goto fail; } @@ -216,8 +216,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) tv.tv_usec = 0; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_TIMEOUT, &tv); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set default timeout to %d\n", - dp_opt_get_int(state->opts->basic, SDAP_OPT_TIMEOUT))); + DEBUG(1, "Failed to set default timeout to %d\n", + dp_opt_get_int(state->opts->basic, SDAP_OPT_TIMEOUT)); goto fail; } @@ -226,8 +226,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_option(state->sh->ldap, LDAP_OPT_REFERRALS, (ldap_referrals ? LDAP_OPT_ON : LDAP_OPT_OFF)); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set referral chasing to %s\n", - (ldap_referrals ? "LDAP_OPT_ON" : "LDAP_OPT_OFF"))); + DEBUG(1, "Failed to set referral chasing to %s\n", + (ldap_referrals ? "LDAP_OPT_ON" : "LDAP_OPT_OFF")); goto fail; } @@ -235,7 +235,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) rebind_proc_params = talloc_zero(state->sh, struct sdap_rebind_proc_params); if (rebind_proc_params == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -247,7 +247,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_rebind_proc(state->sh->ldap, sdap_rebind_proc, rebind_proc_params); if (lret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_set_rebind_proc failed.\n")); + DEBUG(1, "ldap_set_rebind_proc failed.\n"); goto fail; } } @@ -257,13 +257,13 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (ldap_deref != NULL) { ret = deref_string_to_val(ldap_deref, &ldap_deref_val); if (ret != EOK) { - DEBUG(1, ("deref_string_to_val failed.\n")); + DEBUG(1, "deref_string_to_val failed.\n"); goto fail; } lret = ldap_set_option(state->sh->ldap, LDAP_OPT_DEREF, &ldap_deref_val); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set deref option to %d\n", ldap_deref_val)); + DEBUG(1, "Failed to set deref option to %d\n", ldap_deref_val); goto fail; } @@ -276,9 +276,9 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (lret != LDAP_OPT_SUCCESS) { /* Do not fail, just warn into both debug logs and syslog */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to set LDAP SASL nocanon option to %s. If your system " + "Failed to set LDAP SASL nocanon option to %s. If your system " "is configured to use SASL, LDAP operations might fail.\n", - sasl_nocanon ? "true" : "false")); + sasl_nocanon ? "true" : "false"); sss_log(SSS_LOG_INFO, "Failed to set LDAP SASL nocanon option to %s. If your system " "is configured to use SASL, LDAP operations might fail.\n", @@ -293,8 +293,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_option(state->sh->ldap, LDAP_OPT_X_SASL_SSF_MIN, &ber_sasl_minssf); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set LDAP MIN SSF option " - "to %d\n", sasl_minssf)); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set LDAP MIN SSF option " + "to %d\n", sasl_minssf); goto fail; } } @@ -307,21 +307,21 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) return; } - DEBUG(4, ("Executing START TLS\n")); + DEBUG(4, "Executing START TLS\n"); lret = ldap_start_tls(state->sh->ldap, NULL, NULL, &msgid); if (lret != LDAP_SUCCESS) { optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &errmsg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_start_tls failed: [%s] [%s]\n", + DEBUG(3, "ldap_start_tls failed: [%s] [%s]\n", sss_ldap_err2string(lret), - errmsg)); + errmsg); sss_log(SSS_LOG_ERR, "Could not start TLS. %s", errmsg); } else { - DEBUG(3, ("ldap_start_tls failed: [%s]\n", - sss_ldap_err2string(lret))); + DEBUG(3, "ldap_start_tls failed: [%s]\n", + sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS. " "Check for certificate issues."); } @@ -335,7 +335,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_connect_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto fail; } @@ -376,17 +376,17 @@ static void sdap_connect_done(struct sdap_op *op, ret = ldap_parse_result(state->sh->ldap, state->reply->msg, &state->result, NULL, &errmsg, NULL, NULL, 0); if (ret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d)\n", state->op->msgid)); + DEBUG(2, "ldap_parse_result failed (%d)\n", state->op->msgid); tevent_req_error(req, EIO); return; } - DEBUG(3, ("START TLS result: %s(%d), %s\n", - sss_ldap_err2string(state->result), state->result, errmsg)); + DEBUG(3, "START TLS result: %s(%d), %s\n", + sss_ldap_err2string(state->result), state->result, errmsg); ldap_memfree(errmsg); if (ldap_tls_inplace(state->sh->ldap)) { - DEBUG(9, ("SSL/TLS handler already in place.\n")); + DEBUG(9, "SSL/TLS handler already in place.\n"); tevent_req_done(req); return; } @@ -398,14 +398,14 @@ static void sdap_connect_done(struct sdap_op *op, optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &tlserr); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_install_tls failed: [%s] [%s]\n", + DEBUG(3, "ldap_install_tls failed: [%s] [%s]\n", sss_ldap_err2string(ret), - tlserr)); + tlserr); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. %s", tlserr); } else { - DEBUG(3, ("ldap_install_tls failed: [%s]\n", - sss_ldap_err2string(ret))); + DEBUG(3, "ldap_install_tls failed: [%s]\n", + sss_ldap_err2string(ret)); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. " "Check for certificate issues."); } @@ -468,7 +468,7 @@ struct tevent_req *sdap_connect_host_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_connect_host_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -495,7 +495,7 @@ struct tevent_req *sdap_connect_host_send(TALLOC_CTX *mem_ctx, goto immediately; } - DEBUG(SSSDBG_TRACE_FUNC, ("Resolving host %s\n", host)); + DEBUG(SSSDBG_TRACE_FUNC, "Resolving host %s\n", host); subreq = resolv_gethostbyname_send(state, state->ev, resolv_ctx, host, family_order, host_db); @@ -534,19 +534,19 @@ static void sdap_connect_host_resolv_done(struct tevent_req *subreq) ret = resolv_gethostbyname_recv(subreq, state, &status, NULL, &hostent); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to resolve host %s: %s\n", - state->host, resolv_strerror(status))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to resolve host %s: %s\n", + state->host, resolv_strerror(status)); goto done; } sockaddr = resolv_get_sockaddr_address(state, hostent, state->port); if (sockaddr == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("resolv_get_sockaddr_address() failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "resolv_get_sockaddr_address() failed\n"); ret = EIO; goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Connecting to %s\n", state->uri)); + DEBUG(SSSDBG_TRACE_FUNC, "Connecting to %s\n", state->uri); subreq = sdap_connect_send(state, state->ev, state->opts, state->uri, sockaddr, state->use_start_tls); @@ -589,12 +589,12 @@ static void sdap_connect_host_done(struct tevent_req *subreq) /* we need to mark handle as connected to allow anonymous bind */ ret = sdap_set_connected(state->sh, state->ev); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_set_connected() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_set_connected() failed\n"); goto done; } } - DEBUG(SSSDBG_TRACE_FUNC, ("Successful connection to %s\n", state->uri)); + DEBUG(SSSDBG_TRACE_FUNC, "Successful connection to %s\n", state->uri); done: if (ret != EOK) { @@ -669,13 +669,13 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = sss_ldap_control_create(LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sss_ldap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sss_ldap_control_create failed to create " + "Password Policy control.\n"); goto fail; } request_controls = ctrls; - DEBUG(4, ("Executing simple bind as: %s\n", state->user_dn)); + DEBUG(4, "Executing simple bind as: %s\n", state->user_dn); ret = ldap_sasl_bind(state->sh->ldap, state->user_dn, LDAP_SASL_SIMPLE, pw, request_controls, NULL, &msgid); @@ -684,16 +684,16 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = ldap_get_option(state->sh->ldap, LDAP_OPT_RESULT_CODE, &ldap_err); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_bind failed (couldn't get ldap error)\n")); + DEBUG(1, "ldap_bind failed (couldn't get ldap error)\n"); ret = LDAP_LOCAL_ERROR; } else { - DEBUG(1, ("ldap_bind failed (%d)[%s]\n", - ldap_err, sss_ldap_err2string(ldap_err))); + DEBUG(1, "ldap_bind failed (%d)[%s]\n", + ldap_err, sss_ldap_err2string(ldap_err)); ret = ldap_err; } goto fail; } - DEBUG(8, ("ldap simple bind sent, msgid = %d\n", msgid)); + DEBUG(8, "ldap simple bind sent, msgid = %d\n", msgid); if (!sh->connected) { ret = sdap_set_connected(sh, ev); @@ -704,7 +704,7 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = sdap_op_add(state, ev, sh, msgid, simple_bind_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto fail; } @@ -750,7 +750,7 @@ static void simple_bind_done(struct sdap_op *op, &response_controls, 0); if (lret != LDAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldap_parse_result failed (%d)\n", state->op->msgid)); + "ldap_parse_result failed (%d)\n", state->op->msgid); ret = ERR_INTERNAL; goto done; } @@ -762,13 +762,13 @@ static void simple_bind_done(struct sdap_op *op, } if (response_controls == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("Server returned no controls.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Server returned no controls.\n"); state->ppolicy = NULL; } else { for (c = 0; response_controls[c] != NULL; c++) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Server returned control [%s].\n", - response_controls[c]->ldctl_oid)); + "Server returned control [%s].\n", + response_controls[c]->ldctl_oid); if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) { lret = ldap_parse_passwordpolicy_control(state->sh->ldap, @@ -777,14 +777,14 @@ static void simple_bind_done(struct sdap_op *op, &pp_error); if (lret != LDAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldap_parse_passwordpolicy_control failed.\n")); + "ldap_parse_passwordpolicy_control failed.\n"); ret = ERR_INTERNAL; goto done; } - DEBUG(7, ("Password Policy Response: expire [%d] grace [%d] " + DEBUG(7, "Password Policy Response: expire [%d] grace [%d] " "error [%s].\n", pp_expire, pp_grace, - ldap_passwordpolicy_err2txt(pp_error))); + ldap_passwordpolicy_err2txt(pp_error)); if (!state->ppolicy) state->ppolicy = talloc_zero(state, struct sdap_ppolicy_data); @@ -798,29 +798,29 @@ static void simple_bind_done(struct sdap_op *op, if (pp_error == PP_changeAfterReset) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password was reset. " - "User must set a new password.\n")); + "Password was reset. " + "User must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } else if (pp_grace >= 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired. " + "Password expired. " "[%d] grace logins remaining.\n", - pp_grace)); + pp_grace); } else if (pp_expire > 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password will expire in [%d] seconds.\n", - pp_expire)); + "Password will expire in [%d] seconds.\n", + pp_expire); } } else if (result == LDAP_INVALID_CREDENTIALS && pp_error == PP_passwordExpired) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired user must set a new password.\n")); + "Password expired user must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } } else if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PWEXPIRED) == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired user must set a new password.\n")); + "Password expired user must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } else if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PWEXPIRING) == 0) { @@ -850,21 +850,21 @@ static void simple_bind_done(struct sdap_op *op, talloc_zfree(nval); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Couldn't convert control response " - "to an integer [%s].\n", strerror(ret))); + "Couldn't convert control response " + "to an integer [%s].\n", strerror(ret)); goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Password will expire in [%d] seconds.\n", - state->ppolicy->expire)); + "Password will expire in [%d] seconds.\n", + state->ppolicy->expire); } } } - DEBUG(SSSDBG_TRACE_FUNC, ("Bind result: %s(%d), %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Bind result: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set"); if (result != LDAP_SUCCESS && ret == EOK) { ret = ERR_AUTH_FAILED; @@ -933,8 +933,8 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx, state->sasl_user = sasl_user; state->sasl_cred = sasl_cred; - DEBUG(4, ("Executing sasl bind mech: %s, user: %s\n", - sasl_mech, sasl_user)); + DEBUG(4, "Executing sasl bind mech: %s, user: %s\n", + sasl_mech, sasl_user); /* FIXME: Warning, this is a sync call! * No async variant exist in openldap libraries yet */ @@ -945,14 +945,14 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx, (*sdap_sasl_interact), state); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_sasl_bind failed (%d)[%s]\n", - ret, sss_ldap_err2string(ret))); + "ldap_sasl_bind failed (%d)[%s]\n", + ret, sss_ldap_err2string(ret)); optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &diag_msg); if (optret == EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Extended failure message: [%s]\n", diag_msg)); + "Extended failure message: [%s]\n", diag_msg); } talloc_zfree(diag_msg); @@ -1075,12 +1075,12 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, struct sdap_kinit_state *state; int ret; - DEBUG(6, ("Attempting kinit (%s, %s, %s, %d)\n", + DEBUG(6, "Attempting kinit (%s, %s, %s, %d)\n", keytab ? keytab : "default", - principal, realm, lifetime)); + principal, realm, lifetime); if (lifetime < 0 || lifetime > INT32_MAX) { - DEBUG(1, ("Ticket lifetime out of range.\n")); + DEBUG(1, "Ticket lifetime out of range.\n"); return NULL; } @@ -1099,7 +1099,7 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, if (keytab) { ret = setenv("KRB5_KTNAME", keytab, 1); if (ret == -1) { - DEBUG(2, ("Failed to set KRB5_KTNAME to %s\n", keytab)); + DEBUG(2, "Failed to set KRB5_KTNAME to %s\n", keytab); talloc_free(req); return NULL; } @@ -1111,8 +1111,8 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, ret = setenv("KRB5_CANONICALIZE", "false", 1); } if (ret == -1) { - DEBUG(2, ("Failed to set KRB5_CANONICALIZE to %s\n", - ((canonicalize)?"true":"false"))); + DEBUG(2, "Failed to set KRB5_CANONICALIZE to %s\n", + ((canonicalize)?"true":"false")); talloc_free(req); return NULL; } @@ -1132,14 +1132,14 @@ static struct tevent_req *sdap_kinit_next_kdc(struct tevent_req *req) struct sdap_kinit_state *state = tevent_req_data(req, struct sdap_kinit_state); - DEBUG(7, ("Resolving next KDC for service %s\n", state->krb_service_name)); + DEBUG(7, "Resolving next KDC for service %s\n", state->krb_service_name); next_req = be_resolve_server_send(state, state->ev, state->be, state->krb_service_name, state->kdc_srv == NULL ? true : false); if (next_req == NULL) { - DEBUG(1, ("be_resolve_server_send failed.\n")); + DEBUG(1, "be_resolve_server_send failed.\n"); return NULL; } tevent_req_set_callback(next_req, sdap_kinit_kdc_resolved, req); @@ -1165,7 +1165,7 @@ static void sdap_kinit_kdc_resolved(struct tevent_req *subreq) return; } - DEBUG(7, ("KDC resolved, attempting to get TGT...\n")); + DEBUG(7, "KDC resolved, attempting to get TGT...\n"); tgtreq = sdap_get_tgt_send(state, state->ev, state->realm, state->principal, state->keytab, @@ -1198,7 +1198,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) /* The child didn't even respond. Perhaps the KDC is too busy, * retry with another KDC */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Communication with KDC timed out, trying the next one\n")); + "Communication with KDC timed out, trying the next one\n"); be_fo_set_port_status(state->be, state->krb_service_name, state->kdc_srv, PORT_NOT_WORKING); nextreq = sdap_kinit_next_kdc(req); @@ -1208,7 +1208,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) return; } else if (ret != EOK) { /* A severe error while executing the child. Abort the operation. */ - DEBUG(1, ("child failed (%d [%s])\n", ret, strerror(ret))); + DEBUG(1, "child failed (%d [%s])\n", ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1216,7 +1216,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) if (result == EOK) { ret = setenv("KRB5CCNAME", ccname, 1); if (ret == -1) { - DEBUG(2, ("Unable to set env. variable KRB5CCNAME!\n")); + DEBUG(2, "Unable to set env. variable KRB5CCNAME!\n"); tevent_req_error(req, ERR_AUTH_FAILED); } @@ -1236,7 +1236,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) } - DEBUG(4, ("Could not get TGT: %d [%s]\n", result, sss_strerror(result))); + DEBUG(4, "Could not get TGT: %d [%s]\n", result, sss_strerror(result)); tevent_req_error(req, ERR_AUTH_FAILED); } @@ -1298,7 +1298,7 @@ struct tevent_req *sdap_auth_send(TALLOC_CTX *memctx, ret = sss_authtok_get_password(authtok, &password, &pwlen); if (ret != EOK) { - DEBUG(1, ("Cannot parse authtok.\n")); + DEBUG(1, "Cannot parse authtok.\n"); tevent_req_error(req, ret); return tevent_req_post(req, ev); } @@ -1333,8 +1333,8 @@ static int sdap_auth_get_authtok(const char *authtok_type, pw->bv_len = authtok.length; pw->bv_val = (char *) authtok.data; } else { - DEBUG(1, ("Authentication token type [%s] is not supported\n", - authtok_type)); + DEBUG(1, "Authentication token type [%s] is not supported\n", + authtok_type); return EINVAL; } @@ -1503,8 +1503,8 @@ static void sdap_cli_resolve_done(struct tevent_req *subreq) } if (use_tls && sdap_is_secure_uri(state->service->uri)) { - DEBUG(8, ("[%s] is a secure channel. No need to run START_TLS\n", - state->service->uri)); + DEBUG(8, "[%s] is a secure channel. No need to run START_TLS\n", + state->service->uri); use_tls = false; } @@ -1628,7 +1628,7 @@ static void sdap_cli_rootdse_done(struct tevent_req *subreq) ret = sdap_cli_use_rootdse(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_use_rootdse failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_use_rootdse failed\n"); tevent_req_error(req, ret); return; } @@ -1662,7 +1662,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) ret = sdap_set_rootdse_supported_lists(state->rootdse, state->sh); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_set_rootdse_supported_lists failed\n")); + "sdap_set_rootdse_supported_lists failed\n"); return ret; } @@ -1670,7 +1670,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) state->opts->sdom); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_set_config_options_with_rootdse failed.\n")); + "sdap_set_config_options_with_rootdse failed.\n"); return ret; } @@ -1682,7 +1682,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) state->opts, &state->srv_opts); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_server_opts_from_rootdse failed.\n")); + "sdap_get_server_opts_from_rootdse failed.\n"); return ret; } @@ -1738,7 +1738,7 @@ static void sdap_cli_kinit_done(struct tevent_req *subreq) /* We're not able to authenticate to the LDAP server. * There's not much we can do except for going offline */ DEBUG(SSSDBG_TRACE_FUNC, - ("Cannot get a TGT: ret [%d](%s)\n", ret, sss_strerror(ret))); + "Cannot get a TGT: ret [%d](%s)\n", ret, sss_strerror(ret)); tevent_req_error(req, EACCES); return; } @@ -1768,18 +1768,18 @@ static void sdap_cli_auth_step(struct tevent_req *req) */ now = time(NULL); expire_timeout = dp_opt_get_int(state->opts->basic, SDAP_EXPIRE_TIMEOUT); - DEBUG(SSSDBG_CONF_SETTINGS, ("expire timeout is %d\n", expire_timeout)); + DEBUG(SSSDBG_CONF_SETTINGS, "expire timeout is %d\n", expire_timeout); if (!state->sh->expire_time || (state->sh->expire_time > (now + expire_timeout))) { state->sh->expire_time = now + expire_timeout; DEBUG(SSSDBG_TRACE_LIBS, - ("the connection will expire at %ld\n", state->sh->expire_time)); + "the connection will expire at %ld\n", state->sh->expire_time); } if (!state->do_auth || (sasl_mech == NULL && user_dn == NULL)) { DEBUG(SSSDBG_TRACE_LIBS, - ("No authentication requested or SASL auth forced off\n")); + "No authentication requested or SASL auth forced off\n"); tevent_req_done(req); return; } @@ -1794,7 +1794,7 @@ static void sdap_cli_auth_step(struct tevent_req *req) if (authtok_type != NULL) { if (strcasecmp(authtok_type, "password") != 0) { - DEBUG(SSSDBG_TRACE_LIBS, ("Invalid authtoken type\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Invalid authtoken type\n"); tevent_req_error(req, EINVAL); return; } @@ -1893,7 +1893,7 @@ static void sdap_cli_rootdse_auth_done(struct tevent_req *subreq) /* We were able to get rootDSE after authentication */ ret = sdap_cli_use_rootdse(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_use_rootdse failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_use_rootdse failed\n"); tevent_req_error(req, ret); return; } @@ -1965,7 +1965,7 @@ static int synchronous_tls_setup(LDAP *ldap) LDAPMessage *result = NULL; TALLOC_CTX *tmp_ctx; - DEBUG(4, ("Executing START TLS\n")); + DEBUG(4, "Executing START TLS\n"); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return LDAP_NO_MEMORY; @@ -1974,11 +1974,11 @@ static int synchronous_tls_setup(LDAP *ldap) if (lret != LDAP_SUCCESS) { optret = sss_ldap_get_diagnostic_msg(tmp_ctx, ldap, &diag_msg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_start_tls failed: [%s] [%s]\n", - sss_ldap_err2string(lret), diag_msg)); + DEBUG(3, "ldap_start_tls failed: [%s] [%s]\n", + sss_ldap_err2string(lret), diag_msg); sss_log(SSS_LOG_ERR, "Could not start TLS. %s", diag_msg); } else { - DEBUG(3, ("ldap_start_tls failed: [%s]\n", sss_ldap_err2string(lret))); + DEBUG(3, "ldap_start_tls failed: [%s]\n", sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS. " "Check for certificate issues."); } @@ -1988,8 +1988,8 @@ static int synchronous_tls_setup(LDAP *ldap) lret = ldap_result(ldap, msgid, 1, NULL, &result); if (lret != LDAP_RES_EXTENDED) { DEBUG(SSSDBG_OP_FAILURE, - ("Unexpected ldap_result, expected [%lu] got [%d].\n", - LDAP_RES_EXTENDED, lret)); + "Unexpected ldap_result, expected [%lu] got [%d].\n", + LDAP_RES_EXTENDED, lret); lret = LDAP_PARAM_ERROR; goto done; } @@ -1997,16 +1997,16 @@ static int synchronous_tls_setup(LDAP *ldap) lret = ldap_parse_result(ldap, result, &ldaperr, NULL, &errmsg, NULL, NULL, 0); if (lret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d) [%d][%s]\n", msgid, lret, - sss_ldap_err2string(lret))); + DEBUG(2, "ldap_parse_result failed (%d) [%d][%s]\n", msgid, lret, + sss_ldap_err2string(lret)); goto done; } - DEBUG(3, ("START TLS result: %s(%d), %s\n", - sss_ldap_err2string(ldaperr), ldaperr, errmsg)); + DEBUG(3, "START TLS result: %s(%d), %s\n", + sss_ldap_err2string(ldaperr), ldaperr, errmsg); if (ldap_tls_inplace(ldap)) { - DEBUG(9, ("SSL/TLS handler already in place.\n")); + DEBUG(9, "SSL/TLS handler already in place.\n"); lret = LDAP_SUCCESS; goto done; } @@ -2016,12 +2016,12 @@ static int synchronous_tls_setup(LDAP *ldap) optret = sss_ldap_get_diagnostic_msg(tmp_ctx, ldap, &diag_msg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_install_tls failed: [%s] [%s]\n", - sss_ldap_err2string(lret), diag_msg)); + DEBUG(3, "ldap_install_tls failed: [%s] [%s]\n", + sss_ldap_err2string(lret), diag_msg); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. %s", diag_msg); } else { - DEBUG(3, ("ldap_install_tls failed: [%s]\n", - sss_ldap_err2string(lret))); + DEBUG(3, "ldap_install_tls failed: [%s]\n", + sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. " "Check for certificate issues."); } @@ -2054,14 +2054,14 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, if (p->use_start_tls) { ret = synchronous_tls_setup(ldap); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("synchronous_tls_setup failed.\n")); + DEBUG(1, "synchronous_tls_setup failed.\n"); return ret; } } tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return LDAP_NO_MEMORY; } @@ -2071,8 +2071,8 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, ret = sss_ldap_control_create(LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sss_ldap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sss_ldap_control_create failed to create " + "Password Policy control.\n"); goto done; } request_controls = ctrls; @@ -2086,7 +2086,7 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, &password); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_auth_get_authtok failed.\n")); + "sdap_auth_get_authtok failed.\n"); ret = LDAP_LOCAL_ERROR; goto done; } @@ -2096,13 +2096,13 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, request_controls, NULL, NULL); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_sasl_bind_s failed (%d)[%s]\n", ret, - sss_ldap_err2string(ret))); + "ldap_sasl_bind_s failed (%d)[%s]\n", ret, + sss_ldap_err2string(ret)); } } else { sasl_bind_state = talloc_zero(tmp_ctx, struct sasl_bind_state); if (sasl_bind_state == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = LDAP_NO_MEMORY; goto done; } @@ -2114,13 +2114,13 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, (*sdap_sasl_interact), sasl_bind_state); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_sasl_interactive_bind_s failed (%d)[%s]\n", ret, - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_sasl_interactive_bind_s failed (%d)[%s]\n", ret, + sss_ldap_err2string(ret)); } } - DEBUG(7, ("%s bind to [%s].\n", - (ret == LDAP_SUCCESS ? "Successfully" : "Failed to"), url)); + DEBUG(7, "%s bind to [%s].\n", + (ret == LDAP_SUCCESS ? "Successfully" : "Failed to"), url); done: if (ctrls[0]) ldap_control_free(ctrls[0]); |