/* $NetBSD: authunix_prot.c,v 1.12 2000/01/22 22:19:17 mycroft Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright (c) 2009, Sun Microsystems, Inc.6* All rights reserved.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions are met:10* - Redistributions of source code must retain the above copyright notice,11* this list of conditions and the following disclaimer.12* - Redistributions in binary form must reproduce the above copyright notice,13* this list of conditions and the following disclaimer in the documentation14* and/or other materials provided with the distribution.15* - Neither the name of Sun Microsystems, Inc. nor the names of its16* contributors may be used to endorse or promote products derived17* from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE23* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132/*33* authunix_prot.c34* XDR for UNIX style authentication parameters for RPC35*36* Copyright (C) 1984, Sun Microsystems, Inc.37*/3839#include "namespace.h"40#include <assert.h>4142#include <rpc/types.h>43#include <rpc/xdr.h>44#include <rpc/auth.h>45#include <rpc/auth_unix.h>46#include "un-namespace.h"4748/*49* XDR for unix authentication parameters.50*/51bool_t52xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)53{54u_int **paup_gids;5556assert(xdrs != NULL);57assert(p != NULL);5859paup_gids = &p->aup_gids;6061if (xdr_u_long(xdrs, &(p->aup_time)) &&62xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&63xdr_u_int(xdrs, &(p->aup_uid)) &&64xdr_u_int(xdrs, &(p->aup_gid)) &&65xdr_array(xdrs, (char **) paup_gids,66&(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {67return (TRUE);68}69return (FALSE);70}717273