summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2014-01-28 17:19:07 +0000
committerJakub Hrozek <jhrozek@redhat.com>2014-03-18 14:01:51 +0100
commit40dd828529cf01291daf0f075b850783409e8c05 (patch)
tree21d00c5954a5b6f5ac77822bb1831956ed9d9ed8
parent424604f0b4d0ce581b598a1ecda2cc4a7e4fd8ad (diff)
downloadsssd-40dd828529cf01291daf0f075b850783409e8c05.tar.gz
sssd-40dd828529cf01291daf0f075b850783409e8c05.tar.xz
sssd-40dd828529cf01291daf0f075b850783409e8c05.zip
refactor calls of sss_parse_name
sss_parse_name now supports NULL as output parameters so existing calls passing arguments which were never read were substituted by NULL. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/providers/krb5/krb5_common.c3
-rw-r--r--src/providers/ldap/sdap_access.c3
-rw-r--r--src/responder/nss/nsssrv_cmd.c3
-rw-r--r--src/util/domain_info_utils.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index bf7b1f0e0..af38db04b 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -1005,7 +1005,6 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx,
char *uc_dom = NULL;
char *upn;
char *name;
- char *domname;
TALLOC_CTX *tmp_ctx = NULL;
errno_t ret;
@@ -1035,7 +1034,7 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx,
/* Subdomains already have a fully qualified name, which contains
* the domain name. We need to replace it with the realm name
*/
- ret = sss_parse_name(tmp_ctx, dom->names, username, &domname, &name);
+ ret = sss_parse_name(tmp_ctx, dom->names, username, NULL, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
"Could not parse [%s] into name and "
diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c
index 65876ba41..62a087f46 100644
--- a/src/providers/ldap/sdap_access.c
+++ b/src/providers/ldap/sdap_access.c
@@ -665,7 +665,6 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx,
char *clean_username;
errno_t ret = ERR_INTERNAL;
char *name;
- char *domname;
req = tevent_req_create(mem_ctx, &state, struct sdap_access_filter_req_ctx);
if (req == NULL) {
@@ -719,7 +718,7 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx,
/* Construct the filter */
/* Subdomain users are identified by FQDN. We need to use just the username */
- ret = sss_parse_name(state, domain->names, username, &domname, &name);
+ ret = sss_parse_name(state, domain->names, username, NULL, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
"Could not parse [%s] into name and "
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index e91093561..e00849a48 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -177,13 +177,12 @@ static const char *get_homedir_override(TALLOC_CTX *mem_ctx,
{
const char *homedir;
char *name;
- char *domname;
errno_t ret;
homedir = ldb_msg_find_attr_as_string(msg, SYSDB_HOMEDIR, NULL);
/* Subdomain users store FQDN in their name attribute */
- ret = sss_parse_name(mem_ctx, dom->names, orig_name, &domname, &name);
+ ret = sss_parse_name(mem_ctx, dom->names, orig_name, NULL, &name);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE, "Could not parse [%s] into "
"name-value components.\n", orig_name);
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index b41864432..fc4287076 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -160,7 +160,6 @@ find_subdomain_by_object_name(struct sss_domain_info *domain,
TALLOC_CTX *tmp_ctx;
struct sss_domain_info *dom = NULL;
char *domainname = NULL;
- char *name = NULL;
errno_t ret;
tmp_ctx = talloc_new(NULL);
@@ -170,7 +169,7 @@ find_subdomain_by_object_name(struct sss_domain_info *domain,
}
ret = sss_parse_name(tmp_ctx, domain->names, object_name,
- &domainname, &name);
+ &domainname, NULL);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n",
object_name, ret, sss_strerror(ret));