Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e5372f042ee517ffa4efda6dc11a5f28a6c0e2bdf0f74675671f0445220a1038
Ticket: cd609219f5522f3191a68a84deb51a968dfb8cac
directory creation temporarily changes the umask
User & Date: serhiy.storchaka on 2026-10-17 09:00:11
Changes

  1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
  2. icomment:
    Confirmed, and worse than temporary: with several threads running <nowiki>[file mkdir]</nowiki>, the process umask ends up permanently at 0, so later files are created world-writable (main, 9.0, 8.6).
    Proposed fix in branch [/timeline?r=mkdir-no-umask-call|mkdir-no-umask-call], with [623585ffff]: call mkdir(path, 0777) and let the kernel apply the umask; umask() is not called any more. The permissions of new directories do not change. Test unixFCmd-5.2.
    The old code also meant to always add u+rwx, but that never worked, because mkdir() applies the umask once more (umask 0700 gives 077). It could be done with chmod() after mkdir(), but that would change the permissions of new directories under such umasks, and it is not documented, so the branch does not do it.
    
  3. login: "serhiy.storchaka"
  4. mimetype: "text/x-fossil-wiki"