Back to index

glibc  2.9
authuxprot.c
Go to the documentation of this file.
00001 /*
00002  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00003  * unrestricted use provided that this legend is included on all tape
00004  * media and as a part of the software program in whole or part.  Users
00005  * may copy or modify Sun RPC without charge, but are not authorized
00006  * to license or distribute it to anyone else except as part of a product or
00007  * program developed by the user.
00008  *
00009  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00010  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00011  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00012  *
00013  * Sun RPC is provided with no support and without any obligation on the
00014  * part of Sun Microsystems, Inc. to assist in its use, correction,
00015  * modification or enhancement.
00016  *
00017  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00018  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00019  * OR ANY PART THEREOF.
00020  *
00021  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00022  * or profits or other special, indirect and consequential damages, even if
00023  * Sun has been advised of the possibility of such damages.
00024  *
00025  * Sun Microsystems, Inc.
00026  * 2550 Garcia Avenue
00027  * Mountain View, California  94043
00028  */
00029 /*
00030  * Copyright (C) 1984, Sun Microsystems, Inc.
00031  */
00032 /*
00033  * authunix_prot.c
00034  * XDR for UNIX style authentication parameters for RPC
00035  */
00036 
00037 #include <rpc/types.h>
00038 #include <rpc/xdr.h>
00039 #include <rpc/auth.h>
00040 #include <rpc/auth_unix.h>
00041 
00042 /*
00043  * XDR for unix authentication parameters.
00044  * Unfortunately, none of these can be declared const.
00045  */
00046 bool_t
00047 xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p)
00048 {
00049   if (INTUSE(xdr_u_long) (xdrs, &(p->aup_time))
00050       && INTUSE(xdr_string) (xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
00051       && (sizeof (uid_t) == sizeof (short int)
00052          ? INTUSE(xdr_u_short) (xdrs, (u_short *) & (p->aup_uid))
00053          : INTUSE(xdr_u_int) (xdrs, (u_int *) & (p->aup_uid)))
00054       && (sizeof (gid_t) == sizeof (short int)
00055          ? INTUSE(xdr_u_short) (xdrs, (u_short *) & (p->aup_gid))
00056          : INTUSE(xdr_u_int) (xdrs, (u_int *) & (p->aup_gid)))
00057       && INTUSE(xdr_array) (xdrs, (caddr_t *) & (p->aup_gids),
00058                          & (p->aup_len), NGRPS, sizeof (gid_t),
00059                          (sizeof (gid_t) == sizeof (short int)
00060                           ? (xdrproc_t) INTUSE(xdr_u_short)
00061                           : (xdrproc_t) INTUSE(xdr_u_int))))
00062     {
00063       return TRUE;
00064     }
00065   return FALSE;
00066 }
00067 INTDEF(xdr_authunix_parms)