-
Notifications
You must be signed in to change notification settings - Fork 93
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,11 @@ function _generateTmpName(opts) { | |
|
||
// mkstemps like template | ||
if (opts.template) { | ||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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... |
||
template = path.join(opts.dir || tmpDir, template); | ||
return template.replace(TEMPLATE_PATTERN, _randomChars(6)); | ||
} | ||
|
||
// prefix and postfix | ||
|
There was a problem hiding this comment.
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.