Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic don't opencode kauth_cred_get()



details:   https://anonhg.NetBSD.org/src/rev/6f1834910190
branches:  trunk
changeset: 986979:6f1834910190
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 21 14:40:14 2021 +0000

description:
don't opencode kauth_cred_get()

diffstat:

 sys/dev/ic/an.c  |  6 +++---
 sys/dev/ic/ath.c |  6 +++---
 sys/dev/ic/atw.c |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (83 lines):

diff -r ff7df8e9580f -r 6f1834910190 sys/dev/ic/an.c
--- a/sys/dev/ic/an.c   Tue Sep 21 14:36:34 2021 +0000
+++ b/sys/dev/ic/an.c   Tue Sep 21 14:40:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: an.c,v 1.75 2021/06/16 00:21:18 riastradh Exp $        */
+/*     $NetBSD: an.c,v 1.76 2021/09/21 14:40:14 christos Exp $ */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.75 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.76 2021/09/21 14:40:14 christos Exp $");
 
 
 #include <sys/param.h>
@@ -1287,7 +1287,7 @@
                        continue;
                /* do not show any keys to non-root user */
                /* XXX-elad: why is this inside a loop? */
-               if ((error = kauth_authorize_network(curlwp->l_cred,
+               if ((error = kauth_authorize_network(kauth_cred_get(),
                    KAUTH_NETWORK_INTERFACE,
                    KAUTH_REQ_NETWORK_INTERFACE_GETPRIV, sc->sc_ic.ic_ifp,
                    KAUTH_ARG(SIOCG80211NWKEY), NULL)) != 0)
diff -r ff7df8e9580f -r 6f1834910190 sys/dev/ic/ath.c
--- a/sys/dev/ic/ath.c  Tue Sep 21 14:36:34 2021 +0000
+++ b/sys/dev/ic/ath.c  Tue Sep 21 14:40:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath.c,v 1.136 2021/08/09 20:49:10 andvar Exp $ */
+/*     $NetBSD: ath.c,v 1.137 2021/09/21 14:41:28 christos Exp $       */
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.136 2021/08/09 20:49:10 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.137 2021/09/21 14:41:28 christos Exp $");
 #endif
 
 /*
@@ -5426,7 +5426,7 @@
            }
 
        case SIOCGATHDIAG:
-               error = kauth_authorize_network(curlwp->l_cred,
+               error = kauth_authorize_network(kauth_cred_get(),
                    KAUTH_NETWORK_INTERFACE,
                    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
                    NULL);
diff -r ff7df8e9580f -r 6f1834910190 sys/dev/ic/atw.c
--- a/sys/dev/ic/atw.c  Tue Sep 21 14:36:34 2021 +0000
+++ b/sys/dev/ic/atw.c  Tue Sep 21 14:40:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atw.c,v 1.171 2021/06/16 00:21:18 riastradh Exp $  */
+/*     $NetBSD: atw.c,v 1.172 2021/09/21 14:42:01 christos Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.171 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.172 2021/09/21 14:42:01 christos Exp $");
 
 
 #include <sys/param.h>
@@ -3946,8 +3946,8 @@
        case SIOCS80211:
                ireq = data;
                if (ireq->i_type == IEEE80211_IOC_FRAGTHRESHOLD) {
-                       if ((error = kauth_authorize_network(curlwp->l_cred,
-                           KAUTH_NETWORK_INTERFACE,
+                       if ((error = kauth_authorize_network(
+                           kauth_cred_get(), KAUTH_NETWORK_INTERFACE,
                            KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp,
                            (void *)cmd, NULL)) != 0)
                                break;



Home | Main Index | Thread Index | Old Index