Bug 9859 - setcap doesn't work
Summary: setcap doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Pseudo
Classification: Yocto Project Subprojects
Component: pseudo (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.3 M3
Assignee: Seebs
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 9858
  Show dependency tree
 
Reported: 2016-06-30 15:13 UTC by Ross Burton
Modified: 2017-03-20 19:22 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2016-06-30 15:13:31 UTC
If setcap is called inside pseudo context then it errors out.

"
The setcap utility supplied by libcap is used to set capabilities on a
file. Before setting a file's capabilities with cap_set_file() (which uses
setxattr()) it calls cap_set_flag(mycaps, CAP_EFFECTIVE, 1, &capflag,
CAP_SET). cap_set_flag() uses the capset syscall to raise the process'
effective capability. In most cases if the process isn't running as root
this will fail and setcap will exit with an error. Because setxattr is
intercepted by pseudo it's unnecessary for setcap to call capset().
"

https://lists.yoctoproject.org/pipermail/yocto/2016-May/029903.html has a patch.
Comment 1 Seebs 2016-12-12 20:29:30 UTC
The proposed patch appears to be logically correct; we have no real reason to support capset, but it needs to pretend to work. Merged in master.
Comment 2 Seebs 2017-03-20 19:22:26 UTC
I believe this is in pseudo 1.8.2, which has been merged for a bit. I forgot about the open bug. Sorry!