[Rpm-maint] [rpm-software-management/rpm] Fix sbit removal if fchmodat() doesn't support AT_SYMLINK_NOFOLLOW (PR #2759)

Panu Matilainen notifications at github.com
Fri Nov 10 08:45:30 UTC 2023


glibc versions prior to 2020 know about AT_SYMLINK_NOFOLLOW but don't actually implement it for fchmodat() and returns ENOSYS when used. We don't check the return code in removeSBITS() so this silently fails on those older versions.

We already verify the thing is not a link in the fstatat() condition because cap_set_fileat() doesn't have any "dont follow" mode at all, so we can just as well drop it from the fchmodat() and make this work on more libc versions.

Add a test for the suid bit removal while at it.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2759

-- Commit Summary --

  * Fix sbit removal if fchmodat() doesn't support AT_SYMLINK_NOFOLLOW

-- File Changes --

    M lib/fsm.c (3)
    M tests/rpme.at (22)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2759.patch
https://github.com/rpm-software-management/rpm/pull/2759.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2759
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2759 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20231110/64f54dcc/attachment-0001.html>


More information about the Rpm-maint mailing list