]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Remove tmp directory step from --init-tals/--init-as0-tals
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 14 Nov 2023 21:41:11 +0000 (15:41 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 14 Nov 2023 21:41:11 +0000 (15:41 -0600)
The code that handles these flags does not run with a cache context,
so the temporal file step was causing cache download issues despite
being completely unneeded.

src/http/http.c
src/thread_var.c

index 34fafdd4ede1e6038665a9793c09e8b557e08b8d..b02b54ee11d74ab4bfadeadfeb9c1e3c043315fb 100644 (file)
@@ -459,27 +459,5 @@ int
 http_direct_download(char const *remote, char const *dest)
 {
        bool changed;
-       char *tmp_file;
-       int error;
-
-       error = cache_tmpfile(&tmp_file);
-       if (error)
-               return error;
-
-       error = http_fetch(remote, tmp_file, 0, &changed);
-       if (error)
-               goto end;
-
-       /* Overwrite the original file */
-       pr_val_debug("Moving %s to %s.", tmp_file, dest);
-       error = rename(tmp_file, dest);
-       if (error) {
-               error = errno;
-               pr_val_err("Renaming temporal file from '%s' to '%s': %s",
-                   tmp_file, dest, strerror(error));
-               goto end;
-       }
-
-end:   free(tmp_file);
-       return error;
+       return http_fetch(remote, dest, 0, &changed);
 }
index f7be969cbc5a061cf5c77c1578a73102ef049ef4..1cc35be9e70aa28db89db85a00af43c1a1ab3077 100644 (file)
@@ -69,8 +69,8 @@ state_store(struct validation *state)
 }
 
 /*
- * Returns the current thread's validation state. Never returns NULL by
- * contract.
+ * Returns the current thread's validation state. Should not be used outside of
+ * validation threads.
  */
 struct validation *
 state_retrieve(void)