fio->type = ADOUBLE_META;
fio->config = config;
- fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, open_flags, mode);
+ fd = SMB_VFS_NEXT_OPENAT(handle,
+ dirfsp,
+ smb_fname,
+ fsp,
+ open_flags,
+ mode);
if (fd != -1) {
return fd;
}
flags &= ~(O_RDONLY | O_WRONLY);
flags |= O_RDWR;
- hostfd = SMB_VFS_NEXT_OPEN(handle, smb_fname_base, fsp,
- flags, mode);
+ hostfd = SMB_VFS_NEXT_OPENAT(handle,
+ dirfsp,
+ smb_fname_base,
+ fsp,
+ flags,
+ mode);
if (hostfd == -1) {
rc = -1;
goto exit;
#ifdef HAVE_ATTROPEN
int fd = -1;
+ /*
+ * As there's no attropenat() this is only going to work with AT_FDCWD.
+ */
+ SMB_ASSERT(dirfsp->fh->fd == AT_FDCWD);
+
fd = attropen(smb_fname->base_name,
AFPRESOURCE_EA_NETATALK,
flags,
switch (config->rsrc) {
case FRUIT_RSRC_STREAM:
- fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
+ fd = SMB_VFS_NEXT_OPENAT(handle,
+ dirfsp,
+ smb_fname,
+ fsp,
+ flags,
+ mode);
break;
case FRUIT_RSRC_ADFILE:
return -1;
}
- fd = SMB_VFS_NEXT_OPEN(handle,
- fsp->fsp_name,
- fsp,
- fio->flags,
- fio->mode);
+ fd = SMB_VFS_NEXT_OPENAT(handle,
+ fsp->dirfsp,
+ fsp->fsp_name,
+ fsp,
+ fio->flags,
+ fio->mode);
if (fd == -1) {
DBG_ERR("On-demand create [%s] in write failed: %s\n",
fsp_str_dbg(fsp), strerror(errno));