diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-01-21 12:37:36 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-01-27 09:02:01 -0500 |
commit | aec5785126354bd8b192f63fe04ea08dae9c0705 (patch) | |
tree | 817ba377568db20761ce0f26865a48624a278268 /src/providers/proxy/proxy_id.c | |
parent | 8c3a4809b3420657289b42f028a1c9019b112991 (diff) | |
download | sssd-aec5785126354bd8b192f63fe04ea08dae9c0705.tar.gz sssd-aec5785126354bd8b192f63fe04ea08dae9c0705.tar.xz sssd-aec5785126354bd8b192f63fe04ea08dae9c0705.zip |
PROXY: add support for service lookups (non-enumeration)
Diffstat (limited to 'src/providers/proxy/proxy_id.c')
-rw-r--r-- | src/providers/proxy/proxy_id.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c index cfb058a8a..b3bd97ff5 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -1173,6 +1173,34 @@ void proxy_get_account_info(struct be_req *breq) ret = get_netgroup(ctx, sysdb, domain, ar->filter_value); break; + case BE_REQ_SERVICES: + switch (ar->filter_type) { + case BE_FILTER_NAME: + if (ctx->ops.getservbyname_r == NULL) { + return proxy_reply(breq, DP_ERR_FATAL, + ENODEV, "Services are not supported"); + } + ret = get_serv_byname(ctx, sysdb, domain, + ar->filter_value, + ar->extra_value); + break; + case BE_FILTER_IDNUM: + if (ctx->ops.getservbyport_r == NULL) { + return proxy_reply(breq, DP_ERR_FATAL, + ENODEV, "Services are not supported"); + } + ret = get_serv_byport(ctx, sysdb, domain, + ar->filter_value, + ar->extra_value); + break; + case BE_FILTER_ENUM: + break; + default: + return proxy_reply(breq, DP_ERR_FATAL, + EINVAL, "Invalid filter type"); + } + break; + default: /*fail*/ return proxy_reply(breq, DP_ERR_FATAL, EINVAL, "Invalid request type"); |