+1998-01-24 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * nis/Makefile: Distribute nis_cache2.h, add nis cache functions
+ to routines.
+ * nis/nis_cache.c: New.
+ * nis/nis_cache2.h: New.
+ * nis/nis_cache2_xdr.c: New.
+ * nis/nis_call.c: Changes for cache2_info parameter.
+ * nis/nis_checkpoint.c: Likewise.
+ * nis/nis_intern.h: Likewise.
+ * nis/nis_mkdir.c: Likewise.
+ * nis/nis_ping.c: Likewise.
+ * nis/nis_rmdir.c: Likewise.
+ * nis/nis_server.c: Likewise.
+ * nis/nis_util.c: Likewise.
+
+1997-12-30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * nis/nss_nisplus/nisplus-alias.c: Fix bogus if case and
+ return/errnop codes.
+ * nis/nss_nisplus/nisplus-ethers.c: Likewise.
+ * nis/nss_nisplus/nisplus-grp.c: Likewise.
+ * nis/nss_nisplus/nisplus-hosts.c: Likewise.
+ * nis/nss_nisplus/nisplus-proto.c: Likewise.
+ * nis/nss_nisplus/nisplus-publickey.c: Likewise.
+ * nis/nss_nisplus/nisplus-pwd.c: Likewise.
+ * nis/nss_nisplus/nisplus-rpc.c: Likewise
+ * nis/nss_nisplus/nisplus-service.c: Likewise.
+ * nis/nss_nisplus/nisplus-spwd.c: Likewise.
+
+1997-12-28 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * nis/nss_nis/nis-alias.c: Use errnop, not __set_errno().
+ * nis/nss_nis/nis-ethers.c: Likewise.
+ * nis/nss_nis/nis-grp.c: Likewise.
+ * nis/nss_nis/nis-hosts.c: Likewise.
+ * nis/nss_nis/nis-network.c: Likewise.
+ * nis/nss_nis/nis-proto.c: Likewise.
+ * nis/nss_nis/nis-hosts.c: Likewise.
+ * nis/nss_nis/nis-network.c: Likewise.
+ * nis/nss_nis/nis-proto.c: Likewise.
+ * nis/nss_nis/nis-publickey.c: Likewise.
+ * nis/nss_nis/nis-pwd.c: Likewise.
+ * nis/nss_nis/nis-rpc.c: Likewise.
+ * nis/nss_nis/nis-service.c: Likewise.
+ * nis/nss_nis/nis-spwd.c: Likewise.
+
1998-01-24 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/net/if.h (ifr_bandwidth, ifr_qlen):
-NIS(YP)/NIS+ NSS modules 0.15 by Thorsten Kukuk
+NIS(YP)/NIS+ NSS modules 0.16 by Thorsten Kukuk
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
headers := $(wildcard rpcsvc/*.[hx])
distribute := nss-nis.h nss-nisplus.h nis_intern.h Banner \
- nisplus-parser.h
+ nisplus-parser.h nis_cache2.h
# These are the databases available for the nis (and perhaps later nisplus)
# service. This must be a superset of the services in nss.
libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
nis_subr nis_local_names nis_free nis_file \
- nis_print nis_error nis_call nis_lookup\
- nis_table nis_xdr nis_server nis_ping\
+ nis_print nis_error nis_call nis_lookup nis_cache\
+ nis_table nis_xdr nis_server nis_ping nis_cache2_xdr\
nis_checkpoint nis_mkdir nis_rmdir nis_getservlist\
nis_verifygroup nis_ismember nis_addmember nis_util\
nis_removemember nis_creategroup nis_destroygroup\
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
}
static dir_binding *
-__bind_create (const nis_server *serv_val, u_int serv_len, u_long flags)
+__bind_create (const nis_server *serv_val, u_int serv_len, u_long flags,
+ cache2_info *cinfo)
{
dir_binding *dbp;
u_int i;
dbp->server_val[i].pkey.n_bytes = NULL;
}
- if (__nis_findfastest (dbp) < 1)
+ dbp->class = -1;
+ if (cinfo != NULL && cinfo->server_used >= 0)
+ {
+ dbp->server_used = cinfo->server_used;
+ dbp->current_ep = cinfo->current_ep;
+ dbp->class = cinfo->class;
+ }
+ else if (__nis_findfastest (dbp) < 1)
{
__bind_destroy (dbp);
return NULL;
nis_error
__do_niscall2 (const nis_server *server, u_int server_len, u_long prog,
xdrproc_t xargs, caddr_t req, xdrproc_t xres, caddr_t resp,
- u_long flags, nis_cb *cb)
+ u_long flags, nis_cb *cb, cache2_info *cinfo)
{
enum clnt_stat result;
nis_error retcode;
if (flags & MASTER_ONLY)
server_len = 1;
- if ((dbp = __bind_create (server, server_len, flags)) == NULL)
+ dbp = __bind_create (server, server_len, flags, cinfo);
+ if (dbp == NULL)
return NIS_NAMEUNREACHABLE;
while (__bind_connect (dbp) != NIS_SUCCESS)
{
directory_obj *dir = NULL;
nis_server *server;
u_int server_len;
+ cache2_info cinfo = {-1, -1, -1};
if (name == NULL)
return NIS_BADNAME;
+ /* Search in local cache. In the moment, we ignore the fastest server */
+ if (!(flags & NO_CACHE))
+ dir = __nis_cache_search (name, flags, &cinfo);
+
if (dir == NULL)
{
nis_error status;
retcode = __do_niscall2 (server, server_len, prog, xargs, req, xres, resp,
- flags, cb);
+ flags, cb, &cinfo);
nis_free_directory (dir);
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
if (__do_niscall2 (&NIS_RES_OBJECT(res2)->DI_data.do_servers.do_servers_val[i],
1, NIS_CHECKPOINT, (xdrproc_t) xdr_nis_name,
(caddr_t) &dirname, (xdrproc_t) xdr_cp_result,
- (caddr_t) &cpres, 0, NULL) != RPC_SUCCESS)
+ (caddr_t) &cpres, 0, NULL, NULL) != RPC_SUCCESS)
NIS_RES_STATUS (res) = NIS_RPCERROR;
else
{
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
u_int server_used; /* Which server we are bind in the moment ? */
u_int current_ep; /* Which endpoint of the server are in use? */
u_int trys; /* How many server have we tried ? */
+ u_int class; /* From which class is server_val ? */
bool_t master_only; /* Is only binded to the master */
bool_t use_auth; /* Do we use AUTH ? */
bool_t use_udp; /* Do we use UDP ? */
};
typedef struct dir_binding dir_binding;
+struct cache2_info
+{
+ long server_used;
+ long current_ep;
+ long class;
+};
+typedef struct cache2_info cache2_info;
+
struct nis_cb
{
nis_server *serv;
extern nis_error __do_niscall2 __P ((const nis_server *serv, u_int serv_len,
u_long prog, xdrproc_t xargs, caddr_t req,
xdrproc_t xres, caddr_t resp,
- u_long flags, nis_cb *cb));
+ u_long flags, nis_cb *cb,
+ cache2_info *cinfo));
extern nis_error __do_niscall __P ((const_nis_name name, u_long prog,
xdrproc_t xargs, caddr_t req,
xdrproc_t xres, caddr_t resp,
const void *userdata, u_long flags));
extern nis_error __nis_destroy_callback __P ((struct nis_cb *cb));
+#ifdef _LIBC
+/* NIS+ Cache functions */
+extern directory_obj *__nis_cache_search __P ((const_nis_name name,
+ u_long flags,
+ cache2_info *cinfo));
+#endif
+
__END_DECLS
#endif
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
res2 = __do_niscall2 (server, 1, NIS_MKDIR,
(xdrproc_t) xdr_nis_name,
(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
- (caddr_t) &res, 0, NULL);
+ (caddr_t) &res, 0, NULL, NULL);
if (res2 != NIS_SUCCESS)
return res2;
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
__do_niscall2 (&obj->DI_data.do_servers.do_servers_val[i], 1,
NIS_PING, (xdrproc_t) xdr_ping_args,
(caddr_t) &args, (xdrproc_t) xdr_void,
- (caddr_t) NULL, 0, NULL);
+ (caddr_t) NULL, 0, NULL, NULL);
if (res)
nis_freeresult (res);
}
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
res2 = __do_niscall2 (server, 1, NIS_RMDIR,
(xdrproc_t) xdr_nis_name,
(caddr_t) &dir, (xdrproc_t) xdr_nis_error,
- (caddr_t) &res, 0, NULL);
+ (caddr_t) &res, 0, NULL, NULL);
if (res2 != NIS_SUCCESS)
return res2;
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
if (__do_niscall2 (serv, 1, NIS_SERVSTATE, (xdrproc_t) xdr_nis_taglist,
(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
- (caddr_t) &tagres, 0, NULL) != RPC_SUCCESS)
+ (caddr_t) &tagres, 0, NULL, NULL) != RPC_SUCCESS)
return NIS_RPCERROR;
*result = tagres.tags.tags_val;
if (__do_niscall2 (serv, 1, NIS_STATUS, (xdrproc_t) xdr_nis_taglist,
(caddr_t) &taglist, (xdrproc_t) xdr_nis_taglist,
- (caddr_t) &tagres, 0, NULL) != RPC_SUCCESS)
+ (caddr_t) &tagres, 0, NULL, NULL) != RPC_SUCCESS)
return NIS_RPCERROR;
*result = tagres.tags.tags_val;
-/* Copyright (c) 1997 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
fd_args.requester = nis_local_host();
fd_res = calloc (1, sizeof (fd_result));
- if ((status = __do_niscall2 (dir->do_servers.do_servers_val,
- dir->do_servers.do_servers_len,
- NIS_FINDDIRECTORY, (xdrproc_t) xdr_fd_args,
- (caddr_t) &fd_args, (xdrproc_t) xdr_fd_result,
- (caddr_t) fd_res,
- NO_AUTHINFO|USE_DGRAM, NULL)) != NIS_SUCCESS)
+ status = __do_niscall2 (dir->do_servers.do_servers_val,
+ dir->do_servers.do_servers_len,
+ NIS_FINDDIRECTORY, (xdrproc_t) xdr_fd_args,
+ (caddr_t) &fd_args, (xdrproc_t) xdr_fd_result,
+ (caddr_t) fd_res, NO_AUTHINFO|USE_DGRAM, NULL, NULL);
+ if (status != NIS_SUCCESS)
fd_res->status = status;
return fd_res;
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
alias->alias_local = 0;
parse_res = _nss_nis_parse_aliasent (name, p, alias, buffer, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
free (result);
parse_res = _nss_files_parse_etherent (p, eth, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (!parse_res)
- return NSS_STATUS_NOTFOUND;
- else
- return NSS_STATUS_SUCCESS;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
enum nss_status
if (addr == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
free (result);
parse_res = _nss_files_parse_etherent (p, eth, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (!parse_res)
- return NSS_STATUS_NOTFOUND;
- else
- return NSS_STATUS_SUCCESS;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
free (result);
parse_res = _nss_files_parse_grent (p, grp, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
enum nss_status
free (result);
parse_res = _nss_files_parse_grent (p, grp, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if ((size_t) (len + 1) > buflen)
{
free (result);
- __set_errno (ERANGE);
+ *errnop = ERANGE;
*herrnop = NETDB_INTERNAL;
return NSS_STATUS_TRYAGAIN;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
*herrnop = NETDB_INTERNAL;
return NSS_STATUS_UNAVAIL;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
free (result);
parse_res = _nss_files_parse_protoent (p, proto, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
enum nss_status
free (result);
parse_res = _nss_files_parse_protoent (p, proto, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
if (netname == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if (netname == NULL || passwd == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
char *data, size_t datalen, int *errnop);
-
__libc_lock_define_initialized (static, lock)
struct response_t
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if (protocol == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
if (name == NULL)
{
- __set_errno (EINVAL);
+ *errnop = EINVAL;
return NSS_STATUS_UNAVAIL;
}
free (result);
parse_res = _nss_files_parse_spent (p, sp, data, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
- else
- return NSS_STATUS_NOTFOUND;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
{
/* Skip leading blanks. */
while (isspace (*line))
- line++;
+ ++line;
if (*line == '\0')
break;
alias->alias_members[alias->alias_members_len] = line;
while (*line != '\0' && *line != ',')
- line++;
+ ++line;
if (line != alias->alias_members[alias->alias_members_len])
{
- *line = '\0';
- line++;
+ *line++ = '\0';
alias->alias_members_len++;
}
}
return status;
}
- if (name != NULL || strlen (name) <= 8)
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+ else
{
nis_result *result;
char buf[strlen (name) + 30 + tablename_len];
parse_res = _nss_nisplus_parse_aliasent (result, 0, alias,
buffer, buflen, errnop);
- if (parse_res == -1)
- return NSS_STATUS_TRYAGAIN;
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
+ if (parse_res < 1)
+ {
+ if (parse_res == -1)
+ return NSS_STATUS_TRYAGAIN;
+ else
+ return NSS_STATUS_NOTFOUND;
+ }
+ return NSS_STATUS_SUCCESS;
}
- return NSS_STATUS_NOTFOUND;
}
if (name != NULL)
{
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+ else
+ {
nis_result *result;
char buf[strlen (name) + 40 + tablename_len];
parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
buflen, errnop);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- nis_freeresult (result);
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ nis_freeresult (result);
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
+ return NSS_STATUS_SUCCESS;
}
- return NSS_STATUS_NOTFOUND;
}
enum nss_status
parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
buflen, errnop);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- nis_freeresult (result);
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ nis_freeresult (result);
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
+ return NSS_STATUS_SUCCESS;
}
- return NSS_STATUS_NOTFOUND;
}
return status;
}
- if (name == NULL || strlen (name) > 8)
- return NSS_STATUS_NOTFOUND;
+ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_NOTFOUND;
+ }
else
{
nis_result *result;
parse_res = _nss_nisplus_parse_grent (result, 0, gr, buffer, buflen,
errnop);
nis_freeresult (result);
-
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
errnop);
nis_freeresult (result);
-
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
if (parse_res < 1 && *errnop != ERANGE)
parse_res = _nss_nisplus_parse_hostent (result, AF_INET, host,
buffer, buflen, errnop);
- if (parse_res < 1 && *errnop == ERANGE)
+ if (parse_res == -1)
{
nis_freeresult (result);
result = saved_res;
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
return NSS_STATUS_UNAVAIL;
/*
- * 3. Use principal name to look up uid/gid information in
- * LOCAL entry in **local** cred table.
+ * 3. Use principal name to look up uid/gid information in
+ * LOCAL entry in **local** cred table.
*/
domain = nis_local_directory ();
if ((strlen (principal) + strlen (domain) + 45) > (size_t) NIS_MAXNAMELEN)
return status;
}
- if (name == NULL || strlen (name) > 8)
- return NSS_STATUS_NOTFOUND;
+ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
else
{
nis_result *result;
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
{
/* Skip leading blanks. */
while (isspace (*line))
- line++;
+ ++line;
if (*line == '\0')
break;
errnop);
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
errnop);
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}
return status;
}
- if (name == NULL || strlen (name) > 8)
- return NSS_STATUS_NOTFOUND;
+ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_NOTFOUND;
+ }
else
{
nis_result *result;
errnop);
nis_freeresult (result);
- if (parse_res == -1)
+ if (parse_res < 1)
{
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
+ if (parse_res == -1)
+ {
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ return NSS_STATUS_NOTFOUND;
}
-
- if (parse_res)
- return NSS_STATUS_SUCCESS;
-
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_SUCCESS;
}
}