return -1;
}
- ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
- if (ret == 0) {
+ /*
+ * We know the unlink should succeed as the ACL
+ * check is already done in the caller. Remove the
+ * file *after* the streams.
+ */
+ {
char *dirname = stream_dir(handle, smb_fname_base,
&smb_fname_base->st, false);
TALLOC_FREE(dirname);
}
+ ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
TALLOC_FREE(smb_fname_base);
return ret;
}
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname_base);
- if (ret == 0) {
+ /*
+ * We know the rmdir should succeed as the ACL
+ * check is already done in the caller. Remove the
+ * directory *after* the streams.
+ */
+ {
char *dirname = stream_dir(handle, smb_fname_base,
&smb_fname_base->st, false);
TALLOC_FREE(dirname);
}
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname_base);
TALLOC_FREE(smb_fname_base);
return ret;
}