source: rtems-libbsd/freebsd/lib/libc/rpc/authunix_prot.c

6-freebsd-12
Last change on this file was bb80d9d, checked in by Sebastian Huber <sebastian.huber@…>, on 08/09/18 at 12:02:09

Update to FreeBSD head 2017-12-01

Git mirror commit e724f51f811a4b2bd29447f8b85ab5c2f9b88266.

Update #3472.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1#include <machine/rtems-bsd-user-space.h>
2
3/*      $NetBSD: authunix_prot.c,v 1.12 2000/01/22 22:19:17 mycroft Exp $       */
4
5/*-
6 * SPDX-License-Identifier: BSD-3-Clause
7 *
8 * Copyright (c) 2009, Sun Microsystems, Inc.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright notice,
14 *   this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright notice,
16 *   this list of conditions and the following disclaimer in the documentation
17 *   and/or other materials provided with the distribution.
18 * - Neither the name of Sun Microsystems, Inc. nor the names of its
19 *   contributors may be used to endorse or promote products derived
20 *   from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#if defined(LIBC_SCCS) && !defined(lint)
36static char *sccsid2 = "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro";
37static char *sccsid = "@(#)authunix_prot.c      2.1 88/07/29 4.0 RPCSRC";
38#endif
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD$");
41
42/*
43 * authunix_prot.c
44 * XDR for UNIX style authentication parameters for RPC
45 *
46 * Copyright (C) 1984, Sun Microsystems, Inc.
47 */
48
49#include "namespace.h"
50#include <assert.h>
51
52#include <rpc/types.h>
53#include <rpc/xdr.h>
54#include <rpc/auth.h>
55#include <rpc/auth_unix.h>
56#include "un-namespace.h"
57
58/*
59 * XDR for unix authentication parameters.
60 */
61bool_t
62xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)
63{
64        u_int **paup_gids;
65
66        assert(xdrs != NULL);
67        assert(p != NULL);
68
69        paup_gids = &p->aup_gids;
70
71        if (xdr_u_long(xdrs, &(p->aup_time)) &&
72            xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
73            xdr_u_int(xdrs, &(p->aup_uid)) &&
74            xdr_u_int(xdrs, &(p->aup_gid)) &&
75            xdr_array(xdrs, (char **) paup_gids,
76            &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {
77                return (TRUE);
78        }
79        return (FALSE);
80}
Note: See TracBrowser for help on using the repository browser.