<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14015</bug_id>
          
          <creation_ts>2020-08-19 05:48:07 +0000</creation_ts>
          <short_desc>URL Arguments in MIRROR/PREMIRROR get encoded</short_desc>
          <delta_ts>2024-02-08 16:09:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>3.1.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jahn">yoctoproject.bugzilla</reporter>
          <assigned_to name="Jahn">yoctoproject.bugzilla</assigned_to>
          <cc>mark.asselstine</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tgamblin</cc>
    
    <cc>Vikkram.Ravi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87981</commentid>
    <comment_count>0</comment_count>
    <who name="Jahn">yoctoproject.bugzilla</who>
    <bug_when>2020-08-19 05:48:07 +0000</bug_when>
    <thetext>After successfully putting a PREMIRROR for our builds on a blob storage,
I wanted to keep that storage completely private, so adding I thought the following would work:

SAS_TOKEN = &quot;?sv=2019-12-12&amp;ss=bf&amp;srt=co&amp;sp=rdl&amp;spr=https&amp;sig=abcdef_TEST&quot;

INHERIT += &quot;own-mirrors&quot;
SOURCE_MIRROR_URL = &quot;https://somewhere.blob.core.windows.net/our-mirror/downloads/BASENAME${SAS_TOKEN}&quot;

BB_FETCH_PREMIRRORONLY = &quot;1&quot;


Well it kind of does work, but the arguments of the SAS_TOKEN get encoded and the fetch via wget will fail.

Expected behavior: SAS_TOKEN will not be encoded / = have a possibility to add URL parts that will not be encoded.


FYI: I also asked a question about this on stackoverflow
https://stackoverflow.com/questions/63486550/yocto-premirror-source-mirror-url-with-url-arguments-sas-token-possible</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96070</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:22:01 +0000</bug_when>
    <thetext>Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96464</commentid>
    <comment_count>2</comment_count>
    <who name="Trevor Gamblin">tgamblin</who>
    <bug_when>2023-09-14 16:36:54 +0000</bug_when>
    <thetext>Moved to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97059</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-30 15:29:09 +0000</bug_when>
    <thetext>Bulk move to 5.0 M1. -- Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97404</commentid>
    <comment_count>4</comment_count>
    <who name="Mark">mark.asselstine</who>
    <bug_when>2023-12-03 00:54:16 +0000</bug_when>
    <thetext>Jahn, do you know of a publicly available example that I could use to attempt to reproduce and review this issue?

It appears that the code does map with your assertion that the URL is encoded. dodwnload()-&gt;try_mirrors()-&gt;build_mirroruris()-&gt;uri_replace() which does a decode to complete the find and replace of the URL ends with a call to encodeurl() which encodes just the &quot;path&quot; component of the URL with a call to urllib.parse.quote(path).

The interesting bit is that wget will work just fine with an encoded URL, per the manual &quot;You can encode unsafe characters in a URL as ‘%xy’, xy being the hexadecimal representation of the character’s ASCII value. Some common unsafe characters include ‘%’ (quoted as ‘%25’), ‘:’ (quoted as ‘%3A’), and ‘@’ (quoted as ‘%40’). Refer to RFC1738 for a comprehensive list of unsafe characters.&quot; - https://www.gnu.org/software/wget/manual/wget.html which is why I ask about a reproducer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97640</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-12-21 20:38:42 +0000</bug_when>
    <thetext>Jahn, are you able to share a reproducer as Mark requested?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98094</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-02-01 16:06:38 +0000</bug_when>
    <thetext>Moving to 5.99 (near term release but not 5.0) since we don&apos;t have a reproducer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98160</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-02-08 16:09:04 +0000</bug_when>
    <thetext>No repsponse for a few years so closing. We&apos;d consider the bug again if we can get a reproducer.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>