Looks for @GMT- token in pathname.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
src_len,
flags);
}
+
+bool clistr_is_previous_version_path(const char *path)
+{
+ char *q;
+ time_t timestamp;
+ struct tm tm;
+ const char *p = strstr_m(path, "@GMT-");
+
+ if (p == NULL) {
+ return false;
+ }
+ if (p > path && (p[-1] != '\\')) {
+ return false;
+ }
+ q = strptime(p, GMT_FORMAT, &tm);
+ if (q == NULL) {
+ return false;
+ }
+ tm.tm_isdst = -1;
+ timestamp = timegm(&tm);
+ if (timestamp == (time_t)-1) {
+ return false;
+ }
+ if (q[0] != '\0' && q[0] != '\\') {
+ return false;
+ }
+ return true;
+}
const void *src,
int src_len,
int flags);
+bool clistr_is_previous_version_path(const char *path);
/* The following definitions come from libsmb/clitrans.c */