summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-17 09:20:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:34 -0500
commite835621799647ee70630b389fb53d15b15d68355 (patch)
tree429a4ab67cf53f2853ba93f4628b63cd5aac2b02
parentccc65fb995154451537879b57b900b8b4e340bd2 (diff)
downloadsamba-e835621799647ee70630b389fb53d15b15d68355.tar.gz
r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the automatic builds. The main fixes are: - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats - use of NULL format statements to perform dn searches. - assumption that sizeof() returns an int (This used to be commit a58ea6b3854973b694d2b1e22323ed7eb00e3a3f)
-rw-r--r--source4/auth/auth.c4
-rw-r--r--source4/auth/gensec/gensec_gssapi.c3
-rw-r--r--source4/auth/gensec/gensec_krb5.c3
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c10
-rw-r--r--source4/client/client.c4
-rw-r--r--source4/dsdb/samdb/samdb.c7
-rw-r--r--source4/kdc/hdb-ldb.c9
-rw-r--r--source4/kdc/kdc.c2
-rw-r--r--source4/ldap_server/ldap_hacked_ldb.c3
-rw-r--r--source4/ldap_server/ldap_simple_ldb.c3
-rw-r--r--source4/lib/charcnv.c5
-rw-r--r--source4/lib/gendb.c2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c2
-rw-r--r--source4/lib/messaging/messaging.c7
-rw-r--r--source4/lib/registry/reg_backend_nt4.c2
-rw-r--r--source4/lib/util_file.c2
-rw-r--r--source4/lib/util_str.c6
-rw-r--r--source4/libcli/auth/session.c2
-rw-r--r--source4/libcli/cldap/cldap.c4
-rw-r--r--source4/libcli/dgram/browse.c2
-rw-r--r--source4/libcli/dgram/dgramsocket.c4
-rw-r--r--source4/libcli/dgram/netlogon.c2
-rw-r--r--source4/libcli/dgram/ntlogon.c2
-rw-r--r--source4/libcli/nbt/nbtname.c2
-rw-r--r--source4/libcli/nbt/nbtsocket.c2
-rw-r--r--source4/libcli/raw/rawfileinfo.c4
-rw-r--r--source4/libcli/raw/rawfsinfo.c4
-rw-r--r--source4/libcli/raw/rawsearch.c4
-rw-r--r--source4/libcli/raw/rawtrans.c2
-rw-r--r--source4/libcli/wins/winsrepl.c6
-rw-r--r--source4/librpc/ndr/ndr_basic.c2
-rw-r--r--source4/librpc/ndr/ndr_compression.c2
-rw-r--r--source4/librpc/ndr/ndr_spoolss_buf.c8
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c2
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c6
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c14
-rw-r--r--source4/scripting/ejs/smbcalls_cli.c2
-rw-r--r--source4/torture/auth/ntlmssp.c6
-rw-r--r--source4/torture/auth/pac.c4
-rw-r--r--source4/torture/basic/aliases.c4
-rw-r--r--source4/torture/basic/delaywrite.c19
-rw-r--r--source4/torture/basic/denytest.c2
-rw-r--r--source4/torture/basic/locking.c3
-rw-r--r--source4/torture/basic/utable.c2
-rw-r--r--source4/torture/ldap/basic.c6
-rw-r--r--source4/torture/local/iconv.c12
-rw-r--r--source4/torture/local/idtree.c2
-rw-r--r--source4/torture/local/socket.c8
-rw-r--r--source4/torture/nbt/register.c2
-rw-r--r--source4/torture/raw/composite.c4
-rw-r--r--source4/torture/raw/context.c4
-rw-r--r--source4/torture/raw/qfileinfo.c4
-rw-r--r--source4/torture/raw/streams.c4
-rw-r--r--source4/torture/rpc/autoidl.c4
-rw-r--r--source4/torture/rpc/samsync.c4
-rw-r--r--source4/torture/torture.c6
-rw-r--r--source4/torture/torture_util.c4
-rw-r--r--source4/utils/ndrdump.c2
-rw-r--r--source4/web_server/http.c2
59 files changed, 142 insertions, 116 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c
index dab1912d8e0..d05aa54e50a 100644
--- a/source4/auth/auth.c
+++ b/source4/auth/auth.c
@@ -74,7 +74,7 @@ NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, const uint8_t **_chal
if (challenge.length != 8) {
DEBUG(0, ("auth_get_challenge: invalid challenge (length %u) by mothod [%s]\n",
- challenge.length, method->ops->name));
+ (unsigned)challenge.length, method->ops->name));
return NT_STATUS_INTERNAL_ERROR;
}
@@ -148,7 +148,7 @@ NTSTATUS auth_check_password(struct auth_context *auth_ctx,
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("auth_check_password: Invalid challenge (length %u) stored for this auth context set_by %s - cannot continue: %s\n",
- auth_ctx->challenge.data.length, auth_ctx->challenge.set_by, nt_errstr(nt_status)));
+ (unsigned)auth_ctx->challenge.data.length, auth_ctx->challenge.set_by, nt_errstr(nt_status)));
return nt_status;
}
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index e6049edc585..a080e75d5cc 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -714,7 +714,8 @@ static NTSTATUS gensec_gssapi_session_key(struct gensec_security *gensec_securit
&skey);
if (maj_stat == 0) {
- DEBUG(10, ("Got KRB5 session key of length %d\n", skey.length));
+ DEBUG(10, ("Got KRB5 session key of length %d\n",
+ (int)skey.length));
gensec_gssapi_state->session_key = data_blob_talloc(gensec_gssapi_state,
skey.value, skey.length);
*session_key = gensec_gssapi_state->session_key;
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index a1a4886af9c..76f91717135 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -407,7 +407,8 @@ static NTSTATUS gensec_krb5_session_key(struct gensec_security *gensec_security,
break;
}
if (err == 0 && skey != NULL) {
- DEBUG(10, ("Got KRB5 session key of length %d\n", KRB5_KEY_LENGTH(skey)));
+ DEBUG(10, ("Got KRB5 session key of length %d\n",
+ (int)KRB5_KEY_LENGTH(skey)));
gensec_krb5_state->session_key = data_blob_talloc(gensec_krb5_state,
KRB5_KEY_DATA(skey), KRB5_KEY_LENGTH(skey));
*session_key = gensec_krb5_state->session_key;
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index e50fe58305d..5885db8decc 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -531,11 +531,11 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
|| gensec_ntlmssp_state->encrypted_session_key.length != 16) {
data_blob_free(&gensec_ntlmssp_state->encrypted_session_key);
DEBUG(1, ("Client-supplied KEY_EXCH session key was of invalid length (%u)!\n",
- gensec_ntlmssp_state->encrypted_session_key.length));
+ (unsigned)gensec_ntlmssp_state->encrypted_session_key.length));
return NT_STATUS_INVALID_PARAMETER;
} else if (!session_key.data || session_key.length != 16) {
DEBUG(5, ("server session key is invalid (len == %u), cannot do KEY_EXCH!\n",
- session_key.length));
+ (unsigned)session_key.length));
gensec_ntlmssp_state->session_key = session_key;
} else {
dump_data_pw("KEY_EXCH session key (enc):\n",
@@ -705,13 +705,15 @@ static NTSTATUS auth_ntlmssp_check_password(struct gensec_ntlmssp_state *gensec_
NT_STATUS_NOT_OK_RETURN(nt_status);
if (gensec_ntlmssp_state->server_info->user_session_key.length) {
- DEBUG(10, ("Got NT session key of length %u\n", gensec_ntlmssp_state->server_info->user_session_key.length));
+ DEBUG(10, ("Got NT session key of length %u\n",
+ (unsigned)gensec_ntlmssp_state->server_info->user_session_key.length));
*user_session_key = data_blob_talloc(gensec_ntlmssp_state,
gensec_ntlmssp_state->server_info->user_session_key.data,
gensec_ntlmssp_state->server_info->user_session_key.length);
}
if (gensec_ntlmssp_state->server_info->lm_session_key.length) {
- DEBUG(10, ("Got LM session key of length %u\n", gensec_ntlmssp_state->server_info->lm_session_key.length));
+ DEBUG(10, ("Got LM session key of length %u\n",
+ (unsigned)gensec_ntlmssp_state->server_info->lm_session_key.length));
*lm_session_key = data_blob_talloc(gensec_ntlmssp_state,
gensec_ntlmssp_state->server_info->lm_session_key.data,
gensec_ntlmssp_state->server_info->lm_session_key.length);
diff --git a/source4/client/client.c b/source4/client/client.c
index c1f5ab9b34c..3e6609e68e4 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1916,7 +1916,7 @@ static int cmd_allinfo(const char **cmd_ptr)
for (i=0;i<finfo.all_eas.out.num_eas;i++) {
d_printf("\tEA[%d] flags=%d len=%d '%s'\n", i,
finfo.all_eas.out.eas[i].flags,
- finfo.all_eas.out.eas[i].value.length,
+ (int)finfo.all_eas.out.eas[i].value.length,
finfo.all_eas.out.eas[i].name.s);
}
}
@@ -1992,7 +1992,7 @@ static int cmd_eainfo(const char **cmd_ptr)
for (i=0;i<finfo.all_eas.out.num_eas;i++) {
d_printf("\tEA[%d] flags=%d len=%d '%s'\n", i,
finfo.all_eas.out.eas[i].flags,
- finfo.all_eas.out.eas[i].value.length,
+ (int)finfo.all_eas.out.eas[i].value.length,
finfo.all_eas.out.eas[i].name.s);
fflush(stdout);
dump_data(0,
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index f51d3c6102f..fd542c5567f 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -421,7 +421,7 @@ NTTIME samdb_result_allow_password_change(struct ldb_context *sam_ldb,
}
minPwdAge = samdb_search_int64(sam_ldb, mem_ctx, 0,
- domain_dn, "minPwdAge", NULL);
+ domain_dn, "minPwdAge", "dn=%s", domain_dn);
/* yes, this is a -= not a += as minPwdAge is stored as the negative
of the number of 100-nano-seconds */
@@ -447,7 +447,8 @@ NTTIME samdb_result_force_password_change(struct ldb_context *sam_ldb,
return 0;
}
- maxPwdAge = samdb_search_int64(sam_ldb, mem_ctx, 0, domain_dn, "maxPwdAge", NULL);
+ maxPwdAge = samdb_search_int64(sam_ldb, mem_ctx, 0, domain_dn,
+ "maxPwdAge", "dn=%s", domain_dn);
if (maxPwdAge == 0) {
return 0;
} else {
@@ -655,7 +656,7 @@ static NTSTATUS _samdb_allocate_next_id(struct ldb_context *sam_ldb, TALLOC_CTX
struct ldb_val vals[2];
struct ldb_message_element els[2];
- str = samdb_search_string(sam_ldb, mem_ctx, dn, attr, NULL);
+ str = samdb_search_string(sam_ldb, mem_ctx, dn, attr, "dn=%s", dn);
if (!str) {
DEBUG(1,("id not found at %s %s\n", dn, attr));
return NT_STATUS_OBJECT_NAME_INVALID;
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index af93ea8f72f..444382f2a03 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -360,12 +360,14 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
}
if (ret == 0) {
+ size_t num_keys = ent->keys.len;
/*
* create keys from unicodePwd
*/
ret = hdb_generate_key_set_password(context, salt_principal,
- unicodePwd,
- &ent->keys.val, &ent->keys.len);
+ unicodePwd,
+ &ent->keys.val, &num_keys);
+ ent->keys.len = num_keys;
krb5_free_principal(context, salt_principal);
}
@@ -387,7 +389,8 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
} else if (val->length < 16) {
ent->keys.val = NULL;
ent->keys.len = 0;
- krb5_warnx(context, "ntPwdHash has invalid length: %d\n",val->length);
+ krb5_warnx(context, "ntPwdHash has invalid length: %d\n",
+ (int)val->length);
} else {
ret = krb5_data_alloc (&keyvalue, 16);
if (ret) {
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index 1540e0f4a19..810e6cf9ba1 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -97,7 +97,7 @@ static void kdc_recv_handler(struct kdc_socket *kdc_socket)
blob.length = nread;
DEBUG(2,("Received krb5 packet of length %d from %s:%d\n",
- blob.length, src_addr, src_port));
+ (int)blob.length, src_addr, src_port));
/* TODO: This really should be in a utility function somewhere */
ZERO_STRUCT(src_sock_addr);
diff --git a/source4/ldap_server/ldap_hacked_ldb.c b/source4/ldap_server/ldap_hacked_ldb.c
index c7a5f6d1a21..44f75c23766 100644
--- a/source4/ldap_server/ldap_hacked_ldb.c
+++ b/source4/ldap_server/ldap_hacked_ldb.c
@@ -896,7 +896,8 @@ static NTSTATUS hldb_Compare(struct ldapsrv_partition *partition, struct ldapsrv
VALID_DN_SYNTAX(dn,1);
DEBUG(10, ("hldb_Compare: dn: [%s]\n", dn->dn));
- filter = talloc_asprintf(local_ctx, "(%s=%*s)", r->attribute, r->value.length, r->value.data);
+ filter = talloc_asprintf(local_ctx, "(%s=%*s)", r->attribute,
+ (int)r->value.length, r->value.data);
NT_STATUS_HAVE_NO_MEMORY(filter);
DEBUGADD(10, ("hldb_Compare: attribute: [%s]\n", filter));
diff --git a/source4/ldap_server/ldap_simple_ldb.c b/source4/ldap_server/ldap_simple_ldb.c
index 4403ec8ea29..7a8f6648989 100644
--- a/source4/ldap_server/ldap_simple_ldb.c
+++ b/source4/ldap_server/ldap_simple_ldb.c
@@ -455,7 +455,8 @@ static NTSTATUS sldb_Compare(struct ldapsrv_partition *partition, struct ldapsrv
VALID_DN_SYNTAX(dn,1);
DEBUG(10, ("sldb_Compare: dn: [%s]\n", dn->dn));
- filter = talloc_asprintf(local_ctx, "(%s=%*s)", r->attribute, r->value.length, r->value.data);
+ filter = talloc_asprintf(local_ctx, "(%s=%*s)", r->attribute,
+ (int)r->value.length, r->value.data);
NT_STATUS_HAVE_NO_MEMORY(filter);
DEBUGADD(10, ("sldb_Compare: attribute: [%s]\n", filter));
diff --git a/source4/lib/charcnv.c b/source4/lib/charcnv.c
index ea0fcd8d32f..e6327901556 100644
--- a/source4/lib/charcnv.c
+++ b/source4/lib/charcnv.c
@@ -175,11 +175,12 @@ ssize_t convert_string(charset_t from, charset_t to,
if (from == CH_UNIX) {
DEBUG(0,("E2BIG: convert_string(%s,%s): srclen=%d destlen=%d - '%s'\n",
charset_name(from), charset_name(to),
- srclen, destlen, (const char *)src));
+ (int)srclen, (int)destlen,
+ (const char *)src));
} else {
DEBUG(0,("E2BIG: convert_string(%s,%s): srclen=%d destlen=%d\n",
charset_name(from), charset_name(to),
- srclen, destlen));
+ (int)srclen, (int)destlen));
}
break;
case EILSEQ:
diff --git a/source4/lib/gendb.c b/source4/lib/gendb.c
index 92bbd8155ca..4bf76a7f646 100644
--- a/source4/lib/gendb.c
+++ b/source4/lib/gendb.c
@@ -89,7 +89,7 @@ int gendb_search_dn(struct ldb_context *ldb,
struct ldb_message ***res,
const char * const *attrs)
{
- return gendb_search(ldb, mem_ctx, dn, res, attrs, NULL);
+ return gendb_search(ldb, mem_ctx, dn, res, attrs, "dn=%s", dn);
}
/*
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 03ad0612d4b..87b52ac3665 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -131,7 +131,7 @@ static char *ldb_dn_key(struct ldb_context *ldb,
}
ret = talloc_asprintf(ldb, "%s:%s:%.*s",
- LTDB_INDEX, attr_folded, v.length, (char *)v.data);
+ LTDB_INDEX, attr_folded, (int)v.length, (char *)v.data);
if (v.data != value->data) {
talloc_free(v.data);
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index a29f14f0659..4f1589a9ba1 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -93,7 +93,8 @@ static void ping_message(struct messaging_context *msg, void *private,
uint32_t msg_type, uint32_t src, DATA_BLOB *data)
{
DEBUG(1,("INFO: Received PING message from server %u [%.*s]\n",
- (uint_t)src, data->length, data->data?(const char *)data->data:""));
+ (uint_t)src, (int)data->length,
+ data->data?(const char *)data->data:""));
messaging_send(msg, src, MSG_PONG, data);
}
@@ -198,7 +199,7 @@ static void messaging_recv_handler(struct messaging_context *msg)
}
if (msize < sizeof(*rec->header)) {
- DEBUG(0,("messaging: bad message of size %d\n", msize));
+ DEBUG(0,("messaging: bad message of size %d\n", (int)msize));
data_blob_free(&packet);
return;
}
@@ -216,7 +217,7 @@ static void messaging_recv_handler(struct messaging_context *msg)
if (msize != sizeof(*rec->header) + rec->header->length) {
DEBUG(0,("messaging: bad message header size %d should be %d\n",
- rec->header->length, msize - sizeof(*rec->header)));
+ rec->header->length, (int)(msize - sizeof(*rec->header))));
talloc_free(rec);
return;
}
diff --git a/source4/lib/registry/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4.c
index 6072222a87b..e07534884ce 100644
--- a/source4/lib/registry/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4.c
@@ -1051,7 +1051,7 @@ static WERROR nk_to_key(TALLOC_CTX *mem_ctx, struct registry_hive *h, NK_HDR *nk
if (-size < (sizeof(NK_HDR) - 1 + namlen)) {
DEBUG(0, ("Incorrect NK_HDR size: %d, %0X\n", -size, (int)nk_hdr));
DEBUG(0, ("Sizeof NK_HDR: %d, name_len %d, clsname_len %d\n",
- sizeof(NK_HDR), namlen, clsname_len));
+ (int)sizeof(NK_HDR), namlen, clsname_len));
return WERR_GENERAL_FAILURE;
}
diff --git a/source4/lib/util_file.c b/source4/lib/util_file.c
index a7d29d1a1dc..fdf06c47c5d 100644
--- a/source4/lib/util_file.c
+++ b/source4/lib/util_file.c
@@ -258,7 +258,7 @@ void *map_file(char *fname, size_t size)
if (!p) return NULL;
if (s2 != size) {
DEBUG(1,("incorrect size for %s - got %d expected %d\n",
- fname, s2, size));
+ fname, (int)s2, (int)size));
talloc_free(p);
return NULL;
}
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index 592c38e53c2..a0e9da41601 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -274,7 +274,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength)
if (len > maxlength) {
DEBUG(0,("ERROR: string overflow by %u (%u - %u) in safe_strcpy [%.50s]\n",
- (uint_t)(len-maxlength), len, maxlength, src));
+ (uint_t)(len-maxlength), (unsigned)len, (unsigned)maxlength, src));
len = maxlength;
}
@@ -760,7 +760,7 @@ void strlower_m(char *s)
c_size2 = push_codepoint(d, tolower_w(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strlower_m\n",
- c, tolower_w(c), c_size, c_size2));
+ c, tolower_w(c), (int)c_size, (int)c_size2));
smb_panic("codepoint expansion in strlower_m\n");
}
s += c_size;
@@ -796,7 +796,7 @@ void strupper_m(char *s)
c_size2 = push_codepoint(d, toupper_w(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strupper_m\n",
- c, toupper_w(c), c_size, c_size2));
+ c, toupper_w(c), (int)c_size, (int)c_size2));
smb_panic("codepoint expansion in strupper_m\n");
}
s += c_size;
diff --git a/source4/libcli/auth/session.c b/source4/libcli/auth/session.c
index b32e1d724dc..22146cbfb3c 100644
--- a/source4/libcli/auth/session.c
+++ b/source4/libcli/auth/session.c
@@ -179,7 +179,7 @@ NTSTATUS sess_decrypt_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const DAT
if (blob->length < 8) {
DEBUG(0, ("Unexpected length %d in session crypted secret (BLOB)\n",
- blob->length));
+ (int)blob->length));
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 79cdff2437b..4ffa40d1349 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -93,7 +93,7 @@ static void cldap_socket_recv(struct cldap_socket *cldap)
blob.length = nread;
DEBUG(2,("Received cldap packet of length %d from %s:%d\n",
- blob.length, src_addr, src_port));
+ (int)blob.length, src_addr, src_port));
if (!asn1_load(&asn1, blob)) {
DEBUG(2,("Failed to setup for asn.1 decode\n"));
@@ -188,7 +188,7 @@ static void cldap_socket_send(struct cldap_socket *cldap)
req->dest_addr, req->dest_port);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(3,("Failed to send cldap request of length %u to %s:%d\n",
- req->encoded.length, req->dest_addr, req->dest_port));
+ (unsigned)req->encoded.length, req->dest_addr, req->dest_port));
DLIST_REMOVE(cldap->send_queue, req);
talloc_free(req);
continue;
diff --git a/source4/libcli/dgram/browse.c b/source4/libcli/dgram/browse.c
index d7707b7ec81..a304db9c9d4 100644
--- a/source4/libcli/dgram/browse.c
+++ b/source4/libcli/dgram/browse.c
@@ -89,7 +89,7 @@ NTSTATUS dgram_mailslot_browse_parse(struct dgram_mailslot_handler *dgmslot,
(ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to parse browse packet of length %d\n",
- data.length));
+ (int)data.length));
if (DEBUGLVL(10)) {
file_save("browse.dat", data.data, data.length);
}
diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c
index aff9d2e1825..e66e5ed52e5 100644
--- a/source4/libcli/dgram/dgramsocket.c
+++ b/source4/libcli/dgram/dgramsocket.c
@@ -64,7 +64,7 @@ static void dgm_socket_recv(struct nbt_dgram_socket *dgmsock)
blob.length = nread;
DEBUG(2,("Received dgram packet of length %d from %s:%d\n",
- blob.length, src_addr, src_port));
+ (int)blob.length, src_addr, src_port));
packet = talloc(tmp_ctx, struct nbt_dgram_packet);
if (packet == NULL) {
@@ -119,7 +119,7 @@ static void dgm_socket_send(struct nbt_dgram_socket *dgmsock)
req->dest_addr, req->dest_port);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(3,("Failed to send datagram of length %u to %s:%d\n",
- req->encoded.length, req->dest_addr, req->dest_port));
+ (unsigned)req->encoded.length, req->dest_addr, req->dest_port));
DLIST_REMOVE(dgmsock->send_queue, req);
talloc_free(req);
continue;
diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c
index 9d3a0dbed98..dda77689dee 100644
--- a/source4/libcli/dgram/netlogon.c
+++ b/source4/libcli/dgram/netlogon.c
@@ -106,7 +106,7 @@ NTSTATUS dgram_mailslot_netlogon_parse(struct dgram_mailslot_handler *dgmslot,
(ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to parse netlogon packet of length %d\n",
- data.length));
+ (int)data.length));
if (DEBUGLVL(10)) {
file_save("netlogon.dat", data.data, data.length);
}
diff --git a/source4/libcli/dgram/ntlogon.c b/source4/libcli/dgram/ntlogon.c
index e4a24b0591b..03d1266af0c 100644
--- a/source4/libcli/dgram/ntlogon.c
+++ b/source4/libcli/dgram/ntlogon.c
@@ -106,7 +106,7 @@ NTSTATUS dgram_mailslot_ntlogon_parse(struct dgram_mailslot_handler *dgmslot,
(ndr_pull_flags_fn_t)ndr_pull_nbt_ntlogon_packet);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to parse ntlogon packet of length %d\n",
- data.length));
+ (int)data.length));
if (DEBUGLVL(10)) {
file_save("ntlogon.dat", data.data, data.length);
}
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index 36ffdc9af67..d7f0b1b0772 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -171,7 +171,7 @@ NTSTATUS ndr_push_nbt_string(struct ndr_push *ndr, int ndr_flags, const char *s)
if (complen >= 0x3F) {
return ndr_push_error(ndr, NDR_ERR_STRING,
"component length %u[%08X] > 0x00003F",
- complen, complen);
+ (unsigned)complen, (unsigned)complen);
}
compname = talloc_asprintf(ndr, "%c%*.*s",
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index 0401e68af8d..f40ec84e77b 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -199,7 +199,7 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
if (DEBUGLVL(10)) {
DEBUG(10,("Received nbt packet of length %d from %s:%d\n",
- blob.length, src_addr, src_port));
+ (int)blob.length, src_addr, src_port));
NDR_PRINT_DEBUG(nbt_name_packet, packet);
}
diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c
index 9f7786429c2..ede4391824d 100644
--- a/source4/libcli/raw/rawfileinfo.c
+++ b/source4/libcli/raw/rawfileinfo.c
@@ -25,12 +25,12 @@
/* local macros to make the code more readable */
#define FINFO_CHECK_MIN_SIZE(size) if (blob->length < (size)) { \
DEBUG(1,("Unexpected FILEINFO reply size %d for level %u - expected min of %d\n", \
- blob->length, parms->generic.level, (size))); \
+ (int)blob->length, parms->generic.level, (size))); \
return NT_STATUS_INFO_LENGTH_MISMATCH; \
}
#define FINFO_CHECK_SIZE(size) if (blob->length != (size)) { \
DEBUG(1,("Unexpected FILEINFO reply size %d for level %u - expected %d\n", \
- blob->length, parms->generic.level, (size))); \
+ (int)blob->length, parms->generic.level, (size))); \
return NT_STATUS_INFO_LENGTH_MISMATCH; \
}
diff --git a/source4/libcli/raw/rawfsinfo.c b/source4/libcli/raw/rawfsinfo.c
index fd99c4aeb99..3daa1c0f53d 100644
--- a/source4/libcli/raw/rawfsinfo.c
+++ b/source4/libcli/raw/rawfsinfo.c
@@ -115,13 +115,13 @@ static NTSTATUS smb_raw_qfsinfo_blob_recv(struct smbcli_request *req,
/* local macros to make the code more readable */
#define QFS_CHECK_MIN_SIZE(size) if (blob.length < (size)) { \
DEBUG(1,("Unexpected QFS reply size %d for level %u - expected min of %d\n", \
- blob.length, fsinfo->generic.level, (size))); \
+ (int)blob.length, fsinfo->generic.level, (size))); \
status = NT_STATUS_INFO_LENGTH_MISMATCH; \
goto failed; \
}
#define QFS_CHECK_SIZE(size) if (blob.length != (size)) { \
DEBUG(1,("Unexpected QFS reply size %d for level %u - expected %d\n", \
- blob.length, fsinfo->generic.level, (size))); \
+ (int)blob.length, fsinfo->generic.level, (size))); \
status = NT_STATUS_INFO_LENGTH_MISMATCH; \
goto failed; \
}
diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c
index 90715ca8e27..a9b49c07a4f 100644
--- a/source4/libcli/raw/rawsearch.c
+++ b/source4/libcli/raw/rawsearch.c
@@ -643,7 +643,7 @@ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
if (p_blob.length < 10) {
DEBUG(1,("smb_raw_search_first: parms wrong size %d != expected_param_size\n",
- p_blob.length));
+ (int)p_blob.length));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -688,7 +688,7 @@ NTSTATUS smb_raw_search_next(struct smbcli_tree *tree,
if (p_blob.length != 8) {
DEBUG(1,("smb_raw_search_next: parms wrong size %d != expected_param_size\n",
- p_blob.length));
+ (int)p_blob.length));
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c
index b523232bc05..207b5bee083 100644
--- a/source4/libcli/raw/rawtrans.c
+++ b/source4/libcli/raw/rawtrans.c
@@ -219,7 +219,7 @@ struct smbcli_request *smb_raw_trans_send_backend(struct smbcli_tree *tree,
if (parms->in.params.length > UINT16_MAX ||
parms->in.data.length > UINT16_MAX) {
DEBUG(3,("Attempt to send invalid trans2 request (params %u, data %u)\n",
- parms->in.params.length, parms->in.data.length));
+ (unsigned)parms->in.params.length, (unsigned)parms->in.data.length));
return NULL;
}
diff --git a/source4/libcli/wins/winsrepl.c b/source4/libcli/wins/winsrepl.c
index 732b597c530..6b02cfb660e 100644
--- a/source4/libcli/wins/winsrepl.c
+++ b/source4/libcli/wins/winsrepl.c
@@ -162,13 +162,13 @@ static void wrepl_handler_recv(struct wrepl_socket *wrepl_socket)
if (!NT_STATUS_IS_OK(req->status)) {
DEBUG(2,("Failed to parse incoming WINS packet - %s\n",
nt_errstr(req->status)));
- DEBUG(10,("packet length %d\n", req->buffer.length));
+ DEBUG(10,("packet length %d\n", (int)req->buffer.length));
NDR_PRINT_DEBUG(wrepl_packet, req->packet);
goto failed;
}
if (DEBUGLVL(10)) {
- DEBUG(10,("Received WINS packet of length %d\n", req->buffer.length));
+ DEBUG(10,("Received WINS packet of length %d\n", (int)req->buffer.length));
NDR_PRINT_DEBUG(wrepl_packet, req->packet);
}
@@ -390,7 +390,7 @@ struct wrepl_request *wrepl_request_send(struct wrepl_socket *wrepl_socket,
if (!NT_STATUS_IS_OK(req->status)) goto failed;
if (DEBUGLVL(10)) {
- DEBUG(10,("Sending WINS packet of length %d\n", req->buffer.length));
+ DEBUG(10,("Sending WINS packet of length %d\n", (int)req->buffer.length));
NDR_PRINT_DEBUG(wrepl_packet, &wrap.packet);
}
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 8b473724dc8..5046b860a3b 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -46,7 +46,7 @@ void ndr_check_padding(struct ndr_pull *ndr, size_t n)
}
}
if (i<ofs2) {
- DEBUG(0,("WARNING: Non-zero padding to %d: ", n));
+ DEBUG(0,("WARNING: Non-zero padding to %d: ", (int)n));
for (i=ndr->offset;i<ofs2;i++) {
DEBUG(0,("%02x ", ndr->data[i]));
}
diff --git a/source4/librpc/ndr/ndr_compression.c b/source4/librpc/ndr/ndr_compression.c
index c806f62189e..cf3c3ae97b8 100644
--- a/source4/librpc/ndr/ndr_compression.c
+++ b/source4/librpc/ndr/ndr_compression.c
@@ -98,7 +98,7 @@ static NTSTATUS ndr_pull_compression_mszip(struct ndr_pull *subndr,
if (uncompressed.length != decompressed_len) {
return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad uncompressed_len [%u] != [%d] (PULL)",
- uncompressed.length, decompressed_len);
+ (int)uncompressed.length, (int)decompressed_len);
}
*comndr = *subndr;
diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c
index d9f9522eda2..2238a916a43 100644
--- a/source4/librpc/ndr/ndr_spoolss_buf.c
+++ b/source4/librpc/ndr/ndr_spoolss_buf.c
@@ -29,11 +29,11 @@
if (!r->in.buffer && r->in.offered != 0) {\
return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
"SPOOLSS Buffer: r->in.offered[%u] but there's no buffer",\
- r->in.offered);\
+ (unsigned)r->in.offered);\
} else if (r->in.buffer && r->in.buffer->length != r->in.offered) {\
return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
"SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\
- r->in.offered, r->in.buffer->length);\
+ (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\
}\
_r.in.level = r->in.level;\
_r.in.buffer = r->in.buffer;\
@@ -72,7 +72,7 @@
} else if (r->in.offered < _ndr_info->offset) {\
return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\
"SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]!",\
- r->in.offered, _ndr_info->offset);\
+ (unsigned)r->in.offered, (unsigned)_ndr_info->offset);\
}\
_data_blob_info = ndr_push_blob(_ndr_info);\
_r.out.info = &_data_blob_info;\
@@ -466,7 +466,7 @@ NTSTATUS ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct
if (_r.out.data.length != r->in.offered) {
return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\
"SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]",\
- r->in.offered, _r.out.data.length);\
+ (unsigned)r->in.offered, (unsigned)_r.out.data.length);\
}
if (_r.out.data.length > 0 && r->out.needed <= _r.out.data.length) {
struct __spoolss_GetPrinterData __r;
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 88ed1923ca6..6835213cf49 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -79,7 +79,7 @@ static void smb_read_callback(struct smbcli_request *req)
if (state->received < 16) {
DEBUG(0,("dcerpc_smb: short packet (length %d) in read callback!\n",
- state->received));
+ (int)state->received));
pipe_dead(state->c, NT_STATUS_INFO_LENGTH_MISMATCH);
talloc_free(state);
return;
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 07c46968459..71132119ac4 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -265,7 +265,8 @@ static NTSTATUS lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
}
state->domain_sid = samdb_search_dom_sid(state->sam_ldb, state,
- state->domain_dn, "objectSid", NULL);
+ state->domain_dn, "objectSid",
+ "dn=%s", state->domain_dn);
if (!state->domain_sid) {
return NT_STATUS_NO_SUCH_DOMAIN;
}
@@ -277,7 +278,8 @@ static NTSTATUS lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
state->domain_name = talloc_reference(state,
samdb_search_string(state->sam_ldb, mem_ctx,
- state->domain_dn, "name", NULL));
+ state->domain_dn, "name",
+ "dn=%s", state->domain_dn));
if (!state->domain_name) {
return NT_STATUS_NO_SUCH_DOMAIN;
}
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 31b49bcd86e..5539cdde965 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -515,7 +515,7 @@ static NTSTATUS samr_CreateDomainGroup(struct dcesrv_call_state *dce_call, TALLO
/* retrieve the sid for the group just created */
sid = samdb_search_dom_sid(d_state->sam_ctx, a_state,
- msg->dn, "objectSid", NULL);
+ msg->dn, "objectSid", "dn=%s", msg->dn);
if (sid == NULL) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -749,7 +749,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX
/* retrieve the sid for the group just created */
sid = samdb_search_dom_sid(d_state->sam_ctx, a_state,
- msg->dn, "objectSid", NULL);
+ msg->dn, "objectSid", "dn=%s", msg->dn);
if (sid == NULL) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -949,7 +949,7 @@ static NTSTATUS samr_CreateDomAlias(struct dcesrv_call_state *dce_call, TALLOC_C
/* retrieve the sid for the alias just created */
sid = samdb_search_dom_sid(d_state->sam_ctx, a_state,
- msg->dn, "objectSid", NULL);
+ msg->dn, "objectSid", "dn=%s", msg->dn);
a_state->account_name = talloc_strdup(a_state, alias_name);
if (!a_state->account_name) {
@@ -3072,9 +3072,13 @@ static NTSTATUS samr_GetUserPwInfo(struct dcesrv_call_state *dce_call, TALLOC_CT
a_state = h->data;
r->out.info.min_password_length = samdb_search_uint(a_state->sam_ctx, mem_ctx, 0,
- a_state->domain_state->domain_dn, "minPwdLength", NULL);
+ a_state->domain_state->domain_dn, "minPwdLength",
+ "dn=%s",
+ a_state->domain_state->domain_dn);
r->out.info.password_properties = samdb_search_uint(a_state->sam_ctx, mem_ctx, 0,
- a_state->account_dn, "pwdProperties", NULL);
+ a_state->account_dn,
+ "pwdProperties",
+ "dn=%s", a_state->account_dn);
return NT_STATUS_OK;
}
diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c
index 4f262bd350f..d7ffea29fe8 100644
--- a/source4/scripting/ejs/smbcalls_cli.c
+++ b/source4/scripting/ejs/smbcalls_cli.c
@@ -422,7 +422,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
/* Set up host, share destination */
- mem_ctx = talloc_init(NULL);
+ mem_ctx = talloc_new(mprMemCtx());
smbcli_parse_unc(argv[0], mem_ctx, &hostname, &sharename);
/* Set up credentials */
diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c
index 578acb44410..c012ee5174e 100644
--- a/source4/torture/auth/ntlmssp.c
+++ b/source4/torture/auth/ntlmssp.c
@@ -73,7 +73,8 @@ BOOL torture_ntlmssp_self_check(void)
dump_data_pw("NTLMSSP expected sig: ", expected_sig.data, expected_sig.length);
if (sig.length != expected_sig.length) {
- printf("Wrong sig length: %d != %d\n", sig.length, expected_sig.length);
+ printf("Wrong sig length: %d != %d\n",
+ (int)sig.length, (int)expected_sig.length);
return False;
}
@@ -125,7 +126,8 @@ BOOL torture_ntlmssp_self_check(void)
dump_data_pw("NTLMSSP expected sig: ", expected_sig.data, expected_sig.length);
if (sig.length != expected_sig.length) {
- printf("Wrong sig length: %d != %d\n", sig.length, expected_sig.length);
+ printf("Wrong sig length: %d != %d\n",
+ (int)sig.length, (int)expected_sig.length);
return False;
}
diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c
index f03b20b286b..21c3119e316 100644
--- a/source4/torture/auth/pac.c
+++ b/source4/torture/auth/pac.c
@@ -303,14 +303,14 @@ static BOOL torture_pac_saved_check(void)
*/
if (tmp_blob.length != validate_blob.length) {
DEBUG(0, ("PAC push failed: orignial buffer length[%u] != created buffer length[%u]\n",
- tmp_blob.length, validate_blob.length));
+ (unsigned)tmp_blob.length, (unsigned)validate_blob.length));
talloc_free(mem_ctx);
return False;
}
if (memcmp(tmp_blob.data, validate_blob.data, tmp_blob.length) != 0) {
DEBUG(0, ("PAC push failed: length[%u] matches, but data does not\n",
- tmp_blob.length));
+ (unsigned)tmp_blob.length));
talloc_free(mem_ctx);
return False;
}
diff --git a/source4/torture/basic/aliases.c b/source4/torture/basic/aliases.c
index edea3d963eb..364dfeecf24 100644
--- a/source4/torture/basic/aliases.c
+++ b/source4/torture/basic/aliases.c
@@ -55,7 +55,7 @@ static void gen_aliases(struct smbcli_state *cli, struct smb_trans2 *t2, int lev
DLIST_ADD(alias_blobs, t2b);
d_printf("\tFound level %4u (0x%03x) of size %3d (0x%02x)\n",
level, level,
- t2b->data.length, t2b->data.length);
+ (int)t2b->data.length, t2b->data.length);
count++;
}
@@ -285,7 +285,7 @@ static void gen_set_aliases(struct smbcli_state *cli, struct smb_trans2 *t2, int
DLIST_ADD(alias_blobs, t2b);
d_printf("\tFound level %4u (0x%03x) of size %3d (0x%02x)\n",
level, level,
- t2->in.data.length, t2->in.data.length);
+ (int)t2->in.data.length, t2->in.data.length);
count++;
}
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c
index 7839581caac..ebce0131702 100644
--- a/source4/torture/basic/delaywrite.c
+++ b/source4/torture/basic/delaywrite.c
@@ -72,7 +72,8 @@ static BOOL test_delayed_write_update(struct smbcli_state *cli, TALLOC_CTX *mem_
written = smbcli_write(cli->tree, fnum1, 0, "x", 0, 1);
if (written != 1) {
- printf("write failed - wrote %d bytes (%s)\n", written, __location__);
+ printf("write failed - wrote %d bytes (%s)\n",
+ (int)written, __location__);
return False;
}
@@ -239,7 +240,8 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
written = smbcli_write(cli->tree, fnum1, 0, "0123456789", 1, 10);
if (written != 10) {
- printf("write failed - wrote %d bytes (%s)\n", written, __location__);
+ printf("write failed - wrote %d bytes (%s)\n",
+ (int)written, __location__);
return False;
}
@@ -294,7 +296,8 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
written = smbcli_write(cli->tree, fnum2, 0, "0123456789", 11, 10);
if (written != 10) {
- printf("write failed - wrote %d bytes (%s)\n", written, __location__);
+ printf("write failed - wrote %d bytes (%s)\n",
+ (int)written, __location__);
return False;
}
@@ -319,7 +322,8 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
written = smbcli_write(cli->tree, fnum2, 0, "0123456789", 21, 10);
if (written != 10) {
- printf("write failed - wrote %d bytes (%s)\n", written, __location__);
+ printf("write failed - wrote %d bytes (%s)\n",
+ (int)written, __location__);
return False;
}
@@ -397,7 +401,8 @@ static BOOL test_delayed_write_update2(struct smbcli_state *cli, TALLOC_CTX *mem
written = smbcli_write(cli->tree, fnum1, 0, "0123456789", 31, 10);
if (written != 10) {
- printf("write failed - wrote %d bytes (%s)\n", written, __location__);
+ printf("write failed - wrote %d bytes (%s)\n",
+ (int)written, __location__);
return False;
}
@@ -511,7 +516,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
if (written != 1) {
printf("(%s) written gave %d - should have been 1\n",
- __location__, written);
+ __location__, (int)written);
ret = False;
goto done;
}
@@ -532,7 +537,7 @@ static BOOL test_finfo_after_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx
if (written != 1) {
printf("(%s) written gave %d - should have been 1\n",
- __location__, written);
+ __location__, (int)written);
ret = False;
goto done;
}
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 35c22ff19f1..8d16fa5e73d 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -1433,7 +1433,7 @@ BOOL torture_denytest1(void)
smbcli_close(cli1->tree, fnum1);
}
- printf("testing %d entries\n", ARRAY_SIZE(denytable1));
+ printf("testing %d entries\n", (int)ARRAY_SIZE(denytable1));
GetTimeOfDay(&tv_start);
diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c
index 3f395f39071..3ab26c3879e 100644
--- a/source4/torture/basic/locking.c
+++ b/source4/torture/basic/locking.c
@@ -959,7 +959,8 @@ BOOL torture_locktest7(void)
}
if (size != 0) {
- printf("Unable to truncate locked file. Size was %u (%s)\n", size, __location__);
+ printf("Unable to truncate locked file. Size was %u (%s)\n",
+ (unsigned)size, __location__);
correct = False;
goto fail;
}
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index ea1bb76b8c5..cf3b07886ae 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -175,7 +175,7 @@ BOOL torture_casetable(void)
if (size/sizeof(int) >= MAX_EQUIVALENCE) {
printf("too many chars match?? size=%d c=0x%04x\n",
- size, c);
+ (int)size, c);
smbcli_close(cli->tree, fnum);
return False;
}
diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c
index 69b9017d8a5..7dfc81b692e 100644
--- a/source4/torture/ldap/basic.c
+++ b/source4/torture/ldap/basic.c
@@ -125,13 +125,13 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
int j;
for (j=0; j<r->attributes[i].num_values; j++) {
DEBUG(1,("\t%s: %d %.*s\n", r->attributes[i].name,
- r->attributes[i].values[j].length,
- r->attributes[i].values[j].length,
+ (int)r->attributes[i].values[j].length,
+ (int)r->attributes[i].values[j].length,
(char *)r->attributes[i].values[j].data));
if (!(*basedn) &&
strcasecmp("defaultNamingContext",r->attributes[i].name)==0) {
*basedn = talloc_asprintf(conn, "%.*s",
- r->attributes[i].values[j].length,
+ (int)r->attributes[i].values[j].length,
(char *)r->attributes[i].values[j].data);
}
}
diff --git a/source4/torture/local/iconv.c b/source4/torture/local/iconv.c
index 9aa678995b0..662816d5338 100644
--- a/source4/torture/local/iconv.c
+++ b/source4/torture/local/iconv.c
@@ -174,7 +174,7 @@ static int test_buffer(uint8_t *inbuf, size_t size, const char *charset)
}
if (ret1 != ret2) {
- printf("ret1=%d ret2=%d\n", ret1, ret2);
+ printf("ret1=%d ret2=%d\n", (int)ret1, (int)ret2);
ok = 0;
}
@@ -187,20 +187,20 @@ static int test_buffer(uint8_t *inbuf, size_t size, const char *charset)
if (outsize1 != outsize2) {
printf("\noutsize mismatch outsize1=%d outsize2=%d\n",
- outsize1, outsize2);
+ (int)outsize1, (int)outsize2);
ok = 0;
}
if (size_in1 != size_in2) {
printf("\nsize_in mismatch size_in1=%d size_in2=%d\n",
- size_in1, size_in2);
+ (int)size_in1, (int)size_in2);
ok = 0;
}
if (!ok ||
len1 != len2 ||
memcmp(buf1, buf2, len1) != 0) {
- printf("\nsize=%d ret1=%d ret2=%d\n", size, ret1, ret2);
+ printf("\nsize=%d ret1=%d ret2=%d\n", (int)size, (int)ret1, (int)ret2);
show_buf(" IN1:", inbuf, size-size_in1);
show_buf(" IN2:", inbuf, size-size_in2);
show_buf("OUT1:", buf1, len1);
@@ -248,7 +248,7 @@ static int test_buffer(uint8_t *inbuf, size_t size, const char *charset)
if (outsize3 != sizeof(buf3) - size) {
printf("wrong outsize3 - %d should be %d\n",
- outsize3, sizeof(buf3) - size);
+ (int)outsize3, (int)(sizeof(buf3) - size));
ok = 0;
}
@@ -302,7 +302,7 @@ static int test_codepoint(unsigned int codepoint)
if (size2 != size) {
printf("next_codepoint(%u) gave wrong size %d (should be %d)\n",
- codepoint, size2, size);
+ codepoint, (int)size2, (int)size);
return 0;
}
diff --git a/source4/torture/local/idtree.c b/source4/torture/local/idtree.c
index 94463cefa69..d4a81cb5674 100644
--- a/source4/torture/local/idtree.c
+++ b/source4/torture/local/idtree.c
@@ -64,7 +64,7 @@ BOOL torture_local_idtree(void)
if (p != NULL) {
printf("non-present at %d gave %p (would be %d)\n",
ii, p,
- (((char *)p) - (char *)(&ids[0])) / sizeof(int));
+ (int)(((char *)p) - (char *)(&ids[0])) / sizeof(int));
ret = False;
}
if (random() % 5) {
diff --git a/source4/torture/local/socket.c b/source4/torture/local/socket.c
index 8f8e10b3c58..ec0d3b14679 100644
--- a/source4/torture/local/socket.c
+++ b/source4/torture/local/socket.c
@@ -86,7 +86,7 @@ static BOOL test_udp(TALLOC_CTX *mem_ctx)
ret = False;
}
if (nread != size) {
- printf("Unexpected recvfrom size %d should be %d\n", nread, size);
+ printf("Unexpected recvfrom size %d should be %d\n", (int)nread, (int)size);
ret = False;
}
@@ -107,7 +107,7 @@ static BOOL test_udp(TALLOC_CTX *mem_ctx)
ret = False;
}
if (nread != size) {
- printf("Unexpected recvfrom size %d should be %d\n", nread, size);
+ printf("Unexpected recvfrom size %d should be %d\n", (int)nread, (int)size);
ret = False;
}
if (from_port != srv_port) {
@@ -191,7 +191,7 @@ static BOOL test_tcp(TALLOC_CTX *mem_ctx)
ret = False;
}
if (nread != size) {
- printf("Unexpected recvfrom size %d should be %d\n", nread, size);
+ printf("Unexpected recvfrom size %d should be %d\n", (int)nread, (int)size);
ret = False;
}
@@ -215,7 +215,7 @@ static BOOL test_tcp(TALLOC_CTX *mem_ctx)
ret = False;
}
if (nread != size) {
- printf("Unexpected recvfrom size %d should be %d\n", nread, size);
+ printf("Unexpected recvfrom size %d should be %d\n", (int)nread, (int)size);
ret = False;
}
if (from_port != srv_port) {
diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c
index 463783e1c99..bca9fbeef44 100644
--- a/source4/torture/nbt/register.c
+++ b/source4/torture/nbt/register.c
@@ -28,7 +28,7 @@
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%d - should be %d\n", \
- __location__, #v, v, correct); \
+ __location__, #v, (int)v, (int)correct); \
ret = False; \
}} while (0)
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index e78227be161..457bcea7f97 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -96,7 +96,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (io2.out.size != len) {
printf("wrong length in returned data - %d should be %d\n",
- io2.out.size, len);
+ io2.out.size, (int)len);
return False;
}
@@ -187,7 +187,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (io2.out.size != len) {
printf("wrong length in returned data - %d "
"should be %d\n",
- io2.out.size, len);
+ io2.out.size, (int)len);
ret = False;
continue;
}
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 4fb7bc9cde4..5b094d722fb 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -217,7 +217,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
printf("create %d secondary security contexts on the same transport\n",
- ARRAY_SIZE(sessions));
+ (int)ARRAY_SIZE(sessions));
for (i=0; i <ARRAY_SIZE(sessions); i++) {
setups[i].in.sesskey = cli->transport->negotiate.sesskey;
setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
@@ -237,7 +237,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
}
printf("finishing %d secondary security contexts on the same transport\n",
- ARRAY_SIZE(sessions));
+ (int)ARRAY_SIZE(sessions));
for (i=0; i< ARRAY_SIZE(sessions); i++) {
status = smb_composite_sesssetup_recv(composite_contexts[i]);
CHECK_STATUS(status, NT_STATUS_OK);
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 9a1a8a1144a..5f628fd9c84 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -584,8 +584,8 @@ BOOL torture_raw_qfileinfo(void)
printf(" flags=%d %s=%*.*s\n",
s1->all_eas.out.eas[i].flags,
s1->all_eas.out.eas[i].name.s,
- s1->all_eas.out.eas[i].value.length,
- s1->all_eas.out.eas[i].value.length,
+ (int)s1->all_eas.out.eas[i].value.length,
+ (int)s1->all_eas.out.eas[i].value.length,
s1->all_eas.out.eas[i].value.data);
}
}
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 6753234af45..0d787ecf93a 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -38,7 +38,7 @@
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%d - should be %d\n", \
- __location__, #v, v, correct); \
+ __location__, #v, (int)v, (int)correct); \
ret = False; \
}} while (0)
@@ -77,7 +77,7 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
ret = smbcli_read(cli->tree, fnum, buf, 0, strlen(value)+11);
if (ret != strlen(value)) {
printf("Failed to read %d bytes from stream '%s' - got %d\n",
- strlen(value), full_name, ret);
+ strlen(value), full_name, (int)ret);
return False;
}
diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c
index 3bf8f0e2c80..1a498311d8c 100644
--- a/source4/torture/rpc/autoidl.c
+++ b/source4/torture/rpc/autoidl.c
@@ -216,7 +216,7 @@ static void test_scan_call(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_ta
if (NT_STATUS_IS_OK(status)) {
printf("opnum %d min_input %d - output %d\n",
- opnum, stub_in.length, stub_out.length);
+ opnum, (int)stub_in.length, (int)stub_out.length);
dump_data(0, stub_out.data, stub_out.length);
talloc_free(p);
test_ptr_scan(mem_ctx, iface, opnum, &stub_in, 0, stub_in.length, 0);
@@ -229,7 +229,7 @@ static void test_scan_call(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_ta
if (NT_STATUS_IS_OK(status)) {
printf("opnum %d min_input %d - output %d (with handle)\n",
- opnum, stub_in.length, stub_out.length);
+ opnum, (int)stub_in.length, (int)stub_out.length);
dump_data(0, stub_out.data, stub_out.length);
talloc_free(p);
test_ptr_scan(mem_ctx, iface, opnum, &stub_in, 0, stub_in.length, 0);
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 2e1e9d8740a..988f94d904c 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -865,7 +865,7 @@ static BOOL samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam
if (old->secret.length != lsa_blob_out.length) {
printf("Returned secret %s doesn't match: %d != %d\n",
- old->name, old->secret.length, lsa_blob_out.length);
+ old->name, (int)old->secret.length, (int)lsa_blob_out.length);
ret = False;
} else if (memcmp(lsa_blob_out.data,
old->secret.data, old->secret.length) != 0) {
@@ -905,7 +905,7 @@ static BOOL samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam
if (new->secret.length != lsa_blob_out.length) {
printf("Returned secret %s doesn't match: %d != %d\n",
- new->name, new->secret.length, lsa_blob_out.length);
+ new->name, (int)new->secret.length, (int)lsa_blob_out.length);
ret = False;
} else if (memcmp(lsa_blob_out.data,
new->secret.data, new->secret.length) != 0) {
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 87aba2060ab..55ad143373a 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -368,14 +368,14 @@ static BOOL rw_torture2(struct smbcli_state *c1, struct smbcli_state *c2)
if ((bytes_written = smbcli_write(c1->tree, fnum1, 0, buf, 0, buf_size)) != buf_size) {
printf("write failed (%s)\n", smbcli_errstr(c1->tree));
- printf("wrote %d, expected %d\n", bytes_written, buf_size);
+ printf("wrote %d, expected %d\n", (int)bytes_written, (int)buf_size);
correct = False;
break;
}
if ((bytes_read = smbcli_read(c2->tree, fnum2, buf_rd, 0, buf_size)) != buf_size) {
printf("read failed (%s)\n", smbcli_errstr(c2->tree));
- printf("read %d, expected %d\n", bytes_read, buf_size);
+ printf("read %d, expected %d\n", (int)bytes_read, (int)buf_size);
correct = False;
break;
}
@@ -1933,7 +1933,7 @@ BOOL torture_ioctl_test(void)
if (NT_STATUS_IS_OK(status)) {
printf("ioctl device=0x%x function=0x%x OK : %d bytes\n",
- device, function, parms.ioctl.out.blob.length);
+ device, function, (int)parms.ioctl.out.blob.length);
}
}
}
diff --git a/source4/torture/torture_util.c b/source4/torture/torture_util.c
index 753f36164fd..176a8e101b6 100644
--- a/source4/torture/torture_util.c
+++ b/source4/torture/torture_util.c
@@ -391,8 +391,8 @@ NTSTATUS torture_check_ea(struct smbcli_state *cli,
printf("Expected value '%s' not '%*.*s' for ea %s\n",
value,
- info.ea_list.out.eas[0].value.length,
- info.ea_list.out.eas[0].value.length,
+ (int)info.ea_list.out.eas[0].value.length,
+ (int)info.ea_list.out.eas[0].value.length,
info.ea_list.out.eas[0].value.data,
eaname);
diff --git a/source4/utils/ndrdump.c b/source4/utils/ndrdump.c
index 0cc96bfe122..b80dbdc39c5 100644
--- a/source4/utils/ndrdump.c
+++ b/source4/utils/ndrdump.c
@@ -178,7 +178,7 @@ static char *stdin_load(TALLOC_CTX *mem_ctx, size_t *size)
st = talloc_zero_size(mem_ctx, f->struct_size);
if (!st) {
- printf("Unable to allocate %d bytes\n", f->struct_size);
+ printf("Unable to allocate %d bytes\n", (int)f->struct_size);
exit(1);
}
diff --git a/source4/web_server/http.c b/source4/web_server/http.c
index ec4b7770a64..c2e9042d4a3 100644
--- a/source4/web_server/http.c
+++ b/source4/web_server/http.c
@@ -486,7 +486,7 @@ void ejs_exception(const char *reason)
static void esp_request(struct esp_state *esp, const char *url)
{
struct websrv_context *web = esp->web;
- ssize_t size;
+ int size;
int res;
char *emsg = NULL, *buf;