mirror of
https://github.com/samba-team/samba.git
synced 2025-03-23 06:50:21 +03:00
r24994: Fix some C++ warnings.
(This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39)
This commit is contained in:
parent
bd5a802a26
commit
6cf69fee18
@ -1222,7 +1222,7 @@ NTSTATUS gensec_register(const struct gensec_security_ops *ops)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
generic_security_ops[gensec_num_backends] = discard_const(ops);
|
||||
generic_security_ops[gensec_num_backends] = discard_const_p(struct gensec_security_ops, ops);
|
||||
gensec_num_backends++;
|
||||
generic_security_ops[gensec_num_backends] = NULL;
|
||||
|
||||
|
@ -191,7 +191,7 @@ static NTSTATUS gensec_krb5_server_start(struct gensec_security *gensec_security
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
gensec_krb5_state = gensec_security->private_data;
|
||||
gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
|
||||
gensec_krb5_state->state_position = GENSEC_KRB5_SERVER_START;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
@ -203,7 +203,7 @@ static NTSTATUS gensec_fake_gssapi_krb5_server_start(struct gensec_security *gen
|
||||
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
struct gensec_krb5_state *gensec_krb5_state;
|
||||
gensec_krb5_state = gensec_security->private_data;
|
||||
gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
|
||||
gensec_krb5_state->gssapi = True;
|
||||
}
|
||||
return nt_status;
|
||||
@ -240,7 +240,7 @@ static NTSTATUS gensec_krb5_client_start(struct gensec_security *gensec_security
|
||||
return nt_status;
|
||||
}
|
||||
|
||||
gensec_krb5_state = gensec_security->private_data;
|
||||
gensec_krb5_state = (struct gensec_krb5_state *)gensec_security->private_data;
|
||||
gensec_krb5_state->state_position = GENSEC_KRB5_CLIENT_START;
|
||||
|
||||
principal = gensec_get_target_principal(gensec_security);
|
||||
|
@ -146,7 +146,7 @@ WERROR local_get_predefined_key (const struct registry_context *ctx,
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
WERROR local_enum_key(TALLOC_CTX *mem_ctx,
|
||||
static WERROR local_enum_key(TALLOC_CTX *mem_ctx,
|
||||
const struct registry_key *key, uint32_t idx,
|
||||
const char **name,
|
||||
const char **keyclass,
|
||||
@ -169,7 +169,7 @@ static WERROR local_create_key (TALLOC_CTX *mem_ctx,
|
||||
struct hive_key *hivekey;
|
||||
const char **elements;
|
||||
int i;
|
||||
char *last_part;
|
||||
const char *last_part;
|
||||
|
||||
last_part = strrchr(name, '\\');
|
||||
if (last_part == NULL) {
|
||||
|
@ -253,8 +253,8 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1,
|
||||
* Load diff file
|
||||
*/
|
||||
_PUBLIC_ WERROR reg_diff_load(const char *filename,
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data)
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data)
|
||||
{
|
||||
int fd;
|
||||
char hdr[4];
|
||||
@ -295,7 +295,7 @@ _PUBLIC_ WERROR reg_diff_load(const char *filename,
|
||||
*/
|
||||
static WERROR reg_diff_apply_add_key(void *_ctx, const char *key_name)
|
||||
{
|
||||
struct registry_context *ctx = _ctx;
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
struct registry_key *tmp;
|
||||
WERROR error;
|
||||
|
||||
@ -310,7 +310,7 @@ static WERROR reg_diff_apply_add_key(void *_ctx, const char *key_name)
|
||||
|
||||
static WERROR reg_diff_apply_del_key(void *_ctx, const char *key_name)
|
||||
{
|
||||
struct registry_context *ctx = _ctx;
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
WERROR error;
|
||||
|
||||
error = reg_key_del_abs(ctx, key_name);
|
||||
@ -325,7 +325,7 @@ static WERROR reg_diff_apply_del_key(void *_ctx, const char *key_name)
|
||||
|
||||
static WERROR reg_diff_apply_set_value(void *_ctx, const char *path, const char *value_name, uint32_t value_type, DATA_BLOB value)
|
||||
{
|
||||
struct registry_context *ctx = _ctx;
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
struct registry_key *tmp;
|
||||
WERROR error;
|
||||
|
||||
@ -350,7 +350,7 @@ static WERROR reg_diff_apply_set_value(void *_ctx, const char *path, const char
|
||||
|
||||
static WERROR reg_diff_apply_del_value (void *_ctx, const char *key_name, const char *value_name)
|
||||
{
|
||||
struct registry_context *ctx = _ctx;
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
struct registry_key *tmp;
|
||||
WERROR error;
|
||||
|
||||
@ -374,7 +374,7 @@ static WERROR reg_diff_apply_del_value (void *_ctx, const char *key_name, const
|
||||
|
||||
static WERROR reg_diff_apply_del_all_values(void *_ctx, const char *key_name)
|
||||
{
|
||||
struct registry_context *ctx = _ctx;
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
struct registry_key *key;
|
||||
WERROR error;
|
||||
int i;
|
||||
|
@ -40,7 +40,7 @@ struct dotreg_data {
|
||||
|
||||
static WERROR reg_dotreg_diff_add_key(void *_data, const char *key_name)
|
||||
{
|
||||
struct dotreg_data *data = _data;
|
||||
struct dotreg_data *data = (struct dotreg_data *)_data;
|
||||
|
||||
fdprintf(data->fd, "\n[%s]\n", key_name);
|
||||
|
||||
@ -49,7 +49,7 @@ static WERROR reg_dotreg_diff_add_key(void *_data, const char *key_name)
|
||||
|
||||
static WERROR reg_dotreg_diff_del_key(void *_data, const char *key_name)
|
||||
{
|
||||
struct dotreg_data *data = _data;
|
||||
struct dotreg_data *data = (struct dotreg_data *)_data;
|
||||
|
||||
fdprintf(data->fd, "\n[-%s]\n", key_name);
|
||||
|
||||
@ -59,7 +59,7 @@ static WERROR reg_dotreg_diff_del_key(void *_data, const char *key_name)
|
||||
static WERROR reg_dotreg_diff_set_value(void *_data, const char *path,
|
||||
const char *value_name, uint32_t value_type, DATA_BLOB value)
|
||||
{
|
||||
struct dotreg_data *data = _data;
|
||||
struct dotreg_data *data = (struct dotreg_data *)_data;
|
||||
|
||||
fdprintf(data->fd, "\"%s\"=%s:%s\n",
|
||||
value_name, str_regtype(value_type),
|
||||
@ -70,7 +70,7 @@ static WERROR reg_dotreg_diff_set_value(void *_data, const char *path,
|
||||
|
||||
static WERROR reg_dotreg_diff_del_value(void *_data, const char *path, const char *value_name)
|
||||
{
|
||||
struct dotreg_data *data = _data;
|
||||
struct dotreg_data *data = (struct dotreg_data *)_data;
|
||||
|
||||
fdprintf(data->fd, "\"%s\"=-\n", value_name);
|
||||
|
||||
@ -130,7 +130,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
/**
|
||||
* Load diff file
|
||||
*/
|
||||
_PUBLIC_ WERROR reg_dotreg_diff_load(int fd, const struct reg_diff_callbacks *callbacks, void *callback_data)
|
||||
_PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
|
||||
const struct reg_diff_callbacks *callbacks, void *callback_data)
|
||||
{
|
||||
char *line, *p, *q;
|
||||
char *curkey = NULL;
|
||||
|
@ -42,37 +42,37 @@ static WERROR preg_read_utf16(int fd, char *c)
|
||||
/* FIXME These functions need to be implemented */
|
||||
static WERROR reg_preg_diff_add_key(void *_data, const char *key_name)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_set_value(void *_data, const char *key_name, const char *value_name, uint32_t value_type, DATA_BLOB value_data)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_value(void *_data, const char *key_name, const char *value_name)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_all_values(void *_data, const char *key_name)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_done(void *_data)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
|
||||
close(data->fd);
|
||||
talloc_free(data);
|
||||
|
@ -24,7 +24,7 @@
|
||||
* @brief Samba-specific registry functions
|
||||
*/
|
||||
|
||||
WERROR mount_samba_hive(struct registry_context *ctx,
|
||||
static WERROR mount_samba_hive(struct registry_context *ctx,
|
||||
struct auth_session_info *auth_info,
|
||||
struct cli_credentials *creds,
|
||||
const char *name,
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "includes.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/registry/registry.h"
|
||||
#include "lib/registry/tools/common.h"
|
||||
|
||||
struct registry_context *reg_common_open_remote(const char *remote, struct cli_credentials *creds)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ struct delete_state {
|
||||
*/
|
||||
static void delete_fn(struct clilist_file_info *finfo, const char *name, void *state)
|
||||
{
|
||||
struct delete_state *dstate = state;
|
||||
struct delete_state *dstate = (struct delete_state *)state;
|
||||
char *s, *n;
|
||||
if (ISDOT(finfo->name) || ISDOTDOT(finfo->name)) {
|
||||
return;
|
||||
|
@ -27,7 +27,7 @@
|
||||
ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset,
|
||||
size_t size)
|
||||
{
|
||||
uint8_t *buf = _buf;
|
||||
uint8_t *buf = (uint8_t *)_buf;
|
||||
union smb_read parms;
|
||||
int readsize;
|
||||
ssize_t total = 0;
|
||||
@ -87,7 +87,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree,
|
||||
int fnum, uint16_t write_mode,
|
||||
const void *_buf, off_t offset, size_t size)
|
||||
{
|
||||
const uint8_t *buf = _buf;
|
||||
const uint8_t *buf = (const uint8_t *)_buf;
|
||||
union smb_write parms;
|
||||
int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32));
|
||||
ssize_t total = 0;
|
||||
@ -133,7 +133,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree,
|
||||
ssize_t smbcli_smbwrite(struct smbcli_tree *tree,
|
||||
int fnum, const void *_buf, off_t offset, size_t size1)
|
||||
{
|
||||
const uint8_t *buf = _buf;
|
||||
const uint8_t *buf = (const uint8_t *)_buf;
|
||||
union smb_write parms;
|
||||
ssize_t total = 0;
|
||||
|
||||
|
@ -635,7 +635,7 @@ NTSTATUS smb_raw_echo_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx,
|
||||
p->out.sequence_number = SVAL(req->in.vwv, VWV(0));
|
||||
p->out.size = req->in.data_size;
|
||||
talloc_free(p->out.data);
|
||||
p->out.data = talloc_size(mem_ctx, p->out.size);
|
||||
p->out.data = talloc_array(mem_ctx, uint8_t, p->out.size);
|
||||
NT_STATUS_HAVE_NO_MEMORY(p->out.data);
|
||||
|
||||
if (!smbcli_raw_pull_data(req, req->in.data, p->out.size, p->out.data)) {
|
||||
|
@ -66,7 +66,7 @@ NTSTATUS smbcli_parse_stream_info(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
|
||||
if (size == -1) {
|
||||
return NT_STATUS_ILLEGAL_CHARACTER;
|
||||
}
|
||||
io->streams[n].stream_name.s = vstr;
|
||||
io->streams[n].stream_name.s = (const char *)vstr;
|
||||
io->streams[n].stream_name.private_length = nlen;
|
||||
io->num_streams++;
|
||||
len = IVAL(blob.data, ofs);
|
||||
|
@ -83,7 +83,7 @@ struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *tran
|
||||
/* over allocate by a small amount */
|
||||
req->out.allocated = req->out.size + REQ_OVER_ALLOCATION;
|
||||
|
||||
req->out.buffer = talloc_size(req, req->out.allocated);
|
||||
req->out.buffer = talloc_array(req, uint8_t, req->out.allocated);
|
||||
if (!req->out.buffer) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ NTSTATUS smb_raw_trans2_recv(struct smbcli_request *req,
|
||||
|
||||
/* allocate it */
|
||||
if (total_data != 0) {
|
||||
tdata = talloc_size(mem_ctx, total_data);
|
||||
tdata = talloc_array(mem_ctx, uint8_t, total_data);
|
||||
if (!tdata) {
|
||||
DEBUG(0,("smb_raw_receive_trans: failed to enlarge data buffer to %d bytes\n", total_data));
|
||||
req->status = NT_STATUS_NO_MEMORY;
|
||||
@ -96,7 +96,7 @@ NTSTATUS smb_raw_trans2_recv(struct smbcli_request *req,
|
||||
}
|
||||
|
||||
if (total_param != 0) {
|
||||
tparam = talloc_size(mem_ctx, total_param);
|
||||
tparam = talloc_array(mem_ctx, uint8_t, total_param);
|
||||
if (!tparam) {
|
||||
DEBUG(0,("smb_raw_receive_trans: failed to enlarge param buffer to %d bytes\n", total_param));
|
||||
req->status = NT_STATUS_NO_MEMORY;
|
||||
|
@ -229,7 +229,7 @@ static NTSTATUS smb2_grow_buffer(struct smb2_request_buffer *buf, size_t increas
|
||||
|
||||
dynamic_ofs = buf->dynamic - buf->buffer;
|
||||
|
||||
buffer_ptr = talloc_realloc_size(buf, buf->buffer, newsize);
|
||||
buffer_ptr = talloc_realloc(buf, buf->buffer, uint8_t, newsize);
|
||||
NT_STATUS_HAVE_NO_MEMORY(buffer_ptr);
|
||||
|
||||
buf->buffer = buffer_ptr;
|
||||
|
@ -187,7 +187,7 @@ static NTSTATUS appendacl_close(struct composite_context *c,
|
||||
*/
|
||||
static void appendacl_handler(struct smbcli_request *req)
|
||||
{
|
||||
struct composite_context *c = req->async.private;
|
||||
struct composite_context *c = (struct composite_context *)req->async.private;
|
||||
struct appendacl_state *state = talloc_get_type(c->private_data, struct appendacl_state);
|
||||
|
||||
/* when this handler is called, the stage indicates what
|
||||
|
@ -180,7 +180,7 @@ static NTSTATUS loadfile_close(struct composite_context *c,
|
||||
*/
|
||||
static void loadfile_handler(struct smbcli_request *req)
|
||||
{
|
||||
struct composite_context *c = req->async.private;
|
||||
struct composite_context *c = (struct composite_context *)req->async.private;
|
||||
struct loadfile_state *state = talloc_get_type(c->private_data, struct loadfile_state);
|
||||
|
||||
/* when this handler is called, the stage indicates what
|
||||
|
@ -180,7 +180,7 @@ static NTSTATUS savefile_close(struct composite_context *c,
|
||||
*/
|
||||
static void savefile_handler(struct smbcli_request *req)
|
||||
{
|
||||
struct composite_context *c = req->async.private;
|
||||
struct composite_context *c = (struct composite_context *)req->async.private;
|
||||
struct savefile_state *state = talloc_get_type(c->private_data, struct savefile_state);
|
||||
|
||||
/* when this handler is called, the stage indicates what
|
||||
|
@ -76,7 +76,7 @@ static void set_user_session_key(struct smbcli_session *session,
|
||||
*/
|
||||
static void request_handler(struct smbcli_request *req)
|
||||
{
|
||||
struct composite_context *c = req->async.private;
|
||||
struct composite_context *c = (struct composite_context *)req->async.private;
|
||||
struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
|
||||
struct smbcli_session *session = req->session;
|
||||
DATA_BLOB session_key = data_blob(NULL, 0);
|
||||
|
@ -959,7 +959,7 @@ static struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
|
||||
req->recv_handler = NULL;
|
||||
|
||||
if (object != NULL) {
|
||||
req->object = talloc_memdup(req, object, sizeof(*object));
|
||||
req->object = talloc_memdup(req, (void *)object, sizeof(*object));
|
||||
if (req->object == NULL) {
|
||||
talloc_free(req);
|
||||
return NULL;
|
||||
|
@ -39,7 +39,7 @@ struct smb_private {
|
||||
*/
|
||||
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
|
||||
if (smb->dead) {
|
||||
return;
|
||||
@ -141,7 +141,7 @@ static void smb_read_callback(struct smbcli_request *req)
|
||||
*/
|
||||
static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
union smb_read *io;
|
||||
struct smb_read_state *state;
|
||||
struct smbcli_request *req;
|
||||
@ -197,7 +197,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO
|
||||
*/
|
||||
static NTSTATUS send_read_request(struct dcerpc_connection *c)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
|
||||
if (smb->dead) {
|
||||
return NT_STATUS_CONNECTION_DISCONNECTED;
|
||||
@ -220,7 +220,7 @@ struct smb_trans_state {
|
||||
*/
|
||||
static void smb_trans_callback(struct smbcli_request *req)
|
||||
{
|
||||
struct smb_trans_state *state = req->async.private;
|
||||
struct smb_trans_state *state = (struct smb_trans_state *)req->async.private;
|
||||
struct dcerpc_connection *c = state->c;
|
||||
NTSTATUS status;
|
||||
|
||||
@ -249,7 +249,7 @@ static void smb_trans_callback(struct smbcli_request *req)
|
||||
*/
|
||||
static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *blob)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
struct smb_trans2 *trans;
|
||||
uint16_t setup[2];
|
||||
struct smb_trans_state *state;
|
||||
@ -297,7 +297,7 @@ static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *b
|
||||
*/
|
||||
static void smb_write_callback(struct smbcli_request *req)
|
||||
{
|
||||
struct dcerpc_connection *c = req->async.private;
|
||||
struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private;
|
||||
|
||||
if (!NT_STATUS_IS_OK(req->status)) {
|
||||
DEBUG(0,("dcerpc_smb: write callback error\n"));
|
||||
@ -312,7 +312,7 @@ static void smb_write_callback(struct smbcli_request *req)
|
||||
*/
|
||||
static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, BOOL trigger_read)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
union smb_write io;
|
||||
struct smbcli_request *req;
|
||||
|
||||
@ -356,7 +356,7 @@ static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, B
|
||||
*/
|
||||
static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
union smb_close io;
|
||||
struct smbcli_request *req;
|
||||
|
||||
@ -382,7 +382,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
|
||||
*/
|
||||
static const char *smb_peer_name(struct dcerpc_connection *c)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
return smb->server_name;
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@ static const char *smb_target_hostname(struct dcerpc_connection *c)
|
||||
*/
|
||||
static NTSTATUS smb_session_key(struct dcerpc_connection *c, DATA_BLOB *session_key)
|
||||
{
|
||||
struct smb_private *smb = c->transport.private_data;
|
||||
struct smb_private *smb = (struct smb_private *)c->transport.private_data;
|
||||
|
||||
if (smb->tree->session->user_session_key.data) {
|
||||
*session_key = smb->tree->session->user_session_key;
|
||||
|
@ -41,7 +41,7 @@ struct smb2_private {
|
||||
*/
|
||||
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
|
||||
{
|
||||
struct smb2_private *smb = c->transport.private_data;
|
||||
struct smb2_private *smb = (struct smb2_private *)c->transport.private_data;
|
||||
|
||||
if (smb->dead) {
|
||||
return;
|
||||
@ -145,7 +145,7 @@ static void smb2_read_callback(struct smb2_request *req)
|
||||
*/
|
||||
static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob)
|
||||
{
|
||||
struct smb2_private *smb = c->transport.private_data;
|
||||
struct smb2_private *smb = (struct smb2_private *)c->transport.private_data;
|
||||
struct smb2_read io;
|
||||
struct smb2_read_state *state;
|
||||
struct smb2_request *req;
|
||||
@ -190,7 +190,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO
|
||||
*/
|
||||
static NTSTATUS send_read_request(struct dcerpc_connection *c)
|
||||
{
|
||||
struct smb2_private *smb = c->transport.private_data;
|
||||
struct smb2_private *smb = (struct smb2_private *)c->transport.private_data;
|
||||
|
||||
if (smb->dead) {
|
||||
return NT_STATUS_CONNECTION_DISCONNECTED;
|
||||
@ -280,7 +280,7 @@ static NTSTATUS smb2_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *
|
||||
*/
|
||||
static void smb2_write_callback(struct smb2_request *req)
|
||||
{
|
||||
struct dcerpc_connection *c = req->async.private;
|
||||
struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private;
|
||||
|
||||
if (!NT_STATUS_IS_OK(req->status)) {
|
||||
DEBUG(0,("dcerpc_smb2: write callback error\n"));
|
||||
@ -296,7 +296,7 @@ static void smb2_write_callback(struct smb2_request *req)
|
||||
static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob,
|
||||
BOOL trigger_read)
|
||||
{
|
||||
struct smb2_private *smb = c->transport.private_data;
|
||||
struct smb2_private *smb = (struct smb2_private *)c->transport.private_data;
|
||||
struct smb2_write io;
|
||||
struct smb2_request *req;
|
||||
|
||||
@ -328,7 +328,7 @@ static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob,
|
||||
*/
|
||||
static NTSTATUS smb2_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
|
||||
{
|
||||
struct smb2_private *smb = c->transport.private_data;
|
||||
struct smb2_private *smb = (struct smb2_private *)c->transport.private_data;
|
||||
struct smb2_close io;
|
||||
struct smb2_request *req;
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct sock_private {
|
||||
*/
|
||||
static void sock_dead(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) return;
|
||||
|
||||
@ -111,7 +111,7 @@ static NTSTATUS sock_process_recv(void *private, DATA_BLOB blob)
|
||||
{
|
||||
struct dcerpc_connection *p = talloc_get_type(private,
|
||||
struct dcerpc_connection);
|
||||
struct sock_private *sock = p->transport.private_data;
|
||||
struct sock_private *sock = (struct sock_private *)p->transport.private_data;
|
||||
sock->pending_reads--;
|
||||
if (sock->pending_reads == 0) {
|
||||
packet_recv_disable(sock->packet);
|
||||
@ -128,7 +128,7 @@ static void sock_io_handler(struct event_context *ev, struct fd_event *fde,
|
||||
{
|
||||
struct dcerpc_connection *p = talloc_get_type(private,
|
||||
struct dcerpc_connection);
|
||||
struct sock_private *sock = p->transport.private_data;
|
||||
struct sock_private *sock = (struct sock_private *)p->transport.private_data;
|
||||
|
||||
if (flags & EVENT_FD_WRITE) {
|
||||
packet_queue_run(sock->packet);
|
||||
@ -149,7 +149,7 @@ static void sock_io_handler(struct event_context *ev, struct fd_event *fde,
|
||||
*/
|
||||
static NTSTATUS sock_send_read(struct dcerpc_connection *p)
|
||||
{
|
||||
struct sock_private *sock = p->transport.private_data;
|
||||
struct sock_private *sock = (struct sock_private *)p->transport.private_data;
|
||||
sock->pending_reads++;
|
||||
if (sock->pending_reads == 1) {
|
||||
packet_recv_enable(sock->packet);
|
||||
@ -163,7 +163,7 @@ static NTSTATUS sock_send_read(struct dcerpc_connection *p)
|
||||
static NTSTATUS sock_send_request(struct dcerpc_connection *p, DATA_BLOB *data,
|
||||
BOOL trigger_read)
|
||||
{
|
||||
struct sock_private *sock = p->transport.private_data;
|
||||
struct sock_private *sock = (struct sock_private *)p->transport.private_data;
|
||||
DATA_BLOB blob;
|
||||
NTSTATUS status;
|
||||
|
||||
|
@ -50,7 +50,7 @@ static const struct ndr_interface_call *find_function(
|
||||
|
||||
#if (_SAMBA_BUILD_ >= 4)
|
||||
|
||||
static void show_pipes(void)
|
||||
_NORETURN_ static void show_pipes(void)
|
||||
{
|
||||
const struct ndr_interface_list *l;
|
||||
printf("\nYou must specify a pipe\n");
|
||||
@ -67,7 +67,7 @@ static void show_pipes(void)
|
||||
|
||||
#endif
|
||||
|
||||
static void show_functions(const struct ndr_interface_table *p)
|
||||
_NORETURN_ static void show_functions(const struct ndr_interface_table *p)
|
||||
{
|
||||
int i;
|
||||
printf("\nYou must specify a function\n");
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
static EjsId eid;
|
||||
|
||||
static void smbscript_ejs_exception(const char *reason)
|
||||
_NORETURN_ static void smbscript_ejs_exception(const char *reason)
|
||||
{
|
||||
Ejs *ep = ejsPtr(eid);
|
||||
ejsSetErrorMsg(eid, "%s", reason);
|
||||
|
@ -191,7 +191,7 @@ static void standard_new_task(struct event_context *ev,
|
||||
|
||||
|
||||
/* called when a task goes down */
|
||||
static void standard_terminate(struct event_context *ev, const char *reason)
|
||||
_NORETURN_ static void standard_terminate(struct event_context *ev, const char *reason)
|
||||
{
|
||||
DEBUG(2,("standard_terminate: reason[%s]\n",reason));
|
||||
|
||||
|
@ -168,7 +168,7 @@ static void server_stdin_handler(struct event_context *event_ctx, struct fd_even
|
||||
/*
|
||||
die if the user selected maximum runtime is exceeded
|
||||
*/
|
||||
static void max_runtime_handler(struct event_context *ev, struct timed_event *te,
|
||||
_NORETURN_ static void max_runtime_handler(struct event_context *ev, struct timed_event *te,
|
||||
struct timeval t, void *private)
|
||||
{
|
||||
const char *binary_name = private;
|
||||
|
@ -155,7 +155,7 @@ static NTSTATUS rap_pull_string(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr,
|
||||
if ( string_offset + len + 1 > ndr->data_size )
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
*dest = talloc_zero_size(mem_ctx, len+1);
|
||||
*dest = talloc_zero_array(mem_ctx, char, len+1);
|
||||
pull_string(*dest, p, len+1, len, STR_ASCII);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "torture/util.h"
|
||||
#include "librpc/rpc/dcerpc.h"
|
||||
#include "torture/rpc/rpc.h"
|
||||
#include "torture/raw/proto.h"
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "libcli/raw/libcliraw.h"
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/util.h"
|
||||
#include "torture/raw/proto.h"
|
||||
|
||||
#define BASEDIR "\\testsfileinfo"
|
||||
|
||||
|
@ -179,7 +179,7 @@ static void print_test_list(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void usage(poptContext pc)
|
||||
_NORETURN_ static void usage(poptContext pc)
|
||||
{
|
||||
struct torture_suite *o;
|
||||
struct torture_suite *s;
|
||||
@ -271,7 +271,7 @@ static void usage(poptContext pc)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void max_runtime_handler(int sig)
|
||||
_NORETURN_ static void max_runtime_handler(int sig)
|
||||
{
|
||||
DEBUG(0,("maximum runtime exceeded for smbtorture - terminating\n"));
|
||||
exit(1);
|
||||
|
@ -87,12 +87,12 @@ void torture_tcase_set_fixture(struct torture_tcase *tcase,
|
||||
}
|
||||
|
||||
static bool wrap_test_with_testcase(struct torture_context *torture_ctx,
|
||||
struct torture_tcase *tcase,
|
||||
struct torture_test *test)
|
||||
struct torture_tcase *tcase,
|
||||
struct torture_test *test)
|
||||
{
|
||||
bool (*fn) (struct torture_context *,
|
||||
const void *tcase_data,
|
||||
const void *test_data);
|
||||
const void *tcase_data,
|
||||
const void *test_data);
|
||||
|
||||
fn = test->fn;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user