mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 06:56:28 -05:00
Guard lower close_range call with fd > 3 in os_exec_script
Some checks failed
Some checks failed
This commit is contained in:
parent
588b670572
commit
dec765f8ac
1 changed files with 4 additions and 3 deletions
|
|
@ -839,7 +839,8 @@ int os_script(char** argv, char** envp, const char* run_as_user)
|
||||||
*
|
*
|
||||||
* For scripts we cannot set fd as CLOEXEC.
|
* For scripts we cannot set fd as CLOEXEC.
|
||||||
*/
|
*/
|
||||||
close_range(3, fd - 1, CLOSE_RANGE_CLOEXEC);
|
if (fd > 3)
|
||||||
|
close_range(3, fd - 1, CLOSE_RANGE_CLOEXEC);
|
||||||
close_range(fd + 1, ~0U, CLOSE_RANGE_CLOEXEC);
|
close_range(fd + 1, ~0U, CLOSE_RANGE_CLOEXEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue