From: Jeremy Allison Date: Thu, 15 Dec 2022 21:26:49 +0000 (-0800) Subject: s3: lib: Add new clistr_smb2_extract_snapshot_token() function. X-Git-Tag: talloc-2.4.0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=157a79f0ca45a19db0826a7b49ab0582e8191a68;p=thirdparty%2Fsamba.git s3: lib: Add new clistr_smb2_extract_snapshot_token() function. Strips @GMT from client pathnames for SMB2 (uses '\\' separator). Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c index 319f500368b..fc76f6fb0bb 100644 --- a/source3/lib/util_path.c +++ b/source3/lib/util_path.c @@ -310,6 +310,11 @@ bool extract_snapshot_token(char *fname, NTTIME *twrp) return extract_snapshot_token_internal(fname, twrp, '/'); } +bool clistr_smb2_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 diff --git a/source3/lib/util_path.h b/source3/lib/util_path.h index 5b0a1f13e38..7dd307f44dc 100644 --- a/source3/lib/util_path.h +++ b/source3/lib/util_path.h @@ -45,6 +45,7 @@ char *state_path(TALLOC_CTX *mem_ctx, const char *name); char *cache_path(TALLOC_CTX *mem_ctx, const char *name); char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path); bool extract_snapshot_token(char *fname, NTTIME *twrp); +bool clistr_smb2_extract_snapshot_token(char *fname, NTTIME *twrp); bool clistr_is_previous_version_path(const char *path, const char **startp, const char **endp,