diff options
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/rcmd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index 4aa3261133..96d6256760 100644 --- a/src/lib/libc/net/rcmd.c +++ b/src/lib/libc/net/rcmd.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #if defined(LIBC_SCCS) && !defined(lint) | 31 | #if defined(LIBC_SCCS) && !defined(lint) |
| 32 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.50 2005/03/07 20:00:15 deraadt Exp $"; | 32 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.51 2005/03/08 18:34:42 deraadt Exp $"; |
| 33 | #endif /* LIBC_SCCS and not lint */ | 33 | #endif /* LIBC_SCCS and not lint */ |
| 34 | 34 | ||
| 35 | #include <sys/param.h> | 35 | #include <sys/param.h> |
| @@ -244,6 +244,14 @@ again: | |||
| 244 | goto bad; | 244 | goto bad; |
| 245 | } | 245 | } |
| 246 | s3 = accept(s2, (struct sockaddr *)&from, &len); | 246 | s3 = accept(s2, (struct sockaddr *)&from, &len); |
| 247 | if (s3 < 0) { | ||
| 248 | (void)fprintf(stderr, | ||
| 249 | "rcmd: accept: %s\n", strerror(errno)); | ||
| 250 | lport = 0; | ||
| 251 | close(s2); | ||
| 252 | goto bad; | ||
| 253 | } | ||
| 254 | |||
| 247 | /* | 255 | /* |
| 248 | * XXX careful for ftp bounce attacks. If discovered, shut them | 256 | * XXX careful for ftp bounce attacks. If discovered, shut them |
| 249 | * down and check for the real auxiliary channel to connect. | 257 | * down and check for the real auxiliary channel to connect. |
| @@ -262,12 +270,7 @@ again: | |||
| 262 | break; | 270 | break; |
| 263 | } | 271 | } |
| 264 | (void)close(s2); | 272 | (void)close(s2); |
| 265 | if (s3 < 0) { | 273 | |
| 266 | (void)fprintf(stderr, | ||
| 267 | "rcmd: accept: %s\n", strerror(errno)); | ||
| 268 | lport = 0; | ||
| 269 | goto bad; | ||
| 270 | } | ||
| 271 | *fd2p = s3; | 274 | *fd2p = s3; |
| 272 | switch (from.ss_family) { | 275 | switch (from.ss_family) { |
| 273 | case AF_INET: | 276 | case AF_INET: |
