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 | |
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')
38 files changed, 1953 insertions, 1953 deletions
diff --git a/src/providers/ldap/ldap_access.c b/src/providers/ldap/ldap_access.c index c468a1cd5..05354d10c 100644 --- a/src/providers/ldap/ldap_access.c +++ b/src/providers/ldap/ldap_access.c @@ -69,7 +69,7 @@ void sdap_pam_access_handler(struct be_req *breq) access_ctx->id_ctx->conn, pd); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to start sdap_access request\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to start sdap_access request\n"); sdap_access_reply(breq, PAM_SYSTEM_ERR); return; } @@ -97,7 +97,7 @@ static void sdap_access_done(struct tevent_req *req) pam_status = PAM_ACCT_EXPIRED; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Error retrieving access check result.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error retrieving access check result.\n"); pam_status = PAM_SYSTEM_ERR; break; } diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c index 91879291e..b9105a144 100644 --- a/src/providers/ldap/ldap_auth.c +++ b/src/providers/ldap/ldap_auth.c @@ -62,13 +62,13 @@ static errno_t add_expired_warning(struct pam_data *pd, long exp_time) uint32_t *data; if (exp_time < 0 || exp_time > UINT32_MAX) { - DEBUG(1, ("Time to expire out of range.\n")); + DEBUG(1, "Time to expire out of range.\n"); return EINVAL; } data = talloc_array(pd, uint32_t, 2); if (data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; } @@ -78,7 +78,7 @@ static errno_t add_expired_warning(struct pam_data *pd, long exp_time) ret = pam_add_response(pd, SSS_PAM_USER_INFO, 2 * sizeof(uint32_t), (uint8_t *) data); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return EOK; @@ -98,30 +98,30 @@ static errno_t check_pwexpire_kerberos(const char *expire_date, time_t now, end = strptime(expire_date, "%Y%m%d%H%M%SZ", &tm); if (end == NULL) { - DEBUG(1, ("Kerberos expire date [%s] invalid.\n", expire_date)); + DEBUG(1, "Kerberos expire date [%s] invalid.\n", expire_date); return EINVAL; } if (*end != '\0') { - DEBUG(1, ("Kerberos expire date [%s] contains extra characters.\n", - expire_date)); + DEBUG(1, "Kerberos expire date [%s] contains extra characters.\n", + expire_date); return EINVAL; } expire_time = mktime(&tm); if (expire_time == -1) { - DEBUG(1, ("mktime failed to convert [%s].\n", expire_date)); + DEBUG(1, "mktime failed to convert [%s].\n", expire_date); return EINVAL; } tzset(); expire_time -= timezone; DEBUG(SSSDBG_TRACE_ALL, - ("Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " + "Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " "daylight [%d] now [%ld] expire_time [%ld].\n", tzname[0], - tzname[1], timezone, daylight, now, expire_time)); + tzname[1], timezone, daylight, now, expire_time); if (difftime(now, expire_time) > 0.0) { - DEBUG(4, ("Kerberos password expired.\n")); + DEBUG(4, "Kerberos password expired.\n"); ret = ERR_PASSWORD_EXPIRED; } else { if (pwd_exp_warning >= 0) { @@ -134,7 +134,7 @@ static errno_t check_pwexpire_kerberos(const char *expire_date, time_t now, expiration_warning == 0)) { ret = add_expired_warning(pd, (long) difftime(expire_time, now)); if (ret != EOK) { - DEBUG(1, ("add_expired_warning failed.\n")); + DEBUG(1, "add_expired_warning failed.\n"); } } ret = EOK; @@ -152,14 +152,14 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now, int ret; if (spwd->sp_lstchg <= 0) { - DEBUG(4, ("Last change day is not set, new password needed.\n")); + DEBUG(4, "Last change day is not set, new password needed.\n"); return ERR_PASSWORD_EXPIRED; } today = (long) (now / (60 * 60 *24)); password_age = today - spwd->sp_lstchg; if (password_age < 0) { - DEBUG(2, ("The last password change time is in the future!.\n")); + DEBUG(2, "The last password change time is in the future!.\n"); return EOK; } @@ -167,12 +167,12 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now, (spwd->sp_max != -1 && spwd->sp_inact != -1 && password_age > spwd->sp_max + spwd->sp_inact)) { - DEBUG(4, ("Account expired.\n")); + DEBUG(4, "Account expired.\n"); return ERR_ACCOUNT_EXPIRED; } if (spwd->sp_max != -1 && password_age > spwd->sp_max) { - DEBUG(4, ("Password expired.\n")); + DEBUG(4, "Password expired.\n"); return ERR_PASSWORD_EXPIRED; } @@ -188,7 +188,7 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now, ret = add_expired_warning(pd, exp); if (ret != EOK) { - DEBUG(1, ("add_expired_warning failed.\n")); + DEBUG(1, "add_expired_warning failed.\n"); } } @@ -211,7 +211,7 @@ static errno_t check_pwexpire_ldap(struct pam_data *pd, data = talloc_size(pd, 2* sizeof(uint32_t)); if (data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; } @@ -235,7 +235,7 @@ static errno_t check_pwexpire_ldap(struct pam_data *pd, ret = pam_add_response(pd, SSS_PAM_USER_INFO, 2* sizeof(uint32_t), (uint8_t*)data); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } @@ -259,23 +259,23 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx, pwd_policy = dp_opt_get_string(opts, SDAP_PWD_POLICY); if (pwd_policy == NULL) { - DEBUG(1, ("Missing password policy.\n")); + DEBUG(1, "Missing password policy.\n"); return EINVAL; } if (strcasecmp(pwd_policy, PWD_POL_OPT_NONE) == 0) { - DEBUG(9, ("No password policy requested.\n")); + DEBUG(9, "No password policy requested.\n"); return EOK; } else if (strcasecmp(pwd_policy, PWD_POL_OPT_MIT) == 0) { mark = ldb_msg_find_attr_as_string(msg, SYSDB_KRBPW_LASTCHANGE, NULL); if (mark != NULL) { - DEBUG(9, ("Found Kerberos password expiration attributes.\n")); + DEBUG(9, "Found Kerberos password expiration attributes.\n"); val = ldb_msg_find_attr_as_string(msg, SYSDB_KRBPW_EXPIRATION, NULL); if (val != NULL) { *data = talloc_strdup(mem_ctx, val); if (*data == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); return ENOMEM; } *type = PWEXPIRE_KERBEROS; @@ -283,18 +283,18 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx, return EOK; } } else { - DEBUG(1, ("No Kerberos password expiration attributes found, " + DEBUG(1, "No Kerberos password expiration attributes found, " "but MIT Kerberos password policy was requested. " - "Access will be denied.\n")); + "Access will be denied.\n"); return EACCES; } } else if (strcasecmp(pwd_policy, PWD_POL_OPT_SHADOW) == 0) { mark = ldb_msg_find_attr_as_string(msg, SYSDB_SHADOWPW_LASTCHANGE, NULL); if (mark != NULL) { - DEBUG(9, ("Found shadow password expiration attributes.\n")); + DEBUG(9, "Found shadow password expiration attributes.\n"); spwd = talloc_zero(mem_ctx, struct spwd); if (spwd == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; } @@ -327,14 +327,14 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx, return EOK; } else { - DEBUG(1, ("No shadow password attributes found, " + DEBUG(1, "No shadow password attributes found, " "but shadow password policy was requested. " - "Access will be denied.\n")); + "Access will be denied.\n"); return EACCES; } } - DEBUG(9, ("No password expiration attributes found.\n")); + DEBUG(9, "No password expiration attributes found.\n"); return EOK; shadow_fail: @@ -382,7 +382,7 @@ static struct tevent_req *get_user_dn_send(TALLOC_CTX *memctx, opts->user_map[SDAP_OC_USER].name); talloc_zfree(clean_name); if (filter == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build the base filter\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build the base filter\n"); ret = ENOMEM; goto done; } @@ -434,17 +434,17 @@ static void get_user_dn_done(struct tevent_req *subreq) ret = sdap_search_user_recv(state, subreq, NULL, &users, &count); talloc_zfree(subreq); if (ret && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to retrieve users\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to retrieve users\n"); tevent_req_error(req, ret); return; } if (count == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("No such user\n")); + DEBUG(SSSDBG_OP_FAILURE, "No such user\n"); tevent_req_error(req, ENOMEM); return; } else if (count > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Multiple users matched\n")); + DEBUG(SSSDBG_OP_FAILURE, "Multiple users matched\n"); tevent_req_error(req, EIO); return; } @@ -453,7 +453,7 @@ static void get_user_dn_done(struct tevent_req *subreq) ret = sysdb_attrs_get_el_ext(users[0], SYSDB_ORIG_DN, false, &el); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("originalDN is not available for [%s].\n", state->username)); + "originalDN is not available for [%s].\n", state->username); tevent_req_error(req, ret); return; } @@ -464,8 +464,8 @@ static void get_user_dn_done(struct tevent_req *subreq) return; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found originalDN [%s] for [%s]\n", - state->orig_dn, state->username)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found originalDN [%s] for [%s]\n", + state->orig_dn, state->username); tevent_req_done(req); } @@ -555,13 +555,13 @@ static int get_user_dn(TALLOC_CTX *memctx, &pw_expire_type, &pw_expire_data); if (ret != EOK) { - DEBUG(1, ("find_password_expiration_attributes failed.\n")); + DEBUG(1, "find_password_expiration_attributes failed.\n"); } break; default: - DEBUG(1, ("User search by name (%s) returned > 1 results!\n", - username)); + DEBUG(1, "User search by name (%s) returned > 1 results!\n", + username); ret = EFAULT; break; } @@ -660,7 +660,7 @@ static struct tevent_req *auth_get_server(struct tevent_req *req) state->sdap_service->name, state->srv == NULL ? true : false); if (!next_req) { - DEBUG(1, ("be_resolve_server_send failed.\n")); + DEBUG(1, "be_resolve_server_send failed.\n"); return NULL; } @@ -688,8 +688,8 @@ static void auth_resolve_done(struct tevent_req *subreq) /* Determine whether we need to use TLS */ if (sdap_is_secure_uri(state->ctx->service->uri)) { - DEBUG(8, ("[%s] is a secure channel. No need to run START_TLS\n", - state->ctx->service->uri)); + DEBUG(8, "[%s] is a secure channel. No need to run START_TLS\n", + state->ctx->service->uri); use_tls = false; } else { @@ -815,8 +815,8 @@ static void auth_bind_user_done(struct tevent_req *subreq) ret = sdap_auth_recv(subreq, state, &ppolicy); talloc_zfree(subreq); if (ppolicy != NULL) { - DEBUG(9,("Found ppolicy data, " - "assuming LDAP password policies are active.\n")); + DEBUG(9,"Found ppolicy data, " + "assuming LDAP password policies are active.\n"); state->pw_expire_type = PWEXPIRE_LDAP_PASSWORD_POLICY; state->pw_expire_data = ppolicy; } @@ -893,7 +893,7 @@ void sdap_pam_chpass_handler(struct be_req *breq) pd = talloc_get_type(be_req_get_data(breq), struct pam_data); if (be_is_offline(ctx->be)) { - DEBUG(4, ("Backend is marked offline, retry later!\n")); + DEBUG(4, "Backend is marked offline, retry later!\n"); pd->pam_status = PAM_AUTHINFO_UNAVAIL; dp_err = DP_ERR_OFFLINE; goto done; @@ -901,18 +901,18 @@ void sdap_pam_chpass_handler(struct be_req *breq) if ((pd->priv == 1) && (pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) && (sss_authtok_get_type(pd->authtok) != SSS_AUTHTOK_TYPE_PASSWORD)) { - DEBUG(4, ("Password reset by root is not supported.\n")); + DEBUG(4, "Password reset by root is not supported.\n"); pd->pam_status = PAM_PERM_DENIED; dp_err = DP_ERR_OK; goto done; } - DEBUG(2, ("starting password change request for user [%s].\n", pd->user)); + DEBUG(2, "starting password change request for user [%s].\n", pd->user); pd->pam_status = PAM_SYSTEM_ERR; if (pd->cmd != SSS_PAM_CHAUTHTOK && pd->cmd != SSS_PAM_CHAUTHTOK_PRELIM) { - DEBUG(2, ("chpass target was called by wrong pam command.\n")); + DEBUG(2, "chpass target was called by wrong pam command.\n"); goto done; } @@ -954,8 +954,8 @@ static void sdap_auth4chpass_done(struct tevent_req *req) talloc_zfree(req); if ((ret == EOK || ret == ERR_PASSWORD_EXPIRED) && state->pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) { - DEBUG(9, ("Initial authentication for change password operation " - "successful.\n")); + DEBUG(9, "Initial authentication for change password operation " + "successful.\n"); state->pd->pam_status = PAM_SUCCESS; dp_err = DP_ERR_OK; goto done; @@ -971,8 +971,8 @@ static void sdap_auth4chpass_done(struct tevent_req *req) be_ctx->domain->pwd_expiration_warning); if (ret == ERR_PASSWORD_EXPIRED) { - DEBUG(1, ("LDAP provider cannot change kerberos " - "passwords.\n")); + DEBUG(1, "LDAP provider cannot change kerberos " + "passwords.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -981,7 +981,7 @@ static void sdap_auth4chpass_done(struct tevent_req *req) case PWEXPIRE_NONE: break; default: - DEBUG(1, ("Unknow pasword expiration type.\n")); + DEBUG(1, "Unknow pasword expiration type.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -990,10 +990,10 @@ static void sdap_auth4chpass_done(struct tevent_req *req) switch (ret) { case EOK: case ERR_PASSWORD_EXPIRED: - DEBUG(7, ("user [%s] successfully authenticated.\n", state->dn)); + DEBUG(7, "user [%s] successfully authenticated.\n", state->dn); if (pw_expire_type == PWEXPIRE_SHADOW) { /* TODO: implement async ldap modify request */ - DEBUG(1, ("Changing shadow password attributes not implemented.\n")); + DEBUG(1, "Changing shadow password attributes not implemented.\n"); state->pd->pam_status = PAM_MODULE_UNKNOWN; goto done; } else { @@ -1017,7 +1017,7 @@ static void sdap_auth4chpass_done(struct tevent_req *req) state->sh, state->dn, password, new_password); if (!subreq) { - DEBUG(2, ("Failed to change password for %s\n", state->username)); + DEBUG(2, "Failed to change password for %s\n", state->username); goto done; } tevent_req_set_callback(subreq, sdap_pam_chpass_done, state); @@ -1031,12 +1031,12 @@ static void sdap_auth4chpass_done(struct tevent_req *req) &msg_len, &msg); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("pack_user_info_chpass_error failed.\n")); + "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(state->pd, SSS_PAM_USER_INFO, msg_len, msg); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("pam_add_response failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "pam_add_response failed.\n"); } } @@ -1091,12 +1091,12 @@ static void sdap_pam_chpass_done(struct tevent_req *req) ret = pack_user_info_chpass_error(state->pd, user_error_message, &msg_len, &msg); if (ret != EOK) { - DEBUG(1, ("pack_user_info_chpass_error failed.\n")); + DEBUG(1, "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(state->pd, SSS_PAM_USER_INFO, msg_len, msg); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } } @@ -1165,7 +1165,7 @@ void sdap_pam_auth_handler(struct be_req *breq) pd = talloc_get_type(be_req_get_data(breq), struct pam_data); if (be_is_offline(ctx->be)) { - DEBUG(4, ("Backend is marked offline, retry later!\n")); + DEBUG(4, "Backend is marked offline, retry later!\n"); pd->pam_status = PAM_AUTHINFO_UNAVAIL; dp_err = DP_ERR_OFFLINE; goto done; @@ -1230,7 +1230,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) case PWEXPIRE_SHADOW: ret = check_pwexpire_shadow(pw_expire_data, time(NULL), state->pd); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_shadow failed.\n")); + DEBUG(1, "check_pwexpire_shadow failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1240,7 +1240,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) state->pd, be_ctx->domain->pwd_expiration_warning); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_kerberos failed.\n")); + DEBUG(1, "check_pwexpire_kerberos failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1249,7 +1249,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) ret = check_pwexpire_ldap(state->pd, pw_expire_data, be_ctx->domain->pwd_expiration_warning); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_ldap failed.\n")); + DEBUG(1, "check_pwexpire_ldap failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1257,7 +1257,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) case PWEXPIRE_NONE: break; default: - DEBUG(1, ("Unknow pasword expiration type.\n")); + DEBUG(1, "Unknow pasword expiration type.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1304,11 +1304,11 @@ static void sdap_pam_auth_done(struct tevent_req *req) /* password caching failures are not fatal errors */ if (ret != EOK) { - DEBUG(2, ("Failed to cache password for %s\n", - state->pd->user)); + DEBUG(2, "Failed to cache password for %s\n", + state->pd->user); } else { - DEBUG(4, ("Password successfully cached for %s\n", - state->pd->user)); + DEBUG(4, "Password successfully cached for %s\n", + state->pd->user); } } diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c index 19c838dac..7c60c0f73 100644 --- a/src/providers/ldap/ldap_child.c +++ b/src/providers/ldap/ldap_child.c @@ -57,16 +57,16 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, size_t p = 0; uint32_t len; - DEBUG(SSSDBG_TRACE_LIBS, ("total buffer size: %zu\n", size)); + DEBUG(SSSDBG_TRACE_LIBS, "total buffer size: %zu\n", size); /* realm_str size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p); - DEBUG(SSSDBG_TRACE_LIBS, ("realm_str size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "realm_str size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->realm_str = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got realm_str: %s\n", ibuf->realm_str)); + DEBUG(SSSDBG_TRACE_LIBS, "got realm_str: %s\n", ibuf->realm_str); if (ibuf->realm_str == NULL) return ENOMEM; p += len; } @@ -74,11 +74,11 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, /* princ_str size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p); - DEBUG(SSSDBG_TRACE_LIBS, ("princ_str size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "princ_str size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->princ_str = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got princ_str: %s\n", ibuf->princ_str)); + DEBUG(SSSDBG_TRACE_LIBS, "got princ_str: %s\n", ibuf->princ_str); if (ibuf->princ_str == NULL) return ENOMEM; p += len; } @@ -86,18 +86,18 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, /* keytab_name size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p); - DEBUG(SSSDBG_TRACE_LIBS, ("keytab_name size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "keytab_name size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->keytab_name = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got keytab_name: %s\n", ibuf->keytab_name)); + DEBUG(SSSDBG_TRACE_LIBS, "got keytab_name: %s\n", ibuf->keytab_name); if (ibuf->keytab_name == NULL) return ENOMEM; p += len; } /* ticket lifetime */ SAFEALIGN_COPY_INT32_CHECK(&ibuf->lifetime, buf + p, size, &p); - DEBUG(SSSDBG_TRACE_LIBS, ("lifetime: %d\n", ibuf->lifetime)); + DEBUG(SSSDBG_TRACE_LIBS, "lifetime: %d\n", ibuf->lifetime); return EOK; } @@ -112,7 +112,7 @@ static int pack_buffer(struct response *r, int result, krb5_error_code krberr, r->size = 2 * sizeof(uint32_t) + sizeof(krb5_error_code) + len + sizeof(time_t); - DEBUG(SSSDBG_TRACE_INTERNAL, ("response size: %zu\n",r->size)); + DEBUG(SSSDBG_TRACE_INTERNAL, "response size: %zu\n",r->size); r->buf = talloc_array(r, uint8_t, r->size); if(!r->buf) { @@ -120,8 +120,8 @@ static int pack_buffer(struct response *r, int result, krb5_error_code krberr, } DEBUG(SSSDBG_TRACE_LIBS, - ("result [%d] krberr [%d] msgsize [%d] msg [%s]\n", - result, krberr, len, msg)); + "result [%d] krberr [%d] msgsize [%d] msg [%s]\n", + result, krberr, len, msg); /* result */ SAFEALIGN_SET_UINT32(&r->buf[p], result, &p); @@ -187,21 +187,21 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, krberr = krb5_init_context(&context); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to init kerberos context\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to init kerberos context\n"); return krberr; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Kerberos context initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Kerberos context initialized\n"); krberr = set_child_debugging(context); if (krberr != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set krb5_child debugging\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot set krb5_child debugging\n"); } if (!realm_str) { krberr = krb5_get_default_realm(context, &default_realm); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get default realm name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get default realm name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } @@ -219,7 +219,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } } - DEBUG(SSSDBG_TRACE_INTERNAL, ("got realm_name: [%s]\n", realm_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "got realm_name: [%s]\n", realm_name); if (princ_str) { if (!strchr(princ_str, '@')) { @@ -238,7 +238,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } hostname[511] = '\0'; - DEBUG(SSSDBG_TRACE_LIBS, ("got hostname: [%s]\n", hostname)); + DEBUG(SSSDBG_TRACE_LIBS, "got hostname: [%s]\n", hostname); ret = select_principal_from_keytab(memctx, hostname, realm_name, keytab_name, &full_princ, NULL, NULL); @@ -251,12 +251,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, krberr = KRB5KRB_ERR_GENERIC; goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Principal name is: [%s]\n", full_princ)); + DEBUG(SSSDBG_CONF_SETTINGS, "Principal name is: [%s]\n", full_princ); krberr = krb5_parse_name(context, full_princ, &kprinc); if (krberr) { - DEBUG(2, ("Unable to build principal: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(2, "Unable to build principal: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } @@ -265,12 +265,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } else { krberr = krb5_kt_default(context, &keytab); } - DEBUG(SSSDBG_CONF_SETTINGS, ("Using keytab [%s]\n", KEYTAB_CLEAN_NAME)); + DEBUG(SSSDBG_CONF_SETTINGS, "Using keytab [%s]\n", KEYTAB_CLEAN_NAME); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to read keytab file [%s]: %s\n", + "Failed to read keytab file [%s]: %s\n", KEYTAB_CLEAN_NAME, - sss_krb5_get_error_message(context, krberr))); + sss_krb5_get_error_message(context, krberr)); goto done; } @@ -278,7 +278,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, ret = sss_krb5_verify_keytab_ex(full_princ, keytab_name, context, keytab); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to verify principal is present in the keytab\n")); + "Unable to verify principal is present in the keytab\n"); krberr = KRB5_KT_IOERR; goto done; } @@ -288,12 +288,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, krberr = KRB5KRB_ERR_GENERIC; goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("keytab ccname: [%s]\n", ccname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "keytab ccname: [%s]\n", ccname); krberr = krb5_cc_resolve(context, ccname, &ccache); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to set cache name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to set cache name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } @@ -307,7 +307,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, tmp_str = getenv("KRB5_CANONICALIZE"); if (tmp_str != NULL && strcasecmp(tmp_str, "true") == 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Will canonicalize principals\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Will canonicalize principals\n"); canonicalize = 1; } sss_krb5_get_init_creds_opt_set_canonicalize(&options, canonicalize); @@ -316,8 +316,8 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, keytab, 0, NULL, &options); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to init credentials: %s\n", - sss_krb5_get_error_message(context, krberr))); + "Failed to init credentials: %s\n", + sss_krb5_get_error_message(context, krberr)); sss_log(SSS_LOG_ERR, "Failed to initialize credentials using keytab [%s]: %s. " "Unable to create GSSAPI-encrypted LDAP connection.", @@ -325,37 +325,37 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, sss_krb5_get_error_message(context, krberr)); goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("credentials initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "credentials initialized\n"); /* Use updated principal if changed due to canonicalization. */ krberr = krb5_cc_initialize(context, ccache, my_creds.client); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to init ccache: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to init ccache: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } krberr = krb5_cc_store_cred(context, ccache, &my_creds); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store creds: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store creds: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("credentials stored\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "credentials stored\n"); #ifdef HAVE_KRB5_GET_TIME_OFFSETS krberr = krb5_get_time_offsets(context, &kdc_time_offset, &kdc_time_offset_usec); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get KDC time offset: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get KDC time offset: %s\n", + sss_krb5_get_error_message(context, krberr)); kdc_time_offset = 0; } else { if (kdc_time_offset_usec > 0) { kdc_time_offset++; } } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Got KDC time offset\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Got KDC time offset\n"); #else /* If we don't have this function, just assume no offset */ kdc_time_offset = 0; @@ -388,7 +388,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, r->buf = NULL; r->size = 0; - DEBUG(SSSDBG_TRACE_FUNC, ("Building response for result [%d]\n", kerr)); + DEBUG(SSSDBG_TRACE_FUNC, "Building response for result [%d]\n", kerr); if (kerr == 0) { ret = pack_buffer(r, EOK, kerr, ccname, expire_time); @@ -396,7 +396,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, krb5_msg = sss_krb5_get_error_message(krb5_error_ctx, kerr); if (krb5_msg == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_krb5_get_error_message failed.\n")); + "sss_krb5_get_error_message failed.\n"); return ENOMEM; } @@ -405,7 +405,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, } if (ret != EOK) { - DEBUG(1, ("pack_buffer failed\n")); + DEBUG(1, "pack_buffer failed\n"); return ret; } @@ -462,22 +462,22 @@ int main(int argc, const char *argv[]) debug_prg_name = talloc_asprintf(NULL, "[sssd[ldap_child[%d]]]", getpid()); if (!debug_prg_name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); goto fail; } if (debug_fd != -1) { ret = set_debug_file_from_fd(debug_fd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("set_debug_file_from_fd failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "set_debug_file_from_fd failed.\n"); } } - DEBUG(SSSDBG_TRACE_FUNC, ("ldap_child started.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "ldap_child started.\n"); main_ctx = talloc_new(NULL); if (main_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); talloc_free(discard_const(debug_prg_name)); goto fail; } @@ -485,23 +485,23 @@ int main(int argc, const char *argv[]) buf = talloc_size(main_ctx, sizeof(uint8_t)*IN_BUF_SIZE); if (buf == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); goto fail; } ibuf = talloc_zero(main_ctx, struct input_buffer); if (ibuf == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); goto fail; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("context initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "context initialized\n"); errno = 0; len = sss_atomic_read_s(STDIN_FILENO, buf, IN_BUF_SIZE); if (len == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("read failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "read failed [%d][%s].\n", ret, strerror(ret)); goto fail; } @@ -509,24 +509,24 @@ int main(int argc, const char *argv[]) ret = unpack_buffer(buf, len, ibuf); if (ret != EOK) { - DEBUG(1, ("unpack_buffer failed.[%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "unpack_buffer failed.[%d][%s].\n", ret, strerror(ret)); goto fail; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("getting TGT sync\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "getting TGT sync\n"); kerr = ldap_child_get_tgt_sync(main_ctx, ibuf->realm_str, ibuf->princ_str, ibuf->keytab_name, ibuf->lifetime, &ccname, &expire_time); if (kerr != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ldap_child_get_tgt_sync failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldap_child_get_tgt_sync failed.\n"); /* Do not return, must report failure */ } ret = prepare_response(main_ctx, ccname, expire_time, kerr, &resp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("prepare_response failed. [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "prepare_response failed. [%d][%s].\n", + ret, strerror(ret)); goto fail; } @@ -534,24 +534,24 @@ int main(int argc, const char *argv[]) written = sss_atomic_write_s(STDOUT_FILENO, resp->buf, resp->size); if (written == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("write failed [%d][%s].\n", ret, - strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", ret, + strerror(ret)); goto fail; } if (written != resp->size) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Expected to write %zu bytes, wrote %zu\n", - resp->size, written)); + DEBUG(SSSDBG_CRIT_FAILURE, "Expected to write %zu bytes, wrote %zu\n", + resp->size, written); goto fail; } - DEBUG(SSSDBG_TRACE_FUNC, ("ldap_child completed successfully\n")); + DEBUG(SSSDBG_TRACE_FUNC, "ldap_child completed successfully\n"); close(STDOUT_FILENO); talloc_free(main_ctx); _exit(0); fail: - DEBUG(SSSDBG_CRIT_FAILURE, ("ldap_child failed!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldap_child failed!\n"); close(STDOUT_FILENO); talloc_free(main_ctx); _exit(-1); diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 1eb848a9d..890e7a4a4 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -123,8 +123,8 @@ sdap_domain_add(struct sdap_options *opts, ret = domain_to_basedn(sdom, sdom->dom->name, &sdom->basedn); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot convert domain name [%s] to base DN [%d]: %s\n", - dom->name, ret, strerror(ret))); + "Cannot convert domain name [%s] to base DN [%d]: %s\n", + dom->name, ret, strerror(ret)); goto done; } @@ -163,14 +163,14 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx, if (sditer == NULL) { /* New sdap domain */ - DEBUG(SSSDBG_TRACE_FUNC, ("subdomain %s is a new one, will " - "create a new sdap domain object\n", dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "subdomain %s is a new one, will " + "create a new sdap domain object\n", dom->name); ret = sdap_domain_add(sdap_id_ctx->opts, dom, &sdom); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot add new sdap domain for domain %s [%d]: %s\n", - parent->name, ret, strerror(ret))); + "Cannot add new sdap domain for domain %s [%d]: %s\n", + parent->name, ret, strerror(ret)); return ret; } } else { @@ -188,7 +188,7 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx, ret = sdap_create_search_base(sdom, sdom->basedn, LDAP_SCOPE_SUBTREE, NULL, &sdom->search_bases[0]); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot create new sdap search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot create new sdap search base\n"); return ret; } @@ -272,15 +272,15 @@ int ldap_get_options(TALLOC_CTX *memctx, if (ret != EOK) { goto done; } - DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", opts->basic[search_base_options[o]].opt_name, dp_opt_get_string(opts->basic, - search_base_options[o]))); + search_base_options[o])); } } } else { - DEBUG(5, ("Search base not set, trying to discover it later when " - "connecting to the LDAP server.\n")); + DEBUG(5, "Search base not set, trying to discover it later when " + "connecting to the LDAP server.\n"); } /* Default search */ @@ -315,14 +315,14 @@ int ldap_get_options(TALLOC_CTX *memctx, pwd_policy = dp_opt_get_string(opts->basic, SDAP_PWD_POLICY); if (pwd_policy == NULL) { - DEBUG(1, ("Missing password policy, this may not happen.\n")); + DEBUG(1, "Missing password policy, this may not happen.\n"); ret = EINVAL; goto done; } if (strcasecmp(pwd_policy, PWD_POL_OPT_NONE) != 0 && strcasecmp(pwd_policy, PWD_POL_OPT_SHADOW) != 0 && strcasecmp(pwd_policy, PWD_POL_OPT_MIT) != 0) { - DEBUG(1, ("Unsupported password policy [%s].\n", pwd_policy)); + DEBUG(1, "Unsupported password policy [%s].\n", pwd_policy); ret = EINVAL; goto done; } @@ -332,8 +332,8 @@ int ldap_get_options(TALLOC_CTX *memctx, CONFDB_PAM_CRED_TIMEOUT, 0, &offline_credentials_expiration); if (ret != EOK) { - DEBUG(1, ("Cannot get value of %s from confdb \n", - CONFDB_PAM_CRED_TIMEOUT)); + DEBUG(1, "Cannot get value of %s from confdb \n", + CONFDB_PAM_CRED_TIMEOUT); goto done; } @@ -349,22 +349,22 @@ int ldap_get_options(TALLOC_CTX *memctx, * entries must not be purged from cache. */ if (!offline_credentials_expiration && account_cache_expiration) { - DEBUG(1, ("Conflicting values for options %s (unlimited) " + DEBUG(1, "Conflicting values for options %s (unlimited) " "and %s (%d)\n", opts->basic[SDAP_ACCOUNT_CACHE_EXPIRATION].opt_name, CONFDB_PAM_CRED_TIMEOUT, - offline_credentials_expiration)); + offline_credentials_expiration); ret = EINVAL; goto done; } if (offline_credentials_expiration && account_cache_expiration && offline_credentials_expiration > account_cache_expiration) { - DEBUG(1, ("Value of %s (now %d) must be larger " + DEBUG(1, "Value of %s (now %d) must be larger " "than value of %s (now %d)\n", opts->basic[SDAP_ACCOUNT_CACHE_EXPIRATION].opt_name, account_cache_expiration, CONFDB_PAM_CRED_TIMEOUT, - offline_credentials_expiration)); + offline_credentials_expiration); ret = EINVAL; goto done; } @@ -373,7 +373,7 @@ int ldap_get_options(TALLOC_CTX *memctx, if (ldap_deref != NULL) { ret = deref_string_to_val(ldap_deref, &ldap_deref_val); if (ret != EOK) { - DEBUG(1, ("Failed to verify ldap_deref option.\n")); + DEBUG(1, "Failed to verify ldap_deref option.\n"); goto done; } } @@ -383,8 +383,8 @@ int ldap_get_options(TALLOC_CTX *memctx, ldap_referrals = dp_opt_get_bool(opts->basic, SDAP_REFERRALS); if (ldap_referrals) { - DEBUG(1, ("LDAP referrals are not supported, because the LDAP library " - "is too old, see sssd-ldap(5) for details.\n")); + DEBUG(1, "LDAP referrals are not supported, because the LDAP library " + "is too old, see sssd-ldap(5) for details.\n"); ret = dp_opt_set_bool(opts->basic, SDAP_REFERRALS, false); } #endif @@ -423,7 +423,7 @@ int ldap_get_options(TALLOC_CTX *memctx, default_netgroup_map = netgroup_map; default_service_map = service_map; } else { - DEBUG(0, ("Unrecognized schema type: %s\n", schema)); + DEBUG(0, "Unrecognized schema type: %s\n", schema); ret = EINVAL; goto done; } @@ -472,27 +472,27 @@ int ldap_get_options(TALLOC_CTX *memctx, /* FIXME - this can be removed in a future version */ ret = krb5_try_kdcip(cdb, conf_path, opts->basic, SDAP_KRB5_KDC); if (ret != EOK) { - DEBUG(1, ("sss_krb5_try_kdcip failed.\n")); + DEBUG(1, "sss_krb5_try_kdcip failed.\n"); goto done; } authtok_type = dp_opt_get_string(opts->basic, SDAP_DEFAULT_AUTHTOK_TYPE); if (authtok_type != NULL && strcasecmp(authtok_type,"obfuscated_password") == 0) { - DEBUG(9, ("Found obfuscated password, " - "trying to convert to cleartext.\n")); + DEBUG(9, "Found obfuscated password, " + "trying to convert to cleartext.\n"); authtok_blob = dp_opt_get_blob(opts->basic, SDAP_DEFAULT_AUTHTOK); if (authtok_blob.data == NULL || authtok_blob.length == 0) { - DEBUG(1, ("Missing obfuscated password string.\n")); + DEBUG(1, "Missing obfuscated password string.\n"); return EINVAL; } ret = sss_password_decrypt(memctx, (char *) authtok_blob.data, &cleartext); if (ret != EOK) { - DEBUG(1, ("Cannot convert the obfuscated " - "password back to cleartext\n")); + DEBUG(1, "Cannot convert the obfuscated " + "password back to cleartext\n"); return ret; } @@ -501,14 +501,14 @@ int ldap_get_options(TALLOC_CTX *memctx, ret = dp_opt_set_blob(opts->basic, SDAP_DEFAULT_AUTHTOK, authtok_blob); talloc_free(cleartext); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); return ret; } ret = dp_opt_set_string(opts->basic, SDAP_DEFAULT_AUTHTOK_TYPE, "password"); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); return ret; } } @@ -542,25 +542,25 @@ int ldap_get_sudo_options(TALLOC_CTX *memctx, ret = dp_opt_set_string(opts->basic, SDAP_SUDO_SEARCH_BASE, search_base); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set SUDO search base" - "to default value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set SUDO search base" + "to default value\n"); return ret; } - DEBUG(SSSDBG_FUNC_DATA, ("Option %s set to %s\n", + DEBUG(SSSDBG_FUNC_DATA, "Option %s set to %s\n", opts->basic[SDAP_SUDO_SEARCH_BASE].opt_name, - dp_opt_get_string(opts->basic, SDAP_SUDO_SEARCH_BASE))); + dp_opt_get_string(opts->basic, SDAP_SUDO_SEARCH_BASE)); } } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Search base not set, trying to discover it later " - "connecting to the LDAP server.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Search base not set, trying to discover it later " + "connecting to the LDAP server.\n"); } ret = sdap_parse_search_base(opts, opts->basic, SDAP_SUDO_SEARCH_BASE, &opts->sdom->sudo_search_bases); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse SUDO search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse SUDO search base\n"); return ret; } @@ -570,7 +570,7 @@ int ldap_get_sudo_options(TALLOC_CTX *memctx, SDAP_OPTS_SUDO, &opts->sudorule_map); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get SUDO attribute map\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get SUDO attribute map\n"); return ret; } @@ -600,25 +600,25 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, ret = dp_opt_set_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE, search_base); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set autofs search base" - "to default value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set autofs search base" + "to default value\n"); return ret; } - DEBUG(SSSDBG_FUNC_DATA, ("Option %s set to %s\n", + DEBUG(SSSDBG_FUNC_DATA, "Option %s set to %s\n", opts->basic[SDAP_AUTOFS_SEARCH_BASE].opt_name, - dp_opt_get_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE))); + dp_opt_get_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE)); } } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Search base not set, trying to discover it later " - "connecting to the LDAP server.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Search base not set, trying to discover it later " + "connecting to the LDAP server.\n"); } ret = sdap_parse_search_base(opts, opts->basic, SDAP_AUTOFS_SEARCH_BASE, &opts->sdom->autofs_search_bases); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse autofs search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse autofs search base\n"); return ret; } @@ -635,7 +635,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, default_entry_map = rfc2307bis_autofs_entry_map; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown LDAP schema!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown LDAP schema!\n"); return EINVAL; } @@ -645,7 +645,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, &opts->autofs_mobject_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs map object attribute map\n")); + "Could not get autofs map object attribute map\n"); return ret; } @@ -655,7 +655,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, &opts->autofs_entry_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs entry object attribute map\n")); + "Could not get autofs entry object attribute map\n"); return ret; } @@ -698,7 +698,7 @@ errno_t sdap_parse_search_base(TALLOC_CTX *mem_ctx, break; default: DEBUG(SSSDBG_CONF_SETTINGS, - ("Unknown search base type: [%d]\n", class)); + "Unknown search base type: [%d]\n", class); class_name = "UNKNOWN"; /* Non-fatal */ break; @@ -759,8 +759,8 @@ sdap_create_search_base(TALLOC_CTX *mem_ctx, if (!ldb_dn_validate(ldn)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid base DN [%s]\n", - unparsed_base)); + "Invalid base DN [%s]\n", + unparsed_base); ret = EINVAL; goto done; } @@ -816,7 +816,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, */ if (count > 1 && (count % 3)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unparseable search base: [%s][%d]\n", unparsed_base, count)); + "Unparseable search base: [%s][%d]\n", unparsed_base, count); ret = EINVAL; goto done; } @@ -830,10 +830,10 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, if (old_filter != NULL) { /* Using a deprecated ldap_{user,group}_search_filter */ - DEBUG(SSSDBG_IMPORTANT_INFO, ("WARNING: Using a deprecated filter " + DEBUG(SSSDBG_IMPORTANT_INFO, "WARNING: Using a deprecated filter " "option for %s. Please see the documentation on LDAP search " "bases to see how the obsolete option can be migrated\n", - class_name)); + class_name); sss_log(SSS_LOG_NOTICE, "WARNING: Using a deprecated filter option" "for %s. Please see the documentation on LDAP search bases " "to see how the obsolete option can be migrated\n", @@ -844,16 +844,16 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, LDAP_SCOPE_SUBTREE, old_filter, &search_bases[0]); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot create new sdap search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot create new sdap search base\n"); goto done; } DEBUG(SSSDBG_CONF_SETTINGS, - ("Search base added: [%s][%s][%s][%s]\n", + "Search base added: [%s][%s][%s][%s]\n", class_name, search_bases[0]->basedn, "SUBTREE", - search_bases[0]->filter ? search_bases[0]->filter : "")); + search_bases[0]->filter ? search_bases[0]->filter : ""); search_bases[1] = NULL; } else { @@ -875,7 +875,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, if (split_bases[c][0] == '\0') { DEBUG(SSSDBG_CRIT_FAILURE, - ("Zero-length search base: [%s]\n", unparsed_base)); + "Zero-length search base: [%s]\n", unparsed_base); ret = EINVAL; goto done; } @@ -889,8 +889,8 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, if (!ldb_dn_validate(ldn)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid base DN [%s]\n", - split_bases[c])); + "Invalid base DN [%s]\n", + split_bases[c]); ret = EINVAL; goto done; } @@ -917,7 +917,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, search_bases[i]->scope = LDAP_SCOPE_BASE; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unknown search scope: [%s]\n", split_bases[c+1])); + "Unknown search scope: [%s]\n", split_bases[c+1]); ret = EINVAL; goto done; } @@ -943,7 +943,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, tree = ldb_parse_tree(tmp_ctx, filter); if(!tree) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid search filter: [%s]\n", filter)); + "Invalid search filter: [%s]\n", filter); ret = EINVAL; goto done; } @@ -954,11 +954,11 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, } DEBUG(SSSDBG_CONF_SETTINGS, - ("Search base added: [%s][%s][%s][%s]\n", + "Search base added: [%s][%s][%s][%s]\n", class_name, search_bases[i]->basedn, split_bases[c+1][0] ? split_bases[c+1] : "SUBTREE", - search_bases[i]->filter ? search_bases[i]->filter : "")); + search_bases[i]->filter ? search_bases[i]->filter : ""); i++; } @@ -1003,15 +1003,15 @@ int sdap_id_setup_tasks(struct be_ctx *be_ctx, /* set up enumeration task */ if (sdom->dom->enumerate) { - DEBUG(SSSDBG_TRACE_FUNC, ("Setting up enumeration for %s\n", - sdom->dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Setting up enumeration for %s\n", + sdom->dom->name); ret = ldap_setup_enumeration(be_ctx, ctx->opts, sdom, send_fn, recv_fn, pvt); } else { /* the enumeration task, runs the cleanup process by itself, * but if enumeration is not running we need to schedule it */ - DEBUG(SSSDBG_TRACE_FUNC, ("Setting up cleanup task for %s\n", - sdom->dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Setting up cleanup task for %s\n", + sdom->dom->name); ret = ldap_setup_cleanup(ctx, sdom); } @@ -1030,7 +1030,7 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return; } @@ -1044,8 +1044,8 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) srvaddr = fo_get_server_hostent(server); if (!srvaddr) { - DEBUG(1, ("FATAL: No hostent available for server (%s)\n", - fo_get_server_str_name(server))); + DEBUG(1, "FATAL: No hostent available for server (%s)\n", + fo_get_server_str_name(server)); talloc_free(tmp_ctx); return; } @@ -1053,20 +1053,20 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, fo_get_server_port(server)); if (sockaddr == NULL) { - DEBUG(1, ("resolv_get_sockaddr_address failed.\n")); + DEBUG(1, "resolv_get_sockaddr_address failed.\n"); talloc_free(tmp_ctx); return; } if (fo_is_srv_lookup(server)) { if (!tmp) { - DEBUG(1, ("Unknown service, using ldap\n")); + DEBUG(1, "Unknown service, using ldap\n"); tmp = SSS_LDAP_SRV_NAME; } srv_name = fo_get_server_name(server); if (srv_name == NULL) { - DEBUG(1, ("Could not get server host name\n")); + DEBUG(1, "Could not get server host name\n"); talloc_free(tmp_ctx); return; } @@ -1079,12 +1079,12 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) } if (!new_uri) { - DEBUG(2, ("Failed to copy URI ...\n")); + DEBUG(2, "Failed to copy URI ...\n"); talloc_free(tmp_ctx); return; } - DEBUG(6, ("Constructed uri '%s'\n", new_uri)); + DEBUG(6, "Constructed uri '%s'\n", new_uri); /* free old one and replace with new one */ talloc_zfree(service->uri); @@ -1106,7 +1106,7 @@ static void sdap_finalize(struct tevent_context *ev, ret = remove_krb5_info_files(se, realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); } orderly_shutdown(0); @@ -1123,14 +1123,14 @@ errno_t sdap_install_sigterm_handler(TALLOC_CTX *mem_ctx, sig_realm = talloc_strdup(mem_ctx, realm); if (sig_realm == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); return ENOMEM; } sige = tevent_add_signal(ev, mem_ctx, SIGTERM, SA_SIGINFO, sdap_finalize, sig_realm); if (sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); talloc_free(sig_realm); return ENOMEM; } @@ -1149,21 +1149,21 @@ void sdap_remove_kdcinfo_files_callback(void *pvt) ret = be_fo_run_callbacks_at_next_request(ctx->be_ctx, ctx->kdc_service_name); if (ret != EOK) { - DEBUG(1, ("be_fo_run_callbacks_at_next_request failed, " + DEBUG(1, "be_fo_run_callbacks_at_next_request failed, " "krb5 info files will not be removed, because " - "it is unclear if they will be recreated properly.\n")); + "it is unclear if they will be recreated properly.\n"); return; } tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed, cannot remove krb5 info files.\n")); + DEBUG(1, "talloc_new failed, cannot remove krb5 info files.\n"); return; } ret = remove_krb5_info_files(tmp_ctx, ctx->realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); } talloc_zfree(tmp_ctx); @@ -1180,7 +1180,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx, ctx = talloc_zero(mem_ctx, struct remove_info_files_ctx); if (ctx == NULL) { - DEBUG(1, ("talloc_zfree failed.\n")); + DEBUG(1, "talloc_zfree failed.\n"); return ENOMEM; } @@ -1188,7 +1188,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx, ctx->realm = talloc_strdup(ctx, realm); ctx->kdc_service_name = talloc_strdup(ctx, service_name); if (ctx->realm == NULL || ctx->kdc_service_name == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); ret = ENOMEM; goto done; } @@ -1197,7 +1197,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx, sdap_remove_kdcinfo_files_callback, ctx, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_offline_cb failed.\n")); + DEBUG(1, "be_add_offline_cb failed.\n"); goto done; } @@ -1239,7 +1239,7 @@ sdap_set_sasl_options(struct sdap_options *id_opts, *primary_realm = '\0'; desired_realm = primary_realm+1; DEBUG(SSSDBG_TRACE_INTERNAL, - ("authid contains realm [%s]\n", desired_realm)); + "authid contains realm [%s]\n", desired_realm); } else { desired_realm = dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM); if (!desired_realm) { @@ -1248,9 +1248,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, } } - DEBUG(SSSDBG_CONF_SETTINGS, ("Will look for %s@%s in %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Will look for %s@%s in %s\n", desired_primary, desired_realm, - keytab_path ? keytab_path : "default keytab")); + keytab_path ? keytab_path : "default keytab"); ret = select_principal_from_keytab(tmp_ctx, desired_primary, desired_realm, @@ -1262,14 +1262,14 @@ sdap_set_sasl_options(struct sdap_options *id_opts, if (primary_requested && strcmp(desired_primary, sasl_primary) != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Configured SASL auth ID not found in keytab. " - "Requested %s, found %s\n", desired_primary, sasl_primary)); + "Configured SASL auth ID not found in keytab. " + "Requested %s, found %s\n", desired_primary, sasl_primary); } if (realm_requested && strcmp(desired_realm, sasl_realm) != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Configured SASL realm not found in keytab. " - "Requested %s, found %s\n", desired_realm, sasl_realm)); + "Configured SASL realm not found in keytab. " + "Requested %s, found %s\n", desired_realm, sasl_realm); } ret = dp_opt_set_string(id_opts->basic, @@ -1277,9 +1277,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, if (ret != EOK) { goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", id_opts->basic[SDAP_SASL_AUTHID].opt_name, - dp_opt_get_string(id_opts->basic, SDAP_SASL_AUTHID))); + dp_opt_get_string(id_opts->basic, SDAP_SASL_AUTHID)); ret = dp_opt_set_string(id_opts->basic, SDAP_SASL_REALM, sasl_realm); @@ -1287,9 +1287,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", id_opts->basic[SDAP_SASL_REALM].opt_name, - dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM))); + dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM)); ret = EOK; done: @@ -1307,25 +1307,25 @@ sdap_gssapi_get_default_realm(TALLOC_CTX *mem_ctx) krberr = krb5_init_context(&context); if (krberr) { - DEBUG(2, ("Failed to init kerberos context\n")); + DEBUG(2, "Failed to init kerberos context\n"); goto done; } krberr = krb5_get_default_realm(context, &krb5_realm); if (krberr) { - DEBUG(2, ("Failed to get default realm name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(2, "Failed to get default realm name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } realm = talloc_strdup(mem_ctx, krb5_realm); krb5_free_default_realm(context, krb5_realm); if (!realm) { - DEBUG(0, ("Out of memory\n")); + DEBUG(0, "Out of memory\n"); goto done; } - DEBUG(7, ("Will use default realm %s\n", realm)); + DEBUG(7, "Will use default realm %s\n", realm); done: if (context) krb5_free_context(context); return realm; @@ -1353,10 +1353,10 @@ int sdap_gssapi_init(TALLOC_CTX *mem_ctx, krb5_opt_realm = dp_opt_get_string(opts, SDAP_KRB5_REALM); if (krb5_opt_realm == NULL) { - DEBUG(2, ("Missing krb5_realm option, will use libkrb default\n")); + DEBUG(2, "Missing krb5_realm option, will use libkrb default\n"); krb5_realm = sdap_gssapi_get_default_realm(tmp_ctx); if (krb5_realm == NULL) { - DEBUG(0, ("Cannot determine the Kerberos realm, aborting\n")); + DEBUG(0, "Cannot determine the Kerberos realm, aborting\n"); ret = EIO; goto done; } @@ -1375,20 +1375,20 @@ int sdap_gssapi_init(TALLOC_CTX *mem_ctx, SDAP_KRB5_USE_KDCINFO), &service); if (ret != EOK) { - DEBUG(0, ("Failed to init KRB5 failover service!\n")); + DEBUG(0, "Failed to init KRB5 failover service!\n"); goto done; } ret = sdap_install_sigterm_handler(mem_ctx, bectx->ev, krb5_realm); if (ret != EOK) { - DEBUG(0, ("Failed to install sigterm handler\n")); + DEBUG(0, "Failed to install sigterm handler\n"); goto done; } ret = sdap_install_offline_callback(mem_ctx, bectx, krb5_realm, SSS_KRB5KDC_FO_SRV); if (ret != EOK) { - DEBUG(0, ("Failed to install sigterm handler\n")); + DEBUG(0, "Failed to install sigterm handler\n"); goto done; } @@ -1430,7 +1430,7 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, /* split server parm into a list */ ret = split_on_separator(tmp_ctx, urls, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to parse server list!\n")); + DEBUG(1, "Failed to parse server list!\n"); goto done; } @@ -1439,15 +1439,15 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, if (be_fo_is_srv_identifier(list[i])) { if (!primary) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add server [%s] to failover service: " + "Failed to add server [%s] to failover service: " "SRV resolution only allowed for primary servers!\n", - list[i])); + list[i]); continue; } if (!dns_service_name) { - DEBUG(0, ("Missing DNS service name for service [%s].\n", - service_name)); + DEBUG(0, "Missing DNS service name for service [%s].\n", + service_name); ret = EINVAL; goto done; } @@ -1461,29 +1461,29 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, dns_service_name, NULL, BE_FO_PROTO_TCP, false, srv_user_data); if (ret) { - DEBUG(0, ("Failed to add server\n")); + DEBUG(0, "Failed to add server\n"); goto done; } - DEBUG(6, ("Added service lookup\n")); + DEBUG(6, "Added service lookup\n"); continue; } ret = ldap_url_parse(list[i], &lud); if (ret != LDAP_SUCCESS) { - DEBUG(0, ("Failed to parse ldap URI (%s)!\n", list[i])); + DEBUG(0, "Failed to parse ldap URI (%s)!\n", list[i]); ret = EINVAL; goto done; } if (lud->lud_host == NULL) { - DEBUG(2, ("The LDAP URI (%s) did not contain a host name\n", - list[i])); + DEBUG(2, "The LDAP URI (%s) did not contain a host name\n", + list[i]); ldap_free_urldesc(lud); continue; } - DEBUG(6, ("Added URI %s\n", list[i])); + DEBUG(6, "Added URI %s\n", list[i]); talloc_steal(service, list[i]); @@ -1553,7 +1553,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, ret = be_fo_add_service(ctx, service_name, ldap_user_data_cmp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to create failover service!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to create failover service!\n"); goto done; } @@ -1565,7 +1565,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, if (!urls) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No primary servers defined, using service discovery\n")); + "No primary servers defined, using service discovery\n"); urls = BE_SRV_IDENTIFIER; } @@ -1586,7 +1586,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, ret = be_fo_service_add_callback(memctx, ctx, service->name, sdap_uri_callback, service); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to add failover callback!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to add failover callback!\n"); goto done; } @@ -1613,19 +1613,19 @@ errno_t string_to_shadowpw_days(const char *s, long *d) errno = 0; l = strtol(s, &endptr, 10); if (errno != 0) { - DEBUG(1, ("strtol failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "strtol failed [%d][%s].\n", errno, strerror(errno)); return errno; } if (*endptr != '\0') { - DEBUG(1, ("Input string [%s] is invalid.\n", s)); + DEBUG(1, "Input string [%s] is invalid.\n", s); return EINVAL; } if (l < -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Input string contains not allowed negative value [%ld].\n", - l)); + "Input string contains not allowed negative value [%ld].\n", + l); return EINVAL; } @@ -1830,8 +1830,8 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_el(sysdb_attrs, sid_attr, &el); if (ret != EOK || el->num_values != 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No [%s] attribute while id-mapping. [%d][%s]\n", - sid_attr, el->num_values, strerror(ret))); + "No [%s] attribute while id-mapping. [%d][%s]\n", + sid_attr, el->num_values, strerror(ret)); return ENOENT; } @@ -1841,7 +1841,7 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, sid_str = talloc_strndup(mem_ctx, (char *) el->values[0].data, el->values[0].length); if (sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strndup failed.\n"); return ENOMEM; } } else { @@ -1851,8 +1851,8 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID: [%s]\n", - idmap_error_string(err))); + "Could not convert SID: [%s]\n", + idmap_error_string(err)); return EIO; } } diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index dd34c85ca..7a2016345 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -95,7 +95,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -133,8 +133,8 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, uid, &sid); if (err == IDMAP_NO_DOMAIN) { DEBUG(SSSDBG_MINOR_FAILURE, - ("[%s] did not match any configured ID mapping domain\n", - name)); + "[%s] did not match any configured ID mapping domain\n", + name); ret = sysdb_delete_user(state->domain, NULL, uid); if (ret == ENOENT) { @@ -145,8 +145,8 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, goto fail; } else if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Mapping ID [%s] to SID failed: [%s]\n", - name, idmap_error_string(err))); + "Mapping ID [%s] to SID failed: [%s]\n", + name, idmap_error_string(err)); ret = EIO; goto fail; } @@ -180,7 +180,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, } if (attr_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing search attribute name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing search attribute name.\n"); ret = EINVAL; goto fail; } @@ -209,7 +209,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, talloc_zfree(clean_name); if (!state->filter) { - DEBUG(2, ("Failed to build the base filter\n")); + DEBUG(2, "Failed to build the base filter\n"); ret = ENOMEM; goto fail; } @@ -548,7 +548,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -588,8 +588,8 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, gid, &sid); if (err == IDMAP_NO_DOMAIN) { DEBUG(SSSDBG_MINOR_FAILURE, - ("[%s] did not match any configured ID mapping domain\n", - name)); + "[%s] did not match any configured ID mapping domain\n", + name); ret = sysdb_delete_group(state->domain, NULL, gid); if (ret == ENOENT) { @@ -600,8 +600,8 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, goto fail; } else if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Mapping ID [%s] to SID failed: [%s]\n", - name, idmap_error_string(err))); + "Mapping ID [%s] to SID failed: [%s]\n", + name, idmap_error_string(err)); ret = EIO; goto fail; } @@ -635,7 +635,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, } if (attr_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing search attribute name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing search attribute name.\n"); ret = EINVAL; goto fail; } @@ -662,7 +662,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, talloc_zfree(clean_name); if (!state->filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -954,7 +954,7 @@ static struct tevent_req *groups_by_user_send(TALLOC_CTX *memctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -1117,7 +1117,7 @@ void sdap_do_online_check(struct be_req *be_req, struct sdap_id_ctx *ctx) check_ctx = talloc_zero(be_req, struct sdap_online_check_ctx); if (!check_ctx) { ret = ENOMEM; - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed\n"); goto fail; } check_ctx->id_ctx = ctx; @@ -1127,7 +1127,7 @@ void sdap_do_online_check(struct be_req *be_req, struct sdap_id_ctx *ctx) be_ctx, ctx->conn->service, false, CON_TLS_DFL, false); if (req == NULL) { - DEBUG(1, ("sdap_cli_connect_send failed.\n")); + DEBUG(1, "sdap_cli_connect_send failed.\n"); ret = EIO; goto fail; } @@ -1190,12 +1190,12 @@ static void sdap_check_online_done(struct tevent_req *req) talloc_free(check_ctx); if (reinit) { - DEBUG(SSSDBG_TRACE_FUNC, ("Server reinitialization detected. " - "Cleaning cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Server reinitialization detected. " + "Cleaning cache.\n"); reinit_req = sdap_reinit_cleanup_send(be_req, be_ctx, id_ctx); if (reinit_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up.\n"); /* not fatal */ goto done; } @@ -1218,11 +1218,11 @@ static void sdap_check_online_reinit_done(struct tevent_req *req) ret = sdap_reinit_cleanup_recv(req); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up [%d]: %s\n", ret, strerror(ret)); /* not fatal */ } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Reinitialization clean up completed\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reinitialization clean up completed\n"); } sdap_handler_done(be_req, DP_ERR_OK, 0, NULL); @@ -1256,7 +1256,7 @@ void sdap_account_info_handler(struct be_req *breq) ctx = talloc_get_type(be_ctx->bet_info[BET_ID].pvt_bet_data, struct sdap_id_ctx); if (!ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get sdap ctx\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not get sdap ctx\n"); return sdap_handler_done(breq, DP_ERR_FATAL, EINVAL, "Invalid request data\n"); } @@ -1311,7 +1311,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping user enumeration on demand\n")); + "Skipping user enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1330,7 +1330,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping group enumeration on demand\n")); + "Skipping group enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1379,7 +1379,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping service enumeration on demand\n")); + "Skipping service enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1574,7 +1574,7 @@ static void sdap_account_info_complete(struct tevent_req *req) error_text = NULL; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Bug: dp_error is OK on failed request")); + "Bug: dp_error is OK on failed request"); dp_error = DP_ERR_FATAL; error_text = req_error_text; } @@ -1630,7 +1630,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx, req = tevent_req_create(memctx, &state, struct get_user_and_group_state); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n"); return NULL; } @@ -1643,7 +1643,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -1659,7 +1659,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx, state->filter_val, state->filter_type, state->attrs_type, state->noexist_delete); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("users_get_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "users_get_send failed.\n"); ret = ENOMEM; goto fail; } @@ -1705,7 +1705,7 @@ static void get_user_and_group_groups_done(struct tevent_req *subreq) state->filter_val, state->filter_type, state->attrs_type, state->noexist_delete); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("groups_get_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "groups_get_send failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -1735,7 +1735,7 @@ static void get_user_and_group_users_done(struct tevent_req *subreq) ret = sysdb_delete_by_sid(state->sysdb, state->domain, state->filter_val); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete entry by SID!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete entry by SID!\n"); tevent_req_error(req, ret); return; } diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c index 513ad9545..945b405f8 100644 --- a/src/providers/ldap/ldap_id_cleanup.c +++ b/src/providers/ldap/ldap_id_cleanup.c @@ -90,8 +90,8 @@ errno_t ldap_setup_cleanup(struct sdap_id_ctx *id_ctx, BE_PTASK_OFFLINE_SKIP, ldap_cleanup_task, cleanup_ctx, name, &sdom->cleanup_task); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to initialize cleanup periodic " - "task for %s\n", sdom->dom->name)); + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to initialize cleanup periodic " + "task for %s\n", sdom->dom->name); goto done; } @@ -127,7 +127,7 @@ errno_t ldap_id_cleanup(struct sdap_options *opts, ret = sysdb_transaction_start(sdom->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -144,7 +144,7 @@ errno_t ldap_id_cleanup(struct sdap_options *opts, ret = sysdb_transaction_commit(sdom->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -155,7 +155,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sdom->dom->sysdb); if (tret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -189,8 +189,8 @@ static int cleanup_users(struct sdap_options *opts, } account_cache_expiration = dp_opt_get_int(opts->basic, SDAP_ACCOUNT_CACHE_EXPIRATION); - DEBUG(9, ("Cache expiration is set to %d days\n", - account_cache_expiration)); + DEBUG(9, "Cache expiration is set to %d days\n", + account_cache_expiration); if (account_cache_expiration > 0) { subfilter = talloc_asprintf(tmpctx, @@ -210,7 +210,7 @@ static int cleanup_users(struct sdap_options *opts, SYSDB_LAST_LOGIN); } if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; } @@ -223,7 +223,7 @@ static int cleanup_users(struct sdap_options *opts, goto done; } - DEBUG(SSSDBG_FUNC_DATA, ("Found %zu expired user entries!\n", count)); + DEBUG(SSSDBG_FUNC_DATA, "Found %zu expired user entries!\n", count); if (count == 0) { ret = EOK; @@ -241,8 +241,8 @@ static int cleanup_users(struct sdap_options *opts, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(2, ("Entry %s has no Name Attribute ?!?\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(2, "Entry %s has no Name Attribute ?!?\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = EFAULT; goto done; } @@ -251,8 +251,8 @@ static int cleanup_users(struct sdap_options *opts, ret = cleanup_users_logged_in(uid_table, msgs[i]); if (ret == EOK) { /* If the user is logged in, proceed to the next one */ - DEBUG(5, ("User %s is still logged in or a dummy entry, " - "keeping data\n", name)); + DEBUG(5, "User %s is still logged in or a dummy entry, " + "keeping data\n", name); continue; } else if (ret != ENOENT) { goto done; @@ -260,7 +260,7 @@ static int cleanup_users(struct sdap_options *opts, } /* If not logged in or cannot check the table, delete him */ - DEBUG(9, ("About to delete user %s\n", name)); + DEBUG(9, "About to delete user %s\n", name); ret = sysdb_delete_user(dom, name, 0); if (ret) { goto done; @@ -283,8 +283,8 @@ static int cleanup_users_logged_in(hash_table_t *table, uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (!uid) { - DEBUG(SSSDBG_OP_FAILURE, ("Entry %s has no UID Attribute!\n", - ldb_dn_get_linearized(msg->dn))); + DEBUG(SSSDBG_OP_FAILURE, "Entry %s has no UID Attribute!\n", + ldb_dn_get_linearized(msg->dn)); return ENOENT; } @@ -331,7 +331,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, SYSDB_CACHE_EXPIRE, SYSDB_CACHE_EXPIRE, (long)now); if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; } @@ -344,7 +344,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, goto done; } - DEBUG(SSSDBG_FUNC_DATA, ("Found %zu expired group entries!\n", count)); + DEBUG(SSSDBG_FUNC_DATA, "Found %zu expired group entries!\n", count); if (count == 0) { ret = EOK; @@ -373,14 +373,14 @@ static int cleanup_groups(TALLOC_CTX *memctx, subfilter = talloc_asprintf(tmpctx, "(%s=%s)", SYSDB_MEMBEROF, dn); } if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; } base_dn = sysdb_base_dn(sysdb, tmpctx); if (base_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = ENOMEM; goto done; } @@ -393,17 +393,17 @@ static int cleanup_groups(TALLOC_CTX *memctx, name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(2, ("Entry %s has no Name Attribute ?!?\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(2, "Entry %s has no Name Attribute ?!?\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = EFAULT; goto done; } - DEBUG(8, ("About to delete group %s\n", name)); + DEBUG(8, "About to delete group %s\n", name); ret = sysdb_delete_group(domain, name, 0); if (ret) { - DEBUG(2, ("Group delete returned %d (%s)\n", - ret, strerror(ret))); + DEBUG(2, "Group delete returned %d (%s)\n", + ret, strerror(ret)); goto done; } } diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c index 368ad9328..62db1c11c 100644 --- a/src/providers/ldap/ldap_id_enum.c +++ b/src/providers/ldap/ldap_id_enum.c @@ -80,7 +80,7 @@ errno_t ldap_setup_enumeration(struct be_ctx *be_ctx, ectx, "enumeration", &sdom->enum_task); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Unable to initialize enumeration periodic task\n")); + "Unable to initialize enumeration periodic task\n"); talloc_free(ectx); return ret; } @@ -113,13 +113,13 @@ ldap_enumeration_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ldap_enumeration_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } ectx = talloc_get_type(pvt, struct ldap_enum_ctx); if (ectx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot retrieve ldap_enum_ctx!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot retrieve ldap_enum_ctx!\n"); ret = EFAULT; goto fail; } @@ -133,7 +133,7 @@ ldap_enumeration_send(TALLOC_CTX *mem_ctx, /* The ptask API will reschedule the enumeration on its own on * failure */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to schedule enumeration, retrying later!\n")); + "Failed to schedule enumeration, retrying later!\n"); ret = EIO; goto fail; } diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c index 3f40d89e6..f38511a21 100644 --- a/src/providers/ldap/ldap_id_netgroup.c +++ b/src/providers/ldap/ldap_id_netgroup.c @@ -82,7 +82,7 @@ struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -102,7 +102,7 @@ struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx, clean_name, ctx->opts->netgroup_map[SDAP_OC_NETGROUP].name); if (!state->filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -208,8 +208,8 @@ static void ldap_netgroup_get_done(struct tevent_req *subreq) } if (ret == EOK && state->count > 1) { - DEBUG(1, ("Found more than one netgroup with the name [%s].\n", - state->name)); + DEBUG(1, "Found more than one netgroup with the name [%s].\n", + state->name); tevent_req_error(req, EINVAL); return; } diff --git a/src/providers/ldap/ldap_id_services.c b/src/providers/ldap/ldap_id_services.c index 04de1dbc4..77215127b 100644 --- a/src/providers/ldap/ldap_id_services.c +++ b/src/providers/ldap/ldap_id_services.c @@ -94,7 +94,7 @@ services_get_send(TALLOC_CTX *mem_ctx, state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_MINOR_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto error; } @@ -136,13 +136,13 @@ services_get_send(TALLOC_CTX *mem_ctx, talloc_zfree(clean_protocol); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build the base filter\n")); + "Failed to build the base filter\n"); ret = ENOMEM; goto error; } DEBUG(SSSDBG_TRACE_LIBS, - ("Preparing to search for services with filter [%s]\n", - state->filter)); + "Preparing to search for services with filter [%s]\n", + state->filter); ret = build_attrs_from_map(state, id_ctx->opts->service_map, SDAP_OPTS_SERVICES, NULL, diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c index 15615b289..a228f5bd7 100644 --- a/src/providers/ldap/ldap_init.c +++ b/src/providers/ldap/ldap_init.c @@ -75,7 +75,7 @@ errno_t check_order_list_for_duplicates(char **list, cmp = strcasecmp(list[c], list[d]); } if (cmp == 0) { - DEBUG(1, ("Duplicate string [%s] found.\n", list[c])); + DEBUG(1, "Duplicate string [%s] found.\n", list[c]); return EINVAL; } } @@ -100,7 +100,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, /* If we're already set up, just return that */ if(bectx->bet_info[BET_ID].mod_name && strcmp("ldap", bectx->bet_info[BET_ID].mod_name) == 0) { - DEBUG(8, ("Re-using sdap_id_ctx for this provider\n")); + DEBUG(8, "Re-using sdap_id_ctx for this provider\n"); *ops = bectx->bet_info[BET_ID].bet_ops; *pvt_data = bectx->bet_info[BET_ID].pvt_bet_data; return EOK; @@ -115,7 +115,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, dns_service_name = dp_opt_get_string(opts->basic, SDAP_DNS_SERVICE_NAME); DEBUG(SSSDBG_CONF_SETTINGS, - ("Service name for discovery set to %s\n", dns_service_name)); + "Service name for discovery set to %s\n", dns_service_name); urls = dp_opt_get_string(opts->basic, SDAP_URI); backup_urls = dp_opt_get_string(opts->basic, SDAP_BACKUP_URI); @@ -124,7 +124,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, dns_service_name, urls, backup_urls, &sdap_service); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to initialize failover service!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to initialize failover service!\n"); goto done; } @@ -142,8 +142,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx, ctx->be, ctx->conn->service, &ctx->krb5_service); if (ret != EOK) { - DEBUG(1, ("sdap_gssapi_init failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "sdap_gssapi_init failed [%d][%s].\n", + ret, strerror(ret)); goto done; } } @@ -151,8 +151,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx, ret = setup_tls_config(ctx->opts->basic); if (ret != EOK) { - DEBUG(1, ("setup_tls_config failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_tls_config failed [%d][%s].\n", + ret, strerror(ret)); goto done; } @@ -167,16 +167,16 @@ int sssm_ldap_id_init(struct be_ctx *bectx, ret = sdap_setup_child(); if (ret != EOK) { - DEBUG(1, ("setup_child failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_child failed [%d][%s].\n", + ret, strerror(ret)); goto done; } /* setup SRV lookup plugin */ ret = be_fo_set_dns_srv_lookup_plugin(bectx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to set SRV lookup plugin " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -186,8 +186,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx, sdap_refresh_netgroups_recv, ctx); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Periodical refresh of netgroups " - "will not work [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups " + "will not work [%d]: %s\n", ret, strerror(ret)); } *ops = &sdap_id_ops; @@ -243,7 +243,7 @@ int sssm_ldap_chpass_init(struct be_ctx *bectx, ret = sssm_ldap_auth_init(bectx, ops, &data); if (ret != EOK) { - DEBUG(1, ("sssm_ldap_auth_init failed.\n")); + DEBUG(1, "sssm_ldap_auth_init failed.\n"); goto done; } @@ -252,21 +252,21 @@ int sssm_ldap_chpass_init(struct be_ctx *bectx, dns_service_name = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_DNS_SERVICE_NAME); if (dns_service_name) { - DEBUG(7, ("Service name for chpass discovery set to %s\n", - dns_service_name)); + DEBUG(7, "Service name for chpass discovery set to %s\n", + dns_service_name); } urls = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_URI); backup_urls = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_BACKUP_URI); if (!urls && !backup_urls && !dns_service_name) { - DEBUG(9, ("ldap_chpass_uri and ldap_chpass_dns_service_name not set, " - "using ldap_uri.\n")); + DEBUG(9, "ldap_chpass_uri and ldap_chpass_dns_service_name not set, " + "using ldap_uri.\n"); ctx->chpass_service = NULL; } else { ret = sdap_service_init(ctx, ctx->be, "LDAP_CHPASS", dns_service_name, urls, backup_urls, &ctx->chpass_service); if (ret != EOK) { - DEBUG(1, ("Failed to initialize failover service!\n")); + DEBUG(1, "Failed to initialize failover service!\n"); goto done; } } @@ -304,34 +304,34 @@ int sssm_ldap_access_init(struct be_ctx *bectx, ret = sssm_ldap_id_init(bectx, ops, (void **)&access_ctx->id_ctx); if (ret != EOK) { - DEBUG(1, ("sssm_ldap_id_init failed.\n")); + DEBUG(1, "sssm_ldap_id_init failed.\n"); goto done; } order = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCESS_ORDER); if (order == NULL) { - DEBUG(1, ("ldap_access_order not given, using 'filter'.\n")); + DEBUG(1, "ldap_access_order not given, using 'filter'.\n"); order = "filter"; } ret = split_on_separator(access_ctx, order, ',', true, true, &order_list, &order_list_len); if (ret != EOK) { - DEBUG(1, ("split_on_separator failed.\n")); + DEBUG(1, "split_on_separator failed.\n"); goto done; } ret = check_order_list_for_duplicates(order_list, false); if (ret != EOK) { - DEBUG(1, ("check_order_list_for_duplicates failed.\n")); + DEBUG(1, "check_order_list_for_duplicates failed.\n"); goto done; } if (order_list_len > LDAP_ACCESS_LAST) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Currently only [%d] different access rules are supported.\n", - LDAP_ACCESS_LAST)); + "Currently only [%d] different access rules are supported.\n", + LDAP_ACCESS_LAST); ret = EINVAL; goto done; } @@ -346,9 +346,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx, /* It's okay if this is NULL. In that case we will simply act * like the 'deny' provider. */ - DEBUG(0, ("Warning: LDAP access rule 'filter' is set, " + DEBUG(0, "Warning: LDAP access rule 'filter' is set, " "but no ldap_access_filter configured. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); } else { access_ctx->filter = sdap_get_access_filter(access_ctx, filter); @@ -363,9 +363,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx, dummy = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCOUNT_EXPIRE_POLICY); if (dummy == NULL) { - DEBUG(0, ("Warning: LDAP access rule 'expire' is set, " + DEBUG(0, "Warning: LDAP access rule 'expire' is set, " "but no ldap_account_expire_policy configured. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); } else { if (strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_SHADOW) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_AD) != 0 && @@ -373,8 +373,8 @@ int sssm_ldap_access_init(struct be_ctx *bectx, strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_RHDS) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_IPA) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_389DS) != 0) { - DEBUG(1, ("Unsupported LDAP account expire policy [%s].\n", - dummy)); + DEBUG(1, "Unsupported LDAP account expire policy [%s].\n", + dummy); ret = EINVAL; goto done; } @@ -384,16 +384,16 @@ int sssm_ldap_access_init(struct be_ctx *bectx, } else if (strcasecmp(order_list[c], LDAP_ACCESS_HOST_NAME) == 0) { access_ctx->access_rule[c] = LDAP_ACCESS_HOST; } else { - DEBUG(1, ("Unexpected access rule name [%s].\n", order_list[c])); + DEBUG(1, "Unexpected access rule name [%s].\n", order_list[c]); ret = EINVAL; goto done; } } access_ctx->access_rule[c] = LDAP_ACCESS_EMPTY; if (c == 0) { - DEBUG(0, ("Warning: access_provider=ldap set, " + DEBUG(0, "Warning: access_provider=ldap set, " "but ldap_access_order is empty. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); } *ops = &sdap_access_ops; @@ -419,21 +419,21 @@ int sssm_ldap_sudo_init(struct be_ctx *be_ctx, ret = sssm_ldap_id_init(be_ctx, ops, &data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot init LDAP ID provider [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n", + ret, strerror(ret)); return ret; } id_ctx = talloc_get_type(data, struct sdap_id_ctx); if (!id_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID provider?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID provider?\n"); return EIO; } return sdap_sudo_init(be_ctx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Sudo init handler called but SSSD is " - "built without sudo support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Sudo init handler called but SSSD is " + "built without sudo support, ignoring\n"); return EOK; #endif } @@ -449,21 +449,21 @@ int sssm_ldap_autofs_init(struct be_ctx *be_ctx, ret = sssm_ldap_id_init(be_ctx, ops, &data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot init LDAP ID provider [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n", + ret, strerror(ret)); return ret; } id_ctx = talloc_get_type(data, struct sdap_id_ctx); if (!id_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID provider?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID provider?\n"); return EIO; } return sdap_autofs_init(be_ctx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Autofs init handler called but SSSD is " - "built without autofs support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Autofs init handler called but SSSD is " + "built without autofs support, ignoring\n"); return EOK; #endif } diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index ddcf199b6..360312437 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -59,9 +59,9 @@ int sdap_copy_map(TALLOC_CTX *memctx, map[i].name = NULL; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", map[i].opt_name, map[i].name ? "" : " no", - map[i].name ? map[i].name : "")); + map[i].name ? map[i].name : ""); } *_map = map; @@ -96,7 +96,7 @@ int sdap_get_map(TALLOC_CTX *memctx, &name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for %s\n", map[i].opt_name)); + "Failed to retrieve value for %s\n", map[i].opt_name); talloc_zfree(map); return EINVAL; } @@ -105,7 +105,7 @@ int sdap_get_map(TALLOC_CTX *memctx, ret = sss_filter_sanitize(map, name, &map[i].name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not sanitize attribute [%s]\n", name)); + "Could not sanitize attribute [%s]\n", name); talloc_zfree(map); return EINVAL; } @@ -116,14 +116,14 @@ int sdap_get_map(TALLOC_CTX *memctx, if (map[i].def_name && !map[i].name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for %s\n", map[i].opt_name)); + "Failed to retrieve value for %s\n", map[i].opt_name); talloc_zfree(map); return EINVAL; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", map[i].opt_name, map[i].name ? "" : " no", - map[i].name ? map[i].name : "")); + map[i].name ? map[i].name : ""); } *_map = map; @@ -157,8 +157,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, lerrno = 0; ret = ldap_set_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed [%s], ignored.\n", - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed [%s], ignored.\n", + sss_ldap_err2string(ret)); } attrs = sysdb_new_attrs(tmp_ctx); @@ -170,13 +170,13 @@ int sdap_parse_entry(TALLOC_CTX *memctx, str = ldap_get_dn(sh->ldap, sm->msg); if (!str) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); - DEBUG(1, ("ldap_get_dn failed: %d(%s)\n", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "ldap_get_dn failed: %d(%s)\n", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; } - DEBUG(9, ("OriginalDN: [%s].\n", str)); + DEBUG(9, "OriginalDN: [%s].\n", str); ret = sysdb_attrs_add_string(attrs, SYSDB_ORIG_DN, str); if (ret) goto done; if (_dn) { @@ -192,7 +192,7 @@ int sdap_parse_entry(TALLOC_CTX *memctx, if (map) { vals = ldap_get_values_len(sh->ldap, sm->msg, "objectClass"); if (!vals) { - DEBUG(1, ("Unknown entry type, no objectClasses found!\n")); + DEBUG(1, "Unknown entry type, no objectClasses found!\n"); ret = EINVAL; goto done; } @@ -206,8 +206,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, } } if (!vals[i]) { - DEBUG(1, ("objectClass not matching: %s\n", - map[0].name)); + DEBUG(1, "objectClass not matching: %s\n", + map[0].name); ldap_value_free_len(vals); ret = EINVAL; goto done; @@ -221,8 +221,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, DEBUG(lerrno == LDAP_SUCCESS ? SSSDBG_TRACE_INTERNAL : SSSDBG_MINOR_FAILURE, - ("Entry has no attributes [%d(%s)]!?\n", - lerrno, sss_ldap_err2string(lerrno))); + "Entry has no attributes [%d(%s)]!?\n", + lerrno, sss_ldap_err2string(lerrno)); if (map) { ret = EINVAL; goto done; @@ -248,7 +248,7 @@ int sdap_parse_entry(TALLOC_CTX *memctx, break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine if attribute [%s] was ranged\n", str)); + "Could not determine if attribute [%s] was ranged\n", str); goto done; } @@ -285,25 +285,25 @@ int sdap_parse_entry(TALLOC_CTX *memctx, if (!vals) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (lerrno != LDAP_SUCCESS) { - DEBUG(1, ("LDAP Library error: %d(%s)", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "LDAP Library error: %d(%s)", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; } - DEBUG(5, ("Attribute [%s] has no values, skipping.\n", str)); + DEBUG(5, "Attribute [%s] has no values, skipping.\n", str); } else { if (!vals[0]) { - DEBUG(1, ("Missing value after ldap_get_values() ??\n")); + DEBUG(1, "Missing value after ldap_get_values() ??\n"); ret = EINVAL; goto done; } for (i = 0; vals[i]; i++) { if (vals[i]->bv_len == 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Value of attribute [%s] is empty. " - "Skipping this value.\n", str)); + "Value of attribute [%s] is empty. " + "Skipping this value.\n", str); continue; } if (base64) { @@ -334,8 +334,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (lerrno) { - DEBUG(1, ("LDAP Library error: %d(%s)", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "LDAP Library error: %d(%s)", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; } @@ -390,19 +390,19 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } if (!dref->derefVal.bv_val) { - DEBUG(2, ("Entry has no DN?\n")); + DEBUG(2, "Entry has no DN?\n"); ret = EINVAL; goto done; } orig_dn = dref->derefVal.bv_val; DEBUG(SSSDBG_TRACE_LIBS, - ("Dereferenced DN: %s\n", orig_dn)); + "Dereferenced DN: %s\n", orig_dn); if (!dref->attrVals) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Dereferenced entry [%s] has no attributes\n", - orig_dn)); + "Dereferenced entry [%s] has no attributes\n", + orig_dn); ret = EINVAL; goto done; } @@ -411,7 +411,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, for (dval = dref->attrVals; dval != NULL; dval = dval->next) { if (strcasecmp("objectClass", dval->type) == 0) { if (dval->vals == NULL) { - DEBUG(4, ("No value for objectClass, skipping\n")); + DEBUG(4, "No value for objectClass, skipping\n"); continue; } @@ -424,8 +424,8 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } for (i=0; i<len; i++) { - DEBUG(9, ("Dereferenced objectClass value: %s\n", - dval->vals[i].bv_val)); + DEBUG(9, "Dereferenced objectClass value: %s\n", + dval->vals[i].bv_val); ocs[i] = talloc_strdup(ocs, dval->vals[i].bv_val); if (!ocs[i]) { ret = ENOMEM; @@ -437,7 +437,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } } if (!ocs) { - DEBUG(1, ("Unknown entry type, no objectClasses found!\n")); + DEBUG(1, "Unknown entry type, no objectClasses found!\n"); ret = EINVAL; goto done; } @@ -448,7 +448,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, for (i=0; ocs[i]; i++) { /* the objectclass is always the first name in the map */ if (strcasecmp(minfo[mi].map[0].name, ocs[i]) == 0) { - DEBUG(9, ("Found map for objectclass '%s'\n", ocs[i])); + DEBUG(9, "Found map for objectclass '%s'\n", ocs[i]); map = minfo[mi].map; num_attrs = minfo[mi].num_attrs; break; @@ -469,7 +469,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } for (dval = dref->attrVals; dval != NULL; dval = dval->next) { - DEBUG(8, ("Dereferenced attribute: %s\n", dval->type)); + DEBUG(8, "Dereferenced attribute: %s\n", dval->type); for (a = 1; a < num_attrs; a++) { /* check if this attr is valid with the chosen schema */ @@ -486,13 +486,13 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } if (dval->vals == NULL) { - DEBUG(4, ("No value for attribute %s, skipping\n", name)); + DEBUG(4, "No value for attribute %s, skipping\n", name); continue; } for (i=0; dval->vals[i].bv_val; i++) { - DEBUG(9, ("Dereferenced attribute value: %s\n", - dval->vals[i].bv_val)); + DEBUG(9, "Dereferenced attribute value: %s\n", + dval->vals[i].bv_val); ret = sysdb_attrs_add_mem(res[mi]->attrs, name, dval->vals[i].bv_val, dval->vals[i].bv_len); @@ -521,15 +521,15 @@ int sdap_get_msg_dn(TALLOC_CTX *memctx, struct sdap_handle *sh, lerrno = 0; ret = ldap_set_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed [%s], ignored.\n", - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed [%s], ignored.\n", + sss_ldap_err2string(ret)); } str = ldap_get_dn(sh->ldap, sm->msg); if (!str) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); - DEBUG(1, ("ldap_get_dn failed: %d(%s)\n", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "ldap_get_dn failed: %d(%s)\n", + lerrno, sss_ldap_err2string(lerrno)); return EIO; } @@ -563,7 +563,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) ldap_opt_x_tls_require_cert = LDAP_OPT_X_TLS_HARD; } else { - DEBUG(1, ("Unknown value for tls_reqcert.\n")); + DEBUG(1, "Unknown value for tls_reqcert.\n"); return EINVAL; } /* LDAP_OPT_X_TLS_REQUIRE_CERT has to be set as a global option, @@ -571,7 +571,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &ldap_opt_x_tls_require_cert); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -580,7 +580,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -589,7 +589,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTDIR, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -598,7 +598,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -607,7 +607,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_KEYFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -616,7 +616,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CIPHER_SUITE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -710,15 +710,15 @@ static char *get_single_value_as_string(TALLOC_CTX *mem_ctx, char *str = NULL; if (el->num_values == 0) { - DEBUG(3, ("Missing value.\n")); + DEBUG(3, "Missing value.\n"); } else if (el->num_values == 1) { str = talloc_strndup(mem_ctx, (char *) el->values[0].data, el->values[0].length); if (str == NULL) { - DEBUG(1, ("talloc_strndup failed.\n")); + DEBUG(1, "talloc_strndup failed.\n"); } } else { - DEBUG(3, ("More than one value found.\n")); + DEBUG(3, "More than one value found.\n"); } return str; @@ -743,19 +743,19 @@ static char *get_naming_context(TALLOC_CTX *mem_ctx, } if (dnc == NULL && nc == NULL) { - DEBUG(3, ("No attributes [%s] or [%s] found in rootDSE.\n", + DEBUG(3, "No attributes [%s] or [%s] found in rootDSE.\n", SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS, - SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT)); + SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT); } else { if (dnc != NULL) { - DEBUG(5, ("Using value from [%s] as naming context.\n", - SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT)); + DEBUG(5, "Using value from [%s] as naming context.\n", + SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT); naming_context = get_single_value_as_string(mem_ctx, dnc); } if (naming_context == NULL && nc != NULL) { - DEBUG(5, ("Using value from [%s] as naming context.\n", - SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS)); + DEBUG(5, "Using value from [%s] as naming context.\n", + SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS); naming_context = get_single_value_as_string(mem_ctx, nc); } } @@ -806,12 +806,12 @@ static errno_t sdap_set_search_base(struct sdap_options *opts, } DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting option [%s] to [%s].\n", - opts->basic[class].opt_name, naming_context)); + "Setting option [%s] to [%s].\n", + opts->basic[class].opt_name, naming_context); ret = dp_opt_set_string(opts->basic, class, naming_context); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); goto done; } @@ -838,7 +838,7 @@ errno_t sdap_set_config_options_with_rootdse(struct sysdb_attrs *rootdse, || !sdom->autofs_search_bases) { naming_context = get_naming_context(opts->basic, rootdse); if (naming_context == NULL) { - DEBUG(1, ("get_naming_context failed.\n")); + DEBUG(1, "get_naming_context failed.\n"); /* This has to be non-fatal, since some servers offer * multiple namingContexts entries. We will just @@ -952,29 +952,29 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, if (ret != EOK) { switch (ret) { case ENOENT: - DEBUG(1, ("%s configured but not found in rootdse!\n", - opts->gen_map[SDAP_AT_LAST_USN].opt_name)); + DEBUG(1, "%s configured but not found in rootdse!\n", + opts->gen_map[SDAP_AT_LAST_USN].opt_name); break; case ERANGE: - DEBUG(1, ("Multiple values of %s found in rootdse!\n", - opts->gen_map[SDAP_AT_LAST_USN].opt_name)); + DEBUG(1, "Multiple values of %s found in rootdse!\n", + opts->gen_map[SDAP_AT_LAST_USN].opt_name); break; default: - DEBUG(1, ("Unkown error (%d) checking rootdse!\n", ret)); + DEBUG(1, "Unkown error (%d) checking rootdse!\n", ret); } } else { if (!entry_usn_name) { - DEBUG(1, ("%s found in rootdse but %s is not set!\n", + DEBUG(1, "%s found in rootdse but %s is not set!\n", last_usn_name, - opts->gen_map[SDAP_AT_ENTRY_USN].opt_name)); + opts->gen_map[SDAP_AT_ENTRY_USN].opt_name); } else { so->supports_usn = true; so->last_usn = strtoul(last_usn_value, &endptr, 10); if (endptr != NULL && (*endptr != '\0' || endptr == last_usn_value)) { - DEBUG(3, ("USN is not valid (value: %s)\n", last_usn_value)); + DEBUG(3, "USN is not valid (value: %s)\n", last_usn_value); so->last_usn = 0; } else { - DEBUG(9, ("USN value: %s (int: %lu)\n", last_usn_value, so->last_usn)); + DEBUG(9, "USN value: %s (int: %lu)\n", last_usn_value, so->last_usn); } } } @@ -993,10 +993,10 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, so->supports_usn = true; so->last_usn = strtoul(last_usn_value, &endptr, 10); if (endptr != NULL && (*endptr != '\0' || endptr == last_usn_value)) { - DEBUG(3, ("USN is not valid (value: %s)\n", last_usn_value)); + DEBUG(3, "USN is not valid (value: %s)\n", last_usn_value); so->last_usn = 0; } else { - DEBUG(9, ("USN value: %s (int: %lu)\n", last_usn_value, so->last_usn)); + DEBUG(9, "USN value: %s (int: %lu)\n", last_usn_value, so->last_usn); } last_usn_name = usn_attrs[i].last_name; break; @@ -1018,26 +1018,26 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, case DS_BEHAVIOR_WIN2012: opts->dc_functional_level = dc_level; DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting AD compatibility level to [%d]\n", - opts->dc_functional_level)); + "Setting AD compatibility level to [%d]\n", + opts->dc_functional_level); break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Received invalid value for AD compatibility level. " - "Continuing without AD performance enhancements\n")); + "Received invalid value for AD compatibility level. " + "Continuing without AD performance enhancements\n"); } } else if (ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error detecting Active Directory compatibility level " + "Error detecting Active Directory compatibility level " "(%s). Continuing without AD performance enhancements\n", - strerror(ret))); + strerror(ret)); } } if (!last_usn_name) { - DEBUG(5, ("No known USN scheme is supported by this server!\n")); + DEBUG(5, "No known USN scheme is supported by this server!\n"); if (!entry_usn_name) { - DEBUG(5, ("Will use modification timestamp as usn!\n")); + DEBUG(5, "Will use modification timestamp as usn!\n"); opts->gen_map[SDAP_AT_ENTRY_USN].name = talloc_strdup(opts->gen_map, "modifyTimestamp"); } @@ -1168,11 +1168,11 @@ int sdap_control_create(struct sdap_handle *sh, const char *oid, int iscritical, if (sdap_is_control_supported(sh, oid)) { ret = sss_ldap_control_create(oid, iscritical, value, dupval, ctrlp); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("sss_ldap_control_create failed [%d][%s].\n", - ret, sss_ldap_err2string(ret))); + DEBUG(1, "sss_ldap_control_create failed [%d][%s].\n", + ret, sss_ldap_err2string(ret)); } } else { - DEBUG(3, ("Server does not support the requested control [%s].\n", oid)); + DEBUG(3, "Server does not support the requested control [%s].\n", oid); ret = LDAP_NOT_SUPPORTED; } @@ -1189,13 +1189,13 @@ int sdap_replace_id(struct sysdb_attrs *entry, const char *attr, id_t val) if (ret == ENOENT) { return sysdb_attrs_add_uint32(entry, attr, val); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get attribute [%s]\n", attr)); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get attribute [%s]\n", attr); return ret; } if (el->num_values != 1) { DEBUG(SSSDBG_OP_FAILURE, - ("Expected 1 value for %s, got %d\n", attr, el->num_values)); + "Expected 1 value for %s, got %d\n", attr, el->num_values); return EINVAL; } @@ -1223,17 +1223,17 @@ sdap_get_primary_name(TALLOC_CTX *memctx, ret = sysdb_attrs_primary_name(dom->sysdb, attrs, attr_name, &orig_name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The object has no name attribute\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The object has no name attribute\n"); return EINVAL; } name = sss_get_domain_name(memctx, orig_name, dom); if (name == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to format original name [%s]\n", orig_name)); + "Failed to format original name [%s]\n", orig_name); return ENOMEM; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing object %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing object %s\n", name); *_primary_name = name; return EOK; diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index e361cc33e..8addbdd18 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -91,7 +91,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_access_req_ctx); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; } @@ -103,10 +103,10 @@ sdap_access_send(TALLOC_CTX *mem_ctx, state->conn = conn; state->current_rule = 0; - DEBUG(6, ("Performing access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing access check for user [%s]\n", pd->user); if (access_ctx->access_rule[0] == LDAP_ACCESS_EMPTY) { - DEBUG(3, ("No access rules defined, access denied.\n")); + DEBUG(3, "No access rules defined, access denied.\n"); ret = ERR_ACCESS_DENIED; goto done; } @@ -129,7 +129,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx, } if (res->count != 1) { - DEBUG(1, ("Invalid response from sysdb_get_user_attr\n")); + DEBUG(1, "Invalid response from sysdb_get_user_attr\n"); ret = EINVAL; goto done; } @@ -172,7 +172,7 @@ static errno_t check_next_rule(struct sdap_access_req_ctx *state, state->pd->user, state->user_entry); if (subreq == NULL) { - DEBUG(1, ("sdap_access_filter_send failed.\n")); + DEBUG(1, "sdap_access_filter_send failed.\n"); return ENOMEM; } @@ -193,7 +193,7 @@ static errno_t check_next_rule(struct sdap_access_req_ctx *state, break; default: - DEBUG(1, ("Unexpected access rule type. Access denied.\n")); + DEBUG(1, "Unexpected access rule type. Access denied.\n"); ret = ERR_ACCESS_DENIED; } @@ -213,7 +213,7 @@ static void sdap_access_filter_done(struct tevent_req *subreq) ret = sdap_access_filter_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error retrieving access check result.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error retrieving access check result.\n"); tevent_req_error(req, ret); return; } @@ -251,17 +251,17 @@ static errno_t sdap_account_expired_shadow(struct pam_data *pd, long sp_expire; long today; - DEBUG(6, ("Performing access shadow check for user [%s]\n", pd->user)); + DEBUG(6, "Performing access shadow check for user [%s]\n", pd->user); val = ldb_msg_find_attr_as_string(user_entry, SYSDB_SHADOWPW_EXPIRE, NULL); if (val == NULL) { - DEBUG(3, ("Shadow expire attribute not found. " - "Access will be granted.\n")); + DEBUG(3, "Shadow expire attribute not found. " + "Access will be granted.\n"); return EOK; } ret = string_to_shadowpw_days(val, &sp_expire); if (ret != EOK) { - DEBUG(1, ("Failed to retrieve shadow expire date.\n")); + DEBUG(1, "Failed to retrieve shadow expire date.\n"); return ret; } @@ -272,7 +272,7 @@ static errno_t sdap_account_expired_shadow(struct pam_data *pd, sizeof(SHADOW_EXPIRE_MSG), (const uint8_t *) SHADOW_EXPIRE_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCOUNT_EXPIRED; @@ -300,7 +300,7 @@ static bool ad_account_expired(uint64_t expiration_time) now = time(NULL); if (now == ((time_t) -1)) { err = errno; - DEBUG(1, ("time failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "time failed [%d][%s].\n", err, strerror(err)); return true; } @@ -321,18 +321,18 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, uint64_t expiration_time; int ret; - DEBUG(6, ("Performing AD access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing AD access check for user [%s]\n", pd->user); uac = ldb_msg_find_attr_as_uint(user_entry, SYSDB_AD_USER_ACCOUNT_CONTROL, 0); - DEBUG(9, ("User account control for user [%s] is [%X].\n", - pd->user, uac)); + DEBUG(9, "User account control for user [%s] is [%X].\n", + pd->user, uac); expiration_time = ldb_msg_find_attr_as_uint64(user_entry, SYSDB_AD_ACCOUNT_EXPIRES, 0); DEBUG(SSSDBG_TRACE_ALL, - ("Expiration time for user [%s] is [%"PRIu64"].\n", - pd->user, expiration_time)); + "Expiration time for user [%s] is [%"PRIu64"].\n", + pd->user, expiration_time); if (uac & UAC_ACCOUNTDISABLE) { @@ -340,7 +340,7 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, sizeof(AD_DISABLE_MESSAGE), (const uint8_t *) AD_DISABLE_MESSAGE); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -351,7 +351,7 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, sizeof(AD_EXPIRED_MESSAGE), (const uint8_t *) AD_EXPIRED_MESSAGE); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCOUNT_EXPIRED; @@ -368,18 +368,18 @@ static errno_t sdap_account_expired_rhds(struct pam_data *pd, bool locked; int ret; - DEBUG(6, ("Performing RHDS access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing RHDS access check for user [%s]\n", pd->user); locked = ldb_msg_find_attr_as_bool(user_entry, SYSDB_NS_ACCOUNT_LOCK, false); - DEBUG(9, ("Account for user [%s] is%s locked.\n", pd->user, - locked ? "" : " not" )); + DEBUG(9, "Account for user [%s] is%s locked.\n", pd->user, + locked ? "" : " not" ); if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(RHDS_LOCK_MSG), (const uint8_t *) RHDS_LOCK_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -400,7 +400,7 @@ static bool nds_check_expired(const char *exp_time_str) time_t now; if (exp_time_str == NULL) { - DEBUG(9, ("ndsLoginExpirationTime is not set, access granted.\n")); + DEBUG(9, "ndsLoginExpirationTime is not set, access granted.\n"); return false; } @@ -408,18 +408,18 @@ static bool nds_check_expired(const char *exp_time_str) end = strptime(exp_time_str, "%Y%m%d%H%M%SZ", &tm); if (end == NULL) { - DEBUG(1, ("NDS expire date [%s] invalid.\n", exp_time_str)); + DEBUG(1, "NDS expire date [%s] invalid.\n", exp_time_str); return true; } if (*end != '\0') { - DEBUG(1, ("NDS expire date [%s] contains extra characters.\n", - exp_time_str)); + DEBUG(1, "NDS expire date [%s] contains extra characters.\n", + exp_time_str); return true; } expire_time = mktime(&tm); if (expire_time == -1) { - DEBUG(1, ("mktime failed to convert [%s].\n", exp_time_str)); + DEBUG(1, "mktime failed to convert [%s].\n", exp_time_str); return true; } @@ -427,12 +427,12 @@ static bool nds_check_expired(const char *exp_time_str) expire_time -= timezone; now = time(NULL); DEBUG(SSSDBG_TRACE_ALL, - ("Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " + "Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " "daylight [%d] now [%ld] expire_time [%ld].\n", tzname[0], - tzname[1], timezone, daylight, now, expire_time)); + tzname[1], timezone, daylight, now, expire_time); if (difftime(now, expire_time) > 0.0) { - DEBUG(4, ("NDS account expired.\n")); + DEBUG(4, "NDS account expired.\n"); return true; } @@ -452,14 +452,14 @@ static bool nds_check_time_map(const struct ldb_val *time_map) uint8_t mask = 0; if (time_map == NULL) { - DEBUG(9, ("loginAllowedTimeMap is missing, access granted.\n")); + DEBUG(9, "loginAllowedTimeMap is missing, access granted.\n"); return false; } if (time_map->length != 42) { DEBUG(SSSDBG_FUNC_DATA, - ("Allowed time map has the wrong size, " - "got [%zu], expected 42.\n", time_map->length)); + "Allowed time map has the wrong size, " + "got [%zu], expected 42.\n", time_map->length); return true; } @@ -471,7 +471,7 @@ static bool nds_check_time_map(const struct ldb_val *time_map) if (map_index > 335) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected index value [%zu] for time map.\n", map_index)); + "Unexpected index value [%zu] for time map.\n", map_index); return true; } @@ -479,8 +479,8 @@ static bool nds_check_time_map(const struct ldb_val *time_map) if (q.quot > 41 || q.quot < 0 || q.rem > 7 || q.rem < 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected result of div(), [%zu][%d][%d].\n", - map_index, q.quot, q.rem)); + "Unexpected result of div(), [%zu][%d][%d].\n", + map_index, q.quot, q.rem); return true; } @@ -489,7 +489,7 @@ static bool nds_check_time_map(const struct ldb_val *time_map) } if (time_map->data[q.quot] & mask) { - DEBUG(4, ("Access allowed by time map.\n")); + DEBUG(4, "Access allowed by time map.\n"); return false; } @@ -504,19 +504,19 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd, const char *exp_time_str; const struct ldb_val *time_map; - DEBUG(6, ("Performing NDS access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing NDS access check for user [%s]\n", pd->user); locked = ldb_msg_find_attr_as_bool(user_entry, SYSDB_NDS_LOGIN_DISABLED, false); - DEBUG(9, ("Account for user [%s] is%s disabled.\n", pd->user, - locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s disabled.\n", pd->user, + locked ? "" : " not"); if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_DISABLE_MSG), (const uint8_t *) NDS_DISABLE_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -527,15 +527,15 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd, NULL); locked = nds_check_expired(exp_time_str); - DEBUG(9, ("Account for user [%s] is%s expired.\n", pd->user, - locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s expired.\n", pd->user, + locked ? "" : " not"); if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_EXPIRED_MSG), (const uint8_t *) NDS_EXPIRED_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -546,15 +546,15 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd, locked = nds_check_time_map(time_map); - DEBUG(9, ("Account for user [%s] is%s locked at this time.\n", - pd->user, locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s locked at this time.\n", + pd->user, locked ? "" : " not"); if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_TIME_MAP_MSG), (const uint8_t *) NDS_TIME_MAP_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -576,34 +576,34 @@ static errno_t sdap_account_expired(struct sdap_access_ctx *access_ctx, expire = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCOUNT_EXPIRE_POLICY); if (expire == NULL) { - DEBUG(1, ("Missing account expire policy. Access denied\n")); + DEBUG(1, "Missing account expire policy. Access denied\n"); return ERR_ACCESS_DENIED; } else { if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_SHADOW) == 0) { ret = sdap_account_expired_shadow(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_shadow failed.\n")); + DEBUG(1, "sdap_account_expired_shadow failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_AD) == 0) { ret = sdap_account_expired_ad(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_ad failed.\n")); + DEBUG(1, "sdap_account_expired_ad failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_RHDS) == 0 || strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_IPA) == 0 || strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_389DS) == 0) { ret = sdap_account_expired_rhds(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_rhds failed.\n")); + DEBUG(1, "sdap_account_expired_rhds failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_NDS) == 0) { ret = sdap_account_expired_nds(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_nds failed.\n")); + DEBUG(1, "sdap_account_expired_nds failed.\n"); } } else { - DEBUG(1, ("Unsupported LDAP account expire policy [%s]. " - "Access denied.\n", expire)); + DEBUG(1, "Unsupported LDAP account expire policy [%s]. " + "Access denied.\n", expire); ret = ERR_ACCESS_DENIED; } } @@ -653,7 +653,7 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, if (access_ctx->filter == NULL || *access_ctx->filter == '\0') { /* If no filter is set, default to restrictive */ - DEBUG(6, ("No filter set. Access is denied.\n")); + DEBUG(6, "No filter set. Access is denied.\n"); ret = ERR_ACCESS_DENIED; goto done; } @@ -666,7 +666,7 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, state->access_ctx = access_ctx; state->domain = domain; - DEBUG(6, ("Performing access filter check for user [%s]\n", username)); + DEBUG(6, "Performing access filter check for user [%s]\n", username); state->cached_access = ldb_msg_find_attr_as_bool(user_entry, SYSDB_LDAP_ACCESS_FILTER, @@ -681,15 +681,15 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, /* Perform online operation */ basedn = ldb_msg_find_attr_as_string(user_entry, SYSDB_ORIG_DN, NULL); if (basedn == NULL) { - DEBUG(1,("Could not find originalDN for user [%s]\n", - state->username)); + DEBUG(1,"Could not find originalDN for user [%s]\n", + state->username); ret = EINVAL; goto done; } state->basedn = talloc_strdup(state, basedn); if (state->basedn == NULL) { - DEBUG(1, ("Could not allocate memory for originalDN\n")); + DEBUG(1, "Could not allocate memory for originalDN\n"); ret = ENOMEM; goto done; } @@ -699,8 +699,8 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, ret = sss_parse_name(state, domain->names, username, &domname, &name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not parse [%s] into name and " - "domain components, access might fail\n", username)); + "Could not parse [%s] into name and " + "domain components, access might fail\n", username); name = discard_const(username); } @@ -717,18 +717,18 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, state->opts->user_map[SDAP_OC_USER].name, state->access_ctx->filter); if (state->filter == NULL) { - DEBUG(0, ("Could not construct access filter\n")); + DEBUG(0, "Could not construct access filter\n"); ret = ENOMEM; goto done; } talloc_zfree(clean_username); - DEBUG(6, ("Checking filter against LDAP\n")); + DEBUG(6, "Checking filter against LDAP\n"); state->sdap_op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->sdap_op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto done; } @@ -756,10 +756,10 @@ static errno_t sdap_access_filter_decide_offline(struct tevent_req *req) tevent_req_data(req, struct sdap_access_filter_req_ctx); if (state->cached_access) { - DEBUG(6, ("Access granted by cached credentials\n")); + DEBUG(6, "Access granted by cached credentials\n"); return EOK; } else { - DEBUG(6, ("Access denied by cached credentials\n")); + DEBUG(6, "Access denied by cached credentials\n"); return ERR_ACCESS_DENIED; } } @@ -773,7 +773,7 @@ static int sdap_access_filter_retry(struct tevent_req *req) subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (!subreq) { - DEBUG(2, ("sdap_id_op_connect_send failed: %d (%s)\n", ret, strerror(ret))); + DEBUG(2, "sdap_id_op_connect_send failed: %d (%s)\n", ret, strerror(ret)); return ret; } @@ -820,7 +820,7 @@ static void sdap_access_filter_connect_done(struct tevent_req *subreq) SDAP_SEARCH_TIMEOUT), false); if (subreq == NULL) { - DEBUG(1, ("Could not start LDAP communication\n")); + DEBUG(1, "Could not start LDAP communication\n"); tevent_req_error(req, EIO); return; } @@ -858,11 +858,11 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) sss_log(SSS_LOG_ERR, "Malformed access control filter [%s]\n", state->filter); DEBUG(SSSDBG_CRIT_FAILURE, - ("Malformed access control filter [%s]\n", state->filter)); + "Malformed access control filter [%s]\n", state->filter); ret = ERR_ACCESS_DENIED; } else { - DEBUG(1, ("sdap_get_generic_send() returned error [%d][%s]\n", - ret, sss_strerror(ret))); + DEBUG(1, "sdap_get_generic_send() returned error [%d][%s]\n", + ret, sss_strerror(ret)); } goto done; @@ -874,12 +874,12 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) * Anything else is an error */ if (num_results < 1) { - DEBUG(4, ("User [%s] was not found with the specified filter. " - "Denying access.\n", state->username)); + DEBUG(4, "User [%s] was not found with the specified filter. " + "Denying access.\n", state->username); found = false; } else if (results == NULL) { - DEBUG(1, ("num_results > 0, but results is NULL\n")); + DEBUG(1, "num_results > 0, but results is NULL\n"); ret = ERR_INTERNAL; goto done; } @@ -887,7 +887,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* It should not be possible to get more than one reply * here, since we're doing a base-scoped search */ - DEBUG(1, ("Received multiple replies\n")); + DEBUG(1, "Received multiple replies\n"); ret = ERR_INTERNAL; goto done; } @@ -899,21 +899,21 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Save "allow" to the cache for future offline :q* access checks. */ - DEBUG(6, ("Access granted by online lookup\n")); + DEBUG(6, "Access granted by online lookup\n"); ret = EOK; } else { /* Save "disallow" to the cache for future offline * access checks. */ - DEBUG(6, ("Access denied by online lookup\n")); + DEBUG(6, "Access denied by online lookup\n"); ret = ERR_ACCESS_DENIED; } attrs = sysdb_new_attrs(state); if (attrs == NULL) { ret = ENOMEM; - DEBUG(1, ("Could not set up attrs\n")); + DEBUG(1, "Could not set up attrs\n"); goto done; } @@ -923,7 +923,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Failing to save to the cache is non-fatal. * Just return the result. */ - DEBUG(1, ("Could not set up attrs\n")); + DEBUG(1, "Could not set up attrs\n"); goto done; } @@ -933,7 +933,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Failing to save to the cache is non-fatal. * Just return the result. */ - DEBUG(1, ("Failed to set user access attribute\n")); + DEBUG(1, "Failed to set user access attribute\n"); goto done; } @@ -970,13 +970,13 @@ static errno_t sdap_access_service(struct pam_data *pd, el = ldb_msg_find_element(user_entry, SYSDB_AUTHORIZED_SERVICE); if (!el || el->num_values == 0) { - DEBUG(1, ("Missing authorized services. Access denied\n")); + DEBUG(1, "Missing authorized services. Access denied\n"); tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_MISSING_MSG), (const uint8_t *) AUTHR_SRV_MISSING_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } return ERR_ACCESS_DENIED; @@ -989,13 +989,13 @@ static errno_t sdap_access_service(struct pam_data *pd, if (service[0] == '!' && strcasecmp(pd->service, service+1) == 0) { /* This service is explicitly denied */ - DEBUG(4, ("Access denied by [%s]\n", service)); + DEBUG(4, "Access denied by [%s]\n", service); tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_DENY_MSG), (const uint8_t *) AUTHR_SRV_DENY_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } /* A denial trumps all. Break here */ @@ -1003,14 +1003,14 @@ static errno_t sdap_access_service(struct pam_data *pd, } else if (strcasecmp(pd->service, service) == 0) { /* This service is explicitly allowed */ - DEBUG(4, ("Access granted for [%s]\n", service)); + DEBUG(4, "Access granted for [%s]\n", service); /* We still need to loop through to make sure * that it's not also explicitly denied */ ret = EOK; } else if (strcmp("*", service) == 0) { /* This user has access to all services */ - DEBUG(4, ("Access granted to all services\n")); + DEBUG(4, "Access granted to all services\n"); /* We still need to loop through to make sure * that it's not also explicitly denied */ @@ -1019,13 +1019,13 @@ static errno_t sdap_access_service(struct pam_data *pd, } if (ret == ENOENT) { - DEBUG(4, ("No matching service rule found\n")); + DEBUG(4, "No matching service rule found\n"); tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_NO_MATCH_MSG), (const uint8_t *) AUTHR_SRV_NO_MATCH_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } ret = ERR_ACCESS_DENIED; @@ -1044,12 +1044,12 @@ static errno_t sdap_access_host(struct ldb_message *user_entry) el = ldb_msg_find_element(user_entry, SYSDB_AUTHORIZED_HOST); if (!el || el->num_values == 0) { - DEBUG(1, ("Missing hosts. Access denied\n")); + DEBUG(1, "Missing hosts. Access denied\n"); return ERR_ACCESS_DENIED; } if (gethostname(hostname, sizeof(hostname)) == -1) { - DEBUG(1, ("Unable to get system hostname. Access denied\n")); + DEBUG(1, "Unable to get system hostname. Access denied\n"); return ERR_ACCESS_DENIED; } @@ -1066,20 +1066,20 @@ static errno_t sdap_access_host(struct ldb_message *user_entry) if (host[0] == '!' && strcasecmp(hostname, host+1) == 0) { /* This host is explicitly denied */ - DEBUG(4, ("Access denied by [%s]\n", host)); + DEBUG(4, "Access denied by [%s]\n", host); /* A denial trumps all. Break here */ return ERR_ACCESS_DENIED; } else if (strcasecmp(hostname, host) == 0) { /* This host is explicitly allowed */ - DEBUG(4, ("Access granted for [%s]\n", host)); + DEBUG(4, "Access granted for [%s]\n", host); /* We still need to loop through to make sure * that it's not also explicitly denied */ ret = EOK; } else if (strcmp("*", host) == 0) { /* This user has access to all hosts */ - DEBUG(4, ("Access granted to all hosts\n")); + DEBUG(4, "Access granted to all hosts\n"); /* We still need to loop through to make sure * that it's not also explicitly denied */ @@ -1088,7 +1088,7 @@ static errno_t sdap_access_host(struct ldb_message *user_entry) } if (ret == ENOENT) { - DEBUG(4, ("No matching host rule found\n")); + DEBUG(4, "No matching host rule found\n"); ret = ERR_ACCESS_DENIED; } diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index 1022a093f..b6ba90744 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -33,7 +33,7 @@ void make_realm_upper_case(const char *upn) c = strchr(upn, REALM_SEPARATOR); if (c == NULL) { - DEBUG(9, ("No realm delimiter found in upn [%s].\n", upn)); + DEBUG(9, "No realm delimiter found in upn [%s].\n", upn); return; } @@ -100,10 +100,10 @@ static void sdap_handle_release(struct sdap_handle *sh) { struct sdap_op *op; - DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], ldap[%p], " + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], ldap[%p], " "destructor_lock[%d], release_memory[%d]\n", sh, (int)sh->connected, sh->ops, sh->ldap, - (int)sh->destructor_lock, (int)sh->release_memory)); + (int)sh->destructor_lock, (int)sh->release_memory); if (sh->destructor_lock) return; sh->destructor_lock = true; @@ -168,11 +168,11 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt) LDAPMessage *msg; int ret; - DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], ldap[%p]\n", - sh, (int)sh->connected, sh->ops, sh->ldap)); + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], ldap[%p]\n", + sh, (int)sh->connected, sh->ops, sh->ldap); if (!sh->connected || !sh->ldap) { - DEBUG(2, ("ERROR: LDAP connection is not connected!\n")); + DEBUG(2, "ERROR: LDAP connection is not connected!\n"); sdap_handle_release(sh); return; } @@ -181,14 +181,14 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt) if (ret == 0) { /* this almost always means we have reached the end of * the list of received messages */ - DEBUG(8, ("Trace: ldap_result found nothing!\n")); + DEBUG(8, "Trace: ldap_result found nothing!\n"); return; } if (ret == -1) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &ret); DEBUG(SSSDBG_OP_FAILURE, - ("ldap_result error: [%s]\n", ldap_err2string(ret))); + "ldap_result error: [%s]\n", ldap_err2string(ret)); sdap_handle_release(sh); return; } @@ -203,7 +203,7 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt) te = tevent_add_timer(ev, sh, no_timeout, sdap_ldap_next_result, sh); if (!te) { - DEBUG(1, ("Failed to add critical timer to fetch next result!\n")); + DEBUG(1, "Failed to add critical timer to fetch next result!\n"); } /* now process this message */ @@ -281,7 +281,7 @@ static void sdap_process_message(struct tevent_context *ev, msgid = ldap_msgid(msg); if (msgid == -1) { - DEBUG(2, ("can't fire callback, message id invalid!\n")); + DEBUG(2, "can't fire callback, message id invalid!\n"); ldap_msgfree(msg); return; } @@ -293,20 +293,20 @@ static void sdap_process_message(struct tevent_context *ev, } if (op == NULL) { - DEBUG(2, ("Unmatched msgid, discarding message (type: %0x)\n", - msgtype)); + DEBUG(2, "Unmatched msgid, discarding message (type: %0x)\n", + msgtype); ldap_msgfree(msg); return; } /* shouldn't happen */ if (op->done) { - DEBUG(2, ("Operation [%p] already handled (type: %0x)\n", op, msgtype)); + DEBUG(2, "Operation [%p] already handled (type: %0x)\n", op, msgtype); ldap_msgfree(msg); return; } - DEBUG(9, ("Message type: [%s]\n", sdap_ldap_result_str(msgtype))); + DEBUG(9, "Message type: [%s]\n", sdap_ldap_result_str(msgtype)); switch (msgtype) { case LDAP_RES_SEARCH_ENTRY: @@ -334,7 +334,7 @@ static void sdap_process_message(struct tevent_context *ev, default: /* unkwon msg type ?? */ - DEBUG(1, ("Couldn't figure out the msg type! [%0x]\n", msgtype)); + DEBUG(1, "Couldn't figure out the msg type! [%0x]\n", msgtype); ldap_msgfree(msg); return; } @@ -395,7 +395,7 @@ static void sdap_unlock_next_reply(struct sdap_op *op) te = tevent_add_timer(op->ev, op, tv, sdap_process_next_reply, op); if (!te) { - DEBUG(1, ("Failed to add critical timer for next reply!\n")); + DEBUG(1, "Failed to add critical timer for next reply!\n"); op->callback(op, NULL, EFAULT, op->data); } } @@ -435,7 +435,7 @@ static void sdap_op_timeout(struct tevent_req *req) /* should never happen, but just in case */ if (op->done) { - DEBUG(2, ("Timeout happened after op was finished !?\n")); + DEBUG(2, "Timeout happened after op was finished !?\n"); return; } @@ -523,7 +523,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, ber = ber_alloc_t( LBER_USE_DER ); if (ber == NULL) { - DEBUG(7, ("ber_alloc_t failed.\n")); + DEBUG(7, "ber_alloc_t failed.\n"); talloc_zfree(req); return NULL; } @@ -533,7 +533,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, LDAP_TAG_EXOP_MODIFY_PASSWD_OLD, password, LDAP_TAG_EXOP_MODIFY_PASSWD_NEW, new_password); if (ret == -1) { - DEBUG(1, ("ber_printf failed.\n")); + DEBUG(1, "ber_printf failed.\n"); ber_free(ber, 1); talloc_zfree(req); return NULL; @@ -542,7 +542,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, ret = ber_flatten(ber, &bv); ber_free(ber, 1); if (ret == -1) { - DEBUG(1, ("ber_flatten failed.\n")); + DEBUG(1, "ber_flatten failed.\n"); talloc_zfree(req); return NULL; } @@ -550,31 +550,31 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, ret = sdap_control_create(state->sh, LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sdap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sdap_control_create failed to create " + "Password Policy control.\n"); ret = ERR_INTERNAL; goto fail; } request_controls = ctrls; - DEBUG(4, ("Executing extended operation\n")); + DEBUG(4, "Executing extended operation\n"); ret = ldap_extended_operation(state->sh->ldap, LDAP_EXOP_MODIFY_PASSWD, bv, request_controls, NULL, &msgid); ber_bvfree(bv); if (ctrls[0]) ldap_control_free(ctrls[0]); if (ret == -1 || msgid == -1) { - DEBUG(1, ("ldap_extended_operation failed\n")); + DEBUG(1, "ldap_extended_operation failed\n"); ret = ERR_NETWORK_IO; goto fail; } - DEBUG(8, ("ldap_extended_operation sent, msgid = %d\n", msgid)); + DEBUG(8, "ldap_extended_operation sent, msgid = %d\n", msgid); /* FIXME: get timeouts from configuration, for now 5 secs. */ ret = sdap_op_add(state, ev, state->sh, msgid, sdap_exop_modify_passwd_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); ret = ERR_INTERNAL; goto fail; } @@ -612,17 +612,17 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, &response_controls, 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); ret = ERR_INTERNAL; goto done; } if (response_controls == NULL) { - DEBUG(5, ("Server returned no controls.\n")); + DEBUG(5, "Server returned no controls.\n"); } else { for (c = 0; response_controls[c] != NULL; c++) { - DEBUG(9, ("Server returned control [%s].\n", - response_controls[c]->ldctl_oid)); + DEBUG(9, "Server returned control [%s].\n", + response_controls[c]->ldctl_oid); if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) { ret = ldap_parse_passwordpolicy_control(state->sh->ldap, @@ -630,20 +630,20 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, &pp_expire, &pp_grace, &pp_error); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_parse_passwordpolicy_control failed.\n")); + DEBUG(1, "ldap_parse_passwordpolicy_control failed.\n"); ret = ERR_NETWORK_IO; 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)); } } } - DEBUG(3, ("ldap_extended_operation result: %s(%d), %s\n", - sss_ldap_err2string(result), result, errmsg)); + DEBUG(3, "ldap_extended_operation result: %s(%d), %s\n", + sss_ldap_err2string(result), result, errmsg); switch (result) { case LDAP_SUCCESS: @@ -653,7 +653,7 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, state->user_error_message = talloc_strdup(state, "Please make sure the password meets the complexity constraints."); if (state->user_error_message == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed\n"); ret = ENOMEM; goto done; } @@ -664,7 +664,7 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, if (errmsg) { state->user_error_message = talloc_strdup(state, errmsg); if (state->user_error_message == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -763,14 +763,14 @@ sdap_modify_shadow_lastchange_send(TALLOC_CTX *mem_ctx, ret = ldap_modify_ext(state->sh->ldap, state->dn, state->mods, NULL, NULL, &msgid); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to send operation!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to send operation!\n"); goto done; } ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_modify_shadow_lastchange_done, req, 5, &state->op); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set up operation!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set up operation!\n"); goto done; } @@ -803,15 +803,15 @@ static void sdap_modify_shadow_lastchange_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, NULL, 0); if (lret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_result failed (%d)\n", - state->op->msgid)); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed (%d)\n", + state->op->msgid); ret = EIO; goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Updating lastPwdChange result: %s(%d), %s\n", + DEBUG(SSSDBG_TRACE_LIBS, "Updating lastPwdChange result: %s(%d), %s\n", sss_ldap_err2string(result), - result, errmsg)); + result, errmsg); done: ldap_memfree(errmsg); @@ -866,7 +866,7 @@ struct tevent_req *sdap_get_rootdse_send(TALLOC_CTX *memctx, NULL }; - DEBUG(9, ("Getting rootdse\n")); + DEBUG(9, "Getting rootdse\n"); req = tevent_req_create(memctx, &state, struct sdap_get_rootdse_state); if (!req) return NULL; @@ -916,15 +916,15 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) } if (num_results == 0 || !results) { - DEBUG(2, ("RootDSE could not be retrieved. " + DEBUG(2, "RootDSE could not be retrieved. " "Please check that anonymous access to RootDSE is allowed\n" - )); + ); tevent_req_error(req, ENOENT); return; } if (num_results > 1) { - DEBUG(2, ("Multiple replies when searching for RootDSE ??\n")); + DEBUG(2, "Multiple replies when searching for RootDSE ??\n"); tevent_req_error(req, EIO); return; } @@ -932,7 +932,7 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) state->rootdse = talloc_steal(state, results[0]); talloc_zfree(results); - DEBUG(SSSDBG_TRACE_INTERNAL, ("Got rootdse\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Got rootdse\n"); /* Auto-detect the ldap matching rule if requested */ if ((!dp_opt_get_bool(state->opts->basic, @@ -944,13 +944,13 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) * lookup. */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Skipping auto-detection of match rule\n")); + "Skipping auto-detection of match rule\n"); tevent_req_done(req); return; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Auto-detecting support for match rule\n")); + "Auto-detecting support for match rule\n"); /* Create a filter using the matching rule. It need not point * at any valid data. We're only going to be looking for the @@ -997,16 +997,16 @@ static void sdap_get_matching_rule_done(struct tevent_req *subreq) state->opts->support_matching_rule = false; } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unexpected error while testing for matching rule support\n")); + "Unexpected error while testing for matching rule support\n"); tevent_req_error(req, ret); return; } DEBUG(SSSDBG_CONF_SETTINGS, - ("LDAP server %s the matching rule extension\n", + "LDAP server %s the matching rule extension\n", state->opts->support_matching_rule ? "supports" - : "does not support")); + : "does not support"); tevent_req_done(req); } @@ -1042,7 +1042,7 @@ static errno_t add_to_reply(TALLOC_CTX *mem_ctx, struct sysdb_attrs *, sreply->reply_max); if (sreply->reply == NULL) { - DEBUG(1, ("talloc_realloc failed.\n")); + DEBUG(1, "talloc_realloc failed.\n"); return ENOMEM; } } @@ -1075,7 +1075,7 @@ static errno_t add_to_deref_reply(TALLOC_CTX *mem_ctx, struct sdap_deref_attrs *, dreply->reply_max); if (dreply->reply == NULL) { - DEBUG(1, ("talloc_realloc failed.\n")); + DEBUG(1, "talloc_realloc failed.\n"); return ENOMEM; } } @@ -1170,7 +1170,7 @@ sdap_get_generic_ext_send(TALLOC_CTX *memctx, if (state->sh == NULL || state->sh->ldap == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Trying LDAP search while not connected.\n")); + "Trying LDAP search while not connected.\n"); tevent_req_error(req, EIO); tevent_req_post(req, ev); return req; @@ -1252,15 +1252,15 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) talloc_zfree(state->op); DEBUG(SSSDBG_TRACE_FUNC, - ("calling ldap_search_ext with [%s][%s].\n", + "calling ldap_search_ext with [%s][%s].\n", state->filter ? state->filter : "no filter", - state->search_base)); + state->search_base); if (DEBUG_IS_SET(SSSDBG_TRACE_LIBS)) { int i; if (state->attrs) { for (i = 0; state->attrs[i]; i++) { - DEBUG(7, ("Requesting attrs: [%s]\n", state->attrs[i])); + DEBUG(7, "Requesting attrs: [%s]\n", state->attrs[i]); } } } @@ -1294,13 +1294,13 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) ldap_control_free(page_control); state->serverctrls[state->nserverctrls] = NULL; if (lret != LDAP_SUCCESS) { - DEBUG(3, ("ldap_search_ext failed: %s\n", sss_ldap_err2string(lret))); + DEBUG(3, "ldap_search_ext failed: %s\n", sss_ldap_err2string(lret)); if (lret == LDAP_SERVER_DOWN) { ret = ETIMEDOUT; optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &errmsg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("Connection error: %s\n", errmsg)); + DEBUG(3, "Connection error: %s\n", errmsg); sss_log(SSS_LOG_ERR, "LDAP connection error: %s", errmsg); } else { @@ -1314,14 +1314,14 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) } goto done; } - DEBUG(8, ("ldap_search_ext called, msgid = %d\n", msgid)); + DEBUG(8, "ldap_search_ext called, msgid = %d\n", msgid); ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_get_generic_ext_done, req, state->timeout, &state->op); if (ret != EOK) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto done; } @@ -1362,7 +1362,7 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, case LDAP_RES_SEARCH_ENTRY: ret = state->parse_cb(state->sh, reply, state->cb_data); if (ret != EOK) { - DEBUG(1, ("reply parsing callback failed.\n")); + DEBUG(1, "reply parsing callback failed.\n"); tevent_req_error(req, ret); return; } @@ -1375,19 +1375,19 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, &returned_controls, 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(6, ("Search result: %s(%d), %s\n", + DEBUG(6, "Search result: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set"); if (result == LDAP_SIZELIMIT_EXCEEDED) { /* Try to return what we've got */ DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP sizelimit was exceeded, returning incomplete data\n")); + "LDAP sizelimit was exceeded, returning incomplete data\n"); } else if (result == LDAP_INAPPROPRIATE_MATCHING) { /* This error should only occur when we're testing for * specialized functionality like the ldap matching rule @@ -1395,8 +1395,8 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, * level and return EIO. */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("LDAP_INAPPROPRIATE_MATCHING: %s\n", - errmsg ? errmsg : "no errmsg set")); + "LDAP_INAPPROPRIATE_MATCHING: %s\n", + errmsg ? errmsg : "no errmsg set"); ldap_memfree(errmsg); tevent_req_error(req, EIO); return; @@ -1406,9 +1406,9 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, return; } else if (result != LDAP_SUCCESS && result != LDAP_NO_SUCH_OBJECT) { DEBUG(SSSDBG_OP_FAILURE, - ("Unexpected result from ldap: %s(%d), %s\n", + "Unexpected result from ldap: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set"); ldap_memfree(errmsg); tevent_req_error(req, EIO); return; @@ -1428,11 +1428,11 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, &total_count, &cookie); ldap_controls_free(returned_controls); if (lret != LDAP_SUCCESS) { - DEBUG(1, ("Could not determine page control")); + DEBUG(1, "Could not determine page control"); tevent_req_error(req, EIO); return; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Total count [%d]\n", total_count)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Total count [%d]\n", total_count); if (cookie.bv_val != NULL && cookie.bv_len > 0) { /* Cookie contains data, which means there are more requests @@ -1546,14 +1546,14 @@ static errno_t sdap_get_generic_parse_entry(struct sdap_handle *sh, state->map, state->map_num_attrs, &attrs, NULL, disable_range_rtrvl); if (ret != EOK) { - DEBUG(3, ("sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(3, "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret)); return ret; } ret = add_to_reply(state, &state->sreply, attrs); if (ret != EOK) { talloc_free(attrs); - DEBUG(1, ("add_to_reply failed.\n")); + DEBUG(1, "add_to_reply failed.\n"); return ret; } @@ -1570,8 +1570,8 @@ static void sdap_get_generic_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -1647,12 +1647,12 @@ sdap_x_deref_search_send(TALLOC_CTX *memctx, struct tevent_context *ev, ret = sdap_x_deref_create_control(sh, deref_attr, attrs, &state->ctrls[0]); if (ret != EOK) { - DEBUG(1, ("Could not create OpenLDAP deref control\n")); + DEBUG(1, "Could not create OpenLDAP deref control\n"); talloc_zfree(req); return NULL; } - DEBUG(6, ("Dereferencing entry [%s] using OpenLDAP deref\n", base_dn)); + DEBUG(6, "Dereferencing entry [%s] using OpenLDAP deref\n", base_dn); subreq = sdap_get_generic_ext_send(state, ev, opts, sh, base_dn, LDAP_SCOPE_BASE, NULL, attrs, false, state->ctrls, NULL, 0, timeout, @@ -1683,8 +1683,8 @@ static int sdap_x_deref_create_control(struct sdap_handle *sh, ret = ldap_create_deref_control_value(sh->ldap, ds, &derefval); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("sss_ldap_control_create failed: %s\n", - ldap_err2string(ret))); + DEBUG(1, "sss_ldap_control_create failed: %s\n", + ldap_err2string(ret)); return ret; } @@ -1692,7 +1692,7 @@ static int sdap_x_deref_create_control(struct sdap_handle *sh, 1, &derefval, 1, ctrl); ldap_memfree(derefval.bv_val); if (ret != EOK) { - DEBUG(1, ("sss_ldap_control_create failed\n")); + DEBUG(1, "sss_ldap_control_create failed\n"); return ret; } @@ -1720,12 +1720,12 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, ret = ldap_get_entry_controls(state->sh->ldap, msg->msg, &ctrls); if (ret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_result failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed\n"); goto done; } if (!ctrls) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No controls found for entry\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No controls found for entry\n"); ret = ENOENT; goto done; } @@ -1734,20 +1734,20 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, derefctrl = ldap_control_find(LDAP_CONTROL_X_DEREF, ctrls, NULL); if (!derefctrl) { - DEBUG(SSSDBG_FUNC_DATA, ("No deref controls found\n")); + DEBUG(SSSDBG_FUNC_DATA, "No deref controls found\n"); ret = EOK; goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Got deref control\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Got deref control\n"); ret = ldap_parse_derefresponse_control(state->sh->ldap, derefctrl, &deref_res); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, - ("ldap_parse_derefresponse_control failed: %s\n", - ldap_err2string(ret))); + "ldap_parse_derefresponse_control failed: %s\n", + ldap_err2string(ret)); goto done; } @@ -1755,21 +1755,21 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, ret = sdap_parse_deref(tmp_ctx, state->maps, state->num_maps, dref, &res); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_parse_deref failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_parse_deref failed [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = add_to_deref_reply(state, state->num_maps, &state->dreply, res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("add_to_deref_reply failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "add_to_deref_reply failed.\n"); goto done; } } DEBUG(SSSDBG_TRACE_FUNC, - ("All deref results from a single control parsed\n")); + "All deref results from a single control parsed\n"); ldap_derefresponse_free(deref_res); deref_res = NULL; @@ -1790,8 +1790,8 @@ static void sdap_x_deref_search_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -1875,11 +1875,11 @@ sdap_asq_search_send(TALLOC_CTX *memctx, struct tevent_context *ev, ret = sdap_asq_search_create_control(sh, deref_attr, &state->ctrls[0]); if (ret != EOK) { talloc_zfree(req); - DEBUG(1, ("Could not create ASQ control\n")); + DEBUG(1, "Could not create ASQ control\n"); return NULL; } - DEBUG(6, ("Dereferencing entry [%s] using ASQ\n", base_dn)); + DEBUG(6, "Dereferencing entry [%s] using ASQ\n", base_dn); subreq = sdap_get_generic_ext_send(state, ev, opts, sh, base_dn, LDAP_SCOPE_BASE, NULL, attrs, false, state->ctrls, NULL, 0, timeout, @@ -1905,13 +1905,13 @@ static int sdap_asq_search_create_control(struct sdap_handle *sh, ber = ber_alloc_t(LBER_USE_DER); if (ber == NULL) { - DEBUG(2, ("ber_alloc_t failed.\n")); + DEBUG(2, "ber_alloc_t failed.\n"); return ENOMEM; } ret = ber_printf(ber, "{s}", attr); if (ret == -1) { - DEBUG(2, ("ber_printf failed.\n")); + DEBUG(2, "ber_printf failed.\n"); ber_free(ber, 1); return EIO; } @@ -1919,14 +1919,14 @@ static int sdap_asq_search_create_control(struct sdap_handle *sh, ret = ber_flatten(ber, &asqval); ber_free(ber, 1); if (ret == -1) { - DEBUG(1, ("ber_flatten failed.\n")); + DEBUG(1, "ber_flatten failed.\n"); return EIO; } ret = sdap_control_create(sh, LDAP_SERVER_ASQ_OID, 1, asqval, 1, ctrl); ber_bvfree(asqval); if (ret != EOK) { - DEBUG(1, ("sdap_control_create failed\n")); + DEBUG(1, "sdap_control_create failed\n"); return ret; } @@ -1988,7 +1988,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, vals = ldap_get_values_len(sh->ldap, msg->msg, "objectClass"); if (!vals) { DEBUG(SSSDBG_OP_FAILURE, - ("Unknown entry type, no objectClass found for DN [%s]!\n", dn)); + "Unknown entry type, no objectClass found for DN [%s]!\n", dn); ret = EINVAL; goto done; } @@ -2000,8 +2000,8 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, vals[i]->bv_val, vals[i]->bv_len) == 0) { /* it's an entry of the right type */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Matched objectclass [%s] on DN [%s], will use associated map\n", - state->maps[mi].map[0].name, dn)); + "Matched objectclass [%s] on DN [%s], will use associated map\n", + state->maps[mi].map[0].name, dn); map = state->maps[mi].map; num_attrs = state->maps[mi].num_attrs; break; @@ -2009,8 +2009,8 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, } if (!map) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("DN [%s] did not match the objectClass [%s]\n", - dn, state->maps[mi].map[0].name)); + "DN [%s] did not match the objectClass [%s]\n", + dn, state->maps[mi].map[0].name); continue; } @@ -2021,7 +2021,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, map, num_attrs, &res[mi]->attrs, NULL, disable_range_rtrvl); if (ret != EOK) { - DEBUG(3, ("sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(3, "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret)); goto done; } } @@ -2030,7 +2030,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, ret = add_to_deref_reply(state, state->num_maps, &state->dreply, res); if (ret != EOK) { - DEBUG(1, ("add_to_deref_reply failed.\n")); + DEBUG(1, "add_to_deref_reply failed.\n"); goto done; } @@ -2049,8 +2049,8 @@ static void sdap_asq_search_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -2163,8 +2163,8 @@ static errno_t sdap_posix_check_next(struct tevent_req *req) tevent_req_data(req, struct sdap_posix_check_state); DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for POSIX attributes with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for POSIX attributes with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_ext_send(state, state->ev, state->opts, state->sh, @@ -2195,10 +2195,10 @@ static errno_t sdap_posix_check_parse(struct sdap_handle *sh, dn = ldap_get_dn(sh->ldap, msg->msg); if (dn == NULL) { DEBUG(SSSDBG_TRACE_LIBS, - ("Search did not find any entry with POSIX attributes\n")); + "Search did not find any entry with POSIX attributes\n"); goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Found [%s] with POSIX attributes\n", dn)); + DEBUG(SSSDBG_TRACE_LIBS, "Found [%s] with POSIX attributes\n", dn); ldap_memfree(dn); vals = ldap_get_values_len(sh->ldap, msg->msg, @@ -2207,13 +2207,13 @@ static errno_t sdap_posix_check_parse(struct sdap_handle *sh, vals = ldap_get_values_len(sh->ldap, msg->msg, state->opts->group_map[SDAP_AT_GROUP_GID].name); if (vals == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("Entry does not have POSIX attrs?\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Entry does not have POSIX attrs?\n"); goto done; } } if (vals[0] == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("No value for POSIX attr\n")); + DEBUG(SSSDBG_TRACE_LIBS, "No value for POSIX attr\n"); goto done; } @@ -2221,7 +2221,7 @@ static errno_t sdap_posix_check_parse(struct sdap_handle *sh, strtouint32(vals[0]->bv_val, &endptr, 10); if (errno || *endptr || (vals[0]->bv_val == endptr)) { DEBUG(SSSDBG_OP_FAILURE, - ("POSIX attribute is not a number: %s\n", vals[0]->bv_val)); + "POSIX attribute is not a number: %s\n", vals[0]->bv_val); goto done; } @@ -2243,15 +2243,15 @@ static void sdap_posix_check_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, strerror(ret))); + "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } /* Positive hit is definitve, no need to search other bases */ if (state->has_posix == true) { - DEBUG(SSSDBG_FUNC_DATA, ("Server has POSIX attributes\n")); + DEBUG(SSSDBG_FUNC_DATA, "Server has POSIX attributes\n"); tevent_req_done(req); return; } @@ -2267,7 +2267,7 @@ static void sdap_posix_check_done(struct tevent_req *subreq) } /* All bases done! */ - DEBUG(SSSDBG_TRACE_LIBS, ("Cycled through all bases\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Cycled through all bases\n"); tevent_req_done(req); } @@ -2322,29 +2322,29 @@ sdap_deref_search_send(TALLOC_CTX *memctx, state->reply = NULL; if (sdap_is_control_supported(sh, LDAP_SERVER_ASQ_OID)) { - DEBUG(8, ("Server supports ASQ\n")); + DEBUG(8, "Server supports ASQ\n"); state->deref_type = SDAP_DEREF_ASQ; subreq = sdap_asq_search_send(state, ev, opts, sh, base_dn, deref_attr, attrs, maps, num_maps, timeout); if (!subreq) { - DEBUG(2, ("Cannot start ASQ search\n")); + DEBUG(2, "Cannot start ASQ search\n"); goto fail; } } else if (sdap_is_control_supported(sh, LDAP_CONTROL_X_DEREF)) { - DEBUG(8, ("Server supports OpenLDAP deref\n")); + DEBUG(8, "Server supports OpenLDAP deref\n"); state->deref_type = SDAP_DEREF_OPENLDAP; subreq = sdap_x_deref_search_send(state, ev, opts, sh, base_dn, deref_attr, attrs, maps, num_maps, timeout); if (!subreq) { - DEBUG(2, ("Cannot start OpenLDAP deref search\n")); + DEBUG(2, "Cannot start OpenLDAP deref search\n"); goto fail; } } else { - DEBUG(2, ("Server does not support any known deref method!\n")); + DEBUG(2, "Server does not support any known deref method!\n"); goto fail; } @@ -2374,14 +2374,14 @@ static void sdap_deref_search_done(struct tevent_req *subreq) &state->reply_count, &state->reply); break; default: - DEBUG(1, ("Unknown deref method\n")); + DEBUG(1, "Unknown deref method\n"); tevent_req_error(req, EINVAL); return; } talloc_zfree(subreq); if (ret != EOK) { - DEBUG(2, ("dereference processing failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(2, "dereference processing failed [%d]: %s\n", ret, strerror(ret)); if (ret == ENOTSUP) { sss_log(SSS_LOG_WARNING, "LDAP server claims to support deref, but deref search failed. " @@ -2434,8 +2434,8 @@ bool sdap_has_deref_support(struct sdap_handle *sh, struct sdap_options *opts) for (i=0; deref_oids[i][0]; i++) { if (sdap_is_control_supported(sh, deref_oids[i][0])) { - DEBUG(6, ("The server supports deref method %s\n", - deref_oids[i][1])); + DEBUG(6, "The server supports deref method %s\n", + deref_oids[i][1]); return true; } } @@ -2459,20 +2459,20 @@ sdap_attrs_add_ldap_attr(struct sysdb_attrs *ldap_attrs, ret = sysdb_attrs_get_el(ldap_attrs, attr_name, &el); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get %s from the " + DEBUG(SSSDBG_OP_FAILURE, "Could not get %s from the " "list of the LDAP attributes [%d]: %s\n", - attr_name, ret, strerror(ret))); + attr_name, ret, strerror(ret)); return ret; } if (el->num_values == 0) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("%s is not available " - "for [%s].\n", desc, objname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "%s is not available " + "for [%s].\n", desc, objname); } else { num_values = multivalued ? el->num_values : 1; for (i = 0; i < num_values; i++) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding %s [%s] to attributes " - "of [%s].\n", desc, el->values[i].data, objname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding %s [%s] to attributes " + "of [%s].\n", desc, el->values[i].data, objname); ret = sysdb_attrs_add_mem(attrs, attr_name, el->values[i].data, el->values[i].length); @@ -2507,7 +2507,7 @@ sdap_save_all_names(const char *name, ret = sysdb_attrs_get_aliases(tmp_ctx, ldap_attrs, name, lowercase, &aliases); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get the alias list")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get the alias list"); goto done; } @@ -2521,16 +2521,16 @@ sdap_save_all_names(const char *name, if (lowercase) { ret = sysdb_attrs_add_lc_name_alias(attrs, domname); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to add lower-cased version " + DEBUG(SSSDBG_OP_FAILURE, "Failed to add lower-cased version " "of alias [%s] into the " - "attribute list\n", aliases[i])); + "attribute list\n", aliases[i]); goto done; } } else { ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, domname); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to add alias [%s] into the " - "attribute list\n", aliases[i])); + DEBUG(SSSDBG_OP_FAILURE, "Failed to add alias [%s] into the " + "attribute list\n", aliases[i]); goto done; } } diff --git a/src/providers/ldap/sdap_async_autofs.c b/src/providers/ldap/sdap_async_autofs.c index d9ea2980d..616a3b9a5 100644 --- a/src/providers/ldap/sdap_async_autofs.c +++ b/src/providers/ldap/sdap_async_autofs.c @@ -63,7 +63,7 @@ get_autofs_entry_attr(struct sysdb_attrs *entry, struct sdap_options *opts, if (ret) return NULL; if (el->num_values != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Expected one entry got %d\n", el->num_values)); + "Expected one entry got %d\n", el->num_values); return NULL; } @@ -93,13 +93,13 @@ add_autofs_entry(struct sss_domain_info *domain, key = get_autofs_entry_key(entry, opts); if (!key) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs entry key\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get autofs entry key\n"); return EINVAL; } value = get_autofs_entry_value(entry, opts); if (!value) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs entry value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get autofs entry value\n"); return EINVAL; } @@ -131,30 +131,30 @@ save_autofs_entries(struct sss_domain_info *domain, hret = hash_lookup(entry_hash, &key, &value); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot retrieve entry [%s] from hash\n", add_dn_list[i])); + "Cannot retrieve entry [%s] from hash\n", add_dn_list[i]); continue; } entry = talloc_get_type(value.ptr, struct sysdb_attrs); if (!entry) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot retrieve entry [%s] from ptr\n", add_dn_list[i])); + "Cannot retrieve entry [%s] from ptr\n", add_dn_list[i]); continue; } DEBUG(SSSDBG_TRACE_FUNC, - ("Saving autofs entry [%s]\n", add_dn_list[i])); + "Saving autofs entry [%s]\n", add_dn_list[i]); ret = add_autofs_entry(domain, map, opts, entry); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot save entry [%s] to cache\n", add_dn_list[i])); + "Cannot save entry [%s] to cache\n", add_dn_list[i]); continue; } - DEBUG(SSSDBG_TRACE_FUNC, ("Saved entry [%s]\n", add_dn_list[i])); + DEBUG(SSSDBG_TRACE_FUNC, "Saved entry [%s]\n", add_dn_list[i]); } - DEBUG(SSSDBG_TRACE_INTERNAL, ("All entries saved\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "All entries saved\n"); return EOK; } @@ -169,17 +169,17 @@ del_autofs_entries(struct sss_domain_info *dom, for (i=0; del_dn_list[i]; i++) { DEBUG(SSSDBG_TRACE_FUNC, - ("Removing autofs entry [%s]\n", del_dn_list[i])); + "Removing autofs entry [%s]\n", del_dn_list[i]); ret = sysdb_del_autofsentry(dom, del_dn_list[i]); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot delete entry %s\n", del_dn_list[i])); + "Cannot delete entry %s\n", del_dn_list[i]); continue; } } - DEBUG(SSSDBG_TRACE_INTERNAL, ("All entries removed\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "All entries removed\n"); return EOK; } @@ -262,7 +262,7 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx, opts->autofs_entry_map[SDAP_AT_AUTOFS_ENTRY_KEY].name, opts->autofs_entry_map[SDAP_OC_AUTOFS_ENTRY].name); if (!state->base_filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto immediate; } @@ -271,7 +271,7 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx, SDAP_OPTS_AUTOFS_ENTRY, NULL, &state->attrs, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build attributes from map\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build attributes from map\n"); ret = ENOMEM; goto immediate; } @@ -279,17 +279,17 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(state->map, SYSDB_ORIG_DN, &state->orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get originalDN\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get originalDN\n"); goto immediate; } DEBUG(SSSDBG_TRACE_FUNC, - ("Examining autofs map [%s]\n", state->orig_dn)); + "Examining autofs map [%s]\n", state->orig_dn); ret = automntmaps_process_members_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("search failed [%d]: %s\n", ret, strerror(ret))); + "search failed [%d]: %s\n", ret, strerror(ret)); goto immediate; } @@ -321,8 +321,8 @@ automntmaps_process_members_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for automount map entries with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for automount map entries with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, state->orig_dn, @@ -332,7 +332,7 @@ automntmaps_process_members_next_base(struct tevent_req *req) SDAP_OPTS_AUTOFS_ENTRY, state->timeout, true); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot start search for entries\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot start search for entries\n"); return EIO; } tevent_req_set_callback(subreq, automntmaps_process_members_done, req); @@ -386,11 +386,11 @@ automntmaps_process_members_done(struct tevent_req *subreq) } } - DEBUG(SSSDBG_TRACE_INTERNAL, ("No more search bases to try\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No more search bases to try\n"); DEBUG(SSSDBG_TRACE_FUNC, - ("Search for autofs entries, returned %zu results.\n", - state->entries_count)); + "Search for autofs entries, returned %zu results.\n", + state->entries_count); tevent_req_done(req); return; @@ -501,8 +501,8 @@ sdap_get_automntmap_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for automount maps with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for automount maps with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -541,7 +541,7 @@ sdap_get_automntmap_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_FUNC, - ("Search for autofs maps, returned %zu results.\n", state->count)); + "Search for autofs maps, returned %zu results.\n", state->count); if (state->count == 0) { /* No maps found in this search */ @@ -559,12 +559,12 @@ sdap_get_automntmap_process(struct tevent_req *subreq) return; } else if (state->count > 1) { DEBUG(SSSDBG_OP_FAILURE, - ("The search yielded more than one autofs map\n")); + "The search yielded more than one autofs map\n"); tevent_req_error(req, EIO); return; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Processing autofs maps\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Processing autofs maps\n"); subreq = automntmaps_process_members_send(state, state->ev, state->opts, state->sh, state->dom, state->search_bases, @@ -596,7 +596,7 @@ sdap_get_automntmap_done(struct tevent_req *subreq) return; } - DEBUG(SSSDBG_TRACE_FUNC, ("automount map members received\n")); + DEBUG(SSSDBG_TRACE_FUNC, "automount map members received\n"); tevent_req_done(req); return; } @@ -669,7 +669,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, if (!req) return NULL; if (!mapname) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No map name given\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No map name given\n"); ret = EINVAL; goto fail; } @@ -691,7 +691,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, clean_mapname, state->opts->autofs_mobject_map[SDAP_OC_AUTOFS_MAP].name); if (!state->filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -701,7 +701,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, SDAP_OPTS_AUTOFS_MAP, NULL, &state->attrs, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build attributes from map\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build attributes from map\n"); ret = ENOMEM; goto fail; } @@ -714,7 +714,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, dp_opt_get_int(state->opts->basic, SDAP_SEARCH_TIMEOUT)); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto fail; } @@ -744,11 +744,11 @@ sdap_autofs_setautomntent_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (ret == ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not find automount map\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not find automount map\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_automntmap_recv failed [%d]: %s\n", - ret, strerror(ret))); + "sdap_get_automntmap_recv failed [%d]: %s\n", + ret, strerror(ret)); } tevent_req_error(req, ret); return; @@ -756,7 +756,7 @@ sdap_autofs_setautomntent_done(struct tevent_req *subreq) ret = sdap_autofs_setautomntent_save(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save automount map\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not save automount map\n"); tevent_req_error(req, ret); return; } @@ -793,7 +793,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) if (!tmp_ctx) return ENOMEM; DEBUG(SSSDBG_TRACE_LIBS, - ("Got %zu map entries from LDAP\n", state->entries_count)); + "Got %zu map entries from LDAP\n", state->entries_count); if (state->entries_count == 0) { /* No entries for this map in LDAP. * We need to ensure that there are no entries @@ -818,7 +818,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) key = get_autofs_entry_key(state->entries[i], state->opts); val = get_autofs_entry_value(state->entries[i], state->opts); if (!key || !val) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Malformed entry, skipping\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Malformed entry, skipping\n"); continue; } @@ -851,12 +851,12 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) &count, &entries); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("cache lookup for the map failed [%d]: %s\n", - ret, strerror(ret))); + "cache lookup for the map failed [%d]: %s\n", + ret, strerror(ret)); goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Got %zu map entries from sysdb\n", count)); + DEBUG(SSSDBG_TRACE_LIBS, "Got %zu map entries from sysdb\n", count); if (count == 0) { /* No map members for this map in sysdb currently */ sysdb_entrylist = NULL; @@ -889,8 +889,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot start sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot start sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = true; @@ -899,8 +899,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = save_autofs_map(state->dom, state->opts, state->map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs map entry [%d]: %s\n", - ret, strerror(ret))); + "Cannot save autofs map entry [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -911,8 +911,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) entry_hash); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs entries [%d]: %s\n", - ret, strerror(ret))); + "Cannot save autofs entries [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -923,8 +923,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) state->mapname, del_entries); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot delete autofs entries [%d]: %s\n", - ret, strerror(ret))); + "Cannot delete autofs entries [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -933,8 +933,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot commit sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot commit sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = false; @@ -945,8 +945,8 @@ done: tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot cancel sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot cancel sysdb transaction [%d]: %s\n", + ret, strerror(ret)); } } talloc_zfree(tmp_ctx); 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]); diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c index c23a13285..46c07229c 100644 --- a/src/providers/ldap/sdap_async_enum.c +++ b/src/providers/ldap/sdap_async_enum.c @@ -109,7 +109,7 @@ sdap_dom_enum_ex_send(TALLOC_CTX *memctx, state->user_op = sdap_id_op_create(state, user_conn->conn_cache); if (state->user_op == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create failed for users\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create failed for users\n"); ret = EIO; goto fail; } @@ -117,7 +117,7 @@ sdap_dom_enum_ex_send(TALLOC_CTX *memctx, ret = sdap_dom_enum_ex_retry(req, state->user_op, sdap_dom_enum_ex_get_users); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_dom_enum_ex_retry failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_dom_enum_ex_retry failed\n"); goto fail; } @@ -141,7 +141,7 @@ static errno_t sdap_dom_enum_ex_retry(struct tevent_req *req, subreq = sdap_id_op_connect_send(op, state, &ret); if (subreq == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_id_op_connect_send failed: %d\n", ret)); + "sdap_id_op_connect_send failed: %d\n", ret); return ret; } @@ -161,12 +161,12 @@ static bool sdap_dom_enum_ex_connected(struct tevent_req *subreq) if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_TRACE_FUNC, - ("Backend is marked offline, retry later!\n")); + "Backend is marked offline, retry later!\n"); tevent_req_done(req); } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Domain enumeration failed to connect to " \ - "LDAP server: (%d)[%s]\n", ret, strerror(ret))); + "Domain enumeration failed to connect to " \ + "LDAP server: (%d)[%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } return false; @@ -250,13 +250,13 @@ static void sdap_dom_enum_ex_posix_check_done(struct tevent_req *subreq) } return; } else if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Backend is offline, retrying later\n"); tevent_req_done(req); return; } else { /* Non-recoverable error */ DEBUG(SSSDBG_OP_FAILURE, - ("POSIX check failed: %d: %s\n", ret, sss_strerror(ret))); + "POSIX check failed: %d: %s\n", ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -318,20 +318,20 @@ static void sdap_dom_enum_ex_users_done(struct tevent_req *subreq) } return; } else if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Backend is offline, retrying later\n"); tevent_req_done(req); return; } else if (ret != EOK && ret != ENOENT) { /* Non-recoverable error */ DEBUG(SSSDBG_OP_FAILURE, - ("User enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + "User enumeration failed: %d: %s\n", ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } state->group_op = sdap_id_op_create(state, state->group_conn->conn_cache); if (state->group_op == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create failed for groups\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create failed for groups\n"); tevent_req_error(req, EIO); return; } @@ -389,13 +389,13 @@ static void sdap_dom_enum_ex_groups_done(struct tevent_req *subreq) } return; } else if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Backend is offline, retrying later\n"); tevent_req_done(req); return; } else if (ret != EOK && ret != ENOENT) { /* Non-recoverable error */ DEBUG(SSSDBG_OP_FAILURE, - ("Group enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + "Group enumeration failed: %d: %s\n", ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -403,7 +403,7 @@ static void sdap_dom_enum_ex_groups_done(struct tevent_req *subreq) state->svc_op = sdap_id_op_create(state, state->svc_conn->conn_cache); if (state->svc_op == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create failed for svcs\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create failed for svcs\n"); tevent_req_error(req, EIO); return; } @@ -458,13 +458,13 @@ static void sdap_dom_enum_ex_svcs_done(struct tevent_req *subreq) } return; } else if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Backend is offline, retrying later\n"); tevent_req_done(req); return; } else if (ret != EOK && ret != ENOENT) { /* Non-recoverable error */ DEBUG(SSSDBG_OP_FAILURE, - ("Service enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + "Service enumeration failed: %d: %s\n", ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -477,7 +477,7 @@ static void sdap_dom_enum_ex_svcs_done(struct tevent_req *subreq) ret = sysdb_set_enumerated(state->sdom->dom, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not mark domain as having enumerated.\n")); + "Could not mark domain as having enumerated.\n"); /* This error is non-fatal, so continue */ } @@ -487,7 +487,7 @@ static void sdap_dom_enum_ex_svcs_done(struct tevent_req *subreq) /* Not fatal, worst case we'll have stale entries that would be * removed on a subsequent online lookup */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Cleanup failed: %d\n", ret)); + DEBUG(SSSDBG_MINOR_FAILURE, "Cleanup failed: %d\n", ret); } } @@ -562,7 +562,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, ctx->opts->user_map[SDAP_AT_USER_NAME].name); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -583,7 +583,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, } if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -602,7 +602,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -611,7 +611,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, /* Terminate the search filter */ state->filter = talloc_asprintf_append_buffer(state->filter, ")"); if (!state->filter) { - DEBUG(2, ("Failed to build base filter\n")); + DEBUG(2, "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -679,8 +679,8 @@ static void enum_users_done(struct tevent_req *subreq) } } - DEBUG(4, ("Users higher USN value: [%s]\n", - state->ctx->srv_opts->max_user_value)); + DEBUG(4, "Users higher USN value: [%s]\n", + state->ctx->srv_opts->max_user_value); tevent_req_done(req); } @@ -737,7 +737,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, ctx->opts->group_map[SDAP_AT_GROUP_NAME].name); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -758,7 +758,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, } if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -773,7 +773,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, ctx->srv_opts->max_group_value); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -783,7 +783,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, state->filter = talloc_asprintf_append_buffer(state->filter, ")"); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -848,8 +848,8 @@ static void enum_groups_done(struct tevent_req *subreq) } } - DEBUG(4, ("Groups higher USN value: [%s]\n", - state->ctx->srv_opts->max_group_value)); + DEBUG(4, "Groups higher USN value: [%s]\n", + state->ctx->srv_opts->max_group_value); tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c index 1e0d7f69e..ff8da1503 100644 --- a/src/providers/ldap/sdap_async_groups.c +++ b/src/providers/ldap/sdap_async_groups.c @@ -68,7 +68,7 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx, goto done; } - DEBUG(9, ("Searching cache for [%s].\n", sanitized_dn)); + DEBUG(9, "Searching cache for [%s].\n", sanitized_dn); ret = sysdb_search_entry(tmpctx, ctx, base_dn, LDB_SCOPE_SUBTREE, filter, no_attrs, &num_msgs, &msgs); @@ -222,8 +222,8 @@ static int sdap_fill_memberships(struct sdap_options *opts, if (hret == HASH_ERROR_KEY_NOT_FOUND) { sdom = sdap_domain_get_by_dn(opts, (char *)values[i].data); if (sdom == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Member [%s] is it out of domain " - "scope?\n", (char *)values[i].data)); + DEBUG(SSSDBG_MINOR_FAILURE, "Member [%s] is it out of domain " + "scope?\n", (char *)values[i].data); member_sysdb = ctx; member_dom = domain; } else { @@ -238,17 +238,17 @@ static int sdap_fill_memberships(struct sdap_options *opts, if (ret == ENOENT) { /* member may be outside of the configured search bases * or out of scope of nesting limit */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Member [%s] was not found in " - "cache. Is it out of scope?\n", (char *)values[i].data)); + DEBUG(SSSDBG_MINOR_FAILURE, "Member [%s] was not found in " + "cache. Is it out of scope?\n", (char *)values[i].data); continue; } if (ret != EOK) { goto done; } - DEBUG(7, (" member #%d (%s): [%s]\n", + DEBUG(7, " member #%d (%s): [%s]\n", i, (char *)values[i].data, - (char *)el->values[j].data)); + (char *)el->values[j].data); el->values[j].length = strlen((char *)el->values[j].data); j++; @@ -296,7 +296,7 @@ sdap_store_group_with_gid(struct sss_domain_info *domain, if (!posix_group) { ret = sysdb_attrs_add_uint32(group_attrs, SYSDB_GIDNUM, 0); if (ret) { - DEBUG(2, ("Could not set explicit GID 0 for %s\n", name)); + DEBUG(2, "Could not set explicit GID 0 for %s\n", name); return ret; } } @@ -304,7 +304,7 @@ sdap_store_group_with_gid(struct sss_domain_info *domain, ret = sysdb_store_group(domain, name, gid, group_attrs, cache_timeout, now); if (ret) { - DEBUG(2, ("Could not store group %s\n", name)); + DEBUG(2, "Could not store group %s\n", name); return ret; } @@ -333,8 +333,8 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(attrs, SYSDB_GHOST, &gh); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading ghost attributes: [%s]\n", - strerror(ret))); + "Error reading ghost attributes: [%s]\n", + strerror(ret)); return ret; } @@ -353,18 +353,18 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, memberel->values = NULL; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading members: [%s]\n", strerror(ret))); + "Error reading members: [%s]\n", strerror(ret)); return ret; } if (store_original_member) { - DEBUG(SSSDBG_TRACE_FUNC, ("The group has %d members\n", memberel->num_values)); + DEBUG(SSSDBG_TRACE_FUNC, "The group has %d members\n", memberel->num_values); for (i = 0; i < memberel->num_values; i++) { ret = sysdb_attrs_add_string(sysdb_attrs, SYSDB_ORIG_MEMBER, (const char *) memberel->values[i].data); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add member [%s]\n", - (const char *) memberel->values[i].data)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add member [%s]\n", + (const char *) memberel->values[i].data); return ret; } } @@ -374,8 +374,8 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(sysdb_attrs, SYSDB_MEMBER, &sysdb_memberel); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading group members from group_attrs: [%s]\n", - strerror(ret))); + "Error reading group members from group_attrs: [%s]\n", + strerror(ret)); return ret; } sysdb_memberel->values = memberel->values; @@ -385,14 +385,14 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(sysdb_attrs, SYSDB_GHOST, &ghostel); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error getting ghost element: [%s]\n", strerror(ret))); + "Error getting ghost element: [%s]\n", strerror(ret)); return ret; } ghostel->values = gh->values; ghostel->num_values = gh->num_values; cnt = ghostel->num_values + memberel->num_values; - DEBUG(SSSDBG_TRACE_FUNC, ("Group has %zu members\n", cnt)); + DEBUG(SSSDBG_TRACE_FUNC, "Group has %zu members\n", cnt); /* Now process RFC2307bis ghost hash table */ if (ghosts && cnt > 0) { @@ -410,13 +410,13 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, continue; } else if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error checking hash table: [%s]\n", - hash_error_string(hret))); + "Error checking hash table: [%s]\n", + hash_error_string(hret)); return EFAULT; } DEBUG(SSSDBG_TRACE_FUNC, - ("Adding ghost member for group [%s]\n", (char *) value.ptr)); + "Adding ghost member for group [%s]\n", (char *) value.ptr); ghostel->values[ghostel->num_values].data = \ (uint8_t *) talloc_strdup(ghostel->values, value.ptr); if (ghostel->values[ghostel->num_values].data == NULL) { @@ -472,17 +472,17 @@ static int sdap_save_group(TALLOC_CTX *memctx, if (ret == EOK) { ret = sysdb_attrs_add_string(group_attrs, SYSDB_SID_STR, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not add SID string: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not add SID string: [%s]\n", + strerror(ret)); goto done; } } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_ALL, ("objectSID: not available for group [%s].\n", - group_name)); + DEBUG(SSSDBG_TRACE_ALL, "objectSID: not available for group [%s].\n", + group_name); sid_str = NULL; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not identify objectSID: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not identify objectSID: [%s]\n", + strerror(ret)); sid_str = NULL; } @@ -493,28 +493,28 @@ static int sdap_save_group(TALLOC_CTX *memctx, if (subdomain) { dom = subdomain; } else { - DEBUG(SSSDBG_TRACE_FUNC, ("SID %s does not belong to any known " - "domain\n", sid_str)); + DEBUG(SSSDBG_TRACE_FUNC, "SID %s does not belong to any known " + "domain\n", sid_str); } } ret = sdap_get_group_primary_name(tmpctx, opts, attrs, dom, &group_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get group name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get group name\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing group %s\n", group_name); posix_group = true; if (opts->schema_type == SDAP_SCHEMA_AD) { ret = sysdb_attrs_get_int32_t(attrs, SYSDB_GROUP_TYPE, &ad_group_type); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_int32_t failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_int32_t failed.\n"); goto done; } - DEBUG(SSSDBG_TRACE_ALL, ("AD group [%s] has type flags %#x.", - group_name, ad_group_type)); + DEBUG(SSSDBG_TRACE_ALL, "AD group [%s] has type flags %#x.", + group_name, ad_group_type); /* Only security groups from AD are considered for POSIX groups. * Additionally only global and universal group are taken to account * for trusted domains. */ @@ -524,19 +524,19 @@ static int sdap_save_group(TALLOC_CTX *memctx, || (ad_group_type & SDAP_AD_GROUP_TYPE_UNIVERSAL))))) { posix_group = false; gid = 0; - DEBUG(SSSDBG_TRACE_FUNC, ("Filtering AD group [%s].\n", - group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Filtering AD group [%s].\n", + group_name); ret = sysdb_attrs_add_uint32(group_attrs, opts->group_map[SDAP_AT_GROUP_GID].sys_name, 0); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to add a GID to non-posix group!\n")); + "Failed to add a GID to non-posix group!\n"); return ret; } ret = sysdb_attrs_add_bool(group_attrs, SYSDB_POSIX, false); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error: Failed to mark group as non-posix!\n")); + "Error: Failed to mark group as non-posix!\n"); return ret; } } @@ -550,28 +550,28 @@ static int sdap_save_group(TALLOC_CTX *memctx, posix_group = true; if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SID not available, cannot map a " \ - "unix ID to group [%s].\n", group_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "SID not available, cannot map a " \ + "unix ID to group [%s].\n", group_name); ret = ENOENT; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping group [%s] objectSID [%s] to unix ID\n", - group_name, sid_str)); + "Mapping group [%s] objectSID [%s] to unix ID\n", + group_name, sid_str); /* Convert the SID into a UNIX group ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &gid); if (ret == ENOTSUP) { /* ENOTSUP is returned if built-in SID was provided * => do not store the group, but return EOK */ - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID string: [%s]\n", - strerror(ret))); + "Could not convert SID string: [%s]\n", + strerror(ret)); goto done; } @@ -580,7 +580,7 @@ static int sdap_save_group(TALLOC_CTX *memctx, */ ret = sdap_replace_id(attrs, SYSDB_GIDNUM, gid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped GID\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the id-mapped GID\n"); goto done; } } else { @@ -589,17 +589,17 @@ static int sdap_save_group(TALLOC_CTX *memctx, posix_group = true; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading posix attribute: [%s]\n", - strerror(ret))); + "Error reading posix attribute: [%s]\n", + strerror(ret)); goto done; } - DEBUG(8, ("This is%s a posix group\n", (posix_group)?"":" not")); + DEBUG(8, "This is%s a posix group\n", (posix_group)?"":" not"); ret = sysdb_attrs_add_bool(group_attrs, SYSDB_POSIX, posix_group); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting posix attribute: [%s]\n", - strerror(ret))); + "Error setting posix attribute: [%s]\n", + strerror(ret)); goto done; } @@ -607,8 +607,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, opts->group_map[SDAP_AT_GROUP_GID].sys_name, &gid); if (ret != EOK) { - DEBUG(1, ("no gid provided for [%s] in domain [%s].\n", - group_name, dom->name)); + DEBUG(1, "no gid provided for [%s] in domain [%s].\n", + group_name, dom->name); ret = EINVAL; goto done; } @@ -619,7 +619,7 @@ static int sdap_save_group(TALLOC_CTX *memctx, if (posix_group) { if (OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Group [%s] filtered out! (id out of range)\n", group_name)); + "Group [%s] filtered out! (id out of range)\n", group_name); ret = EINVAL; goto done; } @@ -630,8 +630,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, group_name, group_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting original DN: [%s]\n", - strerror(ret))); + "Error setting original DN: [%s]\n", + strerror(ret)); goto done; } @@ -641,8 +641,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, group_name, group_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting mod timestamp: [%s]\n", - strerror(ret))); + "Error setting mod timestamp: [%s]\n", + strerror(ret)); goto done; } @@ -650,21 +650,21 @@ static int sdap_save_group(TALLOC_CTX *memctx, opts->group_map[SDAP_AT_GROUP_USN].sys_name, &el); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error looking up group USN: [%s]\n", - strerror(ret))); + "Error looking up group USN: [%s]\n", + strerror(ret)); goto done; } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original USN value is not available for [%s].\n", group_name)); + "Original USN value is not available for [%s].\n", group_name); } else { ret = sysdb_attrs_add_string(group_attrs, opts->group_map[SDAP_AT_GROUP_USN].sys_name, (const char*)el->values[0].data); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting group USN: [%s]\n", - strerror(ret))); + "Error setting group USN: [%s]\n", + strerror(ret)); goto done; } usn_value = talloc_strdup(tmpctx, (const char*)el->values[0].data); @@ -678,24 +678,24 @@ static int sdap_save_group(TALLOC_CTX *memctx, populate_members, store_original_member, group_attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to save ghost members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to save ghost members\n"); goto done; } ret = sdap_save_all_names(group_name, attrs, dom, group_attrs); if (ret != EOK) { - DEBUG(1, ("Failed to save group names\n")); + DEBUG(1, "Failed to save group names\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Storing info for group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing info for group %s\n", group_name); ret = sdap_store_group_with_gid(dom, group_name, gid, group_attrs, dom->group_timeout, posix_group, now); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not store group with GID: [%s]\n", - strerror(ret))); + "Could not store group with GID: [%s]\n", + strerror(ret)); goto done; } @@ -709,9 +709,9 @@ static int sdap_save_group(TALLOC_CTX *memctx, done: if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to save group [%s]: [%s]\n", + "Failed to save group [%s]: [%s]\n", group_name ? group_name : "Unknown", - strerror(ret))); + strerror(ret)); } talloc_free(tmpctx); return ret; @@ -740,10 +740,10 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx, ret = sdap_get_group_primary_name(memctx, opts, attrs, dom, &group_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get group name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get group name\n"); goto fail; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing group %s\n", group_name); /* With AD we also want to merge in parent groups of primary GID as they * are reported with tokenGroups, too @@ -764,10 +764,10 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx, if (el->num_values == 0 && nuserdns == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("No members for group [%s]\n", group_name)); + "No members for group [%s]\n", group_name); } else { DEBUG(SSSDBG_TRACE_FUNC, - ("Adding member users to group [%s]\n", group_name)); + "Adding member users to group [%s]\n", group_name); group_attrs = sysdb_new_attrs(memctx); if (!group_attrs) { @@ -791,7 +791,7 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx, fail: DEBUG(SSSDBG_OP_FAILURE, - ("Failed to save members of group %s\n", group_name)); + "Failed to save members of group %s\n", group_name); return ret; } @@ -845,7 +845,7 @@ static int sdap_save_groups(TALLOC_CTX *memctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -872,9 +872,9 @@ static int sdap_save_groups(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store group %d. Ignoring.\n", i)); + DEBUG(2, "Failed to store group %d. Ignoring.\n", i); } else { - DEBUG(9, ("Group %d processed!\n", i)); + DEBUG(9, "Group %d processed!\n", i); if (twopass && !populate_members) { saved_groups[nsaved_groups] = groups[i]; nsaved_groups++; @@ -905,16 +905,16 @@ static int sdap_save_groups(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store group %d members.\n", i)); + DEBUG(2, "Failed to store group %d members.\n", i); } else { - DEBUG(9, ("Group %d members processed!\n", i)); + DEBUG(9, "Group %d members processed!\n", i); } } } ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -927,7 +927,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_zfree(tmpctx); @@ -1050,7 +1050,7 @@ struct tevent_req *sdap_process_group_send(TALLOC_CTX *memctx, /* Group without members */ if (el->num_values == 0) { - DEBUG(2, ("No Members. Done!\n")); + DEBUG(2, "No Members. Done!\n"); ret = EOK; goto done; } @@ -1100,7 +1100,7 @@ struct tevent_req *sdap_process_group_send(TALLOC_CTX *memctx, break; default: - DEBUG(1, ("Unknown schema type %d\n", opts->schema_type)); + DEBUG(1, "Unknown schema type %d\n", opts->schema_type); ret = EINVAL; break; } @@ -1109,7 +1109,7 @@ done: /* We managed to process all the entries */ /* EBUSY means we need to wait for entries in LDAP */ if (ret == EOK) { - DEBUG(7, ("All group members processed\n")); + DEBUG(7, "All group members processed\n"); tevent_req_done(req); tevent_req_post(req, ev); } @@ -1138,11 +1138,11 @@ sdap_process_missing_member_2307bis(struct tevent_req *req, * connection. */ if (grp_state->check_count > GROUPMEMBER_REQ_PARALLEL) { - DEBUG(7, (" queueing search for: %s\n", user_dn)); + DEBUG(7, " queueing search for: %s\n", user_dn); if (!grp_state->queued_members) { DEBUG(SSSDBG_TRACE_LIBS, - ("Allocating queue for %zu members\n", - num_users - grp_state->check_count)); + "Allocating queue for %zu members\n", + num_users - grp_state->check_count); grp_state->queued_members = talloc_array(grp_state, char *, num_users - grp_state->check_count + 1); @@ -1199,7 +1199,7 @@ sdap_process_group_members_2307bis(struct tevent_req *req, * User already cached in sysdb. Remember the sysdb DN for later * use by sdap_save_groups() */ - DEBUG(7, ("sysdbdn: %s\n", strdn)); + DEBUG(7, "sysdbdn: %s\n", strdn); state->sysdb_dns->values[state->sysdb_dns->num_values].data = (uint8_t*) strdn; state->sysdb_dns->values[state->sysdb_dns->num_values].length = @@ -1214,19 +1214,19 @@ sdap_process_group_members_2307bis(struct tevent_req *req, * Also, we don't want to be holding the sysdb * transaction while we're performing LDAP lookups. */ - DEBUG(7, ("Searching LDAP for missing user entry\n")); + DEBUG(7, "Searching LDAP for missing user entry\n"); ret = sdap_process_missing_member_2307bis(req, member_dn, memberel->num_values); if (ret != EOK) { - DEBUG(1, ("Error processing missing member #%d (%s):\n", - i, member_dn)); + DEBUG(1, "Error processing missing member #%d (%s):\n", + i, member_dn); return ret; } } } else { - DEBUG(1, ("Error checking cache for member #%d (%s):\n", - i, (char *)memberel->values[i].data)); + DEBUG(1, "Error checking cache for member #%d (%s):\n", + i, (char *)memberel->values[i].data); return ret; } } @@ -1298,7 +1298,7 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, /* Entry exists but the group references it with an alias. */ if (count != 1) { - DEBUG(1, ("More than one entry with this alias?\n")); + DEBUG(1, "More than one entry with this alias?\n"); ret = EIO; goto done; } @@ -1307,8 +1307,8 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, username = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (username == NULL) { ret = EINVAL; - DEBUG(SSSDBG_MINOR_FAILURE, ("Inconsistent sysdb: user " - "without primary name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Inconsistent sysdb: user " + "without primary name?\n"); goto done; } user_dn = sysdb_user_strdn(tmp_ctx, state->dom->name, username); @@ -1318,14 +1318,14 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, ret = sdap_add_group_member_2307(state->sysdb_dns, user_dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group member %s\n", username)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group member %s\n", username); } } else if (ret == ENOENT || count == 0) { /* The entry really does not exist, add a ghost */ - DEBUG(SSSDBG_TRACE_FUNC, ("Adding a ghost entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Adding a ghost entry\n"); ret = sdap_add_group_member_2307(state->ghost_dns, member_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group member %s\n", member_name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group member %s\n", member_name); } } else { ret = EIO; @@ -1360,7 +1360,7 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, * User already cached in sysdb. Remember the sysdb DN for later * use by sdap_save_groups() */ - DEBUG(7, ("Member already cached in sysdb: %s\n", member_name)); + DEBUG(7, "Member already cached in sysdb: %s\n", member_name); userdn = sysdb_user_strdn(state->sysdb_dns, state->dom->name, member_name); if (userdn == NULL) { @@ -1369,23 +1369,23 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, ret = sdap_add_group_member_2307(state->sysdb_dns, userdn); if (ret != EOK) { - DEBUG(1, ("Could not add member %s into sysdb\n", member_name)); + DEBUG(1, "Could not add member %s into sysdb\n", member_name); goto done; } } else if (ret == ENOENT) { /* The user is not in sysdb, need to add it */ - DEBUG(7, ("member #%d (%s): not found in sysdb\n", - i, member_name)); + DEBUG(7, "member #%d (%s): not found in sysdb\n", + i, member_name); ret = sdap_process_missing_member_2307(state, member_name); if (ret != EOK) { - DEBUG(1, ("Error processing missing member #%d (%s):\n", - i, member_name)); + DEBUG(1, "Error processing missing member #%d (%s):\n", + i, member_name); goto done; } } else { - DEBUG(1, ("Error checking cache for member #%d (%s):\n", - i, (char *) memberel->values[i].data)); + DEBUG(1, "Error checking cache for member #%d (%s):\n", + i, (char *) memberel->values[i].data); goto done; } } @@ -1415,7 +1415,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) uint8_t* name_string; state->check_count--; - DEBUG(SSSDBG_TRACE_ALL, ("Members remaining: %zu\n", state->check_count)); + DEBUG(SSSDBG_TRACE_ALL, "Members remaining: %zu\n", state->check_count); ret = sdap_get_generic_recv(subreq, state, &count, &usr_attrs); talloc_zfree(subreq); @@ -1425,7 +1425,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) if (count != 1) { ret = EINVAL; DEBUG(SSSDBG_TRACE_LIBS, - ("Expected one user entry and got %zu\n", count)); + "Expected one user entry and got %zu\n", count); goto next; } ret = sysdb_attrs_get_el(usr_attrs[0], @@ -1434,7 +1434,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) ret = EINVAL; } if (ret) { - DEBUG(2, ("Failed to get the member's name\n")); + DEBUG(2, "Failed to get the member's name\n"); goto next; } @@ -1448,8 +1448,8 @@ static void sdap_process_group_members(struct tevent_req *subreq) next: if (ret) { DEBUG(SSSDBG_TRACE_FUNC, - ("Error reading group member[%d]: %s. Skipping\n", - ret, strerror(ret))); + "Error reading group member[%d]: %s. Skipping\n", + ret, strerror(ret)); state->count--; } /* Are there more searches for uncached users to submit ? */ @@ -1485,8 +1485,8 @@ next: &el); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get the group member attribute [%d]: %s\n", - ret, strerror(ret))); + "Failed to get the group member attribute [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1500,7 +1500,7 @@ next: } el->values = talloc_steal(state->group, state->ghost_dns->values); el->num_values = state->ghost_dns->num_values; - DEBUG(9, ("Processed Group - Done\n")); + DEBUG(9, "Processed Group - Done\n"); tevent_req_done(req); } } @@ -1585,7 +1585,7 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Group lookup request without a search base\n")); + "Group lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -1597,7 +1597,7 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx, subdom_id_ctx = talloc_get_type(sdom->pvt, struct ad_id_ctx); state->op = sdap_id_op_create(state, subdom_id_ctx->ldap_ctx->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto done; } @@ -1669,8 +1669,8 @@ static errno_t sdap_get_groups_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, @@ -1713,11 +1713,11 @@ static void sdap_get_groups_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_FUNC, - ("Search for groups, returned %zu results.\n", count)); + "Search for groups, returned %zu results.\n", count); if (!state->enumeration && count > 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Individual group search returned multiple results\n")); + "Individual group search returned multiple results\n"); tevent_req_error(req, EINVAL); return; } @@ -1820,7 +1820,7 @@ static void sdap_get_groups_process(struct tevent_req *subreq) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(0, ("Failed to start transaction\n")); + DEBUG(0, "Failed to start transaction\n"); tevent_req_error(req, ret); return; } @@ -1828,13 +1828,13 @@ static void sdap_get_groups_process(struct tevent_req *subreq) if (state->enumeration && state->opts->schema_type != SDAP_SCHEMA_RFC2307 && dp_opt_get_int(state->opts->basic, SDAP_NESTING_LEVEL) != 0) { - DEBUG(9, ("Saving groups without members first " - "to allow unrolling of nested groups.\n")); + DEBUG(9, "Saving groups without members first " + "to allow unrolling of nested groups.\n"); ret = sdap_save_groups(state, state->sysdb, state->dom, state->opts, state->groups, state->count, false, NULL, true, NULL); if (ret) { - DEBUG(2, ("Failed to store groups.\n")); + DEBUG(2, "Failed to store groups.\n"); tevent_req_error(req, ret); return; } @@ -1869,18 +1869,18 @@ static void sdap_get_groups_done(struct tevent_req *subreq) if (ret) { sysret = sysdb_transaction_cancel(state->sysdb); if (sysret != EOK) { - DEBUG(0, ("Could not cancel sysdb transaction\n")); + DEBUG(0, "Could not cancel sysdb transaction\n"); } tevent_req_error(req, ret); return; } state->check_count--; - DEBUG(SSSDBG_TRACE_ALL, ("Groups remaining: %zu\n", state->check_count)); + DEBUG(SSSDBG_TRACE_ALL, "Groups remaining: %zu\n", state->check_count); if (state->check_count == 0) { - DEBUG(9, ("All groups processed\n")); + DEBUG(9, "All groups processed\n"); /* If ignore_group_members is set for the domain, don't update * group memberships in the cache. @@ -1894,14 +1894,14 @@ static void sdap_get_groups_done(struct tevent_req *subreq) !state->enumeration, &state->higher_usn); if (ret) { - DEBUG(2, ("Failed to store groups.\n")); + DEBUG(2, "Failed to store groups.\n"); tevent_req_error(req, ret); return; } - DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Groups - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Groups - Done\n", state->count); sysret = sysdb_transaction_commit(state->sysdb); if (sysret != EOK) { - DEBUG(0, ("Couldn't commit transaction\n")); + DEBUG(0, "Couldn't commit transaction\n"); tevent_req_error(req, sysret); } else { tevent_req_done(req); @@ -1938,8 +1938,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve members using AD match rule. [%s]\n", - strerror(ret))); + "Could not retrieve members using AD match rule. [%s]\n", + strerror(ret)); goto done; } @@ -1973,8 +1973,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) &ghosts); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine which users are ghosts: [%s]\n", - strerror(ret))); + "Could not determine which users are ghosts: [%s]\n", + strerror(ret)); goto done; } @@ -2000,7 +2000,7 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) * an originalDN. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("BUG: Missing originalDN for user?\n")); + "BUG: Missing originalDN for user?\n"); goto done; } @@ -2018,8 +2018,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) false, ghosts, true, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not save group to the cache: [%s]\n", - strerror(ret))); + "Could not save group to the cache: [%s]\n", + strerror(ret)); goto done; } @@ -2068,8 +2068,8 @@ static void sdap_nested_done(struct tevent_req *subreq) &group_count, &groups); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("Nested group processing failed: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Nested group processing failed: [%d][%s]\n", + ret, strerror(ret)); goto fail; } @@ -2078,7 +2078,7 @@ static void sdap_nested_done(struct tevent_req *subreq) */ ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -2099,7 +2099,7 @@ static void sdap_nested_done(struct tevent_req *subreq) ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -2112,7 +2112,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -2168,7 +2168,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction!\n"); goto done; } in_transaction = true; @@ -2180,7 +2180,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User entry %d has no originalDN attribute\n", i)); + "User entry %d has no originalDN attribute\n", i); goto done; } original_dn = (const char *) el->values[0].data; @@ -2189,7 +2189,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, &clean_orig_dn); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot sanitize originalDN [%s]\n", original_dn)); + "Cannot sanitize originalDN [%s]\n", original_dn); goto done; } @@ -2200,7 +2200,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, user_dom, &username); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("User entry %d has no name attribute. Skipping\n", i)); + "User entry %d has no name attribute. Skipping\n", i); continue; } @@ -2217,13 +2217,13 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, talloc_zfree(filter); talloc_zfree(clean_orig_dn); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("Error checking cache for user entry\n")); + DEBUG(1, "Error checking cache for user entry\n"); goto done; } else if (ret == EOK) { /* The entry is cached but expired. Update the username * if needed. */ if (count != 1) { - DEBUG(1, ("More than one entry with this origDN? Skipping\n")); + DEBUG(1, "More than one entry with this origDN? Skipping\n"); continue; } @@ -2260,7 +2260,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -2270,7 +2270,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } diff --git a/src/providers/ldap/sdap_async_groups_ad.c b/src/providers/ldap/sdap_async_groups_ad.c index 6a8a4fd13..9bb21d29b 100644 --- a/src/providers/ldap/sdap_async_groups_ad.c +++ b/src/providers/ldap/sdap_async_groups_ad.c @@ -76,8 +76,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, NULL, &state->attrs, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not build attribute map: [%s]\n", - strerror(ret))); + "Could not build attribute map: [%s]\n", + strerror(ret)); goto immediate; } @@ -85,8 +85,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(group, SYSDB_ORIG_DN, &group_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve originalDN for group: %s\n", - strerror(ret))); + "Could not retrieve originalDN for group: %s\n", + strerror(ret)); goto immediate; } @@ -94,8 +94,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(state, group_dn, &sanitized_group_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not sanitize group DN: %s\n", - strerror(ret))); + "Could not sanitize group DN: %s\n", + strerror(ret)); goto immediate; } @@ -119,8 +119,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sdap_get_ad_match_rule_members_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sdap_get_ad_match_rule_members_next_base failed: [%s]\n", - strerror(ret))); + "sdap_get_ad_match_rule_members_next_base failed: [%s]\n", + strerror(ret)); goto immediate; } @@ -149,8 +149,8 @@ sdap_get_ad_match_rule_members_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -183,13 +183,13 @@ sdap_get_ad_match_rule_members_step(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", sss_strerror(ret))); + "LDAP search failed: [%s]\n", sss_strerror(ret)); tevent_req_error(req, ret); return; } DEBUG(SSSDBG_TRACE_LIBS, - ("Search for users returned %zu results\n", count)); + "Search for users returned %zu results\n", count); /* Add this batch of users to the list */ if (count > 0) { @@ -225,7 +225,7 @@ sdap_get_ad_match_rule_members_step(struct tevent_req *subreq) /* No more search bases. We're done here. */ if (state->count == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("No users matched in any search base\n")); + "No users matched in any search base\n"); tevent_req_error(req, ENOENT); return; } diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c index 29b71c116..b7c42fa95 100644 --- a/src/providers/ldap/sdap_async_initgroups.c +++ b/src/providers/ldap/sdap_async_initgroups.c @@ -69,7 +69,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, tmp_name = sss_get_domain_name(tmp_ctx, groupnames[i], domain); if (tmp_name == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to format original name [%s]\n", groupnames[i])); + "Failed to format original name [%s]\n", groupnames[i]); ret = ENOMEM; goto done; } @@ -80,14 +80,14 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, continue; } else if (ret == ENOENT) { missing[mi] = talloc_steal(missing, tmp_name); - DEBUG(7, ("Group #%d [%s][%s] is not cached, " \ + DEBUG(7, "Group #%d [%s][%s] is not cached, " \ "need to add a fake entry\n", - i, groupnames[i], missing[mi])); + i, groupnames[i], missing[mi]); mi++; continue; } else if (ret != ENOENT) { - DEBUG(1, ("search for group failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "search for group failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -106,8 +106,8 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot start sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot start sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = true; @@ -121,7 +121,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, domain, &groupname); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The group has no name attribute\n")); + "The group has no name attribute\n"); goto done; } @@ -136,35 +136,35 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, if (use_id_mapping) { if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No SID for group [%s] " \ + DEBUG(SSSDBG_MINOR_FAILURE, "No SID for group [%s] " \ "while id-mapping.\n", - groupname)); + groupname); ret = EINVAL; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping group [%s] objectSID to unix ID\n", groupname)); + "Mapping group [%s] objectSID to unix ID\n", groupname); DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] has objectSID [%s]\n", - groupname, sid_str)); + "Group [%s] has objectSID [%s]\n", + groupname, sid_str); /* Convert the SID into a UNIX group ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &gid); if (ret == EOK) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] has mapped gid [%lu]\n", - groupname, (unsigned long)gid)); + "Group [%s] has mapped gid [%lu]\n", + groupname, (unsigned long)gid); } else { posix = false; gid = 0; DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] cannot be mapped. " + "Group [%s] cannot be mapped. " "Treating as a non-POSIX group\n", - groupname)); + groupname); } } else { @@ -172,15 +172,15 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, SYSDB_GIDNUM, &gid); if (ret == ENOENT || (ret == EOK && gid == 0)) { - DEBUG(SSSDBG_TRACE_LIBS, ("The group %s gid was %s\n", - groupname, ret == ENOENT ? "missing" : "zero")); + DEBUG(SSSDBG_TRACE_LIBS, "The group %s gid was %s\n", + groupname, ret == ENOENT ? "missing" : "zero"); DEBUG(SSSDBG_TRACE_FUNC, - ("Marking group %s as non-posix and setting GID=0!\n", - groupname)); + "Marking group %s as non-posix and setting GID=0!\n", + groupname); gid = 0; posix = false; } else if (ret) { - DEBUG(1, ("The GID attribute is malformed\n")); + DEBUG(1, "The GID attribute is malformed\n"); goto done; } } @@ -189,12 +189,12 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, SYSDB_ORIG_DN, &original_dn); if (ret) { - DEBUG(5, ("The group has no name original DN\n")); + DEBUG(5, "The group has no name original DN\n"); original_dn = NULL; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Adding fake group %s to sysdb\n", groupname)); + "Adding fake group %s to sysdb\n", groupname); ret = sysdb_add_incomplete_group(domain, groupname, gid, original_dn, sid_str, posix, now); @@ -206,7 +206,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, } if (ai == ldap_groups_count) { - DEBUG(2, ("Group %s not present in LDAP\n", missing[i])); + DEBUG(2, "Group %s not present in LDAP\n", missing[i]); ret = EINVAL; goto done; } @@ -214,7 +214,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_transaction_commit failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_transaction_commit failed.\n"); goto done; } in_transaction = false; @@ -224,7 +224,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -263,8 +263,8 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb, opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_grouplist); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -278,7 +278,7 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -291,24 +291,24 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb, add_groups, ldap_groups, ldap_groups_count); if (ret != EOK) { - DEBUG(1, ("Adding incomplete users failed\n")); + DEBUG(1, "Adding incomplete users failed\n"); goto done; } } - DEBUG(8, ("Updating memberships for %s\n", name)); + DEBUG(8, "Updating memberships for %s\n", name); ret = sysdb_update_members(domain, name, type, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { - DEBUG(1, ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -318,7 +318,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_zfree(tmp_ctx); @@ -382,7 +382,7 @@ struct tevent_req *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a group search base\n")); + "Initgroups lookup request without a group search base\n"); ret = EINVAL; goto done; } @@ -457,8 +457,8 @@ static errno_t sdap_initgr_rfc2307_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -589,15 +589,15 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb, opts->group_map[SDAP_AT_GROUP_NAME].name, &groupnamelist); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -605,14 +605,14 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb, ret = sdap_add_incomplete_groups(sysdb, domain, opts, groupnamelist, groups, count); if (ret != EOK) { - DEBUG(6, ("Could not add incomplete groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(6, "Could not add incomplete groups [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -622,7 +622,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } @@ -745,13 +745,13 @@ static struct tevent_req *sdap_initgr_nested_send(TALLOC_CTX *memctx, ret = sdap_get_user_primary_name(memctx, opts, user, dom, &state->username); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("User entry had no username\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "User entry had no username\n"); goto immediate; } ret = sysdb_attrs_get_el(state->user, SYSDB_MEMBEROF, &state->memberof); if (ret || !state->memberof || state->memberof->num_values == 0) { - DEBUG(4, ("User entry lacks original memberof ?\n")); + DEBUG(4, "User entry lacks original memberof ?\n"); /* We can't find any groups for this user, so we'll * have to assume there aren't any. Just return * success here. @@ -956,8 +956,8 @@ static void sdap_initgr_nested_search(struct tevent_req *subreq) state->groups_cur++; } else { DEBUG(SSSDBG_OP_FAILURE, - ("Search for group %s, returned %zu results. Skipping\n", - state->group_dns[state->cur], count)); + "Search for group %s, returned %zu results. Skipping\n", + state->group_dns[state->cur], count); } state->cur++; @@ -1003,7 +1003,7 @@ static void sdap_initgr_nested_store(struct tevent_req *req) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1011,30 +1011,30 @@ static void sdap_initgr_nested_store(struct tevent_req *req) /* save the groups if they are not already */ ret = sdap_initgr_store_groups(state); if (ret != EOK) { - DEBUG(3, ("Could not save groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save groups [%d]: %s\n", + ret, strerror(ret)); goto fail; } /* save the group memberships */ ret = sdap_initgr_store_group_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save group memberships [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save group memberships [%d]: %s\n", + ret, strerror(ret)); goto fail; } /* save the user memberships */ ret = sdap_initgr_store_user_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save user memberships [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save user memberships [%d]: %s\n", + ret, strerror(ret)); goto fail; } ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1046,7 +1046,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -1102,8 +1102,8 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state) state->groups_cur, &miter); if (ret) { - DEBUG(3, ("Could not compute memberships for group %d [%d]: %s\n", - i, ret, strerror(ret))); + DEBUG(3, "Could not compute memberships for group %d [%d]: %s\n", + i, ret, strerror(ret)); goto done; } @@ -1112,7 +1112,7 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1123,14 +1123,14 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state) (const char *const *) miter->add, (const char *const *) miter->del); if (ret != EOK) { - DEBUG(3, ("Failed to update memberships\n")); + DEBUG(3, "Failed to update memberships\n"); goto done; } } ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1140,7 +1140,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -1175,7 +1175,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) /* Get direct LDAP parents */ ret = sysdb_attrs_get_string(state->user, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(2, ("The user has no original DN\n")); + DEBUG(2, "The user has no original DN\n"); goto done; } @@ -1190,7 +1190,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) for (i=0; i < state->groups_cur ; i++) { ret = sysdb_attrs_get_el(state->groups[i], SYSDB_MEMBER, &el); if (ret) { - DEBUG(3, ("A group with no members during initgroups?\n")); + DEBUG(3, "A group with no members during initgroups?\n"); goto done; } @@ -1204,8 +1204,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) } } - DEBUG(7, ("The user %s is a direct member of %d LDAP groups\n", - state->username, nparents)); + DEBUG(7, "The user %s is a direct member of %d LDAP groups\n", + state->username, nparents); if (nparents == 0) { ldap_parent_name_list = NULL; @@ -1216,8 +1216,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) state->opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_parent_name_list); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -1225,8 +1225,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) ret = sysdb_get_direct_parents(tmp_ctx, state->dom, SYSDB_MEMBER_USER, state->username, &sysdb_parent_name_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - state->username, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + state->username, ret, strerror(ret)); goto done; } @@ -1239,18 +1239,18 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; - DEBUG(8, ("Updating memberships for %s\n", state->username)); + DEBUG(8, "Updating memberships for %s\n", state->username); ret = sysdb_update_members(state->dom, state->username, SYSDB_MEMBER_USER, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { - DEBUG(1, ("Could not update sysdb memberships for %s: %d [%s]\n", - state->username, ret, strerror(ret))); + DEBUG(1, "Could not update sysdb memberships for %s: %d [%s]\n", + state->username, ret, strerror(ret)); goto done; } @@ -1265,7 +1265,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_zfree(tmp_ctx); @@ -1309,8 +1309,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, ret = sysdb_get_direct_parents(tmp_ctx, dom, SYSDB_MEMBER_GROUP, group_name, &sysdb_parents_names_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + group_name, ret, strerror(ret)); goto done; } @@ -1322,12 +1322,12 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, &ldap_parentlist, &parents_count); if (ret != EOK) { - DEBUG(1, ("Cannot get parent groups for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Cannot get parent groups for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; } - DEBUG(7, ("The group %s is a direct member of %d LDAP groups\n", - group_name, parents_count)); + DEBUG(7, "The group %s is a direct member of %d LDAP groups\n", + group_name, parents_count); if (parents_count > 0) { ret = sysdb_attrs_primary_name_list(sysdb, tmp_ctx, @@ -1336,8 +1336,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_parent_names_list); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -1345,8 +1345,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, ret = build_membership_diff(tmp_ctx, group_name, ldap_parent_names_list, sysdb_parents_names_list, &mdiff); if (ret != EOK) { - DEBUG(3, ("Could not build membership diff for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(3, "Could not build membership diff for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; } @@ -1386,10 +1386,10 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(attrs, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(3, ("Missing originalDN\n")); + DEBUG(3, "Missing originalDN\n"); goto done; } - DEBUG(9, ("Looking up direct parents for group [%s]\n", orig_dn)); + DEBUG(9, "Looking up direct parents for group [%s]\n", orig_dn); /* FIXME - Filter only parents from full set to avoid searching * through all members of huge groups. That requires asking for memberOf @@ -1400,7 +1400,7 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx, for (i=0; i < ngroups; i++) { ret = sysdb_attrs_get_el(groups[i], SYSDB_MEMBER, &member); if (ret) { - DEBUG(7, ("A group with no members during initgroups?\n")); + DEBUG(7, "A group with no members during initgroups?\n"); continue; } @@ -1415,7 +1415,7 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx, } direct_groups[ndirect] = NULL; - DEBUG(9, ("The group [%s] has %d direct parents\n", orig_dn, ndirect)); + DEBUG(9, "The group [%s] has %d direct parents\n", orig_dn, ndirect); *_direct_parents = talloc_steal(mem_ctx, direct_groups); *_ndirect = ndirect; @@ -1512,7 +1512,7 @@ static struct tevent_req *sdap_initgr_rfc2307bis_send( if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a group search base\n")); + "Initgroups lookup request without a group search base\n"); ret = EINVAL; goto done; } @@ -1605,8 +1605,8 @@ static errno_t sdap_initgr_rfc2307bis_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for parent groups for user [%s] with base [%s]\n", - state->orig_dn, state->search_bases[state->base_iter]->basedn)); + "Searching for parent groups for user [%s] with base [%s]\n", + state->orig_dn, state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -1646,7 +1646,7 @@ static void sdap_initgr_rfc2307bis_process(struct tevent_req *subreq) return; } DEBUG(SSSDBG_TRACE_LIBS, - ("Found %zu parent groups for user [%s]\n", count, state->name)); + "Found %zu parent groups for user [%s]\n", count, state->name); /* Add this batch of groups to the list */ if (count > 0) { @@ -1736,7 +1736,7 @@ static void sdap_initgr_rfc2307bis_done(struct tevent_req *subreq) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1744,27 +1744,27 @@ static void sdap_initgr_rfc2307bis_done(struct tevent_req *subreq) /* save the groups if they are not cached */ ret = save_rfc2307bis_groups(state); if (ret != EOK) { - DEBUG(3, ("Could not save groups memberships [%d]", ret)); + DEBUG(3, "Could not save groups memberships [%d]", ret); goto fail; } /* save the group membership */ ret = save_rfc2307bis_group_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save group memberships [%d]", ret)); + DEBUG(3, "Could not save group memberships [%d]", ret); goto fail; } /* save the user memberships */ ret = save_rfc2307bis_user_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save user memberships [%d]", ret)); + DEBUG(3, "Could not save user memberships [%d]", ret); goto fail; } ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1776,7 +1776,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -1837,8 +1837,8 @@ save_rfc2307bis_groups(struct sdap_initgr_rfc2307bis_state *state) ret = sdap_nested_groups_store(state->sysdb, state->dom, state->opts, groups, count); if (ret != EOK) { - DEBUG(3, ("Could not save groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save groups [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -1891,7 +1891,7 @@ save_rfc2307bis_group_memberships(struct sdap_initgr_rfc2307bis_state *state) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1930,14 +1930,14 @@ save_rfc2307bis_group_memberships(struct sdap_initgr_rfc2307bis_state *state) (const char *const *) add, (const char *const *) iter->del); if (ret != EOK) { - DEBUG(3, ("Failed to update memberships\n")); + DEBUG(3, "Failed to update memberships\n"); goto done; } } ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1947,7 +1947,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -1980,8 +1980,8 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data) ret = sysdb_get_direct_parents(tmp_ctx, mstate->dom, SYSDB_MEMBER_GROUP, group_name, &sysdb_parents_names_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + group_name, ret, strerror(ret)); goto done; } @@ -1998,8 +1998,8 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data) ret = build_membership_diff(tmp_ctx, group_name, ldap_parents_names_list, sysdb_parents_names_list, &mdiff); if (ret != EOK) { - DEBUG(3, ("Could not build membership diff for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(3, "Could not build membership diff for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; } @@ -2029,10 +2029,10 @@ errno_t save_rfc2307bis_user_memberships( return ENOMEM; } - DEBUG(7, ("Save parent groups to sysdb\n")); + DEBUG(7, "Save parent groups to sysdb\n"); ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto error; } in_transaction = true; @@ -2040,8 +2040,8 @@ errno_t save_rfc2307bis_user_memberships( ret = sysdb_get_direct_parents(tmp_ctx, state->dom, SYSDB_MEMBER_USER, state->name, &sysdb_parent_name_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - state->name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + state->name, ret, strerror(ret)); goto error; } @@ -2063,7 +2063,7 @@ errno_t save_rfc2307bis_user_memberships( tmp_str = sss_tc_fqname(ldap_grouplist, state->dom->names, state->dom, ldap_grouplist[c]); if (tmp_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_tc_fqname failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_tc_fqname failed.\n"); ret = ENOMEM; goto error; } @@ -2084,7 +2084,7 @@ errno_t save_rfc2307bis_user_memberships( goto error; } - DEBUG(8, ("Updating memberships for %s\n", state->name)); + DEBUG(8, "Updating memberships for %s\n", state->name); ret = sysdb_update_members(state->dom, state->name, SYSDB_MEMBER_USER, (const char *const *)add_groups, (const char *const *)del_groups); @@ -2094,7 +2094,7 @@ errno_t save_rfc2307bis_user_memberships( ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto error; } in_transaction = false; @@ -2106,7 +2106,7 @@ error: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -2155,8 +2155,8 @@ struct tevent_req *rfc2307bis_nested_groups_send( struct sdap_rfc2307bis_nested_ctx *state; DEBUG(SSSDBG_TRACE_INTERNAL, - ("About to process %zu groups in nesting level %zu\n", - num_groups, nesting)); + "About to process %zu groups in nesting level %zu\n", + num_groups, nesting); req = tevent_req_create(mem_ctx, &state, struct sdap_rfc2307bis_nested_ctx); @@ -2186,8 +2186,8 @@ struct tevent_req *rfc2307bis_nested_groups_send( state->search_bases = search_bases; if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups nested lookup request " - "without a group search base\n")); + "Initgroups nested lookup request " + "without a group search base\n"); ret = EINVAL; goto done; } @@ -2262,12 +2262,12 @@ static errno_t rfc2307bis_nested_groups_step(struct tevent_req *req) goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Processing group [%s]\n", state->primary_name)); + DEBUG(SSSDBG_TRACE_LIBS, "Processing group [%s]\n", state->primary_name); ret = hash_lookup(state->group_hash, &key, &value); if (ret == HASH_SUCCESS) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Group [%s] was already processed, " - "taking a shortcut\n", state->primary_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Group [%s] was already processed, " + "taking a shortcut\n", state->primary_name); state->processed_groups[state->group_iter] = talloc_get_type(value.ptr, struct sdap_nested_group); talloc_free(key.str); @@ -2355,9 +2355,9 @@ static errno_t rfc2307bis_nested_groups_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for parent groups of group [%s] with base [%s]\n", + "Searching for parent groups of group [%s] with base [%s]\n", state->orig_dn, - state->search_bases[state->base_iter]->basedn)); + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -2404,7 +2404,7 @@ static void rfc2307bis_nested_groups_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_LIBS, - ("Found %zu parent groups of [%s]\n", count, state->orig_dn)); + "Found %zu parent groups of [%s]\n", count, state->orig_dn); ngr = state->processed_groups[state->group_iter]; /* Add this batch of groups to the list */ @@ -2433,8 +2433,8 @@ static void rfc2307bis_nested_groups_process(struct tevent_req *subreq) ngr->ldap_parents[ngr->parents_count] = NULL; DEBUG(SSSDBG_TRACE_INTERNAL, - ("Total of %zu direct parents after this iteration\n", - ngr->parents_count)); + "Total of %zu direct parents after this iteration\n", + ngr->parents_count); } state->base_iter++; @@ -2536,8 +2536,8 @@ static void rfc2307bis_nested_groups_done(struct tevent_req *subreq) ret = rfc2307bis_nested_groups_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("rfc2307bis_nested failed [%d][%s]\n", - ret, strerror(ret))); + DEBUG(6, "rfc2307bis_nested failed [%d][%s]\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -2610,7 +2610,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx, char *clean_name; bool use_id_mapping; - DEBUG(9, ("Retrieving info for initgroups call\n")); + DEBUG(9, "Retrieving info for initgroups call\n"); req = tevent_req_create(memctx, &state, struct sdap_get_initgr_state); if (!req) return NULL; @@ -2631,7 +2631,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx, state->user_search_bases = sdom->user_search_bases; if (!state->user_search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a user search base\n")); + "Initgroups lookup request without a user search base\n"); ret = EINVAL; goto done; } @@ -2717,8 +2717,8 @@ static errno_t sdap_get_initgr_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->user_search_bases[state->user_base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->user_search_bases[state->user_base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -2753,7 +2753,7 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) size_t dn_len; size_t c = 0; - DEBUG(9, ("Receiving info for the user\n")); + DEBUG(9, "Receiving info for the user\n"); ret = sdap_get_generic_recv(subreq, state, &count, &usr_attrs); talloc_zfree(subreq); @@ -2790,29 +2790,29 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) } } else if (count != 1) { DEBUG(SSSDBG_OP_FAILURE, - ("Expected one user entry and got %zu\n", count)); + "Expected one user entry and got %zu\n", count); ret = domain_to_basedn(state, state->dom->name, &expected_basedn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("domain_to_basedn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "domain_to_basedn failed.\n"); tevent_req_error(req, ret); return; } expected_basedn = talloc_asprintf(state, "%s%s", "cn=users,", expected_basedn); if (expected_basedn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_append failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_append failed.\n"); tevent_req_error(req, ENOMEM); return; } - DEBUG(SSSDBG_TRACE_ALL, ("Expected BaseDN is [%s].\n", expected_basedn)); + DEBUG(SSSDBG_TRACE_ALL, "Expected BaseDN is [%s].\n", expected_basedn); expected_basedn_len = strlen(expected_basedn); for (c = 0; c < count; c++) { ret = sysdb_attrs_get_string(usr_attrs[c], SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); tevent_req_error(req, ret); return; } @@ -2822,13 +2822,13 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) && strcasecmp(orig_dn + (dn_len - expected_basedn_len), expected_basedn) == 0) { DEBUG(SSSDBG_TRACE_ALL, - ("Found matching dn [%s].\n", orig_dn)); + "Found matching dn [%s].\n", orig_dn); break; } } if (c == count) { - DEBUG(SSSDBG_OP_FAILURE, ("No matching DN found.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No matching DN found.\n"); tevent_req_error(req, EINVAL); return; } @@ -2838,12 +2838,12 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) ret = sysdb_transaction_start(state->sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } in_transaction = true; - DEBUG(9, ("Storing the user\n")); + DEBUG(9, "Storing the user\n"); ret = sdap_save_user(state, state->opts, state->dom, state->orig_user, true, NULL, 0); @@ -2851,23 +2851,23 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) goto fail; } - DEBUG(9, ("Commit change\n")); + DEBUG(9, "Commit change\n"); ret = sysdb_transaction_commit(state->sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; ret = sysdb_get_real_name(state, state->dom, state->name, &cname); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot canonicalize username\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot canonicalize username\n"); tevent_req_error(req, ret); return; } - DEBUG(9, ("Process user's groups\n")); + DEBUG(9, "Process user's groups\n"); switch (state->opts->schema_type) { case SDAP_SCHEMA_RFC2307: @@ -2954,7 +2954,7 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -2976,7 +2976,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) char *group_sid_str; struct sdap_options *opts = state->opts; - DEBUG(9, ("Initgroups done\n")); + DEBUG(9, "Initgroups done\n"); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -3015,8 +3015,8 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret) { - DEBUG(9, ("Error in initgroups: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(9, "Error in initgroups: [%d][%s]\n", + ret, strerror(ret)); goto fail; } @@ -3026,7 +3026,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) if (state->use_id_mapping) { DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping primary group to unix ID\n")); + "Mapping primary group to unix ID\n"); /* The primary group ID is just the RID part of the objectSID * of the group. Generate the GID by adding this to the domain @@ -3047,7 +3047,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto fail; } @@ -3057,7 +3057,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) &primary_gid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("no primary group ID provided\n")); + "no primary group ID provided\n"); ret = EINVAL; goto fail; } @@ -3079,7 +3079,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) ret = sysdb_attrs_get_uint32_t(state->orig_user, SYSDB_GIDNUM, &primary_gid); if (ret != EOK) { - DEBUG(6, ("Could not find user's primary GID\n")); + DEBUG(6, "Could not find user's primary GID\n"); goto fail; } } @@ -3157,8 +3157,8 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx, attrs, &msg); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error searching user [%s] by name: [%s]\n", - name, strerror(ret))); + "Error searching user [%s] by name: [%s]\n", + name, strerror(ret)); goto done; } @@ -3192,8 +3192,8 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx, &sysdb_grouplist[i]); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine group name from [%s]: [%s]\n", - (const char *)groups->values[i].data, strerror(ret))); + "Could not determine group name from [%s]: [%s]\n", + (const char *)groups->values[i].data, strerror(ret)); goto done; } } diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c index 52adda3f8..5e26de109 100644 --- a/src/providers/ldap/sdap_async_initgroups_ad.c +++ b/src/providers/ldap/sdap_async_initgroups_ad.c @@ -105,8 +105,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, &state->attrs, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not build attribute map: [%s]\n", - strerror(ret))); + "Could not build attribute map: [%s]\n", + strerror(ret)); goto immediate; } @@ -114,8 +114,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(state, state->orig_dn, &sanitized_user_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not sanitize user DN: %s\n", - strerror(ret))); + "Could not sanitize user DN: %s\n", + strerror(ret)); goto immediate; } @@ -141,8 +141,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, ret = sdap_get_ad_match_rule_initgroups_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sdap_get_ad_match_rule_members_next_base failed: [%s]\n", - strerror(ret))); + "sdap_get_ad_match_rule_members_next_base failed: [%s]\n", + strerror(ret)); goto immediate; } @@ -171,8 +171,8 @@ sdap_get_ad_match_rule_initgroups_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -208,12 +208,12 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", sss_strerror(ret))); + "LDAP search failed: [%s]\n", sss_strerror(ret)); goto error; } DEBUG(SSSDBG_TRACE_LIBS, - ("Search for users returned %zu results\n", count)); + "Search for users returned %zu results\n", count); /* Add this batch of groups to the list */ if (count > 0) { @@ -250,7 +250,7 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) if (state->count == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("User is not a member of any group in the search bases\n")); + "User is not a member of any group in the search bases\n"); } /* Get the current sysdb group list for this user @@ -260,9 +260,9 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) state->name, &sysdb_grouplist); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not get the list of groups for [%s] in the sysdb: " + "Could not get the list of groups for [%s] in the sysdb: " "[%s]\n", - state->name, strerror(ret))); + state->name, strerror(ret)); goto error; } @@ -280,8 +280,8 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) state->count); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not store groups for user [%s]: [%s]\n", - state->name, strerror(ret))); + "Could not store groups for user [%s]: [%s]\n", + state->name, strerror(ret)); goto error; } @@ -328,7 +328,7 @@ sdap_get_ad_tokengroups_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_get_ad_tokengroups_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -383,13 +383,13 @@ static void sdap_get_ad_tokengroups_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", sss_strerror(ret))); + "LDAP search failed: [%s]\n", sss_strerror(ret)); goto done; } if (num_users != 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("More than one result on a base search!\n")); + "More than one result on a base search!\n"); ret = EINVAL; goto done; } @@ -397,16 +397,16 @@ static void sdap_get_ad_tokengroups_done(struct tevent_req *subreq) /* get the list of sids from tokengroups */ ret = sysdb_attrs_get_el_ext(users[0], AD_TOKENGROUPS_ATTR, false, &el); if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_LIBS, ("No tokenGroups entries for [%s]\n", - state->username)); + DEBUG(SSSDBG_TRACE_LIBS, "No tokenGroups entries for [%s]\n", + state->username); state->sids = NULL; state->num_sids = 0; ret = EOK; goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not read tokenGroups attribute: " - "[%s]\n", strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not read tokenGroups attribute: " + "[%s]\n", strerror(ret)); goto done; } @@ -423,8 +423,8 @@ static void sdap_get_ad_tokengroups_done(struct tevent_req *subreq) el->values[i].length, &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert binary SID to string: [%s]. Skipping\n", - idmap_error_string(err))); + "Could not convert binary SID to string: [%s]. Skipping\n", + idmap_error_string(err)); continue; } @@ -487,7 +487,7 @@ sdap_ad_tokengroups_update_members(const char *username, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -495,8 +495,8 @@ sdap_ad_tokengroups_update_members(const char *username, ret = get_sysdb_grouplist_dn(tmp_ctx, sysdb, domain, username, &sysdb_groups); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not get the list of groups for " - "[%s] in the sysdb: [%s]\n", username, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not get the list of groups for " + "[%s] in the sysdb: [%s]\n", username, strerror(ret)); goto done; } @@ -508,14 +508,14 @@ sdap_ad_tokengroups_update_members(const char *username, goto done; } - DEBUG(SSSDBG_TRACE_LIBS, ("Updating memberships for [%s]\n", username)); + DEBUG(SSSDBG_TRACE_LIBS, "Updating memberships for [%s]\n", username); ret = sysdb_update_members_dn(domain, username, SYSDB_MEMBER_USER, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -555,7 +555,7 @@ sdap_ad_resolve_sids_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_ad_resolve_sids_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -608,14 +608,14 @@ static errno_t sdap_ad_resolve_sids_step(struct tevent_req *req) domain = find_subdomain_by_sid(state->domain, state->current_sid); if (domain == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SID %s does not belong to any known " - "domain\n", state->current_sid)); + DEBUG(SSSDBG_MINOR_FAILURE, "SID %s does not belong to any known " + "domain\n", state->current_sid); } } while (domain == NULL); sdap_domain = sdap_domain_get(state->opts, domain); if (sdap_domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("SDAP domain does not exist?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "SDAP domain does not exist?\n"); return ERR_INTERNAL; } @@ -645,9 +645,9 @@ static void sdap_ad_resolve_sids_done(struct tevent_req *subreq) ret = groups_get_recv(subreq, &dp_error, &sdap_error); talloc_zfree(subreq); if (ret != EOK || sdap_error != EOK || dp_error != DP_ERR_OK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to resolve SID %s [dp_error: %d, " + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to resolve SID %s [dp_error: %d, " "sdap_error: %d, ret: %d]: %s\n", state->current_sid, dp_error, - sdap_error, ret, strerror(ret))); + sdap_error, ret, strerror(ret)); goto done; } @@ -713,7 +713,7 @@ sdap_ad_tokengroups_initgr_mapping_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_ad_tokengroups_initgr_mapping_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -733,15 +733,15 @@ sdap_ad_tokengroups_initgr_mapping_send(TALLOC_CTX *mem_ctx, sdom = sdap_domain_get(opts, domain); if (sdom == NULL || sdom->pvt == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID ctx available for [%s].\n", - domain->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID ctx available for [%s].\n", + domain->name); ret = EINVAL; goto immediately; } subdom_id_ctx = talloc_get_type(sdom->pvt, struct ad_id_ctx); state->op = sdap_id_op_create(state, subdom_id_ctx->ldap_ctx->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto immediately; } @@ -827,7 +827,7 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); ret = ENOMEM; goto done; } @@ -838,8 +838,8 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) ret = sdap_get_ad_tokengroups_recv(state, subreq, &num_sids, &sids); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to acquire tokengroups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to acquire tokengroups [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -859,27 +859,27 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) for (i = 0; i < num_sids; i++) { sid = sids[i]; - DEBUG(SSSDBG_TRACE_LIBS, ("Processing membership SID [%s]\n", sid)); + DEBUG(SSSDBG_TRACE_LIBS, "Processing membership SID [%s]\n", sid); ret = sdap_idmap_sid_to_unix(state->idmap_ctx, sid, &gid); if (ret == ENOTSUP) { - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; continue; } else if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not convert SID to GID: [%s]. " - "Skipping\n", strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not convert SID to GID: [%s]. " + "Skipping\n", strerror(ret)); continue; } domain = find_subdomain_by_sid(get_domains_head(state->domain), sid); if (domain == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Domain not found for SID %s\n", sid)); + DEBUG(SSSDBG_MINOR_FAILURE, "Domain not found for SID %s\n", sid); continue; } - DEBUG(SSSDBG_TRACE_LIBS, ("SID [%s] maps to GID [%"SPRIgid"]\n", - sid, gid)); + DEBUG(SSSDBG_TRACE_LIBS, "SID [%s] maps to GID [%"SPRIgid"]\n", + sid, gid); /* Check whether this GID already exists in the sysdb */ ret = sysdb_search_group_by_gid(tmp_ctx, domain, gid, attrs, &msg); @@ -887,7 +887,7 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve group name from sysdb\n")); + "Could not retrieve group name from sysdb\n"); ret = EINVAL; goto done; } @@ -899,14 +899,14 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) ret = sysdb_add_incomplete_group(domain, name, gid, NULL, sid, false, now); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not create incomplete " - "group: [%s]\n", strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not create incomplete " + "group: [%s]\n", strerror(ret)); goto done; } } else { /* Unexpected error */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not look up group in sysdb: " - "[%s]\n", strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not look up group in sysdb: " + "[%s]\n", strerror(ret)); goto done; } @@ -924,15 +924,15 @@ static void sdap_ad_tokengroups_initgr_mapping_done(struct tevent_req *subreq) state->sysdb, state->domain, groups); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; } ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not commit transaction! [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not commit transaction! [%s]\n", + strerror(ret)); goto done; } in_transaction = false; @@ -942,8 +942,8 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not cancel transaction! [%s]\n", - strerror(sret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not cancel transaction! [%s]\n", + strerror(sret)); } if (ret != EOK) { @@ -1007,7 +1007,7 @@ sdap_ad_tokengroups_initgr_posix_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_ad_tokengroups_initgr_posix_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -1028,15 +1028,15 @@ sdap_ad_tokengroups_initgr_posix_send(TALLOC_CTX *mem_ctx, sdom = sdap_domain_get(opts, domain); if (sdom == NULL || sdom->pvt == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID ctx available for [%s].\n", - domain->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID ctx available for [%s].\n", + domain->name); ret = EINVAL; goto immediately; } subdom_id_ctx = talloc_get_type(sdom->pvt, struct ad_id_ctx); state->op = sdap_id_op_create(state, subdom_id_ctx->ldap_ctx->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto immediately; } @@ -1123,7 +1123,7 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); ret = ENOMEM; goto done; } @@ -1135,8 +1135,8 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) ret = sdap_get_ad_tokengroups_recv(state, subreq, &num_sids, &sids); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to acquire tokengroups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to acquire tokengroups [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -1159,11 +1159,11 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) * to remember the SID and download missing groups one by one. */ for (i = 0; i < num_sids; i++) { sid = sids[i]; - DEBUG(SSSDBG_TRACE_LIBS, ("Processing membership SID [%s]\n", sid)); + DEBUG(SSSDBG_TRACE_LIBS, "Processing membership SID [%s]\n", sid); domain = find_subdomain_by_sid(get_domains_head(state->domain), sid); if (domain == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Domain not found for SID %s\n", sid)); + DEBUG(SSSDBG_MINOR_FAILURE, "Domain not found for SID %s\n", sid); continue; } @@ -1179,7 +1179,7 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve group name from sysdb\n")); + "Could not retrieve group name from sysdb\n"); ret = EINVAL; goto done; } @@ -1197,11 +1197,11 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) missing_sids[num_missing_sids] = talloc_steal(missing_sids, sid); num_missing_sids++; - DEBUG(SSSDBG_TRACE_FUNC, ("Missing SID %s will be downloaded\n", - sid)); + DEBUG(SSSDBG_TRACE_FUNC, "Missing SID %s will be downloaded\n", + sid); } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not look up group in sysdb: " - "[%s]\n", strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not look up group in sysdb: " + "[%s]\n", strerror(ret)); goto done; } } @@ -1214,8 +1214,8 @@ sdap_ad_tokengroups_initgr_posix_tg_done(struct tevent_req *subreq) state->sysdb, state->domain, valid_groups); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -1256,8 +1256,8 @@ sdap_ad_tokengroups_initgr_posix_sids_done(struct tevent_req *subreq) ret = sdap_ad_resolve_sids_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to resolve missing SIDs " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to resolve missing SIDs " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -1306,7 +1306,7 @@ sdap_ad_tokengroups_initgroups_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_ad_tokengroups_initgroups_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c index 306f55397..51e88bbfb 100644 --- a/src/providers/ldap/sdap_async_nested_groups.c +++ b/src/providers/ldap/sdap_async_nested_groups.c @@ -197,8 +197,8 @@ static errno_t sdap_nested_group_hash_entry(hash_table_t *table, return ret; } - DEBUG(SSSDBG_TRACE_ALL, ("Inserting [%s] into hash table [%s]\n", - name, table_name)); + DEBUG(SSSDBG_TRACE_ALL, "Inserting [%s] into hash table [%s]\n", + name, table_name); key.type = HASH_KEY_STRING; key.str = talloc_strdup(NULL, name); @@ -246,12 +246,12 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, if (group_ctx->opts->schema_type == SDAP_SCHEMA_AD) { ret = sysdb_attrs_get_int32_t(group, SYSDB_GROUP_TYPE, &ad_group_type); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_int32_t failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_int32_t failed.\n"); return ret; } - DEBUG(SSSDBG_TRACE_ALL, ("AD group has type flags %#x.\n", - ad_group_type)); + DEBUG(SSSDBG_TRACE_ALL, "AD group has type flags %#x.\n", + ad_group_type); /* Only security groups from AD are considered for POSIX groups. * Additionally only global and universal group are taken to account * for trusted domains. */ @@ -261,7 +261,7 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, || (ad_group_type & SDAP_AD_GROUP_TYPE_UNIVERSAL))))) { posix_group = false; gid = 0; - DEBUG(SSSDBG_TRACE_FUNC, ("Filtering AD group.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Filtering AD group.\n"); } } @@ -269,15 +269,15 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, &gid); if (ret == ENOENT || (ret == EOK && gid == 0) || !posix_group) { DEBUG(SSSDBG_TRACE_ALL, - ("The group's gid was %s\n", ret == ENOENT ? "missing" : "zero")); + "The group's gid was %s\n", ret == ENOENT ? "missing" : "zero"); DEBUG(SSSDBG_TRACE_INTERNAL, - ("Marking group as non-posix and setting GID=0!\n")); + "Marking group as non-posix and setting GID=0!\n"); if (ret == ENOENT || !posix_group) { ret = sysdb_attrs_add_uint32(group, map[SDAP_AT_GROUP_GID].sys_name, 0); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to add a GID to non-posix group!\n")); + "Failed to add a GID to non-posix group!\n"); return ret; } } @@ -285,7 +285,7 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, ret = sysdb_attrs_add_bool(group, SYSDB_POSIX, false); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error: Failed to mark group as non-posix!\n")); + "Error: Failed to mark group as non-posix!\n"); return ret; } } else if (ret != EOK) { @@ -321,7 +321,7 @@ static errno_t sdap_nested_group_sysdb_search(struct sss_domain_info *domain, } if (count != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one entry found?\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one entry found?\n"); ret = EFAULT; goto done; } @@ -331,7 +331,7 @@ static errno_t sdap_nested_group_sysdb_search(struct sss_domain_info *domain, if (user) { uid = ldb_msg_find_attr_as_uint64(msgs[0], SYSDB_UIDNUM, 0); if (uid == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("User with no UID?\n")); + DEBUG(SSSDBG_OP_FAILURE, "User with no UID?\n"); ret = EINVAL; goto done; } @@ -367,7 +367,7 @@ sdap_nested_group_check_cache(struct sdap_options *opts, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -478,7 +478,7 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -525,7 +525,7 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, dn, &type); if (ret == EOK) { /* found and valid */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] found in cache, skipping\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] found in cache, skipping\n", dn); continue; } else if (ret != EAGAIN && ret != ENOENT) { /* error */ @@ -543,18 +543,18 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, if (is_user && is_group) { /* search bases overlap */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is unknown object\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is unknown object\n", dn); type = SDAP_NESTED_GROUP_DN_UNKNOWN; } else if (is_user) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is a user\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is a user\n", dn); type = SDAP_NESTED_GROUP_DN_USER; } else if (is_group) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is a group\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is a group\n", dn); type = SDAP_NESTED_GROUP_DN_GROUP; } else { /* dn is outside search bases */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is out of scope of configured " - "search bases, skipping\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is out of scope of configured " + "search bases, skipping\n", dn); continue; } } @@ -562,8 +562,8 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, /* check nesting level */ if (type == SDAP_NESTED_GROUP_DN_GROUP) { if (nesting_level >= group_ctx->max_nesting_level) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", dn, nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", dn, nesting_level); talloc_zfree(user_filter); talloc_zfree(group_filter); continue; @@ -637,7 +637,7 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -650,15 +650,15 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->users); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to create hash table [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n", + ret, strerror(ret)); goto immediately; } ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->groups); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to create hash table [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n", + ret, strerror(ret)); goto immediately; } @@ -683,8 +683,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, if (state->group_ctx->try_deref) { for (i = 0; opts->sdom->user_search_bases[i] != NULL; i++) { if (opts->sdom->user_search_bases[i]->filter != NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("User search base contains filter, " - "dereference will be disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "User search base contains filter, " + "dereference will be disabled\n"); state->group_ctx->try_deref = false; break; } @@ -694,8 +694,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, if (state->group_ctx->try_deref) { for (i = 0; opts->sdom->group_search_bases[i] != NULL; i++) { if (opts->sdom->group_search_bases[i]->filter != NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("Group search base contains filter, " - "dereference will be disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Group search base contains filter, " + "dereference will be disabled\n"); state->group_ctx->try_deref = false; break; } @@ -705,8 +705,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, /* insert initial group into hash table */ ret = sdap_nested_group_hash_group(state->group_ctx, group); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to insert group into hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to insert group into hash table " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; } @@ -774,8 +774,8 @@ errno_t sdap_nested_group_recv(TALLOC_CTX *mem_ctx, return ret; } - DEBUG(SSSDBG_TRACE_FUNC, ("%lu users found in the hash table\n", - num_users)); + DEBUG(SSSDBG_TRACE_FUNC, "%lu users found in the hash table\n", + num_users); ret = sdap_nested_group_extract_hash_table(state, state->group_ctx->groups, &num_groups, &groups); @@ -783,8 +783,8 @@ errno_t sdap_nested_group_recv(TALLOC_CTX *mem_ctx, return ret; } - DEBUG(SSSDBG_TRACE_FUNC, ("%lu groups found in the hash table\n", - num_groups)); + DEBUG(SSSDBG_TRACE_FUNC, "%lu groups found in the hash table\n", + num_groups); if (_num_users != NULL) { *_num_users = num_users; @@ -836,7 +836,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_process_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -848,8 +848,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, /* get original dn */ ret = sysdb_attrs_get_string(group, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve original dn " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve original dn " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; } @@ -859,7 +859,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, goto immediately; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("About to process group [%s]\n", orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "About to process group [%s]\n", orig_dn); /* get member list */ ret = sysdb_attrs_get_el(group, group_map[SDAP_AT_GROUP_MEMBER].sys_name, @@ -868,8 +868,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, ret = EOK; /* no members */ goto immediately; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve member list " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve member list " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; } @@ -880,8 +880,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, &state->num_missing_total, &state->num_missing_groups); - DEBUG(SSSDBG_TRACE_INTERNAL, ("Looking up %d/%d members of group [%s]\n", - state->num_missing_total, members->num_values, orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Looking up %d/%d members of group [%s]\n", + state->num_missing_total, members->num_values, orig_dn); if (state->num_missing_total == 0) { ret = EOK; /* we're done */ @@ -891,15 +891,15 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, /* process members */ if (group_ctx->try_deref && state->num_missing_total > group_ctx->deref_treshold) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Dereferencing members of group [%s]\n", - orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Dereferencing members of group [%s]\n", + orig_dn); state->deref = true; subreq = sdap_nested_group_deref_send(state, ev, group_ctx, members, orig_dn, state->nesting_level); } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Members of group [%s] will be " - "processed individually\n", orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Members of group [%s] will be " + "processed individually\n", orig_dn); state->deref = false; subreq = sdap_nested_group_single_send(state, ev, group_ctx, state->missing, @@ -944,8 +944,8 @@ static void sdap_nested_group_process_done(struct tevent_req *subreq) state->group_ctx->try_deref = false; state->deref = false; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Members of group [%s] will be " - "processed individually\n", state->group_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Members of group [%s] will be " + "processed individually\n", state->group_dn); subreq = sdap_nested_group_single_send(state, state->ev, @@ -1011,7 +1011,7 @@ sdap_nested_group_recurse_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_recurse_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -1133,7 +1133,7 @@ sdap_nested_group_single_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_single_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -1257,12 +1257,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save user in hash table */ ret = sdap_nested_group_hash_user(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, ("User was looked up twice, " - "this shouldn't have happened.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "User was looked up twice, " + "this shouldn't have happened.\n"); goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to save user in hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save user in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; } break; @@ -1286,12 +1286,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) ret = sysdb_attrs_get_string(entry, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The entry has no originalDN\n")); + "The entry has no originalDN\n"); orig_dn = "invalid"; } - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", orig_dn, state->nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", orig_dn, state->nesting_level); break; } } @@ -1299,12 +1299,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save group in hash table */ ret = sdap_nested_group_hash_group(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, ("Group was looked up twice, " - "this shouldn't have happened.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Group was looked up twice, " + "this shouldn't have happened.\n"); goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to save group in hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save group in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -1337,8 +1337,8 @@ static void sdap_nested_group_single_step_done(struct tevent_req *subreq) ret = sdap_nested_group_single_step_process(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing direct membership " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -1368,7 +1368,7 @@ static void sdap_nested_group_single_step_done(struct tevent_req *subreq) done: if (ret == EOK) { /* tevent_req_error() cannot cope with EOK */ - DEBUG(SSSDBG_CRIT_FAILURE, ("We should not get here with EOK\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "We should not get here with EOK\n"); tevent_req_error(req, EINVAL); } else if (ret != EAGAIN) { tevent_req_error(req, ret); @@ -1388,8 +1388,8 @@ static void sdap_nested_group_single_done(struct tevent_req *subreq) ret = sdap_nested_group_recurse_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing nested groups " - "[%d]: %s", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing nested groups " + "[%d]: %s", ret, strerror(ret)); tevent_req_error(req, ret); } @@ -1540,7 +1540,7 @@ sdap_nested_group_lookup_user_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_user_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -1553,8 +1553,8 @@ sdap_nested_group_lookup_user_send(TALLOC_CTX *mem_ctx, goto immediately; } - DEBUG(SSSDBG_MINOR_FAILURE, ("Couldn't parse out user information " - "based on DN %s, falling back to an LDAP lookup\n", member->dn)); + DEBUG(SSSDBG_MINOR_FAILURE, "Couldn't parse out user information " + "based on DN %s, falling back to an LDAP lookup\n", member->dn); } /* only pull down username and originalDN */ @@ -1637,7 +1637,7 @@ static void sdap_nested_group_lookup_user_done(struct tevent_req *subreq) state->user = NULL; } else { DEBUG(SSSDBG_OP_FAILURE, - ("BASE search returned more than one records\n")); + "BASE search returned more than one records\n"); ret = EIO; goto done; } @@ -1693,7 +1693,7 @@ sdap_nested_group_lookup_group_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_group_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -1773,7 +1773,7 @@ static void sdap_nested_group_lookup_group_done(struct tevent_req *subreq) state->group = NULL; } else { DEBUG(SSSDBG_OP_FAILURE, - ("BASE search returned more than one records\n")); + "BASE search returned more than one records\n"); ret = EIO; goto done; } @@ -1833,7 +1833,7 @@ sdap_nested_group_lookup_unknown_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_unknown_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -2012,7 +2012,7 @@ sdap_nested_group_deref_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_deref_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -2102,8 +2102,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Received %zu dereference results, " - "about to process them\n", num_entries)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Received %zu dereference results, " + "about to process them\n", num_entries); /* * We don't have any knowledge about possible number of groups when @@ -2121,7 +2121,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) ret = sysdb_attrs_get_string(entries[i]->attrs, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The entry has no originalDN\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The entry has no originalDN\n"); goto done; } @@ -2176,8 +2176,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) entries[i]->attrs); if (ret != EOK && ret != EEXIST) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to save user in hash table " - "[%d]: %s\n", ret, strerror(ret))); + "Unable to save user in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -2186,8 +2186,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) /* skip the group if we have reached the nesting limit */ if (state->nesting_level >= state->group_ctx->max_nesting_level) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", orig_dn, state->nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", orig_dn, state->nesting_level); continue; } @@ -2203,8 +2203,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) continue; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to save group in hash table " - "[%d]: %s\n", ret, strerror(ret))); + "Unable to save group in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -2215,7 +2215,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) } else { /* this should never happen, but if it does, do not loop forever */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Entry does not match any known map, skipping\n")); + "Entry does not match any known map, skipping\n"); continue; } } @@ -2252,8 +2252,8 @@ static void sdap_nested_group_deref_direct_done(struct tevent_req *subreq) ret = sdap_nested_group_deref_direct_process(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing direct membership " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership " + "[%d]: %s\n", ret, strerror(ret)); goto done; } @@ -2276,7 +2276,7 @@ static void sdap_nested_group_deref_direct_done(struct tevent_req *subreq) done: if (ret == EOK) { /* tevent_req_error() cannot cope with EOK */ - DEBUG(SSSDBG_CRIT_FAILURE, ("We should not get here with EOK\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "We should not get here with EOK\n"); tevent_req_error(req, EINVAL); } else if (ret != EAGAIN) { tevent_req_error(req, ret); diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c index 217c2c5ed..d6446fc30 100644 --- a/src/providers/ldap/sdap_async_netgroups.c +++ b/src/providers/ldap/sdap_async_netgroups.c @@ -54,11 +54,11 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, ret = sdap_get_netgroup_primary_name(memctx, opts, attrs, dom, &name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get netgroup name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get netgroup name\n"); goto fail; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing netgroup %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing netgroup %s\n", name); netgroup_attrs = sysdb_new_attrs(memctx); if (!netgroup_attrs) { @@ -80,8 +80,8 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, goto fail; } if (el->num_values == 0) { - DEBUG(7, ("Original mod-Timestamp is not available for [%s].\n", - name)); + DEBUG(7, "Original mod-Timestamp is not available for [%s].\n", + name); } else { ret = sysdb_attrs_add_string(netgroup_attrs, opts->netgroup_map[SDAP_AT_NETGROUP_MODSTAMP].sys_name, @@ -118,12 +118,12 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, goto fail; } - DEBUG(6, ("Storing info for netgroup %s\n", name)); + DEBUG(6, "Storing info for netgroup %s\n", name); ret = sdap_save_all_names(name, attrs, dom, netgroup_attrs); if (ret != EOK) { - DEBUG(1, ("Failed to save netgroup names\n")); + DEBUG(1, "Failed to save netgroup names\n"); goto fail; } @@ -133,7 +133,7 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, ret = list_missing_attrs(attrs, opts->netgroup_map, SDAP_OPTS_NETGROUP, attrs, &missing); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to list missing attributes\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to list missing attributes\n"); goto fail; } @@ -148,7 +148,7 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, return EOK; fail: - DEBUG(2, ("Failed to save netgroup %s\n", name)); + DEBUG(2, "Failed to save netgroup %s\n", name); return ret; } @@ -171,14 +171,14 @@ errno_t update_dn_list(struct dn_item *dn_list, const size_t count, for(c = 0; c < count; c++) { dn = ldb_msg_find_attr_as_string(res[c], SYSDB_ORIG_DN, NULL); if (dn == NULL) { - DEBUG(1, ("Missing original DN.\n")); + DEBUG(1, "Missing original DN.\n"); return EINVAL; } if (strcmp(dn, dn_item->dn) == 0) { - DEBUG(9, ("Found matching entry for [%s].\n", dn_item->dn)); + DEBUG(9, "Found matching entry for [%s].\n", dn_item->dn); cn = ldb_msg_find_attr_as_string(res[c], SYSDB_NAME, NULL); if (cn == NULL) { - DEBUG(1, ("Missing name.\n")); + DEBUG(1, "Missing name.\n"); return EINVAL; } dn_item->cn = talloc_strdup(dn_item, cn); @@ -255,7 +255,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, SYSDB_ORIG_NETGROUP_MEMBER, state, &member_list); if (ret != EOK) { - DEBUG(7, ("Missing netgroup members.\n")); + DEBUG(7, "Missing netgroup members.\n"); continue; } @@ -263,12 +263,12 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, if (is_dn(member_list[mc])) { dn_item = talloc_zero(state, struct dn_item); if (dn_item == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); ret = ENOMEM; goto fail; } - DEBUG(9, ("Adding [%s] to DN list.\n", member_list[mc])); + DEBUG(9, "Adding [%s] to DN list.\n", member_list[mc]); dn_item->netgroup = netgroups[c]; dn_item->dn = member_list[mc]; DLIST_ADD(state->dn_list, dn_item); @@ -276,7 +276,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, ret = sysdb_attrs_add_string(netgroups[c], SYSDB_NETGROUP_MEMBER, member_list[mc]); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); goto fail; } } @@ -284,7 +284,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, } if (state->dn_list == NULL) { - DEBUG(9, ("No DNs found among netgroup members.\n")); + DEBUG(9, "No DNs found among netgroup members.\n"); tevent_req_done(req); tevent_req_post(req, ev); return req; @@ -292,7 +292,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, dn_filter = talloc_strdup(state, "(|"); if (dn_filter == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM;; goto fail; } @@ -301,7 +301,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, dn_filter = talloc_asprintf_append(dn_filter, "(%s=%s)", SYSDB_ORIG_DN, dn_item->dn); if (dn_filter == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); ret = ENOMEM; goto fail; } @@ -309,14 +309,14 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, dn_filter = talloc_asprintf_append(dn_filter, ")"); if (dn_filter == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); ret = ENOMEM; goto fail; } sysdb_filter = talloc_asprintf(state, "(&(%s)%s)", SYSDB_NC, dn_filter); if (sysdb_filter == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto fail; } @@ -332,7 +332,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, talloc_zfree(netgr_basedn); talloc_zfree(sysdb_filter); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_search_entry failed.\n")); + DEBUG(1, "sysdb_search_entry failed.\n"); goto fail; } @@ -340,7 +340,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, ret = update_dn_list(state->dn_list, sysdb_count, sysdb_res, &all_resolved); if (ret != EOK) { - DEBUG(1, ("update_dn_list failed.\n")); + DEBUG(1, "update_dn_list failed.\n"); goto fail; } @@ -350,7 +350,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, SYSDB_NETGROUP_MEMBER, dn_item->cn); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); goto fail; } } @@ -364,7 +364,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, state->dn_idx = state->dn_list; ret = netgr_translate_members_ldap_step(req); if (ret != EOK && ret != EAGAIN) { - DEBUG(1, ("netgr_translate_members_ldap_step failed.\n")); + DEBUG(1, "netgr_translate_members_ldap_step failed.\n"); goto fail; } @@ -407,7 +407,7 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) SYSDB_NETGROUP_MEMBER, state->dn_item->cn); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); tevent_req_error(req, ret); return ret; } @@ -427,14 +427,14 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) cn_attr = talloc_array(state, const char *, 3); if (cn_attr == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); return ENOMEM; } cn_attr[0] = state->opts->netgroup_map[SDAP_AT_NETGROUP_NAME].name; cn_attr[1] = "objectclass"; cn_attr[2] = NULL; - DEBUG(9, ("LDAP base search for [%s].\n", state->dn_item->dn)); + DEBUG(9, "LDAP base search for [%s].\n", state->dn_item->dn); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, state->dn_item->dn, LDAP_SCOPE_BASE, filter, cn_attr, state->opts->netgroup_map, @@ -443,7 +443,7 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) SDAP_SEARCH_TIMEOUT), false); if (!subreq) { - DEBUG(1, ("sdap_get_generic_send failed.\n")); + DEBUG(1, "sdap_get_generic_send failed.\n"); return ENOMEM; } talloc_steal(subreq, cn_attr); @@ -466,42 +466,42 @@ static void netgr_translate_members_ldap_done(struct tevent_req *subreq) ret = sdap_get_generic_recv(subreq, state, &count, &netgroups); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("sdap_get_generic request failed.\n")); + DEBUG(1, "sdap_get_generic request failed.\n"); goto fail; } switch (count) { case 0: - DEBUG(0, ("sdap_get_generic_recv found no entry for [%s].\n", - state->dn_item->dn)); + DEBUG(0, "sdap_get_generic_recv found no entry for [%s].\n", + state->dn_item->dn); break; case 1: ret = sysdb_attrs_get_string(netgroups[0], SYSDB_NAME, &str); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); break; } state->dn_item->cn = talloc_strdup(state->dn_item, str); if (state->dn_item->cn == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); } break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected number of results [%zu] for base search.\n", - count)); + "Unexpected number of results [%zu] for base search.\n", + count); } if (state->dn_item->cn == NULL) { - DEBUG(1, ("Failed to resolve netgroup name for DN [%s], using DN.\n", - state->dn_item->dn)); + DEBUG(1, "Failed to resolve netgroup name for DN [%s], using DN.\n", + state->dn_item->dn); state->dn_item->cn = talloc_strdup(state->dn_item, state->dn_item->dn); } state->dn_idx = state->dn_item->next; ret = netgr_translate_members_ldap_step(req); if (ret != EOK && ret != EAGAIN) { - DEBUG(1, ("netgr_translate_members_ldap_step failed.\n")); + DEBUG(1, "netgr_translate_members_ldap_step failed.\n"); goto fail; } @@ -590,7 +590,7 @@ struct tevent_req *sdap_get_netgroups_send(TALLOC_CTX *memctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Netgroup lookup request without a netgroup search base\n")); + "Netgroup lookup request without a netgroup search base\n"); ret = EINVAL; goto done; } @@ -622,8 +622,8 @@ static errno_t sdap_get_netgroups_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for netgroups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for netgroups with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -658,7 +658,7 @@ static void sdap_get_netgroups_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_FUNC, - ("Search for netgroups, returned %zu results.\n", state->count)); + "Search for netgroups, returned %zu results.\n", state->count); if (state->count == 0) { /* No netgroups found in this search */ @@ -716,13 +716,13 @@ static void netgr_translate_members_done(struct tevent_req *subreq) &state->higher_timestamp, now); if (ret) { - DEBUG(2, ("Failed to store netgroups.\n")); + DEBUG(2, "Failed to store netgroups.\n"); tevent_req_error(req, ret); return; } } - DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Netgroups - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Netgroups - Done\n", state->count); tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c index b36245962..54f3ffb74 100644 --- a/src/providers/ldap/sdap_async_services.c +++ b/src/providers/ldap/sdap_async_services.c @@ -104,7 +104,7 @@ sdap_get_services_send(TALLOC_CTX *memctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Services lookup request without a search base\n")); + "Services lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -137,8 +137,8 @@ sdap_get_services_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for services with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for services with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -177,8 +177,8 @@ sdap_get_services_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_FUNC, - ("Search for services, returned %zu results.\n", - count)); + "Search for services, returned %zu results.\n", + count); if (state->enumeration || count == 0) { /* No services found in this search or enumerating */ @@ -234,13 +234,13 @@ sdap_get_services_process(struct tevent_req *subreq) &state->higher_usn); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store services.\n")); + "Failed to store services.\n"); tevent_req_error(req, ret); return; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Saving %zu services - Done\n", state->count)); + "Saving %zu services - Done\n", state->count); tevent_req_done(req); } @@ -274,7 +274,7 @@ sdap_save_services(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } @@ -292,10 +292,10 @@ sdap_save_services(TALLOC_CTX *mem_ctx, * Just report the failure to save and go on */ if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store service %zu. Ignoring.\n", i)); + "Failed to store service %zu. Ignoring.\n", i); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Service [%zu/%zu] processed!\n", i, num_services)); + "Service [%zu/%zu] processed!\n", i, num_services); } if (usn_value) { @@ -316,7 +316,7 @@ sdap_save_services(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to commit transaction!\n")); + "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -330,7 +330,7 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to cancel transaction!\n")); + "Failed to cancel transaction!\n"); } } talloc_free(tmp_ctx); @@ -360,7 +360,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, uint16_t port; uint64_t cache_timeout; - DEBUG(SSSDBG_TRACE_ALL, ("Saving service\n")); + DEBUG(SSSDBG_TRACE_ALL, "Saving service\n"); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -381,11 +381,11 @@ sdap_save_service(TALLOC_CTX *mem_ctx, &name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine the primary name of the service\n")); + "Could not determine the primary name of the service\n"); goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Primary name: [%s]\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Primary name: [%s]\n", name); /* Handle any available aliases */ @@ -394,7 +394,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, &aliases); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service aliases\n")); + "Failed to identify service aliases\n"); goto done; } @@ -402,8 +402,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_uint16_t(attrs, SYSDB_SVC_PORT, &port); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service port: [%s]\n", - strerror(ret))); + "Failed to identify service port: [%s]\n", + strerror(ret)); goto done; } @@ -412,8 +412,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, tmp_ctx, &protocols); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service protocols: [%s]\n", - strerror(ret))); + "Failed to identify service protocols: [%s]\n", + strerror(ret)); goto done; } @@ -423,8 +423,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, dom->case_sensitive, &cased_protocols); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to get case_sensitive protocols names: [%s]\n", - strerror(ret))); + "Failed to get case_sensitive protocols names: [%s]\n", + strerror(ret)); goto done; } } @@ -436,22 +436,22 @@ sdap_save_service(TALLOC_CTX *mem_ctx, opts->service_map[SDAP_AT_SERVICE_USN].sys_name, &el); if (ret && ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve USN value: [%s]\n", - strerror(ret))); + "Failed to retrieve USN value: [%s]\n", + strerror(ret)); goto done; } if (ret == ENOENT || el->num_values == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Original USN value is not available for [%s].\n", - name)); + "Original USN value is not available for [%s].\n", + name); } else { ret = sysdb_attrs_add_string(svc_attrs, opts->service_map[SDAP_AT_SERVICE_USN].sys_name, (const char*)el->values[0].data); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add USN value: [%s]\n", - strerror(ret))); + "Failed to add USN value: [%s]\n", + strerror(ret)); goto done; } usn_value = talloc_strdup(tmp_ctx, (const char*)el->values[0].data); @@ -468,8 +468,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, attrs, &missing); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify removed attributes: [%s]\n", - strerror(ret))); + "Failed to identify removed attributes: [%s]\n", + strerror(ret)); goto done; } @@ -479,8 +479,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, svc_attrs, missing, cache_timeout, now); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store service in the sysdb: [%s]\n", - strerror(ret))); + "Failed to store service in the sysdb: [%s]\n", + strerror(ret)); goto done; } @@ -568,7 +568,7 @@ enum_services_send(TALLOC_CTX *memctx, id_ctx->opts->service_map[SDAP_AT_SERVICE_PROTOCOL].name); } if (!state->filter) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to build base filter\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -633,8 +633,8 @@ enum_services_op_done(struct tevent_req *subreq) } } - DEBUG(SSSDBG_FUNC_DATA, ("Services higher USN value: [%s]\n", - state->id_ctx->srv_opts->max_service_value)); + DEBUG(SSSDBG_FUNC_DATA, "Services higher USN value: [%s]\n", + state->id_ctx->srv_opts->max_service_value); tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c index b6a5cac75..b4899cbaa 100644 --- a/src/providers/ldap/sdap_async_sudo.c +++ b/src/providers/ldap/sdap_async_sudo.c @@ -206,7 +206,7 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req) if (state->sdap_op == NULL) { state->sdap_op = sdap_id_op_create(state, state->sdap_conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create() failed\n"); state->dp_error = DP_ERR_FATAL; state->error = EIO; return EIO; @@ -216,7 +216,7 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req) subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_id_op_connect_send() failed: %d(%s)\n", ret, strerror(ret))); + "sdap_id_op_connect_send() failed: %d(%s)\n", ret, strerror(ret)); talloc_zfree(state->sdap_op); state->dp_error = DP_ERR_FATAL; state->error = ret; @@ -249,11 +249,11 @@ static void sdap_sudo_refresh_connect_done(struct tevent_req *subreq) return; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("SUDO LDAP connection failed - %s\n", strerror(ret))); + "SUDO LDAP connection failed - %s\n", strerror(ret)); goto fail; } - DEBUG(SSSDBG_TRACE_FUNC, ("SUDO LDAP connection successful\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SUDO LDAP connection successful\n"); subreq = sdap_sudo_load_sudoers_send(state, state->be_ctx->ev, state->opts, @@ -304,7 +304,7 @@ static struct tevent_req * sdap_sudo_load_sudoers_send(TALLOC_CTX *mem_ctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("SUDOERS lookup request without a search base\n")); + "SUDOERS lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -343,7 +343,7 @@ static errno_t sdap_sudo_load_sudoers_next_base(struct tevent_req *req) search_base = state->search_bases[state->base_iter]; if (search_base == NULL) { /* should not happen */ - DEBUG(SSSDBG_CRIT_FAILURE, ("search_base is null\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "search_base is null\n"); return EFAULT; } @@ -356,8 +356,8 @@ static errno_t sdap_sudo_load_sudoers_next_base(struct tevent_req *req) /* send request */ DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for sudo rules with base [%s]\n", - search_base->basedn)); + "Searching for sudo rules with base [%s]\n", + search_base->basedn); subreq = sdap_get_generic_send(state, state->ev, @@ -395,8 +395,8 @@ static void sdap_sudo_load_sudoers_process(struct tevent_req *subreq) search_base = state->search_bases[state->base_iter]; DEBUG(SSSDBG_TRACE_FUNC, - ("Receiving sudo rules with base [%s]\n", - search_base->basedn)); + "Receiving sudo rules with base [%s]\n", + search_base->basedn); ret = sdap_get_generic_recv(subreq, state, &count, &attrs); talloc_zfree(subreq); @@ -475,12 +475,12 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Received %zu rules\n", rules_count)); + DEBUG(SSSDBG_TRACE_FUNC, "Received %zu rules\n", rules_count); /* start transaction */ ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -505,12 +505,12 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) /* commit transaction */ ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; - DEBUG(SSSDBG_TRACE_FUNC, ("Sudoers is successfuly stored in cache\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Sudoers is successfuly stored in cache\n"); ret = EOK; state->num_rules = rules_count; @@ -519,7 +519,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } @@ -555,15 +555,15 @@ static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom, &name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve rule name: [%s]\n", strerror(ret))); + "Failed to retrieve rule name: [%s]\n", strerror(ret)); continue; } ret = sysdb_sudo_purge_byname(dom, name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to delete rule %s: [%s]\n", - name, strerror(ret))); + "Failed to delete rule %s: [%s]\n", + name, strerror(ret)); continue; } } @@ -579,8 +579,8 @@ static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom, done: if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to purge sudo rules [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "failed to purge sudo rules [%d]: %s\n", + ret, strerror(ret)); } return ret; @@ -607,8 +607,8 @@ static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx, rules_count, cache_timeout, now, _usn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to save sudo rules [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "failed to save sudo rules [%d]: %s\n", + ret, strerror(ret)); return ret; } diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c index 0deaff358..42f95df85 100644 --- a/src/providers/ldap/sdap_async_sudo_hostinfo.c +++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c @@ -77,7 +77,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_get_hostinfo_state); if (req == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -93,11 +93,11 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, &state->hostnames, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unable to parse hostnames [%d]: %s\n", ret, strerror(ret))); + "Unable to parse hostnames [%d]: %s\n", ret, strerror(ret)); goto done; } else { DEBUG(SSSDBG_CONF_SETTINGS, - ("Hostnames set to: %s\n", conf_hostnames)); + "Hostnames set to: %s\n", conf_hostnames); } } @@ -106,12 +106,12 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, &state->ip_addr, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unable to parse IP addresses [%d]: %s\n", - ret, strerror(ret))); + "Unable to parse IP addresses [%d]: %s\n", + ret, strerror(ret)); goto done; } else { - DEBUG(SSSDBG_CONF_SETTINGS, ("IP addresses set to: %s\n", - conf_ip_addr)); + DEBUG(SSSDBG_CONF_SETTINGS, "IP addresses set to: %s\n", + conf_ip_addr); } } @@ -120,8 +120,8 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, ret = sdap_sudo_get_ip_addresses(state, &state->ip_addr); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to detect IP addresses [%d]: %s\n", - ret, strerror(ret))); + "Unable to detect IP addresses [%d]: %s\n", + ret, strerror(ret)); } } @@ -162,8 +162,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *subreq) ret = sdap_sudo_get_hostnames_recv(state, subreq, &state->hostnames); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve hostnames [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve hostnames [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -210,7 +210,7 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -218,8 +218,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, ret = getifaddrs(&ifaces); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not read interfaces [%d][%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not read interfaces [%d][%s]\n", + ret, strerror(ret)); goto done; } @@ -291,8 +291,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, if (inet_ntop(iface->ifa_addr->sa_family, sinx_addr, ip_addr, INET6_ADDRSTRLEN) == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("inet_ntop() failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "inet_ntop() failed [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -301,8 +301,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, if (inet_ntop(iface->ifa_addr->sa_family, sinx_network, network_addr, INET6_ADDRSTRLEN) == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("inet_ntop() failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "inet_ntop() failed [%d]: %s\n", + ret, strerror(ret)); goto done; } @@ -328,8 +328,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, } DEBUG(SSSDBG_TRACE_INTERNAL, - ("Found IP address: %s in network %s/%d\n", - ip_addr, network_addr, netmask)); + "Found IP address: %s in network %s/%d\n", + ip_addr, network_addr, netmask); } if (ip_addr_list) { @@ -372,7 +372,7 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, /* hostname, fqdn and NULL */ state->hostnames = talloc_zero_array(state, char*, 3); if (state->hostnames == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero_array() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero_array() failed\n"); ret = ENOMEM; goto done; } @@ -383,15 +383,15 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, ret = gethostname(hostname, HOST_NAME_MAX); if (ret != EOK) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve machine hostname " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve machine hostname " + "[%d]: %s\n", ret, strerror(ret)); goto done; } hostname[HOST_NAME_MAX] = '\0'; state->hostnames[0] = talloc_strdup(state->hostnames, hostname); if (state->hostnames[0] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } @@ -399,14 +399,14 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, dot = strchr(hostname, '.'); if (dot != NULL) { /* already a fqdn, determine hostname and finish */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found fqdn: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found fqdn: %s\n", hostname); *dot = '\0'; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found hostname: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found hostname: %s\n", hostname); state->hostnames[1] = talloc_strdup(state->hostnames, hostname); if (state->hostnames[1] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } @@ -414,7 +414,7 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, ret = EOK; goto done; } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found hostname: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found hostname: %s\n", hostname); } state->resolv_ctx = be_ctx->be_res->resolv; @@ -462,30 +462,30 @@ static void sdap_sudo_get_hostnames_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret == ENOENT) { /* Empty result, just quit */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("No hostent found\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No hostent found\n"); goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not resolve fqdn for this machine, error [%d]: %s, " + "Could not resolve fqdn for this machine, error [%d]: %s, " "resolver returned: [%d]: %s\n", ret, strerror(ret), - resolv_status, resolv_strerror(resolv_status))); + resolv_status, resolv_strerror(resolv_status)); tevent_req_error(req, ret); return; } /* EOK */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found fqdn: %s\n", rhostent->name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found fqdn: %s\n", rhostent->name); if (state->hostnames == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("state->hostnames is NULL\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "state->hostnames is NULL\n"); ret = EINVAL; goto done; } state->hostnames[1] = talloc_strdup(state->hostnames, rhostent->name); if (state->hostnames[1] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } diff --git a/src/providers/ldap/sdap_async_sudo_timer.c b/src/providers/ldap/sdap_async_sudo_timer.c index 27dd41f06..035341909 100644 --- a/src/providers/ldap/sdap_async_sudo_timer.c +++ b/src/providers/ldap/sdap_async_sudo_timer.c @@ -63,7 +63,7 @@ struct tevent_req * sdap_sudo_timer_send(TALLOC_CTX *mem_ctx, /* create request */ req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_timer_state); if (req == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -75,7 +75,7 @@ struct tevent_req * sdap_sudo_timer_send(TALLOC_CTX *mem_ctx, /* set timer */ timer = tevent_add_timer(ev, req, when, sdap_sudo_timer, req); if (timer == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_add_timer() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_add_timer() failed\n"); ret = ENOMEM; goto immediately; } @@ -120,7 +120,7 @@ static void sdap_sudo_timer(struct tevent_context *ev, /* issue request */ state->subreq = state->fn(state, state->sudo_ctx); if (state->subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to issue timed request!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to issue timed request!\n"); tevent_req_error(req, ENOMEM); return; } @@ -137,8 +137,8 @@ static void sdap_sudo_timer(struct tevent_context *ev, * the possibility of starting another * concurrently */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set timeout, " - "canceling request!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set timeout, " + "canceling request!\n"); talloc_zfree(state->subreq); tevent_req_error(req, ENOMEM); } @@ -169,8 +169,8 @@ static void sdap_sudo_timer_timeout(struct tevent_context *ev, req = talloc_get_type(pvt, struct tevent_req); state = tevent_req_data(req, struct sdap_sudo_timer_state); - DEBUG(SSSDBG_CRIT_FAILURE, ("Request timed out. Is timeout too small?" - " (%lds)!\n", state->timeout)); + DEBUG(SSSDBG_CRIT_FAILURE, "Request timed out. Is timeout too small?" + " (%lds)!\n", state->timeout); talloc_zfree(state->subreq); diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index 56d5b2146..91e705c62 100644 --- a/src/providers/ldap/sdap_async_users.c +++ b/src/providers/ldap/sdap_async_users.c @@ -53,7 +53,7 @@ sdap_get_idmap_primary_gid(struct sdap_options *opts, opts->user_map[SDAP_AT_USER_PRIMARY_GROUP].sys_name, &primary_gid); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("no primary group ID provided\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "no primary group ID provided\n"); ret = EINVAL; goto done; } @@ -69,7 +69,7 @@ sdap_get_idmap_primary_gid(struct sdap_options *opts, &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto done; } } @@ -125,7 +125,7 @@ int sdap_save_user(TALLOC_CTX *memctx, char *dom_sid_str = NULL; struct sss_domain_info *subdomain; - DEBUG(SSSDBG_TRACE_FUNC, ("Save user\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Save user\n"); tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -146,16 +146,16 @@ int sdap_save_user(TALLOC_CTX *memctx, if (ret == EOK) { ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not add SID string: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not add SID string: [%s]\n", + strerror(ret)); goto done; } } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_ALL, ("objectSID: not available for user\n")); + DEBUG(SSSDBG_TRACE_ALL, "objectSID: not available for user\n"); sid_str = NULL; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not identify objectSID: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not identify objectSID: [%s]\n", + strerror(ret)); sid_str = NULL; } @@ -166,17 +166,17 @@ int sdap_save_user(TALLOC_CTX *memctx, if (subdomain) { dom = subdomain; } else { - DEBUG(SSSDBG_TRACE_FUNC, ("SID %s does not belong to any known " - "domain\n", sid_str)); + DEBUG(SSSDBG_TRACE_FUNC, "SID %s does not belong to any known " + "domain\n", sid_str); } } ret = sdap_get_user_primary_name(memctx, opts, attrs, dom, &user_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get user name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get user name\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing user %s\n", user_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing user %s\n", user_name); if (opts->schema_type == SDAP_SCHEMA_AD) { ret = sysdb_attrs_get_string(attrs, @@ -232,19 +232,19 @@ int sdap_save_user(TALLOC_CTX *memctx, if (use_id_mapping) { if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SID not available, cannot map a " \ - "unix ID to user [%s].\n", user_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "SID not available, cannot map a " \ + "unix ID to user [%s].\n", user_name); ret = ENOENT; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping user [%s] objectSID [%s] to unix ID\n", user_name, sid_str)); + "Mapping user [%s] objectSID [%s] to unix ID\n", user_name, sid_str); /* Convert the SID into a UNIX user ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &uid); if (ret == ENOTSUP) { - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; goto done; } else if (ret != EOK) { @@ -256,7 +256,7 @@ int sdap_save_user(TALLOC_CTX *memctx, */ ret = sdap_replace_id(attrs, SYSDB_UIDNUM, uid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped UID\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the id-mapped UID\n"); goto done; } } else { @@ -265,16 +265,16 @@ int sdap_save_user(TALLOC_CTX *memctx, &uid); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("no uid provided for [%s] in domain [%s].\n", - user_name, dom->name)); + "no uid provided for [%s] in domain [%s].\n", + user_name, dom->name); ret = EINVAL; goto done; } } /* check that the uid is valid for this domain */ if (OUT_OF_ID_RANGE(uid, dom->id_min, dom->id_max)) { - DEBUG(2, ("User [%s] filtered out! (uid out of range)\n", - user_name)); + DEBUG(2, "User [%s] filtered out! (uid out of range)\n", + user_name); ret = EINVAL; goto done; } @@ -284,8 +284,8 @@ int sdap_save_user(TALLOC_CTX *memctx, &gid); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot get the GID for [%s] in domain [%s].\n", - user_name, dom->name)); + "Cannot get the GID for [%s] in domain [%s].\n", + user_name, dom->name); goto done; } @@ -300,7 +300,7 @@ int sdap_save_user(TALLOC_CTX *memctx, ret = sysdb_attrs_add_uint32(user_attrs, SYSDB_PRIMARY_GROUP_GIDNUM, (uint32_t) gid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_uint32 failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_uint32 failed.\n"); goto done; } @@ -318,8 +318,8 @@ int sdap_save_user(TALLOC_CTX *memctx, &gid); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("no gid provided for [%s] in domain [%s].\n", - user_name, dom->name)); + "no gid provided for [%s] in domain [%s].\n", + user_name, dom->name); ret = EINVAL; goto done; } @@ -329,8 +329,8 @@ int sdap_save_user(TALLOC_CTX *memctx, if (IS_SUBDOMAIN(dom) == false && OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User [%s] filtered out! (primary gid out of range)\n", - user_name)); + "User [%s] filtered out! (primary gid out of range)\n", + user_name); ret = EINVAL; goto done; } @@ -341,11 +341,11 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (!el || el->num_values == 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("originalDN is not available for [%s].\n", user_name)); + "originalDN is not available for [%s].\n", user_name); } else { orig_dn = (const char *) el->values[0].data; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding originalDN [%s] to attributes " - "of [%s].\n", orig_dn, user_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding originalDN [%s] to attributes " + "of [%s].\n", orig_dn, user_name); ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_DN, orig_dn); if (ret) { @@ -359,10 +359,10 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original memberOf is not available for [%s].\n", user_name)); + "Original memberOf is not available for [%s].\n", user_name); } else { DEBUG(SSSDBG_TRACE_FUNC, - ("Adding original memberOf attributes to [%s].\n", user_name)); + "Adding original memberOf attributes to [%s].\n", user_name); for (i = 0; i < el->num_values; i++) { ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF, (const char *) el->values[i].data); @@ -387,7 +387,7 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original USN value is not available for [%s].\n", user_name)); + "Original USN value is not available for [%s].\n", user_name); } else { ret = sysdb_attrs_add_string(user_attrs, opts->user_map[SDAP_AT_USER_USN].sys_name, @@ -409,7 +409,7 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("User principal is not available for [%s].\n", user_name)); + "User principal is not available for [%s].\n", user_name); } else { upn = talloc_strdup(user_attrs, (const char*) el->values[0].data); if (!upn) { @@ -420,8 +420,8 @@ int sdap_save_user(TALLOC_CTX *memctx, make_realm_upper_case(upn); } DEBUG(SSSDBG_TRACE_FUNC, - ("Adding user principal [%s] to attributes of [%s].\n", - upn, user_name)); + "Adding user principal [%s] to attributes of [%s].\n", + upn, user_name); ret = sysdb_attrs_add_string(user_attrs, SYSDB_UPN, upn); if (ret) { goto done; @@ -449,7 +449,7 @@ int sdap_save_user(TALLOC_CTX *memctx, ret = sdap_save_all_names(user_name, attrs, dom, user_attrs); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to save user names\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to save user names\n"); goto done; } @@ -462,7 +462,7 @@ int sdap_save_user(TALLOC_CTX *memctx, goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Storing info for user %s\n", user_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing info for user %s\n", user_name); ret = sysdb_store_user(dom, user_name, pwd, uid, gid, gecos, homedir, shell, orig_dn, @@ -479,8 +479,8 @@ int sdap_save_user(TALLOC_CTX *memctx, done: if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to save user [%s]\n", - user_name ? user_name : "Unknown")); + "Failed to save user [%s]\n", + user_name ? user_name : "Unknown"); } talloc_free(tmpctx); return ret; @@ -518,7 +518,7 @@ int sdap_save_users(TALLOC_CTX *memctx, ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -533,9 +533,9 @@ int sdap_save_users(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store user %d. Ignoring.\n", i)); + DEBUG(2, "Failed to store user %d. Ignoring.\n", i); } else { - DEBUG(9, ("User %d processed!\n", i)); + DEBUG(9, "User %d processed!\n", i); } if (usn_value) { @@ -555,7 +555,7 @@ int sdap_save_users(TALLOC_CTX *memctx, ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -568,7 +568,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_zfree(tmpctx); @@ -635,7 +635,7 @@ struct tevent_req *sdap_search_user_send(TALLOC_CTX *memctx, if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User lookup request without a search base\n")); + "User lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -667,8 +667,8 @@ static errno_t sdap_search_user_next_base(struct tevent_req *req) } DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->search_bases[state->base_iter]->basedn); subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -706,7 +706,7 @@ static void sdap_search_user_process(struct tevent_req *subreq) } DEBUG(SSSDBG_TRACE_FUNC, - ("Search for users, returned %zu results.\n", count)); + "Search for users, returned %zu results.\n", count); if (state->enumeration || count == 0) { /* No users found in this search or enumerating */ @@ -757,7 +757,7 @@ static void sdap_search_user_process(struct tevent_req *subreq) return; } - DEBUG(SSSDBG_TRACE_ALL, ("Retrieved total %zu users\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Retrieved total %zu users\n", state->count); tevent_req_done(req); } @@ -852,7 +852,7 @@ static void sdap_get_users_done(struct tevent_req *subreq) ret = sdap_search_user_recv(state, subreq, &state->higher_usn, &state->users, &state->count); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to retrieve users\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to retrieve users\n"); tevent_req_error(req, ret); return; } @@ -862,12 +862,12 @@ static void sdap_get_users_done(struct tevent_req *subreq) state->users, state->count, &state->higher_usn); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store users.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store users.\n"); tevent_req_error(req, ret); return; } - DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Users - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Users - Done\n", state->count); tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c index 3bee9a67f..5432a6f37 100644 --- a/src/providers/ldap/sdap_autofs.c +++ b/src/providers/ldap/sdap_autofs.c @@ -55,7 +55,7 @@ int sdap_autofs_init(struct be_ctx *be_ctx, { int ret; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing autofs LDAP back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing autofs LDAP back end\n"); *ops = &sdap_autofs_ops; *pvt_data = id_ctx; @@ -86,7 +86,7 @@ void sdap_autofs_handler(struct be_req *be_req) const char *master_map; int ret = EOK; - DEBUG(SSSDBG_TRACE_INTERNAL, ("sdap autofs handler called\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "sdap autofs handler called\n"); id_ctx = talloc_get_type(be_ctx->bet_info[BET_AUTOFS].pvt_bet_data, struct sdap_id_ctx); @@ -97,24 +97,24 @@ void sdap_autofs_handler(struct be_req *be_req) autofs_req = talloc_get_type(be_req_get_data(be_req), struct be_autofs_req); - DEBUG(SSSDBG_FUNC_DATA, ("Requested refresh for: %s\n", - autofs_req->mapname ? autofs_req->mapname : "<ALL>\n")); + DEBUG(SSSDBG_FUNC_DATA, "Requested refresh for: %s\n", + autofs_req->mapname ? autofs_req->mapname : "<ALL>\n"); if (autofs_req->mapname != NULL) { master_map = dp_opt_get_string(id_ctx->opts->basic, SDAP_AUTOFS_MAP_MASTER_NAME); if (strcmp(master_map, autofs_req->mapname) == 0) { autofs_req->invalidate = true; - DEBUG(SSSDBG_FUNC_DATA, ("Refresh of automount master map triggered: %s\n", - autofs_req->mapname)); + DEBUG(SSSDBG_FUNC_DATA, "Refresh of automount master map triggered: %s\n", + autofs_req->mapname); } } if (autofs_req->invalidate) { ret = sysdb_invalidate_autofs_maps(id_ctx->be->domain); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not invalidate autofs maps, " - "backend might return stale entries\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not invalidate autofs maps, " + "backend might return stale entries\n"); } } @@ -167,7 +167,7 @@ sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx, state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -230,7 +230,7 @@ sdap_autofs_get_map_connect_done(struct tevent_req *subreq) state->map_name); if (!subreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_autofs_setautomntent_send failed\n")); + "sdap_autofs_setautomntent_send failed\n"); tevent_req_error(req, ENOMEM); return; } @@ -272,8 +272,8 @@ sdap_autofs_get_map_done(struct tevent_req *subreq) ret = sysdb_delete_autofsmap(state->ctx->be->domain, state->map_name); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot delete autofs map %s [%d]: %s\n", - state->map_name, ret, strerror(ret))); + "Cannot delete autofs map %s [%d]: %s\n", + state->map_name, ret, strerror(ret)); tevent_req_error(req, ret); return; } diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c index 9aaff785b..2a0730e39 100644 --- a/src/providers/ldap/sdap_child_helpers.c +++ b/src/providers/ldap/sdap_child_helpers.c @@ -56,15 +56,15 @@ static void sdap_close_fd(int *fd) int ret; if (*fd == -1) { - DEBUG(6, ("fd already closed\n")); + DEBUG(6, "fd already closed\n"); return; } ret = close(*fd); if (ret) { ret = errno; - DEBUG(2, ("Closing fd %d, return error %d (%s)\n", - *fd, ret, strerror(ret))); + DEBUG(2, "Closing fd %d, return error %d (%s)\n", + *fd, ret, strerror(ret)); } *fd = -1; @@ -91,13 +91,13 @@ static errno_t sdap_fork_child(struct tevent_context *ev, ret = pipe(pipefd_from_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "pipe failed [%d][%s].\n", err, strerror(err)); return err; } ret = pipe(pipefd_to_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "pipe failed [%d][%s].\n", err, strerror(err)); return err; } @@ -107,8 +107,8 @@ static errno_t sdap_fork_child(struct tevent_context *ev, err = exec_child(child, pipefd_to_child, pipefd_from_child, LDAP_CHILD, ldap_child_debug_fd); - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not exec LDAP child: [%d][%s].\n", - err, strerror(err))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec LDAP child: [%d][%s].\n", + err, strerror(err)); return err; } else if (pid > 0) { /* parent */ child->pid = pid; @@ -126,7 +126,7 @@ static errno_t sdap_fork_child(struct tevent_context *ev, } else { /* error */ err = errno; - DEBUG(1, ("fork failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "fork failed [%d][%s].\n", err, strerror(err)); return err; } @@ -145,7 +145,7 @@ static errno_t create_tgt_req_send_buffer(TALLOC_CTX *mem_ctx, buf = talloc(mem_ctx, struct io_buffer); if (buf == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; } @@ -160,11 +160,11 @@ static errno_t create_tgt_req_send_buffer(TALLOC_CTX *mem_ctx, buf->size += strlen(keytab_name); } - DEBUG(SSSDBG_TRACE_FUNC, ("buffer size: %zu\n", buf->size)); + DEBUG(SSSDBG_TRACE_FUNC, "buffer size: %zu\n", buf->size); buf->data = talloc_size(buf, buf->size); if (buf->data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); talloc_free(buf); return ENOMEM; } @@ -227,7 +227,7 @@ static int parse_child_response(TALLOC_CTX *mem_ctx, ccn = talloc_size(mem_ctx, sizeof(char) * (len + 1)); if (ccn == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; } safealign_memcpy(ccn, buf+p, sizeof(char) * len, &p); @@ -296,19 +296,19 @@ struct tevent_req *sdap_get_tgt_send(TALLOC_CTX *mem_ctx, realm_str, princ_str, keytab_name, lifetime, &buf); if (ret != EOK) { - DEBUG(1, ("create_tgt_req_send_buffer failed.\n")); + DEBUG(1, "create_tgt_req_send_buffer failed.\n"); goto fail; } ret = sdap_fork_child(state->ev, state->child); if (ret != EOK) { - DEBUG(1, ("sdap_fork_child failed.\n")); + DEBUG(1, "sdap_fork_child failed.\n"); goto fail; } ret = set_tgt_child_timeout(req, ev, timeout); if (ret != EOK) { - DEBUG(1, ("activate_child_timeout_handler failed.\n")); + DEBUG(1, "activate_child_timeout_handler failed.\n"); goto fail; } @@ -394,11 +394,11 @@ int sdap_get_tgt_recv(struct tevent_req *req, ret = parse_child_response(mem_ctx, state->buf, state->len, &res, &krberr, &ccn, &expire_time); if (ret != EOK) { - DEBUG(1, ("Cannot parse child response: [%d][%s]\n", ret, strerror(ret))); + DEBUG(1, "Cannot parse child response: [%d][%s]\n", ret, strerror(ret)); return ret; } - DEBUG(6, ("Child responded: %d [%s], expired on [%ld]\n", res, ccn, (long)expire_time)); + DEBUG(6, "Child responded: %d [%s], expired on [%ld]\n", res, ccn, (long)expire_time); *result = res; *kerr = krberr; *ccname = ccn; @@ -417,11 +417,11 @@ static void get_tgt_timeout_handler(struct tevent_context *ev, struct sdap_get_tgt_state); int ret; - DEBUG(9, ("timeout for tgt child [%d] reached.\n", state->child->pid)); + DEBUG(9, "timeout for tgt child [%d] reached.\n", state->child->pid); ret = kill(state->child->pid, SIGKILL); if (ret == -1) { - DEBUG(1, ("kill failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "kill failed [%d][%s].\n", errno, strerror(errno)); } tevent_req_error(req, ETIMEDOUT); @@ -434,13 +434,13 @@ static errno_t set_tgt_child_timeout(struct tevent_req *req, struct tevent_timer *te; struct timeval tv; - DEBUG(6, ("Setting %d seconds timeout for tgt child\n", timeout)); + DEBUG(6, "Setting %d seconds timeout for tgt child\n", timeout); tv = tevent_timeval_current_ofs(timeout, 0); te = tevent_add_timer(ev, req, tv, get_tgt_timeout_handler, req); if (te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); return ENOMEM; } @@ -458,14 +458,14 @@ int sdap_setup_child(void) if (debug_to_file != 0 && ldap_child_debug_fd == -1) { ret = open_debug_file_ex(LDAP_CHILD_LOG_FILE, &debug_filep, false); if (ret != EOK) { - DEBUG(0, ("Error setting up logging (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error setting up logging (%d) [%s]\n", + ret, strerror(ret)); return ret; } ldap_child_debug_fd = fileno(debug_filep); if (ldap_child_debug_fd == -1) { - DEBUG(0, ("fileno failed [%d][%s]\n", errno, strerror(errno))); + DEBUG(0, "fileno failed [%d][%s]\n", errno, strerror(errno)); ret = errno; return ret; } diff --git a/src/providers/ldap/sdap_dyndns.c b/src/providers/ldap/sdap_dyndns.c index 7bcf64f35..1c5611b04 100644 --- a/src/providers/ldap/sdap_dyndns.c +++ b/src/providers/ldap/sdap_dyndns.c @@ -137,8 +137,8 @@ sdap_dyndns_update_send(TALLOC_CTX *mem_ctx, subreq = sdap_dyndns_get_addrs_send(state, state->ev, sdap_ctx, ifname); if (!subreq) { ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, sdap_dyndns_update_addrs_done, req); @@ -164,7 +164,7 @@ sdap_dyndns_update_addrs_done(struct tevent_req *subreq) ret = sdap_dyndns_get_addrs_recv(subreq, state, &state->addresses); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); tevent_req_error(req, ret); return; } @@ -176,7 +176,7 @@ sdap_dyndns_update_addrs_done(struct tevent_req *subreq) subreq = nsupdate_get_addrs_send(state, state->ev, state->be_res, state->hostname); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't initiate address check\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't initiate address check\n"); tevent_req_error(req, ret); return; } @@ -208,8 +208,8 @@ sdap_dyndns_dns_addrs_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not receive list of current addresses [%d]: %s\n", - ret, sss_strerror(ret))); + "Could not receive list of current addresses [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -217,28 +217,28 @@ sdap_dyndns_dns_addrs_done(struct tevent_req *subreq) if (state->check_diff) { ret = sdap_dyndns_addrs_diff(state, &do_update); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check the diff between DNS " - "and current addresses [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not check the diff between DNS " + "and current addresses [%d]: %s\n", ret, strerror(ret)); tevent_req_error(req, ret); return; } if (do_update == false) { DEBUG(SSSDBG_TRACE_FUNC, - ("No DNS update needed, addresses did not change\n")); + "No DNS update needed, addresses did not change\n"); tevent_req_done(req); return; } DEBUG(SSSDBG_TRACE_FUNC, - ("Detected IP addresses change, will perform an update\n")); + "Detected IP addresses change, will perform an update\n"); } /* Either we needed the addresses for updating PTR records only or * the addresses have changed (or both) */ ret = sdap_dyndns_update_step(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not start the update [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not start the update [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); } return; @@ -257,8 +257,8 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) state->dns_addrlist, &str_dnslist); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Converting DNS IP addresses to strings failed: [%d]: %s\n", - ret, sss_strerror(ret))); + "Converting DNS IP addresses to strings failed: [%d]: %s\n", + ret, sss_strerror(ret)); return ret; } @@ -266,8 +266,8 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) state->addresses, &str_local_list); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Converting local IP addresses to strings failed: [%d]: %s\n", - ret, sss_strerror(ret))); + "Converting local IP addresses to strings failed: [%d]: %s\n", + ret, sss_strerror(ret)); return ret; } @@ -276,14 +276,14 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) &dns_only, &local_only, NULL); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("diff_string_lists failed: [%d]: %s\n", ret, sss_strerror(ret))); + "diff_string_lists failed: [%d]: %s\n", ret, sss_strerror(ret)); return ret; } if (dns_only) { for (i=0; dns_only[i]; i++) { DEBUG(SSSDBG_TRACE_LIBS, - ("Address in DNS only: %s\n", dns_only[i])); + "Address in DNS only: %s\n", dns_only[i]); do_update = true; } } @@ -291,7 +291,7 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) if (local_only) { for (i=0; local_only[i]; i++) { DEBUG(SSSDBG_TRACE_LIBS, - ("Address on localhost only: %s\n", local_only[i])); + "Address on localhost only: %s\n", local_only[i]); do_update = true; } } @@ -322,7 +322,7 @@ sdap_dyndns_update_step(struct tevent_req *req) state->addresses, state->dns_addrlist, &state->update_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); return ret; } @@ -358,7 +358,7 @@ sdap_dyndns_update_done(struct tevent_req *subreq) WIFEXITED(child_status) && WEXITSTATUS(child_status) != 0) { state->use_server_with_nsupdate = true; DEBUG(SSSDBG_MINOR_FAILURE, - ("nsupdate failed, retrying with server name\n")); + "nsupdate failed, retrying with server name\n"); ret = sdap_dyndns_update_step(req); if (ret == EOK) { return; @@ -370,7 +370,7 @@ sdap_dyndns_update_done(struct tevent_req *subreq) } if (state->update_ptr == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("No PTR update requested, done\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No PTR update requested, done\n"); tevent_req_done(req); return; } @@ -406,7 +406,7 @@ sdap_dyndns_update_ptr_step(struct tevent_req *req) state->addresses, state->dns_addrlist, &state->update_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); return ret; } @@ -442,7 +442,7 @@ sdap_dyndns_update_ptr_done(struct tevent_req *subreq) WIFEXITED(child_status) && WEXITSTATUS(child_status) != 0) { state->use_server_with_nsupdate = true; DEBUG(SSSDBG_MINOR_FAILURE, - ("nsupdate failed, retrying with server name\n")); + "nsupdate failed, retrying with server name\n"); ret = sdap_dyndns_update_ptr_step(req); if (ret == EOK) { return; @@ -494,7 +494,7 @@ sdap_dyndns_get_addrs_send(TALLOC_CTX *mem_ctx, ret = sss_iface_addr_list_get(state, iface, &state->addresses); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot get list of addresses from interface %s\n", iface)); + "Cannot get list of addresses from interface %s\n", iface); } /* We're done. Just fake an async request completion */ goto done; @@ -504,15 +504,15 @@ sdap_dyndns_get_addrs_send(TALLOC_CTX *mem_ctx, state->sdap_op = sdap_id_op_create(state, sdap_ctx->conn->conn_cache); if (!state->sdap_op) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); goto done; } subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (!subreq) { ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, sdap_dyndns_get_addrs_done, req); @@ -546,13 +546,13 @@ sdap_dyndns_get_addrs_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No LDAP server is available, " - "dynamic DNS update is skipped in offline mode.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No LDAP server is available, " + "dynamic DNS update is skipped in offline mode.\n"); ret = ERR_DYNDNS_OFFLINE; } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to LDAP server: [%d](%s)\n", - ret, sss_strerror(ret))); + "Failed to connect to LDAP server: [%d](%s)\n", + ret, sss_strerror(ret)); } tevent_req_error(req, ret); return; @@ -560,7 +560,7 @@ sdap_dyndns_get_addrs_done(struct tevent_req *subreq) ret = sdap_dyndns_add_ldap_conn(state, sdap_id_op_handle(state->sdap_op)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses from LDAP connection\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses from LDAP connection\n"); tevent_req_error(req, ret); return; } @@ -593,7 +593,7 @@ sdap_dyndns_add_ldap_conn(struct sdap_dyndns_get_addrs_state *state, ret = getsockname(fd, (struct sockaddr *) &ss, &ss_len); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to get socket name\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to get socket name\n"); return ret; } @@ -607,7 +607,7 @@ sdap_dyndns_add_ldap_conn(struct sdap_dyndns_get_addrs_state *state, break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Connection to LDAP is neither IPv4 nor IPv6\n")); + "Connection to LDAP is neither IPv4 nor IPv6\n"); return EIO; } @@ -667,15 +667,15 @@ sdap_dyndns_timer_conn_send(TALLOC_CTX *mem_ctx, /* Make sure to have a valid LDAP connection */ state->sdap_op = sdap_id_op_create(state, state->sdap_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"); ret = ENOMEM; goto fail; } subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); ret = ENOMEM; goto fail; } @@ -707,14 +707,14 @@ sdap_dyndns_timer_conn_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No server is available, " - "dynamic DNS update is skipped in offline mode.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No server is available, " + "dynamic DNS update is skipped in offline mode.\n"); /* Another timer will be scheduled when provider goes online */ tevent_req_error(req, ERR_DYNDNS_OFFLINE); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to LDAP server: [%d](%s)\n", - ret, sss_strerror(ret))); + "Failed to connect to LDAP server: [%d](%s)\n", + ret, sss_strerror(ret)); /* Just schedule another dyndns retry */ be_nsupdate_timer_schedule(state->ev, state->dyndns_ctx); diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c index 5e4ea79b3..fc01d78ad 100644 --- a/src/providers/ldap/sdap_fd_events.c +++ b/src/providers/ldap/sdap_fd_events.c @@ -39,7 +39,7 @@ int get_fd_from_ldap(LDAP *ldap, int *fd) ret = ldap_get_option(ldap, LDAP_OPT_DESC, fd); if (ret != LDAP_OPT_SUCCESS || *fd < 0) { - DEBUG(1, ("Failed to get fd from ldap!!\n")); + DEBUG(1, "Failed to get fd from ldap!!\n"); *fd = -1; return EIO; } @@ -74,9 +74,9 @@ static int remove_connection_callback(TALLOC_CTX *mem_ctx) lret = ldap_get_option(cb_data->sh->ldap, LDAP_OPT_CONNECT_CB, conncb); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to remove connection callback.\n")); + DEBUG(1, "Failed to remove connection callback.\n"); } else { - DEBUG(9, ("Successfully removed connection callback.\n")); + DEBUG(9, "Successfully removed connection callback.\n"); } return EOK; } @@ -93,27 +93,27 @@ static int sdap_ldap_connect_callback_add(LDAP *ld, Sockbuf *sb, struct ldap_cb_data); if (cb_data == NULL) { - DEBUG(1, ("sdap_ldap_connect_callback_add called without " - "callback data.\n")); + DEBUG(1, "sdap_ldap_connect_callback_add called without " + "callback data.\n"); return EINVAL; } ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_GET_FD, &ber_fd); if (ret == -1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return EINVAL; } if (DEBUG_IS_SET(SSSDBG_TRACE_LIBS)) { char *uri = ldap_url_desc2str(srv); - DEBUG(7, ("New LDAP connection to [%s] with fd [%d].\n", - uri, ber_fd)); + DEBUG(7, "New LDAP connection to [%s] with fd [%d].\n", + uri, ber_fd); free(uri); } fd_event_item = talloc_zero(cb_data, struct fd_event_item); if (fd_event_item == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; } @@ -121,7 +121,7 @@ static int sdap_ldap_connect_callback_add(LDAP *ld, Sockbuf *sb, TEVENT_FD_READ, sdap_ldap_result, cb_data->sh); if (fd_event_item->fde == NULL) { - DEBUG(1, ("tevent_add_fd failed.\n")); + DEBUG(1, "tevent_add_fd failed.\n"); talloc_free(fd_event_item); return ENOMEM; } @@ -147,10 +147,10 @@ static void sdap_ldap_connect_callback_del(LDAP *ld, Sockbuf *sb, ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_GET_FD, &ber_fd); if (ret == -1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return; } - DEBUG(9, ("Closing LDAP connection with fd [%d].\n", ber_fd)); + DEBUG(9, "Closing LDAP connection with fd [%d].\n", ber_fd); DLIST_FOR_EACH(fd_event_item, cb_data->fd_list) { if (fd_event_item->fd == ber_fd) { @@ -158,7 +158,7 @@ static void sdap_ldap_connect_callback_del(LDAP *ld, Sockbuf *sb, } } if (fd_event_item == NULL) { - DEBUG(1, ("No event for fd [%d] found.\n", ber_fd)); + DEBUG(1, "No event for fd [%d] found.\n", ber_fd); return; } @@ -177,14 +177,14 @@ static int sdap_install_ldap_callbacks(struct sdap_handle *sh, int ret; if (sh->sdap_fd_events) { - DEBUG(1, ("sdap_install_ldap_callbacks is called with already " - "initialized sdap_fd_events.\n")); + DEBUG(1, "sdap_install_ldap_callbacks is called with already " + "initialized sdap_fd_events.\n"); return EINVAL; } sh->sdap_fd_events = talloc_zero(sh, struct sdap_fd_events); if (!sh->sdap_fd_events) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; } @@ -199,9 +199,9 @@ static int sdap_install_ldap_callbacks(struct sdap_handle *sh, return ENOMEM; } - DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], fde[%p], ldap[%p]\n", + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], fde[%p], ldap[%p]\n", sh, (int)sh->connected, sh->ops, sh->sdap_fd_events->fde, - sh->ldap)); + sh->ldap); return EOK; } @@ -218,7 +218,7 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh, sh->sdap_fd_events = talloc_zero(sh, struct sdap_fd_events); if (sh->sdap_fd_events == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -226,14 +226,14 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh, sh->sdap_fd_events->conncb = talloc_zero(sh->sdap_fd_events, struct ldap_conncb); if (sh->sdap_fd_events->conncb == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } cb_data = talloc_zero(sh->sdap_fd_events->conncb, struct ldap_cb_data); if (cb_data == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -247,7 +247,7 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh, ret = ldap_set_option(sh->ldap, LDAP_OPT_CONNECT_CB, sh->sdap_fd_events->conncb); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set connection callback\n")); + DEBUG(1, "Failed to set connection callback\n"); ret = EFAULT; goto fail; } @@ -261,7 +261,7 @@ fail: talloc_zfree(sh->sdap_fd_events); return ret; #else - DEBUG(9, ("LDAP connection callbacks are not supported.\n")); + DEBUG(9, "LDAP connection callbacks are not supported.\n"); return EOK; #endif } @@ -288,13 +288,13 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) sb = ber_sockbuf_alloc(); if (sb == NULL) { - DEBUG(1, ("ber_sockbuf_alloc failed.\n")); + DEBUG(1, "ber_sockbuf_alloc failed.\n"); return ENOMEM; } ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_SET_FD, &fd); if (ret != 1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return EFAULT; } @@ -302,8 +302,8 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) if (ret != 0) { ber_sockbuf_free(sb); DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_url_parse failed to validate [%s] on fd [%d].\n", - uri, fd)); + "ldap_url_parse failed to validate [%s] on fd [%d].\n", + uri, fd); return EFAULT; } @@ -314,7 +314,7 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) ber_sockbuf_free(sb); return ret; #else - DEBUG(9, ("LDAP connection callbacks are not supported.\n")); + DEBUG(9, "LDAP connection callbacks are not supported.\n"); return EOK; #endif } diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index 5e166e19f..1e03d7ac4 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -109,7 +109,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, int ret; struct sdap_id_conn_cache *conn_cache = talloc_zero(memctx, struct sdap_id_conn_cache); if (!conn_cache) { - DEBUG(1, ("talloc_zero(struct sdap_id_conn_cache) failed.\n")); + DEBUG(1, "talloc_zero(struct sdap_id_conn_cache) failed.\n"); ret = ENOMEM; goto fail; } @@ -120,7 +120,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, sdap_id_conn_cache_be_offline_cb, conn_cache, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_offline_cb failed.\n")); + DEBUG(1, "be_add_offline_cb failed.\n"); goto fail; } @@ -128,7 +128,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, sdap_id_conn_cache_fo_reconnect_cb, conn_cache, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_add_reconnect_cb failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_add_reconnect_cb failed.\n"); goto fail; } @@ -179,7 +179,7 @@ static void sdap_id_release_conn_data(struct sdap_id_conn_data *conn_data) return; } - DEBUG(9, ("releasing unused connection\n")); + DEBUG(9, "releasing unused connection\n"); DLIST_REMOVE(conn_cache->connections, conn_data); talloc_zfree(conn_data); @@ -277,7 +277,7 @@ static void sdap_id_conn_data_expire_handler(struct tevent_context *ev, struct sdap_id_conn_data); struct sdap_id_conn_cache *conn_cache = conn_data->conn_cache; - DEBUG(3, ("connection is about to expire, releasing it\n")); + DEBUG(3, "connection is about to expire, releasing it\n"); if (conn_cache->cached_connection == conn_data) { conn_cache->cached_connection = NULL; @@ -304,7 +304,7 @@ struct sdap_id_op *sdap_id_op_create(TALLOC_CTX *memctx, struct sdap_id_conn_cac static void sdap_id_op_hook_conn_data(struct sdap_id_op *op, struct sdap_id_conn_data *conn_data) { if (!op) { - DEBUG(0, ("NULL op passed!!!\n")); + DEBUG(0, "NULL op passed!!!\n"); return; } @@ -334,7 +334,7 @@ static int sdap_id_op_destroy(void *pvt) struct sdap_id_op *op = talloc_get_type(pvt, struct sdap_id_op); if (op->conn_data) { - DEBUG(9, ("releasing operation connection\n")); + DEBUG(9, "releasing operation connection\n"); sdap_id_op_hook_conn_data(op, NULL); } @@ -392,14 +392,14 @@ struct tevent_req *sdap_id_op_connect_send(struct sdap_id_op *op, int ret = EOK; if (!memctx) { - DEBUG(1, ("Bug: no memory context passed.\n")); + DEBUG(1, "Bug: no memory context passed.\n"); ret = EINVAL; goto done; } if (op->connect_req) { /* Connection already in progress, invalid operation */ - DEBUG(1, ("Bug: connection request is already running or completed and leaked.\n")); + DEBUG(1, "Bug: connection request is already running or completed and leaked.\n"); ret = EINVAL; goto done; } @@ -420,7 +420,7 @@ struct tevent_req *sdap_id_op_connect_send(struct sdap_id_op *op, if (op->conn_data) { /* If the operation is already connected, * reuse existing connection regardless of its status */ - DEBUG(9, ("reusing operation connection\n")); + DEBUG(9, "reusing operation connection\n"); ret = EOK; goto done; } @@ -462,23 +462,23 @@ static int sdap_id_op_connect_step(struct tevent_req *req) conn_data = conn_cache->cached_connection; if (conn_data) { if (conn_data->connect_req) { - DEBUG(9, ("waiting for connection to complete\n")); + DEBUG(9, "waiting for connection to complete\n"); sdap_id_op_hook_conn_data(op, conn_data); goto done; } if (sdap_can_reuse_connection(conn_data)) { - DEBUG(9, ("reusing cached connection\n")); + DEBUG(9, "reusing cached connection\n"); sdap_id_op_hook_conn_data(op, conn_data); goto done; } - DEBUG(9, ("releasing expired cached connection\n")); + DEBUG(9, "releasing expired cached connection\n"); conn_cache->cached_connection = NULL; sdap_id_release_conn_data(conn_data); } - DEBUG(9, ("beginning to connect\n")); + DEBUG(9, "beginning to connect\n"); conn_data = talloc_zero(conn_cache, struct sdap_id_conn_data); if (!conn_data) { @@ -544,24 +544,24 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) conn_data->notify_lock++; if (ret == ENOTSUP) { - DEBUG(0, ("Authentication mechanism not Supported by server\n")); + DEBUG(0, "Authentication mechanism not Supported by server\n"); } if (ret == EOK && (!conn_data->sh || !conn_data->sh->connected)) { - DEBUG(0, ("sdap_cli_connect_recv returned bogus connection\n")); + DEBUG(0, "sdap_cli_connect_recv returned bogus connection\n"); ret = EFAULT; } if (ret != EOK && !can_retry) { if (conn_cache->id_conn->ignore_mark_offline) { DEBUG(SSSDBG_TRACE_FUNC, - ("Failed to connect to server, but ignore mark offline " - "is enabled.\n")); + "Failed to connect to server, but ignore mark offline " + "is enabled.\n"); } else { /* be is going offline as there is no more servers to try */ DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to connect, going offline (%d [%s])\n", - ret, strerror(ret))); + "Failed to connect, going offline (%d [%s])\n", + ret, strerror(ret)); be_mark_offline(conn_cache->id_conn->id_ctx->be); } is_offline = true; @@ -570,12 +570,12 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if (ret == EOK) { current_srv_opts = conn_cache->id_conn->id_ctx->srv_opts; if (current_srv_opts) { - DEBUG(8, ("Old USN: %lu, New USN: %lu\n", current_srv_opts->last_usn, srv_opts->last_usn)); + DEBUG(8, "Old USN: %lu, New USN: %lu\n", current_srv_opts->last_usn, srv_opts->last_usn); if (strcmp(srv_opts->server_id, current_srv_opts->server_id) == 0 && srv_opts->supports_usn && current_srv_opts->last_usn > srv_opts->last_usn) { - DEBUG(5, ("Server was probably re-initialized\n")); + DEBUG(5, "Server was probably re-initialized\n"); current_srv_opts->max_user_value = 0; current_srv_opts->max_group_value = 0; @@ -616,7 +616,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) struct sdap_id_op *op; if (ret == EOK && !conn_data->sh->connected) { - DEBUG(9, ("connection was broken after %d notifies\n", notify_count)); + DEBUG(9, "connection was broken after %d notifies\n", notify_count); } DLIST_FOR_EACH(op, conn_data->ops) { @@ -646,7 +646,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if (be_is_offline(conn_cache->id_conn->id_ctx->be)) { /* be is offline, no retry possible */ if (ret == EOK) { - DEBUG(9, ("skipping automatic retry on op #%d as be is offline\n", notify_count)); + DEBUG(9, "skipping automatic retry on op #%d as be is offline\n", notify_count); ret = EIO; } @@ -654,10 +654,10 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) is_offline = true; } else { if (ret == EOK) { - DEBUG(9, ("attempting automatic retry on op #%d\n", notify_count)); + DEBUG(9, "attempting automatic retry on op #%d\n", notify_count); retry = true; } else if (sdap_id_op_can_reconnect(op)) { - DEBUG(9, ("attempting failover retry on op #%d\n", notify_count)); + DEBUG(9, "attempting failover retry on op #%d\n", notify_count); op->reconnect_retry_count++; retry = true; } @@ -676,13 +676,13 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) } if (ret == EOK) { - DEBUG(9, ("notify connected to op #%d\n", notify_count)); + DEBUG(9, "notify connected to op #%d\n", notify_count); sdap_id_op_connect_req_complete(op, DP_ERR_OK, ret); } else if (is_offline) { - DEBUG(9, ("notify offline to op #%d\n", notify_count)); + DEBUG(9, "notify offline to op #%d\n", notify_count); sdap_id_op_connect_req_complete(op, DP_ERR_OFFLINE, EAGAIN); } else { - DEBUG(9, ("notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret))); + DEBUG(9, "notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret)); sdap_id_op_connect_req_complete(op, DP_ERR_FATAL, ret); } } @@ -695,7 +695,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if ((ret == EOK) && conn_data->sh->connected && !be_is_offline(conn_cache->id_conn->id_ctx->be)) { - DEBUG(9, ("caching successful connection after %d notifies\n", notify_count)); + DEBUG(9, "caching successful connection after %d notifies\n", notify_count); conn_cache->cached_connection = conn_data; /* Run any post-connection routines */ @@ -711,14 +711,14 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) } if (reinit) { - DEBUG(SSSDBG_TRACE_FUNC, ("Server reinitialization detected. " - "Cleaning cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Server reinitialization detected. " + "Cleaning cache.\n"); reinit_req = sdap_reinit_cleanup_send(conn_cache->id_conn->id_ctx->be, conn_cache->id_conn->id_ctx->be, conn_cache->id_conn->id_ctx); if (reinit_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up.\n"); return; } @@ -734,13 +734,13 @@ static void sdap_id_op_connect_reinit_done(struct tevent_req *req) ret = sdap_reinit_cleanup_recv(req); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up [%d]: %s\n", ret, strerror(ret)); /* not fatal */ return; } - DEBUG(SSSDBG_TRACE_FUNC, ("Reinitialization clean up completed\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reinitialization clean up completed\n"); } /* Mark operation connection request as complete */ @@ -812,7 +812,7 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) /* do not reuse failed connection */ op->conn_cache->cached_connection = NULL; - DEBUG(5, ("communication error on cached connection, moving to next server\n")); + DEBUG(5, "communication error on cached connection, moving to next server\n"); be_fo_try_next_server(op->conn_cache->id_conn->id_ctx->be, op->conn_cache->id_conn->service->name); } @@ -824,13 +824,13 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) /* if backend is already offline, just report offline, do not duplicate errors */ dp_err = DP_ERR_OFFLINE; retval = EAGAIN; - DEBUG(9, ("falling back to offline data...\n")); + DEBUG(9, "falling back to offline data...\n"); } else if (communication_error) { /* communication error, can try to reconnect */ if (!sdap_id_op_can_reconnect(op)) { dp_err = DP_ERR_FATAL; - DEBUG(9, ("too many communication failures, giving up...\n")); + DEBUG(9, "too many communication failures, giving up...\n"); } else { dp_err = DP_ERR_OK; retval = EAGAIN; @@ -842,14 +842,14 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) if (dp_err == DP_ERR_OK && retval != EOK) { /* reconnect retry */ op->reconnect_retry_count++; - DEBUG(9, ("advising for connection retry #%i\n", op->reconnect_retry_count)); + DEBUG(9, "advising for connection retry #%i\n", op->reconnect_retry_count); } else { /* end of request */ op->reconnect_retry_count = 0; } if (current_conn) { - DEBUG(9, ("releasing operation connection\n")); + DEBUG(9, "releasing operation connection\n"); sdap_id_op_hook_conn_data(op, NULL); } diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c index aad8e34aa..382603554 100644 --- a/src/providers/ldap/sdap_idmap.c +++ b/src/providers/ldap/sdap_idmap.c @@ -43,22 +43,22 @@ sdap_idmap_get_configured_external_range(struct sdap_idmap_ctx *idmap_ctx, int_id = dp_opt_get_int(id_ctx->opts->basic, SDAP_MIN_ID); if (int_id < 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ldap_min_id must be greater than 0.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "ldap_min_id must be greater than 0.\n"); return EINVAL; } min = int_id; int_id = dp_opt_get_int(id_ctx->opts->basic, SDAP_MAX_ID); if (int_id < 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ldap_max_id must be greater than 0.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "ldap_max_id must be greater than 0.\n"); return EINVAL; } max = int_id; if ((min == 0 && max != 0) || (min != 0 && max == 0)) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Both ldap_min_id and ldap_max_id " \ + DEBUG(SSSDBG_CONF_SETTINGS, "Both ldap_min_id and ldap_max_id " \ "either must be 0 (not set) " \ - "or positive integers.\n")); + "or positive integers.\n"); return EINVAL; } @@ -88,7 +88,7 @@ sdap_idmap_add_configured_external_range(struct sdap_idmap_ctx *idmap_ctx) ret = sdap_idmap_get_configured_external_range(idmap_ctx, &range); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_idmap_get_configured_external_range failed.\n")); + "sdap_idmap_get_configured_external_range failed.\n"); return ret; } @@ -99,8 +99,8 @@ sdap_idmap_add_configured_external_range(struct sdap_idmap_ctx *idmap_ctx) NULL, 0, true); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s] to the map: [%d]\n", - id_ctx->be->domain->name, err)); + "Could not add domain [%s] to the map: [%d]\n", + id_ctx->be->domain->name, err); return EIO; } @@ -118,7 +118,7 @@ errno_t sdap_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx, -1); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain [%s]\n", dom_name)); + "Could not add new domain [%s]\n", dom_name); return ret; } @@ -170,17 +170,17 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, || (idmap_upper-idmap_lower) < rangesize) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid settings for range selection: " + "Invalid settings for range selection: " "[%"SPRIid"][%"SPRIid"][%"SPRIid"]\n", - idmap_lower, idmap_upper, rangesize)); + idmap_lower, idmap_upper, rangesize); ret = EINVAL; goto done; } if (((idmap_upper - idmap_lower) % rangesize) != 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Range size does not divide evenly. Uppermost range will " - "not be used\n")); + "Range size does not divide evenly. Uppermost range will " + "not be used\n"); } /* Initialize the map */ @@ -189,8 +189,8 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, &idmap_ctx->map); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize the ID map: [%s]\n", - idmap_error_string(err))); + "Could not initialize the ID map: [%s]\n", + idmap_error_string(err)); if (err == IDMAP_OUT_OF_MEMORY) { ret = ENOMEM; } else { @@ -205,7 +205,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, err |= sss_idmap_ctx_set_rangesize(idmap_ctx->map, rangesize); if (err != IDMAP_SUCCESS) { /* This should never happen */ - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_idmap_ctx corrupted\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_idmap_ctx corrupted\n"); return EIO; } @@ -216,7 +216,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, ret = sdap_idmap_add_configured_external_range(idmap_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_idmap_add_configured_external_range failed.\n")); + "sdap_idmap_add_configured_external_range failed.\n"); goto done; } } @@ -225,14 +225,14 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, ret = sysdb_idmap_get_mappings(tmp_ctx, id_ctx->be->domain, &res); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not read ID mappings from the cache: [%s]\n", - strerror(ret))); + "Could not read ID mappings from the cache: [%s]\n", + strerror(ret)); goto done; } if (ret == EOK && res->count > 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Initializing [%d] domains for ID-mapping\n", res->count)); + "Initializing [%d] domains for ID-mapping\n", res->count); for (i = 0; i < res->count; i++) { dom_name = ldb_msg_find_attr_as_string(res->msgs[i], @@ -266,9 +266,9 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, sid_str, slice_num); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s][%s][%"SPRIid"] " + "Could not add domain [%s][%s][%"SPRIid"] " "to ID map: [%s]\n", - dom_name, sid_str, slice_num, strerror(ret))); + dom_name, sid_str, slice_num, strerror(ret)); goto done; } } @@ -293,18 +293,18 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, sid_str, 0); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s][%s][%u] to ID map: [%s]\n", - dom_name, sid_str, 0, strerror(ret))); + "Could not add domain [%s][%s][%u] to ID map: [%s]\n", + dom_name, sid_str, 0, strerror(ret)); goto done; } } else { if (dp_opt_get_bool(idmap_ctx->id_ctx->opts->basic, SDAP_IDMAP_AUTORID_COMPAT)) { /* In autorid compatibility mode, we MUST have a slice 0 */ DEBUG(SSSDBG_CRIT_FAILURE, - ("WARNING: Autorid compatibility mode selected, " + "WARNING: Autorid compatibility mode selected, " "but %s is not set. UID/GID values may differ " "between clients.\n", - idmap_ctx->id_ctx->opts->basic[SDAP_IDMAP_DEFAULT_DOMAIN_SID].opt_name)); + idmap_ctx->id_ctx->opts->basic[SDAP_IDMAP_DEFAULT_DOMAIN_SID].opt_name); } /* Otherwise, we'll just fall back to hash values as they are seen */ } @@ -333,7 +333,7 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, ret = sss_idmap_ctx_get_upper(idmap_ctx->map, &idmap_upper); if (ret != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get upper bound of available ID range.\n")); + "Failed to get upper bound of available ID range.\n"); ret = EIO; goto done; } @@ -343,19 +343,19 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, ret = sss_idmap_calculate_range(idmap_ctx->map, dom_sid, &slice, &range); if (ret != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to calculate range for domain [%s]: [%d]\n", dom_name, - ret)); + "Failed to calculate range for domain [%s]: [%d]\n", dom_name, + ret); ret = EIO; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Adding domain [%s] as slice [%"SPRIid"]\n", dom_sid, slice)); + "Adding domain [%s] as slice [%"SPRIid"]\n", dom_sid, slice); if (range.max > idmap_upper) { /* This should never happen */ DEBUG(SSSDBG_CRIT_FAILURE, - ("BUG: Range maximum exceeds the global maximum: " - "%u > %"SPRIid"\n", range.max, idmap_upper)); + "BUG: Range maximum exceeds the global maximum: " + "%u > %"SPRIid"\n", range.max, idmap_upper); ret = EINVAL; goto done; } @@ -363,7 +363,7 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, ret = sdap_idmap_get_configured_external_range(idmap_ctx, &range); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_idmap_get_configured_external_range failed.\n")); + "sdap_idmap_get_configured_external_range failed.\n"); return ret; } } @@ -373,8 +373,8 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, NULL, 0, external_mapping); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s] to the map: [%d]\n", - dom_name, err)); + "Could not add domain [%s] to the map: [%d]\n", + dom_name, err); ret = EIO; goto done; } @@ -386,7 +386,7 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, dom_name, dom_sid, slice); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_idmap_store_mapping failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_idmap_store_mapping failed.\n"); goto done; } } @@ -465,14 +465,14 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto done; } ret = idmap_ctx->find_new_domain(idmap_ctx, dom_sid_str, dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain for sid [%s]\n", sid_str)); + "Could not add new domain for sid [%s]\n", sid_str); goto done; } @@ -482,23 +482,23 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, (uint32_t *)id); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert objectSID [%s] to a UNIX ID\n", - sid_str)); + "Could not convert objectSID [%s] to a UNIX ID\n", + sid_str); ret = EIO; goto done; } break; case IDMAP_BUILTIN_SID: DEBUG(SSSDBG_TRACE_FUNC, - ("Object SID [%s] is a built-in one.\n", sid_str)); + "Object SID [%s] is a built-in one.\n", sid_str); /* ENOTSUP indicates built-in SID */ ret = ENOTSUP; goto done; break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert objectSID [%s] to a UNIX ID\n", - sid_str)); + "Could not convert objectSID [%s] to a UNIX ID\n", + sid_str); ret = EIO; goto done; } @@ -559,7 +559,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, } else { tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return false; } @@ -567,7 +567,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, &new_dom_sid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", dom_sid)); + "Could not parse domain SID from [%s]\n", dom_sid); talloc_free(tmp_ctx); return false; } @@ -577,7 +577,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, talloc_free(tmp_ctx); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain for sid [%s]\n", dom_sid)); + "Could not add new domain for sid [%s]\n", dom_sid); return false; } diff --git a/src/providers/ldap/sdap_range.c b/src/providers/ldap/sdap_range.c index c4bf43539..d88def6fa 100644 --- a/src/providers/ldap/sdap_range.c +++ b/src/providers/ldap/sdap_range.c @@ -55,7 +55,7 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, ret = EOK; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("No sub-attributes for [%s]\n", attr_desc)); + "No sub-attributes for [%s]\n", attr_desc); goto done; } @@ -67,8 +67,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Base attribute of [%s] is [%s]\n", - attr_desc, base)); + "Base attribute of [%s] is [%s]\n", + attr_desc, base); /* Next, determine if this is a ranged attribute */ if (strncmp(endptr+1, SDAP_RANGE_STRING, rangestringlen) != 0) { @@ -82,8 +82,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, ret = EOK; } DEBUG(SSSDBG_TRACE_LIBS, - ("[%s] contains sub-attribute other than a range, returning whole\n", - attr_desc)); + "[%s] contains sub-attribute other than a range, returning whole\n", + attr_desc); goto done; } else if (disable_range_retrieval) { /* This is range sub-attribute, but we want to ignore it. @@ -102,8 +102,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, if (!end_range) { ret = EINVAL; DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot find hyphen in [%s]\n", - endptr + rangestringlen +1)); + "Cannot find hyphen in [%s]\n", + endptr + rangestringlen +1); goto done; } end_range++; /* advance past the hyphen */ @@ -113,8 +113,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, *base_attr = talloc_steal(mem_ctx, base); *range_offset = 0; DEBUG(SSSDBG_TRACE_LIBS, - ("[%s] contained the last set of values for this attribute\n", - attr_desc)); + "[%s] contained the last set of values for this attribute\n", + attr_desc); ret = EOK; goto done; } @@ -124,16 +124,16 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, *range_offset = 0; ret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("[%s] did not parse as an unsigned integer: [%s]\n", - end_range, strerror(ret))); + "[%s] did not parse as an unsigned integer: [%s]\n", + end_range, strerror(ret)); goto done; } (*range_offset)++; *base_attr = talloc_steal(mem_ctx, base); DEBUG(SSSDBG_TRACE_LIBS, - ("Parsed range values: [%s][%d]\n", - base, *range_offset)); + "Parsed range values: [%s][%d]\n", + base, *range_offset); ret = EAGAIN; done: diff --git a/src/providers/ldap/sdap_refresh.c b/src/providers/ldap/sdap_refresh.c index 819ee4fce..fb2dbc781 100644 --- a/src/providers/ldap/sdap_refresh.c +++ b/src/providers/ldap/sdap_refresh.c @@ -47,7 +47,7 @@ struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_refresh_netgroups_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -63,11 +63,11 @@ struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx, ret = sdap_refresh_netgroups_step(req); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("Nothing to refresh\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Nothing to refresh\n"); goto immediately; } else if (ret != EAGAIN) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_refresh_netgroups_step() failed " - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_refresh_netgroups_step() failed " + "[%d]: %s\n", ret, sss_strerror(ret)); goto immediately; } @@ -104,7 +104,7 @@ static errno_t sdap_refresh_netgroups_step(struct tevent_req *req) goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing refresh of netgroup %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing refresh of netgroup %s\n", name); subreq = ldap_netgroup_get_send(state, state->ev, state->id_ctx, state->id_ctx->opts->sdom, @@ -136,9 +136,9 @@ static void sdap_refresh_netgroups_done(struct tevent_req *subreq) ret = ldap_netgroup_get_recv(subreq, &dp_error, &sdap_ret); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to refresh netgroup [dp_error: %d, " + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to refresh netgroup [dp_error: %d, " "sdap_ret: %d, errno: %d]: %s\n", - dp_error, sdap_ret, ret, sss_strerror(ret))); + dp_error, sdap_ret, ret, sss_strerror(ret)); goto done; } diff --git a/src/providers/ldap/sdap_reinit.c b/src/providers/ldap/sdap_reinit.c index 5c909379d..265453fdf 100644 --- a/src/providers/ldap/sdap_reinit.c +++ b/src/providers/ldap/sdap_reinit.c @@ -74,15 +74,15 @@ struct tevent_req* sdap_reinit_cleanup_send(TALLOC_CTX *mem_ctx, ret = sdap_reinit_clear_usn(state->sysdb, state->domain); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to clear USN attributes [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to clear USN attributes [%d]: %s\n", + ret, strerror(ret)); goto immediately; } subreq = sdap_dom_enum_send(id_ctx, be_ctx->ev, id_ctx, id_ctx->opts->sdom, id_ctx->conn); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to issue enumeration request\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to issue enumeration request\n"); ret = ENOMEM; goto immediately; } @@ -114,8 +114,8 @@ static void sdap_delete_msgs_usn(struct sysdb_ctx *sysdb, for (i = 0; i < msgs_num; i++) { ret = sysdb_set_entry_attr(sysdb, msgs[i]->dn, &usn_el, SYSDB_MOD_DEL); if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to clean USN on entry: [%s]\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to clean USN on entry: [%s]\n", + ldb_dn_get_linearized(msgs[i]->dn)); } } } @@ -133,7 +133,7 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -166,7 +166,7 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb, ret = sysdb_search_services(tmp_ctx, domain, "", attrs, &msgs_num, &msgs); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot search services [%d]: %s\n", ret, strerror(ret))); + "Cannot search services [%d]: %s\n", ret, strerror(ret)); goto done; } @@ -178,14 +178,14 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb, if (ret == EOK) { in_transaction = false; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not commit transaction\n"); } done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } @@ -206,8 +206,8 @@ static void sdap_reinit_cleanup_done(struct tevent_req *subreq) ret = sdap_dom_enum_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Domain enumeration failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Domain enumeration failed [%d]: %s\n", + ret, strerror(ret)); goto fail; } @@ -218,8 +218,8 @@ static void sdap_reinit_cleanup_done(struct tevent_req *subreq) */ ret = sysdb_set_enumerated(state->domain, true); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not mark domain as having " - "enumerated.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not mark domain as having " + "enumerated.\n"); /* This error is non-fatal, so continue */ } @@ -245,8 +245,8 @@ static void sdap_delete_msgs_dn(struct sysdb_ctx *sysdb, for (i = 0; i < msgs_num; i++) { ret = sysdb_delete_entry(sysdb, msgs[i]->dn, true); if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to delete entry: [%s]\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to delete entry: [%s]\n", + ldb_dn_get_linearized(msgs[i]->dn)); } } } @@ -264,7 +264,7 @@ static errno_t sdap_reinit_delete_records(struct sss_domain_info *domain) tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; } @@ -305,14 +305,14 @@ static errno_t sdap_reinit_delete_records(struct sss_domain_info *domain) if (ret == EOK) { in_transaction = false; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not commit transaction\n"); } done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c index 9da549ac8..6809f743c 100644 --- a/src/providers/ldap/sdap_sudo.c +++ b/src/providers/ldap/sdap_sudo.c @@ -128,11 +128,11 @@ int sdap_sudo_init(struct be_ctx *be_ctx, struct tevent_req *req = NULL; int ret; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing sudo LDAP back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing sudo LDAP back end\n"); sudo_ctx = talloc_zero(be_ctx, struct sdap_sudo_ctx); if (sudo_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc() failed\n"); return ENOMEM; } @@ -150,23 +150,23 @@ int sdap_sudo_init(struct be_ctx *be_ctx, &sudo_ctx->include_regexp, &sudo_ctx->include_netgroups); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get SUDO options [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get SUDO options [%d]: %s\n", + ret, strerror(ret)); return ret; } req = sdap_sudo_get_hostinfo_send(sudo_ctx, id_ctx->opts, be_ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve host information - " - "(host filter will be disabled)\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve host information - " + "(host filter will be disabled)\n"); sudo_ctx->use_host_filter = false; ret = sdap_sudo_setup_periodical_refresh(sudo_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to setup periodical refresh" - "of sudo rules [%d]: %s\n", ret, strerror(ret))); + "Unable to setup periodical refresh" + "of sudo rules [%d]: %s\n", ret, strerror(ret)); /* periodical updates will not work, but specific-rule update * is no affected by this, therefore we don't have to fail here */ } @@ -189,8 +189,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req) ret = sdap_sudo_get_hostinfo_recv(sudo_ctx, req, &hostnames, &ip_addr); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve host information - " - "(host filter will be disabled) [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve host information - " + "(host filter will be disabled) [%d]: %s\n", ret, strerror(ret)); sudo_ctx->use_host_filter = false; } @@ -202,8 +202,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req) ret = sdap_sudo_setup_periodical_refresh(sudo_ctx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to setup periodical refresh" - "of sudo rules [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to setup periodical refresh" + "of sudo rules [%d]: %s\n", ret, strerror(ret)); } } @@ -226,9 +226,9 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) if (smart_interval == 0 && full_interval == 0) { smart_default = id_ctx->opts->basic[SDAP_SUDO_SMART_REFRESH_INTERVAL].def_val.number; - DEBUG(SSSDBG_MINOR_FAILURE, ("At least one periodical update has to be " + DEBUG(SSSDBG_MINOR_FAILURE, "At least one periodical update has to be " "enabled. Setting smart refresh interval to default value (%ld).\n", - smart_default)); + smart_default); ret = dp_opt_set_int(id_ctx->opts->basic, SDAP_SUDO_SMART_REFRESH_INTERVAL, @@ -239,9 +239,9 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) } if (full_interval <= smart_interval) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Full refresh interval has to be greater" + DEBUG(SSSDBG_MINOR_FAILURE, "Full refresh interval has to be greater" "than smart refresh interval. Periodical full refresh will be " - "disabled.\n")); + "disabled.\n"); ret = dp_opt_set_int(id_ctx->opts->basic, SDAP_SUDO_FULL_REFRESH_INTERVAL, 0); @@ -280,8 +280,8 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) sdap_sudo_periodical_first_refresh_done, delay, full_interval, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); return ret; } @@ -303,10 +303,10 @@ static void sdap_sudo_set_usn(struct sdap_server_opts *srv_opts, char *usn) srv_opts->last_usn = usn_number; } - DEBUG(SSSDBG_FUNC_DATA, ("SUDO higher USN value: [%s]\n", - srv_opts->max_sudo_value)); + DEBUG(SSSDBG_FUNC_DATA, "SUDO higher USN value: [%s]\n", + srv_opts->max_sudo_value); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("srv_opts is NULL\n")); + DEBUG(SSSDBG_TRACE_FUNC, "srv_opts is NULL\n"); } } @@ -323,7 +323,7 @@ static char *sdap_sudo_build_host_filter(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; } @@ -425,7 +425,7 @@ static char *sdap_sudo_get_filter(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; } @@ -469,8 +469,8 @@ static void sdap_sudo_reply(struct tevent_req *req) ret = sdap_sudo_rules_refresh_recv(req, &dp_error, &error); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid request type: %d\n", + sudo_req->type); ret = EINVAL; } @@ -500,25 +500,25 @@ void sdap_sudo_handler(struct be_req *be_req) switch (sudo_req->type) { case BE_REQ_SUDO_FULL: - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a full refresh of sudo rules\n"); req = sdap_sudo_full_refresh_send(be_req, sudo_ctx); break; case BE_REQ_SUDO_RULES: - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a refresh of specific sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a refresh of specific sudo rules\n"); req = sdap_sudo_rules_refresh_send(be_req, sudo_ctx, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, sudo_req->rules); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid request type: %d\n", + sudo_req->type); ret = EINVAL; goto fail; } if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to send request: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send request: %d\n", + sudo_req->type); ret = ENOMEM; goto fail; } @@ -546,7 +546,7 @@ static struct tevent_req *sdap_sudo_full_refresh_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_full_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -580,7 +580,7 @@ static struct tevent_req *sdap_sudo_full_refresh_send(TALLOC_CTX *mem_ctx, goto immediately; } - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a full refresh of sudo rules\n"); subreq = sdap_sudo_refresh_send(state, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, @@ -632,14 +632,14 @@ static void sdap_sudo_full_refresh_done(struct tevent_req *subreq) /* save the time in the sysdb */ ret = sysdb_sudo_set_last_full_refresh(state->domain, time(NULL)); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to save time of " - "a successful full refresh\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to save time of " + "a successful full refresh\n"); /* this is only a minor error that does not affect the functionality, * therefore there is no need to report it with tevent_req_error() * which would cause problems in the consumers */ } - DEBUG(SSSDBG_TRACE_FUNC, ("Successful full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Successful full refresh of sudo rules\n"); /* set highest usn */ if (highest_usn != NULL) { @@ -697,13 +697,13 @@ static struct tevent_req *sdap_sudo_rules_refresh_send(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; } req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_rules_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } @@ -851,15 +851,15 @@ static struct tevent_req *sdap_sudo_smart_refresh_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_smart_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; } if (!sudo_ctx->full_refresh_done && (srv_opts == NULL || srv_opts->max_sudo_value == 0)) { /* Perform full refresh first */ - DEBUG(SSSDBG_TRACE_FUNC, ("USN value is unknown, " - "waiting for full refresh!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "USN value is unknown, " + "waiting for full refresh!\n"); ret = EINVAL; goto immediately; } @@ -894,8 +894,8 @@ static struct tevent_req *sdap_sudo_smart_refresh_send(TALLOC_CTX *mem_ctx, /* Do not remove any rules that are already in the sysdb * sysdb_filter = NULL; */ - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a smart refresh of sudo rules " - "(USN > %s)\n", (usn == NULL ? "0" : usn))); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a smart refresh of sudo rules " + "(USN > %s)\n", (usn == NULL ? "0" : usn)); subreq = sdap_sudo_refresh_send(state, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, @@ -943,7 +943,7 @@ static void sdap_sudo_smart_refresh_done(struct tevent_req *subreq) goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Successful smart refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Successful smart refresh of sudo rules\n"); /* set highest usn */ if (highest_usn != NULL) { @@ -997,8 +997,8 @@ static void sdap_sudo_full_refresh_online_cb(void *pvt) SDAP_SUDO_FULL_REFRESH_INTERVAL); if (timeout == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; } @@ -1007,8 +1007,8 @@ static void sdap_sudo_full_refresh_online_cb(void *pvt) sdap_sudo_periodical_first_refresh_done, 0, timeout, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); } } @@ -1025,21 +1025,21 @@ static void sdap_sudo_periodical_first_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; } ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " - "failed [%d]: %s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " + "failed [%d]: %s)\n", ret, strerror(ret)); goto schedule; } if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; } @@ -1055,8 +1055,8 @@ schedule: SDAP_SUDO_FULL_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; } @@ -1069,8 +1069,8 @@ schedule: delay = SUDO_MAX_FIRST_REFRESH_DELAY; } - DEBUG(SSSDBG_TRACE_FUNC, ("Data provider is offline. " - "Scheduling another full refresh in %ld minutes.\n", delay)); + DEBUG(SSSDBG_TRACE_FUNC, "Data provider is offline. " + "Scheduling another full refresh in %ld minutes.\n", delay); ret = sdap_sudo_schedule_refresh(sudo_ctx, sudo_ctx, SDAP_SUDO_REFRESH_FULL, @@ -1078,8 +1078,8 @@ schedule: delay * 60, timeout, &sudo_ctx->first_refresh_timer); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); } /* also setup online callback to make sure the refresh is fired as soon @@ -1088,7 +1088,7 @@ schedule: sdap_sudo_full_refresh_online_cb, sudo_ctx, &sudo_ctx->first_refresh_online_cb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up online callback\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up online callback\n"); } return; @@ -1096,7 +1096,7 @@ schedule: ret = sdap_sudo_schedule_full_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Full periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Full periodical refresh will not work.\n"); } /* smart refresh */ @@ -1104,14 +1104,14 @@ schedule: SDAP_SUDO_SMART_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical smart refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical smart refresh of sudo rules " + "is disabled\n"); return; } ret = sdap_sudo_schedule_smart_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Smart periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Smart periodical refresh will not work.\n"); } } @@ -1127,21 +1127,21 @@ static void sdap_sudo_periodical_full_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; } ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " - "failed [%d]: %s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " + "failed [%d]: %s)\n", ret, strerror(ret)); goto schedule; } if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; } @@ -1153,14 +1153,14 @@ schedule: SDAP_SUDO_FULL_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; } ret = sdap_sudo_schedule_full_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Full periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Full periodical refresh will not work.\n"); } } @@ -1176,20 +1176,20 @@ static void sdap_sudo_periodical_smart_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; } ret = sdap_sudo_smart_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical smart refresh of sudo rules " - "failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules " + "failed [%d]: %s\n", ret, strerror(ret)); } if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical smart refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; } @@ -1201,14 +1201,14 @@ schedule: SDAP_SUDO_SMART_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical smart refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical smart refresh of sudo rules " + "is disabled\n"); return; } ret = sdap_sudo_schedule_smart_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Smart periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Smart periodical refresh will not work.\n"); } } @@ -1237,10 +1237,10 @@ static int sdap_sudo_schedule_refresh(TALLOC_CTX *mem_ctx, name = "Smart refresh"; break; case SDAP_SUDO_REFRESH_RULES: - DEBUG(SSSDBG_OP_FAILURE, ("Rules refresh can't be scheduled!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Rules refresh can't be scheduled!\n"); return EINVAL; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown refresh type [%d].\n", refresh)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown refresh type [%d].\n", refresh); return EINVAL; } @@ -1254,8 +1254,8 @@ static int sdap_sudo_schedule_refresh(TALLOC_CTX *mem_ctx, tevent_req_set_callback(req, callback, sudo_ctx); - DEBUG(SSSDBG_TRACE_FUNC, ("%s scheduled at: %lld\n", - name, (long long)when.tv_sec)); + DEBUG(SSSDBG_TRACE_FUNC, "%s scheduled at: %lld\n", + name, (long long)when.tv_sec); if (_req != NULL) { *_req = req; @@ -1274,8 +1274,8 @@ static int sdap_sudo_schedule_full_refresh(struct sdap_sudo_ctx *sudo_ctx, sdap_sudo_periodical_full_refresh_done, delay, delay, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules!\n"); return ret; } @@ -1292,8 +1292,8 @@ static int sdap_sudo_schedule_smart_refresh(struct sdap_sudo_ctx *sudo_ctx, sdap_sudo_periodical_smart_refresh_done, delay, delay, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule smart refresh of sudo " - "rules!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule smart refresh of sudo " + "rules!\n"); return ret; } diff --git a/src/providers/ldap/sdap_sudo_cache.c b/src/providers/ldap/sdap_sudo_cache.c index c57082c1a..27203c227 100644 --- a/src/providers/ldap/sdap_sudo_cache.c +++ b/src/providers/ldap/sdap_sudo_cache.c @@ -41,7 +41,7 @@ static errno_t sdap_sudo_get_usn(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_USN].sys_name, &usn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve USN value: [%s]\n", strerror(ret))); + "Failed to retrieve USN value: [%s]\n", strerror(ret)); return ret; } @@ -69,33 +69,33 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_NAME].sys_name, &rule_name); if (ret == ERANGE) { - DEBUG(SSSDBG_OP_FAILURE, ("Warning: found rule that contains none " - "or multiple CN values. It will be skipped.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Warning: found rule that contains none " + "or multiple CN values. It will be skipped.\n"); return ret; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get rule name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not get rule name [%d]: %s\n", + ret, strerror(ret)); return ret; } ret = sysdb_attrs_add_time_t(attrs, SYSDB_CACHE_EXPIRE, (cache_timeout ? (now + cache_timeout) : 0)); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb cache expire [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n", + ret, strerror(ret)); return ret; } ret = sdap_sudo_get_usn(mem_ctx, attrs, map, rule_name, _usn); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not read USN from %s\n", rule_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not read USN from %s\n", rule_name); *_usn = NULL; /* but we will store the rule anyway */ } ret = sysdb_save_sudorule(domain, rule_name, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save sudorule %s\n", rule_name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not save sudorule %s\n", rule_name); return ret; } @@ -121,13 +121,13 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "talloc_new() failed\n"); return ENOMEM; } ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not start transaction\n"); goto fail; } in_transaction = true; @@ -137,8 +137,8 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, ret = sdap_save_native_sudorule(tmp_ctx, domain, map, replies[i], cache_timeout, now, &usn_value); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to save sudo rule, " - "will continue with next...\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to save sudo rule, " + "will continue with next...\n"); continue; } @@ -160,7 +160,7 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -174,7 +174,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(domain->sysdb); if (tret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } |