summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/lsa.idl4
-rw-r--r--source4/librpc/idl/samr.idl23
-rw-r--r--source4/librpc/ndr/ndr_lsa.c4
-rw-r--r--source4/librpc/ndr/ndr_samr.c50
-rw-r--r--source4/librpc/ndr/ndr_samr.h19
-rw-r--r--source4/librpc/rpc/rpc_samr.c6
6 files changed, 71 insertions, 35 deletions
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 622d34eef3..204466c784 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -25,8 +25,8 @@
/* Function: 0x02 */
typedef struct {
- uint16 name_len;
- uint16 name_size;
+ [value(2*strlen_m(r->name))] uint16 name_len;
+ [value(2*strlen_m(r->name))] uint16 name_size;
unistr_noterm *name;
} lsa_Name;
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl
index fd71c49369..6017f73f4e 100644
--- a/source4/librpc/idl/samr.idl
+++ b/source4/librpc/idl/samr.idl
@@ -35,19 +35,24 @@
/******************/
/* Function: 0x05 */
- NTSTATUS samr_LookupDomain ();
-
- /******************/
- /* Function: 0x06 */
-
typedef struct {
- uint16 name_len;
- uint16 name_size;
+ [value(2*strlen_m(r->name))] uint16 name_len;
+ [value(2*strlen_m(r->name))] uint16 name_size;
unistr_noterm *name;
} samr_Name;
+ NTSTATUS samr_LookupDomain (
+ [in,ref] policy_handle *handle,
+ [in,ref] samr_Name *domain,
+ [out] dom_sid2 *sid
+ );
+
+
+ /******************/
+ /* Function: 0x06 */
+
typedef struct {
- uint32 rid;
+ uint32 idx;
samr_Name name;
} samr_SamEntry;
@@ -287,7 +292,7 @@
/************************/
/* Function 0x3e */
- NTSTATUS samr_CONNECT4(
+ NTSTATUS samr_Connect4(
[in] unistr *system_name,
[in] uint32 unknown,
[in] uint32 access_mask,
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c
index 587093ed69..db17c1e63d 100644
--- a/source4/librpc/ndr/ndr_lsa.c
+++ b/source4/librpc/ndr/ndr_lsa.c
@@ -20,8 +20,8 @@ static NTSTATUS ndr_push_lsa_Name(struct ndr_push *ndr, int ndr_flags, struct ls
{
NDR_CHECK(ndr_push_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
- NDR_CHECK(ndr_push_uint16(ndr, r->name_len));
- NDR_CHECK(ndr_push_uint16(ndr, r->name_size));
+ NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
+ NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
NDR_CHECK(ndr_push_ptr(ndr, r->name));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
diff --git a/source4/librpc/ndr/ndr_samr.c b/source4/librpc/ndr/ndr_samr.c
index 8258fe6bdf..8a972b426f 100644
--- a/source4/librpc/ndr/ndr_samr.c
+++ b/source4/librpc/ndr/ndr_samr.c
@@ -37,8 +37,26 @@ NTSTATUS ndr_push_samr_Shutdown(struct ndr_push *ndr, struct samr_Shutdown *r)
return NT_STATUS_OK;
}
+static NTSTATUS ndr_push_samr_Name(struct ndr_push *ndr, int ndr_flags, struct samr_Name *r)
+{
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
+ NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
+ NDR_CHECK(ndr_push_ptr(ndr, r->name));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->name) {
+ NDR_CHECK(ndr_push_unistr_noterm(ndr, r->name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
NTSTATUS ndr_push_samr_LookupDomain(struct ndr_push *ndr, struct samr_LookupDomain *r)
{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
+ NDR_CHECK(ndr_push_samr_Name(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain));
return NT_STATUS_OK;
}
@@ -382,7 +400,7 @@ NTSTATUS ndr_push_samr_CONNECT3(struct ndr_push *ndr, struct samr_CONNECT3 *r)
return NT_STATUS_OK;
}
-NTSTATUS ndr_push_samr_CONNECT4(struct ndr_push *ndr, struct samr_CONNECT4 *r)
+NTSTATUS ndr_push_samr_Connect4(struct ndr_push *ndr, struct samr_Connect4 *r)
{
NDR_CHECK(ndr_push_ptr(ndr, r->in.system_name));
if (r->in.system_name) {
@@ -460,13 +478,6 @@ NTSTATUS ndr_pull_samr_Shutdown(struct ndr_pull *ndr, struct samr_Shutdown *r)
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, struct samr_LookupDomain *r)
-{
- NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
-
- return NT_STATUS_OK;
-}
-
static NTSTATUS ndr_pull_samr_Name(struct ndr_pull *ndr, int ndr_flags, struct samr_Name *r)
{
uint32 _ptr_name;
@@ -489,11 +500,28 @@ done:
return NT_STATUS_OK;
}
+NTSTATUS ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, struct samr_LookupDomain *r)
+{
+ uint32 _ptr_sid;
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid));
+ if (_ptr_sid) {
+ NDR_ALLOC(ndr, r->out.sid);
+ } else {
+ r->out.sid = NULL;
+ }
+ if (r->out.sid) {
+ NDR_CHECK(ndr_pull_dom_sid2(ndr, r->out.sid));
+ }
+ NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
+
+ return NT_STATUS_OK;
+}
+
static NTSTATUS ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r)
{
NDR_CHECK(ndr_pull_align(ndr, 4));
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
- NDR_CHECK(ndr_pull_uint32(ndr, &r->rid));
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->idx));
NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->name));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
@@ -935,7 +963,7 @@ NTSTATUS ndr_pull_samr_CONNECT3(struct ndr_pull *ndr, struct samr_CONNECT3 *r)
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_samr_CONNECT4(struct ndr_pull *ndr, struct samr_CONNECT4 *r)
+NTSTATUS ndr_pull_samr_Connect4(struct ndr_pull *ndr, struct samr_Connect4 *r)
{
NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.handle));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
@@ -997,7 +1025,7 @@ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, struct sam
{
ndr_print_struct(ndr, name, "samr_SamEntry");
ndr->depth++;
- ndr_print_uint32(ndr, "rid", r->rid);
+ ndr_print_uint32(ndr, "idx", r->idx);
ndr_print_samr_Name(ndr, "name", &r->name);
ndr->depth--;
}
diff --git a/source4/librpc/ndr/ndr_samr.h b/source4/librpc/ndr/ndr_samr.h
index 20b58685de..f24dde1ec5 100644
--- a/source4/librpc/ndr/ndr_samr.h
+++ b/source4/librpc/ndr/ndr_samr.h
@@ -53,24 +53,27 @@ struct samr_Shutdown {
};
+struct samr_Name {
+ uint16 name_len;
+ uint16 name_size;
+ const char *name;
+};
+
struct samr_LookupDomain {
struct {
+ struct policy_handle *handle;
+ struct samr_Name *domain;
} in;
struct {
+ struct dom_sid2 *sid;
NTSTATUS result;
} out;
};
-struct samr_Name {
- uint16 name_len;
- uint16 name_size;
- const char *name;
-};
-
struct samr_SamEntry {
- uint32 rid;
+ uint32 idx;
struct samr_Name name;
};
@@ -645,7 +648,7 @@ struct samr_CONNECT3 {
};
-struct samr_CONNECT4 {
+struct samr_Connect4 {
struct {
const char *system_name;
uint32 unknown;
diff --git a/source4/librpc/rpc/rpc_samr.c b/source4/librpc/rpc/rpc_samr.c
index d007ebe07f..836ada5c0c 100644
--- a/source4/librpc/rpc/rpc_samr.c
+++ b/source4/librpc/rpc/rpc_samr.c
@@ -871,12 +871,12 @@ NTSTATUS dcerpc_samr_CONNECT3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct
return r->out.result;
}
-NTSTATUS dcerpc_samr_CONNECT4(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_CONNECT4 *r)
+NTSTATUS dcerpc_samr_Connect4(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_Connect4 *r)
{
NTSTATUS status;
status = dcerpc_ndr_request(p, DCERPC_SAMR_CONNECT4, mem_ctx,
- (ndr_push_fn_t) ndr_push_samr_CONNECT4,
- (ndr_pull_fn_t) ndr_pull_samr_CONNECT4,
+ (ndr_push_fn_t) ndr_push_samr_Connect4,
+ (ndr_pull_fn_t) ndr_pull_samr_Connect4,
r);
if (!NT_STATUS_IS_OK(status)) {
return status;