From 39b45a081d1c37121f093cafff6937dd8ea5cc79 Mon Sep 17 00:00:00 2001 From: Moss Date: Sat, 1 Oct 2022 14:39:29 -0400 Subject: [PATCH] Cookies: Added Clean Up After Getting Firefox Cookies --- src/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 1a2b17b..35441d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,6 +181,16 @@ std::vector get_cookies_from_firefox(const std::filesystem:: session.get_value_from_db(db, "FROM moz_cookies WHERE host LIKE '%dropout.tv%'", "value"); sqlite3_close(db); + + std::filesystem::remove("tmp/firefox_cookies.sqlite"); + + if (std::filesystem::is_empty("tmp")) { + std::filesystem::remove("tmp/"); + } + } + else { + std::cerr << "FIREFOX COOKIE ERROR: Attempted to get cookies from firefox without profile." << std::endl; + exit(4); } if (verbose) { @@ -246,6 +256,10 @@ std::vector get_cookies_from_chrome(const std::filesystem::p sqlite3_close(db); } + else { + std::cerr << "CHROME COOKIE ERROR: Attempted to get cookies from chrome without profile." << std::endl; + exit(4); + } auth.chrome_decrypt();