diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-01-24 13:45:44 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-01-24 13:45:44 +0000 |
commit | ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6 (patch) | |
tree | a36c5eed9258c2324f4f1b68f77217f83f2b4cf9 /nis/nss_nisplus | |
parent | ecb9d3e182343fb4a89e4446e41037c6971b1657 (diff) | |
download | glibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.zip glibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.tar.gz glibc-ac9f45cfd18eeffd6a9fbbcc86e68657c95658a6.tar.bz2 |
Update NIS+.
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.
Diffstat (limited to 'nis/nss_nisplus')
-rw-r--r-- | nis/nss_nisplus/nisplus-alias.c | 28 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-ethers.c | 41 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-grp.c | 42 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-hosts.c | 2 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-proto.c | 33 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-publickey.c | 4 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-pwd.c | 41 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-rpc.c | 33 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-service.c | 36 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-spwd.c | 24 |
10 files changed, 159 insertions, 125 deletions
diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c index 381ad18..732c02d 100644 --- a/nis/nss_nisplus/nisplus-alias.c +++ b/nis/nss_nisplus/nisplus-alias.c @@ -127,7 +127,7 @@ _nss_nisplus_parse_aliasent (nis_result *result, unsigned long entry, { /* Skip leading blanks. */ while (isspace (*line)) - line++; + ++line; if (*line == '\0') break; @@ -138,12 +138,11 @@ _nss_nisplus_parse_aliasent (nis_result *result, unsigned long entry, 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++; } } @@ -265,7 +264,12 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias, 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]; @@ -279,11 +283,13 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias, 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; } diff --git a/nis/nss_nisplus/nisplus-ethers.c b/nis/nss_nisplus/nisplus-ethers.c index 76805f1..50f032a 100644 --- a/nis/nss_nisplus/nisplus-ethers.c +++ b/nis/nss_nisplus/nisplus-ethers.c @@ -233,6 +233,11 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth, if (name != NULL) { + *errnop = EINVAL; + return NSS_STATUS_UNAVAIL; + } + else + { nis_result *result; char buf[strlen (name) + 40 + tablename_len]; @@ -249,17 +254,19 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth, 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 @@ -303,15 +310,17 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr, 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; } diff --git a/nis/nss_nisplus/nisplus-grp.c b/nis/nss_nisplus/nisplus-grp.c index 4ac048e..d014c8b 100644 --- a/nis/nss_nisplus/nisplus-grp.c +++ b/nis/nss_nisplus/nisplus-grp.c @@ -171,8 +171,11 @@ _nss_nisplus_getgrnam_r (const char *name, struct group *gr, 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; @@ -193,16 +196,17 @@ _nss_nisplus_getgrnam_r (const char *name, struct group *gr, 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; } } @@ -239,16 +243,16 @@ _nss_nisplus_getgrgid_r (const gid_t gid, struct group *gr, 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; } } diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c index 8514a63..3b022b6 100644 --- a/nis/nss_nisplus/nisplus-hosts.c +++ b/nis/nss_nisplus/nisplus-hosts.c @@ -285,7 +285,7 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, 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; diff --git a/nis/nss_nisplus/nisplus-proto.c b/nis/nss_nisplus/nisplus-proto.c index 262276f..aa2271c 100644 --- a/nis/nss_nisplus/nisplus-proto.c +++ b/nis/nss_nisplus/nisplus-proto.c @@ -323,15 +323,17 @@ _nss_nisplus_getprotobyname_r (const char *name, struct protoent *proto, 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; } } @@ -369,15 +371,16 @@ _nss_nisplus_getprotobynumber_r (const int number, struct protoent *proto, 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; } } diff --git a/nis/nss_nisplus/nisplus-publickey.c b/nis/nss_nisplus/nisplus-publickey.c index 24d217b..47062b4 100644 --- a/nis/nss_nisplus/nisplus-publickey.c +++ b/nis/nss_nisplus/nisplus-publickey.c @@ -290,8 +290,8 @@ _nss_nisplus_netname2user (char netname[MAXNETNAMELEN + 1], uid_t *uidp, 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) diff --git a/nis/nss_nisplus/nisplus-pwd.c b/nis/nss_nisplus/nisplus-pwd.c index 18114ad..45c364a 100644 --- a/nis/nss_nisplus/nisplus-pwd.c +++ b/nis/nss_nisplus/nisplus-pwd.c @@ -179,8 +179,11 @@ _nss_nisplus_getpwnam_r (const char *name, struct passwd *pw, 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; @@ -203,16 +206,17 @@ _nss_nisplus_getpwnam_r (const char *name, struct passwd *pw, 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; } } @@ -249,15 +253,16 @@ _nss_nisplus_getpwuid_r (const uid_t uid, struct passwd *pw, 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; } } diff --git a/nis/nss_nisplus/nisplus-rpc.c b/nis/nss_nisplus/nisplus-rpc.c index 452fb4c..105e802 100644 --- a/nis/nss_nisplus/nisplus-rpc.c +++ b/nis/nss_nisplus/nisplus-rpc.c @@ -320,16 +320,16 @@ _nss_nisplus_getrpcbyname_r (const char *name, struct rpcent *rpc, 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; } } @@ -367,15 +367,16 @@ _nss_nisplus_getrpcbynumber_r (const int number, struct rpcent *rpc, 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; } } diff --git a/nis/nss_nisplus/nisplus-service.c b/nis/nss_nisplus/nisplus-service.c index 1cb1aec..8f681d3 100644 --- a/nis/nss_nisplus/nisplus-service.c +++ b/nis/nss_nisplus/nisplus-service.c @@ -115,7 +115,7 @@ _nss_nisplus_parse_servent (nis_result *result, struct servent *serv, { /* Skip leading blanks. */ while (isspace (*line)) - line++; + ++line; if (*line == '\0') break; @@ -332,16 +332,17 @@ _nss_nisplus_getservbyname_r (const char *name, const char *protocol, 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; } } @@ -386,15 +387,16 @@ _nss_nisplus_getservbynumber_r (const int number, const char *protocol, 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; } } diff --git a/nis/nss_nisplus/nisplus-spwd.c b/nis/nss_nisplus/nisplus-spwd.c index 54bbc32..094f56d 100644 --- a/nis/nss_nisplus/nisplus-spwd.c +++ b/nis/nss_nisplus/nisplus-spwd.c @@ -177,8 +177,11 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp, 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; @@ -200,15 +203,16 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp, 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; } } |