[SERVER-39375] trafficRecordingFileToBSONArr must not close an unopened file Created: 05/Feb/19  Updated: 29/Oct/23  Resolved: 05/Feb/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 4.1.8

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2019-02-11
Participants:
Linked BF Score: 0

 Description   

The convertTrafficRecordingToBSON function in the shell calls trafficRecordingFileToBSONArr. When called on a non-existant file, this leaves inputFd <0, which causes crashes when ::close is invoked.

The fix is to move the guard which cleans up the file until after the check that it is valid



 Comments   
Comment by Githook User [ 05/Feb/19 ]

Author:

{'name': 'Jason Carey', 'email': 'jcarey@argv.me', 'username': 'hanumantmk'}

Message: SERVER-39375 fix trafficRecordingFileToBSONArr

The convertTrafficRecordingToBSON function in the shell calls
trafficRecordingFileToBSONArr. When called on a non-existant file, this
leaves inputFd <0, which causes crashes when ::close is invoked.

The fix is to move the guard which cleans up the file until after the
check that it is valid
Branch: master
https://github.com/mongodb/mongo/commit/8f7034ae18cf42ed4a60168850a5511525e5bca0

Generated at Thu Feb 08 04:51:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.