summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa/ipa_auth.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-02-12 10:12:04 -0500
committerJakub Hrozek <jhrozek@redhat.com>2014-05-02 10:58:19 +0200
commitb0d759c9a604add0573c04b1a4e88e1605e1fdc0 (patch)
tree15c83ce34cd254a30cc42c212123b7f194c21677 /src/providers/ipa/ipa_auth.c
parentb9afd88065ecdb9c2cafb2ee767bd61585b31b8f (diff)
downloadsssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.gz
sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.tar.xz
sssd-b0d759c9a604add0573c04b1a4e88e1605e1fdc0.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 (identical to commit a3c8390d19593b1e5277d95bfb4ab206d4785150): 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/ipa/ipa_auth.c')
-rw-r--r--src/providers/ipa/ipa_auth.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c
index 651196a96..4d5821601 100644
--- a/src/providers/ipa/ipa_auth.c
+++ b/src/providers/ipa/ipa_auth.c
@@ -54,14 +54,14 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx,
struct get_password_migration_flag_state *state;
if (sdap_id_ctx == NULL || ipa_realm == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("Missing parameter.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "Missing parameter.\n");
return NULL;
}
req = tevent_req_create(memctx, &state,
struct get_password_migration_flag_state);
if (req == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n");
return NULL;
}
@@ -74,14 +74,14 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx,
state->sdap_op = sdap_id_op_create(state,
state->sdap_id_ctx->conn->conn_cache);
if (state->sdap_op == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed.\n");
goto fail;
}
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
if (!subreq) {
- DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
+ ret, strerror(ret));
goto fail;
}
@@ -107,12 +107,12 @@ static void get_password_migration_flag_auth_done(struct tevent_req *subreq)
if (ret) {
if (dp_error == DP_ERR_OFFLINE) {
DEBUG(SSSDBG_MINOR_FAILURE,
- ("No IPA server is available, cannot get the "
- "migration flag while offline\n"));
+ "No IPA server is available, cannot get the "
+ "migration flag while offline\n");
} else {
DEBUG(SSSDBG_OP_FAILURE,
- ("Failed to connect to IPA server: [%d](%s)\n",
- ret, strerror(ret)));
+ "Failed to connect to IPA server: [%d](%s)\n",
+ ret, strerror(ret));
}
tevent_req_error(req, ret);
@@ -194,7 +194,7 @@ void ipa_auth(struct be_req *be_req)
state = talloc_zero(be_req, struct ipa_auth_state);
if (state == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n");
goto fail;
}
@@ -219,14 +219,14 @@ void ipa_auth(struct be_req *be_req)
struct ipa_auth_ctx);
break;
default:
- DEBUG(SSSDBG_OP_FAILURE, ("Unsupported PAM task.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "Unsupported PAM task.\n");
goto fail;
}
req = krb5_auth_send(state, state->ev, be_ctx, state->pd,
state->ipa_auth_ctx->krb5_auth_ctx);
if (req == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_send failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_send failed.\n");
goto fail;
}
@@ -251,7 +251,7 @@ static void ipa_auth_handler_done(struct tevent_req *req)
talloc_zfree(req);
state->pd->pam_status = pam_status;
if (ret != EOK && pam_status != PAM_CRED_ERR) {
- DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_recv request failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_recv request failed.\n");
dp_err = DP_ERR_OK;
goto done;
}
@@ -270,7 +270,7 @@ static void ipa_auth_handler_done(struct tevent_req *req)
IPA_KRB5_REALM));
if (req == NULL) {
DEBUG(SSSDBG_OP_FAILURE,
- ("get_password_migration_flag failed.\n"));
+ "get_password_migration_flag failed.\n");
goto done;
}
@@ -293,8 +293,8 @@ static void ipa_get_migration_flag_done(struct tevent_req *req)
&state->password_migration);
talloc_zfree(req);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("get_password_migration_flag "
- "request failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "get_password_migration_flag "
+ "request failed.\n");
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_OK;
goto done;
@@ -307,7 +307,7 @@ static void ipa_get_migration_flag_done(struct tevent_req *req)
state->ipa_auth_ctx->sdap_auth_ctx->service,
true, CON_TLS_ON, true);
if (req == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_connect_send failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_connect_send failed.\n");
goto done;
}
@@ -315,7 +315,7 @@ static void ipa_get_migration_flag_done(struct tevent_req *req)
return;
}
- DEBUG(SSSDBG_CONF_SETTINGS, ("Password migration is not enabled.\n"));
+ DEBUG(SSSDBG_CONF_SETTINGS, "Password migration is not enabled.\n");
dp_err = DP_ERR_OK;
done:
be_req_terminate(state->be_req, dp_err, state->pd->pam_status, NULL);
@@ -336,17 +336,17 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req)
talloc_zfree(req);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("Cannot connect to LDAP server to perform migration\n"));
+ "Cannot connect to LDAP server to perform migration\n");
goto done;
}
state->pd->pam_status = PAM_SYSTEM_ERR;
- DEBUG(SSSDBG_TRACE_FUNC, ("Assuming Kerberos password is missing, "
- "starting password migration.\n"));
+ DEBUG(SSSDBG_TRACE_FUNC, "Assuming Kerberos password is missing, "
+ "starting password migration.\n");
attrs = talloc_array(state, const char *, 2);
if (attrs == NULL) {
- DEBUG(1, ("talloc_array failed.\n"));
+ DEBUG(1, "talloc_array failed.\n");
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_OK;
goto done;
@@ -358,14 +358,14 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req)
be_ctx->domain,
state->pd->user, attrs, &user_msg);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_name failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed.\n");
goto done;
}
dn = ldb_msg_find_attr_as_string(user_msg, SYSDB_ORIG_DN, NULL);
if (dn == NULL) {
- DEBUG(SSSDBG_MINOR_FAILURE, ("Missing original DN for user [%s].\n",
- state->pd->user));
+ DEBUG(SSSDBG_MINOR_FAILURE, "Missing original DN for user [%s].\n",
+ state->pd->user);
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_OK;
goto done;
@@ -374,7 +374,7 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req)
req = sdap_auth_send(state, state->ev, state->sh, NULL, NULL, dn,
state->pd->authtok);
if (req == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("sdap_auth_send failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "sdap_auth_send failed.\n");
goto done;
}
@@ -403,26 +403,26 @@ static void ipa_auth_ldap_done(struct tevent_req *req)
case ERR_AUTH_FAILED:
case ERR_PASSWORD_EXPIRED:
/* TODO: do we need to handle expired passwords? */
- DEBUG(SSSDBG_MINOR_FAILURE, ("LDAP authentication failed, "
- "Password migration not possible.\n"));
+ DEBUG(SSSDBG_MINOR_FAILURE, "LDAP authentication failed, "
+ "Password migration not possible.\n");
state->pd->pam_status = PAM_CRED_INSUFFICIENT;
dp_err = DP_ERR_OK;
goto done;
default:
- DEBUG(SSSDBG_OP_FAILURE, ("auth_send request failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "auth_send request failed.\n");
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_OK;
goto done;
}
- DEBUG(SSSDBG_TRACE_FUNC, ("LDAP authentication succeded, "
- "trying Kerberos authentication again.\n"));
+ DEBUG(SSSDBG_TRACE_FUNC, "LDAP authentication succeded, "
+ "trying Kerberos authentication again.\n");
req = krb5_auth_send(state, state->ev, be_ctx, state->pd,
state->ipa_auth_ctx->krb5_auth_ctx);
if (req == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_send failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_send failed.\n");
goto done;
}
@@ -444,7 +444,7 @@ static void ipa_auth_handler_retry_done(struct tevent_req *req)
ret = krb5_auth_recv(req, &pam_status, &dp_err);
talloc_zfree(req);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_recv request failed.\n"));
+ DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_recv request failed.\n");
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_OK;
goto done;