sdap_access.c revision 5d78919c955c945e78865f322726aac075c71203
50c04f297d76a57ead2fa6b73845f7563b1fc788sf Stephen Gallagher <sgallagh@redhat.com>
50c04f297d76a57ead2fa6b73845f7563b1fc788sf Copyright (C) 2010 Red Hat
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen This program is free software; you can redistribute it and/or modify
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen it under the terms of the GNU General Public License as published by
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the Free Software Foundation; either version 3 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
50c04f297d76a57ead2fa6b73845f7563b1fc788sf This program is distributed in the hope that it will be useful,
50c04f297d76a57ead2fa6b73845f7563b1fc788sf but WITHOUT ANY WARRANTY; without even the implied warranty of
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f08db06526d6901aa08c110b5bc7dde6bc39905nd GNU General Public License for more details.
50c04f297d76a57ead2fa6b73845f7563b1fc788sf You should have received a copy of the GNU General Public License
50c04f297d76a57ead2fa6b73845f7563b1fc788sf along with this program. If not, see <http://www.gnu.org/licenses/>.
f0fa55ff14fa0bf8fd72d989f6625de6dc3260c8igalicstatic void sdap_access_reply(struct be_req *be_req, int pam_status)
50c04f297d76a57ead2fa6b73845f7563b1fc788sf if (pam_status == PAM_SUCCESS || pam_status == PAM_PERM_DENIED) {
50c04f297d76a57ead2fa6b73845f7563b1fc788sfstatic struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx,
50c04f297d76a57ead2fa6b73845f7563b1fc788sf const char *username,
50c04f297d76a57ead2fa6b73845f7563b1fc788sfstatic void sdap_access_filter_done(struct tevent_req *subreq);
bed3c2e56e8f3328e780200466b9d009093db468sfstatic struct tevent_req *sdap_account_expired_send(TALLOC_CTX *mem_ctx,
f0fa55ff14fa0bf8fd72d989f6625de6dc3260c8igalicstatic errno_t sdap_access_service_recv(struct tevent_req *req,
50c04f297d76a57ead2fa6b73845f7563b1fc788sfstatic void sdap_access_service_done(struct tevent_req *subreq);
bed3c2e56e8f3328e780200466b9d009093db468sfstatic void sdap_account_expired_done(struct tevent_req *subreq);
50c04f297d76a57ead2fa6b73845f7563b1fc788sfstatic errno_t sdap_access_host_recv(struct tevent_req *req,
50c04f297d76a57ead2fa6b73845f7563b1fc788sfstatic void sdap_access_host_done(struct tevent_req *subreq);
0d0ba3a410038e179b695446bb149cce6264e0abnd talloc_get_type(breq->be_ctx->bet_info[BET_ACCESS].pvt_bet_data,
struct sdap_access_req_ctx {
int pam_status;
struct tevent_req *
return NULL;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
return req;
done:
return req;
case LDAP_ACCESS_EMPTY:
return ENOENT;
case LDAP_ACCESS_FILTER:
return ENOMEM;
return EOK;
case LDAP_ACCESS_EXPIRE:
return ENOMEM;
return EOK;
case LDAP_ACCESS_SERVICE:
return ENOMEM;
return EOK;
case LDAP_ACCESS_HOST:
return ENOMEM;
return EOK;
return EACCES;
int ret;
int *pam_status)
int ret;
const char *val;
long sp_expire;
long today;
return EOK;
return ret;
sizeof(SHADOW_EXPIRE_MSG),
return EOK;
int err;
int *pam_status)
int ret;
sizeof(AD_DISABLE_MESSAGE),
sizeof(AD_EXPIRED_MESSAGE),
return EOK;
int *pam_status)
bool locked;
int ret;
if (locked) {
sizeof(RHDS_LOCK_MSG),
return EOK;
char *end;
exp_time_str));
tzset();
div_t q;
if (q.rem > 0) {
int *pam_status)
bool locked = true;
int ret;
const char *exp_time_str;
if (locked) {
sizeof(NDS_DISABLE_MSG),
NULL);
if (locked) {
sizeof(NDS_EXPIRED_MSG),
if (locked) {
sizeof(NDS_TIME_MAP_MSG),
return EOK;
struct sdap_account_expired_req_ctx {
int pam_status;
int ret;
const char *expire;
return NULL;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return req;
return EOK;
struct sdap_access_filter_req_ctx {
const char *username;
const char *filter;
int pam_status;
bool cached_access;
char *basedn;
const char *username,
const char *basedn;
char *clean_username;
return NULL;
return req;
goto finished;
NULL);
goto failed;
goto failed;
goto failed;
goto failed;
goto failed;
goto failed;
return req;
return NULL;
return req;
int ret;
if (!subreq) {
return ret;
return EOK;
struct tevent_req);
NULL, 0,
bool found = false;
goto done;
found = false;
goto done;
goto done;
found = true;
if (found) {
goto done;
goto done;
goto done;
done:
return EOK;
struct sdap_access_service_ctx {
int pam_status;
char *service;
if (!req) {
return NULL;
sizeof(AUTHR_SRV_MISSING_MSG),
goto done;
sizeof(AUTHR_SRV_DENY_MSG),
goto done;
sizeof(AUTHR_SRV_NO_MATCH_MSG),
done:
return req;
int *pam_status)
return EOK;
struct sdap_access_host_ctx {
int pam_status;
char *host;
if (!req) {
return NULL;
goto done;
goto done;
done:
return req;
int *pam_status)
return EOK;
return EOK;