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

Issue 11010043: syscall, runtime/cgo: if $LD_PRELOAD is set, use connec...

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

Description

syscall, runtime/cgo: if $LD_PRELOAD is set, use connect(), execve() in libc Fixes issue 3744. it needs https://codereview.appspot.com/11009043/ for cmd/cgo. status: all.bash still pass. tsocks go get xxx is woking if a small patch is applied to tsocks. --- tsocks-1.8/tsocks.c 2002-07-16 06:50:52.000000000 +0800 +++ tsocks-1.8-hacked/tsocks.c 2013-07-09 06:01:36.540725793 +0800 @@ -326,8 +326,13 @@ errno = ECONNREFUSED; return(-1); } else { + int old_flag = fcntl(__fd, F_GETFL); + if(old_flag & O_NONBLOCK) + fcntl(__fd, F_SETFL, old_flag & ~O_NONBLOCK); /* Now we call the main function to handle the connect. */ rc = handle_request(newconn); + if(old_flag & O_NONBLOCK) + fcntl(__fd, F_SETFL, old_flag); /* If the request completed immediately it mustn't have been * a non blocking socket, in this case we don't need to know * about this socket anymore. */

Patch Set 1 #

Patch Set 2 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 3 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 4 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 5 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 6 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 7 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 8 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 9 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 10 : diff -r 6083c3539707 https://code.google.com/p/go #

Patch Set 11 : diff -r e8b145221231 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -0 lines) Patch
A src/pkg/runtime/cgo/syscall_other.go View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
A src/pkg/runtime/cgo/syscall_unix.c View 1 1 chunk +14 lines, -0 lines 0 comments Download
A src/pkg/runtime/cgo/syscall_unix.go View 1 2 3 4 5 6 7 1 chunk +43 lines, -0 lines 0 comments Download
A src/pkg/syscall/syscall_cgo.go View 1 2 3 4 5 6 7 8 9 1 chunk +58 lines, -0 lines 0 comments Download
A src/pkg/syscall/syscall_cgo.s View 1 2 3 4 5 6 1 chunk +38 lines, -0 lines 0 comments Download
A src/pkg/syscall/syscall_nocgo.go View 1 2 3 4 5 6 7 8 9 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 1
rsc
10 years, 7 months ago (2013-09-06 19:21:19 UTC) #1
Let's leave this out of Go 1.2. If someone needs it we can point them at this
CL. I'm still just a little too creeped out by replacing connect (now that we
have the poller) and execve (since fork+exec has such delicate requirements).
Sign in to reply to this message.

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