<?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>1092</bug_id>
          
          <creation_ts>2011-05-20 06:40:01 +0000</creation_ts>
          <short_desc>LSB4.1： /var/lib  permission access error</short_desc>
          <delta_ts>2011-06-03 14:35:31 +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.0-alpha</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>1.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xiaofeng Yan">Xiaofeng.yan</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>13930</commentid>
    <comment_count>0</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-20 06:40:01 +0000</bug_when>
    <thetext>$ls /var/lib -l
drwx------ 10 root root 4096 May 20 19:21 lib

We should modify permission of this directory as follow:
$chmod 755 /var/lib


If nobody modify this problem in .bb file including this directory operation. I will modify it by my method.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13937</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-05-20 14:23:30 +0000</bug_when>
    <thetext>Can you give me more details about what image you are building, I just checked a minimal image and it does not have this problem.  I wonder if there is some other recipe that is changing the ownership incorrectly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13942</commentid>
    <comment_count>2</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-20 17:24:15 +0000</bug_when>
    <thetext>Hi Saul,
this problem arose when I built a lsb-image by command &quot;$bitbake core-image-lsb-qt3&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13945</commentid>
    <comment_count>3</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-21 03:12:01 +0000</bug_when>
    <thetext>Hi Saul,

I found package &quot;sudo&quot; change ownership of directory &quot;/var/lib&quot;. You can find the specified place by the following patch.
 
--- Makefile.orj    2011-05-21 16:32:35.392833427 +0800
+++ Makefile    2011-05-21 16:36:47.979380106 +0800
@@ -482,7 +482,7 @@
         $(DESTDIR)$(visudodir) $(DESTDIR)$(noexecdir) \
         $(DESTDIR)$(sudoersdir) $(DESTDIR)$(docdir) \
         $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform)
-   $(SHELL) $(srcdir)/mkinstalldirs -m 0700 $(DESTDIR)$(timedir)
+   $(SHELL) $(srcdir)/mkinstalldirs -m 0755 $(DESTDIR)$(timedir)
 
  install-binaries: install-dirs $(PROGS)
     $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 04111 sudo $(DESTDIR)$(sudodir)/sudo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13952</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-05-23 12:40:13 +0000</bug_when>
    <thetext>Problem:

The issue is that every application that uses a directory ends up creating and owning the directory structure.  The permissions may not all match.  So when the package manager first creates the directory, those are the permissions that stick for the rest of the filesystem.

Solution:

We simply need to add the ability to &quot;own&quot; a directory, instead of assuming ownership as we currently do.

Question:

We need to verify that the default umask is being set properly so that the permissions on default directories ends up to be reasonable.  (0755)   


In the particular sudo case below, the permissions of the tree structure are wrong in the general case, but correct for this package.  Switching to an owned directory structure should resolve this problem.  So leave this as a known issue for now.

If the problem is causing failures in anything outside of the LSB testing, then we should fix it as indicated in the attached patch, however if it&apos;s only an LSB failure directory ownership should fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13957</commentid>
    <comment_count>5</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2011-05-23 22:28:28 +0000</bug_when>
    <thetext>Hi Mark,

I think if a image include package sudo, then this problem will arise. If I remove sudo from task-core-basic.bb then this problem will not arise. sorry for my English, can you give me more detailed steps for your solution?
Please check my method at
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/sudo

I know this could not be a good solution for my method.
If it is only arise for lsb, you mean I should modify this problem in file (.bb or script)related to lsb. right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13966</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2011-05-25 00:29:31 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Problem:
&gt; 
&gt; The issue is that every application that uses a directory ends up creating and
&gt; owning the directory structure.  The permissions may not all match.  So when
&gt; the package manager first creates the directory, those are the permissions that

Hi Mark,

This is because:

$(SHELL) $(srcdir)/mkinstalldirs -m 0700 $(DESTDIR)$(timedir) 

and the timedir=/var/lib/sudo

but if /var/lib doesn&apos;t exist, the mkinstalldirs would create it and set the
mode to 0700 recursively, so all of the /var, /var/lib and /var/lib/sudo would
be set to 0700, but what sudo needs is only set /var/lib/sudo to 0700.

This should be a bug of sudo, and &quot;mkdir -p $(DESTDIR)/var/lib&quot; before 
&quot;mkinstalldirs -m 0700 $(DESTDIR)$(timedir)&quot; would fix it. Xiaofeng will test
it and send a new patch.

//Robert

&gt; stick for the rest of the filesystem.
&gt; 
&gt; Solution:
&gt; 
&gt; We simply need to add the ability to &quot;own&quot; a directory, instead of assuming
&gt; ownership as we currently do.
&gt; 
&gt; Question:
&gt; 
&gt; We need to verify that the default umask is being set properly so that the
&gt; permissions on default directories ends up to be reasonable.  (0755)   
&gt; 
&gt; 
&gt; In the particular sudo case below, the permissions of the tree structure are
&gt; wrong in the general case, but correct for this package.  Switching to an owned
&gt; directory structure should resolve this problem.  So leave this as a known
&gt; issue for now.
&gt; 
&gt; If the problem is causing failures in anything outside of the LSB testing, then
&gt; we should fix it as indicated in the attached patch, however if it&apos;s only an
&gt; LSB failure directory ownership should fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14164</commentid>
    <comment_count>7</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-06-03 14:35:31 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=505ee4b0a7443c185b101aaa6460d3a566a91fce</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>