[SAMBA 4] [PATCH] Fix IBM checker warnings

Andrew Bartlett abartlet at samba.org
Fri Feb 8 11:18:21 GMT 2008


On Fri, 2008-02-08 at 04:42 -0600, Andrew Kroeger wrote:
> Samba Developers:
> 
> I am attaching a couple of patches to correct a number of issues
> discovered by the IBM checker.
> 
> I am trying to adopt the Git development model, and have also posted the
> same commits at git://git.id10ts.net/samba.git under the v4-0-checker
> topic branch.
> 
> I would appreciate if someone could evaluate these patches vs. my Git
> repository and let me know if I am doing anything wrong with my Git
> repository setup.
> 
> Sincerely,
> Andrew Kroeger
> plain text document attachment (chk_1)
> diff --git a/source/lib/replace/test/testsuite.c b/source/lib/replace/test/testsuite.c
> index c9f3301..dee775e 100644
> --- a/source/lib/replace/test/testsuite.c
> +++ b/source/lib/replace/test/testsuite.c
> @@ -879,50 +879,50 @@ struct torture_context;
>  bool torture_local_replace(struct torture_context *ctx)
>  {
>  	bool ret = true;
> -	ret &= test_ftruncate();
> -	ret &= test_strlcpy();

> +	ret = ret && test_ftruncate();
> +	ret = ret && test_strlcpy();


I know it doesn't like this one, but I really do think it's quite an
acceptable pattern in the torture code.  The only other suggestion I
would make is, when in the main smbtortore code, to move to it's
macro-based setup.

> plain text document attachment (chk_2)
> diff --git a/source/auth/auth_sam.c b/source/auth/auth_sam.c
> index 0885d82..1788955 100644
> --- a/source/auth/auth_sam.c
> +++ b/source/auth/auth_sam.c
> @@ -119,13 +119,13 @@ static NTSTATUS
> authsam_search_account(TALLOC_CTX *mem_ctx, struct ldb_context *
>  		
>  	if (ret_domain == 0) {
>  		DEBUG(3,("check_sam_security: Couldn't find domain [%s] in passdb
> file.\n",
> -			 ldb_dn_get_linearized(msgs_tmp[0]->dn)));
> +			 ldb_dn_get_linearized(domain_dn)));
>  		return NT_STATUS_NO_SUCH_USER;
>  	}
>  		
>  	if (ret_domain > 1) {
>  		DEBUG(0,("Found %d records matching domain [%s]\n", 
> -			 ret_domain, ldb_dn_get_linearized(msgs_tmp[0]->dn)));
> +			 ret_domain, ldb_dn_get_linearized(domain_dn)));
>  		return NT_STATUS_INTERNAL_DB_CORRUPTION;
>  	}

These seem reasonable...
 
> diff --git a/source/lib/registry/patchfile.c
> b/source/lib/registry/patchfile.c
> index fa1367b..8f51c86 100644
> --- a/source/lib/registry/patchfile.c
> +++ b/source/lib/registry/patchfile.c
> @@ -72,7 +72,7 @@ WERROR reg_generate_diff_key(struct registry_key
> *oldkey,
>  						     NULL, NULL);
>  		if (!W_ERROR_IS_OK(error1)) {
>  			DEBUG(0, ("Error occured while getting subkey by index: %s\n",
> -				win_errstr(error2)));
> +				win_errstr(error1)));
>  			continue;
>  		}
>  
-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20080208/b1745737/attachment.bin


More information about the samba-technical mailing list