/*
* Copyright (c) 1988-1999 by 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 <locale.h>
extern int __rpc_negotiate_uid(int);
/*
* The highest level interface for server creation.
* Copied from svc_generic.c and cmd/keyserv/key_generic.c, but adapted
* to work only for TPI_CLTS semantics, and to be called only once
* from kwarnd.c. Returns 1 (interface created) on success and 0
* (no interfaces created) on failure.
*/
int
char *nettype, /* Networktype token */
char *servname) /* name of the srvc */
{
int num = 0;
void *net;
int fd;
gettext("svc_create: could not read netconfig database"));
return (0);
}
continue;
gettext("svc_create: %s: cannot open connection: %s"),
break;
}
/*
* 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 kwarnd contain the uid.
*/
if (__rpc_negotiate_uid(fd) != 0) {
gettext("Could not negotiate for"
" uid with loopback transport %s"),
break;
}
/* LINTED pointer alignment */
gettext("svc_create: t_alloc failed\n"));
break;
}
/* Copy the address */
} else {
gettext("svc_create: no well known "
"address for %s on %s\n"),
}
if (bind_addr)
gettext("svc_create: svc_tli_create failed\n"));
break;
} else {
== FALSE) {
gettext("svc_create: cannot"
" register %d vers %d on %s"),
break;
}
num = 1;
break;
}
}
return (num);
}