Module Name: src
Committed By: elad
Date: Wed May 6 22:17:41 UTC 2009
Modified Files:
src/sys/net: net_osdep.h
Log Message:
Provide privilege checking code snippets for all significant NetBSD
versions: < 2 (suser, proc), 2 & 3 (suser, lwp), >= 4 (kauth, lwp).
No functional change as it's all inside a big comment.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/net_osdep.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/net_osdep.h
diff -u src/sys/net/net_osdep.h:1.17 src/sys/net/net_osdep.h:1.18
--- src/sys/net/net_osdep.h:1.17 Sun Mar 4 06:03:17 2007
+++ src/sys/net/net_osdep.h Wed May 6 22:17:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: net_osdep.h,v 1.17 2007/03/04 06:03:17 christos Exp $ */
+/* $NetBSD: net_osdep.h,v 1.18 2009/05/06 22:17:41 elad Exp $ */
/* $KAME: net_osdep.h,v 1.51 2001/07/06 06:21:43 itojun Exp $ */
/*
@@ -79,12 +79,21 @@
* of BSDI (the change is not merged - yet).
*
* - privileged process
- * NetBSD
+ * NetBSD 2, 3
+ * struct lwp *l;
+ * if (l->l_proc &&
+ * !suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))
+ * privileged
+ * NetBSD >= 4
+ * below is the generic authorization call, please see kauth(9)
+ * for more specific alternatives (for proper integration with
+ * secmodels)
+ *
* struct lwp *l;
* if (l != NULL && kauth_authorize_generic(l->l_cred,
* KAUTH_GENERIC_ISSUSER, NULL) == 0)
* privileged;
- * FreeBSD 3
+ * NetBSD < 2, FreeBSD 3
* struct proc *p;
* if (p && !suser(p->p_ucred, &p->p_acflag))
* privileged;