Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40953

Shell history file accesses should capture errno earlier

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.13
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2019-05-06, Sharding 2019-05-20, Sharding 2019-06-03

      Description

      In this code

      std::stringstream ss;
      ss << "Unable to " << what << " file " << filename << ": " << mongo::errnoWithDescription();
      

      errno is captured too late — it may have been reset by the stringstream by the time errnoWithDescription() uses it.

      There are also a few places where closing the file in response to an error, clobbers the actual errno of interest.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: