smb_token_xdr.c revision 6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2e
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This file was originally generated using rpcgen.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifndef _KERNEL
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <stdlib.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif /* !_KERNEL */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/smb_vops.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/wintypes.h>
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#include <smbsrv/smb_sid.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/smb_xdr.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/smb_token.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2easstatic bool_t
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2easxdr_sid_helper(xdrs, sid)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char **sid;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t pos, len;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint8_t dummy, cnt;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw bool_t rc;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw switch (xdrs->x_op) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw case XDR_DECODE:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /*
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * chicken-and-egg: Can't use smb_sid_len() since it takes
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SID as its parameter while sid is yet to be decoded.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw pos = xdr_getpos(xdrs);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_bool(xdrs, &rc))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint8_t(xdrs, &dummy))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint8_t(xdrs, &cnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rc = xdr_setpos(xdrs, pos);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (rc == FALSE)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas len = sizeof (smb_sid_t) - sizeof (uint32_t) +
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw (cnt * sizeof (uint32_t));
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_pointer(xdrs, sid, len, (xdrproc_t)xdr_smb_sid_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw break;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw case XDR_ENCODE:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw case XDR_FREE:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (*sid == NULL)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas len = smb_sid_len((smb_sid_t *)(uintptr_t)*sid);
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_pointer(xdrs, sid, len, (xdrproc_t)xdr_smb_sid_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw break;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw }
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_privset_helper(xdrs, privs)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char **privs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t pos, len;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t cnt;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw bool_t rc;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_privset_t *p;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (xdrs->x_op == XDR_DECODE) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw pos = xdr_getpos(xdrs);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_bool(xdrs, &rc))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &cnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rc = xdr_setpos(xdrs, pos);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (rc == FALSE)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw } else {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (*privs == NULL)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw p = (smb_privset_t *)(uintptr_t)*privs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw cnt = p->priv_cnt;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw }
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw len = sizeof (smb_privset_t)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw - sizeof (smb_luid_attrs_t)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw + (cnt * sizeof (smb_luid_attrs_t));
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, privs, len, (xdrproc_t)xdr_smb_privset_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_win_grps_helper(xdrs, grps)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char **grps;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t pos, len;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint16_t cnt;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw bool_t rc;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (xdrs->x_op == XDR_DECODE) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw pos = xdr_getpos(xdrs);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_bool(xdrs, &rc))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint16_t(xdrs, &cnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rc = xdr_setpos(xdrs, pos);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (rc == FALSE)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw } else {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (*grps == NULL)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw cnt = ((smb_win_grps_t *)(uintptr_t)*grps)->wg_count;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw }
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw len = cnt * sizeof (smb_id_t) + sizeof (smb_win_grps_t);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, grps, len, (xdrproc_t)xdr_smb_win_grps_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_id_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_id_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_smb_sid_attrs_t(xdrs, &objp->i_sidattr))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, (uint32_t *)&objp->i_id))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_win_grps_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_win_grps_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint16_t(xdrs, &objp->wg_count))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_vector(xdrs, (char *)objp->wg_groups, objp->wg_count,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_id_t), (xdrproc_t)xdr_smb_id_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_posix_grps_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_posix_grps_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->pg_ngrps))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_vector(xdrs, (char *)objp->pg_grps, objp->pg_ngrps,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint32_t), (xdrproc_t)xdr_uint32_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_posix_grps_helper(xdrs, identity)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char **identity;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t pos, len;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw uint32_t cnt;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw bool_t rc;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (xdrs->x_op == XDR_DECODE) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw pos = xdr_getpos(xdrs);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_bool(xdrs, &rc))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &cnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw rc = xdr_setpos(xdrs, pos);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (rc == FALSE)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw } else {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (*identity == NULL)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw cnt = ((smb_posix_grps_t *)(uintptr_t)*identity)->pg_ngrps;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw }
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw len = SMB_POSIX_GRPS_SIZE(cnt);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, identity, len, (xdrproc_t)xdr_smb_posix_grps_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_session_key_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_session_key_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_vector(xdrs, (char *)objp->data, 16,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint8_t), (xdrproc_t)xdr_uint8_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_netr_client_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw netr_client_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint16_t(xdrs, &objp->logon_level))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_string(xdrs, &objp->username, ~0))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_string(xdrs, &objp->domain, ~0))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_string(xdrs, &objp->workstation, ~0))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->ipaddr))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_array(xdrs, (char **)&objp->challenge_key.challenge_key_val,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw (uint32_t *)&objp->challenge_key.challenge_key_len, ~0,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint8_t), (xdrproc_t)xdr_uint8_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_array(xdrs, (char **)&objp->nt_password.nt_password_val,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw (uint32_t *)&objp->nt_password.nt_password_len, ~0,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint8_t), (xdrproc_t)xdr_uint8_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_array(xdrs, (char **)&objp->lm_password.lm_password_val,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw (uint32_t *)&objp->lm_password.lm_password_len, ~0,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint8_t), (xdrproc_t)xdr_uint8_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->logon_id))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_int(xdrs, &objp->native_os))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_int(xdrs, &objp->native_lm))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->local_ipaddr))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint16_t(xdrs, &objp->local_port))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->flags))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2easxdr_smb_sid_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas smb_sid_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_uint8_t(xdrs, &objp->sid_revision))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_uint8_t(xdrs, &objp->sid_subauthcnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_vector(xdrs, (char *)objp->sid_authority, NT_SID_AUTH_MAX,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint8_t), (xdrproc_t)xdr_uint8_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas if (!xdr_vector(xdrs, (char *)objp->sid_subauth, objp->sid_subauthcnt,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (uint32_t), (xdrproc_t)xdr_uint32_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_luid_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_luid_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->lo_part))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->hi_part))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_luid_attrs_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_luid_attrs_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_smb_luid_t(xdrs, &objp->luid))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->attrs))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_privset_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_privset_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->priv_cnt))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->control))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_vector(xdrs, (char *)objp->priv, objp->priv_cnt,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_luid_attrs_t),
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw (xdrproc_t)xdr_smb_luid_attrs_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_sid_attrs_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_sid_attrs_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->attrs))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas return (xdr_sid_helper(xdrs, (char **)&objp->sid));
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwbool_t
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwxdr_smb_token_t(xdrs, objp)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw XDR *xdrs;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw smb_token_t *objp;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, (char **)&objp->tkn_user,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_id_t), (xdrproc_t)xdr_smb_id_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, (char **)&objp->tkn_owner,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_id_t), (xdrproc_t)xdr_smb_id_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, (char **)&objp->tkn_primary_grp,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_id_t), (xdrproc_t)xdr_smb_id_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_smb_win_grps_helper(xdrs, (char **)&objp->tkn_win_grps))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_smb_privset_helper(xdrs, (char **)&objp->tkn_privileges))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_string(xdrs, &objp->tkn_account_name, ~0))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_string(xdrs, &objp->tkn_domain_name, ~0))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->tkn_flags))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_uint32_t(xdrs, &objp->tkn_audit_sid))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_pointer(xdrs, (char **)&objp->tkn_session_key,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw sizeof (smb_session_key_t), (xdrproc_t)xdr_smb_session_key_t))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (!xdr_smb_posix_grps_helper(xdrs, (char **)&objp->tkn_posix_grps))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (FALSE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (TRUE);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}