Descriptionsyscall, 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/ #
MessagesTotal messages: 1
|