mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 03:28:41 -07: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:
parent
627d89813c
commit
d21653e8cf
6 changed files with 20 additions and 3 deletions
|
@ -674,6 +674,9 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
|
|||
QProcess proc;
|
||||
proc.setProgram(command);
|
||||
proc.setArguments(args);
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
|
||||
if (proc.startDetached())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue