mirror of
https://github.com/samba-team/samba.git
synced 2025-03-16 06:50:24 +03:00
s3: smbd: Allow extract_snapshot_token() to cope with MSDFS paths.
"raw" MSDFS paths are passed here as \server\share\path. find_snapshot_token() only looks for a '/' as a separator in SMB1 shapshot paths. Allow extract_snapshot_token() to cope with SMB1 MSDFS paths by converting in place, looking for the @GMT token with a '/' separator via find_snapshot_token(), and then converting back. Note, this a temporary measure until we handle DFS paths better and will be removed in the next patchset. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
8b9fdc8ab1
commit
7a823d44d2
@ -306,8 +306,22 @@ bool extract_snapshot_token(char *fname, uint32_t ucf_flags, NTTIME *twrp)
|
||||
const char *next = NULL;
|
||||
size_t remaining;
|
||||
bool found;
|
||||
bool posix_path = (ucf_flags & UCF_POSIX_PATHNAMES);
|
||||
bool msdfs_path = (ucf_flags & UCF_DFS_PATHNAME);
|
||||
|
||||
if (msdfs_path && !posix_path) {
|
||||
/*
|
||||
* A raw (non-POSIX) MSDFS path looks like \server\share\path.
|
||||
* find_snapshot_token only looks for '/' separators.
|
||||
* Convert the separator characters in place.
|
||||
*/
|
||||
string_replace(fname, '\\', '/');
|
||||
}
|
||||
found = find_snapshot_token(fname, &start, &next, twrp);
|
||||
if (msdfs_path && !posix_path) {
|
||||
/* Put the original separators back. */
|
||||
string_replace(fname, '/', '\\');
|
||||
}
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user