📄 authunix_prot.c
字号:
#ifndef lintstatic char *sccsid = "@(#)authunix_prot.c 4.1 ULTRIX 7/3/90";#endif lint/************************************************************************ * * * Copyright (c) 1986 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * This software is derived from software received from the * * University of California, Berkeley, and from Bell * * Laboratories. Use, duplication, or disclosure is subject to * * restrictions under license agreements with University of * * California and with AT&T. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************//* * Portions of this software have been licensed to * Digital Equipment Company, Maynard, MA. * Copyright (c) 1986 Sun Microsystems, Inc. ALL RIGHTS RESERVED. *//* * authunix_prot.c * XDR for UNIX style authentication parameters for RPC * */#ifdef KERNEL#include "../h/param.h"#include "../h/systm.h"#include "../h/user.h"#include "../h/kernel.h"#include "../h/proc.h"#include "../rpc/types.h"#include "../rpc/xdr.h"#include "../rpc/auth.h"#include "../rpc/auth_unix.h"#else#include <rpc/types.h>#include <rpc/xdr.h>#include <rpc/auth.h>#include <rpc/auth_unix.h>#endif/* * XDR for unix authentication parameters. */bool_txdr_authunix_parms(xdrs, p) register XDR *xdrs; register struct authunix_parms *p;{ if (xdr_u_long(xdrs, &(p->aup_time)) && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) && xdr_int(xdrs, &(p->aup_uid)) && xdr_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (caddr_t *)&(p->aup_gids), &(p->aup_len), NGRPS, sizeof(int), xdr_int) ) { return (TRUE); } return (FALSE);}#ifdef KERNEL/* * XDR kernel unix auth parameters. * Goes out of the u struct directly. * NOTE: this is an XDR_ENCODE only routine. */xdr_authkern(xdrs) register XDR *xdrs;{ int *gp; int uid = u.u_uid; int gid = u.u_gid; int len; caddr_t groups; char *name = hostname; if (xdrs->x_op != XDR_ENCODE) { return (FALSE); } for (gp = &u.u_groups[NGRPS]; gp > u.u_groups; gp--) { if (gp[-1] >= 0) { break; } } len = gp - u.u_groups; groups = (caddr_t)u.u_groups; if (xdr_u_long(xdrs, (u_long *)&time.tv_sec) && xdr_string(xdrs, &name, MAX_MACHINE_NAME) && xdr_int(xdrs, &uid) && xdr_int(xdrs, &gid) && xdr_array(xdrs, &groups, (u_int *)&len, NGRPS, sizeof (int), xdr_int) ) { return (TRUE); } return (FALSE);}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -