s3-clusapi: implement _clusapi_OpenNodeEx(). FIXME!!!
authorGünther Deschner <gd@samba.org>
Tue, 14 Jul 2015 14:03:10 +0000 (16:03 +0200)
committerGünther Deschner <gd@samba.org>
Sun, 3 Feb 2019 09:26:14 +0000 (10:26 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_server/clusapi/srv_clusapi_nt.c

index b5e6346d85b5e995e1b1ecdcf2df3e76c6f4f724..6bc4584dc5dd92ff56bea21d78044ed0b55b8e7f 100644 (file)
@@ -2123,7 +2123,31 @@ void _clusapi_OpenClusterEx(struct pipes_struct *p,
 void _clusapi_OpenNodeEx(struct pipes_struct *p,
                         struct clusapi_OpenNodeEx *r)
 {
-       p->fault_state = DCERPC_FAULT_OP_RNG_ERROR;
+       struct clusapi_handle *h;
+       bool ok;
+
+       if (p->auth.auth_level < DCERPC_AUTH_LEVEL_PRIVACY) {
+               p->fault_state = DCERPC_FAULT_ACCESS_DENIED;
+               *r->out.Status = WERR_ACCESS_DENIED;
+               return;
+       }
+
+       h = talloc_zero(p, struct clusapi_handle);
+       if (h == NULL) {
+               *r->out.Status = WERR_NOT_ENOUGH_MEMORY;
+               return;
+       }
+
+       h->type = CLUSAPI_HANDLE_TYPE_NODE;
+
+       ok = create_policy_hnd(p, r->out.hNode, h);
+       if (!ok) {
+               *r->out.Status = WERR_FOOBAR;
+               return;
+       }
+
+       *r->out.lpdwGrantedAccess = CLUSAPI_GENERIC_ALL;
+       *r->out.Status = WERR_OK;
 }