aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-06 09:18:45 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-06 09:18:45 +0000
commita788b6c2163aa8b7c526a61542d01b7cbbc8859e (patch)
tree81e5b9daab0ac234b55a30b6de71bb09f3478f8c
parent36a8586ddfca3b825704eedda81c81ac8d653f1e (diff)
downloadglibc-a788b6c2163aa8b7c526a61542d01b7cbbc8859e.zip
glibc-a788b6c2163aa8b7c526a61542d01b7cbbc8859e.tar.gz
glibc-a788b6c2163aa8b7c526a61542d01b7cbbc8859e.tar.bz2
Update.
* nis/nis_call.c (do_ypcall, yp_all): Safe and reset errno.
-rw-r--r--ChangeLog2
-rw-r--r--FAQ.in19
-rw-r--r--nis/nis_call.c7
-rw-r--r--nis/ypclnt.c26
4 files changed, 38 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 711db65..4c2430d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
1998-03-06 Andreas Jaeger <aj@arthur.rhein-neckar.de>
- * nis/nis_call.c (__do_niscall): Safe and reset errno.
+ * nis/nis_call.c (do_ypcall, yp_all): Safe and reset errno.
* nis/ypclnt.c (__yp_bind): Safe and reset errno.
diff --git a/FAQ.in b/FAQ.in
index 32c35eb..97e5525 100644
--- a/FAQ.in
+++ b/FAQ.in
@@ -550,7 +550,16 @@ http://www-vt.uni-paderborn.de/~kukuk/linux/nisplus.html).
from ypbind. ypbind 3.3 and older versions don't always remove these
files, so glibc will continue to use them. Other BSD versions seem to
work correctly. Until ypbind 3.4 is released, you can find a patch at
-ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc2.diff.
+ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc3.diff.
+
+?? Under Linux/Alpha, I always get "do_ypcall: clnt_call:
+ RPC: Unable to receive; errno = Connection refused" when using NIS.
+
+{TK} You need a ypbind version which is 64bit clean. Some versions
+are not 64bit clean. A 64bit clean implemention is ypbind-mt. For
+ypbind 3.3, you need the patch from ftp.kernel.org (See the previous
+question). I don't know about other versions.
+
?? After installing glibc name resolving doesn't work properly.
@@ -611,11 +620,11 @@ problem.
?? What do I need for C++ development?
-{HJ,AJ} You need either egcs 1.0.1 or gcc-2.8.0 with libstdc++
-2.8.0. libg++ 2.7.2 (and the Linux Versions 2.7.2.x) doesn't work very
-well with the GNU C library due to vtable thunks.
+{HJ,AJ} You need either egcs 1.0.1 or gcc-2.8.1 with libstdc++
+2.8.1 (or more recent versions). libg++ 2.7.2 (and the Linux Versions
+2.7.2.x) doesn't work very well with the GNU C library due to vtable thunks.
If you're upgrading from glibc 2.0.x to 2.1 you have to recompile
-libstc++ the library compiled for 2.0 is not compatible due to the new
+libstc++ since the library compiled for 2.0 is not compatible due to the new
Large File Support (LFS) in version 2.1.
? Source and binary incompatibilities, and what to do about them
diff --git a/nis/nis_call.c b/nis/nis_call.c
index 8e0aca2..affae09 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -581,7 +581,10 @@ __do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
dir = rec_dirsearch (name, dir, flags, &status);
if (dir == NULL)
- return status;
+ {
+ __set_errno (saved_errno);
+ return status;
+ }
}
if (flags & MASTER_ONLY)
@@ -601,5 +604,7 @@ __do_niscall (const_nis_name name, u_long prog, xdrproc_t xargs,
nis_free_directory (dir);
+ __set_errno (saved_errno);
+
return retcode;
}
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 924a629..ceaaa71 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -104,7 +104,6 @@ __yp_bind (const char *domain, dom_binding **ypdb)
struct iovec vec[2];
u_short port;
int fd;
- int saved_errno = errno;
sprintf (path, "%s/%s.%ld", BINDINGDIR, domain, YPBINDVERS);
fd = open (path, O_RDONLY);
@@ -133,14 +132,11 @@ __yp_bind (const char *domain, dom_binding **ypdb)
}
close (fd);
}
- __set_errno (saved_errno);
}
#endif /* USE_BINDINGDIR */
if (ysd->dom_vers == -1)
{
- int saved_errno = errno;
-
if(ysd->dom_client)
{
clnt_destroy(ysd->dom_client);
@@ -157,7 +153,6 @@ __yp_bind (const char *domain, dom_binding **ypdb)
{
if (is_new)
free (ysd);
- __set_errno (saved_errno);
return YPERR_YPBIND;
}
/*
@@ -170,7 +165,6 @@ __yp_bind (const char *domain, dom_binding **ypdb)
clnt_destroy (client);
if (is_new)
free (ysd);
- __set_errno (saved_errno);
return YPERR_YPBIND;
}
@@ -253,6 +247,7 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
bool_t use_ypbindlist = FALSE;
int try, status;
enum clnt_stat result;
+ int saved_errno = errno;
try = 0;
status = YPERR_YPERR;
@@ -281,6 +276,7 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
{
if (use_ypbindlist)
__libc_lock_unlock (ypbindlist_lock);
+ __set_errno (saved_errno);
return YPERR_DOMAIN;
}
@@ -317,6 +313,8 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
ydb = NULL;
}
+ __set_errno (saved_errno);
+
return status;
}
@@ -670,6 +668,7 @@ yp_all (const char *indomain, const char *inmap,
CLIENT *clnt;
unsigned long status;
int clnt_sock;
+ int saved_errno = errno;
if (indomain == NULL || indomain[0] == '\0' ||
inmap == NULL || inmap == '\0')
@@ -682,6 +681,7 @@ yp_all (const char *indomain, const char *inmap,
{
if (__yp_bind (indomain, &ydb) != 0)
{
+ __set_errno (saved_errno);
return YPERR_DOMAIN;
}
@@ -691,7 +691,10 @@ yp_all (const char *indomain, const char *inmap,
clnt_sin.sin_port = 0;
clnt = clnttcp_create (&clnt_sin, YPPROG, YPVERS, &clnt_sock, 0, 0);
if (clnt == NULL)
- return YPERR_PMAP;
+ {
+ __set_errno (saved_errno);
+ return YPERR_PMAP;
+ }
req.domain = (char *) indomain;
req.map = (char *) inmap;
@@ -714,10 +717,15 @@ yp_all (const char *indomain, const char *inmap,
close (clnt_sock);
if (status != YP_NOMORE)
- return ypprot_err (status);
- try++;
+ {
+ __set_errno (saved_errno);
+ return ypprot_err (status);
+ }
+ ++try;
}
+ __set_errno (saved_errno);
+
return res;
}