<?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>5177</bug_id>
          
          <creation_ts>2013-09-13 07:53:01 +0000</creation_ts>
          <short_desc>meta-security: bastille fails at do_install</short_desc>
          <delta_ts>2013-10-15 14:50:12 +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>Other YP Layers</product>
          <component>layers</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>1.6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stoicescu Cornel">corneliux.stoicescu</reporter>
          <assigned_to name="mulhern">mulhern</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</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>36651</commentid>
    <comment_count>0</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-09-13 07:53:01 +0000</bug_when>
    <thetext>Cannot install bastille using:
poky master:bd76847d867f9f76f76f033439cfb834cf59380f
meta-security master:23815f300174ce6cab48356e3fffba9868b626d4

Error as follows:
DEBUG: Executing shell function do_install
Fatal error reading config file: [Errno 13] Permission denied: &apos;/home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt&apos;
WARNING: /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/temp/run.do_install.12528:1 exit 1 from
  /home/cornel/work/poky/meta-security/recipes-security/bastille/files/set_required_questions.py /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/config Questions
ERROR: Function failed: do_install (log file is located at /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/temp/log.do_install.12528)

File permissions as follows:

-r--r--r-- 1 cornel cornel 45529 Sep 15  2008 /home/cornel/SSD/2poky/build/tmp/work/qemuarm-poky-linux-gnueabi/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt


Tested on Ubuntu 12.04 and Fedora 18 both with Python 2.7 .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36681</commentid>
    <comment_count>1</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-09-13 13:59:05 +0000</bug_when>
    <thetext>More information:

Using Ubuntu 13.04 with &quot;Python 2.7.4 (default, Apr 19 2013, 18:28:01)[GCC 4.7.3] on linux2&quot; the error does not appear. 

-rw------- 1 cornel cornel 45559 sep 13 18:04 tmp/work/emenlow-poky-linux/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt

Using Fedora 18 with &quot;Python 2.7.3 (default, Jul 24 2012, 10:05:38) [GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2&quot; the issue is present

-r--r--r--. 1 cornel cornel 45529 Sep 15  2008 tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt

Using Ubuntu 12.04(LTS) with &quot;Python 2.7.3 (default, Apr 20 2012, 22:39:59) [GCC 4.6.3] on linux2&quot; the issue is present.

-r--r--r-- 1 cornel cornel 45529 Sep 15  2008 tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36713</commentid>
    <comment_count>2</comment_count>
    <who name="mulhern">mulhern</who>
    <bug_when>2013-09-13 18:02:59 +0000</bug_when>
    <thetext>I can not reproduce on my systems, but I do have an hypothesis.

1) When unpacked the Questions files retain their permissions, -r--r--r--.
2) Opening the file for reading is no problem, so that&apos;s a bit of a red herring.
3) Moving the temporary file containing the new version of the file to the Questions file causes a Permission Denied error because the file is not writeable. Unfortunately, this behavior is system dependent. If the file is overwritten it gets the permissions of the temporary file: -rw-------.

I&apos;ve made some changes:
1) I&apos;ve added a debug flag that can be used to make output more informative for the developer.
2) I&apos;ve made the overwriting of the original file with the contents of the tempfile more principled in the set_required_questions.py file more principled.
3) I&apos;ve changed the way set_required_questions.py is called so that it operates on the Questions files in the image subdirectory immediately after they are copied. These are guaranteed of have 644 permissions.

I&apos;ve posted them at: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=mulhern/bug5177.

Could you verify that changes (2) and (3) have eliminated the bug? If not, could you edit the bastille bitbake file to pass the --debug flag to set_required_questions.py and send me the output?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37053</commentid>
    <comment_count>3</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-09-23 11:47:31 +0000</bug_when>
    <thetext>I did a bastille build with the latest commit on your branch on Ubuntu 12.04 having Python 2.7.3 and it worked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37221</commentid>
    <comment_count>4</comment_count>
    <who name="mulhern">mulhern</who>
    <bug_when>2013-09-26 01:22:02 +0000</bug_when>
    <thetext>Fix at: http://git.yoctoproject.org/cgit/cgit.cgi/meta-security/commit/?id=b2a60ba7ff7eb43446e96fc5048109922d58b45d.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37939</commentid>
    <comment_count>5</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-10-15 14:50:12 +0000</bug_when>
    <thetext>Installing Bastille works with latest master.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>