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

View file

@ -1511,11 +1511,11 @@ check_body:
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(