[SCM] Samba Shared Repository - branch v3-4-test updated

Karolin Seeger kseeger at samba.org
Mon Nov 30 06:46:04 MST 2009


The branch, v3-4-test has been updated
       via  b89d902... s3: re-run make samba3-idl.
       via  11f5df1... pidl: fix handling of output arguments in s3 client stubs.
       via  4f14da8... pidl:Samba3/ClientNDR: $size can be 'foo / 2' so we need to add '(' and ')'
       via  d0d77d8... pidl:NDR/Parser: $size can be 'foo / 2' so we need to add '(' and ')'
      from  93bbbd3... s3:docs: Document "aio write behind".

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test


- Log -----------------------------------------------------------------
commit b89d902b6ab0ab14c95cf7b7bbe37b3884fefea5
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 27 16:49:48 2009 +0100

    s3: re-run make samba3-idl.
    
    Guenther
    
    Fix bug #6934.

commit 11f5df11cc6998688cadc034b3e1e249d98bf3e1
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 27 16:44:39 2009 +0100

    pidl: fix handling of output arguments in s3 client stubs.
    
    a20e095 used (uint8_t) instead of (uint8_t *).
    
    Guenther

commit 4f14da8ddb1c903b75917cefaaea3e9b405a633a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 27 11:37:01 2009 +0100

    pidl:Samba3/ClientNDR: $size can be 'foo / 2' so we need to add '(' and ')'
    
    foo / 5 * sizeof(bar)' isn't the same as
    '(foo / 2) * sizeof(bar)'.
    
    metze

commit d0d77d830072fbb5bda1c45f9df0722718f89096
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 25 14:21:32 2009 +0100

    pidl:NDR/Parser: $size can be 'foo / 2' so we need to add '(' and ')'
    
    foo / 5 * sizeof(bar)' isn't the same as
    '(foo / 2) * sizeof(bar)'.
    
    metze
    (cherry picked from commit ab1c92950f3cfdc8c52b772ecef23a5477f48f9d)

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/cli_echo.c                |    4 ++--
 librpc/gen_ndr/cli_epmapper.c            |    4 ++--
 librpc/gen_ndr/cli_eventlog.c            |    4 ++--
 librpc/gen_ndr/cli_ntsvcs.c              |    4 ++--
 librpc/gen_ndr/cli_spoolss.c             |   12 ++++++------
 librpc/gen_ndr/cli_srvsvc.c              |    2 +-
 librpc/gen_ndr/cli_svcctl.c              |   20 ++++++++++----------
 librpc/gen_ndr/cli_winreg.c              |    8 ++++----
 librpc/gen_ndr/ndr_winreg.c              |    4 ++--
 pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm  |    4 ++--
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm |    2 +-
 pidl/tests/samba3-cli.pl                 |    2 +-
 source3/librpc/gen_ndr/messaging.h       |    2 ++
 source3/librpc/gen_ndr/notify.h          |    2 ++
 14 files changed, 39 insertions(+), 35 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_echo.c b/librpc/gen_ndr/cli_echo.c
index ff369c7..48632a3 100644
--- a/librpc/gen_ndr/cli_echo.c
+++ b/librpc/gen_ndr/cli_echo.c
@@ -82,7 +82,7 @@ NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data));
+	memcpy(out_data, r.out.out_data, (r.in.len) * sizeof(*out_data));
 
 	/* Return result */
 	return NT_STATUS_OK;
@@ -162,7 +162,7 @@ NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(data, r.out.data, r.in.len * sizeof(*data));
+	memcpy(data, r.out.data, (r.in.len) * sizeof(*data));
 
 	/* Return result */
 	return NT_STATUS_OK;
diff --git a/librpc/gen_ndr/cli_epmapper.c b/librpc/gen_ndr/cli_epmapper.c
index 0ccefa9..65621d3 100644
--- a/librpc/gen_ndr/cli_epmapper.c
+++ b/librpc/gen_ndr/cli_epmapper.c
@@ -135,7 +135,7 @@ NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli,
 	/* Return variables */
 	*entry_handle = *r.out.entry_handle;
 	*num_ents = *r.out.num_ents;
