This is not present in master as master has been converted to use struct
smb_filename.twrp instead of @GMT string tokens as part of the path.
Signed-off-by: Ralph Boehme <slow@samba.org>
const char *filename_in,
char **filename_out,
char **streamname_out);
+bool is_gmt_token(const char *path);
/* The following definitions come from lib/dummyroot.c */
}
return true;
}
+
+/**
+ * Checks whether the first part of path is a valid GMT token
+ */
+bool is_gmt_token(const char *path)
+{
+ struct tm tm;
+ char *p = NULL;
+
+ p = strptime(path, GMT_FORMAT, &tm);
+ if (p == NULL) {
+ /* Not a valid timestring. */
+ return false;
+ }
+ if (p[0] != '\0' && p[0] != '/') {
+ return false;
+ }
+ return true;
+}