Re: runit: tryshsgr.c: why not test whether gid_t is short by using "sizeof(short) == sizeof(gid_t)"

From: Leah Neukirchen <leah_at_vuxu.org>
Date: Wed, 04 Sep 2024 13:56:39 +0200

Zhixu Liu <zhixu.liu_at_gmail.com> writes:

> Hi,
>
> I'm trying to keep runit remaining available in gentoo's official portage tree,
> see https://bugs.gentoo.org/938282 . I setup a github repo at
> https://github.com/clan/runit/ for this purpose, following is what I'm doing
> now:
> 1. fix all the compilation error(s)
> 2. eliminate the compilation warning(s) as much as possible
>
> Now I 'm in stage 2, when fixing the warning of
> -Wincompatible-pointer-types, see
> https://github.com/clan/runit/blob/master/admin/runit-2.1.2/src/tryshsgr.c
>
> As G. Pape has commented at
> https://github.com/clan/runit/commit/5a7b8099ae638ce72abae2c4d8cac7ce33477522
>
>> "tryshsgr" is specifically there to check whether the size of gid_t is short,
>> it doesn't matter if it fails at compile time or run time. But with this
>> change, it always succeeds, and so always size short is
>> assumed, even though most systems should have unsigned int I guess.

As of runit.git 84457fd2 (2005-08-23), prot_gid is unused and all of
this is dead code that can be removed. setgroups is used directly
with proper gid_t types.

-- 
Leah Neukirchen  <leah_at_vuxu.org>  https://leahneukirchen.org/
Received on Wed Sep 04 2024 - 13:56:39 CEST

This archive was generated by hypermail 2.4.0 : Wed Sep 04 2024 - 13:57:12 CEST