-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: remove unsafe exec() in forc_template.rs #7610
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
base: master
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -21,9 +21,16 @@ pub fn init(command: TemplateCommand) -> Result<()> { | |
| .clone() | ||
| .unwrap_or_else(|| format!("{}-template-source", command.project_name)); | ||
|
|
||
| let reference = if let Some(rev) = &command.rev { | ||
| source::git::Reference::Rev(rev.clone()) | ||
| } else if let Some(tag) = &command.tag { | ||
| source::git::Reference::Tag(tag.clone()) | ||
| } else { | ||
| source::git::Reference::DefaultBranch | ||
| }; | ||
| let source = source::git::Source { | ||
| repo: Url::from_str(&command.url)?, | ||
| reference: source::git::Reference::DefaultBranch, | ||
| reference, | ||
|
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. Misleading "HEAD" log message for tag/rev referencesLow Severity The Reviewed by Cursor Bugbot for commit 57c03a8. Configure here. |
||
| }; | ||
|
|
||
| let current_dir = &env::current_dir()?; | ||
|
|
||


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.
Silently ignores
--tagwhen--revalso providedLow Severity
The
--tagand--revCLI options lack aconflicts_withdeclaration, so both can be specified simultaneously. When a user provides both,--revsilently takes priority and--tagis ignored without warning. The codebase already usesconflicts_withfor mutually exclusive options (e.g., inshared.rs). Users providing both flags likely have a misconfigured command and deserve a clear error rather than silent precedence.Additional Locations (1)
forc/src/cli/commands/template.rs#L25-L32Reviewed by Cursor Bugbot for commit 57c03a8. Configure here.