bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [PATCH] First


From: Tim Rühsen
Subject: [Bug-wget] [PATCH] First
Date: Mon, 17 Nov 2014 21:33:13 +0100
User-agent: KMail/4.14.2 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

This patch fixes Authentication for turkish locales in case that the server
uses promised case-insensitivity for the authentication scheme (e.g. for
'Basic' or 'Digest'). RFC 2617 and it's successor RFC 7235 both say:


RFC 7235 2.1.  Challenge and Response

   ...
   It uses a case-insensitive token as a means to identify the authentication
scheme,
   ...

So I amended testenv/server/http/http_server.py to accept any case for 'Basic'
and 'Digest' as well as sending 'BasIc' and 'DIgest'.

Running the test suite with this change with LC_ALL set to 'tr_TR.utf8'
(turkish locale), three tests fail.

The fix is to use a pure ASCII version of strcasecmp()/strncasecmp() and not
the locale dependant versions from the standard C library.

Gnulib has ASCII versions of these functions (c_strcasecmp/c_strncasecmp).
Using these at two places of src/http.c fixes the problem.

There are many other places in Wget where we should use these functions.
(See my email from 24.9.2014 13:08:21).
I am not sure (in fact I doubt) that we can blindly replace strcasecmp and
strncasecmp. So I try to make test cases to prove replacing is correct.

What do you think ?

Tim

Attachment: 0001-Fix-authentication-problem-with-turkish-locale.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]