Skip to content

prepend opts.dir || tmpDir to template if no path is given#144

Merged
silkentrance merged 1 commit intomasterfrom
gh-143
Nov 27, 2017
Merged

prepend opts.dir || tmpDir to template if no path is given#144
silkentrance merged 1 commit intomasterfrom
gh-143

Conversation

@silkentrance
Copy link
Copy Markdown
Collaborator

fix #143

@silkentrance silkentrance changed the title template option no longer accepts a path prepend opts.dir || tmpDir to template if no path is given Jul 14, 2017

Creates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`.

IMPORTANT NOTE: template no longer accepts a path. Use the dir option instead if you
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not apply because we still support full paths.

return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
var template = opts.template;
// make sure that we prepend the tmp path if none was given
if (path.basename(template) == template)
Copy link
Copy Markdown
Owner

@raszi raszi Nov 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be still a breaking change, but since this is still a beta software and most probably nobody used the template option as it is without a full path, therefore I am okay with the change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raszi Yes, this is somewhat breaking. And there may still exist security concerns for templates that resemble paths...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When using the template option tmp does not join paths with opts.dir or tmpDir if no path is given in the template

2 participants