-	memcpy(entries, r.out.entries, r.in.max_ents * sizeof(*entries));
+	memcpy(entries, r.out.entries, (r.in.max_ents) * sizeof(*entries));
 
 	/* Return result */
 	return NT_STATUS_OK;
@@ -184,7 +184,7 @@ NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli,
 	/* Return variables */
 	*entry_handle = *r.out.entry_handle;
 	*num_towers = *r.out.num_towers;
-	memcpy(towers, r.out.towers, r.in.max_towers * sizeof(*towers));
+	memcpy(towers, r.out.towers, (r.in.max_towers) * sizeof(*towers));
 
 	/* Return result */
 	return NT_STATUS_OK;
diff --git a/librpc/gen_ndr/cli_eventlog.c b/librpc/gen_ndr/cli_eventlog.c
index b9cf39d..2480412 100644
--- a/librpc/gen_ndr/cli_eventlog.c
+++ b/librpc/gen_ndr/cli_eventlog.c
@@ -464,7 +464,7 @@ NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data));
+	memcpy(data, r.out.data, (r.in.number_of_bytes) * sizeof(*data));
 	*sent_size = *r.out.sent_size;
 	*real_size = *r.out.real_size;
 
@@ -941,7 +941,7 @@ NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.buf_size) * sizeof(*buffer));
 	*bytes_needed = *r.out.bytes_needed;
 
 	/* Return result */
diff --git a/librpc/gen_ndr/cli_ntsvcs.c b/librpc/gen_ndr/cli_ntsvcs.c
index 179368d..8f98278 100644
--- a/librpc/gen_ndr/cli_ntsvcs.c
+++ b/librpc/gen_ndr/cli_ntsvcs.c
@@ -461,7 +461,7 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (*r.in.length) * sizeof(*buffer));
 	*length = *r.out.length;
 
 	/* Return result */
@@ -606,7 +606,7 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
 
 	/* Return variables */
 	*reg_data_type = *r.out.reg_data_type;
-	memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (*r.in.buffer_size) * sizeof(*buffer));
 	*buffer_size = *r.out.buffer_size;
 	*needed = *r.out.needed;
 
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index 1e94a2a..3dd73c6 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -1144,7 +1144,7 @@ NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(data, r.out.data, r.in.data_size * sizeof(*data));
+	memcpy(data, r.out.data, (r.in.data_size) * sizeof(*data));
 	*_data_size = *r.out._data_size;
 
 	/* Return result */
@@ -1240,7 +1240,7 @@ NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
 
 	/* Return variables */
 	if (buffer && r.out.buffer) {
-		memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+		memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	}
 	*needed = *r.out.needed;
 
@@ -3464,10 +3464,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
+	memcpy(discard_const_p(uint8_t *, value_name), r.out.value_name, (r.in.value_offered / 2) * sizeof(*value_name));
 	*value_needed = *r.out.value_needed;
 	*type = *r.out.type;
-	memcpy(data, r.out.data, r.in.data_offered * sizeof(*data));
+	memcpy(data, r.out.data, (r.in.data_offered) * sizeof(*data));
 	*data_needed = *r.out.data_needed;
 
 	/* Return result */
@@ -3743,7 +3743,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
 
 	/* Return variables */
 	*type = *r.out.type;
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -4211,7 +4211,7 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
+	memcpy(out_data, r.out.out_data, (r.in.out_data_size) * sizeof(*out_data));
 	*needed = *r.out.needed;
 	*status_code = *r.out.status_code;
 
diff --git a/librpc/gen_ndr/cli_srvsvc.c b/librpc/gen_ndr/cli_srvsvc.c
index d372510..9dd4162 100644
--- a/librpc/gen_ndr/cli_srvsvc.c
+++ b/librpc/gen_ndr/cli_srvsvc.c
@@ -1622,7 +1622,7 @@ NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(can_path, r.out.can_path, r.in.maxbuf * sizeof(*can_path));
+	memcpy(can_path, r.out.can_path, (r.in.maxbuf) * sizeof(*can_path));
 	*pathtype = *r.out.pathtype;
 
 	/* Return result */
