mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Don't leak parent file descriptors to child processes
It is unexpected for the child process to inherit parent file descriptors. Requires Qt >= 6.6 and only affects Linux. Closes #10312. PR #22457.
This commit is contained in:
@@ -57,6 +57,9 @@ namespace
|
||||
info = {};
|
||||
|
||||
QProcess proc;
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
proc.start(exeName, {u"--version"_s}, QIODevice::ReadOnly);
|
||||
if (proc.waitForFinished() && (proc.exitCode() == QProcess::NormalExit))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user