Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2069)

Issue 4532092: code review 4532092: cgo: restrict #cgo directives to prevent shell expansion (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by niemeyer
Modified:
13 years, 10 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

cgo: restrict #cgo directives to prevent shell expansion Fixes issue #1879. Directives were not directly expanded, but since their content ended up in makefiles, further expansion would take place there. This prevents such artifacts by restricting the set of characters that may be used in a directive value. To build the list of safe characters I went through the contents of /usr/lib/pkgconfig and extracted LDFLAGS and CFLAGS information, so hopefully this is a reasonable default to get started.

Patch Set 1 #

Patch Set 2 : code review 4532092: cgo: restrict #cgo directives to prevent shell expansion #

Patch Set 3 : code review 4532092: cgo: restrict #cgo directives to prevent shell expansion #

Patch Set 4 : diff -r 01b6a240e0b7 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 01b6a240e0b7 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r c843ae19e7c2 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -2 lines) Patch
M src/cmd/cgo/gcc.go View 1 2 3 3 chunks +7 lines, -2 lines 0 comments Download

Messages

Total messages: 3
niemeyer
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 10 months ago (2011-05-27 02:02:44 UTC) #1
rsc
Lgtm On May 26, 2011 10:02 PM, <n13m3y3r@gmail.com> wrote: > Reviewers: rsc, > > Message: ...
13 years, 10 months ago (2011-05-27 03:18:13 UTC) #2
niemeyer
13 years, 10 months ago (2011-05-27 11:46:57 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=8e99d1651850 ***

cgo: restrict #cgo directives to prevent shell expansion

Fixes issue #1879.

Directives were not directly expanded, but since their
content ended up in makefiles, further expansion would
take place there.  This prevents such artifacts by
restricting the set of characters that may be used in
a directive value.

To build the list of safe characters I went through the
contents of /usr/lib/pkgconfig and extracted LDFLAGS
and CFLAGS information, so hopefully this is a
reasonable default to get started.

R=rsc
CC=golang-dev
http://codereview.appspot.com/4532092
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b