diff --git a/librpc/gen_ndr/cli_svcctl.c b/librpc/gen_ndr/cli_svcctl.c
index a95a4e7..de23fd9 100644
--- a/librpc/gen_ndr/cli_svcctl.c
+++ b/librpc/gen_ndr/cli_svcctl.c
@@ -225,7 +225,7 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -685,7 +685,7 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(service_status, r.out.service_status, r.in.offered * sizeof(*service_status));
+	memcpy(service_status, r.out.service_status, (r.in.offered) * sizeof(*service_status));
 	*needed = *r.out.needed;
 	*services_returned = *r.out.services_returned;
 
@@ -742,7 +742,7 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(service, r.out.service, r.in.offered * sizeof(*service));
+	memcpy(service, r.out.service, (r.in.offered) * sizeof(*service));
 	*needed = *r.out.needed;
 	*services_returned = *r.out.services_returned;
 	if (resume_handle && r.out.resume_handle) {
@@ -1385,7 +1385,7 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(service, r.out.service, r.in.offered * sizeof(*service));
+	memcpy(service, r.out.service, (r.in.offered) * sizeof(*service));
 	*needed = *r.out.needed;
 	*services_returned = *r.out.services_returned;
 	if (resume_handle && r.out.resume_handle) {
@@ -1534,7 +1534,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(query, r.out.query, r.in.offered * sizeof(*query));
+	memcpy(query, r.out.query, (r.in.offered) * sizeof(*query));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -1961,7 +1961,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -2012,7 +2012,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -2063,7 +2063,7 @@ NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -2122,7 +2122,7 @@ NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(services, r.out.services, r.in.offered * sizeof(*services));
+	memcpy(services, r.out.services, (r.in.offered) * sizeof(*services));
 	*needed = *r.out.needed;
 	*service_returned = *r.out.service_returned;
 	if (resume_handle && r.out.resume_handle) {
@@ -2187,7 +2187,7 @@ NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(services, r.out.services, r.in.offered * sizeof(*services));
+	memcpy(services, r.out.services, (r.in.offered) * sizeof(*services));
 	*needed = *r.out.needed;
 	*service_returned = *r.out.service_returned;
 	if (resume_handle && r.out.resume_handle) {
diff --git a/librpc/gen_ndr/cli_winreg.c b/librpc/gen_ndr/cli_winreg.c
index b18554e..c5d19be 100644
--- a/librpc/gen_ndr/cli_winreg.c
+++ b/librpc/gen_ndr/cli_winreg.c
@@ -544,7 +544,7 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
 		*type = *r.out.type;
 	}
 	if (value && r.out.value) {
-		memcpy(value, r.out.value, *r.in.size * sizeof(*value));
+		memcpy(value, r.out.value, (*r.in.size) * sizeof(*value));
 	}
 	if (size && r.out.size) {
 		*size = *r.out.size;
@@ -915,7 +915,7 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
 		*type = *r.out.type;
 	}
 	if (data && r.out.data) {
-		memcpy(data, r.out.data, *r.in.data_size * sizeof(*data));
+		memcpy(data, r.out.data, (*r.in.data_size) * sizeof(*data));
 	}
 	if (data_size && r.out.data_size) {
 		*data_size = *r.out.data_size;
@@ -1481,9 +1481,9 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(values, r.out.values, r.in.num_values * sizeof(*values));
+	memcpy(values, r.out.values, (r.in.num_values) * sizeof(*values));
 	if (buffer && r.out.buffer) {
-		memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
+		memcpy(buffer, r.out.buffer, (*r.in.buffer_size) * sizeof(*buffer));
 	}
 	*buffer_size = *r.out.buffer_size;
 
diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c
index fe76bca..2433ba0 100644
--- a/librpc/gen_ndr/ndr_winreg.c
+++ b/librpc/gen_ndr/ndr_winreg.c
@@ -3700,7 +3700,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 			NDR_PULL_ALLOC_N(ndr, r->in.values, ndr_get_array_size(ndr, &r->in.values));
 		}
-		memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->in.values) * sizeof(*r->in.values));
+		memcpy(r->out.values, r->in.values, (ndr_get_array_size(ndr, &r->in.values)) * sizeof(*r->in.values));
 		_mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
 		NDR_PULL_SET_MEM_CTX(ndr, r->in.values, 0);
 		for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) {
@@ -3762,7 +3762,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 			NDR_PULL_ALLOC_N(ndr, r->out.values, ndr_get_array_size(ndr, &r->out.values));
 		}
