diff options
| author | acid-burn <acidburn@opendreambox.org> | 2009-10-03 11:29:04 +0200 |
|---|---|---|
| committer | acid-burn <acidburn@opendreambox.org> | 2009-10-03 11:29:04 +0200 |
| commit | aad3256fb995891065c9771bf2af8d3ad74527fc (patch) | |
| tree | 6654d5e367743aec8b682153faef37c1cce35c84 /main/bsod.cpp | |
| parent | 8b9b6e0b8e78557a6d7fba7fcb5b0d4052f3838a (diff) | |
| download | enigma2-aad3256fb995891065c9771bf2af8d3ad74527fc.tar.gz enigma2-aad3256fb995891065c9771bf2af8d3ad74527fc.zip | |
main/bsod.cpp: replace password configentry values with "X" before adding them to the crashlog.
So now no passwords from the enigma2 settings file are added to the crashlogs if crashlog anonymizations is disabled.
Attention: Only config entries named "password" are considered as password fields. So use "password" as the name of your password configentry. for example: config.myplugin.password !
Diffstat (limited to 'main/bsod.cpp')
| -rwxr-xr-x[-rw-r--r--] | main/bsod.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/main/bsod.cpp b/main/bsod.cpp index fde4146b..45f97c6b 100644..100755 --- a/main/bsod.cpp +++ b/main/bsod.cpp @@ -74,7 +74,7 @@ static std::string getConfigFileValue(const char *entry) { return configvalue; } - else // get Value from enigma2 settings file + else // get value from enigma2 settings file { FILE *f = fopen(configfile.c_str(), "r"); if (!f) @@ -119,7 +119,21 @@ static std::string getFileContent(const char *file) char line[1024]; if (!fgets(line, 1024, f)) break; - filecontent += line; + std::string tmp = line; + std::string password; + int pwdpos = tmp.find(".password=", 0); + if( pwdpos != std::string::npos) + { + filecontent += tmp.substr(0,pwdpos +10); + for ( int pos = pwdpos +10; pos < tmp.length()-1; ++pos ) + { + filecontent += "X"; + } + filecontent += "\n"; + } + else { + filecontent += line; + } } fclose(f); } |
