s4-rpc: added public APIs for dce_call authentication
authorAndrew Tridgell <tridge@samba.org>
Fri, 25 Feb 2011 02:13:01 +0000 (13:13 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 15 Mar 2011 01:22:18 +0000 (12:22 +1100)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h

index fd26740ddc37f212794cea80d8544a57a2b7967f..fa5f3e9830016e4e70d14be591c9e339e4617716 100644 (file)
@@ -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;
+}
index 08a57495cc54833b469e571ea7cde99aed0297f9..6e513acac189215a6712665ddd6e366e77fc390a 100644 (file)
@@ -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 */