No need to mmap() anyway, the xattr data is already available in ad->ad_data.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
bool *converted_xattr)
{
static struct char_mappings **string_replace_cmaps = NULL;
bool *converted_xattr)
{
static struct char_mappings **string_replace_cmaps = NULL;
- char *map = MAP_FAILED;
- size_t maplen;
int saved_errno = 0;
NTSTATUS status;
int rc;
int saved_errno = 0;
NTSTATUS status;
int rc;
- maplen = ad_getentryoff(ad, ADEID_RFORK) +
- ad_getentrylen(ad, ADEID_RFORK);
-
- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */
- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED,
- ad->ad_fsp->fh->fd, 0);
- if (map == MAP_FAILED) {
- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno));
- return false;
- }
-
for (i = 0; i < ad->adx_header.adx_num_attrs; i++) {
struct ad_xattr_entry *e = &ad->adx_entries[i];
char *mapped_name = NULL;
for (i = 0; i < ad->adx_header.adx_num_attrs; i++) {
struct ad_xattr_entry *e = &ad->adx_entries[i];
char *mapped_name = NULL;
}
nwritten = SMB_VFS_PWRITE(fsp,
}
nwritten = SMB_VFS_PWRITE(fsp,
+ ad->ad_data + e->adx_offset,
e->adx_length,
0);
if (nwritten == -1) {
e->adx_length,
0);
if (nwritten == -1) {
- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
- if (len != AD_DATASZ_DOT_UND) {
- DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len);
+ rc = ad_fset(handle, ad, ad->ad_fsp);
+ if (rc != 0) {
+ DBG_ERR("ad_fset on [%s] failed: %s\n",
+ fsp_str_dbg(ad->ad_fsp), strerror(errno));
- rc = munmap(map, maplen);
- if (rc != 0) {
- DBG_ERR("munmap failed: %s\n", strerror(errno));
- return false;
- }
-