[BusyBox 0001404]: wget authentication error

bugs at busybox.net bugs at busybox.net
Wed Jun 27 21:41:04 UTC 2007


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1404 
====================================================================== 
Reported By:                iggarpe
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1404
Category:                   Networking Support
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             06-26-2007 02:31 PDT
Last Modified:              06-27-2007 14:41 PDT
====================================================================== 
Summary:                    wget authentication error
Description: 
Looks like the HTTP authentication code is broken. When updating a dyndns
dynamic host, wget fails with the following error message:

badauthwget: error getting response: Bad file descriptor

This works fine in busybox 1.2.1.

URL Example (replace user, password myhost.dyndns.org and 127.0.0.1 with
valid values):

wget -qO -
http://user:password@members.dyndns.org/nic/update/?system=dyndns\&hostname=myhost.dyndns.org\&myip=127.0.0.1


====================================================================== 

---------------------------------------------------------------------- 
 iggarpe - 06-26-07 03:15  
---------------------------------------------------------------------- 
It seems that bb_uuencode is badly broken and is corrupting the host_info
structure when the authentication user is uuencoded.

Replacing the bb_uuencode call by the old base64enc code (see wget.c in
busybox 1.2.1) solves the problem.

Will investigate further what's going on, but thought this info is worth
being known before the bug is assigned. 

---------------------------------------------------------------------- 
 vda - 06-26-07 07:26  
---------------------------------------------------------------------- 
I bet the mistake is here: sizeof(buf) is wrong, third parameter is length
of SOURCE, not dest! Should be strlen(target.user)...

if (target.user) {
        fprintf(sfp, "Authorization: Basic %s\r\n",
                base64enc((unsigned char*)target.user, buf,
sizeof(buf)));
}
if (use_proxy && server.user) {
        fprintf(sfp, "Proxy-Authorization: Basic %s\r\n",
                base64enc((unsigned char*)server.user, buf,
sizeof(buf)));
}

Can you try strlen()? 

---------------------------------------------------------------------- 
 vda - 06-27-07 14:41  
---------------------------------------------------------------------- 
Hopefully fixed in rev 18955. Please test. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-26-07 02:31  iggarpe        New Issue                                    
06-26-07 02:31  iggarpe        Status                   new => assigned     
06-26-07 02:31  iggarpe        Assigned To               => BusyBox         
06-26-07 03:15  iggarpe        Note Added: 0002516                          
06-26-07 07:26  vda            Note Added: 0002523                          
06-27-07 14:41  vda            Status                   assigned => closed  
06-27-07 14:41  vda            Note Added: 0002530                          
======================================================================




More information about the busybox-cvs mailing list