Bug 11262

Summary: wget.py: Handling of ud.user is wrong/outdated
Product: [Build System, Metadata & Runtime] BitBake Reporter: Holger Freyther <holger>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Holger Freyther 2017-03-28 20:10:14 UTC
We have a recipe that is downloading files from a password protected http server. We ask our users to put SRC_URI_pn-NAME = "https://USER:PASS@url" into the local.conf.

This is broken with the current wget fetcher. It seems that it expects that ud.user contains "USER:PASS" and is then doing a string split (which it should limit to 1). But the password is actually already inside the ud.pswd variable.

Something like this (incomplete as there are more usages of ud.user) could fix it:

-        if ud.user:
-            up = ud.user.split(":")
-            fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (up[0],up[1])
+        if ud.user and ud.pswd:
+            fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd)
Comment 1 Richard Purdie 2017-03-30 10:46:44 UTC
I took a look at the other usages and I think its correct elsewhere, it was just this case that was broken. I've sent out the patch and queued it, thanks.
Comment 2 Richard Purdie 2017-03-31 09:16:38 UTC
Fixed with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=f46846dc118a3132eee5aeddb43570b8343afc0a, thanks zecke!