📄 auth_none.c
字号:
#if !defined(lint) && defined(SCCSIDS)static char sccsid[] = "@(#)auth_none.c 1.1 92/07/30 Copyr 1984 Sun Micro";#endif/* * auth_none.c * Creates a client authentication handle for passing "null" * credentials and verifiers to remote systems. * * Copyright (C) 1984, Sun Microsystems, Inc. */#include <rpc/types.h>#include <rpc/xdr.h>#include <rpc/auth.h>#define MAX_MARSHEL_SIZE 20static struct auth_ops *authnone_ops();static struct authnone_private { AUTH no_client; char marshalled_client[MAX_MARSHEL_SIZE]; u_int mcnt;} *authnone_private;AUTH *authnone_create(){ register struct authnone_private *ap = authnone_private; XDR xdr_stream; register XDR *xdrs; if (ap == 0) { ap = (struct authnone_private *)calloc(1, sizeof (*ap)); if (ap == 0) return (0); authnone_private = ap; } if (!ap->mcnt) { ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; ap->no_client.ah_ops = authnone_ops(); xdrs = &xdr_stream; xdrmem_create(xdrs, ap->marshalled_client, (u_int)MAX_MARSHEL_SIZE, XDR_ENCODE); (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); ap->mcnt = XDR_GETPOS(xdrs); XDR_DESTROY(xdrs); } return (&ap->no_client);}/*ARGSUSED*/static bool_tauthnone_marshal(client, xdrs) AUTH *client; XDR *xdrs;{ register struct authnone_private *ap = authnone_private; if (ap == 0) return (0); return ((*xdrs->x_ops->x_putbytes)(xdrs, ap->marshalled_client, ap->mcnt));}static voidauthnone_verf(){}static bool_tauthnone_validate(){ return (TRUE);}static bool_tauthnone_refresh(){ return (FALSE);}static voidauthnone_destroy(){}static struct auth_ops *authnone_ops(){ static struct auth_ops ops; if (ops.ah_nextverf == NULL) { ops.ah_nextverf = authnone_verf; ops.ah_marshal = authnone_marshal; ops.ah_validate = authnone_validate; ops.ah_refresh = authnone_refresh; ops.ah_destroy = authnone_destroy; } return (&ops);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -