bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [Bug-Wget] Wrong Error Codes returned on Digest Auth Fail


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] [Bug-Wget] Wrong Error Codes returned on Digest Auth Failures.
Date: Mon, 22 Jul 2013 00:48:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Hi Darshit,

I have few comments inline:

Darshit Shah <address@hidden> writes:

> diff --git a/src/http.c b/src/http.c
> index b2a03c8..64929d7 100644
> --- a/src/http.c
> +++ b/src/http.c
> @@ -146,6 +146,7 @@ struct request {
>  };
>  
>  extern int numurls;
> +uerr_t auth_err = RETROK;

could you avoid this global?  Can we propagate instead a pointer as
create_authorization_line and digest_authentication_encode param?


> @@ -3133,12 +3146,23 @@ Spider mode enabled. Check if remote file 
> exists.\n"));
>            logputs (LOG_VERBOSE, "\n");
>            logprintf (LOG_NOTQUIET, _("Cannot write to %s (%s).\n"),
>                       quote (hstat.local_file), strerror (errno));
> -        case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED:
> -        case SSLINITFAILED: case CONTNOTSUPPORTED: case VERIFCERTERR:
> -        case FILEBADFILE:
> +        case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case SSLINITFAILED:
> +        case CONTNOTSUPPORTED: case VERIFCERTERR: case FILEBADFILE:
> +        case UNKNOWNATTR:
>            /* Fatal errors just return from the function.  */
>            ret = err;
>            goto exit;
> +        case ATTRMISSING:
> +          /* A missing attribute in a Header is a fatal Protocol error. */
> +          logputs (LOG_VERBOSE, "\n");
> +          logprintf (LOG_NOTQUIET, _("Required attribute missing from Header 
> receieved.\n"));

s|receieved|received|


> @@ -3717,15 +3741,24 @@ digest_authentication_encode (const char *au, const 
> char *user,
>    if (qop != NULL && strcmp(qop,"auth"))
>      {
>        logprintf (LOG_NOTQUIET, _("Unsupported quality of protection 
> '%s'.\n"), qop);
> -      user = NULL; /* force freeing mem and return */
> +      qop = NULL; /* force freeing mem and return */
>      }
> -
> -  if (algorithm != NULL && strcmp (algorithm,"MD5") && strcmp 
> (algorithm,"MD5-sess"))
> +  else if (algorithm != NULL && strcmp (algorithm,"MD5") && strcmp 
> (algorithm,"MD5-sess"))
>      {
>        logprintf (LOG_NOTQUIET, _("Unsupported algorithm '%s'.\n"), 
> algorithm);
> -      user = NULL; /* force freeing mem and return */
> +      qop = NULL; /* force freeing mem and return */
>      }

should we xfree_null (qop) before setting it to NULL?

Thanks,
Giuseppe



reply via email to

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