Author: abartlet Date: 2007-01-29 03:59:10 +0000 (Mon, 29 Jan 2007) New Revision: 713
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=713 Log: Michael Baltaks <[EMAIL PROTECTED]> notices that we should only send "Proxy-Authenticate" replies when we are in a forward proxy. Otherwise, we should send WWW-Authenticate headers, as if we are the target server. Andrew Bartlett Modified: trunk/mod_auth_ntlm_winbind/mod_auth_ntlm_winbind.c Changeset: Modified: trunk/mod_auth_ntlm_winbind/mod_auth_ntlm_winbind.c =================================================================== --- trunk/mod_auth_ntlm_winbind/mod_auth_ntlm_winbind.c 2007-01-24 06:11:23 UTC (rev 712) +++ trunk/mod_auth_ntlm_winbind/mod_auth_ntlm_winbind.c 2007-01-29 03:59:10 UTC (rev 713) @@ -320,7 +320,7 @@ line = apr_pstrcat(r->pool, NEGOTIATE_AUTH_NAME, " ", negotiate_auth_line, NULL); apr_table_add(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate" : "WWW-Authenticate", line); } @@ -328,7 +328,7 @@ if (crec->ntlm_on) { apr_table_add(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate" : "WWW-Authenticate", NTLM_AUTH_NAME); } @@ -340,7 +340,7 @@ "Basic realm=\"", crec->ntlm_basic_realm, "\"", NULL); apr_table_add(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate" : "WWW-Authenticate", line); } @@ -357,7 +357,7 @@ get_auth_header(request_rec * r, ntlm_config_rec * crec, const char *auth_scheme) { const char *auth_line = apr_table_get(r->headers_in, - r->proxyreq ? "Proxy-Authorization" + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authorization" : "Authorization"); if (!auth_line) { @@ -412,7 +412,7 @@ /* Read negotiate from ntlm_auth */ apr_table_setn(r->err_headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate" : "WWW-Authenticate", apr_psprintf(r->pool, "%s %s", auth_scheme, reply)); /* This is to make sure that when receiving later messages @@ -841,7 +841,7 @@ if (!strcmp("*", childarg)) { /* Send last leg (possible mutual authentication token) */ apr_table_setn(r->headers_out, - r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authenticate" : "WWW-Authenticate", apr_psprintf(r->pool, "%s %s", auth_type, childarg)); } @@ -946,7 +946,7 @@ &auth_ntlm_winbind_module); ntlm_connection_context_t *ctxt = get_connection_context( r->connection ); const char *auth_line = apr_table_get(r->headers_in, - r->proxyreq ? "Proxy-Authorization" + (PROXYREQ_PROXY == r->proxyreq) ? "Proxy-Authorization" : "Authorization"); const char *auth_line2;