diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2001-08-19 20:43:57 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2001-08-19 20:43:57 +0000 |
commit | 11706319843cc6faee1a33f3e07576c5c79e207b (patch) | |
tree | 0a73656da63877458bd7b50bd6df90935a264357 /libexec/ftp-proxy | |
parent | 36d7b6426d2521627d611c17ead656bca1879742 (diff) |
unsmokecrack - thanks millert
Diffstat (limited to 'libexec/ftp-proxy')
-rw-r--r-- | libexec/ftp-proxy/ftp-proxy.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/libexec/ftp-proxy/ftp-proxy.c b/libexec/ftp-proxy/ftp-proxy.c index 528d8044bdf..94892483895 100644 --- a/libexec/ftp-proxy/ftp-proxy.c +++ b/libexec/ftp-proxy/ftp-proxy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp-proxy.c,v 1.10 2001/08/19 18:24:13 beck Exp $ */ +/* $OpenBSD: ftp-proxy.c,v 1.11 2001/08/19 20:43:56 beck Exp $ */ /* * Copyright (c) 1996-2001 @@ -185,35 +185,33 @@ check_host(struct sockaddr_in *client_sin, struct sockaddr_in *server_sin) client_sin, RQ_SERVER_SIN, server_sin, RQ_CLIENT_ADDR, inet_ntoa(client_sin->sin_addr), 0); - if (Use_Rdns) { + if (Use_Rdns) { /* * We already looked these up, but we have to do it again * for tcp wrapper, to ensure that we get the DNS name, since * the tcp wrapper cares about these things, and we don't * want to pass in a printed address as a name. */ - if (Use_Rdns) { - i = getnameinfo( - (struct sockaddr *) &client_sin->sin_addr, - sizeof(&client_sin->sin_addr), cname, - sizeof(cname), NULL, 0, NI_NAMEREQD); - if (i == -1) - strlcpy(cname, STRING_UNKNOWN, sizeof(cname)); - - i = getnameinfo( - (struct sockaddr *)&server_sin->sin_addr, - sizeof(&server_sin->sin_addr), sname, - sizeof(sname), NULL, 0, NI_NAMEREQD); - if (i == -1) - strlcpy(sname, STRING_UNKNOWN, sizeof(sname)); - } else { - /* - * ensure the TCP wrapper doesn't start doing - * reverse DNS lookups if we aren't supposed to. - */ + i = getnameinfo( + (struct sockaddr *) &client_sin->sin_addr, + sizeof(&client_sin->sin_addr), cname, + sizeof(cname), NULL, 0, NI_NAMEREQD); + if (i == -1) strlcpy(cname, STRING_UNKNOWN, sizeof(cname)); + + i = getnameinfo( + (struct sockaddr *)&server_sin->sin_addr, + sizeof(&server_sin->sin_addr), sname, + sizeof(sname), NULL, 0, NI_NAMEREQD); + if (i == -1) strlcpy(sname, STRING_UNKNOWN, sizeof(sname)); - } + } else { + /* + * ensure the TCP wrapper doesn't start doing + * reverse DNS lookups if we aren't supposed to. + */ + strlcpy(cname, STRING_UNKNOWN, sizeof(cname)); + strlcpy(sname, STRING_UNKNOWN, sizeof(sname)); } request_set(&request, RQ_SERVER_ADDR, inet_ntoa(server_sin->sin_addr), |