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/responder/pam | |
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/responder/pam')
-rw-r--r-- | src/responder/pam/pam_LOCAL_domain.c | 36 | ||||
-rw-r--r-- | src/responder/pam/pam_helpers.c | 16 | ||||
-rw-r--r-- | src/responder/pam/pamsrv.c | 22 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 138 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_dp.c | 24 |
5 files changed, 118 insertions, 118 deletions
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c index 036b47fda..b602259ee 100644 --- a/src/responder/pam/pam_LOCAL_domain.c +++ b/src/responder/pam/pam_LOCAL_domain.c @@ -31,7 +31,7 @@ #define NULL_CHECK_OR_JUMP(var, msg, ret, err, label) do { \ if (var == NULL) { \ - DEBUG(1, (msg)); \ + DEBUG(1, msg); \ ret = (err); \ goto label; \ } \ @@ -39,7 +39,7 @@ #define NEQ_CHECK_OR_JUMP(var, val, msg, ret, err, label) do { \ if (var != (val)) { \ - DEBUG(1, (msg)); \ + DEBUG(1, msg); \ ret = (err); \ goto label; \ } \ @@ -168,7 +168,7 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq) if (ret) { /* TODO: should we allow null passwords via a config option ? */ if (ret == ENOENT) { - DEBUG(1, ("Empty passwords are not allowed!\n")); + DEBUG(1, "Empty passwords are not allowed!\n"); } lreq->error = EINVAL; goto done; @@ -177,12 +177,12 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq) ret = s3crypt_gen_salt(lreq, &salt); NEQ_CHECK_OR_JUMP(ret, EOK, ("Salt generation failed.\n"), lreq->error, ret, done); - DEBUG(4, ("Using salt [%s]\n", salt)); + DEBUG(4, "Using salt [%s]\n", salt); ret = s3crypt_sha512(lreq, password, salt, &new_hash); NEQ_CHECK_OR_JUMP(ret, EOK, ("Hash generation failed.\n"), lreq->error, ret, done); - DEBUG(4, ("New hash [%s]\n", new_hash)); + DEBUG(4, "New hash [%s]\n", new_hash); lreq->mod_attrs = sysdb_new_attrs(lreq); NULL_CHECK_OR_JUMP(lreq->mod_attrs, ("sysdb_new_attrs failed.\n"), @@ -229,7 +229,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) struct pam_data *pd = preq->pd; int ret; - DEBUG(4, ("LOCAL pam handler.\n")); + DEBUG(4, "LOCAL pam handler.\n"); lreq = talloc_zero(preq, struct LOCAL_request); if (!lreq) { @@ -238,7 +238,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) lreq->dbctx = preq->domain->sysdb; if (lreq->dbctx == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); talloc_free(lreq); return ENOENT; } @@ -251,26 +251,26 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) ret = sysdb_get_user_attr(lreq, preq->domain, preq->pd->user, attrs, &res); if (ret != EOK) { - DEBUG(1, ("sysdb_get_user_attr failed.\n")); + DEBUG(1, "sysdb_get_user_attr failed.\n"); talloc_free(lreq); return ret; } if (res->count < 1) { - DEBUG(4, ("No user found with filter ["SYSDB_PWNAM_FILTER"]\n", - pd->user, pd->user, pd->user)); + DEBUG(4, "No user found with filter ["SYSDB_PWNAM_FILTER"]\n", + pd->user, pd->user, pd->user); pd->pam_status = PAM_USER_UNKNOWN; goto done; } else if (res->count > 1) { - DEBUG(4, ("More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n", - pd->user, pd->user, pd->user)); + DEBUG(4, "More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n", + pd->user, pd->user, pd->user); lreq->error = EFAULT; goto done; } username = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_NAME, NULL); if (strcmp(username, pd->user) != 0) { - DEBUG(1, ("Expected username [%s] get [%s].\n", pd->user, username)); + DEBUG(1, "Expected username [%s] get [%s].\n", pd->user, username); lreq->error = EINVAL; goto done; } @@ -285,7 +285,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) && lreq->preq->cctx->priv == 1) { /* TODO: maybe this is a candiate for an explicit audit message. */ - DEBUG(4, ("allowing root to reset a password.\n")); + DEBUG(4, "allowing root to reset a password.\n"); break; } ret = sss_authtok_get_password(pd->authtok, &password, NULL); @@ -295,16 +295,16 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) pwdhash = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_PWD, NULL); NULL_CHECK_OR_JUMP(pwdhash, ("No password stored.\n"), lreq->error, LDB_ERR_NO_SUCH_ATTRIBUTE, done); - DEBUG(4, ("user: [%s], password hash: [%s]\n", username, pwdhash)); + DEBUG(4, "user: [%s], password hash: [%s]\n", username, pwdhash); ret = s3crypt_sha512(lreq, password, pwdhash, &new_hash); NEQ_CHECK_OR_JUMP(ret, EOK, ("nss_sha512_crypt failed.\n"), lreq->error, ret, done); - DEBUG(4, ("user: [%s], new hash: [%s]\n", username, new_hash)); + DEBUG(4, "user: [%s], new hash: [%s]\n", username, new_hash); if (strcmp(new_hash, pwdhash) != 0) { - DEBUG(1, ("Passwords do not match.\n")); + DEBUG(1, "Passwords do not match.\n"); do_failed_login(lreq); goto done; } @@ -332,7 +332,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) break; default: lreq->error = EINVAL; - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown PAM task [%d].\n", pd->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown PAM task [%d].\n", pd->cmd); } done: diff --git a/src/responder/pam/pam_helpers.c b/src/responder/pam/pam_helpers.c index d2068e57c..1b94f7adf 100644 --- a/src/responder/pam/pam_helpers.c +++ b/src/responder/pam/pam_helpers.c @@ -68,14 +68,14 @@ errno_t pam_initgr_cache_set(struct tevent_context *ev, hret = hash_enter(id_table, &key, &val); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not update initgr cache for [%s]: [%s]\n", - name, hash_error_string(hret))); + "Could not update initgr cache for [%s]: [%s]\n", + name, hash_error_string(hret)); ret = EIO; goto done; } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("[%s] added to PAM initgroup cache\n", - name)); + "[%s] added to PAM initgroup cache\n", + name); } /* Create a timer event to remove the entry from the cache */ @@ -115,13 +115,13 @@ static void pam_initgr_cache_remove(struct tevent_context *ev, if (hret != HASH_SUCCESS && hret != HASH_ERROR_KEY_NOT_FOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not clear [%s] from initgr cache: [%s]\n", + "Could not clear [%s] from initgr cache: [%s]\n", table_ctx->name, - hash_error_string(hret))); + hash_error_string(hret)); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("[%s] removed from PAM initgroup cache\n", - table_ctx->name)); + "[%s] removed from PAM initgroup cache\n", + table_ctx->name); } talloc_free(table_ctx); diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c index 2e6afd087..3806d763e 100644 --- a/src/responder/pam/pamsrv.c +++ b/src/responder/pam/pamsrv.c @@ -82,7 +82,7 @@ static void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(1, ("Reconnected to the Data Provider.\n")); + DEBUG(1, "Reconnected to the Data Provider.\n"); /* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -96,8 +96,8 @@ static void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void } /* Handle failure */ - DEBUG(0, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(0, "Could not reconnect to %s provider.\n", + be_conn->domain->name); /* FIXME: kill the frontend and let the monitor restart it ? */ /* pam_shutdown(rctx); */ @@ -127,7 +127,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, "PAM", &pam_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; } @@ -147,7 +147,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, ret = confdb_get_int(pctx->rctx->cdb, CONFDB_PAM_CONF_ENTRY, CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries); if (ret != EOK) { - DEBUG(0, ("Failed to set up automatic reconnection\n")); + DEBUG(0, "Failed to set up automatic reconnection\n"); goto done; } @@ -172,7 +172,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, ret = sss_ncache_init(pctx, &pctx->ncache); if (ret != EOK) { - DEBUG(0, ("fatal error initializing negative cache\n")); + DEBUG(0, "fatal error initializing negative cache\n"); goto done; } @@ -185,8 +185,8 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, ret = sss_hash_create(pctx, 10, &pctx->id_table); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not create initgroups hash table: [%s]", - strerror(ret))); + "Could not create initgroups hash table: [%s]", + strerror(ret)); goto done; } @@ -198,14 +198,14 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, &fd_limit); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up file descriptor limit\n")); + "Failed to set up file descriptor limit\n"); goto done; } responder_set_fd_limit(fd_limit); ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto done; } @@ -258,7 +258,7 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); } ret = pam_process_init(main_ctx, diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 2bceb8985..f3ceea49d 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -120,12 +120,12 @@ static int pd_set_primary_name(const struct ldb_message *msg,struct pam_data *pd name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (!name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no name?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no name?\n"); return EIO; } if (strcmp(pd->user, name)) { - DEBUG(SSSDBG_TRACE_FUNC, ("User's primary name is %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "User's primary name is %s\n", name); talloc_free(pd->user); pd->user = talloc_strdup(pd, name); if (!pd->user) return ENOMEM; @@ -148,7 +148,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, uint32_t terminator; if (blen < 4*sizeof(uint32_t)+2) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Received data is invalid.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Received data is invalid.\n"); return EINVAL; } @@ -157,7 +157,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, if (start != SSS_START_OF_PAM_REQUEST || terminator != SSS_END_OF_PAM_REQUEST) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Received data is invalid.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Received data is invalid.\n"); return EINVAL; } @@ -172,7 +172,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, /* the uint32_t end maker SSS_END_OF_PAM_REQUEST does not count to * the remaining buffer */ if (size > (blen - c - sizeof(uint32_t))) { - DEBUG(1, ("Invalid data size.\n")); + DEBUG(1, "Invalid data size.\n"); return EINVAL; } @@ -218,7 +218,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, if (ret != EOK) return ret; break; default: - DEBUG(1,("Ignoring unknown data type [%d].\n", type)); + DEBUG(1,"Ignoring unknown data type [%d].\n", type); c += size; } } @@ -242,12 +242,12 @@ static int pam_parse_in_data_v3(struct sss_domain_info *domains, ret = pam_parse_in_data_v2(domains, default_domain, pd, body, blen); if (ret != EOK) { - DEBUG(1, ("pam_parse_in_data_v2 failed.\n")); + DEBUG(1, "pam_parse_in_data_v2 failed.\n"); return ret; } if (pd->cli_pid == 0) { - DEBUG(1, ("Missing client PID.\n")); + DEBUG(1, "Missing client PID.\n"); return EINVAL; } @@ -322,12 +322,12 @@ static int pam_parse_in_data(struct sss_domain_info *domains, ret = extract_authtok_v1(pd->authtok, body, blen, &end); if (ret) { - DEBUG(1, ("Invalid auth token\n")); + DEBUG(1, "Invalid auth token\n"); return ret; } ret = extract_authtok_v1(pd->newauthtok, body, blen, &end); if (ret) { - DEBUG(1, ("Invalid new auth token\n")); + DEBUG(1, "Invalid new auth token\n"); return ret; } @@ -362,7 +362,7 @@ static errno_t set_last_login(struct pam_auth_req *preq) ret = sysdb_set_user_attr(preq->domain, preq->pd->user, attrs, SYSDB_MOD_REP); if (ret != EOK) { - DEBUG(2, ("set_last_login failed.\n")); + DEBUG(2, "set_last_login failed.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto fail; } else { @@ -389,7 +389,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb, CONFDB_PAM_VERBOSITY, DEFAULT_PAM_VERBOSITY, &pam_verbosity); if (ret != EOK) { - DEBUG(1, ("Failed to read PAM verbosity, not fatal.\n")); + DEBUG(1, "Failed to read PAM verbosity, not fatal.\n"); pam_verbosity = DEFAULT_PAM_VERBOSITY; } @@ -397,7 +397,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb, while(resp != NULL) { if (resp->type == SSS_PAM_USER_INFO) { if (resp->len < sizeof(uint32_t)) { - DEBUG(1, ("User info entry is too short.\n")); + DEBUG(1, "User info entry is too short.\n"); return EINVAL; } @@ -413,8 +413,8 @@ static errno_t filter_responses(struct confdb_ctx *cdb, switch (user_info_type) { case SSS_PAM_USER_INFO_OFFLINE_AUTH: if (resp->len != sizeof(uint32_t) + sizeof(int64_t)) { - DEBUG(1, ("User info offline auth entry is " - "too short.\n")); + DEBUG(1, "User info offline auth entry is " + "too short.\n"); return EINVAL; } memcpy(&expire_date, resp->data + sizeof(uint32_t), @@ -429,8 +429,8 @@ static errno_t filter_responses(struct confdb_ctx *cdb, break; default: DEBUG(SSSDBG_TRACE_LIBS, - ("User info type [%d] not filtered.\n", - user_info_type)); + "User info type [%d] not filtered.\n", + user_info_type); } } else if (resp->type & SSS_SERVER_INFO) { resp->do_not_send_to_client = true; @@ -447,7 +447,7 @@ static void pam_reply_delay(struct tevent_context *ev, struct tevent_timer *te, { struct pam_auth_req *preq; - DEBUG(4, ("pam_reply_delay get called.\n")); + DEBUG(4, "pam_reply_delay get called.\n"); preq = talloc_get_type(pvt, struct pam_auth_req); @@ -482,7 +482,7 @@ static void pam_reply(struct pam_auth_req *preq) DEBUG(SSSDBG_FUNC_DATA, - ("pam_reply called with result [%d].\n", pd->pam_status)); + "pam_reply called with result [%d].\n", pd->pam_status); if (pd->pam_status == PAM_AUTHINFO_UNAVAIL) { switch(pd->cmd) { @@ -496,14 +496,14 @@ static void pam_reply(struct pam_auth_req *preq) pd->offline_auth = true; if (preq->domain->sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for domain" - " [%s]!\n", preq->domain->name)); + DEBUG(0, "Fatal: Sysdb CTX not found for domain" + " [%s]!\n", preq->domain->name); goto done; } ret = sss_authtok_get_password(pd->authtok, &password, NULL); if (ret) { - DEBUG(0, ("Failed to get password.\n")); + DEBUG(0, "Failed to get password.\n"); goto done; } @@ -518,13 +518,13 @@ static void pam_reply(struct pam_auth_req *preq) break; case SSS_PAM_CHAUTHTOK_PRELIM: case SSS_PAM_CHAUTHTOK: - DEBUG(5, ("Password change not possible while offline.\n")); + DEBUG(5, "Password change not possible while offline.\n"); pd->pam_status = PAM_AUTHTOK_ERR; user_info_type = SSS_PAM_USER_INFO_OFFLINE_CHPASS; ret = pam_add_response(pd, SSS_PAM_USER_INFO, sizeof(uint32_t), (const uint8_t *) &user_info_type); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); goto done; } break; @@ -534,12 +534,12 @@ static void pam_reply(struct pam_auth_req *preq) case SSS_PAM_ACCT_MGMT: case SSS_PAM_OPEN_SESSION: case SSS_PAM_CLOSE_SESSION: - DEBUG(2, ("Assuming offline authentication setting status for " - "pam call %d to PAM_SUCCESS.\n", pd->cmd)); + DEBUG(2, "Assuming offline authentication setting status for " + "pam call %d to PAM_SUCCESS.\n", pd->cmd); pd->pam_status = PAM_SUCCESS; break; default: - DEBUG(1, ("Unknown PAM call [%d].\n", pd->cmd)); + DEBUG(1, "Unknown PAM call [%d].\n", pd->cmd); pd->pam_status = PAM_MODULE_UNKNOWN; } } @@ -547,8 +547,8 @@ static void pam_reply(struct pam_auth_req *preq) if (pd->response_delay > 0) { ret = gettimeofday(&tv, NULL); if (ret != EOK) { - DEBUG(1, ("gettimeofday failed [%d][%s].\n", - errno, strerror(errno))); + DEBUG(1, "gettimeofday failed [%d][%s].\n", + errno, strerror(errno)); goto done; } tv.tv_sec += pd->response_delay; @@ -557,7 +557,7 @@ static void pam_reply(struct pam_auth_req *preq) te = tevent_add_timer(cctx->ev, cctx, tv, pam_reply_delay, preq); if (te == NULL) { - DEBUG(1, ("Failed to add event pam_reply_delay.\n")); + DEBUG(1, "Failed to add event pam_reply_delay.\n"); goto done; } @@ -586,14 +586,14 @@ static void pam_reply(struct pam_auth_req *preq) ret = filter_responses(pctx->rctx->cdb, pd->resp_list); if (ret != EOK) { - DEBUG(1, ("filter_responses failed, not fatal.\n")); + DEBUG(1, "filter_responses failed, not fatal.\n"); } if (pd->domain != NULL) { ret = pam_add_response(pd, SSS_PAM_DOMAIN_NAME, strlen(pd->domain)+1, (uint8_t *) pd->domain); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); goto done; } } @@ -618,7 +618,7 @@ static void pam_reply(struct pam_auth_req *preq) } sss_packet_get_body(cctx->creq->out, &body, &blen); - DEBUG(SSSDBG_FUNC_DATA, ("blen: %zu\n", blen)); + DEBUG(SSSDBG_FUNC_DATA, "blen: %zu\n", blen); p = 0; memcpy(&body[p], &pd->pam_status, sizeof(int32_t)); @@ -661,7 +661,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, resp_len = sizeof(uint32_t) + sizeof(int64_t); resp = talloc_size(preq->pd, resp_len); if (resp == NULL) { - DEBUG(1, ("talloc_size failed, cannot prepare user info.\n")); + DEBUG(1, "talloc_size failed, cannot prepare user info.\n"); } else { memcpy(resp, &resp_type, sizeof(uint32_t)); dummy = (int64_t) expire_date; @@ -669,7 +669,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len, (const uint8_t *) resp); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } break; @@ -679,7 +679,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, resp_len = sizeof(uint32_t) + sizeof(int64_t); resp = talloc_size(preq->pd, resp_len); if (resp == NULL) { - DEBUG(1, ("talloc_size failed, cannot prepare user info.\n")); + DEBUG(1, "talloc_size failed, cannot prepare user info.\n"); } else { memcpy(resp, &resp_type, sizeof(uint32_t)); dummy = (int64_t) delayed_until; @@ -687,14 +687,14 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len, (const uint8_t *) resp); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } } break; default: DEBUG(SSSDBG_TRACE_LIBS, - ("cached login returned: %d\n", preq->pd->pam_status)); + "cached login returned: %d\n", preq->pd->pam_status); } pam_reply(preq); @@ -725,7 +725,7 @@ errno_t pam_forwarder_parse_data(struct cli_ctx *cctx, struct pam_data *pd) body + blen - sizeof(uint32_t), NULL); if (terminator != SSS_END_OF_PAM_REQUEST) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Received data not terminated.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Received data not terminated.\n"); ret = EINVAL; goto done; } @@ -748,8 +748,8 @@ errno_t pam_forwarder_parse_data(struct cli_ctx *cctx, struct pam_data *pd) body, blen); break; default: - DEBUG(1, ("Illegal protocol version [%d].\n", - cctx->cli_protocol_version->version)); + DEBUG(1, "Illegal protocol version [%d].\n", + cctx->cli_protocol_version->version); ret = EINVAL; } @@ -843,8 +843,8 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd) /* Try the next domain */ DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s@%s] filtered out (negative cache). " - "Trying next domain.\n", pd->user, dom->name)); + "User [%s@%s] filtered out (negative cache). " + "Trying next domain.\n", pd->user, dom->name); } if (!dom) { ret = ENOENT; @@ -854,7 +854,7 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd) } if (preq->domain->provider == NULL) { - DEBUG(1, ("Domain [%s] has no auth provider.\n", preq->domain->name)); + DEBUG(1, "Domain [%s] has no auth provider.\n", preq->domain->name); ret = EINVAL; goto done; } @@ -956,7 +956,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up initgroup timout\n")); + "Could not look up initgroup timout\n"); return EIO; } else if (ret == ENOENT) { /* Call provider first */ @@ -965,22 +965,22 @@ static int pam_check_user_search(struct pam_auth_req *preq) /* Entry is still valid, get it from the sysdb */ } - DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name); if (dom->sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; return EFAULT; } ret = sysdb_getpwnam(preq, dom, name, &preq->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); return EIO; } if (preq->res->count > 1) { - DEBUG(0, ("getpwnam call returned more than one result !?!\n")); + DEBUG(0, "getpwnam call returned more than one result !?!\n"); return ENOENT; } @@ -991,8 +991,8 @@ static int pam_check_user_search(struct pam_auth_req *preq) if (ret != EOK) { /* Should not be fatal, just slower next time */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set ncache for [%s@%s]\n", name, - dom->name)); + "Cannot set ncache for [%s@%s]\n", name, + dom->name); } } @@ -1002,7 +1002,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) continue; } - DEBUG(2, ("No results for getpwnam call\n")); + DEBUG(2, "No results for getpwnam call\n"); /* TODO: store negative cache ? */ @@ -1020,12 +1020,12 @@ static int pam_check_user_search(struct pam_auth_req *preq) } } - DEBUG(6, ("Returning info for user [%s@%s]\n", name, dom->name)); + DEBUG(6, "Returning info for user [%s@%s]\n", name, dom->name); /* We might have searched by alias. Pass on the primary name */ ret = pd_set_primary_name(preq->res->msgs[0], preq->pd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not canonicalize username\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not canonicalize username\n"); return ret; } @@ -1049,7 +1049,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) name, 0, NULL); if (!dpreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); return ENOMEM; } @@ -1071,7 +1071,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) } DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", preq->pd->user)); + "No matching domain found for [%s], fail!\n", preq->pd->user); return ENOENT; } @@ -1091,7 +1091,7 @@ static void pam_dp_send_acct_req_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error, killing connection!\n")); + "Fatal error, killing connection!\n"); talloc_free(cb_ctx->cctx); return; } @@ -1133,9 +1133,9 @@ static void pam_check_user_dp_callback(uint16_t err_maj, uint32_t err_min, char *name; if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); } ret = pam_check_user_search(preq); @@ -1154,8 +1154,8 @@ static void pam_check_user_dp_callback(uint16_t err_maj, uint32_t err_min, talloc_free(name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not save initgr timestamp. " - "Proceeding with PAM actions\n")); + "Could not save initgr timestamp. " + "Proceeding with PAM actions\n"); /* This is non-fatal, we'll just end up going to the * data provider again next time. */ @@ -1188,7 +1188,7 @@ static void pam_dom_forwarder(struct pam_auth_req *preq) else { preq->callback = pam_reply; ret = pam_dp_send_req(preq, SSS_CLI_SOCKET_TIMEOUT/2); - DEBUG(4, ("pam_dp_send_req returned %d\n", ret)); + DEBUG(4, "pam_dp_send_req returned %d\n", ret); } if (ret != EOK) { @@ -1198,37 +1198,37 @@ static void pam_dom_forwarder(struct pam_auth_req *preq) } static int pam_cmd_authenticate(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_authenticate\n")); + DEBUG(4, "entering pam_cmd_authenticate\n"); return pam_forwarder(cctx, SSS_PAM_AUTHENTICATE); } static int pam_cmd_setcred(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_setcred\n")); + DEBUG(4, "entering pam_cmd_setcred\n"); return pam_forwarder(cctx, SSS_PAM_SETCRED); } static int pam_cmd_acct_mgmt(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_acct_mgmt\n")); + DEBUG(4, "entering pam_cmd_acct_mgmt\n"); return pam_forwarder(cctx, SSS_PAM_ACCT_MGMT); } static int pam_cmd_open_session(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_open_session\n")); + DEBUG(4, "entering pam_cmd_open_session\n"); return pam_forwarder(cctx, SSS_PAM_OPEN_SESSION); } static int pam_cmd_close_session(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_close_session\n")); + DEBUG(4, "entering pam_cmd_close_session\n"); return pam_forwarder(cctx, SSS_PAM_CLOSE_SESSION); } static int pam_cmd_chauthtok(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_chauthtok\n")); + DEBUG(4, "entering pam_cmd_chauthtok\n"); return pam_forwarder(cctx, SSS_PAM_CHAUTHTOK); } static int pam_cmd_chauthtok_prelim(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_chauthtok_prelim\n")); + DEBUG(4, "entering pam_cmd_chauthtok_prelim\n"); return pam_forwarder(cctx, SSS_PAM_CHAUTHTOK_PRELIM); } diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c index d5a52446f..a35627e11 100644 --- a/src/responder/pam/pamsrv_dp.c +++ b/src/responder/pam/pamsrv_dp.c @@ -50,7 +50,7 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) /* Check if the client still exists. If not, simply free all the resources * and quit */ if (preq == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Client already disconnected\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Client already disconnected\n"); dbus_pending_call_unref(pending); dbus_message_unref(msg); return; @@ -58,8 +58,8 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) /* Sanity-check of message validity */ if (msg == NULL) { - DEBUG(0, ("Severe error. A reply callback was called but no reply was" - "received and no timeout occurred\n")); + DEBUG(0, "Severe error. A reply callback was called but no reply was" + "received and no timeout occurred\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -69,18 +69,18 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) case DBUS_MESSAGE_TYPE_METHOD_RETURN: ret = dp_unpack_pam_response(msg, preq->pd, &dbus_error); if (!ret) { - DEBUG(0, ("Failed to parse reply.\n")); + DEBUG(0, "Failed to parse reply.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto done; } - DEBUG(4, ("received: [%d][%s]\n", preq->pd->pam_status, preq->pd->domain)); + DEBUG(4, "received: [%d][%s]\n", preq->pd->pam_status, preq->pd->domain); break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0, ("Reply error.\n")); + DEBUG(0, "Reply error.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; break; default: - DEBUG(0, ("Default... what now?.\n")); + DEBUG(0, "Default... what now?.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; } @@ -118,9 +118,9 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) preq->domain->conn_name, &be_conn); if (res != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The Data Provider connection for %s is not available!" + "The Data Provider connection for %s is not available!" " This maybe a bug, it shouldn't happen!\n", - preq->domain->conn_name)); + preq->domain->conn_name); return EIO; } @@ -129,17 +129,17 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) DP_INTERFACE, DP_METHOD_PAMHANDLER); if (msg == NULL) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); return ENOMEM; } - DEBUG(4, ("Sending request with the following data:\n")); + DEBUG(4, "Sending request with the following data:\n"); DEBUG_PAM_DATA(4, pd); ret = dp_pack_pam_request(msg, pd); if (!ret) { - DEBUG(1,("Failed to build message\n")); + DEBUG(1,"Failed to build message\n"); return EIO; } |