| Summary: | "rpm -qa" can not run for non-root user: Permission denied | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Dexuan Cui <dexuan.cui> |
| Component: | core | Assignee: | Alexander Kanavin <alex.kanavin> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | Low | CC: | jessica.zhang, jiajun.xu, meta.mr.watcher, meta.watcher, mravindr, n3npq, randy.macleod, richard.purdie, sgw, xudong.hao |
| Version: | unspecified | ||
| Target Milestone: | Future | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
"opkg-cl list-installed" 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. This is to be expected, you need to be root to run package management operations. Actually this is a bug.. but it'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 Most of the estimate time is required for testing the work, the change is likely fairly simple. Running "rpm -qa" tries to create shared locks in /var/lib/rpm. So a scheme with g+w permission needs to be devised. However "rpm -qa" 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. This was REOPENED I don't see that this was reopened. We never solved the issue as it was low priority. I would like to reassign to myself if this is still a issue. Alex, next time you've an image with rpm on, can you verify this still happens with rpm v4? Just tried on core-image-sato as a 'nobody' user - rpm -qa works fine. |
The log is $ rpm -qa error: db_init:db3.c:994: dbenv->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.