auth_none.c (a986ef5788bd3338d2a970eb96104824e4a0e3bb) auth_none.c (235baf269e492159336326a12da1ca09fbba85db)
1/* $NetBSD: auth_none.c,v 1.13 2000/01/22 22:19:17 mycroft Exp $ */
2
3/*
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or

--- 38 unchanged lines hidden (view full) ---

47#include "namespace.h"
48#include "reentrant.h"
49#include <assert.h>
50#include <stdlib.h>
51#include <rpc/types.h>
52#include <rpc/xdr.h>
53#include <rpc/auth.h>
54#include "un-namespace.h"
1/* $NetBSD: auth_none.c,v 1.13 2000/01/22 22:19:17 mycroft Exp $ */
2
3/*
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or

--- 38 unchanged lines hidden (view full) ---

47#include "namespace.h"
48#include "reentrant.h"
49#include <assert.h>
50#include <stdlib.h>
51#include <rpc/types.h>
52#include <rpc/xdr.h>
53#include <rpc/auth.h>
54#include "un-namespace.h"
55#include "mt_misc.h"
55
56#define MAX_MARSHAL_SIZE 20
57
58/*
59 * Authenticator operations routines
60 */
61
62static bool_t authnone_marshal (AUTH *, XDR *);

--- 13 unchanged lines hidden (view full) ---

76} *authnone_private;
77
78AUTH *
79authnone_create()
80{
81 struct authnone_private *ap = authnone_private;
82 XDR xdr_stream;
83 XDR *xdrs;
56
57#define MAX_MARSHAL_SIZE 20
58
59/*
60 * Authenticator operations routines
61 */
62
63static bool_t authnone_marshal (AUTH *, XDR *);

--- 13 unchanged lines hidden (view full) ---

77} *authnone_private;
78
79AUTH *
80authnone_create()
81{
82 struct authnone_private *ap = authnone_private;
83 XDR xdr_stream;
84 XDR *xdrs;
84 extern mutex_t authnone_lock;
85
86 mutex_lock(&authnone_lock);
87 if (ap == 0) {
88 ap = (struct authnone_private *)calloc(1, sizeof (*ap));
89 if (ap == 0) {
90 mutex_unlock(&authnone_lock);
91 return (0);
92 }

--- 15 unchanged lines hidden (view full) ---

108}
109
110/*ARGSUSED*/
111static bool_t
112authnone_marshal(AUTH *client, XDR *xdrs)
113{
114 struct authnone_private *ap;
115 bool_t dummy;
85
86 mutex_lock(&authnone_lock);
87 if (ap == 0) {
88 ap = (struct authnone_private *)calloc(1, sizeof (*ap));
89 if (ap == 0) {
90 mutex_unlock(&authnone_lock);
91 return (0);
92 }

--- 15 unchanged lines hidden (view full) ---

108}
109
110/*ARGSUSED*/
111static bool_t
112authnone_marshal(AUTH *client, XDR *xdrs)
113{
114 struct authnone_private *ap;
115 bool_t dummy;
116 extern mutex_t authnone_lock;
117
118 assert(xdrs != NULL);
119
120 ap = authnone_private;
121 if (ap == NULL) {
122 mutex_unlock(&authnone_lock);
123 return (FALSE);
124 }

--- 31 unchanged lines hidden (view full) ---

156authnone_destroy(AUTH *client)
157{
158}
159
160static struct auth_ops *
161authnone_ops()
162{
163 static struct auth_ops ops;
116
117 assert(xdrs != NULL);
118
119 ap = authnone_private;
120 if (ap == NULL) {
121 mutex_unlock(&authnone_lock);
122 return (FALSE);
123 }

--- 31 unchanged lines hidden (view full) ---

155authnone_destroy(AUTH *client)
156{
157}
158
159static struct auth_ops *
160authnone_ops()
161{
162 static struct auth_ops ops;
164 extern mutex_t ops_lock;
165
166/* VARIABLES PROTECTED BY ops_lock: ops */
167
168 mutex_lock(&ops_lock);
169 if (ops.ah_nextverf == NULL) {
170 ops.ah_nextverf = authnone_verf;
171 ops.ah_marshal = authnone_marshal;
172 ops.ah_validate = authnone_validate;
173 ops.ah_refresh = authnone_refresh;
174 ops.ah_destroy = authnone_destroy;
175 }
176 mutex_unlock(&ops_lock);
177 return (&ops);
178}
163
164/* VARIABLES PROTECTED BY ops_lock: ops */
165
166 mutex_lock(&ops_lock);
167 if (ops.ah_nextverf == NULL) {
168 ops.ah_nextverf = authnone_verf;
169 ops.ah_marshal = authnone_marshal;
170 ops.ah_validate = authnone_validate;
171 ops.ah_refresh = authnone_refresh;
172 ops.ah_destroy = authnone_destroy;
173 }
174 mutex_unlock(&ops_lock);
175 return (&ops);
176}