[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-575-g1bb22b5

Günther Deschner gd at samba.org
Fri Feb 6 17:55:00 GMT 2009


The branch, master has been updated
       via  1bb22b55274c6d9661acb8c051f8489287a9a2cd (commit)
       via  2bbe0c2859487e286f90d0ab7305da54aed5f1e1 (commit)
      from  143a5b89eeb669640299e67d82decb38512d4f3c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1bb22b55274c6d9661acb8c051f8489287a9a2cd
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 6 18:52:42 2009 +0100

    s3: re-run make samba3-idl.
    
    Guenther

commit 2bbe0c2859487e286f90d0ab7305da54aed5f1e1
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 6 18:51:36 2009 +0100

    pidl: return early when AllocOutVar() in s3 server generator has nothing to do.
    
    Jelmer, Metze, please check.
    
    Guenther

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

Summary of changes:
 librpc/gen_ndr/srv_spoolss.c            |   88 -------------------------------
 pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm |    7 ++-
 2 files changed, 5 insertions(+), 90 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index 1f7d29f..64af1c4 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -57,12 +57,6 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumPrinters(p, r);
 
 	if (p->rng_fault_state) {
@@ -388,12 +382,6 @@ static bool api_spoolss_EnumJobs(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumJobs(p, r);
 
 	if (p->rng_fault_state) {
@@ -858,12 +846,6 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumPrinterDrivers(p, r);
 
 	if (p->rng_fault_state) {
@@ -1255,12 +1237,6 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumPrintProcessors(p, r);
 
 	if (p->rng_fault_state) {
@@ -2098,12 +2074,6 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p)
 		return false;
 	}
 
-	r->out.data = talloc_zero(r, union spoolss_PrinterData);
-	if (r->out.data == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.needed = talloc_zero(r, uint32_t);
 	if (r->out.needed == NULL) {
 		talloc_free(r);
@@ -2722,12 +2692,6 @@ static bool api_spoolss_EnumForms(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumForms(p, r);
 
 	if (p->rng_fault_state) {
@@ -2814,12 +2778,6 @@ static bool api_spoolss_EnumPorts(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumPorts(p, r);
 
 	if (p->rng_fault_state) {
@@ -2906,12 +2864,6 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p)
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
-		talloc_free(r);
-		return false;
-	}
-
 	r->out.result = _spoolss_EnumMonitors(p, r);
 
 	if (p->rng_fault_state) {
@@ -7527,11 +7479,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7584,11 +7531,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7647,11 +7589,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7704,11 +7641,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7804,11 +7736,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData);
-			if (r->out.data == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.needed = talloc_zero(mem_ctx, uint32_t);
 			if (r->out.needed == NULL) {
 			return NT_STATUS_NO_MEMORY;
@@ -7886,11 +7813,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7908,11 +7830,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
@@ -7930,11 +7847,6 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
-			return NT_STATUS_NO_MEMORY;
-			}
-
 			r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
index 33dc68e..c9a8eea 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
@@ -58,14 +58,17 @@ sub AllocOutVar($$$$$)
 	if ($l->{TYPE} eq "POINTER") {
 		my $nl = GetNextLevel($e, $l);
 		$l = $nl if ($nl->{TYPE} eq "ARRAY");
-	}
+	} elsif
 
 	# we don't support multi-dimentional arrays yet
-	if ($l->{TYPE} eq "ARRAY") {
+	($l->{TYPE} eq "ARRAY") {
 		my $nl = GetNextLevel($e, $l);
 		if ($nl->{TYPE} eq "ARRAY") {
 			fatal($e->{ORIGINAL},"multi-dimentional [out] arrays are not supported!");
 		}
+	} else {
+		# neither pointer nor array, no need to alloc something.
+		return;
 	}
 
 	if ($l->{TYPE} eq "ARRAY") {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list