<?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>5690</bug_id>
          
          <creation_ts>2013-12-27 06:15:19 +0000</creation_ts>
          <short_desc>Lack of sanity check for TMPDIR</short_desc>
          <delta_ts>2014-07-03 07:40:05 +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>OE-Core</product>
          <component>core</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>39597</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-27 06:15:19 +0000</bug_when>
    <thetext>Our build system uses a lot of tools and hence have more restrictions on paths than what we might expect.

Here&apos;s an example.
If we set in local.conf:
TMPDIR = &quot;/home/chenqi/poky/build-systemd/tmp-no-empty-dev/&quot;
(Pretty reasonable path at a first glance, right?)

We would get the following error.
     ERROR: debugedit failed with exit code 256 (cmd was &apos;/home/chenqi/poky/build-systemd/tmp-no-empty-dev//sysroots/i686-linux/usr/lib/rpm/bin/debugedit&apos; -b &apos;/home/chenqi/poky/build-systemd/tmp-no-empty-dev\
//work/i586-poky-linux&apos; -d &apos;/usr/src/debug&apos; -i -l &apos;/home/chenqi/poky/build-systemd/tmp-no-empty-dev//work/i586-poky-linux/gcc-runtime/4.8.2-r0/debugsources.list&apos; &apos;/home/chenqi/poky/build-systemd/tmp-no-empty\
-dev//work/i586-poky-linux/gcc-runtime/4.8.2-r0/package/usr/lib/libgomp.so.1.0.0&apos;):
     /home/chenqi/poky/build-systemd/tmp-no-empty-dev/sysroots/i686-linux/usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
     ERROR: Function failed: split_and_strip_files
     ERROR: Logfile of failure stored in: /home/chenqi/poky/build-systemd/tmp-no-empty-dev//work/i586-poky-linux/gcc-runtime/4.8.2-r0/temp/log.do_package.7625
     ERROR: Task 731 (/home/chenqi/poky/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb, do_package) failed with exit code &apos;1&apos;

This is because the debugedit tool doesn&apos;t like double slashes.
And this puts a restriction on our TMPDIR, that is, the TMPDIR cannot end with trailing slashes.

Compared to having our users stair at the screen trying to figure out what&apos;s going on, I think it&apos;s better that we output informative error messages early.

That&apos;s why a sanity check for TMPDIR is needed.

For now, I&apos;d like to propose the following regexp for our TMPDIR:
^/[a-zA-Z0-9\-_/.~]*[a-zA-Z0-9\-_.~]$

The above regexp implies:
1) TMPDIR must be an absolute path
2) TMPDIR must not contain special chars like # or @.
3) TMPDIR cannot end with trailing slashes.

//Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44302</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2014-07-03 07:40:05 +0000</bug_when>
    <thetext>Close this bug as &apos;WONT FIX&apos; as people don&apos;t care about this issue, althought related patches have been sent to the mailing list.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>