[SERVER-70970] Check remove() API's return value Created: 31/Oct/22  Updated: 29/Oct/23  Resolved: 15/Dec/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-10-31 at 9.41.48 AM.png    
Issue Links:
Depends
is depended on by SERVER-71696 Coverity analysis defect 134259: Unch... Closed
Duplicate
is duplicated by SERVER-70887 Coverity analysis defect 134025: Unch... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-12-12, QE 2022-12-26
Participants:

 Description   

Unchecked return value from library

The function returns a value that indicates an error condition. If this is not checked, the error condition may not be handled correctly. Value returned from a library function is not checked for errors before being used. This value may indicate an error condition.
/src/mongo/db/storage/named_pipe_posix.cpp:49: CHECKED_RETURN 134052 Calling "remove(this->_pipeAbsolutePath.c_str())" without checking return value. This library function may fail and return an error code.



 Comments   
Comment by Githook User [ 30/Dec/22 ]

Author:

{'name': 'Kevin Cherkauer', 'email': 'kevin.cherkauer@mongodb.com', 'username': 'kevin-cherkauer'}

Message: SERVER-72441 Named Pipes: Suppress misleading "error" message from SERVER-70970
Branch: master
https://github.com/mongodb/mongo/commit/d88e203be2a206ddb2de326f7ba1c970f50d084b

Comment by Githook User [ 15/Dec/22 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-70970 Check remove()'s return value
Branch: master
https://github.com/mongodb/mongo/commit/d72f7e7b51438fb975e29ede81ba4822848295a1

Comment by Kyle Suarez [ 31/Oct/22 ]

The man page for remove(3) states

On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

Generated at Thu Feb 08 06:17:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.