Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-233

Race condition in req.sendfile().

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      In code for req.sendfile() if no length is supplied indicating how much data should be sent then a stat() is performed on the file to determine the amount of data in the file. The file is then opened and that much data sent.

      Technically this would be a problem if the file changed in between the stat() and sending the data. The result could be that not all data in the file is sent.

      To possibly avoid this problem, but also may improve efficiency of sending files, it would probably be better if an APR file bucket be created and added to the output bucket chain rather than mod_python itself reading data from the file and write it back in the response.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grahamd Graham Phillip Dumpleton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: