diff options
Diffstat (limited to 'src/providers/ldap/ldap_id.c')
-rw-r--r-- | src/providers/ldap/ldap_id.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index 0c90773a..be4642aa 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -647,6 +647,7 @@ int groups_by_user_recv(struct tevent_req *req, int *dp_error_out) static void sdap_account_info_users_done(struct tevent_req *req); static void sdap_account_info_groups_done(struct tevent_req *req); static void sdap_account_info_initgr_done(struct tevent_req *req); +static void sdap_account_info_netgroups_done(struct tevent_req *req); void sdap_account_info_handler(struct be_req *breq) { @@ -728,6 +729,21 @@ void sdap_account_info_handler(struct be_req *breq) break; + case BE_REQ_NETGROUP: + if (ar->filter_type != BE_FILTER_NAME) { + ret = EINVAL; + err = "Invalid filter type"; + break; + } + + req = netgroup_get_send(breq, breq->be_ctx->ev, ctx, ar->filter_value); + if (!req) { + return sdap_handler_done(breq, DP_ERR_FATAL, ENOMEM, "Out of memory"); + } + + tevent_req_set_callback(req, sdap_account_info_netgroups_done, breq); + break; + default: /*fail*/ ret = EINVAL; err = "Invalid request type"; @@ -793,3 +809,13 @@ static void sdap_account_info_initgr_done(struct tevent_req *req) sdap_account_info_complete(breq, dp_error, ret, "Init Groups Failed"); } +static void sdap_account_info_netgroups_done(struct tevent_req *req) +{ + struct be_req *breq = tevent_req_callback_data(req, struct be_req); + int ret, dp_error; + + ret = netgroup_get_recv(req, &dp_error); + talloc_zfree(req); + + sdap_account_info_complete(breq, dp_error, ret, "Netgroup lookup failed"); +} |