From: Colin Walters Date: Thu, 7 Sep 2017 01:30:13 +0000 (-0400) Subject: lib/pull: Only look for cookie files for non-local remotes X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~32^2~33 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=db6135f5b3a27fa06116568f769d96c62af78b62;p=ostree.git lib/pull: Only look for cookie files for non-local remotes Just noticed this while reading an strace. Closes: https://github.com/ostreedev/ostree/issues/1139 Closes: #1145 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index d233b384..4a2a0fcd 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -2743,18 +2743,19 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self, _ostree_fetcher_set_proxy (fetcher, http_proxy); } - { - g_autofree char *cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name); - /* TODO; port away from this; a bit hard since both libsoup and libcurl - * expect a file. Doing ot_fdrel_to_gfile() works for now though. - */ - GFile*repo_path = ostree_repo_get_path (self); - g_autofree char *jar_path = - g_build_filename (gs_file_get_path_cached (repo_path), cookie_file, NULL); - - if (g_file_test (jar_path, G_FILE_TEST_IS_REGULAR)) - _ostree_fetcher_set_cookie_jar (fetcher, jar_path); - } + if (!_ostree_repo_remote_name_is_file (remote_name)) + { + g_autofree char *cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name); + /* TODO; port away from this; a bit hard since both libsoup and libcurl + * expect a file. Doing ot_fdrel_to_gfile() works for now though. + */ + GFile*repo_path = ostree_repo_get_path (self); + g_autofree char *jar_path = + g_build_filename (gs_file_get_path_cached (repo_path), cookie_file, NULL); + + if (g_file_test (jar_path, G_FILE_TEST_IS_REGULAR)) + _ostree_fetcher_set_cookie_jar (fetcher, jar_path); + } success = TRUE;