From 8fbe3b446358d220f916246ee06b35df8f8f5685 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 8 Oct 2020 10:06:05 +0200 Subject: [PATCH] incognito: make sure prefs file is not loaded/saved in any circumstances --- client/src/preferences.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/preferences.c b/client/src/preferences.c index 414797cac..5b5b9bee9 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -79,6 +79,11 @@ int preferences_load(void) { setDefaultPath (spTrace, "."); */ + if (session.incognito) { + PrintAndLogEx(INFO, "No preferences file will be loaded"); + return PM3_SUCCESS; + } + // loadFileJson wants these, so pass in place holder values, though not used // in settings load; uint8_t dummyData = 0x00; @@ -101,7 +106,10 @@ int preferences_load(void) { // Save all settings from memory (struct) to file int preferences_save(void) { // Note sure if backup has value ? - + if (session.incognito) { + PrintAndLogEx(INFO, "No preferences file will be saved"); + return PM3_SUCCESS; + } PrintAndLogEx(INFO, "Saving preferences..."); char *fn = prefGetFilename(); @@ -986,8 +994,7 @@ static int CmdPrefShow(const char *Cmd) { PrintAndLogEx(INFO, "Using "_YELLOW_("%s"), fn); free(fn); } else { - PrintAndLogEx(ERR, "Preferences not loaded"); - return PM3_ESOFT; + PrintAndLogEx(WARNING, "Preferences file not loaded"); } PrintAndLogEx(INFO, "Current settings");