Skip to content
Tcl Source Code History Of Ticket 27b682284974d0cd
Login

History Of Ticket 27b682284974d0cd

Artifacts Associated With Ticket 27b682284974d0cd

  1. Ticket change [59328670a3] (rid 162268) by raimue on 2018-04-06 14:05:10:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The 'file delete' command can fail with "no such file or directory", but it is
      supposed to return successfully in this case.
      
      This can happen when another process removes the file exactly between the
      system calls to stat(2) and unlink(2) in TclFileDeleteCmd(), which is a classic
      TOCTTOU race condition.
      
      I will attach a patch that adds an additional check for the result of
      Tcl_FSDeleteFile() and if it was ENOENT, the command is considered successful.
      
    5. foundin initialized to: "8.5"
    6. is_private initialized to: "0"
    7. login: "raimue"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "6a91daf82c63c43a25145a0cf9805b11645e1aa7"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "raimue"
    14. subsystem initialized to: "37. File System"
    15. title initialized to:
      file delete can return an error if file was already deleted
      
    16. type initialized to: "Patch"
  2. Add attachment "file-delete-racecond.diff" [51168879d0] (rid 162269) by raimue on 2018-04-06 14:05:33.

  3. Ticket change [fa3b191db7] (rid 162277) by sebres on 2018-04-06 17:37:45:

    1. closedate changed to: "2458215.23455012"
    2. closer changed to: "sebres"
    3. icomment:
      I've fixed it in [5acb57c7aec45e05] (although other 8.5th branch, but if not whole accepted this commit can be easy cherry-picked into core-8-5-branch).
      
      Deviations from suggested patch: I've rewritten it also to catch the same race-condition in case of deleted directory.
      
      Thanks you Rainer.
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. severity changed to: "Severe"
    8. status changed to: "Closed"
    9. type changed to: "Bug"
  4. Ticket change [b092b10dd2] (rid 162278) by raimue on 2018-04-06 18:44:52:

    1. closedate changed to: "2458215.2811641"
    2. closer changed to: "raimue"
    3. icomment:
      Thank you for the quick response. Applying the same change to
      directories makes sense, it just did not occur to me.
      
      Looking at the patch, I see you removed
        result = TCL_ERROR;
      before the break statement, but I think this was actually needed as
      Tcl_FSRemoveDirectory() and Tcl_FSDeleteFile() return -1 on error.
      
    4. login: "raimue"
    5. mimetype: "text/plain"
  5. Ticket change [2de79b4b2f] (rid 162314) by sebres on 2018-04-09 10:12:02:

    1. closedate changed to: "2458217.92502732"
    2. closer changed to: "sebres"
    3. icomment:
      I was confused by the comment header of both.
      Corresponding it Tcl_FSDeleteFile as well as Tcl_FSRemoveDirectory returns "Standard Tcl error code" (what is indeed wrong).
      
      So fixed now in [6627aeef8ecda182] for TclFileDeleteCmd.
      
      But I guess we have to fix <a href="/tcl/artifact?udc=1&ln=4258-4259&name=d19e809a6c4d342c">all the comments "Returns" in tclIOUtil.c.
      </a>
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"