<div dir="ltr">This doesn't escape the filename, it quotes it, so should probably correct the message, and will almost certainly break if the name contains a single quote. I'd suggest using subprocess.list2cmdline(), pipes.quote(), or similar instead of doing it manually. Definitely a good fix, just likely best done with an existing mechanism :) Thanks for the contribution.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2020 at 9:52 AM Jean-Marie LEMETAYER <<a href="mailto:jean-marie.lemetayer@savoirfairelinux.com">jean-marie.lemetayer@savoirfairelinux.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">When using a download filename with characters which can be interpreted<br>
by the shell ('(', ')', '&', ';', ...) the command fails. Escaping the<br>
filename fixes the issue.<br>
<br>
Signed-off-by: Jean-Marie LEMETAYER <<a href="mailto:jean-marie.lemetayer@savoirfairelinux.com" target="_blank">jean-marie.lemetayer@savoirfairelinux.com</a>><br>
---<br>
lib/bb/fetch2/wget.py | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py<br>
index 725586d2..6506e1e2 100644<br>
--- a/lib/bb/fetch2/wget.py<br>
+++ b/lib/bb/fetch2/wget.py<br>
@@ -94,9 +94,9 @@ class Wget(FetchMethod):<br>
fetchcmd = self.basecmd<br>
<br>
if 'downloadfilename' in ud.parm:<br>
- dldir = d.getVar("DL_DIR")<br>
- bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))<br>
- fetchcmd += " -O " + dldir + os.sep + ud.localfile<br>
+ localpath = os.path.join(d.getVar("DL_DIR"), ud.localfile)<br>
+ bb.utils.mkdirhier(os.path.dirname(localpath))<br>
+ fetchcmd += " -O '%s'" % localpath<br>
<br>
if ud.user and ud.pswd:<br>
fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd)<br>
-- <br>
2.20.1<br>
<br>
-- <br>
_______________________________________________<br>
bitbake-devel mailing list<br>
<a href="mailto:bitbake-devel@lists.openembedded.org" target="_blank">bitbake-devel@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/bitbake-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>