s4:rpc_server: add dcesrv_call_auth_info()
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Nov 2018 11:44:30 +0000 (12:44 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:35 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h

index 828a936..8f48814 100644 (file)
@@ -3233,3 +3233,20 @@ _PUBLIC_ struct auth_session_info *dcesrv_call_session_info(struct dcesrv_call_s
 {
        return dce_call->context->conn->auth_state.session_info;
 }
+
+/**
+ * retrieve auth type/level from a dce_call
+ */
+_PUBLIC_ void dcesrv_call_auth_info(struct dcesrv_call_state *dce_call,
+                                   enum dcerpc_AuthType *auth_type,
+                                   enum dcerpc_AuthLevel *auth_level)
+{
+       struct dcesrv_auth *auth = &dce_call->conn->auth_state;
+
+       if (auth_type != NULL) {
+               *auth_type = auth->auth_type;
+       }
+       if (auth_level != NULL) {
+               *auth_level = auth->auth_level;
+       }
+}
index 7923d3b..1ba676f 100644 (file)
@@ -519,6 +519,13 @@ _PUBLIC_ const char *dcesrv_call_account_name(struct dcesrv_call_state *dce_call
  */
 _PUBLIC_ struct auth_session_info *dcesrv_call_session_info(struct dcesrv_call_state *dce_call);
 
+/**
+ * retrieve auth type/level from a dce_call
+ */
+_PUBLIC_ void dcesrv_call_auth_info(struct dcesrv_call_state *dce_call,
+                                   enum dcerpc_AuthType *auth_type,
+                                   enum dcerpc_AuthLevel *auth_level);
+
 _PUBLIC_ NTSTATUS dcesrv_interface_bind_require_integrity(struct dcesrv_call_state *dce_call,
                                                          const struct dcesrv_interface *iface);
 _PUBLIC_ NTSTATUS dcesrv_interface_bind_require_privacy(struct dcesrv_call_state *dce_call,