Source-Changes-HG archive

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

[src/trunk]: src/sys/dist/pf/net Get uid/gid from the socket's credentials.



details:   https://anonhg.NetBSD.org/src/rev/7f66ffde7882
branches:  trunk
changeset: 750404:7f66ffde7882
user:      elad <elad%NetBSD.org@localhost>
date:      Wed Dec 30 07:00:01 2009 +0000

description:
Get uid/gid from the socket's credentials.

diffstat:

 sys/dist/pf/net/pf.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 2dfc3338113d -r 7f66ffde7882 sys/dist/pf/net/pf.c
--- a/sys/dist/pf/net/pf.c      Wed Dec 30 06:59:32 2009 +0000
+++ b/sys/dist/pf/net/pf.c      Wed Dec 30 07:00:01 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pf.c,v 1.57 2009/09/14 10:36:49 degroote Exp $ */
+/*     $NetBSD: pf.c,v 1.58 2009/12/30 07:00:01 elad Exp $     */
 /*     $OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.57 2009/09/14 10:36:49 degroote Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.58 2009/12/30 07:00:01 elad Exp $");
 
 #include "bpfilter.h"
 #include "pflog.h"
@@ -2824,12 +2824,13 @@
                break;
 #endif /* INET6 */
        }
-       pd->lookup.uid = so->so_uidinfo->ui_uid;
+       pd->lookup.uid = kauth_cred_geteuid(so->so_cred);
+       pd->lookup.gid = kauth_cred_getegid(so->so_cred);
 #else
        so = inp->inp_socket;
        pd->lookup.uid = so->so_euid;
+       pd->lookup.uid = so->so_egid;
 #endif /* !__NetBSD__ */
-       pd->lookup.gid = so->so_egid;
        pd->lookup.pid = so->so_cpid;
        return (1);
 }



Home | Main Index | Thread Index | Old Index