summaryrefslogtreecommitdiff
path: root/src/responder/pam
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-04-11 15:02:10 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-06-12 21:28:06 -0400
commit3c60433641ce2e86b9b04778c8f8652ef0d097e4 (patch)
tree7e62e915dc54fc40305e5e81714190154783620c /src/responder/pam
parent6199bd6b41e8b280e65db4b4bb17a1c5c0444aa9 (diff)
downloadsssd-3c60433641ce2e86b9b04778c8f8652ef0d097e4.tar.gz
sssd-3c60433641ce2e86b9b04778c8f8652ef0d097e4.tar.bz2
sssd-3c60433641ce2e86b9b04778c8f8652ef0d097e4.zip
Make re_expression and full_name_format per domain options
* Allows different user/domain qualified names for different domains. For example Domain\User or user@domain. * The global re_expression and full_name_format options remain as defaults for the domains. * Subdomains get the re_expression and full_name_format of their parent domain. https://bugzilla.redhat.com/show_bug.cgi?id=811663
Diffstat (limited to 'src/responder/pam')
-rw-r--r--src/responder/pam/pamsrv.c3
-rw-r--r--src/responder/pam/pamsrv_cmd.c20
2 files changed, 11 insertions, 12 deletions
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index ecbf7d9a..c94596c4 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -171,8 +171,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = sss_ncache_prepopulate(pctx->ncache, cdb, pctx->rctx->names,
- pctx->rctx);
+ ret = sss_ncache_prepopulate(pctx->ncache, cdb, pctx->rctx);
if (ret != EOK) {
goto done;
}
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index f1fdc3f0..f6c1e835 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -115,7 +115,7 @@ static int pd_set_primary_name(const struct ldb_message *msg,struct pam_data *pd
return EOK;
}
-static int pam_parse_in_data_v2(struct sss_names_ctx *snctx,
+static int pam_parse_in_data_v2(struct sss_domain_info *domains,
struct pam_data *pd,
uint8_t *body, size_t blen)
{
@@ -153,8 +153,8 @@ static int pam_parse_in_data_v2(struct sss_names_ctx *snctx,
ret = extract_string(&pam_user, size, body, blen, &c);
if (ret != EOK) return ret;
- ret = sss_parse_name(pd, snctx, pam_user,
- &pd->domain, &pd->user);
+ ret = sss_parse_name_for_domains(pd, domains, pam_user,
+ &pd->domain, &pd->user);
if (ret != EOK) return ret;
break;
case SSS_PAM_ITEM_SERVICE:
@@ -205,13 +205,13 @@ static int pam_parse_in_data_v2(struct sss_names_ctx *snctx,
}
-static int pam_parse_in_data_v3(struct sss_names_ctx *snctx,
+static int pam_parse_in_data_v3(struct sss_domain_info *domains,
struct pam_data *pd,
uint8_t *body, size_t blen)
{
int ret;
- ret = pam_parse_in_data_v2(snctx, pd, body, blen);
+ ret = pam_parse_in_data_v2(domains, pd, body, blen);
if (ret != EOK) {
DEBUG(1, ("pam_parse_in_data_v2 failed.\n"));
return ret;
@@ -225,7 +225,7 @@ static int pam_parse_in_data_v3(struct sss_names_ctx *snctx,
return EOK;
}
-static int pam_parse_in_data(struct sss_names_ctx *snctx,
+static int pam_parse_in_data(struct sss_domain_info *domains,
struct pam_data *pd,
uint8_t *body, size_t blen)
{
@@ -241,7 +241,7 @@ static int pam_parse_in_data(struct sss_names_ctx *snctx,
for (start = end; end < last; end++) if (body[end] == '\0') break;
if (body[end++] != '\0') return EINVAL;
- ret = sss_parse_name(pd, snctx, (char *)&body[start], &pd->domain, &pd->user);
+ ret = sss_parse_name_for_domains(pd, domains, (char *)&body[start], &pd->domain, &pd->user);
if (ret != EOK) return ret;
for (start = end; end < last; end++) if (body[end] == '\0') break;
@@ -891,13 +891,13 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
switch (cctx->cli_protocol_version->version) {
case 1:
- ret = pam_parse_in_data(cctx->rctx->names, pd, body, blen);
+ ret = pam_parse_in_data(cctx->rctx->domains, pd, body, blen);
break;
case 2:
- ret = pam_parse_in_data_v2(cctx->rctx->names, pd, body, blen);
+ ret = pam_parse_in_data_v2(cctx->rctx->domains, pd, body, blen);
break;
case 3:
- ret = pam_parse_in_data_v3(cctx->rctx->names, pd, body, blen);
+ ret = pam_parse_in_data_v3(cctx->rctx->domains, pd, body, blen);
break;
default:
DEBUG(1, ("Illegal protocol version [%d].\n",