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;
}
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;
}
&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;
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;
|| 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",
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);
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);
}
}
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,
}
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 */
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 {
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;
}
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);
}
} 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) {
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);
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));
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));
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:
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);
}
/*
}
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);
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);
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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"));
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;
(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);
}
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) {
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;
(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);
}
(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);
}
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",
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);
}
/* 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; \
}
/* 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; \
}
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;
}
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;
}
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;
}
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);
}
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);
}
}
}
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]));
}
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;
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;\
} 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;\
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;
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;
}
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;
}
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;
}
/* 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;
}
/* 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;
}
/* 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) {
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;
}
/* 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 */
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;
}
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;
}
*/
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;
}
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++;
}
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++;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (written != 1) {
printf("(%s) written gave %d - should have been 1\n",
- __location__, written);
+ __location__, (int)written);
ret = False;
goto done;
}
if (written != 1) {
printf("(%s) written gave %d - should have been 1\n",
- __location__, written);
+ __location__, (int)written);
ret = False;
goto done;
}
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);
}
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;
}
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;
}
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);
}
}
}
if (ret1 != ret2) {
- printf("ret1=%d ret2=%d\n", ret1, ret2);
+ printf("ret1=%d ret2=%d\n", (int)ret1, (int)ret2);
ok = 0;
}
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);
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;
}
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;
}
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) {
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;
}
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) {
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;
}
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) {
#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)
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;
}
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;
}
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 */
}
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);
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);
}
}
#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)
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;
}
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);
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);
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) {
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) {
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;
}
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);
}
}
}
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);
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);
}
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;