[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Prevent chown to remove the setuid bit



Hi,

On Wed, Nov 26, 2025 at 08:39:43PM +0100, Franco Martelli wrote:
> Is it possible to change the group owner keeping the permissions of the file
> in its place?

I don't think so because it's the kernel that's enforcing this in the
system call. On user or group change it's clearing setuid, setgid and
all capabilities.

Is there a reason why you can't read the setuid/setgid bits before and
restore them after?

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: