auth_unix.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Adapted for use by the boot program.
*
* auth_unix.c, Implements UNIX style authentication parameters.
*
* The system is very weak. The client uses no encryption for its
* credentials and only sends null verifiers. The server sends backs
* null verifiers or optionally a verifier that suggests a new short hand
* for the credentials.
*/
#include <stdlib.h>
#include <sys/sysmacros.h>
#include "clnt.h"
#include <rpc/auth_unix.h>
#include <sys/bootdebug.h>
#include "nfs_inet.h"
static struct auth_ops *authunix_ops();
/*
* This struct is pointed to by the ah_private field of an auth_handle.
*/
struct audata {
char au_marshed[MAX_AUTH_BYTES];
};
static void marshal_new_auth(AUTH *);
/*
* Create a unix style authenticator.
* Returns an auth handle with the given stuff in it.
*/
AUTH *
{
struct authunix_parms aup;
char mymem[MAX_AUTH_BYTES];
/*
* Allocate and set up auth handle
*/
prom_panic("authunix_create: Cannot allocate memory.");
return (NULL);
}
prom_panic("authunix_create: Cannot allocate memory.");
return (NULL);
}
/* setup authenticator. */
/* structure copies */
au->au_shfaults = 0;
/*
* fill in param struct from the given params
*/
/*
* Serialize the parameters into origcred
*/
prom_panic("authunix_create: xdr_authunix_parms failed");
return ((AUTH *)0);
}
prom_panic("authunix_create: memory alloc failed");
return ((AUTH *)0);
}
/*
* set auth handle to reflect new cred.
*/
return (auth);
}
/*
* authunix operations
*/
/* ARGSUSED */
static void
{
}
/* ARGSUSED */
static bool_t
{
}
static bool_t
{
} else {
}
}
return (TRUE);
}
/*ARGSUSED*/
static bool_t
{
struct authunix_parms aup;
int stat;
/* there is no hope. Punt */
return (FALSE);
}
au->au_shfaults ++;
/* first deserialize the creds back into a struct authunix_parms */
aup.aup_machname = (char *)0;
if (!stat)
goto done;
/* update the time and serialize in place */
XDR_SETPOS(&xdrs, 0);
if (!stat)
goto done;
done:
/* free the struct authunix_parms created by deserializing */
XDR_DESTROY(&xdrs);
return (stat);
}
static void
{
}
/*
* Marshals (pre-serializes) an auth struct.
* sets private data, au_marshed and au_mpos
*/
static void
{
dprintf("marshal_new_auth - Fatal marshalling problem");
} else {
}
}
static struct auth_ops *
authunix_ops(void)
{
if (ops.ah_nextverf == 0) {
}
return (&ops);
}
/*
* XDR for unix authentication parameters.
*/
{
return (TRUE);
}
return (FALSE);
}