return NT_STATUS_OBJECT_NAME_INVALID;
}
+ /* Start with the full orig_path as given by the caller. */
+ if (!(state->smb_fname->base_name = talloc_strdup(state->smb_fname, state->orig_path))) {
+ DBG_ERR("talloc_strdup failed\n");
+ status = NT_STATUS_NO_MEMORY;
+ goto err;
+ }
+
+ /* Canonicalize any @GMT- paths. */
+ status = canonicalize_snapshot_path(state->smb_fname, ucf_flags, twrp);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto err;
+ }
+
/*
* If we trimmed down to a single '\0' character
* then we should use the "." directory to avoid
* As we know this is valid we can return true here.
*/
- if (!*state->orig_path) {
+ if (state->smb_fname->base_name[0] == '\0') {
if (!(state->smb_fname->base_name = talloc_strdup(state->smb_fname, "."))) {
status = NT_STATUS_NO_MEMORY;
goto err;
goto err;
}
- /* Start with the full orig_path as given by the caller. */
- if (!(state->smb_fname->base_name = talloc_strdup(state->smb_fname, state->orig_path))) {
- DBG_ERR("talloc_strdup failed\n");
- status = NT_STATUS_NO_MEMORY;
- goto err;
- }
-
- /* Canonicalize any @GMT- paths. */
- status = canonicalize_snapshot_path(state->smb_fname, ucf_flags, twrp);
- if (!NT_STATUS_IS_OK(status)) {
- goto err;
- }
-
/*
* Large directory fix normalization. If we're case sensitive, and
* the case preserving parameters are set to "no", normalize the case of