;
}
-static int skel_mkdir(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode)
-{
- errno = ENOSYS;
- return -1;
-}
-
static int skel_mkdirat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.seekdir_fn = skel_seekdir,
.telldir_fn = skel_telldir,
.rewind_dir_fn = skel_rewind_dir,
- .mkdir_fn = skel_mkdir,
.mkdirat_fn = skel_mkdirat,
.rmdir_fn = skel_rmdir,
.closedir_fn = skel_closedir,
SMB_VFS_NEXT_REWINDDIR(handle, dirp);
}
-static int skel_mkdir(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode)
-{
- return SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
-}
-
static int skel_mkdirat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.seekdir_fn = skel_seekdir,
.telldir_fn = skel_telldir,
.rewind_dir_fn = skel_rewind_dir,
- .mkdir_fn = skel_mkdir,
.mkdirat_fn = skel_mkdirat,
.rmdir_fn = skel_rmdir,
.closedir_fn = skel_closedir,
SMBPROFILE_STATS_BASIC(syscall_seekdir) \
SMBPROFILE_STATS_BASIC(syscall_telldir) \
SMBPROFILE_STATS_BASIC(syscall_rewinddir) \
- SMBPROFILE_STATS_BASIC(syscall_mkdir) \
SMBPROFILE_STATS_BASIC(syscall_mkdirat) \
SMBPROFILE_STATS_BASIC(syscall_rmdir) \
SMBPROFILE_STATS_BASIC(syscall_closedir) \
/* Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT. */
/* Version 42 - Move SMB_VFS_READLINK -> SMB_VFS_READLINKAT. */
/* Version 42 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT. */
-/* Version 42 - Add SMB_VFS_MKDIRAT. */
+/* Version 42 - Move SMB_VFS_MKDIR -> SMB_VFS_MKDIRAT. */
#define SMB_VFS_INTERFACE_VERSION 42
void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset);
long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
- int (*mkdir_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode);
int (*mkdirat_fn)(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
DIR *dirp);
void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
DIR *dirp);
-int smb_vfs_call_mkdir(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode);
int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset);
long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp);
void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp);
-int vfs_not_implemented_mkdir(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode);
int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
#define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
smb_vfs_call_rewind_dir((handle)->next, (dirp))
-#define SMB_VFS_MKDIR(conn, smb_fname, mode) \
- smb_vfs_call_mkdir((conn)->vfs_handles,(smb_fname), (mode))
-#define SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode) \
- smb_vfs_call_mkdir((handle)->next,(smb_fname), (mode))
-
#define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
#define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
END_PROFILE(syscall_rewinddir);
}
-static int vfswrap_mkdir(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode)
-{
- int result;
- const char *path = smb_fname->base_name;
- char *parent = NULL;
-
- START_PROFILE(syscall_mkdir);
-
- if (lp_inherit_acls(SNUM(handle->conn))
- && parent_dirname(talloc_tos(), path, &parent, NULL)
- && directory_has_default_acl(handle->conn, parent)) {
- mode = (0777 & lp_directory_mask(SNUM(handle->conn)));
- }
-
- TALLOC_FREE(parent);
-
- result = mkdir(path, mode);
-
- END_PROFILE(syscall_mkdir);
- return result;
-}
-
static int vfswrap_mkdirat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.seekdir_fn = vfswrap_seekdir,
.telldir_fn = vfswrap_telldir,
.rewind_dir_fn = vfswrap_rewinddir,
- .mkdir_fn = vfswrap_mkdir,
.mkdirat_fn = vfswrap_mkdirat,
.rmdir_fn = vfswrap_rmdir,
.closedir_fn = vfswrap_closedir,
;
}
-int vfs_not_implemented_mkdir(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode)
-{
- errno = ENOSYS;
- return -1;
-}
-
int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
.seekdir_fn = vfs_not_implemented_seekdir,
.telldir_fn = vfs_not_implemented_telldir,
.rewind_dir_fn = vfs_not_implemented_rewind_dir,
- .mkdir_fn = vfs_not_implemented_mkdir,
.mkdirat_fn = vfs_not_implemented_mkdirat,
.rmdir_fn = vfs_not_implemented_rmdir,
.closedir_fn = vfs_not_implemented_closedir,
handle->fns->rewind_dir_fn(handle, dirp);
}
-int smb_vfs_call_mkdir(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- mode_t mode)
-{
- VFS_FIND(mkdir);
- return handle->fns->mkdir_fn(handle, smb_fname, mode);
-}
-
int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname,