mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
09437d8cd4
Before this patch, `libhostname.so` and `chkhostname` were a test facility for overriding `gethostname()` in non-debug builds on Linux and other Unix platforms supporting `LD_PRELOAD`. `gethostname()` has a single use with SMTP. The alternative way to override `gethostname()` is building in debug mode, which allows to do this via the `CURL_GETHOSTNAME` env, on all platforms. Drop the `LD_PRELOAD` solution in favour of the above. Also: - delete inactive NTLM code with a `gethostname()` call made from it. - streamline NTLM code by dropping a `printf()` and a macro. - tests: stop setting `CURL_GETHOSTNAME` where unnecessary. Closes #14695
106 lines
2.7 KiB
Plaintext
106 lines
2.7 KiB
Plaintext
<testcase>
|
|
<info>
|
|
<keywords>
|
|
HTTP
|
|
HTTP POST
|
|
HTTP NTLM auth
|
|
</keywords>
|
|
</info>
|
|
# Server-side
|
|
<reply>
|
|
|
|
<data>
|
|
HTTP/1.1 200 Thanks for this! swsclose
|
|
Content-Length: 25
|
|
|
|
This is the final page !
|
|
</data>
|
|
|
|
<data1001>
|
|
HTTP/1.1 401 Now gimme that second request of crap
|
|
Server: Microsoft-IIS/5.0
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
Content-Length: 34
|
|
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
|
|
|
|
This is not the real page either!
|
|
</data1001>
|
|
|
|
# This is supposed to be returned when the server gets the second
|
|
# Authorization: NTLM line passed-in from the client
|
|
<data1002>
|
|
HTTP/1.1 302 Thanks for this, but we want to redir you!
|
|
Server: Microsoft-IIS/5.0
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
Location: /%TESTNUMBER
|
|
Content-Length: 34
|
|
|
|
This is not the real page either!
|
|
</data1002>
|
|
|
|
<datacheck>
|
|
HTTP/1.1 401 Now gimme that second request of crap
|
|
Server: Microsoft-IIS/5.0
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
Content-Length: 34
|
|
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
|
|
|
|
HTTP/1.1 302 Thanks for this, but we want to redir you!
|
|
Server: Microsoft-IIS/5.0
|
|
Content-Type: text/html; charset=iso-8859-1
|
|
Location: /%TESTNUMBER
|
|
Content-Length: 34
|
|
|
|
HTTP/1.1 200 Thanks for this! swsclose
|
|
Content-Length: 25
|
|
|
|
This is the final page !
|
|
</datacheck>
|
|
|
|
</reply>
|
|
|
|
# Client-side
|
|
<client>
|
|
<features>
|
|
NTLM
|
|
SSL
|
|
!SSPI
|
|
Debug
|
|
</features>
|
|
<server>
|
|
http
|
|
</server>
|
|
<name>
|
|
HTTP POST with NTLM authorization and following a 302 redirect
|
|
</name>
|
|
<command>
|
|
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L -d "stuff to send away"
|
|
</command>
|
|
</client>
|
|
|
|
# Verify data after the test has been "shot"
|
|
<verify>
|
|
POST /%TESTNUMBER HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
|
|
User-Agent: curl/%VERSION
|
|
Accept: */*
|
|
Content-Length: 0
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
POST /%TESTNUMBER HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
|
|
User-Agent: curl/%VERSION
|
|
Accept: */*
|
|
Content-Length: 18
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
stuff to send awayGET /%TESTNUMBER HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
User-Agent: curl/%VERSION
|
|
Accept: */*
|
|
|
|
</verify>
|
|
</testcase>
|