*/
NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
+ uint32_t ucf_flags,
NTTIME twrp)
{
- char *startp = strchr_m(smb_fname->base_name, '@');
+ char *startp = NULL;
char *endp = NULL;
char *tmp = NULL;
struct tm tm;
smb_fname->twrp = twrp;
}
+ if (!(ucf_flags & UCF_GMT_PATHNAME)) {
+ return NT_STATUS_OK;
+ }
+
+ startp = strchr_m(smb_fname->base_name, '@');
if (startp == NULL) {
/* No @ */
return NT_STATUS_OK;
bool name_has_wildcard;
bool posix_pathnames;
bool allow_wcard_last_component;
- bool snapshot_path;
bool done;
};
.ucf_flags = ucf_flags,
.posix_pathnames = (ucf_flags & UCF_POSIX_PATHNAMES),
.allow_wcard_last_component = (ucf_flags & UCF_ALWAYS_ALLOW_WCARD_LCOMP),
- .snapshot_path = (ucf_flags & UCF_GMT_PATHNAME),
};
*smb_fname_out = NULL;
}
/* Canonicalize any @GMT- paths. */
- if (state->snapshot_path) {
- status = canonicalize_snapshot_path(state->smb_fname, twrp);
- if (!NT_STATUS_IS_OK(status)) {
- goto err;
- }
+ status = canonicalize_snapshot_path(state->smb_fname, ucf_flags, twrp);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto err;
}
/*
TALLOC_FREE(fname);
return NULL;
}
- status = canonicalize_snapshot_path(smb_fname, 0);
+ status = canonicalize_snapshot_path(smb_fname,
+ ucf_flags,
+ 0);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(fname);
TALLOC_FREE(smb_fname);
NTSTATUS check_name(connection_struct *conn,
const struct smb_filename *smb_fname);
NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
+ uint32_t ucf_flags,
NTTIME twrp);
int get_real_filename(connection_struct *conn,
struct smb_filename *path,
};
/* Removes @GMT tokens if any */
- status = canonicalize_snapshot_path(&target_fname, 0);
+ status = canonicalize_snapshot_path(&target_fname, UCF_GMT_PATHNAME, 0);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
};
/* Removes @GMT tokens if any */
- status = canonicalize_snapshot_path(&target_fname, 0);
+ status = canonicalize_snapshot_path(&target_fname, UCF_GMT_PATHNAME, 0);
if (!NT_STATUS_IS_OK(status)) {
return status;
}