diff options
author | Simo Sorce <idra@samba.org> | 2009-01-09 08:42:28 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2009-01-09 08:42:28 -0500 |
commit | dd422e75a52d197d9084b6a4415b58553460ae41 (patch) | |
tree | 3567618ceb6b80e20d1bc6b94b5115f8163dd614 /server/nss/nsssrv_cmd.c | |
parent | ccd17380f5347d0c50fe5214de2e2cd077238f53 (diff) | |
download | sssd-dd422e75a52d197d9084b6a4415b58553460ae41.tar.gz sssd-dd422e75a52d197d9084b6a4415b58553460ae41.tar.bz2 sssd-dd422e75a52d197d9084b6a4415b58553460ae41.zip |
Lots of little nasty bugs fixed.
I was finally able to get a getpwnam() request go through sssd,
hit the remote ldap server and get the answer back with
'getent passwd foo'
Yupiee!
Diffstat (limited to 'server/nss/nsssrv_cmd.c')
-rw-r--r-- | server/nss/nsssrv_cmd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/nss/nsssrv_cmd.c b/server/nss/nsssrv_cmd.c index 6838466e..828bdb78 100644 --- a/server/nss/nsssrv_cmd.c +++ b/server/nss/nsssrv_cmd.c @@ -212,7 +212,7 @@ static void nss_cmd_getpw_callback(void *ptr, int status, DEBUG(1, ("getpwnam call returned more than one result !?!\n")); } if (res->count == 0) { - DEBUG(2, ("No results for getpwnam call")); + DEBUG(2, ("No results for getpwnam call\n")); } ret = nss_packet_new(cctx->creq, 2*sizeof(uint32_t), nss_packet_get_cmd(cctx->creq->in), @@ -233,25 +233,24 @@ done: nss_cmd_done(nctx); } -static void nss_cmd_getpwnam_callback(DBusPendingCall *pending, void *ptr) +static void nss_cmd_getpwnam_callback(uint16_t err_maj, uint32_t err_min, + const char *err_msg, void *ptr) { struct nss_cmd_ctx *nctx = talloc_get_type(ptr, struct nss_cmd_ctx); struct cli_ctx *cctx = nctx->cctx; - dbus_uint16_t cli_err_maj; - dbus_uint32_t cli_err_min; - char *cli_err_msg; int ret; - ret = nss_dp_get_reply(pending, &cli_err_maj, &cli_err_min, &cli_err_msg); - if (ret != EOK) { + if (err_maj) { DEBUG(2, ("Unable to get information from Data Provider\n" - "Will try to return what we have in cache\n")); + "Error: %u, %u, %s\n" + "Will try to return what we have in cache\n", + (unsigned int)err_maj, (unsigned int)err_min, err_msg)); } ret = nss_ldb_getpwnam(nctx, cctx->ev, cctx->nctx->lctx, nctx->name, nss_cmd_getpw_callback, nctx); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!")); + DEBUG(1, ("Failed to make request to our cache!\n")); ret = nss_cmd_send_error(nctx, ret); if (ret != EOK) { @@ -289,7 +288,8 @@ static int nss_cmd_getpwnam(struct cli_ctx *cctx) ret = nss_dp_send_acct_req(cctx->nctx, nctx, nss_cmd_getpwnam_callback, nctx, - "*", NSS_DP_USER, nctx->name, 0); + SSS_NSS_SOCKET_TIMEOUT/2, "*", + NSS_DP_USER, nctx->name, 0); if (ret != EOK) { talloc_free(nctx); return ret; |