TALLOC_CTX *mem_ctx,
struct witness_GetInterfaceList *r)
{
- DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+ struct witness_interfaceList *list;
+
+ if (dce_call->conn->auth_state.auth_level < DCERPC_AUTH_LEVEL_INTEGRITY) {
+ DCESRV_FAULT(DCERPC_FAULT_ACCESS_DENIED);
+ }
+
+ /* for the sake of providing brand new data from ctdb, repeat the ctdb query every time */
+
+ (void)srv_witness_startup_witness_interfaces_from_ctdb(state);
+
+ list = talloc_zero(mem_ctx, struct witness_interfaceList);
+ if (list == NULL) {
+ return WERR_NOT_ENOUGH_MEMORY;
+ }
+ list->num_interfaces = state->InterfaceList.num_interfaces;
+ list->interfaces = state->InterfaceList.interfaces;
+
+ *r->out.interface_list = list;
+
+ if (list->num_interfaces == 0) {
+ return WERR_NO_MORE_ITEMS;
+ }
+
+ return WERR_OK;
}