Skip to content

Stale process.umask() value #18

@RyanZim

Description

@RyanZim

I'm working on jprichardson/node-fs-extra#619; and experimenting with switching our current implementation (an internal fork of mkdirp@0.x) to an internal fork of make-dir. In testing against our existing test suite, I discovered what seems to be a bug, and thought I'd report it upstream here.

The default mode is based on process.umask(), which is set here:

mode: 0o777 & (~process.umask()),

However, this is one static value, based on the process.umask() value at require-time. If the user sets the umask with process.umask(value) after requiring make-dir, the new umask will not be respected.

Fix for this would be to fetch defaults in a function, called at runtime, to get a fresh process.umask() call for every method call. Happy to submit a PR if this is confirmed as a bug.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions