]> git.ipfire.org Git - thirdparty/openvpn.git/commit
platform: Do not assume uid_t/gid_t are signed
authorFrank Lichtenheld <frank@lichtenheld.com>
Fri, 3 Oct 2025 10:06:02 +0000 (12:06 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 5 Oct 2025 16:41:00 +0000 (18:41 +0200)
commiteadae51341dbf80c83e827bb4011e80dfcbc6927
tree0c8109d5d2b36d4e3885213299a060dfeb16a755
parent9243ea88913fc1bed26c25ba7d7b18bb2f16fa4c
platform: Do not assume uid_t/gid_t are signed

uid_t/gid_t are int on many platform but unsigned
on at least Linux. So rewrite the code in a way that
does not make any assumptions about the types. Mainly
this means storing the information whether the value
is valid in a separate bool and not in the value
itself.

Note that this changes the return behavior of
platform_{user,group}_get but a review of the
callers determined that this makes no actual
difference.

Change-Id: Ie6b4c41d13544d5ba71d441cc794c7abd12408f3
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: MaxF <max@max-fillinger.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1206
Message-Id: <20251003100602.375062-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33266.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/manage.c
src/openvpn/manage.h
src/openvpn/platform.c
src/openvpn/platform.h
src/openvpn/socket.c
src/openvpn/socket.h