svn commit: samba r19049 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3: .

jerry at samba.org jerry at samba.org
Mon Oct 2 16:19:05 GMT 2006


Author: jerry
Date: 2006-10-02 16:19:05 +0000 (Mon, 02 Oct 2006)
New Revision: 19049

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19049

Log:
Samba 3 client fixes

* Make sure to check for NULL pointers when dealing with
  [out,unique] before assigning valoues
* Detect RPC faults and return immediately


Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm	2006-10-02 15:23:03 UTC (rev 19048)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm	2006-10-02 16:19:05 UTC (rev 19049)
@@ -58,6 +58,14 @@
 	pidl "";
 	pidl "status = cli_do_rpc_ndr(cli, mem_ctx, PI_$uif, $ufn, &r, (ndr_pull_flags_fn_t)ndr_pull_$fn->{NAME}, (ndr_push_flags_fn_t)ndr_push_$fn->{NAME});";
 	pidl "";
+
+	pidl "if ( !NT_STATUS_IS_OK(status) ) {";
+	indent;
+	pidl "return status;";
+	deindent;
+	pidl "}";
+
+	pidl "";
 	pidl "if (DEBUGLEVEL >= 10)";
 	pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, &r);";
 	pidl "";
@@ -71,7 +79,16 @@
 
 		fatal($e, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY");
 
-		pidl "*$e->{NAME} = *r.out.$e->{NAME};";
+		if ( ($e->{LEVELS}[0]->{TYPE} eq "POINTER") && ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique") ) {
+			pidl "if ( $e->{NAME} ) {";
+			indent;
+			pidl "*$e->{NAME} = *r.out.$e->{NAME};";
+			deindent;
+			pidl "}";
+		} else {
+			pidl "*$e->{NAME} = *r.out.$e->{NAME};";
+		}
+			
 	}
 
 	pidl"";



More information about the samba-cvs mailing list