mirror of
https://github.com/samba-team/samba.git
synced 2025-03-02 08:58:33 +03:00
This is the start of a C API to the DCERPC client routines. Currently
the only way to access this is to cut&paste from torture/rpc/*.c (This used to be commit 3355fec421f82034f433a4b59aa5ad589b070577)
This commit is contained in:
parent
4c12490730
commit
f1c3fa060e
@ -106,6 +106,7 @@ LIBCLI_OBJS = @LIBCLI_OBJS@
|
||||
LIBNDR_RAW_OBJS = @LIBNDR_RAW_OBJS@
|
||||
LIBRPC_RAW_OBJS = @LIBRPC_RAW_OBJS@
|
||||
LIBRPC_OBJS = @LIBRPC_OBJS@
|
||||
LIBRPC_CLIENT_OBJS = @LIBRPC_CLIENT_OBJS@
|
||||
|
||||
LIBSMB_OBJS = @LIBSMB_OBJS@
|
||||
LIBSMB_LIBS = @LIBSMB_LIBS@
|
||||
|
@ -25,6 +25,12 @@ SMB_SUBSYSTEM(LIBRPC_RAW,[],
|
||||
librpc/rpc/dcerpc_smb.o librpc/rpc/dcerpc_tcp.o],
|
||||
librpc/rpc/librpc_raw_public_proto.h)
|
||||
|
||||
SMB_SUBSYSTEM(LIBRPC_CLIENT,[],
|
||||
[librpc/rpc/dcerpc_lsa.o],
|
||||
librpc/rpc/librpc/client/public_proto.h)
|
||||
|
||||
SMB_SUBSYSTEM(LIBRPC,[],
|
||||
[\$(LIBNDR_RAW_OBJS) \$(LIBRPC_RAW_OBJS)],
|
||||
[\$(LIBNDR_RAW_OBJS) \$(LIBRPC_RAW_OBJS) \
|
||||
\$(LIBRPC_CLIENT_OBJS)],
|
||||
librpc/librpc_public_proto.h)
|
||||
|
||||
|
79
source4/librpc/rpc/dcerpc_lsa.c
Normal file
79
source4/librpc/rpc/dcerpc_lsa.c
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
raw dcerpc operations
|
||||
|
||||
Copyright (C) Tim Potter 2004
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
NTSTATUS lsa_OpenPolicy(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
struct policy_handle *handle)
|
||||
{
|
||||
struct lsa_ObjectAttribute attr;
|
||||
struct lsa_QosInfo qos;
|
||||
struct lsa_OpenPolicy r;
|
||||
NTSTATUS status;
|
||||
uint16 system_name = '\\';
|
||||
|
||||
qos.len = 0;
|
||||
qos.impersonation_level = 2;
|
||||
qos.context_mode = 1;
|
||||
qos.effective_only = 0;
|
||||
|
||||
attr.len = 0;
|
||||
attr.root_dir = NULL;
|
||||
attr.object_name = NULL;
|
||||
attr.attributes = 0;
|
||||
attr.sec_desc = NULL;
|
||||
attr.sec_qos = &qos;
|
||||
|
||||
r.in.system_name = &system_name;
|
||||
r.in.attr = &attr;
|
||||
r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
|
||||
r.out.handle = handle;
|
||||
|
||||
return dcerpc_lsa_OpenPolicy(p, mem_ctx, &r);
|
||||
}
|
||||
|
||||
NTSTATUS lsa_OpenPolicy2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
struct policy_handle *handle)
|
||||
{
|
||||
struct lsa_ObjectAttribute attr;
|
||||
struct lsa_QosInfo qos;
|
||||
struct lsa_OpenPolicy2 r;
|
||||
|
||||
qos.len = 0;
|
||||
qos.impersonation_level = 2;
|
||||
qos.context_mode = 1;
|
||||
qos.effective_only = 0;
|
||||
|
||||
attr.len = 0;
|
||||
attr.root_dir = NULL;
|
||||
attr.object_name = NULL;
|
||||
attr.attributes = 0;
|
||||
attr.sec_desc = NULL;
|
||||
attr.sec_qos = &qos;
|
||||
|
||||
r.in.system_name = "\\";
|
||||
r.in.attr = &attr;
|
||||
r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
|
||||
r.out.handle = handle;
|
||||
|
||||
return dcerpc_lsa_OpenPolicy2(p, mem_ctx, &r);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user