If KernelShark is running with Root privileges, do not save the settings in the standard location. Otherwise the configuration files will be owned by Root and later the normal user will have no access to those files. The patch seems to do the right thing in all cases that I tested, however there is definitely something that I do not understand. QDir::homePath() always returns the path to the home of the normal user, even if I build and run kernelshark as root (sudo -s). Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx> --- kernel-shark/src/KsMainWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 3402764..bd6c338 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -69,7 +69,7 @@ KsMainWindow::KsMainWindow(QWidget *parent) _contentsAction("Contents", this), _bugReportAction("Report a bug", this), _deselectShortcut(this), - _settings("kernelshark.org", "Kernel Shark") // organization , application + _settings(_getCacheDir() + "/setting.ini", QSettings::IniFormat) { setWindowTitle("Kernel Shark"); _createActions(); @@ -431,6 +431,9 @@ QString KsMainWindow::_getCacheDir() dir = QStandardPaths::writableLocation(appCachePath); dir += "/kernelshark"; + if (geteuid() == 0) + dir.replace(QDir::homePath(), "/root"); + if (!QDir(dir).exists()) lamMakePath(false); } -- 2.20.1