1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: smbd: Make extract_snapshot_token() a wrapper for extract_snapshot_token_internal().

Allows us to pass in path separator from a new function without
changing existing calling code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison 2022-12-15 13:24:12 -08:00 committed by Volker Lendecke
parent 96d68c6b8a
commit fdc6449a3f

View File

@ -287,14 +287,14 @@ bool clistr_is_previous_version_path(const char *path,
return true;
}
bool extract_snapshot_token(char *fname, NTTIME *twrp)
static bool extract_snapshot_token_internal(char *fname, NTTIME *twrp, char sep)
{
const char *start = NULL;
const char *next = NULL;
size_t remaining;
bool found;
found = find_snapshot_token(fname, '/', &start, &next, twrp);
found = find_snapshot_token(fname, sep, &start, &next, twrp);
if (!found) {
return false;
}
@ -305,6 +305,11 @@ bool extract_snapshot_token(char *fname, NTTIME *twrp)
return true;
}
bool extract_snapshot_token(char *fname, NTTIME *twrp)
{
return extract_snapshot_token_internal(fname, twrp, '/');
}
/*
* Take two absolute paths, figure out if "subdir" is a proper
* subdirectory of "parent". Return the component relative to the