[SERVER-20352] FTDC incorrectly checking return from boost::filesystem::create_directories Created: 10/Sep/15  Updated: 04/Jan/17  Resolved: 04/Feb/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.3.2

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: bkp, coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.2
Sprint: Integration 10 (02/22/16)
Participants:

 Description   

A false return indicates that the directory already exists, it is not used to signal errors.

Original description: Coverity analysis defect 73690: Unchecked return value

Value returned from a function is not checked for errors before being used

Defect 73690 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/db/sorter/sorter.cpp
Function mongo::SortedFileWriter<mongo::Value, mongo::Document>::SortedFileWriter(const mongo::SortOptions &, const std::pair<mongo::Value::SorterDeserializeSettings, mongo::Document::SorterDeserializeSettings> &)
/src/mongo/db/sorter/sorter.cpp, line: 817
Calling "create_directories" without checking return value (as is done elsewhere 1 out of 2 times).

        boost::filesystem::create_directories(opts.tempDir);

File: /src/mongo/db/sorter/sorter.cpp
Function mongo::SortedFileWriter<mongo::Value, mongo::Value>::SortedFileWriter(const mongo::SortOptions &, const std::pair<mongo::Value::SorterDeserializeSettings, mongo::Value::SorterDeserializeSettings> &)
/src/mongo/db/sorter/sorter.cpp, line: 817
Calling "create_directories" without checking return value (as is done elsewhere 1 out of 2 times).

        boost::filesystem::create_directories(opts.tempDir);



 Comments   
Comment by Githook User [ 04/Feb/16 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-20352 Correctly check for errors from boost::filesystem::create_directories
Branch: master
https://github.com/mongodb/mongo/commit/34b7d4013ec098761a52712e49c1458fb998f67f

Comment by Charlie Swanson [ 10/Sep/15 ]

Assigning to mathias, as git blame points to him as the most recent non-clang-format contributor around there

Generated at Thu Feb 08 03:53:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.