The 'name' can be later used by other backends to find the operations
structure for this backend.
*/
-NTSTATUS auth_register(const void *_ops)
+NTSTATUS auth_register(const struct auth_operations *ops)
{
- const struct auth_operations *ops = _ops;
struct auth_operations *new_ops;
if (auth_backend_byname(ops->name) != NULL) {
static NTSTATUS gensec_krb5_session_key(struct gensec_security *gensec_security,
DATA_BLOB *session_key)
{
- struct gensec_krb5_state *gensec_krb5_state = gensec_security->private_data;
+ struct gensec_krb5_state *gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
krb5_context context = gensec_krb5_state->smb_krb5_context->krb5_context;
krb5_auth_context auth_context = gensec_krb5_state->auth_context;
krb5_keyblock *skey;
struct auth_session_info **_session_info)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
- struct gensec_krb5_state *gensec_krb5_state = gensec_security->private_data;
+ struct gensec_krb5_state *gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
krb5_context context = gensec_krb5_state->smb_krb5_context->krb5_context;
struct auth_serversupplied_info *server_info = NULL;
struct auth_session_info *session_info = NULL;
const DATA_BLOB *in,
DATA_BLOB *out)
{
- struct gensec_krb5_state *gensec_krb5_state = gensec_security->private_data;
+ struct gensec_krb5_state *gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
krb5_context context = gensec_krb5_state->smb_krb5_context->krb5_context;
krb5_auth_context auth_context = gensec_krb5_state->auth_context;
krb5_error_code ret;
const DATA_BLOB *in,
DATA_BLOB *out)
{
- struct gensec_krb5_state *gensec_krb5_state = gensec_security->private_data;
+ struct gensec_krb5_state *gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
krb5_context context = gensec_krb5_state->smb_krb5_context->krb5_context;
krb5_auth_context auth_context = gensec_krb5_state->auth_context;
krb5_error_code ret;
static BOOL gensec_krb5_have_feature(struct gensec_security *gensec_security,
uint32_t feature)
{
- struct gensec_krb5_state *gensec_krb5_state = gensec_security->private_data;
+ struct gensec_krb5_state *gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
if (feature & GENSEC_FEATURE_SESSION_KEY) {
return True;
}
static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- struct schannel_state *state = gensec_security->private_data;
+ struct schannel_state *state = (struct schannel_state *)gensec_security->private_data;
NTSTATUS status;
struct schannel_bind bind_schannel;
struct schannel_bind_ack bind_schannel_ack;
return status;
}
- state = gensec_security->private_data;
+ state = (struct schannel_state *)gensec_security->private_data;
state->initiator = False;
return NT_STATUS_OK;
return status;
}
- state = gensec_security->private_data;
+ state = (struct schannel_state *)gensec_security->private_data;
state->initiator = True;
return NT_STATUS_OK;
const uint8_t *whole_pdu, size_t pdu_length,
const DATA_BLOB *sig)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
const uint8_t *whole_pdu, size_t pdu_length,
const DATA_BLOB *sig)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
const uint8_t *whole_pdu, size_t pdu_length,
DATA_BLOB *sig)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
const uint8_t *whole_pdu, size_t pdu_length,
DATA_BLOB *sig)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
const DATA_BLOB *in,
DATA_BLOB *out)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
const DATA_BLOB *in,
DATA_BLOB *out)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
DATA_BLOB *out,
size_t *len_processed)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
static NTSTATUS gensec_spnego_packet_full_request(struct gensec_security *gensec_security,
DATA_BLOB blob, size_t *size)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
DATA_BLOB *out,
size_t *len_processed)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
static size_t gensec_spnego_sig_size(struct gensec_security *gensec_security, size_t data_size)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
static size_t gensec_spnego_max_input_size(struct gensec_security *gensec_security)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
static size_t gensec_spnego_max_wrapped_size(struct gensec_security *gensec_security)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (spnego_state->state_position != SPNEGO_DONE
&& spnego_state->state_position != SPNEGO_FALLBACK) {
static NTSTATUS gensec_spnego_session_key(struct gensec_security *gensec_security,
DATA_BLOB *session_key)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (!spnego_state->sub_sec_security) {
return NT_STATUS_INVALID_PARAMETER;
}
static NTSTATUS gensec_spnego_session_info(struct gensec_security *gensec_security,
struct auth_session_info **session_info)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (!spnego_state->sub_sec_security) {
return NT_STATUS_INVALID_PARAMETER;
}
static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
DATA_BLOB null_data_blob = data_blob(NULL, 0);
DATA_BLOB unwrapped_out = data_blob(NULL, 0);
struct spnego_data spnego_out;
static BOOL gensec_spnego_have_feature(struct gensec_security *gensec_security,
uint32_t feature)
{
- struct spnego_state *spnego_state = gensec_security->private_data;
+ struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
if (!spnego_state->sub_sec_security) {
return False;
}
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB input, DATA_BLOB *out)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
NTSTATUS status;
uint32_t i;
NTSTATUS gensec_ntlmssp_session_key(struct gensec_security *gensec_security,
DATA_BLOB *session_key)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
if (!gensec_ntlmssp_state->session_key.data) {
return NT_STATUS_NO_USER_SESSION_KEY;
static BOOL gensec_ntlmssp_have_feature(struct gensec_security *gensec_security,
uint32_t feature)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
if (feature & GENSEC_FEATURE_SIGN) {
if (!gensec_ntlmssp_state->session_key.length) {
return False;
TALLOC_CTX *out_mem_ctx,
DATA_BLOB in, DATA_BLOB *out)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
if (gensec_ntlmssp_state->unicode) {
gensec_ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE;
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
uint32_t chal_flags, ntlmssp_command, unkn1, unkn2;
DATA_BLOB server_domain_blob;
DATA_BLOB challenge_blob;
nt_status = gensec_ntlmssp_start(gensec_security);
NT_STATUS_NOT_OK_RETURN(nt_status);
- gensec_ntlmssp_state = gensec_security->private_data;
+ gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
gensec_ntlmssp_state->role = NTLMSSP_CLIENT;
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
DATA_BLOB struct_blob;
fstring dnsname, dnsdomname;
uint32_t neg_flags = 0;
DATA_BLOB *user_session_key,
DATA_BLOB *lm_session_key)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
NTSTATUS nt_status;
DATA_BLOB session_key = data_blob(NULL, 0);
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
DATA_BLOB user_session_key = data_blob(NULL, 0);
DATA_BLOB lm_session_key = data_blob(NULL, 0);
NTSTATUS nt_status;
struct auth_session_info **session_info)
{
NTSTATUS nt_status;
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
nt_status = auth_generate_session_info(gensec_ntlmssp_state, gensec_ntlmssp_state->server_info, session_info);
NT_STATUS_NOT_OK_RETURN(nt_status);
nt_status = gensec_ntlmssp_start(gensec_security);
NT_STATUS_NOT_OK_RETURN(nt_status);
- gensec_ntlmssp_state = gensec_security->private_data;
+ gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
gensec_ntlmssp_state->role = NTLMSSP_SERVER;
const uint8_t *whole_pdu, size_t pdu_length,
DATA_BLOB *sig)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
return ntlmssp_make_packet_signature(gensec_ntlmssp_state, sig_mem_ctx,
data, length,
const uint8_t *whole_pdu, size_t pdu_length,
const DATA_BLOB *sig)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
DATA_BLOB local_sig;
NTSTATUS nt_status;
const uint8_t *whole_pdu, size_t pdu_length,
DATA_BLOB *sig)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
NTSTATUS nt_status;
if (!gensec_ntlmssp_state->session_key.length) {
DEBUG(3, ("NO session key, cannot seal packet\n"));
const uint8_t *whole_pdu, size_t pdu_length,
const DATA_BLOB *sig)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data;
+ struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
if (!gensec_ntlmssp_state->session_key.length) {
DEBUG(3, ("NO session key, cannot unseal packet\n"));
return NT_STATUS_NO_USER_SESSION_KEY;
int ret;
data.dsize = offsetof(struct ctdb_control_set_tunable, name) + strlen(name) + 1;
- data.dptr = talloc_size(ctdb, data.dsize);
+ data.dptr = talloc_array(ctdb, unsigned char, data.dsize);
CTDB_NO_MEMORY(ctdb, data.dptr);
t = (struct ctdb_control_set_tunable *)data.dptr;
}
- queue->partial.data = talloc_realloc_size(queue, queue->partial.data,
- num_ready + queue->partial.length);
+ queue->partial.data = talloc_realloc(queue, queue->partial.data,
+ uint8_t,
+ num_ready + queue->partial.length);
if (queue->partial.data == NULL) {
DEBUG(0,("read error alloc failed for %u\n",
/*
a fatal internal error occurred - no hope for recovery
*/
-void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
+_NORETURN_ void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
{
DEBUG(0,("ctdb fatal error: %s\n", msg));
abort();
*/
static struct server_id ctdb_id(struct cluster_ops *ops, uint32_t id)
{
- struct cluster_state *state = ops->private;
+ struct cluster_state *state = (struct cluster_state *)ops->private;
struct ctdb_context *ctdb = state->ctdb;
struct server_id server_id;
server_id.node = ctdb_get_vnn(ctdb);
*/
static void *ctdb_backend_handle(struct cluster_ops *ops)
{
- struct cluster_state *state = ops->private;
+ struct cluster_state *state = (struct cluster_state *)ops->private;
return (void *)state->ctdb;
}
struct server_id server,
cluster_message_fn_t handler)
{
- struct cluster_state *state = ops->private;
+ struct cluster_state *state = (struct cluster_state *)ops->private;
struct ctdb_handler_state *h;
int ret;
static NTSTATUS ctdb_message_send(struct cluster_ops *ops,
struct server_id server, DATA_BLOB *data)
{
- struct cluster_state *state = ops->private;
+ struct cluster_state *state = (struct cluster_state *)ops->private;
struct ctdb_context *ctdb = state->ctdb;
TDB_DATA tdata;
int ret;
static int get_seq(struct ldb_context *ldb, void *context,
struct ldb_reply *ares)
{
- unsigned long long *max_seq = context;
+ unsigned long long *max_seq = (unsigned long long *)context;
unsigned long long seq;
if (ares->type == LDB_REPLY_ENTRY) {
struct ldb_message_element *el = ldb_msg_find_element(ares->message, "contextCSN");
static enum user_is what_is_user(struct ldb_module *module)
{
struct auth_session_info *session_info
- = ldb_get_opaque(module->ldb, "sessionInfo");
+ = (struct auth_session_info *)ldb_get_opaque(module->ldb, "sessionInfo");
if (!session_info) {
return ANONYMOUS;
}
static const char *user_name(TALLOC_CTX *mem_ctx, struct ldb_module *module)
{
struct auth_session_info *session_info
- = ldb_get_opaque(module->ldb, "sessionInfo");
+ = (struct auth_session_info *)ldb_get_opaque(module->ldb, "sessionInfo");
if (!session_info) {
return "UNKNOWN (NULL)";
}
static int sort_compare(void *void1,
void *void2, void *opaque)
{
- struct dsdb_control_current_partition **pp1 = void1;
- struct dsdb_control_current_partition **pp2 = void2;
+ struct dsdb_control_current_partition **pp1 =
+ (struct dsdb_control_current_partition **)void1;
+ struct dsdb_control_current_partition **pp2 =
+ (struct dsdb_control_current_partition **)void2;
struct dsdb_control_current_partition *partition1 = talloc_get_type(*pp1,
struct dsdb_control_current_partition);
struct dsdb_control_current_partition *partition2 = talloc_get_type(*pp2,
TALLOC_CTX *mem_ctx,
const char *name)
{
- const char *base_url = ldb_get_opaque(module->ldb, "ldb_url");
+ const char *base_url =
+ (const char *)ldb_get_opaque(module->ldb, "ldb_url");
char *path, *p, *full_name;
if (name == NULL) {
return NULL;
struct dom_sid *domain_sid;
/* see if we have a cached copy */
- domain_sid = ldb_get_opaque(ldb, "cache.domain_sid");
+ domain_sid = (struct dom_sid *)ldb_get_opaque(ldb, "cache.domain_sid");
if (domain_sid) {
return domain_sid;
}
struct ldb_dn *settings_dn;
/* see if we have a cached copy */
- settings_dn = ldb_get_opaque(ldb, "cache.settings_dn");
+ settings_dn = (struct ldb_dn *)ldb_get_opaque(ldb, "cache.settings_dn");
if (settings_dn) {
return settings_dn;
}
struct GUID *invocation_id;
/* see if we have a cached copy */
- invocation_id = ldb_get_opaque(ldb, "cache.invocation_id");
+ invocation_id = (struct GUID *)ldb_get_opaque(ldb, "cache.invocation_id");
if (invocation_id) {
return invocation_id;
}
struct GUID *invocation_id_old;
/* see if we have a cached copy */
- invocation_id_old = ldb_get_opaque(ldb, "cache.invocation_id");
+ invocation_id_old = (struct GUID *)ldb_get_opaque(ldb,
+ "cache.invocation_id");
tmp_ctx = talloc_new(ldb);
if (tmp_ctx == NULL) {
struct GUID *ntds_guid;
/* see if we have a cached copy */
- ntds_guid = ldb_get_opaque(ldb, "cache.ntds_guid");
+ ntds_guid = (struct GUID *)ldb_get_opaque(ldb, "cache.ntds_guid");
if (ntds_guid) {
return ntds_guid;
}
struct GUID *ntds_guid_old;
/* see if we have a cached copy */
- ntds_guid_old = ldb_get_opaque(ldb, "cache.ntds_guid");
+ ntds_guid_old = (struct GUID *)ldb_get_opaque(ldb, "cache.ntds_guid");
tmp_ctx = talloc_new(ldb);
if (tmp_ctx == NULL) {
NULL
};
- if (!attrs) {
- return v;
- }
-
v = talloc_asprintf_append(v, "%s ( ", list_name);
if (!v) return NULL;
reply);
}
- password = talloc_strndup(mem_ctx, chpw.newpasswd.data,
+ password = talloc_strndup(mem_ctx,
+ (const char *)chpw.newpasswd.data,
chpw.newpasswd.length);
if (!password) {
free_ChangePasswdDataMS(&chpw);
*/
static void ltdb_attributes_unload(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
int i;
*/
static int ltdb_attributes_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg = ltdb->cache->attributes;
struct ldb_dn *dn;
int i, r;
*/
static int ltdb_subclasses_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg = ltdb->cache->subclasses;
struct ldb_dn *dn;
int i, j, r;
*/
static void ltdb_subclasses_unload(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
int i;
*/
static int ltdb_baseinfo_init(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
struct ldb_message_element el;
struct ldb_val val;
*/
static void ltdb_cache_free(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
ltdb->sequence_number = 0;
talloc_free(ltdb->cache);
*/
int ltdb_cache_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_dn *baseinfo_dn = NULL;
struct ldb_dn *indexlist_dn = NULL;
uint64_t seq;
*/
int ltdb_increase_sequence_number(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
struct ldb_message_element el[2];
struct ldb_val val;
const void *base, size_t nmemb, size_t size,
comparison_fn_t comp_fn)
{
- const char *base_p = base;
+ const char *base_p = (const char *)base;
size_t min_i, max_i, test_i;
if (nmemb == 0) {
static int ltdb_index_add0(struct ldb_module *module, const char *dn,
struct ldb_message_element *elements, int num_el)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
int ret;
unsigned int i, j;
*/
int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
int ret;
const char *dn;
unsigned int i, j;
*/
int ltdb_index_one(struct ldb_module *module, const struct ldb_message *msg, int add)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
struct ldb_message_element el;
struct ldb_val val;
struct ldb_dn *pdn;
*/
static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *state)
{
- struct ldb_module *module = state;
+ struct ldb_module *module = (struct ldb_module *)state;
struct ldb_message *msg;
const char *dn = NULL;
int ret;
*/
int ltdb_reindex(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
int ret;
if (ltdb_cache_reload(module) != 0) {
*/
int ltdb_search_dn1(struct ldb_module *module, struct ldb_dn *dn, struct ldb_message *msg)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
int ret;
TDB_DATA tdb_key, tdb_data;
*/
static int ltdb_lock_read(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
return tdb_lockall_read(ltdb->tdb);
}
*/
static int ltdb_unlock_read(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
return tdb_unlockall_read(ltdb->tdb);
}
{
DATA_BLOB blob;
- blob.data = (void *)&ptr;
+ blob.data = (uint8_t *)&ptr;
blob.length = sizeof(void *);
return messaging_send(msg, server, msg_type, &blob);
return WERR_NOT_FOUND;
*key = reg_import_hive_key(ctx, mp->key,
- mp->path.predefined_key,
- mp->path.elements
- );
+ mp->path.predefined_key,
+ mp->path.elements);
return WERR_OK;
}
#include "includes.h"
#include "lib/registry/registry.h"
+#include "lib/registry/patchfile.h"
#include "system/filesys.h"
#include "pstring.h"
DATA_BLOB value_list;
value_list.length = (nk->num_values+1)*4;
- value_list.data = (void *)talloc_array(private_data, uint32_t, nk->num_values+1);
+ value_list.data = talloc_array(private_data, uint32_t, nk->num_values+1);
W_ERROR_HAVE_NO_MEMORY(value_list.data);
memcpy(value_list.data, values.data, nk->num_values * 4);
return WERR_OK;
}
-static WERROR cmd_exit(struct regshell_context *ctx,
- int argc, char **argv)
+_NORETURN_ static WERROR cmd_exit(struct regshell_context *ctx, int argc, char **argv)
{
exit(0);
return WERR_OK;
const char *name;
const char *alias;
const char *help;
- WERROR (*handle)(struct regshell_context *ctx,
- int argc, char **argv);
+ WERROR (*handle)(struct regshell_context *ctx, int argc, char **argv);
} regshell_cmds[] = {
{"ck", "cd", "Change current key", cmd_ck },
{"info", "i", "Show detailed information of a key", cmd_info },
/**
report a fault
**/
-static void fault_report(int sig)
+_NORETURN_ static void fault_report(int sig)
{
static int counter;
/**
catch serious errors
**/
-static void sig_fault(int sig)
+_NORETURN_ static void sig_fault(int sig)
{
if (fault_handlers.fault_handler) {
/* we have a fault handler, call it. It may not return. */
x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
SIVAL(&x,0,x2);
- return pull_dos_date((void *)&x, zone_offset);
+ return pull_dos_date((const uint8_t *)&x, zone_offset);
}
/**
static const char *blob2string_talloc(TALLOC_CTX *mem_ctx,
DATA_BLOB blob)
{
- char *result = talloc_size(mem_ctx, blob.length+1);
+ char *result = talloc_array(mem_ctx, char, blob.length+1);
memcpy(result, blob.data, blob.length);
result[blob.length] = '\0';
return result;
return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR);
}
if (pwlen != 0) {
- char *pw = talloc_size(msg, pwlen+1);
+ char *pw = talloc_array(msg, char, pwlen+1);
if (!pw) {
return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR);
}
if (len == -1) {
return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR);
}
- dn = talloc_size(msg, len+1);
+ dn = talloc_array(msg, char, len+1);
if (dn == NULL)
break;
asn1_read(data, dn, len);
if (len == -1) {
return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR);
}
- newsup = talloc_size(msg, len+1);
+ newsup = talloc_array(msg, char, len+1);
if (newsup == NULL) {
return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR);
}
}
/* find the matching request */
- req = idr_find(nbtsock->idr, packet->name_trn_id);
+ req = (struct nbt_name_request *)idr_find(nbtsock->idr,
+ packet->name_trn_id);
if (req == NULL) {
if (nbtsock->unexpected.handler) {
nbtsock->unexpected.handler(nbtsock, packet, src);
*/
static void resolve_handler(struct composite_context *creq)
{
- struct composite_context *c = creq->async.private_data;
+ struct composite_context *c = (struct composite_context *)creq->async.private_data;
struct resolve_state *state = talloc_get_type(c->private_data, struct resolve_state);
const struct resolve_method *method = find_method(state->methods[0]);
}
maxlen = sid->num_auths * 11 + 25;
- ret = talloc_size(mem_ctx, maxlen);
+ ret = talloc_array(mem_ctx, char, maxlen);
if (!ret) return talloc_strdup(mem_ctx, "(SID ERR)");
ia = (sid->id_auth[5]) +
req->out.size = SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size;
req->out.allocated = req->out.size + body_dynamic_size;
- req->out.buffer = talloc_size(req, req->out.allocated);
+ req->out.buffer = talloc_array(req, uint8_t, req->out.allocated);
if (req->out.buffer == NULL) {
talloc_free(req);
return NULL;
data->has_error = True;
return False;
}
- *s = talloc_size(mem_ctx, len+1);
+ *s = talloc_array(mem_ctx, char, len+1);
if (! *s) {
data->has_error = True;
return False;
#define NDR_PUSH_ALLOC_SIZE(ndr, s, size) do { \
- (s) = talloc_size(ndr, size); \
+ (s) = talloc_array(ndr, uint8_t, size); \
if (!(s)) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %u failed: %s\n", (unsigned)size, __location__); \
} while (0)
int i;
for (i=0;i<ndr->depth;i++) {
- ndr->private_data = talloc_asprintf_append(ndr->private_data, " ");
+ ndr->private_data = talloc_asprintf_append(
+ (char *)ndr->private_data, " ");
}
va_start(ap, format);
- ndr->private_data = talloc_vasprintf_append(ndr->private_data, format, ap);
+ ndr->private_data = talloc_vasprintf_append((char *)ndr->private_data,
+ format, ap);
va_end(ap);
- ndr->private_data = talloc_asprintf_append(ndr->private_data, "\n");
+ ndr->private_data = talloc_asprintf_append((char *)ndr->private_data,
+ "\n");
}
/*
ndr->depth = 1;
ndr->flags = 0;
fn(ndr, name, ptr);
- ret = talloc_steal(mem_ctx, ndr->private_data);
+ ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
failed:
talloc_free(ndr);
return ret;
ndr->flags = 0;
ndr_print_set_switch_value(ndr, ptr, level);
fn(ndr, name, ptr);
- ret = talloc_steal(mem_ctx, ndr->private_data);
+ ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
failed:
talloc_free(ndr);
return ret;
ndr->depth = 1;
ndr->flags = 0;
fn(ndr, name, flags, ptr);
- ret = talloc_steal(mem_ctx, ndr->private_data);
+ ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
failed:
talloc_free(ndr);
return ret;
{
uint32_t i;
uint8_t zero[4] = {0,0,0,0};
- const char *var = _var;
+ const char *var = (const char *)_var;
for (i = 0; memcmp(var+i*element_size,zero,element_size) != 0; i++);
{
/* FIXME: Treat special chars special here, taking chset into account */
/* Also include 0 byte */
- return strlen(var)+1;
+ return strlen((const char *)var)+1;
}
req->recv_handler = NULL;
if (object != NULL) {
- req->object = talloc_memdup(req, (void *)object, sizeof(*object));
+ req->object = (struct GUID *)talloc_memdup(req, (void *)object, sizeof(*object));
if (req->object == NULL) {
talloc_free(req);
return NULL;
*/
static NTSTATUS sock_shutdown_pipe(struct dcerpc_connection *p, NTSTATUS status)
{
- struct sock_private *sock = p->transport.private_data;
+ struct sock_private *sock = (struct sock_private *)p->transport.private_data;
if (sock && sock->sock) {
sock_dead(p, status);
return -1;
}
- tree = talloc_check_name(argv[0]->ptr, "struct smbcli_tree");
+ tree = talloc_get_type(argv[0]->ptr, struct smbcli_tree);
result = smb_tree_disconnect(tree);
return -1;
}
- tree = argv[0]->ptr;
+ tree = (struct smbcli_tree *)argv[0]->ptr;
if (!mprVarIsString(argv[1]->type)) {
ejsSetErrorMsg(eid, "arg 2 must be a string");
return -1;
}
- tree = argv[0]->ptr;
+ tree = (struct smbcli_tree *)argv[0]->ptr;
if (!mprVarIsString(argv[1]->type)) {
ejsSetErrorMsg(eid, "arg 2 must be a string");
return -1;
}
- tree = argv[0]->ptr;
+ tree = (struct smbcli_tree *)argv[0]->ptr;
if (!mprVarIsString(argv[1]->type)) {
ejsSetErrorMsg(eid, "arg 2 must be a string");
return -1;
}
- tree = argv[0]->ptr;
+ tree = (struct smbcli_tree *)argv[0]->ptr;
if (!mprVarIsString(argv[1]->type)) {
ejsSetErrorMsg(eid, "arg 2 must be a string");
return -1;
}
- tree = argv[0]->ptr;
+ tree = (struct smbcli_tree *)argv[0]->ptr;
if (!mprVarIsString(argv[1]->type)) {
ejsSetErrorMsg(eid, "arg 2 must be a string");
credentials = mprGetProperty(this, "credentials", NULL);
if (credentials) {
- creds = mprGetPtr(credentials, "creds");
+ creds = (struct cli_credentials *)
+ mprGetPtr(credentials, "creds");
} else {
creds = cmdline_credentials;
}
int i, count;
struct MprVar *results;
- p = mprGetThisPtr(eid, "irpc");
+ p = (struct ejs_irpc_connection *)mprGetThisPtr(eid, "irpc");
ejs = talloc(mprMemCtx(), struct ejs_rpc);
if (ejs == NULL) {
/* look for aliased info levels in trans2 calls */
-struct torture_suite *torture_trans2_aliases(void)
+struct torture_suite *torture_trans2_aliases(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "ALIASES");
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "ALIASES");
torture_suite_add_1smb_test(suite, "QFILEINFO aliases", qfsinfo_aliases);
torture_suite_add_1smb_test(suite, "QFSINFO aliases", qfileinfo_aliases);
};
-BOOL torture_openattrtest(struct torture_context *tctx,
- struct smbcli_state *cli1)
+bool torture_openattrtest(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
const char *fname = "\\openattr.file";
int fnum1;
struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "BASE");
torture_suite_add_2smb_test(suite, "FDPASS", run_fdpasstest);
- torture_suite_add_suite(suite, torture_base_locktest());
+ torture_suite_add_suite(suite, torture_base_locktest(suite));
torture_suite_add_1smb_test(suite, "UNLINK", torture_unlinktest);
torture_suite_add_1smb_test(suite, "ATTR", run_attrtest);
torture_suite_add_1smb_test(suite, "TRANS2", run_trans2test);
torture_suite_add_1smb_test(suite, "CASETABLE", torture_casetable);
torture_suite_add_1smb_test(suite, "UTABLE", torture_utable);
torture_suite_add_simple_test(suite, "SMB", torture_smb_scan);
- torture_suite_add_suite(suite, torture_trans2_aliases());
+ torture_suite_add_suite(suite, torture_trans2_aliases(suite));
torture_suite_add_1smb_test(suite, "TRANS2-SCAN", torture_trans2_scan);
torture_suite_add_1smb_test(suite, "NTTRANS", torture_nttrans_scan);
/*
this produces a matrix of deny mode behaviour for 1 connection
*/
-BOOL torture_denytest1(struct torture_context *tctx,
- struct smbcli_state *cli1)
+bool torture_denytest1(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
int fnum1, fnum2;
int i;
/*
this produces a matrix of deny mode behaviour with 2 connections
*/
-BOOL torture_denytest2(struct torture_context *tctx,
- struct smbcli_state *cli1,
- struct smbcli_state *cli2)
+bool torture_denytest2(struct torture_context *tctx,
+ struct smbcli_state *cli1,
+ struct smbcli_state *cli2)
{
int fnum1, fnum2;
int i;
/*
simple test harness for playing with deny modes
*/
-BOOL torture_denytest3(struct torture_context *tctx,
- struct smbcli_state *cli1,
- struct smbcli_state *cli2)
+bool torture_denytest3(struct torture_context *tctx,
+ struct smbcli_state *cli1,
+ struct smbcli_state *cli2)
{
int fnum1, fnum2;
const char *fname;
/*
a denytest for ntcreatex
*/
-BOOL torture_ntdenytest1(struct torture_context *tctx, struct smbcli_state *cli, int client)
+bool torture_ntdenytest1(struct torture_context *tctx,
+ struct smbcli_state *cli, int client)
{
extern int torture_seed;
/*
a denytest for ntcreatex
*/
-BOOL torture_ntdenytest2(struct torture_context *torture,
- struct smbcli_state *cli1,
- struct smbcli_state *cli2)
+bool torture_ntdenytest2(struct torture_context *torture,
+ struct smbcli_state *cli1,
+ struct smbcli_state *cli2)
{
return torture_ntdenytest(torture, cli1, cli2, 0);
}
/*
test sharing of handles with DENY_DOS on a single connection
*/
-BOOL torture_denydos_sharing(struct torture_context *tctx,
- struct smbcli_state *cli)
+bool torture_denydos_sharing(struct torture_context *tctx,
+ struct smbcli_state *cli)
{
union smb_open io;
union smb_fileinfo finfo;
/*
test directory listing speed
*/
-BOOL torture_dirtest1(struct torture_context *tctx,
- struct smbcli_state *cli)
+bool torture_dirtest1(struct torture_context *tctx,
+ struct smbcli_state *cli)
{
int i;
int fnum;
return correct;
}
-BOOL torture_dirtest2(struct torture_context *tctx,
- struct smbcli_state *cli)
+bool torture_dirtest2(struct torture_context *tctx,
+ struct smbcli_state *cli)
{
int i;
int fnum, num_seen;
/*
basic testing of disconnects
*/
-BOOL torture_disconnect(struct torture_context *torture)
+bool torture_disconnect(struct torture_context *torture)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx;
return correct;
}
-struct torture_suite *torture_base_locktest(void)
+struct torture_suite *torture_base_locktest(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *suite = torture_suite_create(talloc_autofree_context(),
- "LOCK");
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCK");
torture_suite_add_2smb_test(suite, "LOCK1", torture_locktest1);
torture_suite_add_1smb_test(suite, "LOCK2", torture_locktest2);
torture_suite_add_2smb_test(suite, "LOCK3", torture_locktest3);
}
-BOOL torture_mangle(struct torture_context *torture,
- struct smbcli_state *cli)
+bool torture_mangle(struct torture_context *torture,
+ struct smbcli_state *cli)
{
extern int torture_numops;
int i;
/*
print out server properties
*/
-BOOL torture_test_properties(struct torture_context *torture,
- struct smbcli_state *cli)
+bool torture_test_properties(struct torture_context *torture,
+ struct smbcli_state *cli)
{
BOOL correct = True;
union smb_fsinfo fs;
/*
Test rename on files open with share delete and no share delete.
*/
-BOOL torture_test_rename(struct torture_context *tctx,
- struct smbcli_state *cli1)
+bool torture_test_rename(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
const char *fname = "\\test.txt";
const char *fname1 = "\\test1.txt";
1) the server does not allow an unlink on a file that is open
*/
-BOOL torture_unlinktest(struct torture_context *tctx, struct smbcli_state *cli)
+bool torture_unlinktest(struct torture_context *tctx, struct smbcli_state *cli)
{
const char *fname = BASEDIR "\\unlink.tst";
int fnum;
static BOOL oplock_handler(struct smbcli_transport *transport, uint16_t tid,
uint16_t fnum, uint8_t level, void *private)
{
- struct smbcli_tree *tree = private;
+ struct smbcli_tree *tree = (struct smbcli_tree *)private;
return smbcli_oplock_ack(tree, fnum, OPLOCK_BREAK_TO_NONE);
}
{
NTSTATUS status;
struct nbt_netlogon_packet netlogon;
- int *replies = dgmslot->private;
+ int *replies = (int *)dgmslot->private;
printf("netlogon reply from %s:%d\n", src->addr, src->port);
{
NTSTATUS status;
struct nbt_ntlogon_packet ntlogon;
- int *replies = dgmslot->private;
+ int *replies = (int *)dgmslot->private;
printf("ntlogon reply from %s:%d\n", src->addr, src->port);
/*
display a replication entry
*/
-static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name)
+static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
{
int i;
}
};
-static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx,
- const char *address)
+static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
+ struct torture_context *tctx, const char *address)
{
struct test_wrepl_conflict_conn *ctx;
struct wrepl_associate associate;
{
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
- struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
+ struct test_conflict_owned_active_vs_replica_struct *rec =
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
_NBT_ASSERT(req_packet->qdcount, 1);
_NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
{
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
- struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
+ struct test_conflict_owned_active_vs_replica_struct *rec =
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
_NBT_ASSERT(req_packet->qdcount, 1);
_NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
struct nbt_name_packet *req_packet,
struct socket_address *src)
{
- struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
+ struct test_conflict_owned_active_vs_replica_struct *rec =
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
rec->defend.ret = false;
basic testing of chkpath calls
*/
bool torture_raw_chkpath(struct torture_context *torture,
- struct smbcli_state *cli)
+ struct smbcli_state *cli)
{
bool ret = true;
int fnum;
* basic testing of all RAW_CLOSE_* calls
*/
bool torture_raw_close(struct torture_context *torture,
- struct smbcli_state *cli)
+ struct smbcli_state *cli)
{
bool ret = true;
union smb_close io;
basic testing of libcli composite calls
*/
bool torture_raw_composite(struct torture_context *tctx,
- struct smbcli_state *cli)
+ struct smbcli_state *cli)
{
bool ret = true;
basic testing of session/tree context calls
*/
bool torture_raw_context(struct torture_context *torture,
- struct smbcli_state *cli)
+ struct smbcli_state *cli)
{
bool ret = true;
if (lp_use_spnego()) {
/*
test max EA size
*/
-BOOL torture_max_eas(struct torture_context *torture)
+bool torture_max_eas(struct torture_context *torture)
{
struct smbcli_state *cli;
BOOL ret = True;
basic testing of some ioctl calls
*/
bool torture_raw_ioctl(struct torture_context *torture,
- struct smbcli_state *cli)
+ struct smbcli_state *cli)
{
bool ret = true;
/*
basic testing of all RAW_MKDIR_* calls
*/
-BOOL torture_raw_mkdir(struct torture_context *torture,
- struct smbcli_state *cli)
+bool torture_raw_mkdir(struct torture_context *torture,
+ struct smbcli_state *cli)
{
bool ret = true;
static void tcp_dis_handler(struct smbcli_transport *t, void *p)
{
- struct smbcli_state *cli = p;
+ struct smbcli_state *cli = (struct smbcli_state *)p;
smbcli_transport_dead(cli->transport, NT_STATUS_LOCAL_DISCONNECT);
cli->transport = NULL;
cli->tree = NULL;
basic testing of change notify
*/
bool torture_raw_notify(struct torture_context *torture,
- struct smbcli_state *cli,
- struct smbcli_state *cli2)
+ struct smbcli_state *cli,
+ struct smbcli_state *cli2)
{
bool ret = true;
/*
a handler function for oplock break requests. Ack it as a break to level II if possible
*/
-static BOOL oplock_handler_ack_to_levelII(struct smbcli_transport *transport, uint16_t tid,
- uint16_t fnum, uint8_t level, void *private)
+static bool oplock_handler_ack_to_levelII(struct smbcli_transport *transport,
+ uint16_t tid, uint16_t fnum,
+ uint8_t level, void *private)
{
- struct smbcli_tree *tree = private;
+ struct smbcli_tree *tree = (struct smbcli_tree *)private;
break_info.fnum = fnum;
break_info.level = level;
break_info.count++;
/*
a handler function for oplock break requests. Ack it as a break to none
*/
-static BOOL oplock_handler_ack_to_none(struct smbcli_transport *transport, uint16_t tid,
- uint16_t fnum, uint8_t level,
- void *private)
+static bool oplock_handler_ack_to_none(struct smbcli_transport *transport,
+ uint16_t tid, uint16_t fnum,
+ uint8_t level, void *private)
{
- struct smbcli_tree *tree = private;
+ struct smbcli_tree *tree = (struct smbcli_tree *)private;
break_info.fnum = fnum;
break_info.level = level;
break_info.count++;
uint16_t fnum, uint8_t level, void *private)
{
union smb_close io;
- struct smbcli_tree *tree = private;
+ struct smbcli_tree *tree = (struct smbcli_tree *)private;
struct smbcli_request *req;
break_info.fnum = fnum;
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE, },
};
-static BOOL oplock_handler_hold(struct smbcli_transport *transport, uint16_t tid,
- uint16_t fnum, uint8_t level, void *private)
+static bool oplock_handler_hold(struct smbcli_transport *transport,
+ uint16_t tid, uint16_t fnum, uint8_t level,
+ void *private)
{
- struct smbcli_tree *tree = private;
+ struct smbcli_tree *tree = (struct smbcli_tree *)private;
struct hold_oplock_info *info;
int i;
BOOL torture_hold_oplock(struct torture_context *torture,
struct smbcli_state *cli)
{
- struct event_context *ev = cli->transport->socket->event.ctx;
+ struct event_context *ev =
+ (struct event_context *)cli->transport->socket->event.ctx;
int i;
printf("Setting up open files with oplocks in %s\n", BASEDIR);
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
const char *fname = BASEDIR "\\test.txt";
const uint8_t data[] = "TEST DATA";
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
return smb_raw_setpathinfo(tree, &sfinfo);
}
-BOOL torture_samba3_hide(struct torture_context *torture)
+bool torture_samba3_hide(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = "test.txt";
* close. smb_close should return NT_STATUS_ACCESS_DENIED.
*/
-BOOL torture_samba3_closeerr(struct torture_context *tctx)
+bool torture_samba3_closeerr(struct torture_context *tctx)
{
struct smbcli_state *cli = NULL;
BOOL result = False;
} \
} while (0)
-BOOL torture_samba3_checkfsp(struct torture_context *torture)
+bool torture_samba3_checkfsp(struct torture_context *torture)
{
struct smbcli_state *cli;
const char *fname = "test.txt";
}
-BOOL torture_samba3_badpath(struct torture_context *torture)
+bool torture_samba3_badpath(struct torture_context *torture)
{
struct smbcli_state *cli_nt;
struct smbcli_state *cli_dos;
*counter += 1;
}
-BOOL torture_samba3_caseinsensitive(struct torture_context *torture)
+bool torture_samba3_caseinsensitive(struct torture_context *torture)
{
struct smbcli_state *cli;
TALLOC_CTX *mem_ctx;
* on an underlying file
*/
-BOOL torture_samba3_posixtimedlock(struct torture_context *tctx)
+bool torture_samba3_posixtimedlock(struct torture_context *tctx)
{
struct smbcli_state *cli;
NTSTATUS status;
*/
static BOOL single_search_callback(void *private, const union smb_search_data *file)
{
- union smb_search_data *data = private;
+ union smb_search_data *data = (union smb_search_data *)private;
*data = *file;
*/
static BOOL multiple_search_callback(void *private, const union smb_search_data *file)
{
- struct multiple_result *data = private;
+ struct multiple_result *data = (struct multiple_result *)private;
data->count++;
union smb_search_next io2;
NTSTATUS status;
const int per_search = 100;
- struct multiple_result *result = data;
+ struct multiple_result *result = (struct multiple_result *)data;
if (data_level == RAW_SEARCH_DATA_SEARCH) {
io.search_first.level = RAW_SEARCH_SEARCH;
return False;
}
- buf = talloc_size(mem_ctx, strlen(value)+11);
+ buf = talloc_array(mem_ctx, uint8_t, strlen(value)+11);
ret = smbcli_read(cli->tree, fnum, buf, 0, strlen(value)+11);
if (ret != strlen(value)) {
*/
struct torture_suite *torture_raw_unlink(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *suite = torture_suite_create(mem_ctx,
- "UNLINK");
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "UNLINK");
torture_suite_add_1smb_test(suite, "unlink", test_unlink);
torture_suite_add_1smb_test(suite, "delete_on_close", test_delete_on_close);
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
torture_comment(tctx, "dangerous not set - limiting range of test to 2^%d\n", max_bits);
}
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero_size(tctx, maxsize);
+ buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
char *user, *pass;
user=buf;
- pass=memchr(buf,' ',length);
+ pass = memchr(buf, ' ', length);
if (!pass) {
DEBUG(2, ("Password not found. Denying access\n"));
mux_printf(mux_id, "ERR\n");
TALLOC_CTX *mem_ctx;
if (*private) {
- state = *private;
+ state = (struct gensec_ntlm_state *)*private;
} else {
state = talloc_zero(NULL, struct gensec_ntlm_state);
if (!state) {