char *stripped;
NTSTATUS status;
char *conv;
+ struct smb_filename *smb_fname = NULL;
if (!snapper_gmt_strip_snapshot(talloc_tos(), handle,
fsp->fsp_name->base_name,
if (conv == NULL) {
return map_nt_error_from_unix(errno);
}
- status = SMB_VFS_NEXT_GET_NT_ACL(handle, conv, security_info,
- mem_ctx, ppdesc);
+
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
TALLOC_FREE(conv);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info,
+ mem_ctx, ppdesc);
+ TALLOC_FREE(smb_fname);
return status;
}
static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
- const char *fname,
+ const struct smb_filename *fname,
uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
char *stripped;
NTSTATUS status;
char *conv;
+ struct smb_filename *smb_fname = NULL;
- if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname,
+ if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname->base_name,
×tamp, &stripped)) {
return map_nt_error_from_unix(errno);
}
if (conv == NULL) {
return map_nt_error_from_unix(errno);
}
- status = SMB_VFS_NEXT_GET_NT_ACL(handle, conv, security_info,
- mem_ctx, ppdesc);
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
TALLOC_FREE(conv);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info,
+ mem_ctx, ppdesc);
+ TALLOC_FREE(smb_fname);
return status;
}
static int snapper_gmt_mkdir(vfs_handle_struct *handle,
- const char *fname, mode_t mode)
+ const struct smb_filename *fname,
+ mode_t mode)
{
time_t timestamp;
char *stripped;
int ret, saved_errno;
char *conv;
+ struct smb_filename *smb_fname = NULL;
- if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname,
+ if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname->base_name,
×tamp, &stripped)) {
return -1;
}
if (conv == NULL) {
return -1;
}
- ret = SMB_VFS_NEXT_MKDIR(handle, conv, mode);
- saved_errno = errno;
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
TALLOC_FREE(conv);
+ if (smb_fname == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ ret = SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
+ saved_errno = errno;
+ TALLOC_FREE(smb_fname);
errno = saved_errno;
return ret;
}