[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-62-gcb98869

Stefan Metzmacher metze at samba.org
Wed Oct 17 08:36:39 GMT 2007


The branch, v3-2-test has been updated
       via  cb98869fa189ce2a926a00fa9077a114f31a5d45 (commit)
      from  2ef50e325c2183385286b994216624dc3a309ff3 (commit)

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


- Log -----------------------------------------------------------------
commit cb98869fa189ce2a926a00fa9077a114f31a5d45
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Oct 17 10:35:51 2007 +0200

    fix crash bug in pidl generated client code, this
    could have happend with [in,out,unique] pointers
    when the clients sends a valid pointer, but the server
    reponse with a NULL pointer (as samba-3.0.26a do for some calls).
    
    I've tested with midl to see how windows handles this situation
    and also the reverse case where the client sends NULL and
    the server reposnse with non-NULL.
    
    It appears that midl generated code just ignores this
    and only copies the result if both pointers are non-NULL.
    
    metze

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

Summary of changes:
 source/librpc/gen_ndr/cli_dfs.c      |   12 ++++----
 source/librpc/gen_ndr/cli_lsa.c      |   46 +++++++++++++++++-----------------
 source/librpc/gen_ndr/cli_netlogon.c |   22 ++++++++--------
 source/librpc/gen_ndr/cli_srvsvc.c   |   34 ++++++++++++------------
 source/librpc/gen_ndr/cli_svcctl.c   |   24 +++++++++---------
 source/librpc/gen_ndr/cli_winreg.c   |   24 +++++++++---------
 source/librpc/gen_ndr/cli_wkssvc.c   |    6 ++--
 7 files changed, 84 insertions(+), 84 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/librpc/gen_ndr/cli_dfs.c b/source/librpc/gen_ndr/cli_dfs.c
index 9a4e4c8..154ceff 100644
--- a/source/librpc/gen_ndr/cli_dfs.c
+++ b/source/librpc/gen_ndr/cli_dfs.c
@@ -198,10 +198,10 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint3
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
-	if ( total ) {
+	if (total && r.out.total) {
 		*total = *r.out.total;
 	}
 	
@@ -358,7 +358,7 @@ NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 	}
 	
 	/* Return variables */
-	if ( unknown2 ) {
+	if (unknown2 && r.out.unknown2) {
 		*unknown2 = *r.out.unknown2;
 	}
 	
@@ -396,7 +396,7 @@ NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
 	}
 	
 	/* Return variables */
-	if ( unknown ) {
+	if (unknown && r.out.unknown) {
 		*unknown = *r.out.unknown;
 	}
 	
@@ -709,10 +709,10 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, con
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
-	if ( total ) {
+	if (total && r.out.total) {
 		*total = *r.out.total;
 	}
 	
diff --git a/source/librpc/gen_ndr/cli_lsa.c b/source/librpc/gen_ndr/cli_lsa.c
index 4c92358..5018636 100644
--- a/source/librpc/gen_ndr/cli_lsa.c
+++ b/source/librpc/gen_ndr/cli_lsa.c
@@ -127,7 +127,7 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
 	}
 	
 	/* Return variables */
-	if ( sdbuf ) {
+	if (sdbuf && r.out.sdbuf) {
 		*sdbuf = *r.out.sdbuf;
 	}
 	
@@ -252,7 +252,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -482,7 +482,7 @@ NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*sids = *r.out.sids;
@@ -521,7 +521,7 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*names = *r.out.names;
@@ -622,7 +622,7 @@ NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, TALLOC_CTX *me
 	}
 	
 	/* Return variables */
-	if ( privs ) {
+	if (privs && r.out.privs) {
 		*privs = *r.out.privs;
 	}
 	
@@ -868,7 +868,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, TALLOC_C
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -999,16 +999,16 @@ NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
 	}
 	
 	/* Return variables */
-	if ( new_val ) {
+	if (new_val && r.out.new_val) {
 		*new_val = *r.out.new_val;
 	}
-	if ( new_mtime ) {
+	if (new_mtime && r.out.new_mtime) {
 		*new_mtime = *r.out.new_mtime;
 	}
-	if ( old_val ) {
+	if (old_val && r.out.old_val) {
 		*old_val = *r.out.old_val;
 	}
-	if ( old_mtime ) {
+	if (old_mtime && r.out.old_mtime) {
 		*old_mtime = *r.out.old_mtime;
 	}
 	
@@ -1074,7 +1074,7 @@ NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	}
 	
 	/* Return variables */
-	if ( name ) {
+	if (name && r.out.name) {
 		*name = *r.out.name;
 	}
 	
@@ -1110,7 +1110,7 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, TALLOC_CT
 	}
 	
 	/* Return variables */
-	if ( disp_name ) {
+	if (disp_name && r.out.disp_name) {
 		*disp_name = *r.out.disp_name;
 	}
 	*language_id = *r.out.language_id;
@@ -1304,7 +1304,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, TAL
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1490,10 +1490,10 @@ NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
 	}
 	
 	/* Return variables */
-	if ( account_name ) {
+	if (account_name && r.out.account_name) {
 		*account_name = *r.out.account_name;
 	}
-	if ( authority_name ) {
+	if (authority_name && r.out.authority_name) {
 		*authority_name = *r.out.authority_name;
 	}
 	
@@ -1527,7 +1527,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, TALLOC_CTX *me
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1591,7 +1591,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, TA
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1752,7 +1752,7 @@ NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, TA
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1885,7 +1885,7 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*names = *r.out.names;
@@ -1927,7 +1927,7 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*sids = *r.out.sids;
@@ -2230,7 +2230,7 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*sids = *r.out.sids;
@@ -2473,7 +2473,7 @@ NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*names = *r.out.names;
@@ -2514,7 +2514,7 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
 	}
 	
 	/* Return variables */
-	if ( domains ) {
+	if (domains && r.out.domains) {
 		*domains = *r.out.domains;
 	}
 	*sids = *r.out.sids;
diff --git a/source/librpc/gen_ndr/cli_netlogon.c b/source/librpc/gen_ndr/cli_netlogon.c
index d986cef..20c5f2d 100644
--- a/source/librpc/gen_ndr/cli_netlogon.c
+++ b/source/librpc/gen_ndr/cli_netlogon.c
@@ -33,7 +33,7 @@ NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -105,7 +105,7 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	}
 	
 	/* Return variables */
-	if ( return_authenticator ) {
+	if (return_authenticator && r.out.return_authenticator) {
 		*return_authenticator = *r.out.return_authenticator;
 	}
 	*validation = *r.out.validation;
@@ -145,7 +145,7 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	}
 	
 	/* Return variables */
-	if ( return_authenticator ) {
+	if (return_authenticator && r.out.return_authenticator) {
 		*return_authenticator = *r.out.return_authenticator;
 	}
 	
@@ -290,7 +290,7 @@ NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	/* Return variables */
 	*return_authenticator = *r.out.return_authenticator;
 	*sequence_num = *r.out.sequence_num;
-	if ( delta_enum_array ) {
+	if (delta_enum_array && r.out.delta_enum_array) {
 		*delta_enum_array = *r.out.delta_enum_array;
 	}
 	
@@ -331,7 +331,7 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
 	/* Return variables */
 	*return_authenticator = *r.out.return_authenticator;
 	*sync_context = *r.out.sync_context;
-	if ( delta_enum_array ) {
+	if (delta_enum_array && r.out.delta_enum_array) {
 		*delta_enum_array = *r.out.delta_enum_array;
 	}
 	
@@ -626,7 +626,7 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	/* Return variables */
 	*return_authenticator = *r.out.return_authenticator;
 	*sync_context = *r.out.sync_context;
-	if ( delta_enum_array ) {
+	if (delta_enum_array && r.out.delta_enum_array) {
 		*delta_enum_array = *r.out.delta_enum_array;
 	}
 	
@@ -665,7 +665,7 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
 	
 	/* Return variables */
 	*return_authenticator = *r.out.return_authenticator;
-	if ( delta_enum_array ) {
+	if (delta_enum_array && r.out.delta_enum_array) {
 		*delta_enum_array = *r.out.delta_enum_array;
 	}
 	
@@ -765,7 +765,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -985,7 +985,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1215,7 +1215,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, TALLOC_CTX *me
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1558,7 +1558,7 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, TALLOC_
 	}
 	
 	/* Return variables */
-	if ( return_authenticator ) {
+	if (return_authenticator && r.out.return_authenticator) {
 		*return_authenticator = *r.out.return_authenticator;
 	}
 	*validation = *r.out.validation;
diff --git a/source/librpc/gen_ndr/cli_srvsvc.c b/source/librpc/gen_ndr/cli_srvsvc.c
index 7944340..e848e5b 100644
--- a/source/librpc/gen_ndr/cli_srvsvc.c
+++ b/source/librpc/gen_ndr/cli_srvsvc.c
@@ -38,7 +38,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, TALLOC_CTX *m
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -144,7 +144,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, TALLOC_CTX *
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -215,7 +215,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, TALLOC_CT
 	}
 	
 	/* Return variables */
-	if ( parm_error ) {
+	if (parm_error && r.out.parm_error) {
 		*parm_error = *r.out.parm_error;
 	}
 	
@@ -319,7 +319,7 @@ NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -361,7 +361,7 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -467,7 +467,7 @@ NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -535,7 +535,7 @@ NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	}
 	
 	/* Return variables */
-	if ( parm_error ) {
+	if (parm_error && r.out.parm_error) {
 		*parm_error = *r.out.parm_error;
 	}
 	
@@ -575,7 +575,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, TALLOC_CTX *
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -645,7 +645,7 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *
 	}
 	
 	/* Return variables */
-	if ( parm_error ) {
+	if (parm_error && r.out.parm_error) {
 		*parm_error = *r.out.parm_error;
 	}
 	
@@ -809,7 +809,7 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *me
 	}
 	
 	/* Return variables */
-	if ( parm_error ) {
+	if (parm_error && r.out.parm_error) {
 		*parm_error = *r.out.parm_error;
 	}
 	
@@ -848,7 +848,7 @@ NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
 	/* Return variables */
 	*info = *r.out.info;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -954,7 +954,7 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, TALLOC_CTX
 	*level = *r.out.level;
 	*transports = *r.out.transports;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -1019,7 +1019,7 @@ NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	}
 	
 	/* Return variables */
-	if ( info ) {
+	if (info && r.out.info) {
 		*info = *r.out.info;
 	}
 	
@@ -1292,7 +1292,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 	*level = *r.out.level;
 	*ctr = *r.out.ctr;
 	*totalentries = *r.out.totalentries;
-	if ( resume_handle ) {
+	if (resume_handle && r.out.resume_handle) {
 		*resume_handle = *r.out.resume_handle;
 	}
 	
@@ -1327,7 +1327,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, TALLOC_CTX
 	}
 	
 	/* Return variables */
-	if ( hnd ) {
+	if (hnd && r.out.hnd) {
 		*hnd = *r.out.hnd;
 	}
 	
@@ -1360,7 +1360,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, TALLOC_CTX
 	}
 	
 	/* Return variables */
-	if ( hnd ) {
+	if (hnd && r.out.hnd) {
 		*hnd = *r.out.hnd;
 	}
 	
@@ -1396,7 +1396,7 @@ NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, TALLOC_CT
 	}
 	
 	/* Return variables */
-	if ( sd_buf ) {
+	if (sd_buf && r.out.sd_buf) {
 		*sd_buf = *r.out.sd_buf;
 	}
 	
diff --git a/source/librpc/gen_ndr/cli_svcctl.c b/source/librpc/gen_ndr/cli_svcctl.c


-- 
Samba Shared Repository


More information about the samba-cvs mailing list