const struct smb_filename *smb_fname)
{
TALLOC_CTX *ctx = talloc_tos();
- char *dname = NULL;
- struct smb_filename *smb_fname_parent;
+ struct smb_filename *smb_fname_parent = NULL;
bool ret;
if (!CAN_WRITE(conn)) {
}
/* Get the parent directory permission mask and owners. */
- if (!parent_dirname(ctx, smb_fname->base_name, &dname, NULL)) {
- return False;
- }
-
- smb_fname_parent = synthetic_smb_fname(ctx,
- dname,
- NULL,
- NULL,
- smb_fname->flags);
- if (smb_fname_parent == NULL) {
- ret = false;
- goto out;
+ ret = parent_smb_fname(ctx, smb_fname, &smb_fname_parent, NULL);
+ if (ret != true) {
+ return false;
}
if(SMB_VFS_STAT(conn, smb_fname_parent) != 0) {
false,
FILE_DELETE_CHILD));
out:
- TALLOC_FREE(dname);
TALLOC_FREE(smb_fname_parent);
return ret;
}