<?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>9611</bug_id>
          
          <creation_ts>2016-05-09 23:00:13 +0000</creation_ts>
          <short_desc>Under Project-&gt;Bitbake variable, We disallow variables with a &apos;/&apos; in them</short_desc>
          <delta_ts>2016-09-19 12:49:14 +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>Toaster</product>
          <component>toaster</component>
          <version>2.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="brian avery">brian.avery</reporter>
          <assigned_to name="Belen Barros Pena">belen.barros.pena</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>ross.burton</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62057</commentid>
    <comment_count>0</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-05-09 23:00:13 +0000</bug_when>
    <thetext>an example of such a variable that we might want to set is PREFERRED_PROVIDER_virtual/java2-runtime to openjdk-7-jre.
Our javascript checker says:
&apos;A valid variable name can only include letters, numbers, underscores, and dashes&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62136</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-05-12 03:59:18 +0000</bug_when>
    <thetext>+ is allowed and used in recipe names, so it needs to be allowed in variable names here too (since it can therefore appear in a valid _pn- override).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62144</commentid>
    <comment_count>2</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2016-05-12 14:34:04 +0000</bug_when>
    <thetext>so, it&apos;s / and + so far. Any other special character we ought to allow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62163</commentid>
    <comment_count>3</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-05-12 17:30:48 +0000</bug_when>
    <thetext>What about not restricting the inputs?  If they put in an unparseable variable, the error message should be clear, I would think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62171</commentid>
    <comment_count>4</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2016-05-13 09:38:54 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; What about not restricting the inputs?  If they put in an unparseable
&gt; variable, the error message should be clear, I would think.

mmm, personally I don&apos;t like the approach. The CLI already let&apos;s you shoot yourself in the foot: we don&apos;t need the GUI to do that too. Most special characters are probably not allowed in OE variables (or so I was told when I designed that page). If that&apos;s the case, let&apos;s validate user input, as good web forms should.

Turns out there is an answer to this in BitBake

http://git.openembedded.org/bitbake/tree/lib/bb/parse/parse_py/ConfHandler.py#n33

According to RP, (?P&lt;var&gt;[a-zA-Z0-9\-~_+.${}/]+?) is the key bit. It implies 

a-zA-Z0-9\-~_+.${}/ 

are all acceptable 

So here is our answer: those are the special characters the validation should allow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62200</commentid>
    <comment_count>5</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-05-13 21:23:46 +0000</bug_when>
    <thetext>Agreed. Your&apos;s is better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65798</commentid>
    <comment_count>6</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2016-09-05 11:06:11 +0000</bug_when>
    <thetext>Patch submitted to the mailing list

https://lists.yoctoproject.org/pipermail/toaster/2016-September/005164.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66322</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-09-19 12:49:14 +0000</bug_when>
    <thetext>Merged in bitbake 146f6f95a8753308edb31e952d7c440c8de11870.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>