summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-05-17 17:36:38 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-05-20 22:37:25 +0200
commit7486dea9f5f7b2a6fbbacc6db740a82140b6377c (patch)
treea7f7cfc4f772860423e56d363ade1f6408f45f71 /src
parent574061e65d3fb687b9cb2c757afa1fe92812245e (diff)
downloadsssd-7486dea9f5f7b2a6fbbacc6db740a82140b6377c.tar.gz
sssd-7486dea9f5f7b2a6fbbacc6db740a82140b6377c.tar.bz2
sssd-7486dea9f5f7b2a6fbbacc6db740a82140b6377c.zip
Fixing critical format string issues.
--missing arguments. --format '%s', but argument is integer. --wrong format string, examle: '%\n'
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb_idmap.c3
-rw-r--r--src/providers/krb5/krb5_child.c4
-rw-r--r--src/providers/krb5/krb5_utils.c4
-rw-r--r--src/providers/ldap/ldap_init.c4
-rw-r--r--src/providers/ldap/sdap_async.c3
-rw-r--r--src/providers/ldap/sdap_async_connection.c4
-rw-r--r--src/providers/ldap/sdap_async_groups.c3
-rw-r--r--src/providers/ldap/sdap_async_initgroups_ad.c2
-rw-r--r--src/resolv/async_resolv.c6
-rw-r--r--src/responder/common/responder_common.c5
-rw-r--r--src/responder/nss/nsssrv_cmd.c15
-rw-r--r--src/responder/nss/nsssrv_services.c2
-rw-r--r--src/responder/pam/pam_LOCAL_domain.c2
-rw-r--r--src/responder/pam/pamsrv_cmd.c4
-rw-r--r--src/responder/pam/pamsrv_dp.c6
-rw-r--r--src/responder/sudo/sudosrv_get_sudorules.c5
-rw-r--r--src/sbus/sssd_dbus_server.c5
-rw-r--r--src/tools/files.c6
-rw-r--r--src/tools/sss_seed.c2
-rw-r--r--src/tools/sss_userdel.c6
-rw-r--r--src/tools/tools_mc_util.c3
-rw-r--r--src/tools/tools_util.c3
22 files changed, 61 insertions, 36 deletions
diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c
index 612a42aa..7b46ae66 100644
--- a/src/db/sysdb_idmap.c
+++ b/src/db/sysdb_idmap.c
@@ -196,7 +196,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
if (slice_num != old_slice) {
DEBUG(SSSDBG_FATAL_FAILURE,
("Detected attempt to change slice value for sid [%s] "
- "This will break existing users. Refusing to perform.\n"));
+ "This will break existing users. Refusing to perform.\n",
+ dom_sid));
ret = EINVAL;
goto done;
}
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 831905af..4626f59f 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -2029,7 +2029,9 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline)
} else if (strcasecmp(use_fast_str, "demand") == 0) {
kerr = k5c_setup_fast(kr, lifetime_str, true);
} else {
- DEBUG(1, ("Unsupported value [%s] for krb5_use_fast.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Unsupported value [%s] for krb5_use_fast.\n",
+ use_fast_str));
return EINVAL;
}
}
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 52456893..1883d785 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -858,7 +858,7 @@ cc_file_check_existing(const char *location, uid_t uid,
filename = sss_krb5_residual_check_type(location, SSS_KRB5_TYPE_FILE);
if (!filename) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n", location));
return EINVAL;
}
@@ -922,7 +922,7 @@ cc_file_remove(const char *location)
filename = sss_krb5_residual_check_type(location, SSS_KRB5_TYPE_FILE);
if (!filename) {
- DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("%s is not of type FILE:\n", location));
return EINVAL;
}
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 0884a85c..12b204c8 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -317,7 +317,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx,
}
if (order_list_len > LDAP_ACCESS_LAST) {
- DEBUG(1, ("Currently only [%d] different access rules are supported.\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Currently only [%d] different access rules are supported.\n",
+ LDAP_ACCESS_LAST));
ret = EINVAL;
goto done;
}
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index afa2904f..5eac1d43 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -2228,7 +2228,8 @@ 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 "
- "list of the LDAP attributes [%d]: %s\n", ret, strerror(ret)));
+ "list of the LDAP attributes [%d]: %s\n",
+ attr_name, ret, strerror(ret)));
return ret;
}
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 39a3ce94..4f6986fc 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -850,8 +850,8 @@ static void simple_bind_done(struct sdap_op *op,
talloc_zfree(nval);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
- ("Could not convert control response to an integer. ",
- "[%s]\n", strerror(ret)));
+ ("Couldn't convert control response "
+ "to an integer [%s].\n", strerror(ret)));
goto done;
}
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index cb30d4bb..dc7fba42 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -2052,7 +2052,8 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
ret = EINVAL;
}
if (ret != EOK) {
- DEBUG(1, ("User entry %s has no originalDN attribute\n", i));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("User entry %d has no originalDN attribute\n", i));
goto done;
}
original_dn = (const char *) el->values[0].data;
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
index a3f6694a..c2dec373 100644
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
@@ -569,7 +569,7 @@ done:
sret = sysdb_transaction_cancel(state->sysdb);
DEBUG(SSSDBG_FATAL_FAILURE,
("Could not cancel transaction! [%s]\n",
- sret));
+ strerror(sret)));
}
if (ret == EOK) {
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index ad9d5829..f1e577e8 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -645,7 +645,8 @@ resolv_copy_hostent_ares(TALLOC_CTX *mem_ctx, struct hostent *src,
&((struct ares_addr6ttl *) ares_ttl_data)[i]);
break;
default:
- DEBUG(1, ("Unknown address family %d\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Unknown address family %d\n", family));
goto fail;
}
@@ -1484,7 +1485,8 @@ resolv_get_sockaddr_address_index(TALLOC_CTX *mem_ctx,
((struct sockaddr_in6 *) sockaddr)->sin6_port = (in_port_t) htons(port);
break;
default:
- DEBUG(1, ("Unknown address family %d\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Unknown address family %d\n", hostent->family));
return NULL;
}
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 54701d6f..4a878c67 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -462,8 +462,9 @@ static void accept_fd_handler(struct tevent_context *ev,
if (!cctx->cfde) {
close(cctx->cfd);
talloc_free(cctx);
- DEBUG(2, ("Failed to queue client handler%\n",
- accept_ctx->is_private ? " on privileged pipe" : ""));
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Failed to queue client handler%s\n",
+ accept_ctx->is_private ? " on privileged pipe" : ""));
return;
}
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index c409e794..57b5786f 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -1123,7 +1123,8 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx)
}
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+ dctx->cmdctx->cmd));
ret = EINVAL;
}
@@ -1202,7 +1203,8 @@ static void nss_cmd_getbynam_done(struct tevent_req *req)
}
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+ dctx->cmdctx->cmd));
ret = EINVAL;
}
@@ -1407,7 +1409,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx)
}
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+ dctx->cmdctx->cmd));
ret = EINVAL;
goto done;
}
@@ -1452,7 +1455,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx)
}
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+ dctx->cmdctx->cmd));
ret = EINVAL;
}
@@ -1513,7 +1517,8 @@ static void nss_cmd_getbyid_done(struct tevent_req *req)
}
break;
default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", dctx->cmdctx));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n",
+ dctx->cmdctx->cmd));
ret = EINVAL;
}
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index 99fc67e7..42a1deed 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -658,7 +658,7 @@ fill_service(struct sss_packet *packet,
port = (uint16_t) ldb_msg_find_attr_as_uint(msg, SYSDB_SVC_PORT, 0);
if (!port) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("No port for service [%s]. Skipping\n"));
+ ("No port for service [%s]. Skipping\n", tmpstr));
}
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c
index 4aec3e4d..e7776cba 100644
--- a/src/responder/pam/pam_LOCAL_domain.c
+++ b/src/responder/pam/pam_LOCAL_domain.c
@@ -332,7 +332,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
break;
default:
lreq->error = EINVAL;
- DEBUG(1, ("Unknown PAM task [%d].\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown PAM task [%d].\n", pd->cmd));
}
done:
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 8350f655..ff86a13a 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -416,7 +416,9 @@ static errno_t filter_responses(struct confdb_ctx *cdb,
break;
default:
- DEBUG(7, ("User info type [%d] not filtered.\n"));
+ DEBUG(SSSDBG_TRACE_LIBS,
+ ("User info type [%d] not filtered.\n",
+ user_info_type));
}
} else if (resp->type & SSS_SERVER_INFO) {
resp->do_not_send_to_client = true;
diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c
index 46c54dad..d5a52446 100644
--- a/src/responder/pam/pamsrv_dp.c
+++ b/src/responder/pam/pamsrv_dp.c
@@ -117,8 +117,10 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout)
res = sss_dp_get_domain_conn(preq->cctx->rctx,
preq->domain->conn_name, &be_conn);
if (res != EOK) {
- DEBUG(1, ("The Data Provider connection for %s is not available!"
- " This maybe a bug, it shouldn't happen!\n", preq->domain));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("The Data Provider connection for %s is not available!"
+ " This maybe a bug, it shouldn't happen!\n",
+ preq->domain->conn_name));
return EIO;
}
diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
index ab363da6..e84631e3 100644
--- a/src/responder/sudo/sudosrv_get_sudorules.c
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
@@ -564,7 +564,8 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
NULL, &groupnames);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("Unable to retrieve user info [%d]: %s\n", strerror(ret)));
+ ("Unable to retrieve user info [%d]: %s\n",
+ ret, strerror(ret)));
goto done;
}
flags = SYSDB_SUDO_FILTER_USERINFO | SYSDB_SUDO_FILTER_INCLUDE_ALL;
@@ -582,7 +583,7 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
&rules, &num_rules);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("Unable to retrieve sudo rules [%d]: %s\n", strerror(ret)));
+ ("Unable to retrieve sudo rules [%d]: %s\n", ret, strerror(ret)));
goto done;
}
diff --git a/src/sbus/sssd_dbus_server.c b/src/sbus/sssd_dbus_server.c
index 2255d196..3ada25b6 100644
--- a/src/sbus/sssd_dbus_server.c
+++ b/src/sbus/sssd_dbus_server.c
@@ -165,8 +165,9 @@ remove_socket_symlink(const char *symlink_name)
ret = unlink(symlink_name);
if (ret != 0) {
ret = errno;
- DEBUG(2, ("unlink failed to remove [%s] [%d]: %s\n",
- symlink, ret, strerror(ret)));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("unlink failed to remove [%s] [%d]: %s\n",
+ symlink_name, ret, strerror(ret)));
return ret;
}
diff --git a/src/tools/files.c b/src/tools/files.c
index 186f18b9..1c1b0855 100644
--- a/src/tools/files.c
+++ b/src/tools/files.c
@@ -208,7 +208,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx,
if (parent_dev && parent_dev != statres.st_dev) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Directory %s is on different filesystem, "
- "will not follow\n"));
+ "will not follow\n", result->d_name));
ret = EFAULT;
goto fail;
}
@@ -588,8 +588,8 @@ copy_entry(struct copy_ctx *cctx,
&st);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- ("Could recursively copy '%s' to '%s': %s\n",
- src_ent_path, dest_dir_fd, strerror(ret)));
+ ("Couldn't recursively copy '%s' to '%s': %s\n",
+ src_ent_path, dest_ent_path, strerror(ret)));
goto done;
}
} else if (S_ISREG(st.st_mode)) {
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 846a4472..75f7e8c5 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -789,7 +789,7 @@ int main(int argc, const char **argv)
/* initialize seed context and parse options */
ret = seed_init(sctx, argc, argv, &sctx);
if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE,("Seed init failed [%d][%d]\n",
+ DEBUG(SSSDBG_OP_FAILURE,("Seed init failed [%d][%s]\n",
ret, strerror(ret)));
goto done;
}
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c
index ac87a736..d61a4571 100644
--- a/src/tools/sss_userdel.c
+++ b/src/tools/sss_userdel.c
@@ -96,8 +96,10 @@ static int kick_user(struct tools_ctx *tctx)
} else {
/* parent */
if (pid == -1) {
- DEBUG(1, ("fork failed [%d]: %s\n"));
- return errno;
+ ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("fork failed [%d]: %s\n", ret, strerror(ret)));
+ return ret;
}
while((child_pid = waitpid(pid, &status, 0)) > 0) {
diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c
index b563fac3..33d5d26d 100644
--- a/src/tools/tools_mc_util.c
+++ b/src/tools/tools_mc_util.c
@@ -117,7 +117,8 @@ done:
if (pret == -1) {
DEBUG(SSSDBG_MINOR_FAILURE,
("Failed to unlink file %s. "
- "Will be unlinked later by sssd_nss.\n"));
+ "Will be unlinked later by sssd_nss.\n",
+ mc_filename));
}
}
}
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 1ad5326e..6798b658 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -532,8 +532,9 @@ int run_userdel_cmd(struct tools_ctx *tctx)
} else {
/* parent */
if (pid == -1) {
- DEBUG(1, ("fork failed [%d]: %s\n"));
ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("fork failed [%d]: %s\n", ret, strerror(ret)));
goto done;
}