diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-02-25 13:13:01 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-03-15 12:22:18 +1100 |
commit | 48ea48d5031f7118cf39b0233799d02e8bae6946 (patch) | |
tree | 86fe33e19f920e2507b952b6526118affb5a7f2f /source4/rpc_server | |
parent | a6d07a8e69600853756f7a091456ba2489e53cbf (diff) | |
download | samba-48ea48d5031f7118cf39b0233799d02e8bae6946.tar.gz samba-48ea48d5031f7118cf39b0233799d02e8bae6946.tar.bz2 samba-48ea48d5031f7118cf39b0233799d02e8bae6946.zip |
s4-rpc: added public APIs for dce_call authentication
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 19 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_server.h | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index fd26740ddc..fa5f3e9830 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1718,3 +1718,22 @@ NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, return NT_STATUS_NOT_SUPPORTED; } } + + +/** + * retrieve credentials from a dce_call + */ +_PUBLIC_ struct cli_credentials *dcesrv_call_credentials(struct dcesrv_call_state *dce_call) +{ + return dce_call->conn->auth_state.session_info->credentials; +} + +/** + * returns true if this is an authenticated call + */ +_PUBLIC_ bool dcesrv_call_authenticated(struct dcesrv_call_state *dce_call) +{ + enum security_user_level level; + level = security_session_user_level(dce_call->conn->auth_state.session_info, NULL); + return level >= SECURITY_USER; +} diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 08a57495cc..6e513acac1 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -383,5 +383,15 @@ NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct tevent_context *event_ctx, const struct model_ops *model_ops); +/** + * retrieve credentials from a dce_call + */ +_PUBLIC_ struct cli_credentials *dcesrv_call_credentials(struct dcesrv_call_state *dce_call); + +/** + * returns true if this is an authenticated call + */ +_PUBLIC_ bool dcesrv_call_authenticated(struct dcesrv_call_state *dce_call); + #endif /* SAMBA_DCERPC_SERVER_H */ |