[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Mar 21 03:26:03 UTC 2018


The branch, master has been updated
       via  e9d42e5 s3:registry: Fix size types and length calculations
       via  0f7a86c s3:vfs_preopen: Change to a do-while loop and fix the check
       via  9f6de82 s3:locking: Fix integer overflow check in posix_lock_in_range()
       via  3a38303 s3:nmbd: Fix possible integer overflow
       via  f866844 s4:dsdb: Fix integer operations
       via  da68a1b lib:socket: Return early if we have only one interface
       via  dcd0a7f ldb: Fix size types in ldb_ldif functions
       via  d0c8824 s3:rpcclient: Fix size types
       via  e3483f9 s3:rpc_server: Fix size types in spoolss
       via  db31156 s3:passdb: Fix size types
       via  59b6894 s3:modules: Fix size type in getdate
       via  c6b5297 s3:nmbd: Fix size type in nmbd_browsesync.c
       via  dfb6948 s3:utils: Fix size type in log2pcaphex
       via  c2e9fb6 s3:rpc_server: Fix size types in srvsvc
       via  b19a810 s3:vfs_nettalk: Fix size types
       via  8a108f6 s3:winbindd: Fix size types in idmap_tdb_common
       via  206bbec s3:printing: Fix size type in printing_db
       via  eb0bdef s3:avahi: Fix size types
       via  75c28a2 s3:client: Fix size types
       via  4630e06 s4:client: Fix size types
       via  f5fd615 s4:torture: Fix size types in nss tests
       via  ba3e21c s3:libsmb: Fix size types in nmblib
       via  d5a8c49 s3:torture: Fix size types in spoolss test
       via  1354061 s4:torture: Fix size types in qfileinfo test
       via  74fbc8e s4:torture: Fix size types in qsinfo test
       via  a877018 s4:rpc_server: Fix size types
       via  b709b10 s4:utils: Fix size types
       via  87ebb19 s3:param: Fix size types
       via  c63ed7b libcli:smb: Fix size types
       via  939b472 s4:cldap_server: Fix size types
       via  8438897 s4:ldap_server: Fix size types
       via  1bd4a0c s4:rpc_server: Fix size types in dcerpc dnsserver
       via  19e6215 s4:dns_server: Fix size types
       via  bbbe675 s3:libads: Fix size types in kerberos functions
       via  717976a s4:ntvfs: Fix size type in pvfs functions
       via  72979d1 heimdal: Fix size types
       via  62c3a7a s3: Fix possible mem leak
      from  618c714 lib:replace: Fix linking when libtirpc-devel overwrites system headers

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


- Log -----------------------------------------------------------------
commit e9d42e5681739dda041ae612f3c9a4a31b131bbd
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 19:46:21 2017 +0100

    s3:registry: Fix size types and length calculations
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Mar 21 04:25:39 CET 2018 on sn-devel-144

commit 0f7a86c46ff90b907615d8f096f86c383ccf3e8e
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:44:59 2017 +0100

    s3:vfs_preopen: Change to a do-while loop and fix the check
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 9f6de82ef25c5d7969c3986d508a138c3c4f5a64
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:24:18 2017 +0100

    s3:locking: Fix integer overflow check in posix_lock_in_range()
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3a383038ee7f74e5a9d2326a761b27950a14eb83
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 15:24:59 2017 +0100

    s3:nmbd: Fix possible integer overflow
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f866844f44c3a9246076aa950148e994809d4b1b
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:32:36 2017 +0100

    s4:dsdb: Fix integer operations
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit da68a1b2f417ec82ea4ed3e7a4d867cef8ca8f93
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 15:54:13 2017 +0100

    lib:socket: Return early if we have only one interface
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dcd0a7f738dabc67aef73abc805eb9eb0d226e8d
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Dec 8 10:03:00 2017 +0100

    ldb: Fix size types in ldb_ldif functions
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d0c882434cb94f89501283149a28b47a1dd6461c
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 19:21:38 2017 +0100

    s3:rpcclient: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e3483f955bc5ba5eac90cf38c3e6ca2ee481b53d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:50:20 2017 +0100

    s3:rpc_server: Fix size types in spoolss
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit db31156dafbf4d2eebb171857df8814af230f896
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:48:45 2017 +0100

    s3:passdb: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 59b689474727c173f052d66a4ab924060181b903
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 20:07:08 2017 +0100

    s3:modules: Fix size type in getdate
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c6b5297b406312a7944c11917a8d5c8235f72673
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 19:47:50 2017 +0100

    s3:nmbd: Fix size type in nmbd_browsesync.c
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dfb69482c4a500a486fe8b4cb6f3841e58d00f56
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 19:47:04 2017 +0100

    s3:utils: Fix size type in log2pcaphex
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c2e9fb63c06ea37e11ed163a89a055748ea1ffc5
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:42:44 2017 +0100

    s3:rpc_server: Fix size types in srvsvc
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b19a810206ce954f3f7997c7a02a294a36e17da9
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:39:07 2017 +0100

    s3:vfs_nettalk: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8a108f624d516cb12396f135e21891c41a16852d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:27:41 2017 +0100

    s3:winbindd: Fix size types in idmap_tdb_common
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 206bbec4f94cc5bcf958961cfca187eb8106da36
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:58:38 2017 +0100

    s3:printing: Fix size type in printing_db
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit eb0bdefd2dd5477ae5c590b5be8c485fb3977775
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:57:05 2017 +0100

    s3:avahi: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 75c28a264223529777f8d1f86574178805aef706
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 18:47:18 2017 +0100

    s3:client: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4630e06334c157639eaf6ae0858f491ca4fc1dad
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:55:34 2017 +0100

    s4:client: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f5fd615cbf727663ad082176511dfad90969083d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:54:12 2017 +0100

    s4:torture: Fix size types in nss tests
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ba3e21cea0dc70a8e8e6fc6e88c1721a3a455b9d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:52:39 2017 +0100

    s3:libsmb: Fix size types in nmblib
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d5a8c49c1bc71eb751c57d076f452d7a2c3e95ea
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:50:33 2017 +0100

    s3:torture: Fix size types in spoolss test
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 13540613edfcde827a41f60d78d64c63eb99f065
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:49:00 2017 +0100

    s4:torture: Fix size types in qfileinfo test
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 74fbc8ed4be57b3236bd6c4344fa990410fe4670
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:47:15 2017 +0100

    s4:torture: Fix size types in qsinfo test
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a877018ebeb905f9fb9bbad7e138dad55918717e
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:48:00 2017 +0100

    s4:rpc_server: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b709b10eb62541b57adc11d6d36096f04647bee3
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:45:45 2017 +0100

    s4:utils: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 87ebb195d34e3c413eea7ef38024c1be97fd5be9
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:03:37 2017 +0100

    s3:param: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c63ed7b656d4b3ea5518ee40679df96b84db0332
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:01:39 2017 +0100

    libcli:smb: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 939b4723a7d159466bfe2e66ddcb38012e412385
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:43:58 2017 +0100

    s4:cldap_server: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8438897828b16bfc5985d02b76268609a7610c7d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:43:08 2017 +0100

    s4:ldap_server: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1bd4a0cf27dfe820ec9103374ed225375aac8ded
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:42:02 2017 +0100

    s4:rpc_server: Fix size types in dcerpc dnsserver
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 19e621554f0ffe44745f7ebc7e2c71094a00bc11
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:40:00 2017 +0100

    s4:dns_server: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bbbe675a1a7afcbc89f27093b8d521d296cde2fa
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:38:21 2017 +0100

    s3:libads: Fix size types in kerberos functions
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 717976ac237fff3cf7a4e95dd0c67950dfaf8e20
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 17:35:11 2017 +0100

    s4:ntvfs: Fix size type in pvfs functions
    
    This fixes compilation with -Wstrict-overflow=2
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 72979d1d60ca2eab1e7903c2e77b8cca69667691
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 7 20:26:40 2017 +0100

    heimdal: Fix size types
    
    This fixes compilation with -Wstrict-overflow=2
    
    Upstream pull request:
    https://github.com/heimdal/heimdal/pull/354
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 62c3a7a6bd165e10d58acad57858901c699ae470
Author: Swen Schillig <swen at vnet.ibm.com>
Date:   Tue Mar 6 10:35:32 2018 +0100

    s3: Fix possible mem leak
    
    The call to full_path_tos() might allocate memory which needs to be free'd
    once processign is done.
    
    Signed-off-by: Swen Schillig <swen at vnet.ibm.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/ldb/common/ldb_ldif.c                       |  6 ++++--
 lib/socket/interfaces.c                         |  5 ++++-
 libcli/smb/smbXcli_base.c                       |  7 ++++---
 source3/client/client.c                         |  6 +++---
 source3/libads/kerberos.c                       | 10 +++++-----
 source3/libsmb/nmblib.c                         |  6 +++---
 source3/locking/posix.c                         |  3 ++-
 source3/modules/getdate.c                       |  2 +-
 source3/modules/getdate.y                       |  2 +-
 source3/modules/vfs_netatalk.c                  |  2 +-
 source3/modules/vfs_preopen.c                   |  4 ++--
 source3/nmbd/nmbd_browsesync.c                  |  2 +-
 source3/nmbd/nmbd_sendannounce.c                |  4 +++-
 source3/param/loadparm.c                        |  4 ++--
 source3/passdb/pdb_ldap.c                       |  3 ++-
 source3/printing/printing_db.c                  |  2 +-
 source3/registry/reg_format.c                   | 16 +++++++++-------
 source3/rpc_server/spoolss/srv_spoolss_nt.c     |  8 ++++----
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c       |  8 ++++----
 source3/rpcclient/rpcclient.c                   |  2 +-
 source3/smbd/avahi_register.c                   |  4 ++--
 source3/smbd/dir.c                              | 11 ++++++++---
 source3/utils/log2pcaphex.c                     |  2 +-
 source3/winbindd/idmap_tdb_common.c             |  4 ++--
 source4/cldap_server/cldap_server.c             |  2 +-
 source4/client/client.c                         |  8 ++++----
 source4/dns_server/dns_server.c                 |  4 ++--
 source4/dsdb/samdb/ldb_modules/operational.c    |  6 +++---
 source4/heimdal/lib/asn1/gen.c                  |  4 ++--
 source4/heimdal/lib/hx509/cert.c                |  3 ++-
 source4/heimdal/lib/krb5/config_file.c          |  2 +-
 source4/heimdal/lib/krb5/keytab_any.c           |  2 +-
 source4/heimdal/lib/roken/resolve.c             |  2 +-
 source4/ldap_server/ldap_server.c               |  4 ++--
 source4/ntvfs/posix/pvfs_resolve.c              |  8 ++++----
 source4/rpc_server/dcerpc_server.c              |  4 ++--
 source4/rpc_server/dnsserver/dcerpc_dnsserver.c |  4 ++--
 source4/rpc_server/dnsserver/dnsdata.c          |  2 +-
 source4/torture/local/nss_tests.c               |  4 ++--
 source4/torture/raw/qfileinfo.c                 |  6 +++---
 source4/torture/raw/qfsinfo.c                   |  6 +++---
 source4/torture/rpc/spoolss.c                   |  2 +-
 source4/utils/oLschema2ldif.c                   |  2 +-
 43 files changed, 108 insertions(+), 90 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index b90d27e..e23b568 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -216,7 +216,8 @@ static int fold_string(int (*fprintf_fn)(void *, const char *, ...), void *priva
 			const char *buf, size_t length, int start_pos)
 {
 	size_t i;
-	int total=0, ret;
+	size_t total = 0;
+	int ret;
 
 	for (i=0;i<length;i++) {
 		ret = fprintf_fn(private_data, "%c", buf[i]);
@@ -280,7 +281,8 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
 {
 	TALLOC_CTX *mem_ctx;
 	unsigned int i, j;
-	int total=0, ret;
+	size_t total = 0;
+	int ret;
 	char *p;
 	const struct ldb_message *msg;
 	const char * const * secret_attributes = ldb_get_opaque(ldb, LDB_SECRET_ATTRIBUTE_LIST_OPAQUE);
diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
index 6409275..168bff5 100644
--- a/lib/socket/interfaces.c
+++ b/lib/socket/interfaces.c
@@ -367,7 +367,10 @@ int get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces)
 	int total, i, j;
 
 	total = _get_interfaces(mem_ctx, &ifaces);
-	if (total <= 0) return total;
+	/* If we have an error, no interface or just one we can leave */
+	if (total <= 1) {
+		return total;
+	}
 
 	/* now we need to remove duplicates */
 	TYPESAFE_QSORT(ifaces, total, iface_comp);
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index e9fdc1d..fbf2441 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -1914,7 +1914,7 @@ static NTSTATUS smb1cli_inbuf_parse_chain(uint8_t *buf, TALLOC_CTX *mem_ctx,
 					  struct iovec **piov, int *pnum_iov)
 {
 	struct iovec *iov;
-	int num_iov;
+	size_t num_iov;
 	size_t buflen;
 	size_t taken;
 	size_t remaining;
@@ -3470,7 +3470,8 @@ static NTSTATUS smb2cli_inbuf_parse_compound(struct smbXcli_conn *conn,
 					     uint8_t *buf,
 					     size_t buflen,
 					     TALLOC_CTX *mem_ctx,
-					     struct iovec **piov, int *pnum_iov)
+					     struct iovec **piov,
+					     size_t *pnum_iov)
 {
 	struct iovec *iov;
 	int num_iov = 0;
@@ -3656,7 +3657,7 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
 	struct tevent_req *req;
 	struct smbXcli_req_state *state = NULL;
 	struct iovec *iov = NULL;
-	int i, num_iov = 0;
+	size_t i, num_iov = 0;
 	NTSTATUS status;
 	bool defer = true;
 	struct smbXcli_session *last_session = NULL;
diff --git a/source3/client/client.c b/source3/client/client.c
index ad10a53..49d027a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5607,9 +5607,9 @@ static struct {
 
 static int process_tok(char *tok)
 {
-	int i = 0, matches = 0;
-	int cmd=0;
-	int tok_len = strlen(tok);
+	size_t i = 0, matches = 0;
+	size_t cmd=0;
+	size_t tok_len = strlen(tok);
 
 	while (commands[i].fn != NULL) {
 		if (strequal(commands[i].name,tok)) {
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index cfb09a7..82f118a 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -336,10 +336,10 @@ int kerberos_kinit_password(const char *principal,
 
 ************************************************************************/
 
-static void add_sockaddr_unique(struct sockaddr_storage *addrs, int *num_addrs,
+static void add_sockaddr_unique(struct sockaddr_storage *addrs, size_t *num_addrs,
 				const struct sockaddr_storage *addr)
 {
-	int i;
+	size_t i;
 
 	for (i=0; i<*num_addrs; i++) {
 		if (sockaddr_equal((const struct sockaddr *)&addrs[i],
@@ -382,12 +382,12 @@ static char *get_kdc_ip_string(char *mem_ctx,
 		const struct sockaddr_storage *pss)
 {
 	TALLOC_CTX *frame = talloc_stackframe();
-	int i;
+	size_t i;
 	struct ip_service *ip_srv_site = NULL;
 	struct ip_service *ip_srv_nonsite = NULL;
 	int count_site = 0;
 	int count_nonsite;
-	int num_dcs;
+	size_t num_dcs;
 	struct sockaddr_storage *dc_addrs;
 	struct tsocket_address **dc_addrs2 = NULL;
 	const struct tsocket_address * const *dc_addrs3 = NULL;
@@ -448,7 +448,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
 				      struct tsocket_address *,
 				      num_dcs);
 
-	DEBUG(10, ("%d additional KDCs to test\n", num_dcs));
+	DBG_DEBUG("%zu additional KDCs to test\n", num_dcs);
 	if (num_dcs == 0) {
 		goto out;
 	}
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 5bfc129..ef6177e 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -176,11 +176,11 @@ static bool handle_name_ptrs(unsigned char *ubuf,int *offset,int length,
 
 static int parse_nmb_name(char *inbuf,int ofs,int length, struct nmb_name *name)
 {
-	int m,n=0;
+	size_t m,n=0;
 	unsigned char *ubuf = (unsigned char *)inbuf;
 	int ret = 0;
 	bool got_pointer=False;
-	int loop_count=0;
+	size_t loop_count=0;
 	int offset = ofs;
 
 	if (length - offset < 2)
@@ -483,7 +483,7 @@ static int put_compressed_name_ptr(unsigned char *buf,
 
 static bool parse_dgram(char *inbuf,int length,struct dgram_packet *dgram)
 {
-	int offset;
+	size_t offset;
 	int flags;
 
 	memset((char *)dgram,'\0',sizeof(*dgram));
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index ff79428..0b627aa 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -145,7 +145,8 @@ static bool posix_lock_in_range(off_t *offset_out, off_t *count_out,
 	 * Truncate count to end at max lock offset.
 	 */
 
-	if (offset + count < 0 || offset + count > max_positive_lock_offset) {
+	if (offset > INT64_MAX - count ||
+	    offset + count > max_positive_lock_offset) {
 		count = max_positive_lock_offset - offset;
 	}
 
diff --git a/source3/modules/getdate.c b/source3/modules/getdate.c
index 2879bc8..7a5d68e 100644
--- a/source3/modules/getdate.c
+++ b/source3/modules/getdate.c
@@ -2492,7 +2492,7 @@ static int
 yylex (YYSTYPE *lvalp, parser_control *pc)
 {
   unsigned char c;
-  int count;
+  size_t count;
 
   for (;;)
     {
diff --git a/source3/modules/getdate.y b/source3/modules/getdate.y
index 1ddcda4..2e49f15 100644
--- a/source3/modules/getdate.y
+++ b/source3/modules/getdate.y
@@ -790,7 +790,7 @@ static int
 yylex (YYSTYPE *lvalp, parser_control *pc)
 {
   unsigned char c;
-  int count;
+  size_t count;
 
   for (;;)
     {
diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c
index 206c3b6..3085cf4 100644
--- a/source3/modules/vfs_netatalk.c
+++ b/source3/modules/vfs_netatalk.c
@@ -118,7 +118,7 @@ static int atalk_unlink_file(const char *path)
 
 static void atalk_add_to_list(name_compare_entry **list)
 {
-	int i, count = 0;
+	size_t i, count = 0;
 	name_compare_entry *new_list = 0;
 	name_compare_entry *cur_list = 0;
 
diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c
index aac00c7..b6a63d3 100644
--- a/source3/modules/vfs_preopen.c
+++ b/source3/modules/vfs_preopen.c
@@ -156,7 +156,7 @@ static bool preopen_helper_open_one(int sock_fd, char **pnamebuf,
 
 	nread = 0;
 
-	while ((nread == 0) || (namebuf[nread-1] != '\0')) {
+	do {
 		ssize_t thistime;
 
 		thistime = read(sock_fd, namebuf + nread,
@@ -176,7 +176,7 @@ static bool preopen_helper_open_one(int sock_fd, char **pnamebuf,
 			}
 			*pnamebuf = namebuf;
 		}
-	}
+	} while (namebuf[nread - 1] != '\0');
 
 	fd = open(namebuf, O_RDONLY);
 	if (fd == -1) {
diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c
index b1517f8..6f90e61 100644
--- a/source3/nmbd/nmbd_browsesync.c
+++ b/source3/nmbd/nmbd_browsesync.c
@@ -629,7 +629,7 @@ void sync_all_dmbs(time_t t)
 {
 	static time_t lastrun = 0;
 	struct work_record *work;
-	int count=0;
+	size_t count=0;
 
 	/* Only do this if we are using a WINS server. */
 	if(we_are_a_wins_client() == False)
diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c
index 1d557c4..44d67e7 100644
--- a/source3/nmbd/nmbd_sendannounce.c
+++ b/source3/nmbd/nmbd_sendannounce.c
@@ -288,8 +288,10 @@ void announce_my_server_names(time_t t)
 			}
 
 			/* Announce every minute at first then progress to every 12 mins */
-			if ((t - work->lastannounce_time) < work->announce_interval)
+			if (t > work->lastannounce_time &&
+			    (t - work->lastannounce_time) < work->announce_interval) {
 				continue;
+			}
 
 			if (work->announce_interval < (CHECK_TIME_MAX_HOST_ANNCE * 60))
 				work->announce_interval += 60;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index b1b502c..520d066 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1833,8 +1833,8 @@ static bool is_synonym_of(int parm1, int parm2, bool *inverse)
 
 static void show_parameter(int parmIndex)
 {
-	int enumIndex, flagIndex;
-	int parmIndex2;
+	size_t enumIndex, flagIndex;
+	size_t parmIndex2;
 	bool hadFlag;
 	bool hadSyn;
 	bool inverse;
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index c495448..bf9377c 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -4103,7 +4103,8 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
 	LDAPMessage *msg = NULL;
 	LDAPMessage *entry;
 	char *allsids = NULL;
-	int i, rc, num_mapped;
+	size_t i, num_mapped;
+	int rc;
 	NTSTATUS result = NT_STATUS_NO_MEMORY;
 	TALLOC_CTX *mem_ctx;
 	LDAP *ld;
diff --git a/source3/printing/printing_db.c b/source3/printing/printing_db.c
index 1a129ea..7465195 100644
--- a/source3/printing/printing_db.c
+++ b/source3/printing/printing_db.c
@@ -35,7 +35,7 @@ static struct tdb_print_db *print_db_head;
 struct tdb_print_db *get_print_db_byname(const char *printername)
 {
 	struct tdb_print_db *p = NULL, *last_entry = NULL;
-	int num_open = 0;
+	size_t num_open = 0;
 	char *printdb_path = NULL;
 	bool done_become_root = False;
 	char *print_cache_path;
diff --git a/source3/registry/reg_format.c b/source3/registry/reg_format.c
index 15f63c7..36ccb62 100644
--- a/source3/registry/reg_format.c
+++ b/source3/registry/reg_format.c
@@ -54,16 +54,17 @@ static void cstr_unescape(char* val)
  * @see srprs_val_name
  */
 static int cbuf_print_value_assign(cbuf* ost, const char* name) {
-	int ret, n;
+	size_t ret = 0;
+	int n;
 	if (*name == '\0') {
-		ret = cbuf_putc(ost, '@');
+		n = cbuf_putc(ost, '@');
 	} else {
-		ret = cbuf_print_quoted_string(ost, name);
+		n = cbuf_print_quoted_string(ost, name);
 	}
-
-	if (ret<0) {
-		return ret;
+	if (n < 0) {
+		return n;
 	}
+	ret += n;
 
 	n = cbuf_putc(ost, '=');
 	if (n < 0) {
@@ -120,7 +121,8 @@ cbuf_print_hive(cbuf* ost, const char* hive, int len, const struct fmt_key* fmt)
 static int
 cbuf_print_keyname(cbuf* ost, const char* key[], int n, const struct fmt_key* fmt)
 {
-	int r, ret=0;
+	int r;
+	size_t ret = 0;
 	size_t pos = cbuf_getpos(ost);
 	bool hive = true;
 
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index c9ea400..2f42e6d 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -1090,13 +1090,13 @@ static int build_notify2_messages(TALLOC_CTX *mem_ctx,
 				  SPOOLSS_NOTIFY_MSG *messages,
 				  uint32_t num_msgs,
 				  struct spoolss_Notify **_notifies,
-				  int *_count)
+				  size_t *_count)
 {
 	struct spoolss_Notify *notifies;
 	SPOOLSS_NOTIFY_MSG *msg;
-	int count = 0;
+	size_t count = 0;
 	uint32_t id;
-	int i;
+	uint32_t i;
 
 	notifies = talloc_zero_array(mem_ctx,
 				     struct spoolss_Notify, num_msgs);
@@ -1189,7 +1189,7 @@ static int send_notify2_printer(TALLOC_CTX *mem_ctx,
 				SPOOLSS_NOTIFY_MSG_GROUP *msg_group)
 {
 	struct spoolss_Notify *notifies;
-	int count = 0;
+	size_t count = 0;
 	union spoolss_ReplyPrinterInfo info;
 	struct spoolss_NotifyInfo info0;
 	uint32_t reply_result;
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 6536e3d..2c33387b 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -548,13 +548,13 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
 				      uint32_t *total_entries,
 				      bool all_shares)
 {
-	int num_entries = 0;
-	int alloc_entries = 0;
+	uint32_t num_entries = 0;
+	uint32_t alloc_entries = 0;
 	int num_services = 0;
 	int snum;
 	TALLOC_CTX *ctx = p->mem_ctx;
-	int i = 0;
-	int valid_share_count = 0;
+	uint32_t i = 0;
+	uint32_t valid_share_count = 0;
 	bool *allowed = 0;
 	union srvsvc_NetShareCtr ctr;
 	uint32_t resume_handle = resume_handle_p ? *resume_handle_p : 0;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 4eb1e14..b4e25e6 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -73,7 +73,7 @@ static char **completion_fn(const char *text, int start, int end)
 {
 #define MAX_COMPLETIONS 1000
 	char **matches;
-	int i, count=0;
+	size_t i, count=0;
 	struct cmd_list *commands = cmd_list;
 
 #if 0	/* JERRY */
diff --git a/source3/smbd/avahi_register.c b/source3/smbd/avahi_register.c
index 50462b5..6c87669 100644
--- a/source3/smbd/avahi_register.c
+++ b/source3/smbd/avahi_register.c
@@ -108,7 +108,7 @@ static void avahi_client_callback(AvahiClient *c, AvahiClientState status,
 	case AVAHI_CLIENT_S_RUNNING: {
 		int snum;
 		int num_services = lp_numservices();
-		int dk = 0;
+		size_t dk = 0;
 		AvahiStringList *adisk = NULL;
 		AvahiStringList *adisk2 = NULL;
 		const char *hostname = NULL;
@@ -154,7 +154,7 @@ static void avahi_client_callback(AvahiClient *c, AvahiClientState status,
 			    lp_parm_bool(snum, "fruit", "time machine", false))
 			{
 				adisk2 = avahi_string_list_add_printf(
-					    adisk, "dk%d=adVN=%s,adVF=0x82",
+					    adisk, "dk%zu=adVN=%s,adVF=0x82",
 					    dk++, lp_const_servicename(snum));
 				if (adisk2 == NULL) {
 					DBG_DEBUG("avahi_string_list_add_printf"
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 4480ec3..2ed7175 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -2028,24 +2028,29 @@ static int files_below_forall_fn(struct file_id fid,
 		/*
 		 * Filter files above dirpath
 		 */
-		return 0;
+		goto out;
 	}
 	if (fullpath[state->dirpath_len] != '/') {
 		/*
 		 * Filter file that don't have a path separator at the end of
 		 * dirpath's length
 		 */
-		return 0;
+		goto out;
 	}
 
 	if (memcmp(state->dirpath, fullpath, state->dirpath_len) != 0) {
 		/*
 		 * Not a parent
 		 */
-		return 0;
+		goto out;
 	}
 
+	TALLOC_FREE(to_free);
 	return state->fn(fid, data, state->private_data);
+
+out:
+	TALLOC_FREE(to_free);
+	return 0;
 }
 
 static int files_below_forall(connection_struct *conn,
diff --git a/source3/utils/log2pcaphex.c b/source3/utils/log2pcaphex.c
index f31efa1..5310982 100644
--- a/source3/utils/log2pcaphex.c
+++ b/source3/utils/log2pcaphex.c
@@ -305,7 +305,7 @@ int main(int argc, const char **argv)
 	long data_offset = 0;
 	long data_length;
 	long data_bytes_read = 0;
-	int in_packet = 0;
+	size_t in_packet = 0;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
 		{ "quiet", 'q', POPT_ARG_NONE, &quiet, 0, "Be quiet, don't output warnings" },
diff --git a/source3/winbindd/idmap_tdb_common.c b/source3/winbindd/idmap_tdb_common.c
index e873b60..48d87bb 100644
--- a/source3/winbindd/idmap_tdb_common.c
+++ b/source3/winbindd/idmap_tdb_common.c
@@ -307,7 +307,7 @@ NTSTATUS idmap_tdb_common_unixids_to_sids(struct idmap_domain * dom,
 					  struct id_map ** ids)
 {
 	NTSTATUS ret;
-	int i, num_mapped = 0;
+	size_t i, num_mapped = 0;
 	struct idmap_tdb_common_context *ctx;
 
 	NTSTATUS(*unixid_to_sid_fn) (struct idmap_domain * dom,
@@ -543,7 +543,7 @@ static NTSTATUS idmap_tdb_common_sids_to_unixids_action(struct db_context *db,
 							void *private_data)
 {
 	struct idmap_tdb_common_sids_to_unixids_context *state = private_data;
-	int i, num_mapped = 0;
+	size_t i, num_mapped = 0;
 	NTSTATUS ret = NT_STATUS_OK;
 
 	DEBUG(10, ("idmap_tdb_common_sids_to_unixids: "


-- 
Samba Shared Repository



More information about the samba-cvs mailing list