@@ -79,6 +79,8 @@ QStringList ApplicationRestarter::buildSudoEnvArgs()
7979 QStringList envArgs;
8080
8181 for (const QString &key : envKeys) {
82+ qWarning () << " [SUDO]"
83+ << " key:" << key << " value:" << env.value (key);
8284 envArgs << QString (" %1=%2" ).arg (key, env.value (key));
8385 }
8486
@@ -88,13 +90,17 @@ QStringList ApplicationRestarter::buildSudoEnvArgs()
8890#ifdef __linux__
8991void ApplicationRestarter::triggerRestartWithSudo ()
9092{
93+ qWarning () << " [SUDO]"
94+ << " Entered in triggerRestartWithSudo() - UID" << getuid ();
9195 if (getuid () == 0 ) {
9296 return ;
9397 }
9498
9599 ApplicationRestarter *instance = GetInstance ();
96100 QString executable;
97101
102+ qWarning () << " [SUDO]"
103+ << " qEnvironmentVariable(APPIMAGE):" << qEnvironmentVariable (" APPIMAGE" );
98104#ifdef __appimage__
99105 executable = qEnvironmentVariable (" APPIMAGE" );
100106 if (executable.isEmpty ()) {
@@ -104,7 +110,8 @@ void ApplicationRestarter::triggerRestartWithSudo()
104110#else
105111 executable = QFileInfo (instance->m_executable ).absoluteFilePath ();
106112#endif
107-
113+ qWarning () << " [SUDO]"
114+ << " executable:" << executable;
108115 QStringList pkexecArgs;
109116 pkexecArgs << " env"
110117 << " -i"
@@ -113,8 +120,13 @@ void ApplicationRestarter::triggerRestartWithSudo()
113120 pkexecArgs << executable;
114121 pkexecArgs << instance->m_arguments ;
115122
123+ qWarning () << " [SUDO]"
124+ << " pkexecargs:" << pkexecArgs;
125+
116126 QProcess::startDetached (" pkexec" , pkexecArgs, instance->m_currentPath );
117127 instance->m_restart = false ;
118128 qApp->exit ();
129+ qWarning () << " [SUDO]"
130+ << " exit triggerRestartWithSudo" ;
119131}
120132#endif
0 commit comments