summaryrefslogtreecommitdiffstats
path: root/src/responder/pac/pacsrv_cmd.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-15 22:08:05 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-11-05 00:14:05 +0100
commitdcc133e6357e321d101cf39a2999901e33ae988e (patch)
treeb6b0a95c11a56695ea3fea9d1460ca947fae48cf /src/responder/pac/pacsrv_cmd.c
parent09d59c60dc9fae1fdc70ea4f1a073591a4eff456 (diff)
downloadsssd-dcc133e6357e321d101cf39a2999901e33ae988e.tar.gz
sssd-dcc133e6357e321d101cf39a2999901e33ae988e.tar.xz
sssd-dcc133e6357e321d101cf39a2999901e33ae988e.zip
pac responder: add user principal and name alias to cached user object
The principal name for the user is generated with the user name and the domain from the PAC. It is stored in the cache so that if e.g. can be used by password authentication. Additionally the name alias is stored to allow case-insensitive searches.
Diffstat (limited to 'src/responder/pac/pacsrv_cmd.c')
-rw-r--r--src/responder/pac/pacsrv_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c
index 4cbf14b5c..777798387 100644
--- a/src/responder/pac/pacsrv_cmd.c
+++ b/src/responder/pac/pacsrv_cmd.c
@@ -231,6 +231,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx)
struct ldb_message *msg;
struct passwd *pwd = NULL;
TALLOC_CTX *tmp_ctx = NULL;
+ struct sysdb_attrs *user_attrs = NULL;
sysdb = pr_ctx->dom->sysdb;
if (sysdb == NULL) {
@@ -252,7 +253,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx)
/* TODO: check id uid and gid are equal. */
} else if (ret == ENOENT) {
ret = get_pwd_from_pac(tmp_ctx, pr_ctx->pac_ctx, pr_ctx->dom,
- pr_ctx->logon_info, &pwd);
+ pr_ctx->logon_info, &pwd, &user_attrs);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, ("get_pwd_from_pac failed.\n"));
goto done;
@@ -261,7 +262,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx)
ret = sysdb_store_user(sysdb, pwd->pw_name, NULL,
pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos,
pwd->pw_dir,
- pwd->pw_shell, NULL, NULL,
+ pwd->pw_shell, user_attrs, NULL,
pr_ctx->dom->user_timeout, 0);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_user failed [%d][%s].\n",