summaryrefslogtreecommitdiff
path: root/server/responder/pam
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2009-06-15 15:07:39 +0200
committerStephen Gallagher <sgallagh@redhat.com>2009-07-02 08:59:47 -0400
commit1a0eed71352d7d2c4a9f335d8583e0fee3cae491 (patch)
tree6f2006821d1b4c1c957ee0c811c095b5459299a6 /server/responder/pam
parent43133b835fe97592eba30344805177faab9fb644 (diff)
downloadsssd-1a0eed71352d7d2c4a9f335d8583e0fee3cae491.tar.gz
sssd-1a0eed71352d7d2c4a9f335d8583e0fee3cae491.tar.bz2
sssd-1a0eed71352d7d2c4a9f335d8583e0fee3cae491.zip
added kerberos backend with tevent_req event handling
Diffstat (limited to 'server/responder/pam')
-rw-r--r--server/responder/pam/pamsrv_cmd.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/server/responder/pam/pamsrv_cmd.c b/server/responder/pam/pamsrv_cmd.c
index e0654908..9b02146c 100644
--- a/server/responder/pam/pamsrv_cmd.c
+++ b/server/responder/pam/pamsrv_cmd.c
@@ -22,6 +22,7 @@
#include <time.h>
#include "util/util.h"
+#include "db/sysdb.h"
#include "confdb/confdb.h"
#include "responder/common/responder_packet.h"
#include "responder/common/responder.h"
@@ -387,7 +388,6 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
size_t blen;
int timeout;
int ret;
-
preq = talloc_zero(cctx, struct pam_auth_req);
if (!preq) {
return ENOMEM;
@@ -716,6 +716,24 @@ static void pam_check_user_callback(void *ptr, int status,
case 1:
/* BINGO */
+ preq->pd->pw_uid =
+ ldb_msg_find_attr_as_int(res->msgs[0], SYSDB_UIDNUM, -1);
+ if (preq->pd->pw_uid == -1) {
+ DEBUG(1, ("Failed to find uid for user [%s] in domain [%s].\n",
+ preq->pd->user, preq->pd->domain));
+ preq->pd->pam_status = PAM_SYSTEM_ERR;
+ pam_reply(preq);
+ }
+
+ preq->pd->gr_gid =
+ ldb_msg_find_attr_as_int(res->msgs[0], SYSDB_GIDNUM, -1);
+ if (preq->pd->gr_gid == -1) {
+ DEBUG(1, ("Failed to find gid for user [%s] in domain [%s].\n",
+ preq->pd->user, preq->pd->domain));
+ preq->pd->pam_status = PAM_SYSTEM_ERR;
+ pam_reply(preq);
+ }
+
pam_dom_forwarder(preq);
return;