summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-02-21 09:55:13 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-02-21 09:55:13 +1100
commit774fa12ac1695600710ce9fac18024edd38161ee (patch)
tree5440d8c0f00d28656e0d8f65f3b771eb11a01842 /source4/librpc
parent49b3a4829325967df9d1e616ad32e5379ce6cf5d (diff)
parent910a1cafdf253255510d3aff7cc2385da43331dd (diff)
downloadsamba-774fa12ac1695600710ce9fac18024edd38161ee.tar.gz
samba-774fa12ac1695600710ce9fac18024edd38161ee.tar.bz2
samba-774fa12ac1695600710ce9fac18024edd38161ee.zip
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-local
(This used to be commit 5cd3310b78a85243eb436d05db3228c3495f9162)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/config.mk2
-rw-r--r--source4/librpc/idl/dcerpc.idl3
-rw-r--r--source4/librpc/idl/drsblobs.idl3
-rw-r--r--source4/librpc/idl/drsuapi.idl9
-rw-r--r--source4/librpc/idl/epmapper.idl12
-rw-r--r--source4/librpc/idl/idl_types.h17
-rw-r--r--source4/librpc/idl/initshutdown.idl25
-rw-r--r--source4/librpc/idl/krb5pac.idl3
-rw-r--r--source4/librpc/idl/lsa.idl10
-rw-r--r--source4/librpc/idl/nbt.idl2
-rw-r--r--source4/librpc/idl/spoolss.idl15
-rw-r--r--source4/librpc/idl/winreg.idl14
-rw-r--r--source4/librpc/ndr/libndr.h2
-rw-r--r--source4/librpc/ndr/ndr_sec_helper.c3
-rw-r--r--source4/librpc/ndr/ndr_string.c45
-rw-r--r--source4/librpc/rpc/dcerpc_smb2.c6
16 files changed, 71 insertions, 100 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 0f5a65121c..2fdef41b2a 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -277,7 +277,7 @@ OBJ_FILES = gen_ndr/ndr_winbind.o
PUBLIC_HEADERS = gen_ndr/winbind.h
PUBLIC_DEPENDENCIES = LIBNDR NDR_NETLOGON
-include ../heimdal_build/perl_path_wrapper.sh ../librpc/idl-deps.pl librpc/idl/*.idl|
+mkinclude ../heimdal_build/perl_path_wrapper.sh ../librpc/idl-deps.pl librpc/idl/*.idl|
librpc/gen_ndr/tables.c: $(IDL_NDR_PARSE_H_FILES)
@echo Generating librpc/gen_ndr/tables.c
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index fcb0be4639..b2c67542f5 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -64,7 +64,8 @@ interface dcerpc
uint16 max_xmit_frag;
uint16 max_recv_frag;
uint32 assoc_group_id;
- ascstr3 secondary_address;
+ [value(strlen(secondary_address)+1)] uint16 secondary_address_size;
+ [charset(DOS)] uint8 secondary_address[secondary_address_size];
[flag(NDR_ALIGN4)] DATA_BLOB _pad1;
uint8 num_results;
dcerpc_ack_ctx ctx_list[num_results];
diff --git a/source4/librpc/idl/drsblobs.idl b/source4/librpc/idl/drsblobs.idl
index 1e80597f4a..27f3a99551 100644
--- a/source4/librpc/idl/drsblobs.idl
+++ b/source4/librpc/idl/drsblobs.idl
@@ -85,7 +85,8 @@ interface drsblobs {
* w2k3 uses version 1
*/
typedef [public,gensize] struct {
- asclstr dns_name;
+ [value(strlen(dns_name)+1)] uint32 __dns_name_size;
+ [charset(DOS)] uint8 dns_name[__dns_name_size];
} repsFromTo1OtherInfo;
typedef [public,gensize,flag(NDR_PAHEX)] struct {
diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl
index f298b7e321..fb24122e26 100644
--- a/source4/librpc/idl/drsuapi.idl
+++ b/source4/librpc/idl/drsuapi.idl
@@ -130,7 +130,8 @@ interface drsuapi
[value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid;
GUID guid;
dom_sid28 sid;
- [flag(STR_SIZE4|STR_CHARLEN|STR_CONFORMANT)] string dn;
+ [value(strlen_m(dn))] uint32 __ndr_size_dn;
+ [charset(UTF16),size_is(__ndr_size_dn+1)] uint16 dn[];
} drsuapi_DsReplicaObjectIdentifier;
typedef [public] bitmap {
@@ -451,7 +452,8 @@ interface drsuapi
[value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
GUID guid;
dom_sid28 sid;
- [flag(STR_SIZE4|STR_CHARLEN)] string dn;
+ [value(strlen_m(dn))] uint32 __ndr_size_dn;
+ [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
} drsuapi_DsReplicaObjectIdentifier3;
typedef [public,gensize] struct {
@@ -459,7 +461,8 @@ interface drsuapi
[value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
GUID guid;
dom_sid28 sid;
- [flag(STR_SIZE4|STR_CHARLEN)] string dn;
+ [value(strlen_m(dn))] uint32 __ndr_size_dn;
+ [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
[value(binary.length + 4)] uint32 __ndr_size_binary;
[flag(NDR_REMAINING)] DATA_BLOB binary;
} drsuapi_DsReplicaObjectIdentifier3Binary;
diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl
index baf9f23877..60ff338ec4 100644
--- a/source4/librpc/idl/epmapper.idl
+++ b/source4/librpc/idl/epmapper.idl
@@ -3,6 +3,7 @@
/*
endpoint mapper interface
Related links:
+ http://www.opengroup.org/onlinepubs/9629399/apdxo.htm : The official IDL for this pipe
http://www.opengroup.org/onlinepubs/9629399/apdxl.htm : Details on towers
http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: binding strings
@@ -222,7 +223,16 @@ interface epmapper
typedef struct {
GUID object;
epm_twr_t *tower;
- ascstr2 annotation;
+ /*
+ * In theory this should be:
+ * [charset(DOS),string] uint8 annotation[64]
+ * But midl treats this as:
+ * [charset(DOS),string] uint8 annotation[]
+ * and pidl doesn't support this yet
+ */
+ [value(0)] uint32 __annotation_offset;
+ [value(strlen(annotation)+1)] uint32 __annotation_length;
+ [charset(DOS)] uint8 annotation[__annotation_length];
} epm_entry_t;
typedef struct {
diff --git a/source4/librpc/idl/idl_types.h b/source4/librpc/idl/idl_types.h
index f21f3e660d..9885ca5bf6 100644
--- a/source4/librpc/idl/idl_types.h
+++ b/source4/librpc/idl/idl_types.h
@@ -5,33 +5,16 @@
#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM
#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM
#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE
-#define STR_FIXLEN32 LIBNDR_FLAG_STR_FIXLEN32
-#define STR_FIXLEN15 LIBNDR_FLAG_STR_FIXLEN15
#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT
#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN
#define STR_UTF8 LIBNDR_FLAG_STR_UTF8
/*
- a UCS2 string prefixed with [size], 32 bits
-*/
-#define lstring [flag(STR_SIZE4)] string
-
-/*
a null terminated UCS2 string
*/
#define nstring [flag(STR_NULLTERM)] string
/*
- fixed length 32 character UCS-2 string
-*/
-#define string32 [flag(STR_FIXLEN32)] string
-
-/*
- fixed length 16 character ascii string
-*/
-#define astring15 [flag(STR_ASCII|STR_FIXLEN15)] string
-
-/*
an ascii string prefixed with [offset] [length], both 32 bits
null terminated
*/
diff --git a/source4/librpc/idl/initshutdown.idl b/source4/librpc/idl/initshutdown.idl
index 868e48e28a..ac30be70dd 100644
--- a/source4/librpc/idl/initshutdown.idl
+++ b/source4/librpc/idl/initshutdown.idl
@@ -4,6 +4,8 @@
initshutdown interface definition
*/
+import "lsa.idl";
+
[
uuid("894de0c0-0d55-11d3-a322-00c04fa321a1"),
version(1.0),
@@ -12,20 +14,13 @@
helpstring("Init shutdown service")
] interface initshutdown
{
- typedef struct {
- [value(strlen_m_term(name))] uint32 name_size;
- [flag(STR_LEN4|STR_NOTERM)] string name;
- } initshutdown_String_sub;
-
- typedef [public] struct {
- [value(strlen_m(name->name)*2)] uint16 name_len;
- [value(strlen_m_term(name->name)*2)] uint16 name_size;
- initshutdown_String_sub *name;
- } initshutdown_String;
-
WERROR initshutdown_Init(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 reboot
@@ -37,7 +32,11 @@
WERROR initshutdown_InitEx(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 reboot,
diff --git a/source4/librpc/idl/krb5pac.idl b/source4/librpc/idl/krb5pac.idl
index fa6bf51e44..efd4aa860f 100644
--- a/source4/librpc/idl/krb5pac.idl
+++ b/source4/librpc/idl/krb5pac.idl
@@ -16,7 +16,8 @@ interface krb5pac
{
typedef struct {
NTTIME logon_time;
- [flag(STR_SIZE2|STR_NOTERM|STR_BYTESIZE)] string account_name;
+ [value(2*strlen_m(account_name))] uint16 size;
+ [charset(UTF16)] uint8 account_name[size];
} PAC_LOGON_NAME;
typedef [public,flag(NDR_PAHEX)] struct {
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 8d26ec0aad..3159a7d16d 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -23,7 +23,7 @@ import "security.idl";
typedef [public] struct {
[value(2*strlen_m(string))] uint16 length;
- [value(2*(strlen_m(string)+1))] uint16 size;
+ [value(2*strlen_m_term(string))] uint16 size;
[charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
} lsa_StringLarge;
@@ -35,9 +35,15 @@ import "security.idl";
typedef [public] struct {
[value(strlen_m(string))] uint16 length;
[value(strlen_m(string))] uint16 size;
- ascstr_noterm *string;
+ [charset(DOS),size_is(size),length_is(length)] uint8 *string;
} lsa_AsciiString;
+ typedef [public] struct {
+ [value(strlen_m(string))] uint16 length;
+ [value(strlen_m_term(string))] uint16 size;
+ [charset(DOS),size_is(size),length_is(length)] uint8 *string;
+ } lsa_AsciiStringLarge;
+
/******************/
/* Function: 0x00 */
NTSTATUS lsa_Close (
diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl
index d4c2bf1ad0..17304bfa0d 100644
--- a/source4/librpc/idl/nbt.idl
+++ b/source4/librpc/idl/nbt.idl
@@ -143,7 +143,7 @@ interface nbt
} nbt_statistics;
typedef struct {
- astring15 name;
+ [charset(DOS)] uint8 name[15];
nbt_name_type type;
nb_flags nb_flags;
} nbt_status_name;
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 114c06a00d..2144393ebd 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -58,7 +58,7 @@ import "security.idl", "winreg.idl";
} spoolss_PrinterInfo0;
typedef [public,gensize] struct {
- string32 devicename;
+ [charset(UTF16)] uint16 devicename[32];
uint16 specversion;
uint16 driverversion;
uint16 size;
@@ -77,7 +77,7 @@ import "security.idl", "winreg.idl";
uint16 yresolution;
uint16 ttoption;
uint16 collate;
- string32 formname;
+ [charset(UTF16)] uint16 formname[32];
uint16 logpixels;
uint32 bitsperpel;
uint32 pelswidth;
@@ -1407,12 +1407,13 @@ import "security.idl", "winreg.idl";
WERROR spoolss_EnumPrinterData(
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
+ [out,ref,size_is(value_offered/2),charset(UTF16)] uint16 *value_name,
[in] uint32 value_offered,
- [out] lstring value_name,
- [out] uint32 value_needed,
- [out] uint32 printerdata_type,
- [out] DATA_BLOB buffer,
- [in,out,ref] uint32 *data_size
+ [out,ref] uint32 *value_needed,
+ [out,ref] uint32 *printerdata_type,
+ [out,ref] DATA_BLOB *buffer,
+ [in] uint32 data_offered,
+ [out,ref] uint32 *data_needed
);
/******************/
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index b489e86c38..5e5d5542b6 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -2,7 +2,7 @@
winreg interface definition
*/
-import "lsa.idl", "initshutdown.idl", "security.idl";
+import "lsa.idl", "security.idl";
[
uuid("338cd001-2244-31f1-aaaa-900038001003"),
@@ -302,7 +302,11 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x18 */
WERROR winreg_InitiateSystemShutdown(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 reboot
@@ -358,7 +362,11 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x1e */
WERROR winreg_InitiateSystemShutdownEx(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 reboot,
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 1ecc6f3c38..731ef0f60b 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -109,11 +109,9 @@ struct ndr_print {
#define LIBNDR_FLAG_STR_NULLTERM (1<<6)
#define LIBNDR_FLAG_STR_SIZE2 (1<<7)
#define LIBNDR_FLAG_STR_BYTESIZE (1<<8)
-#define LIBNDR_FLAG_STR_FIXLEN32 (1<<9)
#define LIBNDR_FLAG_STR_CONFORMANT (1<<10)
#define LIBNDR_FLAG_STR_CHARLEN (1<<11)
#define LIBNDR_FLAG_STR_UTF8 (1<<12)
-#define LIBNDR_FLAG_STR_FIXLEN15 (1<<13)
#define LIBNDR_STRING_FLAGS (0x7FFC)
diff --git a/source4/librpc/ndr/ndr_sec_helper.c b/source4/librpc/ndr/ndr_sec_helper.c
index 30eaf9c6f4..5a0178bd25 100644
--- a/source4/librpc/ndr/ndr_sec_helper.c
+++ b/source4/librpc/ndr/ndr_sec_helper.c
@@ -187,6 +187,9 @@ enum ndr_err_code ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct
if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
/* handle a w2k bug which send random data in the buffer */
ZERO_STRUCTP(sid);
+ } else if (sid->num_auths == 0 && sid->sub_auths) {
+ talloc_free(sid->sub_auths);
+ sid->sub_auths = NULL;
}
return NDR_ERR_SUCCESS;
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c
index 69a7eca1a8..79548f81bc 100644
--- a/source4/librpc/ndr/ndr_string.c
+++ b/source4/librpc/ndr/ndr_string.c
@@ -259,24 +259,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
*s = as;
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32:
- len1 = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- NDR_PULL_NEED_BYTES(ndr, len1*byte_mul);
- ret = convert_string_talloc(ndr->current_mem_ctx,
- ndr->iconv_convenience,
- chset, CH_UNIX,
- ndr->data+ndr->offset,
- len1*byte_mul,
- (void **)&as);
- if (ret == -1) {
- return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad character conversion");
- }
- NDR_CHECK(ndr_pull_advance(ndr, len1*byte_mul));
- *s = as;
- break;
-
case LIBNDR_FLAG_STR_NOTERM:
if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
return ndr_pull_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x (missing NDR_REMAINING)\n",
@@ -349,10 +331,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
flags &= ~LIBNDR_FLAG_STR_CONFORMANT;
- if (!(flags &
- (LIBNDR_FLAG_STR_NOTERM |
- LIBNDR_FLAG_STR_FIXLEN15 |
- LIBNDR_FLAG_STR_FIXLEN32))) {
+ if (!(flags & LIBNDR_FLAG_STR_NOTERM)) {
s_len++;
}
d_len = convert_string_talloc(ndr, ndr->iconv_convenience, CH_UNIX, chset, s, s_len, (void **)&dest);
@@ -399,21 +378,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32: {
- ssize_t fix_len = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- uint32_t pad_len = fix_len - d_len;
- if (d_len > fix_len) {
- return ndr_push_error(ndr, NDR_ERR_CHARCNV,
- "Bad character conversion");
- }
- NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
- if (pad_len != 0) {
- NDR_CHECK(ndr_push_zero(ndr, pad_len));
- }
- break;
- }
-
default:
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
@@ -439,13 +403,6 @@ _PUBLIC_ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s)
unsigned byte_mul = 2;
unsigned c_len_term = 1;
- if (flags & LIBNDR_FLAG_STR_FIXLEN32) {
- return 32;
- }
- if (flags & LIBNDR_FLAG_STR_FIXLEN15) {
- return 15;
- }
-
c_len = s?strlen_m(s):0;
if (flags & (LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_UTF8)) {
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c
index b06964d331..a0094b8bae 100644
--- a/source4/librpc/rpc/dcerpc_smb2.c
+++ b/source4/librpc/rpc/dcerpc_smb2.c
@@ -410,7 +410,7 @@ struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_pipe *p,
state->ctx = ctx;
ZERO_STRUCT(io);
- io.in.access_mask =
+ io.in.desired_access =
SEC_STD_READ_CONTROL |
SEC_FILE_READ_ATTRIBUTE |
SEC_FILE_WRITE_ATTRIBUTE |
@@ -423,11 +423,11 @@ struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_pipe *p,
io.in.share_access =
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE;
- io.in.open_disposition = NTCREATEX_DISP_OPEN;
+ io.in.create_disposition = NTCREATEX_DISP_OPEN;
io.in.create_options =
NTCREATEX_OPTIONS_NON_DIRECTORY_FILE |
NTCREATEX_OPTIONS_UNKNOWN_400000;
- io.in.impersonation = NTCREATEX_IMPERSONATION_IMPERSONATION;
+ io.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
if ((strncasecmp(pipe_name, "/pipe/", 6) == 0) ||
(strncasecmp(pipe_name, "\\pipe\\", 6) == 0)) {