key_generic.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 (c) 1988-1996 Sun Microsystems Inc
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <syslog.h>
#include <netconfig.h>
#include <netdir.h>
#include <tiuser.h>
#include <fcntl.h>
#include <string.h>
#include "automount.h"
#define MAXCACHETIME 900
/*
* The highest level interface for server creation.
* Copied from svc_generic.c and ../keyserv/key_generic.c, but adapted
* to work only for TPI_COTS_ORD semantics, and to be called only once
* from autod_main.c. Returns 1 (interface created) on success and 0
* (interfaces created) on failure.
*/
int
void (*dispatch) (); /* Dispatch function */
char *nettype; /* Networktype token */
char *servname; /* name of the service */
{
int num = 0;
void *net;
int fd;
struct nd_hostserv ns;
struct nd_addrlist *nas;
"svc_create: could not read netconfig database");
return (0);
}
continue;
"svc_create: %s: cannot open connection: %s",
return (0);
}
/*
* Negotiate for returning the uid of the caller.
* This should be done before enabling the endpoint for
* service via t_bind() (called in svc_tli_create())
* so that requests to automountd contain the uid.
*/
if (__rpc_negotiate_uid(fd) != 0) {
"Couldn't negotiate for uid with loopback transport %s",
return (0);
}
/* LINTED pointer alignment */
return (0);
}
/* Copy the address */
} else {
"svc_create: no well known address for %s on %s\n",
}
if (bind_addr)
"svc_create: svc_tli_create failed\n");
return (0);
} else {
== FALSE) {
"svc_create: cannot register %d vers %d on %s",
return (0);
}
"svc_create: init dupcache failed");
return (0);
}
num = 1;
}
break;
}
return (num);
}