*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "onefs.h"
#include "onefs_config.h"
/* Strip off the :$DATA if one exists. */
str_tmp = strrchr_m(stream_name, ':');
if (str_tmp) {
- if (StrCaseCmp(str_tmp, ":$DATA") != 0) {
+ if (strcasecmp_m(str_tmp, ":$DATA") != 0) {
return NT_STATUS_INVALID_PARAMETER;
}
str_tmp[0] = '\0';
static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
struct stream_struct **streams,
- const char *name, SMB_OFF_T size,
- SMB_OFF_T alloc_size)
+ const char *name, off_t size,
+ off_t alloc_size)
{
struct stream_struct *tmp;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct,
+ tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct,
(*num_streams)+1);
if (tmp == NULL) {
return false;
int dir_fd = -1;
int stream_fd = -1;
int ret;
- SMB_STRUCT_DIR *dirp = NULL;
- SMB_STRUCT_DIRENT *dp = NULL;
+ DIR *dirp = NULL;
+ struct dirent *dp = NULL;
files_struct fake_fs;
struct fd_handle fake_fh;
SMB_STRUCT_STAT stream_sbuf;
return map_nt_error_from_unix(errno);
}
- state.streams = NULL;
- state.num_streams = 0;
+ state.streams = *pstreams;
+ state.num_streams = *pnum_streams;
if (lp_parm_bool(SNUM(handle->conn), PARM_ONEFS_TYPE,
PARM_IGNORE_STREAMS, PARM_IGNORE_STREAMS_DEFAULT)) {
goto out;
}
- /* Add the default stream. */
- if (S_ISREG(sbuf.st_ex_mode)) {
- if (!add_one_stream(mem_ctx,
- &state.num_streams, &state.streams,
- "", sbuf.st_ex_size,
- SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp,
- &sbuf))) {
- return NT_STATUS_NO_MEMORY;
- }
- }
-
state.mem_ctx = mem_ctx;
state.handle = handle;
state.status = NT_STATUS_OK;
out:
*num_streams = state.num_streams;
*streams = state.streams;
- return NT_STATUS_OK;
+ return SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, pnum_streams, pstreams);
}