aboutsummaryrefslogtreecommitdiff
path: root/src/toast.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-06-29 20:12:20 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-06-29 20:12:20 +0200
commitccd667be067a5148545d7ccc958e29e65a2ac458 (patch)
treecd3373253bf68835a523ddc7894d4b47c07a5ce4 /src/toast.c
parent8f946f8dd153c367fc026a3e860757a55c547b7b (diff)
downloadOFQT-ccd667be067a5148545d7ccc958e29e65a2ac458.tar.gz
OFQT-ccd667be067a5148545d7ccc958e29e65a2ac458.zip
validate revisions, set threads to 4, do not allow concurent updates
Diffstat (limited to 'src/toast.c')
-rw-r--r--src/toast.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/toast.c b/src/toast.c
index 475847c..4c26142 100644
--- a/src/toast.c
+++ b/src/toast.c
@@ -348,7 +348,7 @@ struct revision_t* getRevisionData(char* url, int rev)
json_object_object_get_ex(file, "path", &temp);
assert(temp);
- revision->files[i].path = strdup(json_object_get_string(temp));
+ revision->files[i].path = normalizeUnixPath(strdup(json_object_get_string(temp)));
json_object_object_get_ex(file, "hash", &temp);
if (temp)
@@ -419,7 +419,7 @@ struct revision_t* fastFowardRevisions(char* url, int from, int to)
rev->files[rev->file_count].type = cur_rev->files[j].type;
if (cur_rev->files[j].path)
- rev->files[rev->file_count].path = strdup(cur_rev->files[j].path);
+ rev->files[rev->file_count].path = normalizeUnixPath(strdup(cur_rev->files[j].path));
else
rev->files[rev->file_count].path = NULL;
@@ -515,6 +515,7 @@ size_t downloadObject(char* dir, char* url, struct file_info* info)
* 0 on success
* 1 on missing object
* 2 on general failure
+ * 3 on invalid path
*/
int applyObject(char* path, struct file_info* info)
{
@@ -526,6 +527,8 @@ int applyObject(char* path, struct file_info* info)
if (!path || !isDir(path))
return 2;
+ else if (!isRelativePath(file) || leavesRelativePath(file))
+ return 3;
else if (!object)
return 0;