Bug 9348 - Opkg requires root privileges for all operations
Summary: Opkg requires root privileges for all operations
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.3.2
Hardware: All Multiple
: Undecided major
Target Milestone: 0.4.4
Assignee: Alejandro del Castillo
QA Contact:
URL:
Whiteboard:
: 8174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-25 20:10 UTC by Alejandro del Castillo
Modified: 2020-10-30 07:40 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro del Castillo 2016-03-25 20:10:29 UTC
Opkg is creating it's lock file under /var/run, which has drwxr-xr-x root-root permissions. Any opkg operation under an unprivilged user will throw:

Collected errors:
 * opkg_lock: Could not create lock file /var/run/opkg.lock: Permission denied.

A better place for lock file is /var/run/lock (maps to /run/lock). If writes can be made atomic (via a tmpfile), then reads shouldn't need a lock and an unprivileged user should be able to do any operations than only requires reads. Since any user can create files in /var/run/lock, opkg will need to make sure that the user is root when creating the lock.
Comment 1 Alejandro del Castillo 2016-05-02 22:16:18 UTC
*** Bug 8174 has been marked as a duplicate of this bug. ***
Comment 2 Alejandro del Castillo 2020-10-30 07:40:32 UTC
/var/run/lock permissions are too open, left lock on /var/run. 

Commit feb40ec55c07aabe7a925f0338156f71582041a5 removed the need to be root for read-only operations.