-		memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->out.values) * sizeof(*r->in.values));
+		memcpy(r->out.values, r->in.values, (ndr_get_array_size(ndr, &r->out.values)) * sizeof(*r->in.values));
 		_mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
 		NDR_PULL_SET_MEM_CTX(ndr, r->out.values, 0);
 		for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) {
diff --git a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
index ed1b71a..a45abdb 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
@@ -98,9 +98,9 @@ sub ParseOutputArgument($$$)
 		my $env = GenerateFunctionInEnv($fn, "r.");
 		my $size_is = ParseExpr($e->{LEVELS}[$level]->{SIZE_IS}, $env, $e->{ORIGINAL});
 		if (has_property($e, "charset")) {
-		    $self->pidl("memcpy(CONST_DISCARD(char *, $e->{NAME}), r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+		    $self->pidl("memcpy(discard_const_p(uint8_t *, $e->{NAME}), r.out.$e->{NAME}, ($size_is) * sizeof(*$e->{NAME}));");
 		} else {
-		    $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+		    $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, ($size_is) * sizeof(*$e->{NAME}));");
 		}
 	} else {
 		$self->pidl("*$e->{NAME} = *r.out.$e->{NAME};");
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 7ce9708..a5ee948 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2119,7 +2119,7 @@ sub AllocateArrayLevel($$$$$$)
 		$self->pidl("}");
 		if (grep(/in/,@{$e->{DIRECTION}}) and
 		    grep(/out/,@{$e->{DIRECTION}})) {
-			$self->pidl("memcpy(r->out.$e->{NAME}, r->in.$e->{NAME}, $size * sizeof(*r->in.$e->{NAME}));");
+			$self->pidl("memcpy(r->out.$e->{NAME}, r->in.$e->{NAME}, ($size) * sizeof(*r->in.$e->{NAME}));");
 		}
 		return;
 	}
diff --git a/pidl/tests/samba3-cli.pl b/pidl/tests/samba3-cli.pl
index 5a55163..27ab99d 100755
--- a/pidl/tests/samba3-cli.pl
+++ b/pidl/tests/samba3-cli.pl
@@ -123,4 +123,4 @@ my $e = { NAME => "foo", ORIGINAL => { FILE => "f", LINE => -1 },
           LEVELS => [ { TYPE => "ARRAY", SIZE_IS => "mysize" }, { TYPE => "DATA", DATA_TYPE => "int" } ]};
 
 $x->ParseOutputArgument($fn, $e);
-is($x->{res}, "memcpy(foo, r.out.foo, mysize * sizeof(*foo));\n");
+is($x->{res}, "memcpy(foo, r.out.foo, (mysize) * sizeof(*foo));\n");
diff --git a/source3/librpc/gen_ndr/messaging.h b/source3/librpc/gen_ndr/messaging.h
index 3324160..b212b50 100644
--- a/source3/librpc/gen_ndr/messaging.h
+++ b/source3/librpc/gen_ndr/messaging.h
@@ -2,6 +2,8 @@
 
 #include <stdint.h>
 
+#include "libcli/util/ntstatus.h"
+
 #ifndef _HEADER_messaging
 #define _HEADER_messaging
 
diff --git a/source3/librpc/gen_ndr/notify.h b/source3/librpc/gen_ndr/notify.h
index a5ec4a4..981a5b7 100644
--- a/source3/librpc/gen_ndr/notify.h
+++ b/source3/librpc/gen_ndr/notify.h
@@ -2,6 +2,8 @@
 
 #include <stdint.h>
 
+#include "libcli/util/ntstatus.h"
+
 #ifndef _HEADER_notify
 #define _HEADER_notify
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list