Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941628 - kde-plasma/kwin should call setcap cap_sys_nice=ep after install
Summary: kde-plasma/kwin should call setcap cap_sys_nice=ep after install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo KDE team
URL: https://invent.kde.org/plasma/kwin/-/...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: plasma-6.2.3-stable, plasma-6.2.4-stable
  Show dependency tree
 
Reported: 2024-10-16 12:02 UTC by microcai
Modified: 2024-12-15 18:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description microcai 2024-10-16 12:02:01 UTC
kwin_wayland gained support for caps so that It can tune itself into higher priority to make desktop experience better.

a setcap call is required after kwin_wayland installed into system to make this feature take effect.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-17 03:52:30 UTC
Right, the caps will get lost right now: https://invent.kde.org/plasma/kwin/-/blob/master/src/CMakeLists.txt#L427.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-17 03:55:57 UTC
I'll discuss it with asturm first as I find filecaps.eclass kind of icky.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-28 19:36:07 UTC
(In reply to Sam James from comment #2)
> I'll discuss it with asturm first as I find filecaps.eclass kind of icky.

... fcaps.eclass, obviously.

Anyway, I changed my mind, it's fine. But there is one issue which I'm not clear on (part of why I found it icky).

The eclass description says " This eclass  provides a function to set file-based capabilities on binaries.  This is not the same as USE=caps which controls runtime capability changes, often via packages like libcap.".

The eclass unconditionally adds IUSE="+filecaps".

But kwin needs libcap (which is controlled by USE=caps) for this functionality *and* for the capability to be set on kwin_wayland? I guess this means we eat the USE=+filecaps and go with it for now (I am inclined to do this) but this feels like a poor interface.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-28 19:36:24 UTC
CCing base-system for input on the eclass to see if I'm missing something.
Comment 5 Mike Gilbert gentoo-dev 2024-10-28 20:48:17 UTC
From what I can tell, it looks like kwin doesn't actually use libcap.so at all. The dependency is only there so that the build system can call 'setcap' via SETCAP_EXECUTABLE.

I would say drop the "caps" USE flag and just filecaps.eclass.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-28 20:58:08 UTC
(In reply to Mike Gilbert from comment #5)
> From what I can tell, it looks like kwin doesn't actually use libcap.so at
> all. The dependency is only there so that the build system can call 'setcap'
> via SETCAP_EXECUTABLE.
> 
> I would say drop the "caps" USE flag and just filecaps.eclass.

Ah! The libcap.so use was dropped in https://invent.kde.org/plasma/kwin/-/commit/a601a08ba7a65ebb4df46cf1f94f3fff2c0553cd.
Comment 7 Mike Gilbert gentoo-dev 2024-10-28 21:26:31 UTC
PR for testing.
Comment 8 Larry the Git Cow gentoo-dev 2024-10-29 00:27:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d4f045899711d1a2b3dd5f7b236f03f1d3ded51

commit 0d4f045899711d1a2b3dd5f7b236f03f1d3ded51
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-10-28 21:07:25 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-10-29 00:25:48 +0000

    kde-plasma/kwin: set cap_sys_nice=ep on kwin_wayland
    
    Closes: https://bugs.gentoo.org/941628
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../kwin/{kwin-6.2.2.ebuild => kwin-6.2.2-r1.ebuild}     | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
Comment 9 Larry the Git Cow gentoo-dev 2024-10-29 00:33:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=a5355d9c719f407dc300af8412348bbe3fe4ba52

commit a5355d9c719f407dc300af8412348bbe3fe4ba52
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-10-28 21:07:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-10-29 00:32:57 +0000

    kde-plasma/kwin: set cap_sys_nice=ep on kwin_wayland
    
    Closes: https://bugs.gentoo.org/941628
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 kde-plasma/kwin/kwin-6.2.49.9999.ebuild | 16 ++++++++++++----
 kde-plasma/kwin/kwin-9999.ebuild        | 16 ++++++++++++----
 2 files changed, 24 insertions(+), 8 deletions(-)
Comment 10 Larry the Git Cow gentoo-dev 2024-12-15 18:37:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c5387ec25069e924bac85e6510ca9aa91f35475

commit 9c5387ec25069e924bac85e6510ca9aa91f35475
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-15 18:35:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-15 18:36:40 +0000

    profiles: kwin[caps] -> kwin[filecaps]
    
    The masks/forces need updating for caps->filecaps when we fixed
    eclass use in bug #941628.
    
    Bug: https://bugs.gentoo.org/931215
    Bug: https://bugs.gentoo.org/941628
    Closes: https://bugs.gentoo.org/946505
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.use.force          | 2 +-
 profiles/features/musl/package.use.force | 2 +-
 profiles/features/musl/package.use.mask  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)