char *rsrc_data_buf;
};
-static bool ad_collect_one_stream(struct vfs_handle_struct *handle,
- struct char_mappings **cmaps,
- struct smb_filename *smb_fname,
- const struct stream_struct *stream,
- struct adouble *ad,
- struct ad_collect_state *state)
+static NTSTATUS ad_collect_one_stream(struct vfs_handle_struct *handle,
+ struct char_mappings **cmaps,
+ struct smb_filename *smb_fname,
+ const struct stream_struct *stream,
+ struct adouble *ad,
+ struct ad_collect_state *state)
{
struct smb_filename *sname = NULL;
files_struct *fsp = NULL;
smb_fname->twrp,
0);
if (sname == NULL) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
if (is_ntfs_default_stream_smb_fname(sname)) {
TALLOC_FREE(sname);
- return true;
+ return NT_STATUS_OK;
}
DBG_DEBUG("Collecting stream [%s]\n", smb_fname_str_dbg(sname));
status = openat_pathref_fsp(handle->conn->cwd_fsp, sname);
if (!NT_STATUS_IS_OK(status)) {
- ok = false;
goto out;
}
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("SMB_VFS_CREATE_FILE [%s] failed\n",
smb_fname_str_dbg(sname));
- ok = false;
goto out;
}
DBG_ERR("Bad size [%zd] on [%s]\n",
(ssize_t)stream->size,
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
DBG_ERR("Bad size [%zd] on [%s]\n",
(ssize_t)stream->size,
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
if (!ok) {
DBG_ERR("Deleting [%s] failed\n",
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
- ok = true;
+ status = NT_STATUS_OK;
goto out;
}
DBG_ERR("Bad size [%zd] on [%s]\n",
(ssize_t)stream->size,
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
if (!ok) {
DBG_ERR("Deleting [%s] failed\n",
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
}
- ok = true;
+ status = NT_STATUS_OK;
goto out;
}
struct ad_xattr_entry,
ad->adx_header.adx_num_attrs + 1);
if (ad->adx_entries == NULL) {
- ok = false;
+ status = NT_STATUS_NO_MEMORY;
goto out;
}
};
e->adx_name = talloc_strdup(ad, stream->name + 1);
if (e->adx_name == NULL) {
- ok = false;
+ status = NT_STATUS_NO_MEMORY;
goto out;
}
p = strchr(e->adx_name, ':');
vfs_translate_to_unix);
if (rc != 0) {
DBG_ERR("string_replace_allocate failed: %s\n", strerror(rc));
- ok = false;
+ status = map_nt_error_from_unix(rc);
goto out;
}
char,
needed_size);
if (ad->adx_data == NULL) {
- ok = false;
+ status = NT_STATUS_NO_MEMORY;
goto out;
}
}
DBG_ERR("Bad size [%zd] on [%s]\n",
(ssize_t)stream->size,
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
state->adx_data_off += nread;
if (!ok) {
DBG_ERR("Deleting [%s] failed\n",
smb_fname_str_dbg(sname));
- ok = false;
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto out;
}
DBG_ERR("close_file [%s] failed: %s\n",
smb_fname_str_dbg(smb_fname),
nt_errstr(status));
- ok = false;
}
}
- return ok;
+ return status;
}
/**
}
for (i = 0; i < num_streams; i++) {
- ok = ad_collect_one_stream(handle,
- cmaps,
- smb_fname,
- &streams[i],
- ad,
- &state);
- if (!ok) {
+ status = ad_collect_one_stream(
+ handle, cmaps, smb_fname, &streams[i], ad, &state);
+ if (!NT_STATUS_IS_OK(status)) {
+ ok = false;
goto out;
}
}