Blame sunrpc/rpc/auth_unix.h

Packit 6c4009
/*
Packit 6c4009
 * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
Packit 6c4009
 *
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions are
Packit 6c4009
 * met:
Packit 6c4009
 *
Packit 6c4009
 *     * Redistributions of source code must retain the above copyright
Packit 6c4009
 *       notice, this list of conditions and the following disclaimer.
Packit 6c4009
 *     * Redistributions in binary form must reproduce the above
Packit 6c4009
 *       copyright notice, this list of conditions and the following
Packit 6c4009
 *       disclaimer in the documentation and/or other materials
Packit 6c4009
 *       provided with the distribution.
Packit 6c4009
 *     * Neither the name of the "Oracle America, Inc." nor the names of its
Packit 6c4009
 *       contributors may be used to endorse or promote products derived
Packit 6c4009
 *       from this software without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 6c4009
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 6c4009
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Packit 6c4009
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Packit 6c4009
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Packit 6c4009
 *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit 6c4009
 *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 6c4009
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 6c4009
 *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit 6c4009
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 6c4009
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * The system is very weak.  The client uses no encryption for  it
Packit 6c4009
 * credentials and only sends null verifiers.  The server sends backs
Packit 6c4009
 * null verifiers or optionally a verifier that suggests a new short hand
Packit 6c4009
 * for the credentials.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _RPC_AUTH_UNIX_H
Packit 6c4009
#define _RPC_AUTH_UNIX_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <rpc/types.h>
Packit 6c4009
#include <rpc/auth.h>
Packit 6c4009
#include <rpc/xdr.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* The machine name is part of a credential; it may not exceed 255 bytes */
Packit 6c4009
#define MAX_MACHINE_NAME 255
Packit 6c4009
Packit 6c4009
/* gids compose part of a credential; there may not be more than 16 of them */
Packit 6c4009
#define NGRPS 16
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Unix style credentials.
Packit 6c4009
 */
Packit 6c4009
struct authunix_parms
Packit 6c4009
  {
Packit 6c4009
    u_long aup_time;
Packit 6c4009
    char *aup_machname;
Packit 6c4009
    __uid_t aup_uid;
Packit 6c4009
    __gid_t aup_gid;
Packit 6c4009
    u_int aup_len;
Packit 6c4009
    __gid_t *aup_gids;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * If a response verifier has flavor AUTH_SHORT,
Packit 6c4009
 * then the body of the response verifier encapsulates the following structure;
Packit 6c4009
 * again it is serialized in the obvious fashion.
Packit 6c4009
 */
Packit 6c4009
struct short_hand_verf
Packit 6c4009
  {
Packit 6c4009
    struct opaque_auth new_cred;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* rpc/auth_unix.h */