SEC_DESC *psd = NULL;
size_t sd_size;
uint32 security_info_wanted;
- TALLOC_CTX *frame;
files_struct *fsp = NULL;
NTSTATUS status;
DATA_BLOB blob;
return;
}
- frame = talloc_stackframe();
-
/*
* Get the permissions to return.
*/
}
if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(frame);
reply_nterror(req, status);
return;
}
if (max_data_count < sd_size) {
send_nt_replies(conn, req, NT_STATUS_BUFFER_TOO_SMALL,
params, 4, *ppdata, 0);
- TALLOC_FREE(frame);
return;
}
data = nttrans_realloc(ppdata, sd_size);
if(data == NULL) {
- TALLOC_FREE(frame);
reply_doserror(req, ERRDOS, ERRnomem);
return;
}
&blob.data, &blob.length);
if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(frame);
reply_nterror(req, status);
return;
}
send_nt_replies(conn, req, NT_STATUS_OK, params, 4, data, (int)sd_size);
- TALLOC_FREE(frame);
return;
}
char *saved_dir = NULL;
SMB_STRUCT_STAT sbuf;
SMB_STRUCT_STAT parent_st;
- TALLOC_CTX *ctx = talloc_stackframe();
+ TALLOC_CTX *ctx = talloc_tos();
NTSTATUS status = NT_STATUS_OK;
int ret;
DEBUG(0,("change_dir_owner_to_parent: failed to stat parent "
"directory %s. Error was %s\n",
inherit_from_dir, strerror(errno) ));
- TALLOC_FREE(ctx);
return status;
}
DEBUG(0,("change_dir_owner_to_parent: failed to get "
"current working directory. Error was %s\n",
strerror(errno)));
- TALLOC_FREE(ctx);
return status;
}
out:
- TALLOC_FREE(ctx);
vfs_ChDir(conn,saved_dir);
return status;
}
int *pinfo,
SMB_STRUCT_STAT *psbuf)
{
- TALLOC_CTX *frame = talloc_stackframe();
struct case_semantics_state *case_state = NULL;
SMB_STRUCT_STAT sbuf;
int info = FILE_WAS_OPENED;
if (psbuf != NULL) {
*psbuf = sbuf;
}
- TALLOC_FREE(frame);
return NT_STATUS_OK;
fail:
close_file(fsp, ERROR_CLOSE);
fsp = NULL;
}
- TALLOC_FREE(frame);
return status;
}
char *inbuf;
size_t inbuf_len;
bool encrypted = false;
- TALLOC_CTX *frame = talloc_stackframe();
+ TALLOC_CTX *frame = talloc_stackframe_pool(8192);
errno = 0;
int find_service(fstring service)
{
int iService;
- TALLOC_CTX *frame = talloc_stackframe();
all_string_sub(service,"\\","/",0);
if (iService < 0)
DEBUG(3,("find_service() failed to find service %s\n", service));
- TALLOC_FREE(frame);
-
return (iService);
}
#if SOFTLINK_OPTIMISATION
/* resolve any soft links early if possible */
if (vfs_ChDir(conn,conn->connectpath) == 0) {
- TALLOC_CTX *ctx = talloc_stackframe();
+ TALLOC_CTX *ctx = talloc_tos();
char *s = vfs_GetWd(ctx,s);
if (!s) {
*status = map_nt_error_from_unix(errno);
- TALLOC_FREE(ctx);
goto err_root_exit;
}
if (!set_conn_connectpath(conn,s)) {
*status = NT_STATUS_NO_MEMORY;
- TALLOC_FREE(ctx);
goto err_root_exit;
}
vfs_ChDir(conn,conn->connectpath);
- TALLOC_FREE(ctx);
}
#endif
if (!lp_ea_support(SNUM(conn))) {
return 0;
}
- mem_ctx = talloc_init("estimate_ea_size");
+ mem_ctx = talloc_tos();
(void)get_ea_list_from_file(mem_ctx, conn, fsp, fname, &total_ea_len);
- talloc_destroy(mem_ctx);
return total_ea_len;
}
static void canonicalize_ea_name(connection_struct *conn, files_struct *fsp, const char *fname, fstring unix_ea_name)
{
size_t total_ea_len;
- TALLOC_CTX *mem_ctx = talloc_init("canonicalize_ea_name");
+ TALLOC_CTX *mem_ctx = talloc_tos();
struct ea_list *ea_list = get_ea_list_from_file(mem_ctx, conn, fsp, fname, &total_ea_len);
for (; ea_list; ea_list = ea_list->next) {
break;
}
}
- talloc_destroy(mem_ctx);
}
/****************************************************************************
out_of_space = True;
finished = False;
} else {
- TALLOC_CTX *sub_ctx = talloc_stackframe();
-
- finished = !get_lanman2_dir_entry(sub_ctx,
+ finished = !get_lanman2_dir_entry(ctx,
conn,
req->flags2,
mask,dirtype,info_level,
space_remaining, &out_of_space,
&got_exact_match,
&last_entry_off, ea_list);
-
- TALLOC_FREE(sub_ctx);
}
if (finished && out_of_space)
out_of_space = True;
finished = False;
} else {
- TALLOC_CTX *sub_ctx = talloc_stackframe();
-
- finished = !get_lanman2_dir_entry(sub_ctx,
+ finished = !get_lanman2_dir_entry(ctx,
conn,
req->flags2,
mask,dirtype,info_level,
space_remaining, &out_of_space,
&got_exact_match,
&last_entry_off, ea_list);
-
- TALLOC_FREE(sub_ctx);
}
if (finished && out_of_space)
return NT_STATUS_INVALID_PARAMETER;
}
- ctx = talloc_init("SMB_INFO_SET_EA");
- if (!ctx) {
- return NT_STATUS_NO_MEMORY;
- }
+ ctx = talloc_tos();
ea_list = read_ea_list(ctx, pdata + 4, total_data - 4);
if (!ea_list) {
- talloc_destroy(ctx);
return NT_STATUS_INVALID_PARAMETER;
}
status = set_ea(conn, fsp, fname, ea_list);
- talloc_destroy(ctx);
return status;
}
return map_nt_error_from_unix(errno);
case ENOENT:
{
- TALLOC_CTX *tmp_ctx = talloc_stackframe();
+ TALLOC_CTX *ctx = talloc_tos();
char *tmp_fname = NULL;
char *last_component = NULL;
/* Last component didn't exist. Remove it and try and canonicalise the directory. */
- tmp_fname = talloc_strdup(tmp_ctx, fname);
+ tmp_fname = talloc_strdup(ctx, fname);
if (!tmp_fname) {
- TALLOC_FREE(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
p = strrchr_m(tmp_fname, '/');
last_component = p;
} else {
last_component = tmp_fname;
- tmp_fname = talloc_strdup(tmp_ctx,
+ tmp_fname = talloc_strdup(ctx,
".");
if (!tmp_fname) {
- TALLOC_FREE(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
}
#endif
if (!resolved_name) {
DEBUG(3,("reduce_name: couldn't get realpath for %s\n", fname));
- TALLOC_FREE(tmp_ctx);
return map_nt_error_from_unix(errno);
}
- tmp_fname = talloc_asprintf(tmp_ctx,
+ tmp_fname = talloc_asprintf(ctx,
"%s/%s",
resolved_name,
last_component);
if (!tmp_fname) {
- TALLOC_FREE(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
#ifdef REALPATH_TAKES_NULL
safe_strcpy(resolved_name_buf, tmp_fname, PATH_MAX);
resolved_name = resolved_name_buf;
#endif
- TALLOC_FREE(tmp_ctx);
break;
}
default: