1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
* inet/rcmd.c (rcmd_af): errno is not set if read returns without
	reading anything.  Reported by Andries.Brouwer@cwi.nl.
This commit is contained in:
Ulrich Drepper
2000-05-07 22:40:26 +00:00
parent 74a0513daf
commit 6ac52e83bd
2 changed files with 11 additions and 3 deletions

View File

@@ -117,6 +117,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
char c;
int refused;
char num[8];
ssize_t n;
if (af != AF_INET && af != AF_INET6)
{
@@ -265,9 +266,13 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
(void)__write(s, locuser, strlen(locuser)+1);
(void)__write(s, remuser, strlen(remuser)+1);
(void)__write(s, cmd, strlen(cmd)+1);
if (__read(s, &c, 1) != 1) {
(void)fprintf(stderr,
"rcmd: %s: %m\n", *ahost);
n = __read(s, &c, 1);
if (n != 1) {
if (n == 0)
(void)fprintf(stderr, _("rcmd: %s: short read"),
*ahost);
else
(void)fprintf(stderr, "rcmd: %s: %m\n", *ahost);
goto bad2;
}
if (c != 0) {