summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-09-02 13:15:58 -0700
committerDan Fandrich <dan@coneharvesters.com>2011-09-02 13:22:20 -0700
commitded3638d972f4512b4e90aaec1625b9b0890b233 (patch)
tree99b4ce3bba196fdbc83aa89e6a5f9c990fbfe50f
parent9194e1700312f27c6e2abdfb1f604e130497e887 (diff)
downloadgnurl-ded3638d972f4512b4e90aaec1625b9b0890b233.tar.gz
gnurl-ded3638d972f4512b4e90aaec1625b9b0890b233.tar.bz2
gnurl-ded3638d972f4512b4e90aaec1625b9b0890b233.zip
Fix NTLM winbind support to pass the torture tests
Calling sclose() both in the child and the parent fools the socket leak detector into thinking it's been closed twice. Calling close() in the child instead overcomes this problem. It's not as portable as the sclose() macro, but this code is highly POSIX-specific, anyway.
-rw-r--r--lib/curl_ntlm_wb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c
index b9cc314ef..ff7339373 100644
--- a/lib/curl_ntlm_wb.c
+++ b/lib/curl_ntlm_wb.c
@@ -166,8 +166,8 @@ static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp)
* child process
*/
- sclose(sockfds[0]);
-
+ /* Don't use sclose in the child since it fools the socket leak detector */
+ close(sockfds[0]);
if(dup2(sockfds[1], STDIN_FILENO) == -1) {
error = ERRNO;
failf(conn->data, "Could not redirect child stdin. errno %d: %s",
@@ -197,7 +197,7 @@ static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp)
NULL);
error = ERRNO;
- sclose(sockfds[1]);
+ close(sockfds[1]);
failf(conn->data, "Could not execl(). errno %d: %s",
error, Curl_strerror(conn, error));
exit(1);