Skip to content

Commit

Permalink
Don't allow --cargo-build to smuggle flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jul 15, 2024
1 parent 0b53404 commit 6d3c40a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ pub fn write_deb(config: &Config, package_deb: &PackageConfig, &compress::Compre
pub fn cargo_build(config: &Config, target: Option<&str>, build_command: &str, build_flags: &[String], verbose: bool) -> CDResult<()> {
let mut cmd = Command::new("cargo");
cmd.current_dir(&config.package_manifest_dir);
cmd.args(build_command.split(' '));
cmd.args(build_command.split(' ')
.filter(|cmd| if !cmd.starts_with('-') { true } else {
log::error!("unexpected flag in build command name: {cmd}");
false
}));

cmd.args(build_flags);

Expand Down

0 comments on commit 6d3c40a

Please sign in to comment.