/* Save the current directory in case the
new directory is invalid */
if (newdir[0] == '\\')
- dname = talloc_strdup(NULL, newdir);
+ dname = talloc_strdup(ctx, newdir);
else
- dname = talloc_asprintf(NULL, "%s\\%s", ctx->remote_cur_dir, newdir);
+ dname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, newdir);
dos_format(dname);
/****************************************************************************
get a file from rname to lname
****************************************************************************/
-static int do_get(struct smbclient_context *ctx, char *rname, const char *lname, bool reget)
+static int do_get(struct smbclient_context *ctx, char *rname, const char *p_lname, bool reget)
{
int handle = 0, fnum;
bool newhandle = false;
off_t start = 0;
off_t nread = 0;
int rc = 0;
+ char *lname;
+
+ lname = talloc_strdup(ctx, p_lname);
GetTimeOfDay(&tp_start);
if (ctx->lowercase) {
- strlower(discard_const_p(char, lname));
+ strlower(lname);
}
fnum = smbcli_open(ctx->cli->tree, rname, O_RDONLY, DENY_NONE);
char *quest;
char *mget_mask;
char *saved_curdir;
+ char *l_fname;
if (ISDOT(finfo->name) || ISDOTDOT(finfo->name))
return;
}
/* handle directories */
- saved_curdir = talloc_strdup(NULL, ctx->remote_cur_dir);
+ saved_curdir = talloc_strdup(ctx, ctx->remote_cur_dir);
ctx->remote_cur_dir = talloc_asprintf_append_buffer(NULL, "%s\\", finfo->name);
- string_replace(discard_const_p(char, finfo->name), '\\', '/');
+ l_fname = talloc_strdup(ctx, finfo->name);
+
+ string_replace(l_fname, '\\', '/');
if (ctx->lowercase) {
- strlower(discard_const_p(char, finfo->name));
+ strlower(l_fname);
}
- if (!directory_exist(finfo->name) &&
- mkdir(finfo->name,0777) != 0) {
- d_printf("failed to create directory %s\n",finfo->name);
+ if (!directory_exist(l_fname) &&
+ mkdir(l_fname, 0777) != 0) {
+ d_printf("failed to create directory %s\n", l_fname);
return;
}
- if (chdir(finfo->name) != 0) {
- d_printf("failed to chdir to directory %s\n",finfo->name);
+ if (chdir(l_fname) != 0) {
+ d_printf("failed to chdir to directory %s\n", l_fname);
return;
}
- mget_mask = talloc_asprintf(NULL, "%s*", ctx->remote_cur_dir);
+ mget_mask = talloc_asprintf(ctx, "%s*", ctx->remote_cur_dir);
do_list(ctx, mget_mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,do_mget,false, true);
chdir("..");
attribute |= FILE_ATTRIBUTE_DIRECTORY;
for (i = 1; args[i]; i++) {
- mget_mask = talloc_strdup(ctx,ctx->remote_cur_dir);
+ mget_mask = talloc_strdup(ctx, ctx->remote_cur_dir);
if(mget_mask[strlen(mget_mask)-1]!='\\')
mget_mask = talloc_append_string(ctx, mget_mask, "\\");
static int cmd_select(struct smbclient_context *ctx, const char **args)
{
talloc_free(ctx->fileselection);
- ctx->fileselection = talloc_strdup(NULL, args[1]);
+ ctx->fileselection = talloc_strdup(ctx, args[1]);
return 0;
}
d_printf("del <filename>\n");
return 1;
}
- mask = talloc_asprintf(ctx,"%s%s", ctx->remote_cur_dir, args[1]);
+ mask = talloc_asprintf(ctx, "%s%s", ctx->remote_cur_dir, args[1]);
if (NT_STATUS_IS_ERR(smbcli_unlink(ctx->cli->tree, mask))) {
d_printf("%s deleting remote file %s\n",smbcli_errstr(ctx->cli->tree),mask);
int i;
/* and get the first part of the command */
- args = str_list_make_shell(ctx, cline, NULL);
+ args = (const char **) str_list_make_shell(ctx, cline, NULL);
if (!args || !args[0])
return 0;
****************************************************************************/
int main(int argc,char *argv[])
{
- const char *base_directory = NULL;
+ char *base_directory = NULL;
const char *dest_ip = NULL;
int opt;
const char *query_host = NULL;
bool message = false;
- const char *desthost = NULL;
+ char *desthost = NULL;
poptContext pc;
const char *service = NULL;
int port = 0;
* Make an equality or prefix match tree, from the attribute, operation and matching value supplied
*/
static struct ldb_parse_tree *make_match_tree(struct ldb_module *module,
- TALLOC_CTX *mem_ctx, enum ldb_parse_op op,
- const char *attr, const DATA_BLOB *match)
+ TALLOC_CTX *mem_ctx,
+ enum ldb_parse_op op,
+ const char *attr,
+ struct ldb_val *match)
{
struct ldb_context *ldb;
struct ldb_parse_tree *match_tree;
*/
static int anr_replace_value(struct anr_context *ac,
TALLOC_CTX *mem_ctx,
- const struct ldb_val *match,
+ struct ldb_val *match,
struct ldb_parse_tree **ntree)
{
struct ldb_parse_tree *tree = NULL;
ac->found_anr = true;
if (match->length > 1 && match->data[0] == '=') {
- DATA_BLOB *match2 = talloc(mem_ctx, DATA_BLOB);
+ struct ldb_val *match2 = talloc(mem_ctx, struct ldb_val);
*match2 = data_blob_const(match->data+1, match->length - 1);
if (match2 == NULL){
ldb_oom(ldb);
if (p) {
struct ldb_parse_tree *first_split_filter, *second_split_filter, *split_filters, *match_tree_1, *match_tree_2;
- DATA_BLOB *first_match = talloc(tree, DATA_BLOB);
- DATA_BLOB *second_match = talloc(tree, DATA_BLOB);
+ struct ldb_val *first_match = talloc(tree, struct ldb_val);
+ struct ldb_val *second_match = talloc(tree, struct ldb_val);
if (!first_match || !second_match) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
/* Run IClassFactory::CreateInstance() */
- error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, &iunk);
+ error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, (struct MInterfacePointer *) &iunk);
if (!W_ERROR_IS_OK(error)) {
DEBUG(3, ("Error while calling IClassFactory::CreateInstance : %s\n", win_errstr(error)));
return error;
struct socket_context **result,
uint16_t *port);
void set_socket_options(int fd, const char *options);
-void socket_set_flags(struct socket_context *socket, unsigned flags);
+void socket_set_flags(struct socket_context *sock, unsigned flags);
void socket_tevent_fd_close_fn(struct tevent_context *ev,
struct tevent_fd *fde,
talloc_steal(conn, conn->sock);
if (conn->ldaps) {
struct socket_context *tls_socket;
- struct socket_context *tmp_socket;
char *cafile = lp_tls_cafile(conn->sock, conn->lp_ctx);
if (!cafile || !*cafile) {
return false;
}
- if (!asn1_read_Integer(data, &(lsdfc->secinfo_flags))) {
+ if (!asn1_read_Integer(data, (int *) &(lsdfc->secinfo_flags))) {
return false;
}
return false;
}
- if (!asn1_read_Integer(data, &(lsoc->search_options))) {
+ if (!asn1_read_Integer(data, (int *) &(lsoc->search_options))) {
return false;
}
/* Change the granted access per each ACE */
void object_tree_modify_access(struct object_tree *root,
- uint32_t access)
+ uint32_t access_mask)
{
struct object_tree *p;
if (root){
- root->remaining_access &= ~access;
+ root->remaining_access &= ~access_mask;
}
for (p = root->children; p != NULL; p = p->next)
- object_tree_modify_access(p, access);
+ object_tree_modify_access(p, access_mask);
}
#include "../libcli/samsync/samsync.h"
#include "auth/gensec/gensec.h"
#include "auth/credentials/credentials.h"
-#include "auth/gensec/schannel_proto.h"
+#include "libcli/auth/schannel.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "librpc/gen_ndr/ndr_netlogon_c.h"
#include "param/param.h"
#define PyErr_SetNdrError(err) \
PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNdrError(err))
-void PyErr_SetDCERPCStatus(struct dcerpc_pipe *pipe, NTSTATUS status);
+void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status);
typedef bool (*py_data_pack_fn) (PyObject *args, PyObject *kwargs, void *r);
typedef PyObject *(*py_data_unpack_fn) (void *r);
}
if (strncmp(sharename, "\\\\", 2) == 0) {
- char *p = strchr(sharename+2, '\\');
- if (p) {
- sharename = p + 1;
+ char *p2 = strchr(sharename+2, '\\');
+ if (p2) {
+ sharename = p2 + 1;
}
}
struct share_config;
struct dcesrv_context;
struct dcesrv_context;
+struct dcesrv_call_state;
+struct ndr_interface_table;
struct dcerpc_server_info {
const char *domain_name;
uint32_t version_build;
};
-struct ndr_interface_table;
-struct dcesrv_call_state;
#include "rpc_server/common/proto.h"
#endif /* _DCERPC_SERVER_COMMON_H_ */
NTSTATUS status;
union smb_notify notify;
union smb_open io;
- int fnum, fnum2;
+ int fnum;
int count = 100;
struct smbcli_request *req1;
int i;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
- int fnum, fnum2;
- int count = 100;
+ int fnum;
struct smbcli_request *req1;
- int i;
printf("TESTING CHANGE NOTIFY BASEDIR EVENTS\n");
struct dcerpc_pipe *p;
bool ret = true;
struct policy_handle *handle;
- struct dom_sid *dom_sid;
- struct dom_sid *trusted_sid;
+ struct dom_sid *dom_sid = NULL;
+ struct dom_sid *trusted_sid = NULL;
struct dom_sid *sids[NUM_SIDS];
status = torture_rpc_connection(torture, &p, &ndr_table_lsarpc);
return NT_STATUS_OK;
}
-static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
+static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *p,
const char *servername, int level, int *num_printers)
{
struct spoolss_EnumPrinters r;
r.out.count = &count;
r.out.info = &info;
- status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r);
+ status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) dcerpc_spoolss_EnumPrinters failed: %s\n",
__location__, nt_errstr(status));
r.in.buffer = &blob;
r.in.offered = needed;
- status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r);
+ status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
d_printf("(%s) dcerpc_spoolss_EnumPrinters failed: %s, "
"%s\n", __location__, nt_errstr(status),
return true;
}
-static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
+static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *p,
struct policy_handle *handle, int level,
union spoolss_PrinterInfo **res)
{
r.in.offered = 0;
r.out.needed = &needed;
- status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
+ status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) dcerpc_spoolss_GetPrinter failed: %s\n",
__location__, nt_errstr(status));
r.in.buffer = &blob;
r.in.offered = needed;
- status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
+ status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
d_printf("(%s) dcerpc_spoolss_GetPrinter failed: %s, "
"%s\n", __location__, nt_errstr(status),
#include "../lib/crypto/crypto.h"
#include "lib/cmdline/popt_common.h"
#include "torture/rpc/rpc.h"
-#include "auth/gensec/schannel_proto.h"
+#include "../libcli/auth/schannel.h"
#include "auth/gensec/gensec.h"
#include "libcli/auth/libcli_auth.h"
#include "param/param.h"
#include "../lib/crypto/crypto.h"
#include "system/time.h"
#include "torture/rpc/rpc.h"
-#include "auth/gensec/schannel_proto.h"
+#include "../libcli/auth/schannel.h"
#include "auth/gensec/gensec.h"
#include "libcli/auth/libcli_auth.h"
#include "libcli/samsync/samsync.h"
#include "auth/credentials/credentials.h"
#include "torture/rpc/rpc.h"
#include "lib/cmdline/popt_common.h"
-#include "auth/gensec/schannel_proto.h"
+#include "../libcli/auth/schannel.h"
#include "libcli/auth/libcli_auth.h"
#include "libcli/security/security.h"
#include "system/filesys.h"
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[2];
- DATA_BLOB data;
smb2_transport_credits_ask_num(tree->session->transport, 2);
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[5];
- uint64_t uid;
- uint32_t tid;
smb2_transport_credits_ask_num(tree->session->transport, 5);
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[2];
- DATA_BLOB data;
smb2_transport_credits_ask_num(tree->session->transport, 2);
struct smb2_find f;
struct smb2_handle h;
union smb_search_data *d;
- int count;
+ unsigned count;
smb2_deltree(tree, DNAME);
struct smb2_find f;
struct smb2_handle h;
union smb_search_data *d;
- int count, file_count = 0;
+ int i, j, file_count = 0;
char **strs = NULL;
- int i, j;
+ unsigned count;
torture_comment(tctx,
"Testing directory enumeration in a directory with >1000 files\n");
#include "smbd/service_task.h"
#include "libnet/libnet_proto.h"
#include "param/param.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "auth/credentials/credentials.h"
struct cmd_getgrgid_state {
#include "winbind/wb_helper.h"
#include "smbd/service_task.h"
#include "libnet/libnet_proto.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
struct cmd_getgrnam_state {
struct composite_context *ctx;
#include "smbd/service_task.h"
#include "libnet/libnet_proto.h"
#include "param/param.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "auth/credentials/credentials.h"
struct cmd_getpwuid_state {
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "winbind/idmap.h"
struct gid2sid_state {
#include "winbind/wb_server.h"
#include "lib/messaging/irpc.h"
#include "libcli/composite/composite.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_winbind.h"
#include "smbd/service_task.h"
struct wbsrv_service *service = talloc_get_type(msg->private_data,
struct wbsrv_service);
struct wb_irpc_get_idmap_state *s;
- struct composite_context *ctx;
+ struct composite_context *ctx = NULL;
DEBUG(5, ("wb_irpc_get_idmap called\n"));
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "winbind/idmap.h"
struct sids2xids_state {
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "winbind/idmap.h"
struct uid2sid_state {
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
#include "winbind/idmap.h"
struct xids2sids_state {