/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 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.
*/
/*
* auth_sys.c, Implements UNIX (system) 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 "mt.h"
#include "rpc_mt.h"
#include <alloca.h>
#include <stdio.h>
#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <rpc/auth_sys.h>
#include <synch.h>
extern int gethostname(char *, int);
static struct auth_ops *authsys_ops(void);
/*
* This struct is pointed to by the ah_private field of an auth_handle.
*/
struct audata {
};
static void marshal_new_auth();
/*
* Create a (sys) unix style authenticator.
* Returns an auth handle with the given stuff in it.
*/
AUTH *
{
/*
* Allocate and set up auth handle
*/
return (NULL);
}
return (NULL);
}
au->au_shfaults = 0;
/*
* fill in param struct from the given params
*/
/*
* Serialize the parameters into origcred
*/
": xdr_authsys_parms failed");
return (NULL);
}
NULL) {
return (NULL);
}
/*
* set auth handle to reflect new cred.
*/
(void) marshal_new_auth(auth);
return (auth);
}
/*
* authsys_create_default is a public interface.
*
* Returns an auth handle with parameters determined by doing lots of
* syscalls.
*/
static const char authsys_def_str[] =
"authsys_create_default: get%s failed: %m";
AUTH *
authsys_create_default(void)
{
int len;
return (NULL);
}
machname[MAX_MACHINE_NAME] = 0;
return (NULL);
}
}
/*
* authsys_create_ruid() is a private routine and is a
* variant of authsys_create_default().
*
* authsys_create_default() is using the effective uid.
* authsys_create_ruid() is using the real uid.
*
* This routine is used by key_call_ext() in key_call.c
*/
AUTH *
authsys_create_ruid(void)
{
int len;
"authsys_create_ruid:gethostname failed");
return (NULL);
}
machname[MAX_MACHINE_NAME] = 0;
"authsys_create_ruid:getgroups failed");
return (NULL);
}
return (res);
}
/*
* authsys operations
*/
/*ARGSUSED*/
static void
{
/* no action necessary */
}
static bool_t
{
/* LINTED pointer alignment */
}
static bool_t
{
/* LINTED pointer alignment */
}
} else {
}
(void) marshal_new_auth(auth);
}
return (TRUE);
}
/*ARGSUSED*/
static bool_t
{
/* LINTED pointer alignment */
int stat;
return (FALSE); /* there is no hope. Punt */
au->au_shfaults ++;
/* first deserialize the creds back into a struct authsys_parms */
if (!stat)
goto done;
/* update the time and serialize in place */
XDR_SETPOS(&xdrs, 0);
if (!stat)
goto done;
(void) marshal_new_auth(auth);
done:
/* free the struct authsys_parms created by deserializing */
XDR_DESTROY(&xdrs);
return (stat);
}
static void
{
/* LINTED pointer alignment */
}
/*
* Marshals (pre-serializes) an auth struct.
* sets private data, au_marshed and au_mpos
*/
static const char marshal_new_auth_str[] =
"marshal_new_auth - Fatal marshalling problem";
static void
{
/* LINTED pointer alignment */
} else {
}
}
static struct auth_ops *
authsys_ops(void)
{
/* VARIABLES PROTECTED BY ops_lock: ops */
(void) mutex_lock(&ops_lock);
}
(void) mutex_unlock(&ops_lock);
return (&ops);
}