Skip to content

cgo: backtick shell-execution allowed in cgo flags #1879

@gopherbot

Description

@gopherbot

by jimteeuwen:

What steps will reproduce the problem?

   // #cgo CFLAGS : -L`date`
   import "C"

What is the expected output?
Should sanitize -L`date` and pass 'date' to gcc as-is.

What do you see instead?
gcc: error: May: No such file or directory
gcc: error: 25: No such file or directory
gcc: error: 15:24:38: No such file or directory
gcc: error: CEST: No such file or directory
gcc: error: 2011: No such file or directory

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
linux (amd64)

Which revision are you using?  (hg identify)
c98449d685d2 weekly/weekly.2011-05-22

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions