gssd_clnt_stubs.c revision d4f95bf4d6ec7ef0f01e5ddf22813ac641edf019
/*
* 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 2012 Milan Jurik. All rights reserved.
*/
/*
* GSSAPI library stub module for gssd.
*/
#include <mechglueP.h>
#include "gssd_prot.h"
#include <gssapi/kgssapi_defs.h>
#ifdef GSSDEBUG
/*
* Kernel kgssd module debugging aid. The global variable "gss_log"
* is a bit mask which allows various types of debugging messages
* to be printed out.
*
* gss_log & 1 will cause actual failures to be printed.
* gss_log & 2 will cause informational messages to be
* printed on the client side of kgssd.
* gss_log & 4 will cause informational messages to be
* printed on the server side of kgssd.
* gss_log & 8 will cause informational messages to be
* printed on both client and server side of kgssd.
*/
#endif /* GSSDEBUG */
#ifdef DEBUG
extern void prom_printf(const char *, ...);
#endif
char *server = "localhost";
/* EXPORT DELETE START */
/* EXPORT DELETE END */
#define DEFAULT_MINOR_STAT ((OM_uint32) ~0)
uid,
const gss_name_t desired_name;
const gss_OID_set desired_mechs;
int cred_usage;
{
enum clnt_stat client_stat;
int i;
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* convert the desired name from internal to external format */
&name_type) != GSS_S_COMPLETE) {
return ((OM_uint32) GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
name_type == GSS_C_NULL_OID ?
name_type == GSS_C_NULL_OID ?
if (desired_mechs != GSS_C_NULL_OID_SET) {
for (i = 0; i < desired_mechs->count; i++) {
(void) memcpy(
}
} else
/* call the remote procedure */
if (desired_mechs != GSS_C_NULL_OID_SET) {
for (i = 0; i < desired_mechs->count; i++)
}
if (client_stat != RPC_SUCCESS) {
/*
* if the RPC call times out, null out all return arguments,
* set minor_status to its maximum value, and return
* GSS_S_FAILURE
*/
if (minor_status != NULL)
if (output_cred_handle != NULL)
if (actual_mechs != NULL)
*actual_mechs = NULL;
*time_rec = 0;
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
if (output_cred_handle != NULL &&
}
actual_mechs != NULL) {
(*actual_mechs)->count =
for (i = 0; i < (*actual_mechs)->count; i++) {
}
} else {
actual_mechs != NULL)
(*actual_mechs) = NULL;
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
uid)
const gss_name_t desired_name;
const gss_OID_set desired_mechs;
int cred_usage;
{
kcred = KGSS_CRED_ALLOC();
}
return (err);
}
uid)
int cred_usage;
int initiator_time_req;
int acceptor_time_req;
{
int i;
/*
* NULL the params here once
* If there are errors then we won't
* have to do it for every error
* case
*/
if (minor_status != NULL)
if (actual_mechs != NULL)
*actual_mechs = NULL;
if (initiator_time_rec != NULL)
*initiator_time_rec = 0;
if (acceptor_time_rec != NULL)
*acceptor_time_rec = 0;
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* convert the desired name from internal to external format */
&name_type) != GSS_S_COMPLETE) {
return ((OM_uint32) GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_cred_id_t);
name_type == GSS_C_NULL_OID ?
name_type == GSS_C_NULL_OID ?
desired_mech_type->length : 0);
(char *)(desired_mech_type != GSS_C_NULL_OID ?
desired_mech_type->elements : 0);
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments,
* set minor_status to its maximum value, and return
* GSS_S_FAILURE
*/
return (GSS_S_FAILURE);
}
/* free the allocated memory for the flattened name */
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
actual_mechs != NULL) {
(*actual_mechs)->count =
for (i = 0; i < (*actual_mechs)->count; i++) {
}
} else {
(*actual_mechs) = NULL;
}
if (initiator_time_rec != NULL)
if (acceptor_time_rec != NULL)
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
uid)
int cred_usage;
int initiator_time_req;
int acceptor_time_req;
{
if (input_cred_handle != GSS_C_NO_CREDENTIAL) {
} else {
}
return (err);
}
uid,
{
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
if (cred_handle != NULL) {
(uint_t)sizeof (gssd_cred_id_t);
} else
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
if (cred_handle != NULL)
*cred_handle = NULL;
return (GSS_S_FAILURE);
}
/* if the release succeeded, null out the cred_handle */
*cred_handle = NULL;
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
/* return with status returned in rpc call */
}
uid)
{
if (*cred_handle == GSS_C_NO_CREDENTIAL)
return (GSS_S_COMPLETE);
else
return (err);
}
static OM_uint32
const gss_name_t target_name,
int req_flags,
const gss_buffer_t input_token,
int *ret_flags,
{
/* get the client handle to GSSD */
GSSLOG(1,
"kgss_init_sec_context: can't connect to server on %s\n",
server);
return (GSS_S_FAILURE);
}
/* convert the target name from internal to external format */
return ((OM_uint32) GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_ctx_id_t);
0 : (uint_t)sizeof (gssd_cred_id_t);
(char *)&claimant_cred_handle;
name_type == GSS_C_NULL_OID ?
if (input_chan_bindings != GSS_C_NO_CHANNEL_BINDINGS) {
} else {
}
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
if (actual_mech_type != NULL)
*actual_mech_type = NULL;
if (output_token != NULL)
output_token->length = 0;
*ret_flags = 0;
*time_rec = 0;
return (GSS_S_FAILURE);
}
/* free the allocated memory for the flattened name */
if (minor_status != NULL)
}
/* if the call was successful, copy out the results */
/*
* if the return code is GSS_S_CONTINUE_NEEDED
* ignore all return parameters except for
* status codes, output token and context handle.
*/
if (actual_mech_type != NULL) {
(*actual_mech_type)->length =
(*actual_mech_type)->elements =
(*actual_mech_type)->length);
}
}
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
static struct gss_config default_gc = {
{ 0, NULL},
NULL,
NULL,
0,
/* EXPORT DELETE START */ /* CRYPT DELETE START */
/* EXPORT DELETE END */ /* CRYPT DELETE END */
NULL, /* kgss_delete_sec_context_wrapped */
/* EXPORT DELETE START */ /* CRYPT DELETE START */
/* EXPORT DELETE END */ /* CRYPT DELETE END */
NULL, /* kgss_import_sec_context */
/* EXPORT DELETE START */
/* CRYPT DELETE START */
#if 0
/* CRYPT DELETE END */
/* CRYPT DELETE START */
#endif
/* CRYPT DELETE END */
/* EXPORT DELETE END */
};
void
{
}
const gss_name_t target_name,
int req_flags,
const gss_buffer_t input_token,
int *ret_flags,
{
/*
* If this is an initial call, we'll need to create the
* wrapper struct that contains kernel state information, and
* a reference to the handle from gssd.
*/
if (*context_handle == GSS_C_NO_CONTEXT) {
kctx = KGSS_ALLOC();
/*
* The default gss-mechanism struct as pointers to
* upcalls to gssd.
*/
} else
if (claimant_cred_handle != GSS_C_NO_CREDENTIAL) {
} else {
}
/*
* We need to know the resulting mechanism oid, so allocate
* it if the caller won't.
*/
if (actual_mech_type == NULL)
actual_mech_type = &amt;
} else if (err == GSS_S_COMPLETE) {
/*
* Now check if there is a kernel module for this
* mechanism OID. If so, set the gss_mechanism structure
* in the wrapper context to point to the kernel mech.
*/
/*
* If the mech oid was allocated for us, free it.
*/
if (&amt == actual_mech_type) {
}
}
return (err);
}
static OM_uint32
const gss_buffer_t input_token,
int *ret_flags,
{
/* get the client handle to GSSD */
GSSLOG(1,
"kgss_accept_sec_context: can't connect to server on %s\n",
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_ctx_id_t);
0 : (uint_t)sizeof (gssd_cred_id_t);
(char *)&verifier_cred_handle;
if (input_chan_bindings != GSS_C_NO_CHANNEL_BINDINGS) {
} else {
}
/* set the return parameters in case of errors.... */
if (minor_status != NULL)
}
if (output_token != NULL)
output_token->length = 0;
*ret_flags = 0;
*time_rec = 0;
if (delegated_cred_handle != NULL)
/* call the remote procedure */
return (GSS_S_FAILURE);
}
if (minor_status != NULL)
}
/* if the call was successful, copy out the results */
/*
* the only parameters that are ready when we
* get GSS_S_CONTINUE_NEEDED are: minor, ctxt_handle,
* and the output token to send to the peer.
*/
*context_handle = *((gssd_ctx_id_t *)
/* these other parameters are only ready upon GSS_S_COMPLETE */
}
/*
* move mech type returned to mech_type
* for gss_import_name_for_mech()
*/
*mech_type =
}
if ((delegated_cred_handle != NULL) &&
!= 0)) {
kcred = KGSS_CRED_ALLOC();
*((gssd_cred_id_t *)
}
}
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
const gss_buffer_t input_token,
int *ret_flags,
{
/*
* See kgss_init_sec_context() to get an idea of what is going
* on here.
*/
if (*context_handle == GSS_C_NO_CONTEXT) {
kctx = KGSS_ALLOC();
} else
if (verifier_cred_handle != GSS_C_NO_CREDENTIAL) {
} else {
}
} else if (err == GSS_S_COMPLETE) {
/*
* If the mech oid was allocated for us, free it.
*/
}
}
return (err);
}
uid)
const gss_ctx_id_t context_handle;
{
/* get the client handle to GSSD */
GSSLOG(1,
"kgss_process_context_token: can't connect to server on %s\n",
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
/* return with status returned in rpc call */
}
/*ARGSUSED*/
static OM_uint32
{
/* get the client handle to GSSD */
GSSLOG(1,
"kgss_delete_sec_context: can't connect to server on %s\n",
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_ctx_id_t);
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
if (context_handle != NULL)
*context_handle = NULL;
if (output_token != NULL)
output_token->length = 0;
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
*context_handle = NULL;
else
if (output_token != NULL) {
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
{
if (*context_handle == GSS_C_NO_CONTEXT) {
return (GSS_S_COMPLETE);
} else
return (GSS_S_COMPLETE);
}
} else {
return (GSS_S_COMPLETE);
}
}
return (err);
}
{
/* get the client handle to GSSD */
" can't connect to server on %s\n", server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments,
* set minor_status to its maximum value, and return
* GSS_S_FAILURE
*/
if (minor_status != NULL)
if (context_handle != NULL)
*context_handle = NULL;
if (output_token != NULL)
output_token->length = 0;
GSSLOG0(1,
"kgss_export_sec_context_wrapped: RPC call times out\n");
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
*context_handle = NULL;
else
if (output_token != NULL) {
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
{
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_FAILURE);
else
/*
* If there is a kernel module then import_sec context must be
* supported and we make an upcall to export_sec_context.
* If there is no kernel module then we return an error
*/
*minor_status = 0;
} else {
/*
* This is not the right error value; instead of
* inventing new error we return GSS_S_NAME_NOT_MN
* This error is not returned by the export routine
*/
"unavailable \n");
return (GSS_S_NAME_NOT_MN);
}
}
const gss_buffer_t interprocess_token;
{
char *p;
return (GSS_S_FAILURE);
}
/*
* This should never happen
* If Kernel import sec context does not exist the export
* sec context should have caught this and returned an error
* and the caller should not have called this routine
*/
return (GSS_S_FAILURE);
}
*minor_status = 0;
return (GSS_S_DEFECTIVE_TOKEN);
p = interprocess_token->value;
length = *p++;
p += length;
/*
* select the approprate underlying mechanism routine and
* call it.
*/
if (status == GSS_S_COMPLETE) {
return (GSS_S_COMPLETE);
} else
return (status);
}
/*ARGSUSED*/
uid)
const gss_ctx_id_t context_handle;
{
return (GSS_S_FAILURE);
}
/*ARGSUSED*/
static OM_uint32
kgss_sign_wrapped(void *private,
const gss_ctx_id_t ctx_handle,
int qop_req,
const gss_buffer_t message_buffer,
{
/* get the client handle to GSSD */
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
const gss_ctx_id_t context_handle,
int qop_req,
const gss_buffer_t message_buffer,
{
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_FAILURE);
}
/*ARGSUSED*/
static OM_uint32
kgss_verify_wrapped(void *private,
const gss_ctx_id_t ctx_handle,
const gss_buffer_t message_buffer,
const gss_buffer_t token_buffer,
int *qop_state,
{
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
*qop_state = 0;
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
/* return with status returned in rpc call */
}
const gss_ctx_id_t context_handle,
const gss_buffer_t message_buffer,
const gss_buffer_t token_buffer,
int *qop_state)
{
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_FAILURE);
}
/* EXPORT DELETE START */
/*ARGSUSED*/
static OM_uint32
kgss_seal_wrapped(void *private,
const gss_ctx_id_t ctx_handle,
int conf_req_flag,
int qop_req,
const gss_buffer_t input_message_buffer,
int *conf_state,
{
/* get the client handle to GSSD */
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
(char *)input_message_buffer->value;
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
if (conf_state != NULL)
*conf_state = 0;
if (output_message_buffer != NULL)
output_message_buffer->length = 0;
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
if (conf_state != NULL)
if (output_message_buffer != NULL) {
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
/*ARGSUSED*/
const gss_ctx_id_t context_handle,
int conf_req_flag,
int qop_req,
const gss_buffer_t input_message_buffer,
int *conf_state,
{
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_FAILURE);
}
/*ARGSUSED*/
static OM_uint32
kgss_unseal_wrapped(void *private,
const gss_ctx_id_t ctx_handle,
const gss_buffer_t input_message_buffer,
int *conf_state,
int *qop_state,
{
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
(char *)input_message_buffer->value;
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
if (output_message_buffer != NULL)
output_message_buffer->length = 0;
if (conf_state != NULL)
*conf_state = 0;
*qop_state = 0;
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
if (output_message_buffer != NULL) {
}
if (conf_state != NULL)
/*
* free the memory allocated for the results and return with the
* status received in the rpc call
*/
}
const gss_ctx_id_t context_handle,
const gss_buffer_t input_message_buffer,
int *conf_state,
int *qop_state)
{
if (context_handle == GSS_C_NO_CONTEXT)
return (GSS_S_FAILURE);
}
/* EXPORT DELETE END */
uid)
int status_type;
int *message_context;
{
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
/* call the remote procedure */
if (message_context != NULL)
*message_context = 0;
if (status_string != NULL) {
status_string->length = 0;
}
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
return (GSS_S_FAILURE);
}
/* now process the results and pass them back to the caller */
if (minor_status != NULL)
if (message_context != NULL)
if (status_string != NULL) {
}
}
}
/*ARGSUSED*/
uid)
{
void *arg;
int i;
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
}
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
name,
uid)
const gssd_cred_id_t cred_handle;
int *cred_usage;
{
int i;
/*
* NULL the params here once
* If there are errors then we won't
* have to do it for every error
* case
*/
if (minor_status != NULL)
*lifetime = 0;
if (cred_usage != NULL)
*cred_usage = 0;
if (mechanisms != NULL)
*mechanisms = NULL;
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_cred_id_t);
/* call the remote procedure */
/*
* if the RPC call times out
* kill the handle and return GSS_S_FAILURE
* the parameters have been set to NULL already
*/
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
/* convert name from external to internal format */
/*
* we can pass a pointer to res structure
* since gss_import_name treats the name_type
* parameter as read only and performs a copy
*/
return ((OM_uint32) GSS_S_FAILURE);
}
}
if (cred_usage != NULL)
mechanisms != NULL) {
(*mechanisms)->count =
for (i = 0; i < (*mechanisms)->count; i++) {
}
} else {
mechanisms != NULL)
(*mechanisms) = NULL;
}
/*
* free the memory allocated for the results and return with the status
* received in the rpc call
*/
}
name,
uid)
const gss_cred_id_t cred_handle;
int *cred_usage;
{
return (kgss_inquire_cred_wrapped(minor_status,
}
uid)
{
/* get the client handle to GSSD */
server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments into the rpc arg parameter */
0 : (uint_t)sizeof (gssd_cred_id_t);
(char *)(mech_type != GSS_C_NULL_OID ?
/* call the remote procedure */
/*
* if the RPC call times out, null out all return arguments, set
* minor_status to its maximum value, and return GSS_S_FAILURE
*/
if (minor_status != NULL)
return (GSS_S_FAILURE);
}
/* copy the rpc results into the return arguments */
if (minor_status != NULL)
}
uid)
{
}
const gss_buffer_t expName;
int *gidsLen;
{
return (GSS_S_CALL_INACCESSIBLE_READ);
return (GSS_S_CALL_INACCESSIBLE_WRITE);
/* NULL out output parameters */
*uidOut = UID_NOBODY;
if (gidsLen)
*gidsLen = 0;
if (gids)
/* get the client handle to gssd */
{
" can't connect to server on %s\n", server);
return (GSS_S_FAILURE);
}
/* copy the procedure arguments */
/* null out the return buffer and call the remote proc */
{
GSSLOG0(1,
"kgsscred_expname_to_unix_cred: RPC call times out\n");
return (GSS_S_FAILURE);
}
/* copy the results into the result parameters */
{
if (gidOut)
{
}
}
/* free RPC results */
} /* kgsscred_expname_to_unix_cred */
const gss_name_t intName;
int *gidsLen;
{
return (GSS_S_CALL_INACCESSIBLE_READ);
return (GSS_S_CALL_INACCESSIBLE_WRITE);
/* NULL out the output parameters */
*uidOut = UID_NOBODY;
if (gids)
if (gidsLen)
*gidsLen = 0;
/* get the client handle to gssd */
{
GSSLOG(1,
"kgsscred_name_to_unix_cred: can't connect to server %s\n",
server);
return (GSS_S_FAILURE);
}
/* convert the name to flat representation */
!= GSS_S_COMPLETE)
{
return (major);
}
/* set the rpc parameters */
/* call the remote procedure */
return (GSS_S_FAILURE);
}
/* delete the flat name buffer */
/* copy the output parameters on output */
if (gidOut)
}
}
/* delete RPC allocated memory */
} /* kgsscred_name_to_unix_cred */
int *gidsLen;
{
/* check the output parameters */
return (GSS_S_CALL_INACCESSIBLE_WRITE);
/* get the client GSSD handle */
GSSLOG(1,
"kgss_get_group_info: can't connect to server on %s\n",
server);
return (GSS_S_FAILURE);
}
/* set the input parameters */
/* call the remote procedure */
return (GSS_S_FAILURE);
}
/* copy the results */
}
/* no results to free */
} /* kgss_get_group_info */
static char *
{
/* get the client GSSD handle */
server);
return (NULL);
}
/* set the input parameters */
/* call the remote procedure */
return (NULL);
}
/* no results to free */
} else
return (NULL);
} /* kgss_get_kmod */
static gss_mechanism kgss_mech_head;
static gss_mechanism kgss_mech_tail;
/*
* See if there is kernel mechanism module, and if so, attempt to
* entry points to that of the kernel module.
*/
static void
{
char *kmod;
/*
* We can search the list without a mutex, becuase the list never
* shrinks and we always add to the end.
*/
if (mech) {
return;
}
/*
* Get the module name from the kernel.
*/
if (kmod) {
extern int modload(const char *, const char *);
/*
* Modload of 'kmod' failed, so log an
* appropriate comment
*/
"(%s) failed. Userland gssd will now handle "
"all GSSAPI calls, which may result in "
"reduced performance.\n", kmod);
};
/*
* Allocated in the XDR routine called by gss_get_kmod_1().
*/
if (mech) {
}
/*
* If for some reason the module load didn't take,
* we return anyway and hope that the next context
* creation succeeds.
*/
return;
}
/*
* No kernel module, so enter this mech oid into the list
* gssd.
*/
if (mech) {
return;
}
/*
* Allocate space for the mechanism entry.
*/
/*
* Copy basic information from default mechanism struct.
*/
*mech = default_gc;
/*
* Record the real mech OID.
*/
/*
* Add it to the table.
*/
}
/*
* Called with __kgss_mech_lock held.
*/
void
{
if (kgss_mech_head == NULL)
}
/*
* given the mechs_array and a mechanism OID, return the
* pointer to the mechanism, or NULL if that mechanism is
* not supported.
*/
{
/*
* Note that a reader can scan this list without the mutex held.
* This is safe because we always append, and never shrink the list.
* Moreover, the entry is fully initialized before it is ever
* added to the list.
*/
return (mech);
}
return (NULL);
}