Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

silkentrance
Copy link
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
@@ -237,10 +237,14 @@ console.log('Dir: ', tmpobj.name);

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
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
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
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
2 participants