<?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>922</bug_id>
          
          <creation_ts>2011-03-22 00:49:21 +0000</creation_ts>
          <short_desc>&quot;rpm -qa&quot; can not run for non-root user:  Permission denied</short_desc>
          <delta_ts>2018-01-26 12:36:37 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dexuan Cui">dexuan.cui</reporter>
          <assigned_to name="Alexander Kanavin">alex.kanavin</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mravindr</cc>
    
    <cc>n3npq</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>xudong.hao</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>12900</commentid>
    <comment_count>0</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-03-22 00:49:21 +0000</bug_when>
    <thetext>The log is

$ rpm -qa
error: db_init:db3.c:994: dbenv-&gt;open(13): Permission denied
error: cannot open Packages(0) index: Permission denied(13)
        DB: Berkeley DB 5.1.19: (August 27, 2010)
error: cannot open Packages database in /var/lib/rpm


BTW: root can run the command successfully.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12915</commentid>
    <comment_count>1</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-03-22 22:15:54 +0000</bug_when>
    <thetext>&quot;opkg-cl list-installed&quot; has the same issue for a non-root user:

$ opkg-cl list-installed
Collected errors:
 * opkg_conf_load: Could not create lock file /var/lib/opkg/lock: Permission denied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12956</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-03-24 05:36:48 +0000</bug_when>
    <thetext>This is to be expected, you need to be root to run package management operations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12967</commentid>
    <comment_count>3</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2011-03-24 09:28:45 +0000</bug_when>
    <thetext>Actually this is a bug.. but it&apos;s low.  As Richard indicates you need root to
use the package management system.  But traditionally you can query the packages
available on the system as non-root. - Mark</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21187</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2012-05-08 15:35:58 +0000</bug_when>
    <thetext>Most of the estimate time is required for testing the work, the change is likely fairly simple.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32603</commentid>
    <comment_count>5</comment_count>
    <who name="Jeff Johnson">n3npq</who>
    <bug_when>2013-04-24 16:58:04 +0000</bug_when>
    <thetext>Running &quot;rpm -qa&quot; tries to create shared locks
in /var/lib/rpm. So a scheme with g+w permission
needs to be devised.

However &quot;rpm -qa&quot; skips the locking with some minor
risk of non-root segfaulting iof/when another rpm
install (not query) process is running.

However I believe that the permissions on /var/lib/rpm/Packages
are preventing the open here, likely because of umask settings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56651</commentid>
    <comment_count>6</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2015-11-19 16:04:01 +0000</bug_when>
    <thetext>This was REOPENED</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56658</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2015-11-19 16:08:22 +0000</bug_when>
    <thetext>I don&apos;t see that this was reopened.  We never solved the issue as it was low priority.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57578</commentid>
    <comment_count>8</comment_count>
    <who name="Madhusudhanan">mravindr</who>
    <bug_when>2016-01-06 13:38:18 +0000</bug_when>
    <thetext>I would like to reassign to myself if this is still a issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79219</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-01-25 15:56:36 +0000</bug_when>
    <thetext>Alex, next time you&apos;ve an image with rpm on, can you verify this still happens with rpm v4?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79233</commentid>
    <comment_count>10</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2018-01-26 12:36:37 +0000</bug_when>
    <thetext>Just tried on core-image-sato as a &apos;nobody&apos; user - rpm -qa works fine.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>