summaryrefslogtreecommitdiff
path: root/src/ostree/ot-remote-builtin-delete-cookie.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ostree/ot-remote-builtin-delete-cookie.c')
-rw-r--r--src/ostree/ot-remote-builtin-delete-cookie.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/ostree/ot-remote-builtin-delete-cookie.c b/src/ostree/ot-remote-builtin-delete-cookie.c
index cb1177fc..79778f77 100644
--- a/src/ostree/ot-remote-builtin-delete-cookie.c
+++ b/src/ostree/ot-remote-builtin-delete-cookie.c
@@ -36,16 +36,8 @@ static GOptionEntry option_entries[] = {
gboolean
ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error)
{
- g_autoptr(GOptionContext) context = NULL;
g_autoptr(OstreeRepo) repo = NULL;
- const char *remote_name;
- const char *domain;
- const char *path;
- const char *cookie_name;
- g_autofree char *jar_path = NULL;
- g_autofree char *cookie_file = NULL;
-
- context = g_option_context_new ("NAME DOMAIN PATH COOKIE_NAME- Remote one cookie from remote");
+ g_autoptr(GOptionContext) context = g_option_context_new ("NAME DOMAIN PATH COOKIE_NAME- Remote one cookie from remote");
if (!ostree_option_context_parse (context, option_entries, &argc, &argv,
OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
@@ -57,15 +49,12 @@ ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellabl
return FALSE;
}
- remote_name = argv[1];
- domain = argv[2];
- path = argv[3];
- cookie_name = argv[4];
-
- cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name);
- jar_path = g_build_filename (gs_file_get_path_cached (repo->repodir), cookie_file, NULL);
-
- if (!ot_delete_cookie_at (AT_FDCWD, jar_path, domain, path, cookie_name, error))
+ const char *remote_name = argv[1];
+ const char *domain = argv[2];
+ const char *path = argv[3];
+ const char *cookie_name = argv[4];
+ g_autofree char *cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name);
+ if (!ot_delete_cookie_at (ostree_repo_get_dfd (repo), cookie_file, domain, path, cookie_name, error))
return FALSE;
return TRUE;