1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-19 15:33:56 +00:00

o Fix ipfw uid rules: socheckuid() returns 0 when uid matches a socket

cr_uid.

Note: we do not have socheckuid() in RELENG_4, ip_fw2.c uses its
own macro for a similar purpose that is why ipfw2 in RELENG_4 processes
uid rules correctly. I will MFC the diff for code consistency.

Reported by:	Oleg Baranov <ol@csa.ru>
Reviewed by:	luigi
MFC after:	1 month
This commit is contained in:
Maxim Konovalov 2003-02-17 13:39:57 +00:00
parent 3931c9a231
commit b52d5ea3d2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111037

View File

@ -1511,11 +1511,11 @@ ipfw_chk(struct ip_fw_args *args)
if (pcb == NULL || pcb->inp_socket == NULL)
break;
#if __FreeBSD_version < 500034
#define socheckuid(a,b) ((a)->so_cred->cr_uid == (b))
#define socheckuid(a,b) ((a)->so_cred->cr_uid != (b))
#endif
if (cmd->opcode == O_UID) {
match =
socheckuid(pcb->inp_socket,
!socheckuid(pcb->inp_socket,
(uid_t)((ipfw_insn_u32 *)cmd)->d[0]);
} else {
match = groupmember(