client_cache.cc revision e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mt.h"
#include <unistd.h>
#include <string.h>
#include <syslog.h>
#include "client_cache.h"
#include "nis_cache.h"
: NisMappedCache(err, 0, 0)
{
cache_is_bad = 0;
if (!checkUp())
err = NIS_RPCERROR;
}
{
}
int
{
return (cache_is_bad == 0);
}
{
if (err != NIS_SUCCESS) {
clnt = clientHandle();
err = NIS_RPCERROR;
cacheIsBad();
} else {
err = NIS_RPCERROR;
cacheIsBad();
} else {
}
}
/* cache manager should have loaded it */
if (err == NIS_SUCCESS)
}
return (err);
}
{
int i;
/* check to see if we already have a binding to the master server */
if (err != NIS_SUCCESS)
return (err);
return (NIS_SUCCESS);
}
}
clnt = clientHandle();
err = NIS_RPCERROR;
cacheIsBad();
} else {
err = NIS_RPCERROR;
cacheIsBad();
} else {
}
}
/* cache manager should have loaded it and found master server */
if (err == NIS_SUCCESS)
if (err == NIS_SUCCESS)
return (err);
}
{
int i;
binding = (nis_bound_directory *)
return (NIS_NOMEMORY);
return (NIS_NOMEMORY);
}
return (NIS_SUCCESS);
}
}
/* this is no good for us */
clnt = clientHandle();
err = NIS_RPCERROR;
cacheIsBad();
} else {
err = NIS_RPCERROR;
cacheIsBad();
} else {
}
}
if (err == NIS_SUCCESS) {
} else {
}
return (err);
}
int
{
clnt = clientHandle();
cacheIsBad();
return (0);
}
cacheIsBad();
return (0);
}
return (0);
}
return (1);
}
int
{
clnt = clientHandle();
cacheIsBad();
return (0);
}
cacheIsBad();
return (0);
}
return (0);
}
return (1);
}
int
{
clnt = clientHandle();
cacheIsBad();
return (0);
}
cacheIsBad();
return (0);
}
return (0);
}
/* don't xdr_free result because we are using pointers */
return (1);
}
{
void *res;
clnt = clientHandle();
cacheIsBad();
return (0);
}
cacheIsBad();
return (0);
}
return (1);
}
CLIENT *
{
if (!checkUp()) {
return (NULL);
}
if (checkClntState())
return (mgr_clnt);
/* client handle is no longer valid */
}
/*
* We cache this so that we only have to get it once.
* It never changes.
*/
return (NULL);
}
return (NULL);
return (NULL);
CACHEPROG, CACHE_VER_2, 0, 0);
return (NULL);
setClntState();
return (mgr_clnt);
}
void
{
} else {
}
}
int
{
char *uaddr;
/* check rdev of connection file descriptor */
/* do this first so that CLSET_FD_NCLOSE flag will be set if needed */
/* probably because file descriptor was closed */
"NIS+ cache client: can't stat %d", curFd);
/* it's not our fd, so don't try to close it */
(char *)NULL);
return (0);
}
"NIS+ cache client: fd %d changed, old=0x%lx, new=0x%lx",
/* it's not our fd, so don't try to close it */
(char *)NULL);
return (0);
}
}
/* check uaddr of cache manager */
return (0);
}
/* check pid */
return (0);
/* it appears to be okay */
return (1);
}
void
{
cache_is_bad = 1;
}